/** * Returns the mime type that should be exposed to the client when sending the exception * message. * * <p>Defaults to <code>geoserver.getMimeType()</code> */ public String getMimeType(GeoServer geoserver) { return "text/xml; charset=" + geoserver.getSettings().getCharset(); } }
public String getCharset() { return getSettings().getCharset(); }
if (other.getCharset() != null) return false; } else if (!charset.equals(other.getCharset())) return false; if (contact == null) { if (other.getContact() != null) return false;
public Charset getCharSet() { GeoServer geoServer2 = getGeoServer(); String charset = geoServer2.getSettings().getCharset(); return Charset.forName(charset); }
public static Object parseRequest(Parser parser, Reader reader, WFSInfo wfs) throws Exception { // set the input source with the correct encoding InputSource source = new InputSource(reader); source.setEncoding(wfs.getGeoServer().getSettings().getCharset()); return parser.parse(source); }
@Override public String getCharset() { return wms.getGeoServer().getSettings().getCharset(); } }
@Override public String getCharset(Operation operation) { return gs.getGlobal().getSettings().getCharset(); } }
@Override public String getCharset() { return wms.getGeoServer().getSettings().getCharset(); } }
@Override public String getCharset(Operation operation) { return wms.getGeoServer().getSettings().getCharset(); } }
@Override public String getCharset() { return wms.getGeoServer().getSettings().getCharset(); } }
@Override public String getCharset(Operation operation) { return gs.getGlobal().getSettings().getCharset(); } }
public DescribeCoverageTransformer describeCoverage(DescribeCoverageType request) { final String version = request.getVersion(); if ("1.1.0".equals(version) || "1.1.1".equals(version)) { WCSInfo wcs = getServiceInfo(); DescribeCoverageTransformer describeTransformer = new DescribeCoverageTransformer(wcs, catalog, responseFactory); describeTransformer.setEncoding( Charset.forName(wcs.getGeoServer().getSettings().getCharset())); return describeTransformer; } throw new WcsException("Could not understand version:" + version); }
/** */ public Wcs10DescribeCoverageTransformer describeCoverage(DescribeCoverageType request) { final String version = request.getVersion(); if ("1.0.0".equals(version)) { WCSInfo wcs = getServiceInfo(); Wcs10DescribeCoverageTransformer describeTransformer = new Wcs10DescribeCoverageTransformer(wcs, catalog); describeTransformer.setEncoding( Charset.forName((wcs.getGeoServer().getSettings().getCharset()))); return describeTransformer; } throw new WcsException("Could not understand version:" + version); }
void write1_1(LockFeatureResponseType lockResponse, OutputStream output, Operation operation) throws IOException { Encoder encoder = new Encoder(configuration, configuration.schema()); encoder.setEncoding(Charset.forName(getInfo().getGeoServer().getSettings().getCharset())); LockFeatureType req = (LockFeatureType) operation.getParameters()[0]; encoder.setSchemaLocation( org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE, buildSchemaURL(req.getBaseUrl(), "schemas/wfs/1.1.0/wfs.xsd")); encoder.encode(lockResponse, org.geoserver.wfs.xml.v1_1_0.WFS.LOCKFEATURERESPONSE, output); output.flush(); } }
@Override protected void encode(FeatureCollectionResponse hits, OutputStream output, WFSInfo wfs) throws IOException { hits.setNumberOfFeatures(BigInteger.valueOf(0)); Encoder e = new Encoder(new WFSConfiguration()); e.setEncoding(Charset.forName(wfs.getGeoServer().getSettings().getCharset())); e.setSchemaLocation( WFS.NAMESPACE, ResponseUtils.appendPath(wfs.getSchemaBaseURL(), "wfs/2.0/wfs.xsd")); e.encode(hits.getAdaptee(), WFS.FeatureCollection, output); } }
public WfsXmlWriter(WFSInfo wfs, OutputStream output) { this.wfs = wfs; this.output = output; // default to wfs configured charset charSetEncoding = wfs.getGeoServer().getSettings().getCharset(); // schema locations schemaLocations = new HashMap(); // declare the namespaces ( wfs is default ) namespaceSupport = new NamespaceSupport(); namespaceSupport.declarePrefix("xs", XS.NAMESPACE); namespaceSupport.declarePrefix("ogc", OGC.NAMESPACE); namespaceSupport.declarePrefix("gml", GML.NAMESPACE); namespaceSupport.declarePrefix("wfs", org.geoserver.wfs.xml.v1_0_0.WFS.NAMESPACE); namespaceSupport.declarePrefix("", org.geoserver.wfs.xml.v1_0_0.WFS.NAMESPACE); }
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); } }
protected void encode(FeatureCollectionResponse hits, OutputStream output, WFSInfo wfs) throws IOException { Encoder encoder = new Encoder(configuration, configuration.schema()); encoder.setEncoding(Charset.forName(wfs.getGeoServer().getSettings().getCharset())); encoder.setSchemaLocation( org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE, ResponseUtils.appendPath(wfs.getSchemaBaseURL(), "wfs/1.1.0/wfs.xsd")); encoder.encode( hits.getAdaptee(), org.geoserver.wfs.xml.v1_1_0.WFS.FEATURECOLLECTION, output); } }
@Override public void write(Object value, OutputStream output, Operation operation) throws IOException, ServiceException { Encoder encoder = new Encoder(new WFSConfiguration()); encoder.setEncoding(Charset.forName(getInfo().getGeoServer().getSettings().getCharset())); encoder.setOmitXMLDeclaration(Dispatcher.REQUEST.get().isSOAP()); String baseURL = (String) EMFUtils.get((EObject) operation.getParameters()[0], "baseUrl"); encoder.setSchemaLocation(WFS.NAMESPACE, buildSchemaURL(baseURL, "wfs/2.0/wfs.xsd")); encode(encoder, value, output, operation); }
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); }