private void addOperation( WFSRequestType wfsRequestType, List<Domain> params, List<DCP> getAndPost, List<DCP> post, List<DCP> get, List<Operation> operations ) { if ( isGetSupported( wfsRequestType ) && isPostSupported( wfsRequestType ) ) operations.add( new Operation( wfsRequestType.name(), getAndPost, params, null, null ) ); else if ( isPostSupported( wfsRequestType ) ) operations.add( new Operation( wfsRequestType.name(), post, params, null, null ) ); else if ( isGetSupported( wfsRequestType ) ) operations.add( new Operation( wfsRequestType.name(), get, params, null, null ) ); }
private static void exportOperationsMetadata( XMLStreamWriter writer ) throws XMLStreamException { List<Operation> operations = new LinkedList<Operation>(); List<DCP> dcps = null; try { DCP dcp = new DCP( new URL( OGCFrontController.getHttpGetURL() ), new URL( OGCFrontController.getHttpPostURL() ) ); dcps = Collections.singletonList( dcp ); } catch ( MalformedURLException e ) { // should never happen } List<Domain> params = new ArrayList<Domain>(); List<Domain> constraints = new ArrayList<Domain>(); List<OMElement> mdEls = new ArrayList<OMElement>(); operations.add( new Operation( "GetCapabilities", dcps, params, constraints, mdEls ) ); operations.add( new Operation( "DescribeProcess", dcps, params, constraints, mdEls ) ); operations.add( new Operation( "Execute", dcps, params, constraints, mdEls ) ); OperationsMetadata operationsMd = new OperationsMetadata( operations, params, constraints, null ); exportOperationsMetadata110( writer, operationsMd ); }
void exportOperationsMetadata() throws XMLStreamException { List<Operation> operations = new LinkedList<Operation>(); List<DCP> dcps = null; try { DCP dcp = new DCP( new URL( OGCFrontController.getHttpGetURL() ), null ); dcps = Collections.singletonList( dcp ); } catch ( MalformedURLException e ) { // should never happen } List<Domain> params = new ArrayList<Domain>(); List<Domain> constraints = new ArrayList<Domain>(); constraints.add( new Domain( "GetEncoding", Collections.singletonList( "KVP" ) ) ); List<OMElement> mdEls = new ArrayList<OMElement>(); operations.add( new Operation( "GetCapabilities", dcps, params, constraints, mdEls ) ); operations.add( new Operation( "GetTile", dcps, params, constraints, mdEls ) ); operations.add( new Operation( "GetFeatureInfo", dcps, params, constraints, mdEls ) ); OperationsMetadata operationsMd = new OperationsMetadata( operations, params, constraints, null ); exportOperationsMetadata110( writer, operationsMd ); }
private Operation parseOperation( OMElement opEl ) { String name = opEl.getLocalName(); XPath xpath = new XPath( getPrefix() + "DCPType", nsContext ); List<OMElement> dcpEls = getElements( opEl, xpath ); List<DCP> dcps = new ArrayList<DCP>( dcpEls.size() ); if ( dcpEls != null ) { for ( OMElement dcpEl : dcpEls ) { DCP dcp = parseDCP( dcpEl ); dcps.add( dcp ); } } return new Operation( name, dcps, new ArrayList<Domain>(), new ArrayList<Domain>(), new ArrayList<OMElement>() ); }
@SuppressWarnings("unchecked") private void sendCapabilities( Map<String, String> map, HttpServletRequest request, HttpResponseBuffer response ) throws IOException { GetCapabilities req = GetCapabilitiesKVPParser.parse( map ); XMLOutputFactory factory = XMLOutputFactory.newInstance(); factory.setProperty( IS_REPAIRING_NAMESPACES, true ); try { XMLStreamWriter xsw = factory.createXMLStreamWriter( response.getOutputStream(), "UTF-8" ); IndentingXMLStreamWriter xmlWriter = new IndentingXMLStreamWriter( xsw ); List<Operation> operations = new ArrayList<Operation>(); List<DCP> dcps = Collections.singletonList( new DCP( new URL( OGCFrontController.getHttpGetURL() ), null ) ); List<Domain> params = Collections.emptyList(); List<Domain> constraints = Collections.emptyList(); for ( String operation : allowedOperations ) { operations.add( new Operation( operation, dcps, params, constraints, EMPTY_LIST ) ); } OperationsMetadata operationsMd = new OperationsMetadata( operations, params, constraints, null ); new CapabilitiesXMLAdapter().export040( xmlWriter, req, identification, provider, operationsMd, service.getServiceConfiguration() ); xmlWriter.writeEndDocument(); } catch ( XMLStreamException e ) { throw new IOException( e ); } }
return new Operation( name, dcps, params, constraints, metadataEls );
List<OMElement> metadataEls = getElements( opEl, xpath ); return new Operation( name, dcps, params, constraints, metadataEls );
constraints.add( new Domain( "PreservesSiblingOrder", "TRUE" ) ); if ( supportedEncodings.isEncodingSupported( Transaction, "POST" ) ) operations.add( new Operation( Transaction.name(), post, null, constraints, null ) );