// to collect and return feedback about erroneous use of filter
// expressions
String message = new String("");
StrTokenizer tokenizer = new StrTokenizer(inFilter, ' ', '\"');
// conjunctions collecting conditions
Conjunction conjWorkPiece = null;
Conjunction conjProjects = null;
Conjunction conjSteps = null;
Conjunction conjProcesses = null;
Conjunction conjTemplates = null;
Conjunction conjUsers = null;
Conjunction conjStepProperties = null;
Conjunction conjProcessProperties = null;
// this is needed if we filter processes
if (flagProcesses) {
conjProjects = Restrictions.conjunction();
limitToUserAccessRights(conjProjects);
// in case nothing is set here it needs to be removed again
// happens if user has admin rights
if (conjProjects.toString().equals("()")) {
conjProjects = null;
flagSetCritProjects = true;
}
}
// this is needed if we filter steps
if (flagSteps) {
conjSteps = Restrictions.conjunction();
limitToUserAssignedSteps(conjSteps, stepOpenOnly, userAssignedStepsOnly);
// in case nothing is set here conjunction needs to be set to null
// again
if (conjSteps.toString().equals("()")) {
conjSteps = null;
}
}
// this is needed for the template filter (true) and the undefined
// processes filter (false) in any other case it needs to be null
if (isTemplate != null) {
conjProcesses = Restrictions.conjunction();
if (!isTemplate) {
conjProcesses.add(Restrictions.eq("istTemplate", Boolean.valueOf(false)));
} else {
conjProcesses.add(Restrictions.eq("istTemplate", Boolean.valueOf(true)));
}
}
// this is needed for evaluating a filter string
while (tokenizer.hasNext()) {
String tok = tokenizer.nextToken().trim();
if (tok.toLowerCase().startsWith(FilterString.PROCESSPROPERTY) || tok.toLowerCase().startsWith(FilterString.PROZESSEIGENSCHAFT)) {
if (conjProcessProperties == null) {
conjProcessProperties = Restrictions.conjunction();
}