@Override public PropertyName translateProperty(RecordDescriptor rd, Name name) { return AbstractRecordDescriptor.buildPropertyName(rd.getNamespaceSupport(), name); } }
/** * Create a submapping from a list of property names * Required properties will also be included. * * @param properties list of property names to be included in submapping * @param rd Record Descriptor * @return */ public CatalogStoreMapping subMapping(List<PropertyName> properties, RecordDescriptor rd) { Set<String> paths = new HashSet<String>(); for (PropertyName prop : properties) { paths.add(toDotPath(XPathUtil.steps( rd.getFeatureDescriptor() , prop.toString(), rd.getNamespaceSupport()))); } CatalogStoreMapping mapping = new CatalogStoreMapping(); for ( Entry<String, CatalogStoreMappingElement> element : mappingElements.entrySet()) { if (element.getValue().isRequired() || paths.contains(element.getKey())) { mapping.mappingElements.put(element.getKey(), element.getValue()); } } mapping.identifier = identifier; mapping.includeEnvelope = includeEnvelope && paths.contains( rd.getBoundingBoxPropertyName() ); return mapping; }
/** * Create a submapping from a list of property names Required properties will also be included. * * @param properties list of property names to be included in submapping * @param rd Record Descriptor */ public CatalogStoreMapping subMapping(List<PropertyName> properties, RecordDescriptor rd) { Set<String> paths = new HashSet<String>(); for (PropertyName prop : properties) { paths.add( toDotPath( XPathUtil.steps( rd.getFeatureDescriptor(), prop.toString(), rd.getNamespaceSupport()))); } CatalogStoreMapping mapping = new CatalogStoreMapping(); for (Entry<String, CatalogStoreMappingElement> element : mappingElements.entrySet()) { if (element.getValue().isRequired() || paths.contains(element.getKey())) { mapping.mappingElements.put(element.getKey(), element.getValue()); } } mapping.identifier = identifier; mapping.includeEnvelope = includeEnvelope && paths.contains(rd.getBoundingBoxPropertyName()); return mapping; }
public GetDomain(CSWInfo csw, CatalogStore store) { this.csw = csw; this.store = store; try { for (RecordDescriptor rd : store.getRecordDescriptors()) { for (Name prop : store.getCapabilities().getDomainQueriables(rd.getFeatureDescriptor().getName())) { attributeTypeMap.put(prop, rd.getFeatureDescriptor().getName()); Enumeration declaredPrefixes = rd.getNamespaceSupport().getDeclaredPrefixes(); while (declaredPrefixes.hasMoreElements()) { String prefix = (String) declaredPrefixes.nextElement(); String uri = rd.getNamespaceSupport().getURI(prefix); ns.declarePrefix(prefix, uri); } } } } catch (IOException e) { throw new ServiceException(e, "Failed to retrieve the domain values", ServiceException.NO_APPLICABLE_CODE); } }
public GetDomain(CSWInfo csw, CatalogStore store) { this.csw = csw; this.store = store; try { for (RecordDescriptor rd : store.getRecordDescriptors()) { for (Name prop : store.getCapabilities() .getDomainQueriables(rd.getFeatureDescriptor().getName())) { attributeTypeMap.put(prop, rd.getFeatureDescriptor().getName()); Enumeration declaredPrefixes = rd.getNamespaceSupport().getDeclaredPrefixes(); while (declaredPrefixes.hasMoreElements()) { String prefix = (String) declaredPrefixes.nextElement(); String uri = rd.getNamespaceSupport().getURI(prefix); ns.declarePrefix(prefix, uri); } } } } catch (IOException e) { throw new ServiceException( e, "Failed to retrieve the domain values", ServiceException.NO_APPLICABLE_CODE); } }
NamespaceSupport nss = rd.getNamespaceSupport(); for (Name q : queriables) { String prefix = nss.getPrefix(q.getNamespaceURI());
NamespaceSupport nss = rd.getNamespaceSupport(); for (Name q : queriables) { String prefix = nss.getPrefix(q.getNamespaceURI());
DomainType dt = owsf.createDomainType(); dt.setName(rd.getQueryablesDescription()); NamespaceSupport nss = rd.getNamespaceSupport();
outputSchema = CSW.NAMESPACE; namespaces = descriptors.get( outputSchema).getNamespaceSupport();
DomainType dt = owsf.createDomainType(); dt.setName(rd.getQueryablesDescription()); NamespaceSupport nss = rd.getNamespaceSupport();
@Override public Object visit(PropertyName expression, Object extraData) { XPathUtil.StepList steps = XPathUtil.steps( rd.getFeatureDescriptor() , expression.getPropertyName(), rd.getNamespaceSupport()); if (steps.size()==1 && steps.get(0).getName().getLocalPart().equalsIgnoreCase("AnyText")) { Expression result = ff.literal(" "); for (CatalogStoreMappingElement element : mapping.elements()) { Expression fieldIgnoreNull = ff.function( "if_then_else", ff.function("isNull", element.getContent()), ff.literal(""), element.getContent()); result = ff.function("strConcat", result, ff.function("strConcat", ff.literal(" "), fieldIgnoreNull ) ); } return result; } String path = CatalogStoreMapping.toDotPath(steps); if (path.equalsIgnoreCase(rd.getBoundingBoxPropertyName())) { return ff.property("boundingBox"); } CatalogStoreMappingElement element = mapping.getElement(path); if (element == null) { throw new IllegalArgumentException("Unknown field in mapping: " + expression); } return element.getContent(); }
outputSchema = CSW.NAMESPACE; namespaces = descriptors.get(outputSchema).getNamespaceSupport();
rd.getFeatureDescriptor(), expression.getPropertyName(), rd.getNamespaceSupport());