Search in sources :

Example 6 with DomainType

use of net.opengis.ows.v_1_0_0.DomainType in project ddf by codice.

the class TestCswFilterDelegate method getOperation.

private static Operation getOperation() {
    List<DomainType> getRecordsParameters = new ArrayList<>(6);
    DomainType typeName = new DomainType();
    typeName.setName(CswConstants.TYPE_NAME_PARAMETER);
    getRecordsParameters.add(typeName);
    DomainType outputSchema = new DomainType();
    outputSchema.setName(CswConstants.OUTPUT_SCHEMA_PARAMETER);
    getRecordsParameters.add(outputSchema);
    DomainType constraintLang = new DomainType();
    constraintLang.setName(CswConstants.CONSTRAINT_LANGUAGE_PARAMETER);
    getRecordsParameters.add(constraintLang);
    DomainType outputFormat = new DomainType();
    outputFormat.setName(CswConstants.OUTPUT_FORMAT_PARAMETER);
    getRecordsParameters.add(outputFormat);
    DomainType resultType = new DomainType();
    resultType.setName(CswConstants.RESULT_TYPE_PARAMETER);
    getRecordsParameters.add(resultType);
    DomainType elementSetName = new DomainType();
    elementSetName.setName(CswConstants.ELEMENT_SET_NAME_PARAMETER);
    getRecordsParameters.add(elementSetName);
    Operation getRecords = new Operation();
    getRecords.setName(CswConstants.GET_RECORDS);
    getRecords.setParameter(getRecordsParameters);
    List<Operation> operations = new ArrayList<>(1);
    operations.add(getRecords);
    return getRecords;
}
Also used : DomainType(net.opengis.ows.v_1_0_0.DomainType) ArrayList(java.util.ArrayList) Operation(net.opengis.ows.v_1_0_0.Operation)

Example 7 with DomainType

use of net.opengis.ows.v_1_0_0.DomainType in project ddf by codice.

the class TestCswEndpoint method verifyOperationsMetadata.

/**
     * Helper method to verify the OperationsMetadata section matches the endpoint's definition
     *
     * @param ct The CapabilitiesType to verify
     */
private void verifyOperationsMetadata(CapabilitiesType ct) {
    OperationsMetadata om = ct.getOperationsMetadata();
    List<Operation> opList = om.getOperation();
    ArrayList<String> opNames = new ArrayList<>();
    for (Operation op : opList) {
        opNames.add(op.getName());
        if (StringUtils.equals(CswConstants.TRANSACTION, op.getName()) || StringUtils.equals(CswConstants.GET_RECORDS, op.getName())) {
            for (DomainType parameter : op.getParameter()) {
                if (StringUtils.equals(CswConstants.CONSTRAINT_LANGUAGE_PARAMETER, parameter.getName())) {
                    assertThat(parameter.getValue(), contains(CswConstants.CONSTRAINT_LANGUAGE_FILTER, CswConstants.CONSTRAINT_LANGUAGE_CQL));
                } else if (StringUtils.equals(CswConstants.TYPE_NAMES_PARAMETER, parameter.getName())) {
                    // TODO : Remove conditional when GMD Metacard Transformer is merged (DDF-1976)
                    if (StringUtils.equals(op.getName(), CswConstants.TRANSACTION)) {
                        assertThat(parameter.getValue(), contains(CswConstants.CSW_RECORD));
                    } else {
                        assertThat(parameter.getValue(), hasItems(CswConstants.CSW_RECORD, GmdConstants.GMD_METACARD_TYPE_NAME));
                    }
                }
            }
        }
    }
    assertThat(opNames.contains(CswConstants.GET_CAPABILITIES), is(true));
    assertThat(opNames.contains(CswConstants.DESCRIBE_RECORD), is(true));
    assertThat(opNames.contains(CswConstants.GET_RECORDS), is(true));
    assertThat(opNames.contains(CswConstants.GET_RECORD_BY_ID), is(true));
    assertThat(opNames.contains(CswConstants.TRANSACTION), is(true));
}
Also used : OperationsMetadata(net.opengis.ows.v_1_0_0.OperationsMetadata) DomainType(net.opengis.ows.v_1_0_0.DomainType) ArrayList(java.util.ArrayList) Operation(net.opengis.ows.v_1_0_0.Operation)

Example 8 with DomainType

use of net.opengis.ows.v_1_0_0.DomainType in project ddf by codice.

the class TestCswEndpoint method testGetCapabilitiesTypeFederatedCatalogs.

@Test
public void testGetCapabilitiesTypeFederatedCatalogs() {
    GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
    CapabilitiesType ct = null;
    try {
        ct = csw.getCapabilities(gct);
    } catch (CswException e) {
        fail("CswException caught during getCapabilities GET request: " + e.getMessage());
    }
    assertThat(ct, notNullValue());
    assertThat(ct.getOperationsMetadata(), notNullValue());
    for (Operation operation : ct.getOperationsMetadata().getOperation()) {
        if (StringUtils.equals(operation.getName(), CswConstants.GET_RECORDS)) {
            for (DomainType constraint : operation.getConstraint()) {
                if (StringUtils.equals(constraint.getName(), CswConstants.FEDERATED_CATALOGS)) {
                    assertThat(constraint.getValue().size(), is(3));
                    return;
                }
            }
        }
    }
    fail("Didn't find [" + CswConstants.FEDERATED_CATALOGS + "] in request [" + CswConstants.GET_RECORDS + "]");
}
Also used : DomainType(net.opengis.ows.v_1_0_0.DomainType) CapabilitiesType(net.opengis.cat.csw.v_2_0_2.CapabilitiesType) GetCapabilitiesType(net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType) GetCapabilitiesType(net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType) CswException(org.codice.ddf.spatial.ogc.csw.catalog.common.CswException) Operation(net.opengis.ows.v_1_0_0.Operation) Test(org.junit.Test)

Example 9 with DomainType

use of net.opengis.ows.v_1_0_0.DomainType in project ddf by codice.

the class TestCswFilterDelegate method createCswFilterDelegate.

private CswFilterDelegate createCswFilterDelegate(CswSourceConfiguration cswSourceConfiguration, MetacardType type) {
    DomainType outputFormatValues = null;
    DomainType resultTypesValues = null;
    for (DomainType dt : getOperation().getParameter()) {
        if (dt.getName().equals(CswConstants.OUTPUT_FORMAT_PARAMETER)) {
            outputFormatValues = dt;
        } else if (dt.getName().equals(CswConstants.RESULT_TYPE_PARAMETER)) {
            resultTypesValues = dt;
        }
    }
    CswFilterDelegate cswFilterDelegate = new CswFilterDelegate(getOperation(), getMockFilterCapabilities(), outputFormatValues, resultTypesValues, cswSourceConfiguration);
    return cswFilterDelegate;
}
Also used : DomainType(net.opengis.ows.v_1_0_0.DomainType)

Example 10 with DomainType

use of net.opengis.ows.v_1_0_0.DomainType in project ddf by codice.

the class TestCswCqlFilter method initDefaultCswFilterDelegate.

private CswFilterDelegate initDefaultCswFilterDelegate(CswSourceConfiguration cswSourceConfiguration) {
    DomainType outputFormatValues = null;
    DomainType resultTypesValues = null;
    for (DomainType dt : getOperation().getParameter()) {
        if (dt.getName().equals(CswConstants.OUTPUT_FORMAT_PARAMETER)) {
            outputFormatValues = dt;
        } else if (dt.getName().equals(CswConstants.RESULT_TYPE_PARAMETER)) {
            resultTypesValues = dt;
        }
    }
    CswFilterDelegate localCswFilterDelegate = new CswFilterDelegate(getOperation(), getMockFilterCapabilities(), outputFormatValues, resultTypesValues, cswSourceConfiguration);
    return localCswFilterDelegate;
}
Also used : DomainType(net.opengis.ows.v_1_0_0.DomainType)

Aggregations

DomainType (net.opengis.ows.v_1_0_0.DomainType)13 Operation (net.opengis.ows.v_1_0_0.Operation)8 ArrayList (java.util.ArrayList)7 OperationsMetadata (net.opengis.ows.v_1_0_0.OperationsMetadata)4 CapabilitiesType (net.opengis.cat.csw.v_2_0_2.CapabilitiesType)3 ConformanceType (net.opengis.filter.v_2_0_0.ConformanceType)3 FilterCapabilities (net.opengis.filter.v_2_0_0.FilterCapabilities)3 DomainType (net.opengis.ows.v_1_1_0.DomainType)3 ValueType (net.opengis.ows.v_1_1_0.ValueType)3 Test (org.junit.Test)3 GetCapabilitiesType (net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType)2 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)2 GetCapabilitiesRequest (org.codice.ddf.spatial.ogc.csw.catalog.common.GetCapabilitiesRequest)2 Metacard (ddf.catalog.data.Metacard)1 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)1 SortByImpl (ddf.catalog.filter.impl.SortByImpl)1 QueryImpl (ddf.catalog.operation.impl.QueryImpl)1 QName (javax.xml.namespace.QName)1 GetRecordsType (net.opengis.cat.csw.v_2_0_2.GetRecordsType)1 SearchResultsType (net.opengis.cat.csw.v_2_0_2.SearchResultsType)1