use of org.geosdi.geoplatform.request.folder.InsertFolderRequest in project geo-platform by geosdi.
the class LayerService method saveFolder.
@Override
public Long saveFolder(Long idParentFolder, String folderName, int position, int numberOfDescendants, boolean isChecked, HttpServletRequest httpServletRequest) throws GeoPlatformException {
try {
this.sessionUtility.getLoggedAccount(httpServletRequest);
} catch (GPSessionTimeout timeout) {
throw new GeoPlatformException(timeout);
}
GPFolder gpFolder = null;
try {
gpFolder = geoPlatformServiceClient.getFolderDetail(idParentFolder);
} catch (Exception e) {
logger.error("LayerService", "Ubable to load Folder with ID : " + idParentFolder);
throw new GeoPlatformException("The Folder with ID : " + idParentFolder + " was deleted.");
}
GPFolder folder = new GPFolder();
folder.setName(folderName);
folder.setPosition(position);
folder.setShared(false);
folder.setParent(gpFolder);
folder.setNumberOfDescendants(numberOfDescendants);
folder.setChecked(isChecked);
Long projectId;
// folder.setProject(project);
Long savedFolderId = null;
try {
projectId = this.sessionUtility.getDefaultProject(httpServletRequest);
savedFolderId = this.geoPlatformServiceClient.insertFolder(new InsertFolderRequest(projectId, folder));
} catch (IllegalParameterFault ilg) {
logger.error("Error on LayerService: " + ilg);
throw new GeoPlatformException("Parameter incorrect on saveFolde");
} catch (ResourceNotFoundFault rnff) {
logger.error("Error on LayerService: " + rnff);
throw new GeoPlatformException(rnff);
} catch (GPSessionTimeout timeout) {
throw new GeoPlatformException(timeout);
}
return savedFolderId;
}
use of org.geosdi.geoplatform.request.folder.InsertFolderRequest in project geo-platform by geosdi.
the class ServiceTest method createAndInsertFolder.
protected long createAndInsertFolder(String folderName, GPProject project, int position, GPFolder parent, int numberOfDescendants) throws ResourceNotFoundFault, IllegalParameterFault {
GPFolder folder = this.createFolder(folderName, project, position, parent);
folder.setNumberOfDescendants(numberOfDescendants);
return gpWSClient.insertFolder(new InsertFolderRequest(project.getId(), folder));
}
use of org.geosdi.geoplatform.request.folder.InsertFolderRequest in project geo-platform by geosdi.
the class LayerService method saveFolderForUser.
@Override
public Long saveFolderForUser(String folderName, int position, int numberOfDescendants, boolean isChecked, HttpServletRequest httpServletRequest) throws GeoPlatformException {
GPFolder folder = new GPFolder();
folder.setName(folderName);
folder.setPosition(position);
folder.setShared(false);
Long projectId;
try {
projectId = this.sessionUtility.getDefaultProject(httpServletRequest);
this.sessionUtility.getLoggedAccount(httpServletRequest);
} catch (GPSessionTimeout timeout) {
throw new GeoPlatformException(timeout);
}
folder.setNumberOfDescendants(numberOfDescendants);
folder.setChecked(isChecked);
Long savedFolderId;
try {
savedFolderId = this.geoPlatformServiceClient.insertFolder(new InsertFolderRequest(projectId, folder));
} catch (IllegalParameterFault ilg) {
logger.error("Error on LayerService: " + ilg);
throw new GeoPlatformException("Parameter incorrect on saveFoldeForUser");
} catch (ResourceNotFoundFault rnff) {
logger.error("Error on LayerService: " + rnff);
throw new GeoPlatformException(rnff);
}
return savedFolderId;
}
use of org.geosdi.geoplatform.request.folder.InsertFolderRequest in project geo-platform by geosdi.
the class GPJacksonFolderSupportTest method insertFolderRequestDataMapperTest.
@Test
public void insertFolderRequestDataMapperTest() throws Exception {
InsertFolderRequest insertFolderRequest = jacksonSupport.getDefaultMapper().readValue(Thread.currentThread().getContextClassLoader().getResourceAsStream(INSERT_FOLDER_REQUEST_DATA_JSON), InsertFolderRequest.class);
logger.info("\n\n@@@@@@@@@@@@@@@@@@@@INSERT_FOLDER_REQUEST_DATA_MAPPING" + " : {}\n\n", insertFolderRequest);
super.marshall(insertFolderRequest);
}
Aggregations