Search in sources :

Example 1 with CasProcessEPSGResultRequest

use of org.geosdi.geoplatform.gui.client.command.publish.cas.CasProcessEPSGResultRequest in project geo-platform by geosdi.

the class CasProcessEPSGResultCommand method execute.

@Override
public ProcessEPSGResultResponse execute(CasProcessEPSGResultRequest request, HttpServletRequest httpServletRequest) {
    GPAccount account;
    try {
        account = sessionUtility.getLoggedAccount(httpServletRequest);
    } catch (GPSessionTimeout timeout) {
        throw new GeoPlatformException(timeout);
    }
    List<EPSGLayerData> previewLayerList = request.getPreviewLayerList();
    try {
        List<InfoPreview> resultList = casPublisherService.processEPSGResult(new ProcessEPSGResultRequest(account.getNaturalID(), this.trasformPreviewLayerList(previewLayerList), request.getWorkspace())).getInfoPreviews();
        return new ProcessEPSGResultResponse(generateJSONObjects(resultList));
    } catch (Exception ex) {
        ex.printStackTrace();
        throw new GeoPlatformException("Error on publish shape.");
    }
}
Also used : GPAccount(org.geosdi.geoplatform.core.model.GPAccount) EPSGLayerData(org.geosdi.geoplatform.gui.client.model.EPSGLayerData) CasProcessEPSGResultRequest(org.geosdi.geoplatform.gui.client.command.publish.cas.CasProcessEPSGResultRequest) ProcessEPSGResultRequest(org.geosdi.geoplatform.request.ProcessEPSGResultRequest) InfoPreview(org.geosdi.geoplatform.responce.InfoPreview) GPSessionTimeout(org.geosdi.geoplatform.gui.utility.GPSessionTimeout) GeoPlatformException(org.geosdi.geoplatform.gui.global.GeoPlatformException) GeoPlatformException(org.geosdi.geoplatform.gui.global.GeoPlatformException) ProcessEPSGResultResponse(org.geosdi.geoplatform.gui.client.command.publish.basic.ProcessEPSGResultResponse)

Aggregations

GPAccount (org.geosdi.geoplatform.core.model.GPAccount)1 ProcessEPSGResultResponse (org.geosdi.geoplatform.gui.client.command.publish.basic.ProcessEPSGResultResponse)1 CasProcessEPSGResultRequest (org.geosdi.geoplatform.gui.client.command.publish.cas.CasProcessEPSGResultRequest)1 EPSGLayerData (org.geosdi.geoplatform.gui.client.model.EPSGLayerData)1 GeoPlatformException (org.geosdi.geoplatform.gui.global.GeoPlatformException)1 GPSessionTimeout (org.geosdi.geoplatform.gui.utility.GPSessionTimeout)1 ProcessEPSGResultRequest (org.geosdi.geoplatform.request.ProcessEPSGResultRequest)1 InfoPreview (org.geosdi.geoplatform.responce.InfoPreview)1