public NamespaceInfo getNamespace() { return delegate.getNamespace(); }
expect(ft1.getNamespace()).andReturn(ns1).anyTimes(); replay(ft1); expect(ft2.getNamespace()).andReturn(ns2).anyTimes(); replay(ft2);
tb.setNamespaceURI(info.getNamespace().getURI());
dirName = metadata; } else { dirName = ftInfo.getNamespace().getPrefix() + "_" + ftInfo.getName();
assertEquals(ns, ft.getNamespace()); assertEquals("EPSG:4326", ft.getSRS()); assertEquals(new Measure(10, SI.METRE), ft.getLinearizationTolerance());
/** * Checks that the collection of featureTypeNames all have the same prefix. Used to determine if * their schemas are all in the same namespace or if imports need to be done. * * @param infos list of feature type info objects.. * @return true if all the types in the collection have the same prefix. */ public boolean allSameType(FeatureTypeInfo[] infos) { boolean sameType = true; if (infos.length == 0) { return false; } FeatureTypeInfo first = infos[0]; for (int i = 0; i < infos.length; i++) { FeatureTypeInfo ftInfo = infos[i]; if (!first.getNamespace().equals(ftInfo.getNamespace())) { return false; } } return sameType; } }
private String getLocalTypeName(FeatureTypeInfo ft) { if (ft.getNamespace() != null && ft.getNamespace().getURI() != null) { String uri = ft.getNamespace().getURI(); String name = ft.getName(); if (queriedTypes != null) { for (QName type : queriedTypes) { String namespaceURI = type.getNamespaceURI(); String prefix = type.getPrefix(); if (prefix != null && namespaceURI != null && namespaceURI.equals(uri) && type.getLocalPart().equals(name)) { return prefix + ":" + type.getLocalPart(); } } } } return null; }
protected String getDatabaseName(FeatureTypeInfo cfg) throws Exception { return cfg.getNamespace().getPrefix() + "_" + cfg.getName(); }
NamespaceInfo namespace = i.next().getNamespace(); while (i.hasNext()) { FeatureTypeInfo type = i.next(); if (!namespace.equals(type.getNamespace())) { namespace = null; break;
context.put("workspace", ftInfo.getNamespace().getPrefix()); context.put("geometryType", geometryType == null ? "" : geometryType); context.put("timestamp", timestamp);
/** * Internal method to print XML element information for table. * * @param type The table name. * @return The element part of the response. */ private static String printElement(FeatureTypeInfo type) { return "\n <xs:element name=\"" + type.getName() + "\" type=\"" + type.getNamespace().getPrefix() + ":" + type.getName() + "_Type" + "\" substitutionGroup=\"gml:_Feature\"/>"; }
for (Iterator it = featureTypes.iterator(); it.hasNext(); ) { FeatureTypeInfo ft = (FeatureTypeInfo) it.next(); if (!namespace.equals(ft.getNamespace().getPrefix())) it.remove();
String prefix = meta.getNamespace().getPrefix(); String namespaceURI = meta.getNamespace().getURI(); wfsSchema.getQNamePrefixToNamespaceMap().put(prefix, namespaceURI);
ft -> new QName( ft.getNamespace().getURI(), ft.getName(), ft.getNamespace().getPrefix())) .forEach(qn -> item.getReturnFeatureType().add(qn));
public void write(Object value, OutputStream output, Operation operation) throws IOException, ServiceException { // get the feature SimpleFeature feature = (SimpleFeature) value; SimpleFeatureType featureType = feature.getType(); // grab the metadata FeatureTypeInfo meta = catalog.getFeatureTypeByName(featureType.getName()); // create teh encoder Encoder encoder = new Encoder(configuration); encoder.setEncoding(Charset.forName(getInfo().getGeoServer().getSettings().getCharset())); encoder.encode(feature, new QName(meta.getNamespace().getURI(), meta.getName()), output); } }
public static FeatureTypeInfo localizeFeatureType(final FeatureTypeInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final FeatureTypeInfo localObject=catalog.getFeatureTypeByName(info.getNamespace(),info.getName()); if (localObject !=null){ return localObject; } final FeatureTypeInfo createdObject = catalog.getFactory().createFeatureType(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setNamespace(localizeNamespace(info.getNamespace(), catalog)); final StoreInfo store=localizeStore(info.getStore(), catalog); createdObject.setStore(store); final CatalogBuilder builder = new CatalogBuilder(catalog); builder.attach(createdObject); return createdObject; }
public static FeatureTypeInfo localizeFeatureType(final FeatureTypeInfo info, final Catalog catalog) throws IllegalAccessException, InvocationTargetException { if (info==null || catalog==null) throw new NullArgumentException("Arguments may never be null"); final FeatureTypeInfo localObject=catalog.getFeatureTypeByName(info.getNamespace(),info.getName()); if (localObject !=null){ return localObject; } final FeatureTypeInfo createdObject = catalog.getFactory().createFeatureType(); // let's using the created object (see getGridCoverageReader) BeanUtils.copyProperties(createdObject, info); createdObject.setNamespace(localizeNamespace(info.getNamespace(), catalog)); final StoreInfo store=localizeStore(info.getStore(), catalog); createdObject.setStore(store); final CatalogBuilder builder = new CatalogBuilder(catalog); builder.attach(createdObject); return createdObject; }
private void buildSchemaContent( FeatureTypeInfo featureTypeMeta, XSDSchema schema, XSDFactory factory, String baseUrl) throws IOException { if (!findTypeInSchema(featureTypeMeta, schema, factory)) { // build the type manually FeatureType featureType = featureTypeMeta.getFeatureType(); if (featureTypeMeta.isCircularArcPresent() && this.getClass().equals(GML3.class)) { featureType = new CurveTypeWrapper(featureType); } XSDComplexTypeDefinition xsdComplexType = buildComplexSchemaContent(featureType, schema, factory); XSDElementDeclaration element = factory.createXSDElementDeclaration(); element.setName(featureTypeMeta.getName()); element.setTargetNamespace(featureTypeMeta.getNamespace().getURI()); synchronized (Schemas.class) { // this call changes the global schemas too, need to be synchronized element.setSubstitutionGroupAffiliation(getFeatureElement()); } element.setTypeDefinition(xsdComplexType); schema.getContents().add(element); schema.updateElement(); } }
layer.getFeature().getNamespace().getName(), layer.getFeature().getName()); collection = new FeatureCollectionDecorator(name, collection);
Catalog catalog = app.getCatalog(); String namespace = ft.getNamespace().getURI(); Name qualifiedName = new NameImpl(namespace, _layerInfo.getName()); LayerInfo layerInfo = catalog.getLayerByName(qualifiedName);