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);
}
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);
}
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);
}
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;
}
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);
}
Aggregations