use of net.opengis.fes.x20.BinaryComparisonOpType in project ddf by codice.
the class CswQueryFactoryTest method testPostGetRecordsTemporalPropertyIsGreaterOrEqualOgcFilter.
@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 testPostGetRecordsTemporalPropertyIsGreaterOrEqualOgcFilter() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
BinaryComparisonOpType op = createTemporalBinaryComparisonOpType(CswConstants.CSW_CREATED, TIMESTAMP);
ogcOrdTemporalQuery(filterObjectFactory.createPropertyIsGreaterThanOrEqualTo(op));
}
use of net.opengis.fes.x20.BinaryComparisonOpType in project ddf by codice.
the class CswQueryFactoryTest method testPostGetRecordsTemporalPropertyIsGreaterOgcFilter.
@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 testPostGetRecordsTemporalPropertyIsGreaterOgcFilter() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
BinaryComparisonOpType op = createTemporalBinaryComparisonOpType(CswConstants.CSW_CREATED, TIMESTAMP);
ogcTemporalQuery(Core.CREATED, filterObjectFactory.createPropertyIsGreaterThan(op), After.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().setPropertyName(createPropertyNameType(property).getValue());
propIsLike.getValue().setEscape(WfsConstants.ESCAPE);
propIsLike.getValue().setSingleChar(SINGLE_CHAR);
propIsLike.getValue().setWildCard(WfsConstants.WILD_CARD);
propIsLike.getValue().setLiteral(createLiteralType(literal).getValue());
return propIsLike;
default:
throw new UnsupportedOperationException("Unsupported Property Comparison Type");
}
}
use of net.opengis.fes.x20.BinaryComparisonOpType in project arctic-sea by 52North.
the class FesDecoderV20Test method should_parse_PropertyIsEqualTo_Filter.
/**
* Test PropertyIsEqualTo filter decoding
*
* @throws OwsExceptionReport
*/
@Test
public void should_parse_PropertyIsEqualTo_Filter() throws DecodingException {
PropertyIsEqualToDocument propertyIsEqualToDoc = PropertyIsEqualToDocument.Factory.newInstance();
BinaryComparisonOpType propertyIsEqualToType = propertyIsEqualToDoc.addNewPropertyIsEqualTo();
// valueReference
XmlString valueReference = (XmlString) propertyIsEqualToType.addNewExpression().substitute(FilterConstants.QN_VALUE_REFERENCE, XmlString.type);
valueReference.setStringValue(TEST_VALUE_REFERENCE);
// literal
LiteralType literalType = (LiteralType) propertyIsEqualToType.addNewExpression().substitute(FilterConstants.QN_LITERAL, LiteralType.type);
XmlString newInstance = XmlString.Factory.newInstance();
newInstance.setStringValue(TEST_LITERAL);
literalType.set(newInstance);
// create document
FilterDocument filterDoc = FilterDocument.Factory.newInstance();
FilterType filterType = filterDoc.addNewFilter();
filterType.setComparisonOps(propertyIsEqualToType);
filterType.getComparisonOps().substitute(FilterConstants.QN_PROPERTY_IS_EQUAL_TO, BinaryComparisonOpType.type);
ComparisonFilter comparisonFilter = (ComparisonFilter) decoder.decode(filterDoc);
// test
assertThat(comparisonFilter.getOperator(), is(FilterConstants.ComparisonOperator.PropertyIsEqualTo));
assertThat(comparisonFilter.getValueReference(), is(TEST_VALUE_REFERENCE));
assertThat(comparisonFilter.getValue(), is(TEST_LITERAL));
}
Aggregations