public SrsSyntax getSrsSyntax() { return WFSXmlUtils.getSrsSyntax(this); }
public void setSrsSyntax(SrsSyntax srsSyntax) { WFSXmlUtils.setSrsSyntax(this, srsSyntax); }
@Override public Object read(Object request, Reader reader, Map kvp) throws Exception { WFSConfiguration config = new WFSConfiguration(); WFSXmlUtils.initWfsConfiguration(config, gs, new FeatureTypeSchemaBuilder.GML32(gs)); Parser parser = new Parser(config); parser.setEntityResolver(entityResolverProvider.getEntityResolver()); WFSInfo wfs = wfs(); WFSXmlUtils.initRequestParser(parser, wfs, gs, kvp); Object parsed = null; try { parsed = WFSXmlUtils.parseRequest(parser, reader, wfs); } catch (Exception e) { // check the exception, and set code to OperationParsingFailed if code not set if (!(e instanceof ServiceException) || ((ServiceException) e).getCode() == null) { e = new WFSException("Request parsing failed", e, "OperationParsingFailed"); } throw e; } WFSXmlUtils.checkValidationErrors(parser, this); return parsed; }
public Object read(Object request, Reader reader, Map kvp) throws Exception { // TODO: make this configurable? configuration.getProperties().add(Parser.Properties.PARSE_UNKNOWN_ELEMENTS); Parser parser = new Parser(configuration); parser.setEntityResolver(entityResolverProvider.getEntityResolver()); WFSXmlUtils.initRequestParser(parser, wfs, geoServer, kvp); Object parsed = WFSXmlUtils.parseRequest(parser, reader, wfs); WFSXmlUtils.checkValidationErrors(parser, this); return parsed; } }
@SuppressWarnings("unchecked") @Override protected void configureBindings(Map bindings) { // register our custom bindings bindings.put(OGC.FilterType, FilterTypeBinding.class); bindings.put(OGC.PropertyNameType, PropertyNameTypeBinding.class); bindings.put(GML.CircleType, CircleTypeBinding.class); WFSXmlUtils.registerAbstractGeometryTypeBinding(this, bindings, GML.AbstractGeometryType); // use setter injection for OGCBBoxTypeBinding to allow an // optional crs to be set in teh binding context for parsing, this crs // is set by the binding of a parent element. // note: it is important that this component adapter is non-caching so // that the setter property gets updated properly every time bindings.put( OGC.BBOXType, new SetterInjectionComponentAdapter( OGC.BBOXType, OGCBBOXTypeBinding.class, new Parameter[] { new OptionalComponentParameter(CoordinateReferenceSystem.class) })); // override XSQName binding bindings.put(XS.QNAME, XSQNameBinding.class); }
WFSXmlUtils.registerAbstractGeometryTypeBinding(this, bindings, GML.AbstractGeometryType);
public static void registerAbstractGeometryTypeBinding( final Configuration config, Map bindings, QName qName) { // use setter injection for AbstractGeometryType bindign to allow an // optional crs to be set in teh binding context for parsing, this crs // is set by the binding of a parent element. // note: it is important that this component adapter is non-caching so // that the setter property gets updated properly every time bindings.put( qName, new SetterInjectionComponentAdapter( qName, AbstractGeometryTypeBinding.class, new Parameter[] { new OptionalComponentParameter(CoordinateReferenceSystem.class), new DirectObjectParameter(config, Configuration.class), new DirectObjectParameter(getSrsSyntax(config), SrsSyntax.class) })); }