Search in sources :

Example 31 with CapabilitiesType

use of net.opengis.cat.csw._3.CapabilitiesType in project geo-platform by geosdi.

the class CatalogCapabilitiesTest method testGetCapabilitiesRNDTWithConnector.

// @Ignore(value = "Server is Down")
@Test
public void testGetCapabilitiesRNDTWithConnector() throws Exception {
    GPCatalogConnectorStore serverConnector = newConnector().withServerUrl(new URL("https://geodati.gov.it/RNDT/csw")).build();
    CatalogGetCapabilitiesRequest<CapabilitiesType> request = serverConnector.createGetCapabilitiesRequest();
    CapabilitiesType response = request.getResponse();
    logger.info("##################CSW GET_CAPABILITIES VERSION @@@@@@@@@@@@@@@@@@@@@@@ {}", response.getVersion());
}
Also used : CapabilitiesType(org.geosdi.geoplatform.xml.csw.v202.CapabilitiesType) URL(java.net.URL) Test(org.junit.Test)

Example 32 with CapabilitiesType

use of net.opengis.cat.csw._3.CapabilitiesType in project geo-platform by geosdi.

the class CatalogCapabilitiesTest method testGetCapabilitiesWithConnector.

@Test
public void testGetCapabilitiesWithConnector() throws Exception {
    URL url = new URL("http://catalog.geosdi.org/geonetwork/srv/eng/csw");
    GPCatalogConnectorStore serverConnector = newConnector().withServerUrl(url).build();
    CatalogGetCapabilitiesRequest<CapabilitiesType> request = serverConnector.createGetCapabilitiesRequest();
    CapabilitiesType response = request.getResponse();
    logger.info("CSW GET_CAPABILITIES VERSION @@@@@@@@@@@@@@@@@@@@@@@ {}", response.getVersion());
    List<Operation> operationList = response.getOperationsMetadata().getOperation();
    for (Operation operation : operationList) {
        String operationName = operation.getName();
        if ("GetRecordById".equals(operationName)) {
            List<DomainType> parameterList = operation.getParameter();
            for (DomainType parameter : parameterList) {
                String parameterName = parameter.getName();
                if ("outputSchema".equals(parameterName)) {
                    List<String> valueList = parameter.getValue();
                    logger.info("########################### outputSchema\n");
                    for (String value : valueList) {
                        logger.info("*** {}", value);
                    }
                }
            }
        }
    }
}
Also used : DomainType(org.geosdi.geoplatform.xml.ows.v100.DomainType) CapabilitiesType(org.geosdi.geoplatform.xml.csw.v202.CapabilitiesType) Operation(org.geosdi.geoplatform.xml.ows.v100.Operation) URL(java.net.URL) Test(org.junit.Test)

Example 33 with CapabilitiesType

use of net.opengis.cat.csw._3.CapabilitiesType in project geotoolkit by Geomatys.

the class WcsXMLBindingTest method marshallingTest200.

@Test
public void marshallingTest200() throws JAXBException, IOException, ParserConfigurationException, SAXException {
    org.geotoolkit.wcs.xml.v200.GetCoverageType getCoverage = new org.geotoolkit.wcs.xml.v200.GetCoverageType("test", "image/geotiff", null);
    ParametersType param = new ParametersType();
    param.setCompression(CompressionType.NONE);
    param.setInterleave(InterleaveType.PIXEL);
    param.setJpegQuality(10);
    param.setPredictor(PredictorType.NONE);
    param.setTileheight(12);
    param.setTilewidth(15);
    param.setTiling(true);
    ObjectFactory facto = new ObjectFactory();
    getCoverage.setExtension(new ExtensionType(facto.createParameters(param)));
    StringWriter sw = new StringWriter();
    marshaller.marshal(getCoverage, sw);
    String result = sw.toString();
    String expResult = "<wcs:GetCoverage version=\"2.0.1\" service=\"WCS\" " + "xmlns:wcs=\"http://www.opengis.net/wcs/2.0\" xmlns:geotiff=\"http://www.opengis.net/gmlcov/geotiff/1.0\">" + '\n' + "    <wcs:Extension>\n" + "        <geotiff:parameters>\n" + "            <geotiff:compression>None</geotiff:compression>\n" + "            <geotiff:jpeg_quality>10</geotiff:jpeg_quality>\n" + "            <geotiff:predictor>None</geotiff:predictor>\n" + "            <geotiff:interleave>Pixel</geotiff:interleave>\n" + "            <geotiff:tiling>true</geotiff:tiling>\n" + "            <geotiff:tileheight>12</geotiff:tileheight>\n" + "            <geotiff:tilewidth>15</geotiff:tilewidth>\n" + "        </geotiff:parameters>\n" + "    </wcs:Extension>\n" + "    <wcs:CoverageId>test</wcs:CoverageId>" + '\n' + "    <wcs:format>image/geotiff</wcs:format>" + '\n' + "</wcs:GetCoverage>" + '\n';
    assertXmlEquals(expResult, result, "xmlns:*");
    final org.geotoolkit.wcs.xml.v200.GetCoverageType unmarshalled = (org.geotoolkit.wcs.xml.v200.GetCoverageType) ((JAXBElement) unmarshaller.unmarshal(new StringReader(expResult))).getValue();
    assertEquals(getCoverage, unmarshalled);
    final org.geotoolkit.gml.xml.v321.RangeSetType rangeSet = new org.geotoolkit.gml.xml.v321.RangeSetType();
    final FileType ft = new FileType();
    ft.setMimeType("image/tiff");
    final String ext = ".tif";
    ft.setRangeParameters(new AssociationRoleType("cid:grey" + ext, "http://www.opengis.net/spec/GMLCOV_geotiff-coverages/1.0/conf/geotiff-coverage", "fileReference"));
    ft.setFileReference("cid:grey" + ext);
    rangeSet.setFile(ft);
    final AbstractDiscreteCoverageType cov = new AbstractDiscreteCoverageType(new CoverageDescriptionType(), rangeSet);
    final org.geotoolkit.gmlcov.xml.v100.ObjectFactory factory = new org.geotoolkit.gmlcov.xml.v100.ObjectFactory();
    JAXBElement jb = factory.createGridCoverage(cov);
    sw = new StringWriter();
    marshaller.marshal(jb, sw);
    result = sw.toString();
    System.out.println(result);
    // test the crs extension in capabilities
    List<String> supportedFormat = new ArrayList<>();
    supportedFormat.add("image/tiff");
    supportedFormat.add("application/x-netcdf");
    List<String> supportedCrs = new ArrayList<>();
    supportedCrs.add("http://www.opengis.net/def/crs/EPSG/0/4326");
    supportedCrs.add("http://www.opengis.net/def/crs/EPSG/0/666");
    ServiceMetadataType serviceMetadata = new ServiceMetadataType(supportedFormat, supportedCrs);
    CapabilitiesType capa = new CapabilitiesType(null, null, null, "2.0.1", null, null, serviceMetadata);
    sw = new StringWriter();
    marshaller.marshal(capa, sw);
    result = sw.toString();
    System.out.println(result);
    // test the crs extension in get coverage
    String subsettingCRS = "http://www.opengis.net/def/crs/EPSG/0/4326";
    String outputCRS = "http://www.opengis.net/def/crs/EPSG/0/666";
    org.geotoolkit.wcs.xml.v200.GetCoverageType getCov = new org.geotoolkit.wcs.xml.v200.GetCoverageType("CID", "geotiff", "image/tiff", subsettingCRS, outputCRS);
    sw = new StringWriter();
    marshaller.marshal(getCov, sw);
    result = sw.toString();
    System.out.println(result);
}
Also used : AssociationRoleType(org.geotoolkit.gml.xml.v321.AssociationRoleType) ArrayList(java.util.ArrayList) AbstractDiscreteCoverageType(org.geotoolkit.gmlcov.xml.v100.AbstractDiscreteCoverageType) ObjectFactory(org.geotoolkit.gmlcov.geotiff.xml.v100.ObjectFactory) StringWriter(java.io.StringWriter) CapabilitiesType(org.geotoolkit.wcs.xml.v200.CapabilitiesType) StringReader(java.io.StringReader) CoverageDescriptionType(org.geotoolkit.wcs.xml.v200.CoverageDescriptionType) ServiceMetadataType(org.geotoolkit.wcs.xml.v200.ServiceMetadataType) GetCoverageType(org.geotoolkit.wcs.xml.v100.GetCoverageType) JAXBElement(javax.xml.bind.JAXBElement) FileType(org.geotoolkit.gml.xml.v321.FileType) ExtensionType(org.geotoolkit.wcs.xml.v200.ExtensionType) ParametersType(org.geotoolkit.gmlcov.geotiff.xml.v100.ParametersType)

Example 34 with CapabilitiesType

use of net.opengis.cat.csw._3.CapabilitiesType in project ARLAS-server by gisaia.

the class GetCapabilitiesHandler method setCapabilitiesType.

public void setCapabilitiesType(List<String> sections, String url, String urlOpenSearch) {
    capabilitiesType = new CapabilitiesType();
    capabilitiesType.setVersion(CSWConstant.SUPPORTED_CSW_VERSION);
    this.sections = sections;
    if (sections.contains("ServiceIdentification") || sections.contains("All")) {
        setServiceIdentification(capabilitiesType);
    }
    if (sections.contains("ServiceProvider") || sections.contains("All")) {
        setServiceProvider(capabilitiesType);
    }
    if (sections.contains("OperationsMetadata") || sections.contains("All")) {
        setOperations(capabilitiesType, urlOpenSearch);
        setOperationsUrl(capabilitiesType, url);
    }
    if (sections.contains("Filter_Capabilities") || sections.contains("All")) {
        setFilterCapabilities(capabilitiesType);
    }
    if (sections.contains("Languages") || sections.contains("All")) {
        CapabilitiesBaseType.Languages languages = new CapabilitiesBaseType.Languages();
        languages.getLanguage().add("FILTER");
        capabilitiesType.setLanguages(languages);
    }
}
Also used : ExtendedCapabilitiesType(eu.europa.ec.inspire.schemas.inspire_dls._1.ExtendedCapabilitiesType) CapabilitiesType(net.opengis.cat.csw._3.CapabilitiesType)

Example 35 with CapabilitiesType

use of net.opengis.cat.csw._3.CapabilitiesType in project ddf by codice.

the class CswEndpointTest method testGetCapabilitiesTypeNoVersion.

@Test
public void testGetCapabilitiesTypeNoVersion() {
    // Should return all sections
    GetCapabilitiesType gct = createDefaultGetCapabilitiesType();
    gct.setAcceptVersions(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)

Aggregations

CapabilitiesType (net.opengis.cat.csw.v_2_0_2.CapabilitiesType)45 Test (org.junit.Test)44 GetCapabilitiesType (net.opengis.cat.csw.v_2_0_2.GetCapabilitiesType)40 CswException (org.codice.ddf.spatial.ogc.csw.catalog.common.CswException)38 GetCapabilitiesRequest (org.codice.ddf.spatial.ogc.csw.catalog.common.GetCapabilitiesRequest)24 SectionsType (net.opengis.ows.v_1_0_0.SectionsType)12 CapabilitiesType (com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType)6 DomainType (net.opengis.ows.v_1_0_0.DomainType)5 Operation (net.opengis.ows.v_1_0_0.Operation)5 CapabilitiesType (org.geosdi.geoplatform.xml.csw.v202.CapabilitiesType)5 CachingMetadataType (com.evolveum.midpoint.xml.ns._public.common.common_3.CachingMetadataType)4 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)4 ScalarCapabilitiesType (net.opengis.filter.v_1_1_0.ScalarCapabilitiesType)4 Test (org.testng.annotations.Test)4 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)3 CapabilityCollectionType (com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilityCollectionType)3 PrismObject (com.evolveum.midpoint.prism.PrismObject)2 ResourceSchema (com.evolveum.midpoint.schema.processor.ResourceSchema)2 ActivationCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ActivationCapabilityType)2 Metacard (ddf.catalog.data.Metacard)2