/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { AcceptVersionsType acceptVersions = owsfactory.createAcceptVersionsType(); acceptVersions.getVersion().addAll(node.getChildValues("Version")); return acceptVersions; } }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { SectionsType sections = owsfactory.createSectionsType(); sections.getSection().addAll(node.getChildValues("Section")); return sections; } }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { AcceptFormatsType acceptFormats = owsfactory.createAcceptFormatsType(); acceptFormats.getOutputFormat().addAll(node.getChildValues("OutputFormat")); return acceptFormats; } }
public void testEncode() throws Exception { Ows10Factory f = Ows10Factory.eINSTANCE; GetCapabilitiesType caps = f.createGetCapabilitiesType(); AcceptVersionsType versions = f.createAcceptVersionsType(); caps.setAcceptVersions(versions); versions.getVersion().add("1.0.0"); versions.getVersion().add("1.1.0"); ByteArrayOutputStream output = new ByteArrayOutputStream(); response.write(caps, output, null); Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); TransformerFactory.newInstance() .newTransformer() .transform( new StreamSource(new ByteArrayInputStream(output.toByteArray())), new DOMResult(d)); assertEquals("ows:GetCapabilities", d.getDocumentElement().getNodeName()); assertEquals(2, d.getElementsByTagName("ows:Version").getLength()); } }
OperationsMetadataType operationsMetadata) { OperationType getCapabilities = owsf.createOperationType(); operationsMetadata.getOperation().add(getCapabilities); DCPType getCapabilitiesDCP = owsf.createDCPType(); getCapabilities.getDCP().add(getCapabilitiesDCP); HTTPType getCapabilitiesHTTP = owsf.createHTTPType(); getCapabilitiesDCP.setHTTP(getCapabilitiesHTTP); new HashMap<String, String>(), URLType.SERVICE); RequestMethodType getCapabilitiesGet = owsf.createRequestMethodType(); getCapabilitiesGet.setHref(getCapabilitiesHref); getCapabilitiesHTTP.getGet().add(getCapabilitiesGet); RequestMethodType getCapabilitiesPost = owsf.createRequestMethodType(); getCapabilitiesPost.setHref(getCapabilitiesHref); getCapabilitiesHTTP.getPost().add(getCapabilitiesPost);
ServiceIdentificationType si = owsf.createServiceIdentificationType(); caps.setServiceIdentification(si); List<KeywordInfo> keywords = csw.getKeywords(); if (keywords != null && keywords.size() > 0) { kw = owsf.createKeywordsType(); for (KeywordInfo keyword : keywords) { kw.getKeyword().add(keyword.getValue()); CodeType CSW = owsf.createCodeType(); CSW.setValue("CSW"); si.setServiceType(CSW); ServiceProviderType sp = owsf.createServiceProviderType(); caps.setServiceProvider(sp); OnlineResourceType providerSite = owsf.createOnlineResourceType(); sp.setProviderSite(providerSite); providerSite.setHref((csw.getOnlineResource() != null ? csw.getOnlineResource() : "")); ResponsiblePartySubsetType serviceContact = owsf.createResponsiblePartySubsetType(); sp.setServiceContact(serviceContact); serviceContact.setIndividualName(contact.getContactPerson()); serviceContact.setPositionName(contact.getContactPosition()); ContactType contactInfo = owsf.createContactType(); serviceContact.setContactInfo(contactInfo); AddressType address = owsf.createAddressType(); contactInfo.setAddress(address);
@Override public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Ows10Factory ows10Factory = Ows10Factory.eINSTANCE; ServiceIdentificationType service = ows10Factory.createServiceIdentificationType(); String keywords = (String) node.getChildValue("Keywords"); if (keywords != null) { KeywordsType kwd = ows10Factory.createKeywordsType(); String[] split = (keywords).split(","); for (int i = 0; i < split.length; i++) { CodeType serviceType = ows10Factory.createCodeType(); serviceType.setValue(name); service.setServiceType(serviceType);
EObject acceptVersions = Ows10Factory.eINSTANCE.createAcceptVersionsType(); ((Collection) EMFUtils.get(acceptVersions, "version")) .addAll(KvpUtils.readFlat(value, KvpUtils.INNER_DELIMETER)); String value = (String) rawKvp.get("sections"); LOGGER.info("Sections: " + value); EObject sections = Ows10Factory.eINSTANCE.createSectionsType(); ((Collection) EMFUtils.get(sections, "section")) .addAll(KvpUtils.readFlat(value, KvpUtils.INNER_DELIMETER));
@SuppressWarnings("unchecked") @Override public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Ows10Factory ows10Factory = Ows10Factory.eINSTANCE; DCPType dcpType = ows10Factory.createDCPType(); HTTPType httpType = ows10Factory.createHTTPType(); dcpType.setHTTP(httpType); List<Node> httpChildren = node.getChildren("HTTP"); for (Node http : httpChildren) { Node get = http.getChild("Get"); if (get != null) { RequestMethodType methodType = createRequestMethodType(ows10Factory, get); httpType.getGet().add(methodType); } Node post = http.getChild("Post"); if (post != null) { RequestMethodType methodType = createRequestMethodType(ows10Factory, post); httpType.getPost().add(methodType); } } return dcpType; }
private OperationType getCapabilities(Node node, Ows10Factory ows10Factory) { if (node == null) { return null; } OperationType operationType = ows10Factory.createOperationType(); operationType.setName("GetCapabilities"); addDCPTypes(node, operationType); return operationType; }
@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); }
if (value instanceof String) { String[] split = ((String) value).split(","); KeywordsType kwd = Ows10Factory.eINSTANCE.createKeywordsType(); for (int i = 0; i < split.length; i++) { String kw = split[i].trim();
private ServiceIdentificationType getServiceIdentification() { ServiceIdentificationType serviceId = capabilities.getServiceIdentification(); if (serviceId == null) { LOGGER.info("Capabilities did not provide a ServiceIdentification section"); serviceId = Ows10Factory.eINSTANCE.createServiceIdentificationType(); capabilities.setServiceIdentification(serviceId); } return serviceId; }
OperationsMetadataType operationsMetadata) { OperationType describeRecord = owsf.createOperationType(); operationsMetadata.getOperation().add(describeRecord); DCPType describeRecordDCP = owsf.createDCPType(); describeRecord.getDCP().add(describeRecordDCP); HTTPType describeRecordHTTP = owsf.createHTTPType(); describeRecordDCP.setHTTP(describeRecordHTTP); new HashMap<String, String>(), URLType.SERVICE); RequestMethodType describeRecordGet = owsf.createRequestMethodType(); describeRecordGet.setHref(describeRecordHref); describeRecordHTTP.getGet().add(describeRecordGet); RequestMethodType describeRecordPost = owsf.createRequestMethodType(); describeRecordPost.setHref(describeRecordHref); DomainType describeRecordPostConstraints = owsf.createDomainType(); describeRecordPostConstraints.setName("PostEncoding"); describeRecordPostConstraints.getValue().add("XML");
ServiceIdentificationType si = owsf.createServiceIdentificationType(); caps.setServiceIdentification(si); List<KeywordInfo> keywords = csw.getKeywords(); if (keywords != null && keywords.size() > 0) { kw = owsf.createKeywordsType(); for (KeywordInfo keyword : keywords) { kw.getKeyword().add(keyword.getValue()); CodeType CSW = owsf.createCodeType(); CSW.setValue("CSW"); si.setServiceType(CSW); ServiceProviderType sp = owsf.createServiceProviderType(); caps.setServiceProvider(sp); OnlineResourceType providerSite = owsf.createOnlineResourceType(); sp.setProviderSite(providerSite); providerSite.setHref((csw.getOnlineResource() != null ? csw.getOnlineResource() : "")); ResponsiblePartySubsetType serviceContact = owsf.createResponsiblePartySubsetType(); sp.setServiceContact(serviceContact); serviceContact.setIndividualName(contact.getContactPerson()); serviceContact.setPositionName(contact.getContactPosition()); ContactType contactInfo = owsf.createContactType(); serviceContact.setContactInfo(contactInfo); AddressType address = owsf.createAddressType(); contactInfo.setAddress(address);
@Override public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Ows10Factory ows10Factory = Ows10Factory.eINSTANCE; ServiceIdentificationType service = ows10Factory.createServiceIdentificationType(); String keywords = (String) node.getChildValue("Keywords"); if (keywords != null) { KeywordsType kwd = ows10Factory.createKeywordsType(); String[] split = (keywords).split(","); for (int i = 0; i < split.length; i++) { CodeType serviceType = ows10Factory.createCodeType(); serviceType.setValue(name); service.setServiceType(serviceType);
@SuppressWarnings("unchecked") @Override public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Ows10Factory ows10Factory = Ows10Factory.eINSTANCE; DCPType dcpType = ows10Factory.createDCPType(); HTTPType httpType = ows10Factory.createHTTPType(); dcpType.setHTTP(httpType); List<Node> httpChildren = node.getChildren("HTTP"); for (Node http : httpChildren) { Node get = http.getChild("Get"); if (get != null) { RequestMethodType methodType = createRequestMethodType(ows10Factory, get); httpType.getGet().add(methodType); } Node post = http.getChild("Post"); if (post != null) { RequestMethodType methodType = createRequestMethodType(ows10Factory, post); httpType.getPost().add(methodType); } } return dcpType; }
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; }
@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); }
if (value instanceof String) { String[] split = ((String) value).split(","); KeywordsType kwd = Ows10Factory.eINSTANCE.createKeywordsType(); for(int i = 0; i < split.length; i++){ String kw = split[i].trim();