Package net.opengis.cat.csw20.impl

Examples of net.opengis.cat.csw20.impl.EchoedRequestTypeImpl


     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetAcknowledgement(AcknowledgementType newAcknowledgement, NotificationChain msgs) {
        AcknowledgementType oldAcknowledgement = acknowledgement;
        acknowledgement = newAcknowledgement;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Csw20Package.HARVEST_RESPONSE_TYPE__ACKNOWLEDGEMENT, oldAcknowledgement, newAcknowledgement);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here


        encoder.setIndenting(true);
    }

    @Test
    public void testParseBriefRecord() throws Exception {
        BriefRecordType br = (BriefRecordType) parser.parse(getClass().getResourceAsStream("BriefRecord.xml"));
        assertEquals("00180e67-b7cf-40a3-861d-b3a09337b195", br.getIdentifier().get(0).getValue());
        assertEquals("Image2000 Product 1 (at1) Multispectral", br.getTitle().get(0).getValue());
        assertEquals("Image2000 Product 1 (at1) Multispectral", br.getTitle().get(0).getValue());
        assertEquals("dataset", br.getType().getValue());
    }
View Full Code Here

        assertEquals("dataset", br.getType().getValue());
    }
   
    @Test
    public void testRoundTripBriefRecord() throws Exception {
        BriefRecordType br = (BriefRecordType) parser.parse(getClass().getResourceAsStream("BriefRecord.xml"));
        String encoded = encoder.encodeAsString(br, CSW.BriefRecord);
        BriefRecordType reparsed = (BriefRecordType) parser.parse(new StringReader(encoded));
        assertTrue(EMFUtils.emfEquals(br, reparsed));
    }
View Full Code Here

        assertEquals("OperationsMetadata", sections.get(0));
    }
   
    @Test
    public void testParseCapabilities() throws Exception {
        CapabilitiesType caps = (CapabilitiesType) parser.parse(getClass().getResourceAsStream("Capabilities.xml"));
        assertEquals("2.0.2", caps.getVersion());
       
        ServiceIdentificationType si = caps.getServiceIdentification();
        assertEquals("con terra GmbH Catalogue Server", si.getTitle());
        assertEquals("terraCatalog 2.1 - Web based Catalogue Service \n" +
            "        (CS-W 2.0.0/AP ISO19115/19 0.9.3 (DE-Profil 1.0.1)) for service, datasets and applications", si.getAbstract());
        KeywordsType keywords = (KeywordsType) si.getKeywords().get(0);
        assertEquals("CS-W", keywords.getKeyword().get(0));
        assertEquals("ISO19119", keywords.getKeyword().get(1));
        assertEquals("http://www.conterra.de", keywords.getType().getCodeSpace());
        assertEquals("theme", keywords.getType().getValue());
        assertEquals("CSW", si.getServiceType().getValue());
        // minor trouble here, this should be a list, not a string
        assertEquals("2.0.2", si.getServiceTypeVersion());
       
        ServiceProviderType sp = caps.getServiceProvider();
        assertEquals("con terra GmbH", sp.getProviderName());
        assertEquals("http://www.conterra.de", sp.getProviderSite().getHref());
        ResponsiblePartySubsetType rp = sp.getServiceContact();
        assertEquals("Markus Neteler", rp.getIndividualName());
        assertEquals("GRASS leader", rp.getPositionName());
        ContactType ci = rp.getContactInfo();
        assertEquals("+49-251-7474-400", ci.getPhone().getVoice());
        assertEquals("Marting-Luther-King-Weg 24", ci.getAddress().getDeliveryPoint());
        assertEquals("Muenster", ci.getAddress().getCity());
        assertEquals("mailto:conterra@conterra.de", ci.getOnlineResource().getHref());
       
        OperationsMetadataType opm = caps.getOperationsMetadata();
        assertEquals(6, opm.getOperation().size());
        OperationType gr = (OperationType) opm.getOperation().get(0);
        assertEquals("GetRecords", gr.getName());
        DCPType dcp = (DCPType) gr.getDCP().get(0);
        RequestMethodType rm = (RequestMethodType) dcp.getHTTP().getPost().get(0);
        assertEquals("http://tc22-test:9090/soapService/services/CSWDiscovery", rm.getHref());
        assertEquals(6, gr.getParameter().size());
        DomainType param = (DomainType) gr.getParameter().get(0);
        assertEquals("TypeName", param.getName());
        assertEquals("gmd:MD_Metadata", param.getValue().get(0));
        assertEquals("csw:Record", param.getValue().get(1));
        assertEquals(2, gr.getConstraint().size());
        DomainType ct = (DomainType) gr.getConstraint().get(0);
        assertEquals("SupportedISOQueryables", ct.getName());
        assertEquals(25, ct.getValue().size());
        assertEquals("RevisionDate", ct.getValue().get(0));
        assertEquals("OperatesOnWithOpName", ct.getValue().get(24));
       
        /** This fails, caps are not getting parsed **/
        FilterCapabilities filterCapabilities = caps.getFilterCapabilities();
        assertNotNull(filterCapabilities);
        SpatialCapabilities spatial = filterCapabilities.getSpatialCapabilities();
        Collection<GeometryOperand> geoms = spatial.getGeometryOperands();
        assertEquals(4, geoms.size());
        assertTrue(geoms.contains(GeometryOperand.Envelope));
View Full Code Here

        assertFalse(id.hasEID());
    }
   
    @Test
    public void testRoundTripCapabilities() throws Exception {
        CapabilitiesType caps = (CapabilitiesType) parser.parse(getClass().getResourceAsStream("Capabilities.xml"));

        Encoder encoder = new Encoder(new CSWConfiguration());
        encoder.setIndenting(true);
        encoder.setNamespaceAware(true);
        encoder.getNamespaces().declarePrefix("ows", OWS.NAMESPACE);
        encoder.getNamespaces().declarePrefix("ogc", OGC.NAMESPACE);
        encoder.getNamespaces().declarePrefix("gml", GML.NAMESPACE);
        String encoded = encoder.encodeAsString(caps, CSW.Capabilities);
        // System.out.println(encoded);
       
        CapabilitiesType reParsed = (CapabilitiesType) parser.parse(new StringReader(encoded));
        assertTrue(EMFUtils.emfEquals(caps, reParsed));
    }
View Full Code Here

    @Test
    @SuppressWarnings("unchecked")
    public void testExtendedCapabilities() throws Exception {
        Csw20Factory cswf = Csw20Factory.eINSTANCE;
        Ows10Factory owsf = Ows10Factory.eINSTANCE;
        CapabilitiesType caps = cswf.createCapabilitiesType();
        OperationsMetadataType om = owsf.createOperationsMetadataType();
        caps.setOperationsMetadata(om);
        final String rimNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0";
        om.setExtendedCapabilities(new EncoderDelegate() {
           
            @Override
            public void encode(ContentHandler output) throws Exception {
View Full Code Here

    }

    @Override
    public CapabilitiesType getCapabilities(GetCapabilitiesType request) throws ServiceException {
        checkStore();
        CapabilitiesType caps = new GetCapabilities(this.csw, this.store, context).run(request);
       
        // check for decorator extensions
        for(CapabilitiesDecorator decorator : GeoServerExtensions.extensions(CapabilitiesDecorator.class))
        {
            caps = decorator.decorate(caps, this.store);
View Full Code Here

        if (request.getSections() != null) {
            sections = request.getSections();
        }

        // encode the response
        CapabilitiesType caps = cswf.createCapabilitiesType();
        caps.setVersion(CSW_VERSION);

        // ServiceIdentification
        if (sections == null || requestedSection("ServiceIdentification", sections)) {
            ServiceIdentificationType si = owsf.createServiceIdentificationType();
            caps.setServiceIdentification(si);

            si.setTitle(csw.getTitle());
            si.setAbstract(csw.getAbstract());

            KeywordsType kw = null;
            List<KeywordInfo> keywords = csw.getKeywords();
            if (keywords != null && keywords.size() > 0) {
                kw = owsf.createKeywordsType();
                for (KeywordInfo keyword : keywords) {
                    kw.getKeyword().add(keyword.getValue());
                }
            }

            if (kw != null) {
                si.getKeywords().add(kw);
            }

            CodeType CSW = owsf.createCodeType();
            CSW.setValue("CSW");
            si.setServiceType(CSW);
            si.setServiceTypeVersion(CSW_VERSION);
            si.setFees(csw.getFees());

            if (csw.getAccessConstraints() != null) {
                si.setAccessConstraints(csw.getAccessConstraints());
            }
        }

        // ServiceProvider
        if (sections == null || requestedSection("ServiceProvider", sections)) {
            ServiceProviderType sp = owsf.createServiceProviderType();
            caps.setServiceProvider(sp);

            final ContactInfo contact = csw.getGeoServer().getGlobal().getSettings().getContact();

            sp.setProviderName((contact.getContactOrganization() != null ? contact.getContactOrganization() : ""));

            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);
            address.setAdministrativeArea(contact.getAddressState());
            address.setCity(contact.getAddressCity());
            address.setCountry(contact.getAddressCountry());
            address.setDeliveryPoint(null);
            address.setElectronicMailAddress(contact.getContactEmail());
            address.setPostalCode(contact.getAddressPostalCode());

            contactInfo.setContactInstructions(null);
            contactInfo.setHoursOfService(null);

            OnlineResourceType onlineResource = owsf.createOnlineResourceType();
            contactInfo.setOnlineResource(onlineResource);
            onlineResource.setHref(contact.getOnlineResource());

            TelephoneType telephone = owsf.createTelephoneType();
            contactInfo.setPhone(telephone);
            telephone.setFacsimile(contact.getContactFacsimile());
            telephone.setVoice(contact.getContactVoice());

            serviceContact.setRole(null);
        }

        // Operations Metadata
        if (sections == null || requestedSection("OperationsMetadata", sections)) {
            final String baseUrl = (String) EMFUtils.get(request, "baseUrl");
            if (baseUrl == null) {
                throw new IllegalArgumentException("Request object" + request
                        + " has no 'baseUrl' property.");
            }

            OperationsMetadataType operationsMetadata = owsf.createOperationsMetadataType();
            caps.setOperationsMetadata(operationsMetadata);

            OperationMetadata_GetCapabilities(owsf, baseUrl, operationsMetadata);
            OperationMetadata_DescribeRecord(owsf, baseUrl, operationsMetadata);
            OperationMetadata_GetDomain(owsf, baseUrl, operationsMetadata);
            OperationMetadata_GetRecords(owsf, baseUrl, operationsMetadata);
            OperationMetadata_GetRecordById(owsf, baseUrl, operationsMetadata);
            if (store.getCapabilities().supportsTransactions()) {
                OperationMetadata_Transaction(owsf, baseUrl, operationsMetadata);
            }
           
            // - Parameters
            for (DomainType param : operationParameters.get("OperationsMetadata"))
            {
                // clone the object, as the caps decorators might want to modify it
                operationsMetadata.getParameter().add(EcoreUtil.copy(param));
            }

            // - Constraints
            for (DomainType constraint : operationConstraints.get("OperationsMetadata"))
            {
                // clone the object, as the caps decorators might want to modify it
                operationsMetadata.getConstraint().add(EcoreUtil.copy(constraint));
            }
        }

        // Filter Capabilities
        // this part is not optional, the schema has min = 0, so we don't check for the sections
        final FilterFactory2 ffFactory = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
        // - Spatial Capabilities
        //SpatialCapabilities spatialCapabilities = ffFactory.spatialCapabilities(geometryOperands, spatialOperands);
        SpatialCapabilities spatialCapabilities = new CSWSpatialCapabilities();
           
        // - Scalar Capabilities
        Operator[] operators = new Operator[] { ffFactory.operator("EqualTo"),
                ffFactory.operator("Like"), ffFactory.operator("LessThan"),
                ffFactory.operator("GreaterThan"), ffFactory.operator("LessThanEqualTo"),
                ffFactory.operator("GreaterThanEqualTo"), ffFactory.operator("NotEqualTo"),
                ffFactory.operator("Between"), ffFactory.operator("NullCheck") };
        ComparisonOperators comparisonOperators = ffFactory.comparisonOperators(operators);
        ArithmeticOperators arithmeticOperators = ffFactory.arithmeticOperators(true, null);
        ScalarCapabilities scalarCapabilities = ffFactory.scalarCapabilities(
                comparisonOperators, arithmeticOperators, logicalOperators);
        // - removing Arithmetic Operators...
        ((ScalarCapabilitiesImpl)scalarCapabilities).setArithmeticOperators(null);

        // - Id Capabilities
        IdCapabilities id = ffFactory.idCapabilities(eid, fid);

        FilterCapabilities filterCapabilities = ffFactory.capabilities("1.1.0",
                scalarCapabilities, spatialCapabilities, id);
       
        ((FilterCapabilitiesImpl)filterCapabilities).setScalar(scalarCapabilities);
        ((FilterCapabilitiesImpl)filterCapabilities).setSpatial(spatialCapabilities);
        ((FilterCapabilitiesImpl)filterCapabilities).setId(id);
       
        caps.setFilterCapabilities(filterCapabilities);

        return caps;
    }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetConceptualScheme(ConceptualSchemeType newConceptualScheme, NotificationChain msgs) {
        ConceptualSchemeType oldConceptualScheme = conceptualScheme;
        conceptualScheme = newConceptualScheme;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Csw20Package.DOMAIN_VALUES_TYPE__CONCEPTUAL_SCHEME, oldConceptualScheme, newConceptualScheme);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

     * <!-- end-user-doc -->
     * @generated
     */
    public static Csw20Factory init() {
        try {
            Csw20Factory theCsw20Factory = (Csw20Factory)EPackage.Registry.INSTANCE.getEFactory("http:///net/opengis/cat/csw20.ecore");
            if (theCsw20Factory != null) {
                return theCsw20Factory;
            }
        }
        catch (Exception exception) {
View Full Code Here

TOP

Related Classes of net.opengis.cat.csw20.impl.EchoedRequestTypeImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.