use of org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType in project ddf by codice.
the class WfsSource method createFeatureMetacardTypeRegistration.
private MetacardTypeRegistration createFeatureMetacardTypeRegistration(FeatureTypeType featureTypeType, String ftName, XmlSchema schema) {
FeatureMetacardType ftMetacard = new FeatureMetacardType(schema, featureTypeType.getName(), nonQueryableProperties != null ? Arrays.asList(nonQueryableProperties) : new ArrayList<String>(), Wfs20Constants.GML_3_2_NAMESPACE);
Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put(Metacard.CONTENT_TYPE, new String[] { ftName });
LOGGER.debug("WfsSource {}: Registering MetacardType: {}", getId(), ftName);
return new MetacardTypeRegistration(ftMetacard, props, featureTypeType.getDefaultCRS());
}
use of org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType in project ddf by codice.
the class FeatureMetacardTypeTest method testfeatureMetacardTypeFindSingleGmlProperty.
@Test
public void testfeatureMetacardTypeFindSingleGmlProperty() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement gmlElement = new XmlSchemaElement(schema, true);
gmlElement.setSchemaType(new XmlSchemaComplexType(schema, false));
gmlElement.setSchemaTypeName(new QName(Wfs20Constants.GML_3_2_NAMESPACE, GML));
gmlElement.setName(ELEMENT_NAME_1);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs20Constants.GML_3_2_NAMESPACE);
assertTrue(featureMetacardType.getGmlProperties().size() == 1);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.GEO_TYPE);
}
use of org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType in project ddf by codice.
the class FeatureMetacardTypeTest method testFeatureMetacardTypeSingleStringProperty.
@Test
public void testFeatureMetacardTypeSingleStringProperty() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement stringElement = new XmlSchemaElement(schema, true);
stringElement.setSchemaType(new XmlSchemaSimpleType(schema, false));
stringElement.setSchemaTypeName(Constants.XSD_STRING);
stringElement.setName(ELEMENT_NAME_1);
schema.getElements().put(new QName(ELEMENT_NAME_1), stringElement);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs20Constants.GML_3_2_NAMESPACE);
assertTrue(featureMetacardType.getTextualProperties().size() == 1);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.STRING_TYPE);
}
use of org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType in project ddf by codice.
the class FeatureMetacardTypeTest method testFeatureMetacardTypeStringAndGmlProperties.
@Test
public void testFeatureMetacardTypeStringAndGmlProperties() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement stringElement = new XmlSchemaElement(schema, true);
stringElement.setSchemaType(new XmlSchemaSimpleType(schema, false));
stringElement.setSchemaTypeName(Constants.XSD_STRING);
stringElement.setName(ELEMENT_NAME_1);
XmlSchemaElement gmlElement = new XmlSchemaElement(schema, true);
gmlElement.setSchemaType(new XmlSchemaComplexType(schema, false));
gmlElement.setSchemaTypeName(new QName(Wfs20Constants.GML_3_2_NAMESPACE, GML));
gmlElement.setName(ELEMENT_NAME_2);
schema.getElements().put(new QName(ELEMENT_NAME_1), stringElement);
schema.getElements().put(new QName(ELEMENT_NAME_2), gmlElement);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs20Constants.GML_3_2_NAMESPACE);
assertTrue(featureMetacardType.getTextualProperties().size() == 1);
assertTrue(featureMetacardType.getGmlProperties().size() == 1);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.STRING_TYPE);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_2, BasicTypes.GEO_TYPE);
}
use of org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureMetacardType in project ddf by codice.
the class FeatureMetacardTypeTest method testfeatureMetacardTypeFindDoubleProperties.
@Test
public void testfeatureMetacardTypeFindDoubleProperties() {
XmlSchema schema = new XmlSchema();
XmlSchemaElement doubleElement = new XmlSchemaElement(schema, true);
doubleElement.setSchemaType(new XmlSchemaSimpleType(schema, false));
doubleElement.setSchemaTypeName(Constants.XSD_DOUBLE);
doubleElement.setName(ELEMENT_NAME_1);
schema.getElements().put(new QName(ELEMENT_NAME_1), doubleElement);
FeatureMetacardType featureMetacardType = new FeatureMetacardType(schema, FEATURE_TYPE, NON_QUERYABLE_PROPS, Wfs20Constants.GML_3_2_NAMESPACE);
assertAttributeDescriptor(featureMetacardType, ELEMENT_NAME_1, BasicTypes.DOUBLE_TYPE);
}
Aggregations