l.setActive(dto.isActive()); l.setBlueprint(fromDto(dto.getBlueprint())); l.setCreationBy(dto.getCreationBy()); l.setCreationDate(dto.getCreationDate()); l.setId(dto.getId()); l.setLastEditBy(dto.getLastEditBy()); l.setLastEditDate(dto.getLastEditDate()); l.setGeodeskId(dto.getGeodeskId()); l.setLimitToCreatorTerritory(dto.isLimitToCreatorTerritory()); l.setLimitToUserTerritory(dto.isLimitToUserTerritory()); l.setName(dto.getName()); l.setPublic(dto.isPublic()); l.setOwner(fromDto(dto.getOwner(), false, false)); List<Territory> territories = l.getTerritories(); l.setApplicationClientWidgetInfos(dto.getApplicationClientWidgetInfos()); l.setMainMapClientWidgetInfos(dto.getMainMapClientWidgetInfos()); l.setOverviewMapClientWidgetInfos(dto.getOverviewMapClientWidgetInfos()); if (dto.getTerritories() != null && dto.getTerritories().size() > 0) { for (TerritoryDto gDto : dto.getTerritories()) { territories.add(fromDto(gDto, false, false)); if (dto.getMainMapLayers() != null) { for (LayerDto layer : dto.getMainMapLayers()) { mainLayers.add(fromDto(layer)); if (dto.getOverviewMapLayers() != null) { for (LayerDto layer : dto.getOverviewMapLayers()) { overviewLayers.add(fromDto(layer));
public void execute(GetClientLayersResponse result) { if (geodesk.getMainMapLayers() == null || geodesk.getMainMapLayers().size() == 0) { //If no layers is set, present default from blueprint layerSelect.setValues(geodesk.getBlueprint().getMainMapLayers(), result.getLayers(), geodesk.getBlueprint().getMainMapLayers(), !geodesk.isPublic()); } else { layerSelect.setValues(geodesk.getBlueprint().getMainMapLayers(), result.getLayers(), geodesk.getMainMapLayers(), !geodesk.isPublic()); } fireChangedHandler(); }
private ListGridRecord toGridRecord(GeodeskDto loket) { ListGridRecord record = new ListGridRecord(); record.setAttribute(FLD_ID, loket.getId()); record.setAttribute(FLD_NAME, loket.getName()); record.setAttribute(FLD_BLUEPRINT, loket.getBlueprint().getName()); record.setAttribute(FLD_AUTHOR, loket.getLastEditBy()); record.setAttribute(FLD_PUBLIC, loket.isPublic()); record.setAttribute(FLD_ACTIVE, loket.isActive() && loket.getBlueprint().isGeodesksActive()); record.setAttribute(FLD_ACTIONS, " "); record.setAttribute(FLD_GEODESKID, loket.getGeodeskId()); record.setAttribute(FLD_OWNER, loket.getOwner() != null ? loket.getOwner().getName() : MESSAGES.geodeskGridColumnOwnerNoOwner()); record.setAttribute(FLD_OBJECT, loket); return record; }
GeodeskDto lDto = new GeodeskDto(); lDto.setActive(geodesk.isActive()); lDto.setBlueprint(toDto(geodesk.getBlueprint(), includeReferences)); lDto.setCreationBy(geodesk.getCreationBy()); lDto.setCreationDate(geodesk.getCreationDate()); lDto.setId(geodesk.getId()); lDto.setLastEditBy(geodesk.getLastEditBy()); lDto.setLastEditDate(geodesk.getLastEditDate()); lDto.setGeodeskId(geodesk.getGeodeskId()); lDto.setLimitToLoketTerritory(geodesk.isLimitToCreatorTerritory()); lDto.setLimitToUserTerritory(geodesk.isLimitToUserTerritory()); lDto.setName(geodesk.getName()); lDto.setPublic(geodesk.isPublic()); lDto.setApplicationClientWidgetInfos(new HashMap<String, ClientWidgetInfo>(geodesk .getApplicationClientWidgetInfos())); lDto.setMainMapClientWidgetInfos(new HashMap<String, ClientWidgetInfo>(geodesk.getMainMapClientWidgetInfos())); lDto.setOverviewMapClientWidgetInfos(new HashMap<String, ClientWidgetInfo>(geodesk .getOverviewMapClientWidgetInfos())); if (geodesk.getMainMapLayers() != null) { for (ClientLayer layer : geodesk.getMainMapLayers()) { lDto.getMainMapLayers().add(toDto(layer)); lDto.getOverviewMapLayers().add(toDto(layer)); lDto.setOwner(toDto(geodesk.getOwner(), false, false)); if (includeReferences) { List<TerritoryDto> territories = lDto.getTerritories(); if (geodesk.getTerritories() != null && geodesk.getTerritories().size() > 0) {
geodeskIdValid = true; if (loket != null) { geodeskName.setValue(loket.getName()); geodeskId.setValue(loket.getGeodeskId()); blueprints.setValue(loket.getBlueprint().getId()); geodeskAdministrator.setValue(loket.getCreationBy()); lastEditBy.setValue(loket.getLastEditBy()); lastEditDate.setValue(DATE_FORMATTER.format(loket.getLastEditDate())); active.setValue(loket.isActive()); publicGeodesk.setValue(loket.isPublic()); limitToCreatorTerritory.setValue(loket.isLimitToCreatorTerritory()); limitToUserTerritory.setValue(loket.isLimitToUserTerritory()); limitToCreatorTerritory.setDisabled(!loket.isPublic()); limitToUserTerritory.setDisabled(loket.isPublic()); publicGeodesk.setDisabled(!loket.getBlueprint().isPublic()); if (!limitToUserTerritory.isDisabled()) { limitToUserTerritory.setDisabled(loket.getBlueprint().isLimitToUserTerritory()); limitToCreatorTerritory.setDisabled(loket.getBlueprint().isLimitToCreatorTerritory()); if (!loket.getBlueprint().isGeodesksActive()) { active.setDisabled(true); active.setHint("<nobr>" + MESSAGES.geodeskSettingsWarnGeodeskInactivedByBlueprint() + "</nobr>");
/** * Retrieve the list of ClientWidgetInfo's from the blueprint's and geodesks main map. If clientWidgetInfo's are * defined on both blueprint and geodesk level, that defined in the geodesk is used. * * @param geodesk the blueprint * @return List of ClientWidgetInfo as defined in the blueprint */ public static Map<String, ClientWidgetInfo> getMainMapClientWidgetInfo(BaseGeodeskDto geodesk) { Map<String, ClientWidgetInfo> widgetInfos = new HashMap<String, ClientWidgetInfo>(); if (geodesk instanceof GeodeskDto) { widgetInfos.putAll(getMainMapClientWidgetInfo(((GeodeskDto) geodesk).getBlueprint())); } if (geodesk instanceof BlueprintDto) { widgetInfos.putAll(getMainMapClientWidgetInfo(geodesk.getUserApplicationInfo())); } widgetInfos.putAll(geodesk.getMainMapClientWidgetInfos()); return widgetInfos; }
@Override public void onBlueprintChange(BlueprintEvent bpe) { if (!bpe.isDeleted() && !bpe.isNewInstance()) { // just changed for (Record r : getDataAsRecordList().toArray()) { GeodeskDto l = (GeodeskDto) r.getAttributeAsObject(FLD_OBJECT); if (l.getBlueprint().getId().equals(bpe.getBlueprint().getId())) { r.setAttribute(FLD_ACTIVE, l.isActive() && bpe.getBlueprint().isGeodesksActive()); refreshRow(getRecordIndex(r)); if (getSelectedRecord() != null && getSelectedRecord().equals(r)) { deselectAllRecords(); selectRecord(r); } } } } }
public boolean isDefault() { return geodesk.getMainMapLayers() == null || geodesk.getMainMapLayers().isEmpty(); } }
private void setGeodesk(GeodeskDto loket) { this.geodesk = loket; if (loket != null) { groupSelect.setValues(loket.getTerritories()); } else { groupSelect.setValues(null); } fireChangedHandler(); }
GeodeskDto lDto = new GeodeskDto(); lDto.setActive(geodesk.isActive()); lDto.setBlueprint(toDto(geodesk.getBlueprint(), includeReferences)); lDto.setCreationBy(geodesk.getCreationBy()); lDto.setCreationDate(geodesk.getCreationDate()); lDto.setId(geodesk.getId()); lDto.setLastEditBy(geodesk.getLastEditBy()); lDto.setLastEditDate(geodesk.getLastEditDate()); lDto.setGeodeskId(geodesk.getGeodeskId()); lDto.setLimitToLoketTerritory(geodesk.isLimitToCreatorTerritory()); lDto.setLimitToUserTerritory(geodesk.isLimitToUserTerritory()); lDto.setName(geodesk.getName()); lDto.setPublic(geodesk.isPublic()); lDto.setApplicationClientWidgetInfos(new HashMap<String, ClientWidgetInfo>(geodesk .getApplicationClientWidgetInfos())); lDto.setMainMapClientWidgetInfos(new HashMap<String, ClientWidgetInfo>(geodesk.getMainMapClientWidgetInfos())); lDto.setOverviewMapClientWidgetInfos(new HashMap<String, ClientWidgetInfo>(geodesk .getOverviewMapClientWidgetInfos())); if (geodesk.getMainMapLayers() != null) { for (ClientLayer layer : geodesk.getMainMapLayers()) { lDto.getMainMapLayers().add(toDto(layer)); lDto.getOverviewMapLayers().add(toDto(layer)); lDto.setOwner(toDto(geodesk.getOwner(), false, false)); if (includeReferences) { List<TerritoryDto> territories = lDto.getTerritories(); if (geodesk.getTerritories() != null && geodesk.getTerritories().size() > 0) {
public void execute(List<GeodeskDto> result) { for (GeodeskDto bp : result) { geodesks.put(bp.getId(), bp); ListGridRecord record = toGridRecord(bp); addData(record); } setShowEmptyMessage(false); redraw(); } });
/** * Retrieve the list of ClientWidgetInfo's from the blueprint's and geodesks overview map. If clientWidgetInfo's are * defined on both blueprint and geodesk level, that defined in the geodesk is used. * * @param geodesk the blueprint * @return List of ClientWidgetInfo as defined in the blueprint */ public static Map<String, ClientWidgetInfo> getOverviewMapClientWidgetInfo(BaseGeodeskDto geodesk) { Map<String, ClientWidgetInfo> widgetInfos = new HashMap<String, ClientWidgetInfo>(); if (geodesk instanceof GeodeskDto) { widgetInfos.putAll(getOverviewMapClientWidgetInfo(((GeodeskDto) geodesk).getBlueprint())); } if (geodesk instanceof BlueprintDto) { widgetInfos.putAll(getOverviewMapClientWidgetInfo(geodesk.getUserApplicationInfo())); } widgetInfos.putAll(geodesk.getOverviewMapClientWidgetInfos()); return widgetInfos; }
public boolean onResetClick(ClickEvent event) { geodesk.getMainMapLayers().clear(); ManagerCommandService.saveGeodesk(geodesk, SaveGeodeskRequest.SAVE_LAYERS); return true; }
l.setActive(dto.isActive()); l.setBlueprint(fromDto(dto.getBlueprint())); l.setCreationBy(dto.getCreationBy()); l.setCreationDate(dto.getCreationDate()); l.setId(dto.getId()); l.setLastEditBy(dto.getLastEditBy()); l.setLastEditDate(dto.getLastEditDate()); l.setGeodeskId(dto.getGeodeskId()); l.setLimitToCreatorTerritory(dto.isLimitToCreatorTerritory()); l.setLimitToUserTerritory(dto.isLimitToUserTerritory()); l.setName(dto.getName()); l.setPublic(dto.isPublic()); l.setOwner(fromDto(dto.getOwner(), false, false)); List<Territory> territories = l.getTerritories(); l.setApplicationClientWidgetInfos(dto.getApplicationClientWidgetInfos()); l.setMainMapClientWidgetInfos(dto.getMainMapClientWidgetInfos()); l.setOverviewMapClientWidgetInfos(dto.getOverviewMapClientWidgetInfos()); if (dto.getTerritories() != null && dto.getTerritories().size() > 0) { for (TerritoryDto gDto : dto.getTerritories()) { territories.add(fromDto(gDto, false, false)); if (dto.getMainMapLayers() != null) { for (LayerDto layer : dto.getMainMapLayers()) { mainLayers.add(fromDto(layer)); if (dto.getOverviewMapLayers() != null) { for (LayerDto layer : dto.getOverviewMapLayers()) { overviewLayers.add(fromDto(layer));
@Override public void onGeodeskSelectionChange(GeodeskSelectionEvent geodeskSelectionEvent) { setDisabled(true); GeodeskDto geodeskDto = geodeskSelectionEvent.getGeodesk(); if (geodeskDto != null) { loadRecord(geodeskDto.getId()); } else { setGeodesk(null); } }
/** * Retrieve the list of ClientWidgetInfo's from the blueprint's and geodesks application info. If clientWidgetInfo's * are defined on both blueprint and geodesk level, that defined in the geodesk is used. * * @param geodesk the blueprint * @return List of ClientWidgetInfo as defined in the blueprint */ public static Map<String, ClientWidgetInfo> getApplicationClientWidgetInfo(BaseGeodeskDto geodesk) { Map<String, ClientWidgetInfo> widgetInfos = new HashMap<String, ClientWidgetInfo>(); if (geodesk instanceof GeodeskDto) { widgetInfos.putAll(getApplicationClientWidgetInfo(((GeodeskDto) geodesk).getBlueprint())); } if (geodesk instanceof BlueprintDto) { widgetInfos.putAll(getApplicationClientWidgetInfo(geodesk.getUserApplicationInfo())); } widgetInfos.putAll(geodesk.getApplicationClientWidgetInfos()); return widgetInfos; }
@Override public void onGeodeskChange(GeodeskEvent geodeskEvent) { String geodeskId = geodeskEvent.getGeodesk().getId(); GeodeskDto old = geodesks.remove(geodeskId); if (old != null && getRecordList() != null) { Record oldr = getRecordList().find(FLD_ID, old.getId()); removeData(oldr); } switch (geodeskEvent.getAction()) { case DELETE: if (selectedGeodeskId.equals(geodeskId)) { selectedGeodeskId = null; Whiteboard.fireSelectionChangeEvent(new GeodeskSelectionEvent(null)); } // do nothing further, old geodesk is already removed break; default: geodesks.put(geodeskId, geodeskEvent.getGeodesk()); ListGridRecord record = toGridRecord(geodeskEvent.getGeodesk()); addData(record); if (GeodeskEvent.Action.CREATE.equals(geodeskEvent.getAction())) { selectedGeodeskId = geodeskId; } break; } selectCurrentGeodesk(); }
/** * Retrieve the main map layers from the geodesk. If it's a geodesk without layers, the layers from the blueprint * are retrieved. * * @param geodesk the geodesk * @return a list of layers */ public static List<LayerDto> getMainMapLayers(BaseGeodeskDto geodesk) { if (geodesk instanceof GeodeskDto && (geodesk.getMainMapLayers() == null || geodesk.getMainMapLayers().isEmpty())) { return getMainMapLayers(((GeodeskDto) geodesk).getBlueprint()); } return geodesk.getMainMapLayers(); } }
/** * {@see org.geomajas.plugin.deskmanager.command.manager.DeleteGeodeskCommand}. * * @param geodesk the geodesk to delete. */ public static void deleteGeodesk(final GeodeskDto geodesk) { DeleteGeodeskRequest request = new DeleteGeodeskRequest(); request.setGeodeskId(geodesk.getId()); GwtCommand command = new GwtCommand(DeleteGeodeskRequest.COMMAND); command.setCommandRequest(request); GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<CommandResponse>() { public void execute(CommandResponse response) { Whiteboard.fireEvent(new GeodeskEvent(geodesk, GeodeskEvent.Action.DELETE)); } }); }