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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations