private Geodesk getGeodesk() { if (geodesk == null) { try { geodesk = geodeskService.getGeodeskByPublicId(geodeskId); } catch (GeomajasSecurityException e) { e.printStackTrace(); } } return geodesk; }
public ClientMapInfo getMapInfo(String mapId, String applicationId) { try { // FIXME: code duplication from GetConfigurationCommand. move to service! String id = applicationId; Geodesk geodesk = geodeskService.getGeodeskByPublicId(id); // this checks if geodesk is allowed if (geodesk != null) { // request from cache ClientApplicationInfo geodeskConfig = getClonedGeodeskConfiguration(geodesk); for (ClientMapInfo map : geodeskConfig.getMaps()) { if (map.getId().equals(mapId)) { return map; } } } } catch (GeomajasSecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
private void buildDeskmanagerAuthorizationInfo() { // Set basic authorization info (from configuration) deskmanagerAuthorizationInfo = (DeskmanagerAuthorizationInfo) deskmanagerAuthorizationInfos.get( profile.getRole().toString()).clone(); // Add geodesk specific authorization if (geodeskId != null && !RetrieveRolesRequest.MANAGER_ID.equals(geodeskId) && isGeodeskUseAllowed(geodeskId)) { try { LOG.debug("building deskmanagerAauthorizationInfo"); Geodesk geodesk = geodeskService.getGeodeskByPublicId(geodeskId); ClientApplicationInfo geodeskInfo = applicationContext.getBean(GeodeskConfigurationService.class) .createGeodeskConfiguration(geodesk, true); // Add all layers visible in this geodesk if (geodeskInfo != null) { for (ClientMapInfo map : geodeskInfo.getMaps()) { for (ClientLayerInfo layer : map.getLayers()) { // Add layers if they are public, or the user is not guest. if (!profile.getRole().equals(Role.GUEST) || layerModelService. getLayerModelByClientLayerIdInternal(layer.getId()).isPublic()) { deskmanagerAuthorizationInfo.getVisibleLayersInclude().add(layer.getServerLayerId()); } } } } } catch (GeomajasSecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }