use of org.geosdi.geoplatform.request.viewport.ManageViewportRequest in project geo-platform by geosdi.
the class RSViewportTest method replaceViewportListTestRest.
@Test
public void replaceViewportListTestRest() throws Exception {
Collection<GPViewport> viewports = super.createMassiveViewports();
gpWSClient.saveOrUpdateViewportList(new ManageViewportRequest(idAccountProject, new ArrayList<>(viewports)));
Assert.assertEquals(80, gpWSClient.getAccountProjectViewports(idAccountProject).getViewports().size());
gpWSClient.replaceViewportList(new ManageViewportRequest(idAccountProject, new ArrayList<>(createViewportListToReplace())));
Collection<GPViewport> viewportsReplacedFound = gpWSClient.getAccountProjectViewports(idAccountProject).getViewports();
Assert.assertEquals(20, viewportsReplacedFound.size());
logger.trace("\n\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ COLLECTION_" + "VIEWPORT_REPLACED : {}", viewportsReplacedFound);
}
use of org.geosdi.geoplatform.request.viewport.ManageViewportRequest in project geo-platform by geosdi.
the class MapService method replaceViewportList.
@Override
public void replaceViewportList(List<GPClientViewport> viewportList, HttpServletRequest httpServletRequest) throws GeoPlatformException {
GPAccount account;
Long projectID;
try {
account = this.sessionUtility.getLoggedAccount(httpServletRequest);
projectID = this.sessionUtility.getDefaultProject(httpServletRequest);
} catch (GPSessionTimeout timeout) {
throw new GeoPlatformException(timeout);
}
try {
GPAccountProject accountProject = this.geoPlatformServiceClient.getAccountProjectByAccountAndProjectIDs(account.getId(), projectID);
this.geoPlatformServiceClient.replaceViewportList(new ManageViewportRequest(accountProject.getId(), convertClientViewportToDTO(viewportList)));
} catch (ResourceNotFoundFault | IllegalParameterFault rnff) {
logger.error("Error on MapService: " + rnff);
throw new GeoPlatformException(rnff);
}
}
use of org.geosdi.geoplatform.request.viewport.ManageViewportRequest in project geo-platform by geosdi.
the class RSViewportTest method insertMassiveViewportTestRest.
@Test
public void insertMassiveViewportTestRest() throws Exception {
Collection<GPViewport> viewports = super.createMassiveViewports();
gpWSClient.saveOrUpdateViewportList(new ManageViewportRequest(idAccountProject, new ArrayList<>(viewports)));
Collection<GPViewport> viewportsFound = gpWSClient.getAccountProjectViewports(idAccountProject).getViewports();
logger.trace("\n\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@FOUND {} " + "@@@@@@@@@@@@@@@@@@@@@@@@@\n\n", viewportsFound);
Assert.assertEquals(80, viewportsFound.size());
GPViewport defaultVieport = gpWSClient.getDefaultViewport(idAccountProject);
logger.trace("\n\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@DEFAULT_VIEWPORT " + "Found : {}@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n", defaultVieport);
Assert.assertEquals("Viewport0-Rest", defaultVieport.getName());
Assert.assertEquals(0.0, defaultVieport.getZoomLevel(), 0.0);
}
Aggregations