Search in sources :

Example 1 with CatalogCapabilities

use of org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities in project geo-platform by geosdi.

the class CSWServiceDelegate method saveServerCSW.

/**
 * @see {@link GeoPlatformCSWService#saveServerCSW(String, String, String)},
 * java.lang.String)
 */
@Override
public ServerCSWDTO saveServerCSW(String alias, String serverUrl, String organization) throws IllegalParameterFault {
    serverUrl = this.deleteQueryStringFromURL(serverUrl);
    GeoPlatformServer server = serverDao.findByServerUrl(serverUrl);
    if (server != null) {
        // If there is already a server with the specified URLs
        return new ServerCSWDTO(server);
    }
    GPOrganization org = organizationDao.findByName(organization);
    if (org == null) {
        throw new IllegalParameterFault("CSW Server to save have an organization that does not exist");
    }
    try {
        CatalogCapabilities capabilities = catalogCapabilitiesBean.bindUrl(serverUrl);
        server = new GeoPlatformServer();
        server.setServerType(GPCapabilityType.CSW);
        server.setServerUrl(serverUrl);
        server.setAliasName(alias);
        server.setOrganization(org);
        server.setTitle(capabilities.getServiceIdentification().getTitle());
        server.setAbstractServer(capabilities.getServiceIdentification().getAbstractText());
        server.setName(capabilities.getServiceProvider().getProviderName());
        // TODO assert
        CSWEntityCorrectness.checkCSWServer(server);
        serverDao.persist(server);
    } catch (Exception ex) {
        logger.error("### MalformedURLException: {}", ex.getMessage());
        throw new IllegalParameterFault("Exception : " + ex.getMessage());
    }
    return new ServerCSWDTO(server);
}
Also used : CatalogCapabilities(org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities) GeoPlatformServer(org.geosdi.geoplatform.core.model.GeoPlatformServer) IllegalParameterFault(org.geosdi.geoplatform.exception.IllegalParameterFault) ServerCSWDTO(org.geosdi.geoplatform.responce.ServerCSWDTO) GPOrganization(org.geosdi.geoplatform.core.model.GPOrganization) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException)

Example 2 with CatalogCapabilities

use of org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities in project geo-platform by geosdi.

the class CatalogCapabilitiesTest method testCapabilitiesV201.

@Test
@Ignore(value = "Server is DOWN")
public void testCapabilitiesV201() throws Exception {
    CatalogCapabilities catalogGetCapabilities = catalogCapabilitiesBean.bindUrl("http://catalogocentrale.nsdi.it/geonetwork/srv/en/csw");
    logger.info("@@@@@@@@@@@@@@@ CATALOG CAPABILITIES BEAN V_2.0.1@@@@@@@@@@@@@@@@@@@@@@@ " + catalogGetCapabilities);
}
Also used : CatalogCapabilities(org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 3 with CatalogCapabilities

use of org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities in project geo-platform by geosdi.

the class CatalogCapabilitiesTest method testCapabilitiesV202.

@Test
public // @Ignore("SERVER IS DOWN")
void testCapabilitiesV202() throws Exception {
    CatalogCapabilities catalogGetCapabilities = catalogCapabilitiesBean.bindUrl("http://rsdi.regione.basilicata.it/Catalogo/srv/en/csw");
    logger.info("CATALOG CAPABILITIES BEAN V_2.0.2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ " + catalogGetCapabilities);
}
Also used : CatalogCapabilities(org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities) Test(org.junit.Test)

Example 4 with CatalogCapabilities

use of org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities in project geo-platform by geosdi.

the class CatalogGetCapabilitiesBean method bindUrl.

/**
 * <p>
 *      Bind CSW_202 Server URL with Control for Server Version. The standard CSW_202 Server version must be 2.0.2.
 * </p>
 *
 * @param urlServer
 * @return CatalogCapabilities
 * @throws Exception
 */
@Override
public CatalogCapabilities bindUrl(@Nonnull(when = NEVER) String urlServer) throws Exception {
    checkArgument((urlServer != null) && !(urlServer.trim().isEmpty()), "The Parameter urlServer must not be null or an empty string.");
    CatalogCapabilities catalogGetCapabilities = this.connect(urlServer);
    this.checkCSWServerVersion(catalogGetCapabilities);
    return catalogGetCapabilities;
}
Also used : CatalogCapabilities(org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities)

Example 5 with CatalogCapabilities

use of org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities in project geo-platform by geosdi.

the class CatalogCapabilitiesTest method testCapabilitiesV201WithoutVersionControl.

@Test
@Ignore(value = "Server is DOWN")
public void testCapabilitiesV201WithoutVersionControl() throws Exception {
    CatalogCapabilities catalogGetCapabilities = catalogCapabilitiesBean.bindUrlWithoutVersionControl("http://catalogocentrale.nsdi.it/geonetwork/srv/eng/csw?SERVICE");
    logger.info("@@@@@@@@@@@@@@@ CATALOG CAPABILITIES BEAN V_2.0.1 WITHOUT VERSION CONTROL@@@@@@@@@@@@@@@@@@@@@@@ " + catalogGetCapabilities);
}
Also used : CatalogCapabilities(org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

CatalogCapabilities (org.geosdi.geoplatform.connector.api.capabilities.model.csw.CatalogCapabilities)6 Test (org.junit.Test)4 Ignore (org.junit.Ignore)3 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 GPOrganization (org.geosdi.geoplatform.core.model.GPOrganization)1 GeoPlatformServer (org.geosdi.geoplatform.core.model.GeoPlatformServer)1 IllegalParameterFault (org.geosdi.geoplatform.exception.IllegalParameterFault)1 ServerCSWDTO (org.geosdi.geoplatform.responce.ServerCSWDTO)1