/** * Encode the provided SimpleFeatureType into an XSD file, using a target namespace * * <p>When encoding the simpleFeatureType: * * <ul> * <li>target prefix/namespace can be provided by prefix and namespace parameters. This is the * default for the entire XSD document. * <li>simpleFeatureType.geName().getNamespaceURI() is used for the simpleFeatureType itself, * providing simpleFeatureType.getUserData().get("prefix") is defined * </ul> * * @param simpleFeatureType To be encoded as an XSD document * @param prefix Prefix to use for for target namespace * @param namespace Target namespace */ public void encode(OutputStream out, SimpleFeatureType simpleFeatureType) throws IOException { XSDSchema xsd = xsd(simpleFeatureType); XSDResourceImpl.serialize(out, xsd.getElement(), encoding.name()); }
public static void serialize(OutputStream outputStream, Document document, String encoding) { try { doSerialize(outputStream, document, encoding); } catch (Exception exception) { exception.printStackTrace(); } }
public static void serialize(OutputStream outputStream, Document document, String encoding) { try { doSerialize(outputStream, document, encoding); } catch (Exception exception) { exception.printStackTrace(); } }
public static void serialize(OutputStream outputStream, Element element, String encoding) { try { doSerialize(outputStream, element, encoding); } catch (Exception exception) { exception.printStackTrace(); } }
public static void serialize(OutputStream outputStream, Element element, String encoding) { try { doSerialize(outputStream, element, encoding); } catch (Exception exception) { exception.printStackTrace(); } }
protected void doWrite( FeatureTypeInfo[] featureTypeInfos, OutputStream output, Operation describeFeatureType) throws IOException { // create the schema Object request = describeFeatureType.getParameters()[0]; DescribeFeatureTypeRequest req = DescribeFeatureTypeRequest.adapt(request); XSDSchema schema = schemaBuilder.build(featureTypeInfos, req.getBaseURL()); // serialize schema.updateElement(); final String encoding = gs.getSettings().getCharset(); XSDResourceImpl.serialize(output, schema.getElement(), encoding); }
public void write(Object value, OutputStream output, Operation describeFeatureType) throws IOException { VersionedDescribeResults results = (VersionedDescribeResults) value; // create the schema DescribeFeatureTypeType req = (DescribeFeatureTypeType) describeFeatureType .getParameters()[0]; String proxifiedBaseUrl = RequestUtils.proxifiedBaseURL(req .getBaseUrl(), wfs.getGeoServer().getProxyBaseUrl()); FeatureTypeSchemaBuilder builder = null; if (results.isVersioned()) { builder = new VersionedSchemaBuilder(wfs, catalog, resourceLoader, configuration); } else { builder = new FeatureTypeSchemaBuilder.GML3(wfs, catalog, resourceLoader); } XSDSchema schema = builder.build(results.getFeatureTypeInfo(), proxifiedBaseUrl); // serialize schema.updateElement(); XSDResourceImpl.serialize(output, schema.getElement()); }