Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmason committed Nov 23, 2012
1 parent a729de1 commit 6d3d0c9
Showing 1 changed file with 9 additions and 8 deletions.
Expand Up @@ -173,19 +173,20 @@ private List<HTextFlow> findTextFlowsWithDatabaseSearch(String projectSlug, Stri
// source strings, because there may not be HTextFlowTarget for the
// HTextFlow.

// FIXME constrain to only non-obsolete documents
// FIXME constrain to only non-obsolete documents?
// check that this is not already handled by id list retrieval

HLocale loc = localeServiceImpl.getByLocaleId(validatedLocaleId);
Long locId = loc.getId();

ArrayList<String> projectDpcStateConstraints = new ArrayList<String>();
projectDpcStateConstraints.add("tf.document.projectIteration.project.slug = :project");
projectDpcStateConstraints.add("tf.document.projectIteration.slug = :iteration");
ArrayList<String> projectDocStateConstraints = new ArrayList<String>();
projectDocStateConstraints.add("tf.document.projectIteration.project.slug = :project");
projectDocStateConstraints.add("tf.document.projectIteration.slug = :iteration");

boolean hasDocumentPaths = documentPaths != null && !documentPaths.isEmpty();
if (hasDocumentPaths)
{
projectDpcStateConstraints.add("tf.document.docId in ( :doclist )");
projectDocStateConstraints.add("tf.document.docId in ( :doclist )");
}

ArrayList<ContentState> stateList = new ArrayList<ContentState>(2);
Expand All @@ -197,7 +198,7 @@ private List<HTextFlow> findTextFlowsWithDatabaseSearch(String projectSlug, Stri
if (constraints.isIncludeNew())
{
// exclude non-matching states (so that flows with no target will match)
projectDpcStateConstraints.add("tf.targets[" + locId + "].state not in ( :statelist )");
projectDocStateConstraints.add("tf.targets[" + locId + "].state not in ( :statelist )");
if (!constraints.isIncludeFuzzy())
{
stateList.add(ContentState.NeedReview);
Expand All @@ -210,7 +211,7 @@ private List<HTextFlow> findTextFlowsWithDatabaseSearch(String projectSlug, Stri
else
{
// include matching states (so that flows with no target will not match)
projectDpcStateConstraints.add("tf.targets[" + locId + "].state in ( :statelist )");
projectDocStateConstraints.add("tf.targets[" + locId + "].state in ( :statelist )");
if (constraints.isIncludeFuzzy())
{
stateList.add(ContentState.NeedReview);
Expand Down Expand Up @@ -240,7 +241,7 @@ private List<HTextFlow> findTextFlowsWithDatabaseSearch(String projectSlug, Stri
}

String[] contentChecks = contentCheckList.toArray(new String[contentCheckList.size()]);
String[] projectDocStateChecks = projectDpcStateConstraints.toArray(new String[projectDpcStateConstraints.size()]);
String[] projectDocStateChecks = projectDocStateConstraints.toArray(new String[projectDocStateConstraints.size()]);

String queryStr = select("tf").from("HTextFlow tf")
.where(and(and(projectDocStateChecks), or(contentChecks)))
Expand Down

0 comments on commit 6d3d0c9

Please sign in to comment.