Search in sources :

Example 1 with PropertyNameType

use of org.geotoolkit.ogc.xml.v100.PropertyNameType in project ddf by codice.

the class WfsFilterDelegate method createPropertyNameType.

private JAXBElement<PropertyNameType> createPropertyNameType(String propertyNameValue) {
    JAXBElement<PropertyNameType> propertyNameType = filterObjectFactory.createPropertyName(new PropertyNameType());
    propertyNameType.getValue().setContent(propertyNameValue);
    return propertyNameType;
}
Also used : PropertyNameType(ogc.schema.opengis.filter.v_1_0_0.PropertyNameType)

Example 2 with PropertyNameType

use of org.geotoolkit.ogc.xml.v100.PropertyNameType in project ddf by codice.

the class CswQueryFactoryTest method createDistanceBufferType.

private DistanceBufferType createDistanceBufferType() {
    DistanceBufferType distanceBuffer = new DistanceBufferType();
    PropertyNameType propName = new PropertyNameType();
    propName.getContent().add(SPATIAL_TEST_ATTRIBUTE);
    distanceBuffer.setPropertyName(propName);
    DistanceType distance = filterObjectFactory.createDistanceType();
    distance.setUnits(REL_GEO_UNITS);
    distance.setValue(REL_GEO_DISTANCE);
    distanceBuffer.setDistance(distance);
    distanceBuffer.setGeometry(createPolygon());
    return distanceBuffer;
}
Also used : DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType) DistanceType(net.opengis.filter.v_1_1_0.DistanceType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 3 with PropertyNameType

use of org.geotoolkit.ogc.xml.v100.PropertyNameType in project ddf by codice.

the class CswFilterFactory method createPropertyNameType.

private PropertyNameType createPropertyNameType(String propertyName) {
    PropertyNameType propertyNameType = new PropertyNameType();
    propertyNameType.setContent(Arrays.asList(new Object[] { propertyName }));
    return propertyNameType;
}
Also used : PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 4 with PropertyNameType

use of org.geotoolkit.ogc.xml.v100.PropertyNameType in project ddf by codice.

the class AbstractCswSource method createSortBy.

private SortByType createSortBy(QueryRequest queryRequest) {
    Query query = queryRequest.getQuery();
    SortByType cswSortBy = null;
    if (query != null && query.getSortBy() != null && query.getSortBy().getPropertyName() != null) {
        List<SortBy> sortBys = new ArrayList<>();
        sortBys.add(query.getSortBy());
        Serializable extSortBySer = queryRequest.getPropertyValue(ADDITIONAL_SORT_BYS);
        if (extSortBySer instanceof SortBy[]) {
            SortBy[] extSortBys = (SortBy[]) extSortBySer;
            if (extSortBys.length > 0) {
                sortBys.addAll(Arrays.asList(extSortBys));
            }
        }
        for (SortBy sortBy : sortBys) {
            SortPropertyType sortProperty = new SortPropertyType();
            PropertyNameType propertyName = new PropertyNameType();
            if (sortBy.getPropertyName() != null) {
                String propName = sortBy.getPropertyName().getPropertyName();
                if (propName != null) {
                    if (Result.TEMPORAL.equals(propName) || Metacard.ANY_DATE.equals(propName)) {
                        propName = Core.MODIFIED;
                    } else if (Result.RELEVANCE.equals(propName) || Metacard.ANY_TEXT.equals(propName)) {
                        propName = Core.TITLE;
                    } else if (Result.DISTANCE.equals(propName) || Metacard.ANY_GEO.equals(propName)) {
                        continue;
                    }
                    if (cswSortBy == null) {
                        cswSortBy = new SortByType();
                    }
                    propertyName.setContent(Arrays.asList((Object) cswFilterDelegate.mapPropertyName(propName)));
                    sortProperty.setPropertyName(propertyName);
                    if (SortOrder.DESCENDING.equals(query.getSortBy().getSortOrder())) {
                        sortProperty.setSortOrder(SortOrderType.DESC);
                    } else {
                        sortProperty.setSortOrder(SortOrderType.ASC);
                    }
                    cswSortBy.getSortProperty().add(sortProperty);
                }
            }
        }
    } else {
        return null;
    }
    return cswSortBy;
}
Also used : Serializable(java.io.Serializable) Query(ddf.catalog.operation.Query) SortBy(org.opengis.filter.sort.SortBy) ArrayList(java.util.ArrayList) SortPropertyType(net.opengis.filter.v_1_1_0.SortPropertyType) SortByType(net.opengis.filter.v_1_1_0.SortByType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 5 with PropertyNameType

use of org.geotoolkit.ogc.xml.v100.PropertyNameType 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)

Aggregations

PropertyNameType (org.geotoolkit.ogc.xml.v110.PropertyNameType)62 JAXBElement (javax.xml.bind.JAXBElement)46 LiteralType (org.geotoolkit.ogc.xml.v110.LiteralType)38 Test (org.junit.Test)38 Unmarshaller (javax.xml.bind.Unmarshaller)37 Marshaller (javax.xml.bind.Marshaller)36 ValueReference (org.opengis.filter.ValueReference)36 Literal (org.opengis.filter.Literal)30 Filter (org.opengis.filter.Filter)26 PropertyNameType (org.geotoolkit.ogc.xml.v100.PropertyNameType)20 BinaryComparisonOperator (org.opengis.filter.BinaryComparisonOperator)20 LiteralType (org.geotoolkit.ogc.xml.v100.LiteralType)16 FilterType (org.geotoolkit.ogc.xml.v110.FilterType)16 PropertyNameType (net.opengis.filter.v_1_1_0.PropertyNameType)13 FilterType (org.geotoolkit.ogc.xml.v100.FilterType)12 Expression (org.opengis.filter.Expression)12 ComparisonOpsType (org.geotoolkit.ogc.xml.v100.ComparisonOpsType)10 BinaryComparisonOpType (org.geotoolkit.ogc.xml.v100.BinaryComparisonOpType)9 BinaryComparisonOpType (org.geotoolkit.ogc.xml.v110.BinaryComparisonOpType)9 ComparisonOpsType (org.geotoolkit.ogc.xml.v110.ComparisonOpsType)9