Search in sources :

Example 6 with GetCapabilitiesType

use of net.opengis.sos.x20.GetCapabilitiesType in project arctic-sea by 52North.

the class SosDecoderv20 method parseGetCapabilities.

/**
 * parses the XmlBean representing the getCapabilities request and creates a
 * SosGetCapabilities request
 *
 * @param getCapsDoc
 *            XmlBean created from the incoming request stream
 * @return Returns SosGetCapabilitiesRequest representing the request
 *
 * @throws DecodingException
 *             * If parsing the XmlBean failed
 */
private OwsServiceRequest parseGetCapabilities(final GetCapabilitiesDocument getCapsDoc) throws DecodingException {
    final GetCapabilitiesType getCapsType = getCapsDoc.getGetCapabilities2();
    final GetCapabilitiesRequest request = new GetCapabilitiesRequest(getCapsType.getService());
    if (getCapsType.getAcceptFormats() != null && getCapsType.getAcceptFormats().sizeOfOutputFormatArray() != 0) {
        request.setAcceptFormats(Arrays.asList(getCapsType.getAcceptFormats().getOutputFormatArray()));
    }
    if (getCapsType.getAcceptVersions() != null && getCapsType.getAcceptVersions().sizeOfVersionArray() != 0) {
        request.setAcceptVersions(Arrays.asList(getCapsType.getAcceptVersions().getVersionArray()));
    }
    if (getCapsType.getSections() != null && getCapsType.getSections().getSectionArray().length != 0) {
        request.setSections(Arrays.asList(getCapsType.getSections().getSectionArray()));
    }
    if (getCapsType.getExtensionArray() != null && getCapsType.getExtensionArray().length > 0) {
        request.setExtensions(parseExtensibleRequestExtension(getCapsType.getExtensionArray()));
    }
    return request;
}
Also used : GetCapabilitiesRequest(org.n52.shetland.ogc.ows.service.GetCapabilitiesRequest) GetCapabilitiesType(net.opengis.sos.x20.GetCapabilitiesType)

Example 7 with GetCapabilitiesType

use of net.opengis.sos.x20.GetCapabilitiesType in project arctic-sea by 52North.

the class GetCapabilitiesRequestEncoder method create.

@Override
protected XmlObject create(GetCapabilitiesRequest request) throws EncodingException {
    GetCapabilitiesDocument doc = GetCapabilitiesDocument.Factory.newInstance(getXmlOptions());
    GetCapabilitiesType gct = doc.addNewGetCapabilities2();
    addService(gct, request);
    addAcceptVersion(gct, request);
    addSections(gct, request);
    return doc;
}
Also used : GetCapabilitiesType(net.opengis.sos.x20.GetCapabilitiesType) GetCapabilitiesDocument(net.opengis.sos.x20.GetCapabilitiesDocument)

Example 8 with GetCapabilitiesType

use of net.opengis.sos.x20.GetCapabilitiesType in project ddf by codice.

the class TestCswEndpoint method createDefaultGetCapabilitiesType.

/**
     * Creates default GetCapabilities POST request, with no sections specified
     *
     * @return Vanilla GetCapabilitiesType object
     */
private GetCapabilitiesType createDefaultGetCapabilitiesType() {
    GetCapabilitiesType gct = new GetCapabilitiesType();
    gct.setService(CswConstants.CSW);
    AcceptVersionsType avt = new AcceptVersionsType();
    avt.setVersion(CswEndpoint.SERVICE_TYPE_VERSION);
    gct.setAcceptVersions(avt);
    return gct;
}
Also used : GetCapabilitiesType(net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType) AcceptVersionsType(net.opengis.ows.v_1_0_0.AcceptVersionsType)

Example 9 with GetCapabilitiesType

use of net.opengis.sos.x20.GetCapabilitiesType in project ddf by codice.

the class TestCswEndpoint method testGetCapabilitiesTypeNoSections.

@Test
public void testGetCapabilitiesTypeNoSections() {
    // Should return all sections
    GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
    gct.setSections(null);
    CapabilitiesType ct = null;
    try {
        ct = csw.getCapabilities(gct);
    } catch (CswException e) {
        fail("CswException caught during getCapabilities GET request: " + e.getMessage());
    }
    assertThat(ct, notNullValue());
    verifyOperationsMetadata(ct);
    verifyServiceIdentification(ct);
    verifyServiceProvider(ct);
    verifyFilterCapabilities(ct);
}
Also used : 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) Test(org.junit.Test)

Example 10 with GetCapabilitiesType

use of net.opengis.sos.x20.GetCapabilitiesType in project ddf by codice.

the class TestCswEndpoint method testGetCapabilitiesTypeOperationsMetadata.

@Test
public void testGetCapabilitiesTypeOperationsMetadata() {
    // Should only return the OperationsMetadata section
    GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
    SectionsType stv = new SectionsType();
    stv.setSection(Arrays.asList(CswEndpoint.OPERATIONS_METADATA));
    gct.setSections(stv);
    CapabilitiesType ct = null;
    try {
        ct = csw.getCapabilities(gct);
    } catch (CswException e) {
        fail("CswException caught during getCapabilities GET request: " + e.getMessage());
    }
    assertThat(ct, notNullValue());
    verifyOperationsMetadata(ct);
    verifyFilterCapabilities(ct);
    assertThat(ct.getServiceIdentification(), nullValue());
    assertThat(ct.getServiceProvider(), nullValue());
}
Also used : SectionsType(net.opengis.ows.v_1_0_0.SectionsType) 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) Test(org.junit.Test)

Aggregations

GetCapabilitiesType (net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType)10 CapabilitiesType (net.opengis.cat.csw.v_2_0_2.CapabilitiesType)9 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)9 Test (org.junit.Test)9 SectionsType (net.opengis.ows.v_1_0_0.SectionsType)6 GetCapabilitiesType (net.opengis.sos.x20.GetCapabilitiesType)2 AcceptVersionsType (net.opengis.ows.v_1_0_0.AcceptVersionsType)1 DomainType (net.opengis.ows.v_1_0_0.DomainType)1 Operation (net.opengis.ows.v_1_0_0.Operation)1 GetCapabilitiesDocument (net.opengis.sos.x20.GetCapabilitiesDocument)1 GetCapabilitiesRequest (org.n52.shetland.ogc.ows.service.GetCapabilitiesRequest)1