Package net.opengis.cat.csw20

Examples of net.opengis.cat.csw20.GetCapabilitiesType


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

    @Test
    public void testParseGetRecordsEbrimBrief() throws Exception {
        GetRecordsType gr = (GetRecordsType) parser.parse(getClass().getResourceAsStream(
                "GetRecordsBrief.xml"));
        assertEquals("CSW", gr.getService());
        assertEquals("2.0.2", gr.getVersion());

        // check the attributes
        assertEquals("application/xml", gr.getOutputFormat());
        assertEquals("urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", gr.getOutputSchema());

        // the query
        QueryType query = (QueryType) gr.getQuery();
        List<QName> expected = new ArrayList<QName>();
        String rimNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0";
        expected.add(new QName(rimNamespace, "Service"));
        expected.add(new QName(rimNamespace, "Classification"));
        expected.add(new QName(rimNamespace, "Association"));
View Full Code Here


        assertEquals(SortOrder.DESCENDING, sorts[1].getSortOrder());
    }

    @Test
    public void testParseGetRecordsFilterSimple() throws Exception {
        GetRecordsType gr = (GetRecordsType) parser.parse(getClass().getResourceAsStream(
                "GetRecordsFilterSimple.xml"));

        // check the attributes
        assertEquals("CSW", gr.getService());
        assertEquals("2.0.2", gr.getVersion());
        assertEquals("application/xml", gr.getOutputFormat());
        assertEquals("http://www.opengis.net/cat/csw/2.0.2", gr.getOutputSchema());
        assertEquals(new Integer(1), gr.getStartPosition());
        assertEquals(new Integer(5), gr.getMaxRecords());
        assertEquals(ResultType.RESULTS, gr.getResultType());

        // the query
        QueryType query = (QueryType) gr.getQuery();
        List<QName> expected = new ArrayList<QName>();
        expected.add(new QName("http://www.opengis.net/cat/csw/2.0.2", "Record"));
        assertEquals(expected, query.getTypeNames());

        // the element names
View Full Code Here

        raw.put("hopCount", "10");
        raw.put("responsehandler", "http://www.geoserver.org");
        GetRecordsKvpRequestReader reader = new GetRecordsKvpRequestReader();
        reader.setApplicationContext(applicationContext);
        Object request = reader.createRequest();
        GetRecordsType gr = (GetRecordsType) reader.read(request, parseKvp(raw), raw);

        // basic checks
        assertEquals("CSW", gr.getService());
        assertEquals("2.0.2", gr.getVersion());
        assertEquals(ResultType.RESULTS, gr.getResultType());
        assertEquals("myId", gr.getRequestId());
        assertEquals("application/xml", gr.getOutputFormat());
        assertEquals("http://www.opengis.net/cat/csw/2.0.2", gr.getOutputSchema());
        assertNotNull(gr.getDistributedSearch());
        assertEquals(new Integer(10), gr.getDistributedSearch().getHopCount());
        assertEquals("http://www.geoserver.org", gr.getResponseHandler());

        // now onto the query
        QueryType query = (QueryType) gr.getQuery();
        assertEquals("AnyText like '%pollution%'", query.getConstraint().getCqlText());
        assertEquals(2, query.getTypeNames().size());
        assertEquals(new QName("http://www.opengis.net/cat/csw/2.0.2", "Record"), query
                .getTypeNames().get(0));
        assertEquals(new QName("urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", "RegistryPackage"),
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetListOfValues(ListOfValuesType newListOfValues, NotificationChain msgs) {
        ListOfValuesType oldListOfValues = listOfValues;
        listOfValues = newListOfValues;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Csw20Package.DOMAIN_VALUES_TYPE__LIST_OF_VALUES, oldListOfValues, newListOfValues);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetConstraint(QueryConstraintType newConstraint, NotificationChain msgs) {
        QueryConstraintType oldConstraint = constraint;
        constraint = newConstraint;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Csw20Package.UPDATE_TYPE__CONSTRAINT, oldConstraint, newConstraint);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetConstraint(QueryConstraintType newConstraint, NotificationChain msgs) {
        QueryConstraintType oldConstraint = constraint;
        constraint = newConstraint;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Csw20Package.QUERY_TYPE__CONSTRAINT, oldConstraint, newConstraint);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetConstraint(QueryConstraintType newConstraint, NotificationChain msgs) {
        QueryConstraintType oldConstraint = constraint;
        constraint = newConstraint;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Csw20Package.DELETE_TYPE__CONSTRAINT, oldConstraint, newConstraint);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

        assertEquals(2, names.size());
        assertEquals(new QName("http://purl.org/dc/terms/", "abstract"), names.get(0));
        assertEquals(new QName("http://purl.org/dc/elements/1.1/", "title"), names.get(1));

        // The filter
        QueryConstraintType constraint = query.getConstraint();
        assertEquals("1.1.0", constraint.getVersion());
        Filter filter = CQL.toFilter("AnyText like '%polution%'");
        assertEquals(filter, constraint.getFilter());
    }
View Full Code Here

        // check the attributes
        assertEquals("application/xml", gr.getOutputFormat());
        assertEquals("urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", gr.getOutputSchema());

        // the query
        QueryType query = (QueryType) gr.getQuery();
        List<QName> expected = new ArrayList<QName>();
        String rimNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0";
        expected.add(new QName(rimNamespace, "Service"));
        expected.add(new QName(rimNamespace, "Classification"));
        expected.add(new QName(rimNamespace, "Association"));
        assertEquals(expected, query.getTypeNames());

        // the element set name
        ElementSetNameType esn = query.getElementSetName();
        expected.clear();
        expected.add(new QName(rimNamespace, "Service"));
        assertEquals(expected, esn.getTypeNames());
        assertEquals(ElementSetType.BRIEF, esn.getValue());
       
        // the sort by properties
        SortBy[] sorts = query.getSortBy();
        assertEquals(2, sorts.length);
        assertEquals("rim:foo", sorts[0].getPropertyName().getPropertyName());
        assertEquals(SortOrder.ASCENDING, sorts[0].getSortOrder());
        assertEquals("rim:bar", sorts[1].getPropertyName().getPropertyName());
        assertEquals(SortOrder.DESCENDING, sorts[1].getSortOrder());
View Full Code Here

        assertEquals(new Integer(1), gr.getStartPosition());
        assertEquals(new Integer(5), gr.getMaxRecords());
        assertEquals(ResultType.RESULTS, gr.getResultType());

        // the query
        QueryType query = (QueryType) gr.getQuery();
        List<QName> expected = new ArrayList<QName>();
        expected.add(new QName("http://www.opengis.net/cat/csw/2.0.2", "Record"));
        assertEquals(expected, query.getTypeNames());

        // the element names
        List<QName> names = query.getElementName();
        assertEquals(2, names.size());
        assertEquals(new QName("http://purl.org/dc/terms/", "abstract"), names.get(0));
        assertEquals(new QName("http://purl.org/dc/elements/1.1/", "title"), names.get(1));

        // The filter
        QueryConstraintType constraint = query.getConstraint();
        assertEquals("1.1.0", constraint.getVersion());
        Filter filter = CQL.toFilter("AnyText like '%polution%'");
        assertEquals(filter, constraint.getFilter());
    }
View Full Code Here

TOP

Related Classes of net.opengis.cat.csw20.GetCapabilitiesType

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.