use of net.opengis.fes.x20.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 net.opengis.fes.x20.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;
}
use of net.opengis.fes.x20.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 net.opengis.fes.x20.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 net.opengis.fes.x20.BinaryComparisonOpType in project ddf by codice.
the class WfsFilterDelegate method createPropertyIsFilter.
private JAXBElement<? extends ComparisonOpsType> createPropertyIsFilter(String property, Object literal, PROPERTY_IS_OPS operation) {
switch(operation) {
case PropertyIsEqualTo:
JAXBElement<BinaryComparisonOpType> propIsEqualTo = filterObjectFactory.createPropertyIsEqualTo(new BinaryComparisonOpType());
propIsEqualTo.getValue().getExpression().add(createPropertyNameType(property));
propIsEqualTo.getValue().getExpression().add(createLiteralType(literal));
return propIsEqualTo;
case PropertyIsNotEqualTo:
JAXBElement<BinaryComparisonOpType> propIsNotEqualTo = filterObjectFactory.createPropertyIsNotEqualTo(new BinaryComparisonOpType());
propIsNotEqualTo.getValue().getExpression().add(createPropertyNameType(property));
propIsNotEqualTo.getValue().getExpression().add(createLiteralType(literal));
return propIsNotEqualTo;
case PropertyIsGreaterThan:
JAXBElement<BinaryComparisonOpType> propIsGreaterThan = filterObjectFactory.createPropertyIsGreaterThan(new BinaryComparisonOpType());
propIsGreaterThan.getValue().getExpression().add(createPropertyNameType(property));
propIsGreaterThan.getValue().getExpression().add(createLiteralType(literal));
return propIsGreaterThan;
case PropertyIsGreaterThanOrEqualTo:
JAXBElement<BinaryComparisonOpType> propIsGreaterThanOrEqualTo = filterObjectFactory.createPropertyIsGreaterThanOrEqualTo(new BinaryComparisonOpType());
propIsGreaterThanOrEqualTo.getValue().getExpression().add(createPropertyNameType(property));
propIsGreaterThanOrEqualTo.getValue().getExpression().add(createLiteralType(literal));
return propIsGreaterThanOrEqualTo;
case PropertyIsLessThan:
JAXBElement<BinaryComparisonOpType> propIsLessThan = filterObjectFactory.createPropertyIsLessThan(new BinaryComparisonOpType());
propIsLessThan.getValue().getExpression().add(createPropertyNameType(property));
propIsLessThan.getValue().getExpression().add(createLiteralType(literal));
return propIsLessThan;
case PropertyIsLessThanOrEqualTo:
JAXBElement<BinaryComparisonOpType> propIsLessThanOrEqualTo = filterObjectFactory.createPropertyIsLessThanOrEqualTo(new BinaryComparisonOpType());
propIsLessThanOrEqualTo.getValue().getExpression().add(createPropertyNameType(property));
propIsLessThanOrEqualTo.getValue().getExpression().add(createLiteralType(literal));
return propIsLessThanOrEqualTo;
case PropertyIsLike:
JAXBElement<PropertyIsLikeType> propIsLike = filterObjectFactory.createPropertyIsLike(new PropertyIsLikeType());
propIsLike.getValue().setEscapeChar(Wfs20Constants.ESCAPE);
propIsLike.getValue().setSingleChar(SINGLE_CHAR);
propIsLike.getValue().setWildCard(Wfs20Constants.WILD_CARD);
propIsLike.getValue().getExpression().add(createLiteralType(literal));
propIsLike.getValue().getExpression().add(createPropertyNameType(property));
return propIsLike;
default:
throw new UnsupportedOperationException("Unsupported Property Comparison Type");
}
}
Aggregations