Search in sources :

Example 1 with BinaryComparisonOpType

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);
}
Also used : BinaryComparisonOpType(net.opengis.filter.v_1_1_0.BinaryComparisonOpType)

Example 2 with BinaryComparisonOpType

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;
}
Also used : LiteralType(net.opengis.filter.v_1_1_0.LiteralType) BinaryComparisonOpType(net.opengis.filter.v_1_1_0.BinaryComparisonOpType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 3 with BinaryComparisonOpType

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));
}
Also used : BinaryComparisonOpType(net.opengis.filter.v_1_1_0.BinaryComparisonOpType) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 4 with BinaryComparisonOpType

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);
}
Also used : BinaryComparisonOpType(net.opengis.filter.v_1_1_0.BinaryComparisonOpType) Test(org.junit.Test)

Example 5 with BinaryComparisonOpType

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");
    }
}
Also used : BinaryComparisonOpType(net.opengis.filter.v_2_0_0.BinaryComparisonOpType) PropertyIsLikeType(net.opengis.filter.v_2_0_0.PropertyIsLikeType)

Aggregations

BinaryComparisonOpType (net.opengis.filter.v_1_1_0.BinaryComparisonOpType)11 Test (org.junit.Test)5 Ignore (org.junit.Ignore)3 BinaryComparisonOpType (net.opengis.fes.x20.BinaryComparisonOpType)1 FilterDocument (net.opengis.fes.x20.FilterDocument)1 FilterType (net.opengis.fes.x20.FilterType)1 LiteralType (net.opengis.fes.x20.LiteralType)1 PropertyIsEqualToDocument (net.opengis.fes.x20.PropertyIsEqualToDocument)1 LiteralType (net.opengis.filter.v_1_1_0.LiteralType)1 PropertyNameType (net.opengis.filter.v_1_1_0.PropertyNameType)1 BinaryComparisonOpType (net.opengis.filter.v_2_0_0.BinaryComparisonOpType)1 PropertyIsLikeType (net.opengis.filter.v_2_0_0.PropertyIsLikeType)1 BinaryComparisonOpType (ogc.schema.opengis.filter.v_1_0_0.BinaryComparisonOpType)1 PropertyIsLikeType (ogc.schema.opengis.filter.v_1_0_0.PropertyIsLikeType)1 XmlString (org.apache.xmlbeans.XmlString)1 ComparisonFilter (org.n52.shetland.ogc.filter.ComparisonFilter)1