@SuppressWarnings("unchecked") protected Set<String> findParameters( final OperationType operationMetadata, final String parameterName) { Set<String> outputFormats = new HashSet<String>(); List<DomainType> parameters = operationMetadata.getParameter(); for (DomainType param : parameters) { String paramName = param.getName(); if (parameterName.equals(paramName)) { List<String> value = param.getValue(); outputFormats.addAll(value); } } return outputFormats; }
private OperationType getCapabilities(Node node, Ows10Factory ows10Factory) { if (node == null) { return null; } OperationType operationType = ows10Factory.createOperationType(); operationType.setName("GetCapabilities"); addDCPTypes(node, operationType); return operationType; }
operationsMetadata.getOperation().add(getCapabilities); getCapabilities.setName("GetCapabilities"); DCPType getCapabilitiesDCP = owsf.createDCPType(); getCapabilities.getDCP().add(getCapabilitiesDCP); getCapabilities.getParameter().add(param); getCapabilities.getConstraint().add(constraint);
@SuppressWarnings("unchecked") private void addDCPTypes(Node node, OperationType operationType) { List<Node> dcpNodes = node.getChildren(DCPType.class); for (Node dcpNode : dcpNodes) { DCPType dcp = (DCPType) dcpNode.getValue(); operationType.getDCP().add(dcp); } }
/** * @return the operation metadata advertised in the capabilities for the given operation * @see #getServerSupportedOutputFormats(WFSOperationType) */ protected OperationType getOperationMetadata(final WFSOperationType operation) { final OperationsMetadataType operationsMetadata = capabilities.getOperationsMetadata(); @SuppressWarnings("unchecked") final List<OperationType> operations = operationsMetadata.getOperation(); final String expectedOperationName = operation.getName(); for (OperationType operationType : operations) { String operationName = operationType.getName(); if (expectedOperationName.equalsIgnoreCase(operationName)) { return operationType; } } throw new NoSuchElementException( "Operation metadata not found for " + expectedOperationName + " in the capabilities document"); } }
operationsMetadata.getOperation().add(getCapabilities); getCapabilities.setName("GetCapabilities"); DCPType getCapabilitiesDCP = owsf.createDCPType(); getCapabilities.getDCP().add(getCapabilitiesDCP); getCapabilities.getParameter().add(EcoreUtil.copy(param)); getCapabilities.getConstraint().add(EcoreUtil.copy(constraint));
@SuppressWarnings("unchecked") private void addDCPTypes(Node node, OperationType operationType) { List<Node> dcpNodes = node.getChildren(DCPType.class); for (Node dcpNode : dcpNodes) { DCPType dcp = (DCPType) dcpNode.getValue(); operationType.getDCP().add(dcp); } }
private OperationType getOperationMetadata(WFSOperationType operation) { final OperationsMetadataType operationsMetadata = capabilities.getOperationsMetadata(); final List<OperationType> operations = operationsMetadata.getOperation(); final String expectedOperationName = operation.getName(); for (OperationType operationType : operations) { String operationName = operationType.getName(); if (expectedOperationName.equalsIgnoreCase(operationName)) { return operationType; } } throw new NoSuchElementException("Operation metadata not found for " + expectedOperationName + " in the capabilities document"); }
operationsMetadata.getOperation().add(describeRecord); describeRecord.setName("DescribeRecord"); DCPType describeRecordDCP = owsf.createDCPType(); describeRecord.getDCP().add(describeRecordDCP); describeRecord.getParameter().add(param); describeRecord.getConstraint().add(constraint);
@SuppressWarnings("unchecked") private void addParameter( Node node, Ows10Factory ows10Factory, OperationType operationType, String parameterName) { Node paramParentNode = node.getChild(parameterName); List<String> paramValues = childNames(paramParentNode); DomainType domain = ows10Factory.createDomainType(); domain.setName(parameterName); for (String paramValue : paramValues) { domain.getValue().add(paramValue); } operationType.getParameter().add(domain); }
/** * Returns the operation URI for the given operation/http method as a String to avoid creating a * URL instance when not needed */ private String getOperationURI(WFSOperationType operation, HttpMethod method) { final OperationType operationType = getOperationMetadata(operation); final List<DCPType> dcps = operationType.getDCP(); for (DCPType dcp : dcps) { List<RequestMethodType> requests; if (GET == method) { requests = dcp.getHTTP().getGet(); } else { requests = dcp.getHTTP().getPost(); } for (RequestMethodType req : requests) { String href = req.getHref(); return href; } } return null; }
private OperationType createOperation( String opetationName, Node node, Ows10Factory ows10Factory) { if (node == null) { return null; } OperationType operationType = ows10Factory.createOperationType(); operationType.setName(opetationName); addDCPTypes(node, operationType); return operationType; }
/** * @return the operation metadata advertised in the capabilities for the given operation * @see #getServerSupportedOutputFormats(WFSOperationType) */ protected OperationType getOperationMetadata(final WFSOperationType operation) { final OperationsMetadataType operationsMetadata = capabilities.getOperationsMetadata(); @SuppressWarnings("unchecked") final List<OperationType> operations = operationsMetadata.getOperation(); final String expectedOperationName = operation.getName(); for (OperationType operationType : operations) { String operationName = operationType.getName(); if (expectedOperationName.equalsIgnoreCase(operationName)) { return operationType; } } throw new NoSuchElementException( "Operation metadata not found for " + expectedOperationName + " in the capabilities document"); } }
operationsMetadata.getOperation().add(getRecordById); getRecordById.setName("GetRecordById"); DCPType getRecordByIdDCP = owsf.createDCPType(); getRecordById.getDCP().add(getRecordByIdDCP); getRecordById.getParameter().add(param); getRecordById.getConstraint().add(constraint);
@SuppressWarnings("unchecked") protected Set<String> findParameters( final OperationType operationMetadata, final String parameterName) { Set<String> outputFormats = new HashSet<String>(); List<DomainType> parameters = operationMetadata.getParameter(); for (DomainType param : parameters) { String paramName = param.getName(); if (parameterName.equals(paramName)) { List<String> value = param.getValue(); outputFormats.addAll(value); } } return outputFormats; }
private OperationType createOperation(String opetationName, Node node, Ows10Factory ows10Factory) { if (node == null) { return null; } OperationType operationType = ows10Factory.createOperationType(); operationType.setName(opetationName); addDCPTypes(node, operationType); return operationType; }
operationsMetadata.getOperation().add(transaction); transaction.setName("Transaction"); DCPType transactionDCP = owsf.createDCPType(); transaction.getDCP().add(transactionDCP); transaction.getParameter().add(param); transaction.getConstraint().add(constraint);
@SuppressWarnings("unchecked") private void addParameter(Node node, Ows10Factory ows10Factory, OperationType operationType, String parameterName) { Node paramParentNode = node.getChild(parameterName); List<String> paramValues = childNames(paramParentNode); DomainType domain = ows10Factory.createDomainType(); domain.setName(parameterName); for (String paramValue : paramValues) { domain.getValue().add(paramValue); } operationType.getParameter().add(domain); }