buildSchemaURL( baseURL(request.getHttpRequest()), "ows/1.0.0/owsExceptionReport.xsd"); encoder.setSchemaLocation(org.geoserver.ows.xml.v1_0.OWS.NAMESPACE, schemaLocation);
buildSchemaURL(baseURL(request.getHttpRequest()), "ows/1.1.0/owsAll.xsd"); encoder.setSchemaLocation(OWS.NAMESPACE, schemaLocation);
protected String wfsSchemaLocation(String baseUrl) { return buildSchemaURL(baseUrl, "wfs/1.0.0/WFS-basic.xsd"); }
String schemaLocation(String namespace, String uri) { String location = null; try { new URL(uri); // external location location = uri; } catch (MalformedURLException e) { // means the url is relative location = buildSchemaURL(schemaBaseURL, uri); } return namespace + " " + location; }
protected String schemaLocation(String namespace, String uri) { String location = null; try { new URL(uri); // external location location = uri; } catch (MalformedURLException e) { // means the url is relative location = buildSchemaURL(schemaBaseURL, uri); } return namespace + " " + location; }
protected String cswSchemaLocation(String schema) { if (canonicalSchemaLocation) { return CSW_ROOT_LOCATION + schema; } else { return buildSchemaURL(request.getBaseUrl(), "csw/2.0.2/" + schema); } }
protected String cswSchemaLocation(String schema) { if (canonicalSchemaLocation) { return CSW_ROOT_LOCATION + schema; } else { return buildSchemaURL(request.getBaseUrl(), "csw/2.0.2/" + schema); } } }
private String cswSchemaLocation(String schema) { if (canonicalSchemaLocation) { return CSW_ROOT_LOCATION + schema; } else { return buildSchemaURL(request.getBaseUrl(), "csw/2.0.2/" + schema); } } }
private String cswSchemaLocation(String schema) { if (canonicalSchemaLocation) { return CSW_ROOT_LOCATION + schema; } else { return buildSchemaURL(request.getBaseUrl(), "csw/2.0.2/" + schema); } } }
/** * Gets the <code>Transformer</code> created by the overriden method in the superclass and adds * it the DOCTYPE token pointing to the DescribeLayer DTD on this server instance. * * <p>The DTD is set at the fixed location given by the <code>schemaBaseUrl</code> passed to the * constructor <code>+ "wms/1.1.1/WMS_DescribeLayerResponse.dtd</code>. * * @return a Transformer propoerly configured to produce DescribeLayer responses. * @throws TransformerException if it is thrown by <code>super.createTransformer()</code> */ public Transformer createTransformer() throws TransformerException { Transformer transformer = super.createTransformer(); String dtdUrl = buildSchemaURL(baseURL, "wms/1.1.1/WMS_DescribeLayerResponse.dtd"); transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, dtdUrl); return transformer; }
/** * Gets the <code>Transformer</code> created by the overriden method in the superclass and adds * it the system DOCTYPE token pointing to the Capabilities DTD on this server instance. * * <p>The DTD is set at the fixed location given by the <code>schemaBaseUrl</code> passed to the * constructor <code>+ * "wms/1.1.1/WMS_MS_Capabilities.dtd</code>. * * @return a Transformer propoerly configured to produce DescribeLayer responses.h * @throws TransformerException if it is thrown by <code>super.createTransformer()</code> */ @Override public Transformer createTransformer() throws TransformerException { Transformer transformer = super.createTransformer(); String dtdUrl = buildSchemaURL(baseURL, "wms/1.1.1/WMS_MS_Capabilities.dtd"); transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, dtdUrl); return transformer; }
schemaLocationRoot = "http://schemas.opengis.net"; } else { schemaLocationRoot = buildSchemaURL(request.getBaseUrl(), "");
schemaLocationRoot = "http://schemas.opengis.net"; } else { schemaLocationRoot = buildSchemaURL(request.getBaseUrl(), "");
@Override protected void setAdditionalSchemaLocations( Encoder encoder, GetFeatureRequest request, WFSInfo wfs) { // since wfs 2.0 schema does not depend on gml 3.2 schema we register it manually String loc = wfs.isCanonicalSchemaLocation() ? GML.CANONICAL_SCHEMA_LOCATION : ResponseUtils.buildSchemaURL(request.getBaseUrl(), "gml/3.2.1/gml.xsd"); encoder.setSchemaLocation(GML.NAMESPACE, loc); }
protected void importGMLSchema(XSDSchema schema, XSDFactory factory, String baseUrl) { XSDImport imprt = factory.createXSDImport(); imprt.setNamespace(gmlNamespace); imprt.setSchemaLocation(ResponseUtils.buildSchemaURL(baseUrl, gmlSchemaLocation)); XSDSchema gmlSchema = gmlSchema(); imprt.setResolvedSchema(gmlSchema); schema.getContents().add(imprt); }
schemaLocationRoot = "http://schemas.opengis.net/csw/2.0.2"; } else { schemaLocationRoot = buildSchemaURL(request.getBaseUrl(), "csw/2.0.2");
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 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); }
@Override protected void importGMLSchema(XSDSchema schema, XSDFactory factory, String baseUrl) { synchronized (Schemas.class) { XSDImport imprt; try { imprt = factory.createXSDImport(); imprt.setNamespace(gmlNamespace); // imprt.setNamespace( WFS.getInstance().getSchema().getTargetNamespace() ); imprt.setSchemaLocation( ResponseUtils.buildSchemaURL(baseUrl, gmlSchemaLocation)); // imprt.setResolvedSchema(WFS.getInstance().getSchema()); imprt.setResolvedSchema(GML.getInstance().getSchema()); schema.getContents().add(imprt); schema.getQNamePrefixToNamespaceMap().put("wfs", WFS.NAMESPACE); // imprt = Schemas.importSchema(schema, WFS.getInstance().getSchema()); final XSDSchemaImpl xsdSchema = (XSDSchemaImpl) WFS.getInstance().getSchema(); synchronized (xsdSchema.eAdapters()) { xsdSchema.imported(imprt); } // ((XSDSchemaImpl)schema).resolveSchema(WFS.NAMESPACE); // schema.getContents().add(imprt); } catch (IOException e) { throw new RuntimeException(e); } } }
public void v_1_1(TransactionResponseType response, OutputStream output, Operation operation) throws IOException, ServiceException { if (!response.getTransactionResults().getAction().isEmpty()) { // since we do atomic transactions, an action failure means all we rolled back // spec says to throw exception ActionType action = (ActionType) response.getTransactionResults().getAction().iterator().next(); throw new WFSException(action.getMessage(), action.getCode(), action.getLocator()); } Encoder encoder = new Encoder(configuration, configuration.schema()); encoder.setEncoding(Charset.forName(getInfo().getGeoServer().getSettings().getCharset())); TransactionType req = (TransactionType) operation.getParameters()[0]; encoder.setSchemaLocation( org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE, buildSchemaURL(req.getBaseUrl(), "wfs/1.1.0/wfs.xsd")); encoder.encode(response, org.geoserver.wfs.xml.v1_1_0.WFS.TRANSACTIONRESPONSE, output); } }