Package net.opengis.cat.csw20.impl

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


    }
   
    @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() {
           
View Full Code Here


        return super.read(request, kvp, rawKvp);
    }

    private QueryType readQuery(Map kvp, Object request) throws Exception {
        Csw20Factory factory = Csw20Factory.eINSTANCE;
        QueryType query = factory.createQueryType();

        // parse the type names
        String typeNamesString = (String) kvp.get("typeNames");
        if(typeNamesString == null) {
            throw new ServiceException("Mandatory parameter typeNames is missing", ServiceException.MISSING_PARAMETER_VALUE, "typeNames");
        }
        NamespaceSupport namespaces = (NamespaceSupport) kvp.get("namespace");
        if (namespaces == null) {
            // by spec, "NAMSPACE, If not included, all qualified names are in default namespace"
            String outputSchema = (String) kvp.get("outputSchema");
            if (outputSchema == null || descriptors.get(outputSchema) == null) {
                outputSchema = CSW.NAMESPACE;
            }
            namespaces = descriptors.get( outputSchema).getNamespaceSupport();
        }
        List<QName> typeNames = resolver.parseQNames(typeNamesString, namespaces);
        query.setTypeNames(typeNames);
       
        // handle the element set
        ElementSetType elementSet = (ElementSetType) kvp.remove("ELEMENTSETNAME");
        if (elementSet != null) {
            ElementSetNameType esn = Csw20Factory.eINSTANCE.createElementSetNameType();
            esn.setValue(elementSet);
            esn.setTypeNames(typeNames);
            query.setElementSetName(esn);
        }
       
        // and the element names
        String elementNamesString = (String) kvp.remove("ELEMENTNAME");
        if(elementNamesString != null) {
            List<QName> elementNames = resolver.parseQNames(elementNamesString, namespaces);
            query.getElementName().addAll(elementNames);
        }

        // the filter
        if (kvp.get(CONSTRAINT) != null) {
            query.setConstraint(factory.createQueryConstraintType());
            Object language = kvp.get(CONSTRAINTLANGUAGE);
            String constraint = (String) kvp.get(CONSTRAINT);
            if (CQL_TEXT.equals(language) || language == null) {
                Filter filter = null;
                try {
View Full Code Here

   
    Parser parser = new Parser(new CSWConfiguration());

    @Test
    public void testParseDescribeRecord() throws Exception {
        DescribeRecordType dr = (DescribeRecordType) parser.parse(getClass().getResourceAsStream("DescribeRecord.xml"));
        assertEquals("CSW", dr.getService());
        assertEquals("2.0.2", dr.getVersion());
        assertEquals(2, dr.getTypeName().size());
        assertEquals(new QName("http://www.opengis.net/cat/csw/2.0.2", "Record"), dr.getTypeName().get(0));
        assertEquals(new QName("urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", "RegistryPackage"), dr.getTypeName().get(1));
    }
View Full Code Here

        raw.put("schemalanguage", "XMLSCHEMA");
        raw.put("outputFormat", "application/xml");

        DescribeRecordKvpRequestReader reader = new DescribeRecordKvpRequestReader();
        Object request = reader.createRequest();
        DescribeRecordType dr = (DescribeRecordType) reader.read(request, parseKvp(raw), raw);

        assertDescribeRecordValid(dr);
    }
View Full Code Here

        raw.put("schemalanguage", "XMLSCHEMA");
        raw.put("outputFormat", "application/xml");

        DescribeRecordKvpRequestReader reader = new DescribeRecordKvpRequestReader();
        Object request = reader.createRequest();
        DescribeRecordType dr = (DescribeRecordType) reader.read(request, parseKvp(raw), raw);

        assertDescribeRecordValid(dr);
    }
View Full Code Here

        raw.put("schemalanguage", "XMLSCHEMA");
        raw.put("outputFormat", "application/xml");

        DescribeRecordKvpRequestReader reader = new DescribeRecordKvpRequestReader();
        Object request = reader.createRequest();
        DescribeRecordType dr = (DescribeRecordType) reader.read(request, parseKvp(raw), raw);

        assertDescribeRecordValid(dr);
    }
View Full Code Here

    }

    @Test
    public void testXMLReader() throws Exception {
        CSWXmlReader reader = new CSWXmlReader("DescribeRecord", "2.0.2", new CSWConfiguration());
        DescribeRecordType dr = (DescribeRecordType) reader.read(null,
                getResourceAsReader("DescribeRecord.xml"), (Map) null);
        assertDescribeRecordValid(dr);
    }
View Full Code Here

        AttributeDescriptor[] descriptors = (AttributeDescriptor[]) value;

        Writer writer = new OutputStreamWriter(output, Charset.forName("UTF-8"));

        // find the root of the schema location
        DescribeRecordType request = (DescribeRecordType) operation.getParameters()[0];
        CSWInfo csw = gs.getService(CSWInfo.class);
        String schemaLocationRoot;
        if (csw.isCanonicalSchemaLocation()) {
            schemaLocationRoot = "http://schemas.opengis.net/csw/2.0.2";
        } else {
            schemaLocationRoot = buildSchemaURL(request.getBaseUrl(), "csw/2.0.2");
        }

        // write out the container
        writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
                + "<csw:DescribeRecordResponse xmlns:csw=\"http://www.opengis.net/cat/csw/2.0.2\" "
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetDistributedSearch(DistributedSearchType newDistributedSearch, NotificationChain msgs) {
        DistributedSearchType oldDistributedSearch = distributedSearch;
        distributedSearch = newDistributedSearch;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Csw20Package.GET_RECORDS_TYPE__DISTRIBUTED_SEARCH, oldDistributedSearch, newDistributedSearch);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

        String ds = (String) kvp.remove("distributedSearch");
        Integer hopCount = (Integer) kvp.remove("hopCount");
        if (rawKvp.containsKey("distributedSearch")) {

            if ("true".equalsIgnoreCase(ds)) {
                DistributedSearchType dst = Csw20Factory.eINSTANCE.createDistributedSearchType();
                if (hopCount != null) {
                    dst.setHopCount(hopCount);
                } else {
                    dst.setHopCount(2);
                }
                kvp.put("distributedSearch", dst);
            }
        }
View Full Code Here

TOP

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

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.