use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class CSWServiceDelegate method getRecordById.
@Override
public String getRecordById(Long serverID, String identifier) throws Exception {
logger.trace("\n*** GetRecordById ***\n");
GeoPlatformServer server = this.getCSWServerByID(serverID);
GPCatalogConnectorStore serverConnector = this.createServerConnector(server.getServerUrl());
OutputSchema outputSchema = this.gpCSWOutputSchemaFinder.retrieveBestOutputSchemaForRequest(serverConnector, GET_RECORD_BY_ID.toString());
CatalogGetRecordByIdRequest<GetRecordByIdResponseType> request = serverConnector.createGetRecordByIdRequest();
request.setId(identifier);
request.setElementSetType(ElementSetType.FULL.value());
request.setOutputSchema(outputSchema);
String response = this.createGetRecordByIdResponseAsString(request);
String responseXSL = this.insertStylesheet(response);
return responseXSL;
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class CSWServiceDelegate method getRecordsCount.
@Override
public int getRecordsCount(CatalogFinderBean catalogFinder) throws Exception {
logger.trace("########################## getRecordsCount {}\n", catalogFinder);
GeoPlatformServer server = this.getCSWServerByID(catalogFinder.getServerID());
CatalogGetRecordsRequest<GetRecordsResponseType> request = this.createGetRecordsRequest(server.getServerUrl());
request.setTypeName(TypeName.RECORD_V202);
request.setOutputSchema(OutputSchema.CSW_V202);
request.setElementSetName(ElementSetType.BRIEF.value());
request.setResultType(ResultType.HITS.value());
request.setConstraintLanguage(ConstraintLanguage.FILTER);
request.setConstraintLanguageVersion(ConstraintLanguageVersion.V110);
request.setCatalogFinder(catalogFinder);
GetRecordsResponseType response = this.createGetRecordsResponse(request);
logger.info("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@RESPONSE : {}\n\n\n", request);
return response.getSearchResults().getNumberOfRecordsMatched().intValue();
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class CSWServiceDelegate method getServerDetailCSWByUrl.
/**
* @see GeoPlatformCSWService#getServerDetailCSWByUrl(java.lang.String)
*/
@Override
public GeoPlatformServer getServerDetailCSWByUrl(String serverUrl) throws ResourceNotFoundFault {
GeoPlatformServer server = serverDao.findByServerUrl(serverUrl);
if (server == null) {
throw new ResourceNotFoundFault("Server not found " + serverUrl);
}
// TODO assert
CSWEntityCorrectness.checkCSWServerLog(server);
return server;
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class GPWMSDelegateImpl method getCapabilitiesAuth.
/**
* @param serverUrl
* @param request
* @param token
* @param authkey
* @param headers
* @return {@link ServerDTO}
* @throws Exception
*/
@Override
public ServerDTO getCapabilitiesAuth(String serverUrl, RequestByID request, String token, String authkey, List<WMSHeaderParam> headers) throws ResourceNotFoundFault {
ServerDTO serverDTO;
String userName = null;
String password = null;
if (request.getId() != null) {
GeoPlatformServer server = serverDao.find(request.getId());
if (server == null) {
throw new ResourceNotFoundFault("Server has been deleted", request.getId());
}
serverDTO = new ServerDTO(server);
if (server.isProtected()) {
userName = server.getAuthServer().getUsername();
password = this.pooledPBEStringEncryptorDecorator.decrypt(server.getAuthServer().getPassword());
}
} else {
serverDTO = new ServerDTO();
serverDTO.setServerUrl(serverUrl);
}
List<RasterLayerDTO> layers = this.wmsCapabilitiesBuilder.loadWMSCapabilitiesAuth(serverUrl, token, authkey, headers, userName, password);
serverDTO.setLayerList(layers);
return serverDTO;
}
use of org.geosdi.geoplatform.core.model.GeoPlatformServer in project geo-platform by geosdi.
the class GPWMSDelegateImpl method getCapabilities.
/**
* @param serverUrl
* @param request
* @param token
* @param authkey
* @return {@link ServerDTO}
* @throws Exception
*/
@Override
public ServerDTO getCapabilities(String serverUrl, RequestByID request, String token, String authkey) throws ResourceNotFoundFault {
ServerDTO serverDTO;
String userName = null;
String password = null;
if (request.getId() != null) {
GeoPlatformServer server = serverDao.find(request.getId());
if (server == null) {
throw new ResourceNotFoundFault("Server has been deleted", request.getId());
}
serverDTO = new ServerDTO(server);
if (server.isProtected()) {
userName = server.getAuthServer().getUsername();
password = server.getAuthServer().getPassword();
}
} else {
serverDTO = new ServerDTO();
serverDTO.setServerUrl(serverUrl);
}
List<RasterLayerDTO> layers = this.wmsCapabilitiesBuilder.loadWMSCapabilities(serverUrl, token, authkey, userName, password);
serverDTO.setLayerList(layers);
return serverDTO;
}
Aggregations