use of org.geotoolkit.ogc.xml.v100.BinaryComparisonOpType in project ddf by codice.
the class CswFilterFactory method createPropertyIsGreaterThan.
private JAXBElement<BinaryComparisonOpType> createPropertyIsGreaterThan(String propertyName, Object literal) {
BinaryComparisonOpType propertyIsGreaterThan = new BinaryComparisonOpType();
propertyIsGreaterThan.getExpression().add(createPropertyNameType(Arrays.asList(new Object[] { propertyName })));
propertyIsGreaterThan.getExpression().add(createLiteralType(literal));
return filterObjectFactory.createPropertyIsGreaterThan(propertyIsGreaterThan);
}
use of org.geotoolkit.ogc.xml.v100.BinaryComparisonOpType in project ddf by codice.
the class WfsFilterDelegate method createPropertyIsFilter.
private JAXBElement<? extends ComparisonOpsType> createPropertyIsFilter(String property, Object literal, PROPERTY_IS_OPS operation, boolean isCaseSensitive) {
switch(operation) {
case PropertyIsEqualTo:
JAXBElement<BinaryComparisonOpType> propIsEqualTo = filterObjectFactory.createPropertyIsEqualTo(new BinaryComparisonOpType());
propIsEqualTo.getValue().getExpression().add(createPropertyNameType(property));
propIsEqualTo.getValue().getExpression().add(createLiteralType(literal));
propIsEqualTo.getValue().setMatchCase(isCaseSensitive);
return propIsEqualTo;
case PropertyIsNotEqualTo:
JAXBElement<BinaryComparisonOpType> propIsNotEqualTo = filterObjectFactory.createPropertyIsNotEqualTo(new BinaryComparisonOpType());
propIsNotEqualTo.getValue().getExpression().add(createPropertyNameType(property));
propIsNotEqualTo.getValue().getExpression().add(createLiteralType(literal));
propIsNotEqualTo.getValue().setMatchCase(isCaseSensitive);
return propIsNotEqualTo;
case PropertyIsGreaterThan:
JAXBElement<BinaryComparisonOpType> propIsGreaterThan = filterObjectFactory.createPropertyIsGreaterThan(new BinaryComparisonOpType());
propIsGreaterThan.getValue().getExpression().add(createPropertyNameType(property));
propIsGreaterThan.getValue().getExpression().add(createLiteralType(literal));
propIsGreaterThan.getValue().setMatchCase(isCaseSensitive);
return propIsGreaterThan;
case PropertyIsGreaterThanOrEqualTo:
JAXBElement<BinaryComparisonOpType> propIsGreaterThanOrEqualTo = filterObjectFactory.createPropertyIsGreaterThanOrEqualTo(new BinaryComparisonOpType());
propIsGreaterThanOrEqualTo.getValue().getExpression().add(createPropertyNameType(property));
propIsGreaterThanOrEqualTo.getValue().getExpression().add(createLiteralType(literal));
propIsGreaterThanOrEqualTo.getValue().setMatchCase(isCaseSensitive);
return propIsGreaterThanOrEqualTo;
case PropertyIsLessThan:
JAXBElement<BinaryComparisonOpType> propIsLessThan = filterObjectFactory.createPropertyIsLessThan(new BinaryComparisonOpType());
propIsLessThan.getValue().getExpression().add(createPropertyNameType(property));
propIsLessThan.getValue().getExpression().add(createLiteralType(literal));
propIsLessThan.getValue().setMatchCase(isCaseSensitive);
return propIsLessThan;
case PropertyIsLessThanOrEqualTo:
JAXBElement<BinaryComparisonOpType> propIsLessThanOrEqualTo = filterObjectFactory.createPropertyIsLessThanOrEqualTo(new BinaryComparisonOpType());
propIsLessThanOrEqualTo.getValue().getExpression().add(createPropertyNameType(property));
propIsLessThanOrEqualTo.getValue().getExpression().add(createLiteralType(literal));
propIsLessThanOrEqualTo.getValue().setMatchCase(isCaseSensitive);
return propIsLessThanOrEqualTo;
case PropertyIsLike:
JAXBElement<PropertyIsLikeType> propIsLike = filterObjectFactory.createPropertyIsLike(new PropertyIsLikeType());
propIsLike.getValue().setPropertyName(createPropertyNameType(property).getValue());
propIsLike.getValue().setEscapeChar(escapeChar);
propIsLike.getValue().setSingleChar(singleChar);
propIsLike.getValue().setWildCard(wildcardChar);
final String literalReplaced = replaceSpecialPropertyIsLikeChars((String) literal);
propIsLike.getValue().setLiteral(createLiteralType(literalReplaced).getValue());
propIsLike.getValue().setMatchCase(isCaseSensitive);
return propIsLike;
default:
throw new UnsupportedOperationException("Unsupported Property Comparison Type");
}
}
use of org.geotoolkit.ogc.xml.v100.BinaryComparisonOpType in project ddf by codice.
the class CswQueryFactoryTest method testPostGetRecordsTemporalPropertyIsLessOgcFilter.
@Test
public void testPostGetRecordsTemporalPropertyIsLessOgcFilter() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
BinaryComparisonOpType op = createTemporalBinaryComparisonOpType(CswConstants.CSW_CREATED, TIMESTAMP);
ogcTemporalQuery(Core.CREATED, filterObjectFactory.createPropertyIsLessThan(op), Before.class);
}
use of org.geotoolkit.ogc.xml.v100.BinaryComparisonOpType in project ddf by codice.
the class CswQueryFactoryTest method testPostGetRecordsTemporalPropertyIsLessOrEqualOgcFilter.
@Ignore("TODO: the functions this test tests has been augmented to play well with the limited capabilities of the Solr provider. " + "These tests and the functions they test should be reenabled and refactored after DDF-311 is addressed")
@Test
public void testPostGetRecordsTemporalPropertyIsLessOrEqualOgcFilter() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
BinaryComparisonOpType op = createTemporalBinaryComparisonOpType(CswConstants.CSW_CREATED, TIMESTAMP);
ogcOrdTemporalQuery(filterObjectFactory.createPropertyIsLessThanOrEqualTo(op));
}
use of org.geotoolkit.ogc.xml.v100.BinaryComparisonOpType in project ddf by codice.
the class CswQueryFactoryTest method createTemporalBinaryComparisonOpType.
private BinaryComparisonOpType createTemporalBinaryComparisonOpType(String attr, String comparison) {
BinaryComparisonOpType comparisonOp = new BinaryComparisonOpType();
PropertyNameType propName = new PropertyNameType();
propName.getContent().add(attr);
comparisonOp.getExpression().add(filterObjectFactory.createPropertyName(propName));
LiteralType literal = new LiteralType();
literal.getContent().add(comparison);
comparisonOp.getExpression().add(filterObjectFactory.createLiteral(literal));
return comparisonOp;
}
Aggregations