/** * A {@link FieldSearchQuery} may be made from a terms string or a query * string, but not both. */ private FieldSearchQuery assembleFieldSearchQuery(String query, String terms) { if (terms != null) { return new FieldSearchQuery(terms); } else { try { return new FieldSearchQuery(Condition.getConditions(query)); } catch (QueryParseException e) { throw new ValidatorProcessUsageException("Value '" + query + "' of parameter '" + PARAMETER_QUERY + "' is not a valid query string."); } } }
/** * Convert a local {@link Condition} into a WSDL-style * {@link org.fcrepo.server.types.gen.Condition Condition}. */ public static org.fcrepo.server.types.gen.Condition convertConditionToGenCondition(Condition condition) { String opAbbr = condition.getOperator().getAbbreviation(); ComparisonOperator compOperator; try { compOperator = ComparisonOperator.fromValue(opAbbr); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("unrecognized comparison operator string: '" + opAbbr + "'"); } org.fcrepo.server.types.gen.Condition cond = new org.fcrepo.server.types.gen.Condition(); cond.setProperty(condition.getProperty()); cond.setOperator(compOperator); cond.setValue(condition.getValue()); return cond; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null) { return false; } if (!o.getClass().equals(this.getClass())) { return false; } Condition that = (Condition) o; return equivalent(m_property, that.m_property) && equivalent(m_value, that.m_value) && equivalent(m_operator, that.m_operator); }
maxResults, new FieldSearchQuery(Condition .getConditions(query)));
whereClause.append(" AND"); String op = cond.getOperator().getSymbol(); String prop = cond.getProperty(); if (prop.toLowerCase().endsWith("date")) { toSql("doFields.dcDate", cond.getValue()); if (sqlPart.startsWith(" ")) { needsEscape = true; dt = DateUtility.parseDateStrict(cond.getValue()); } catch (ParseException e) { throw new QueryParseException("When using " toSql("doFields." + prop, cond.getValue()); if (sqlPart.indexOf("LIKE ") != -1) { throw new QueryParseException("The = " toSql("doFields." + prop, cond.getValue()); if (sqlPart.startsWith(" ")) { needsEscape = true;
public static List<Condition> convertGenConditionArrayToSearchConditionList(org.fcrepo.server.types.gen.FieldSearchQuery.Conditions genConditions) throws org.fcrepo.server.errors.InvalidOperatorException, org.fcrepo.server.errors.QueryParseException { if (genConditions == null) { return null; } ArrayList<Condition> list = new ArrayList<Condition>(); if (genConditions != null && genConditions.getCondition() != null) { for (org.fcrepo.server.types.gen.Condition c : genConditions .getCondition()) { list.add(new org.fcrepo.server.search.Condition(c.getProperty(), c.getOperator() != null ? c .getOperator() .value() : null, c.getValue())); } } return list; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null) { return false; } if (!o.getClass().equals(this.getClass())) { return false; } Condition that = (Condition) o; return equivalent(m_property, that.m_property) && equivalent(m_value, that.m_value) && equivalent(m_operator, that.m_operator); }
maxResults, new FieldSearchQuery(Condition .getConditions(query)));
whereClause.append(" AND"); String op = cond.getOperator().getSymbol(); String prop = cond.getProperty(); if (prop.toLowerCase().endsWith("date")) { toSql("doFields.dcDate", cond.getValue()); if (sqlPart.startsWith(" ")) { needsEscape = true; dt = DateUtility.parseDateStrict(cond.getValue()); } catch (ParseException e) { throw new QueryParseException("When using " toSql("doFields." + prop, cond.getValue()); if (sqlPart.indexOf("LIKE ") != -1) { throw new QueryParseException("The = " toSql("doFields." + prop, cond.getValue()); if (sqlPart.startsWith(" ")) { needsEscape = true;
public static List<Condition> convertGenConditionArrayToSearchConditionList(org.fcrepo.server.types.gen.FieldSearchQuery.Conditions genConditions) throws org.fcrepo.server.errors.InvalidOperatorException, org.fcrepo.server.errors.QueryParseException { if (genConditions == null) { return null; } ArrayList<Condition> list = new ArrayList<Condition>(); if (genConditions != null && genConditions.getCondition() != null) { for (org.fcrepo.server.types.gen.Condition c : genConditions .getCondition()) { list.add(new org.fcrepo.server.search.Condition(c.getProperty(), c.getOperator() != null ? c .getOperator() .value() : null, c.getValue())); } } return list; }
1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "' dcmDate>'2000-01-01'"))) 1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "'"))) .objectFieldsList();
result = m_access.findObjects(context, wantedFields, maxResults, new FieldSearchQuery(terms)); } else { result = m_access.findObjects(context, wantedFields, maxResults, new FieldSearchQuery(Condition.getConditions(query)));
result = m_access.findObjects(context, wantedFields, maxResults, new FieldSearchQuery(terms)); } else { result = m_access.findObjects(context, wantedFields, maxResults, new FieldSearchQuery(Condition.getConditions(query)));
1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "' dcmDate>'2000-01-01'"))) 1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "'"))) .objectFieldsList();
100, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "' dcmDate>'2000-01-01'"))) 1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "'"))) .objectFieldsList();
100, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "' dcmDate>'2000-01-01'"))) 1, new FieldSearchQuery(Condition .getConditions("pid='" + pid + "'"))) .objectFieldsList();
(int) getMaxHeaders(), new FieldSearchQuery(Condition .getConditions("dcmDate>'2000-01-01'" + getDatePart(from, until))));
(int) getMaxRecords(), new FieldSearchQuery(Condition .getConditions("dcmDate>'2000-01-01'" + getDatePart(from, until))));