use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestCswFilterDelegate method testConfigurableMetacardMapping.
@Test
public void testConfigurableMetacardMapping() throws JAXBException, SAXException, IOException {
// Setup
CswSourceConfiguration cswSourceConfiguration = new CswSourceConfiguration();
cswSourceConfiguration.putMetacardCswMapping(Core.ID, CswConstants.CSW_IDENTIFIER);
cswSourceConfiguration.putMetacardCswMapping(Core.MODIFIED, CswConstants.CSW_MODIFIED);
cswSourceConfiguration.putMetacardCswMapping(Core.CREATED, CswConstants.CSW_CREATED);
cswSourceConfiguration.putMetacardCswMapping(Metacard.EFFECTIVE, CswConstants.CSW_DATE_SUBMITTED);
cswSourceConfiguration.putMetacardCswMapping(Metacard.CONTENT_TYPE, CswConstants.CSW_FORMAT);
cswSourceConfiguration.setCswAxisOrder(CswAxisOrder.LAT_LON);
cswSourceConfiguration.setUsePosList(false);
String contentType = "myContentType";
CswFilterDelegate localCswFilterDelegate = createCswFilterDelegate(cswSourceConfiguration);
// Perform Test
/**
* Incoming query with Metacard.CONTENT_TYPE equal to myContentType. Metacard.CONTENT_TYPE
* will be mapped to format in the CswFilterDelegate.
*/
FilterType filterType = localCswFilterDelegate.propertyIsEqualTo(Metacard.CONTENT_TYPE, contentType, isCaseSensitive);
// Verify
/**
* Verify that a PropertyIsEqualTo filter is created with PropertyName of format and Literal
* equal to myContentType
*/
assertXMLEqual(configurableContentTypeMappingXml, getXmlFromMarshaller(filterType));
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestCswFilterDelegate method getXmlProperty.
private String getXmlProperty(CswFilterDelegate localCswFilterDelegate, String propName, ComparisonOperatorType comparisonOp, Date beginDate, Date endDate, Map<String, Object> propMap) throws JAXBException {
String extendedComparisonOp = null;
if (null != propMap) {
extendedComparisonOp = (String) propMap.get("extendedComparisonOp");
}
FilterType filterType = null;
switch(comparisonOp) {
case BETWEEN:
if (!StringUtils.isBlank(extendedComparisonOp) && extendedComparisonOp.equals("relative")) {
Object duration = propMap.get("duration");
if (duration instanceof Long) {
filterType = localCswFilterDelegate.relative(propName, ((Long) duration).longValue());
}
} else {
filterType = localCswFilterDelegate.during(propName, beginDate, endDate);
}
break;
default:
break;
}
marshaller.marshal(getFilterTypeJaxbElement(filterType), writer);
String xml = writer.toString();
LOGGER.debug(xml);
return xml;
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestCswFilterDelegate method testPropertyLikeAnyText.
@Test
public void testPropertyLikeAnyText() throws JAXBException, SAXException, IOException {
FilterType filterType = cswFilterDelegateLatLon.propertyIsLike(propertyNameAnyText, likeLiteral, isCaseSensitive);
assertXMLEqual(propertyIsLikeXmlAnyText, getXmlFromMarshaller(filterType));
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestCswFilterDelegate method testPropertyIsLessThanFloatLiteral.
@Test
public void testPropertyIsLessThanFloatLiteral() throws JAXBException, SAXException, IOException {
FilterType filterType = cswFilterDelegateLatLon.propertyIsLessThan(propertyName, floatLiteral);
assertXMLEqual(propertyIsLessThanXmlWithDecimal, getXmlFromMarshaller(filterType));
}
use of net.opengis.filter.v_2_0_0.FilterType in project ddf by codice.
the class TestCswFilterDelegate method testPropertyIsLessThanOrEqualToStringLiteralAnyText.
@Test
public void testPropertyIsLessThanOrEqualToStringLiteralAnyText() throws JAXBException, SAXException, IOException {
FilterType filterType = cswFilterDelegateLatLon.propertyIsLessThanOrEqualTo(propertyNameAnyText, stringLiteral);
assertXMLEqual(propertyIsLessThanOrEqualToXmlAnyText, getXmlFromMarshaller(filterType));
}
Aggregations