PropertyName extendProperty( PropertyName expression, FilterFactory2 filterFactory, NamespaceSupport nss) { String path = expression.getPropertyName(); if (nss != null) { QName name = resolver.parseQName(path, nss); String uri = name.getNamespaceURI(); if (uri != null && !"".equals(uri)) { if (DC.NAMESPACE.equals(uri) || DCT.NAMESPACE.equals(uri)) { path = path + "/dc:value"; } } else { AttributeDescriptor descriptor = CSWRecordDescriptor.getDescriptor(path); if (descriptor != null) { if (DC.NAMESPACE.equals(descriptor.getName().getNamespaceURI())) { path = "dc:" + path + "/dc:value"; nss = CSWRecordDescriptor.NAMESPACES; } else if (DCT.NAMESPACE.equals(descriptor.getName().getNamespaceURI())) { path = "dct:" + path + "/dc:value"; nss = CSWRecordDescriptor.NAMESPACES; } } } } return filterFactory.property(path, nss); } }
private void assertRecordElement(Feature f, String elementName, Object... values) { AttributeDescriptor identifierDescriptor = CSWRecordDescriptor.getDescriptor(elementName); Collection<Property> propertyList = f.getProperties(identifierDescriptor.getName()); Property[] properties = (Property[]) propertyList.toArray(new Property[propertyList.size()]); assertEquals(properties.length, values.length); for (int i = 0; i < properties.length; i++) { ComplexAttribute cad = (ComplexAttribute) properties[i]; assertEquals(identifierDescriptor, cad.getDescriptor()); assertEquals(values[i], cad.getProperty(CSWRecordDescriptor.SIMPLE_LITERAL_VALUE).getValue()); } }