/** * {@see org.geomajas.plugin.deskmanager.command.manager.DeleteLayerModelCommand}. * * @param layerModel the layerModel to delete. */ public static void deleteLayerModel(final LayerModelDto layerModel) { DeleteLayerModelRequest request = new DeleteLayerModelRequest(); request.setId(layerModel.getId()); GwtCommand command = new GwtCommand(DeleteLayerModelRequest.COMMAND); command.setCommandRequest(request); GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<CommandResponse>() { public void execute(CommandResponse response) { Whiteboard.fireEvent(new LayerModelEvent(layerModel, true, false)); } }); }
/** * {@see org.geomajas.plugin.deskmanager.command.manager.CheckLayerModelInUseCommand}. * * @param layerModel the layerModel to check. * @param onFinish callback called when answer is recieved. */ public static void checkLayerModelInUse(final LayerModelDto layerModel, final DataCallback<Boolean> onFinish) { CheckLayerModelInUseRequest request = new CheckLayerModelInUseRequest(); request.setLayerModelId(layerModel.getId()); GwtCommand command = new GwtCommand(CheckLayerModelInUseRequest.COMMAND); command.setCommandRequest(request); GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<CheckLayerModelInUseResponse>() { public void execute(CheckLayerModelInUseResponse response) { if (onFinish != null) { onFinish.execute(response.isLayerModelInUse()); } } }); }
public LayerModel fromDto(LayerModelDto dto) throws GeomajasException { if (dto == null) { return null; } LayerModel lm = new LayerModel(); lm.setActive(dto.isActive()); lm.setClientLayerId(dto.getClientLayerId()); lm.setId(dto.getId()); lm.setName(dto.getName()); lm.setPublic(dto.isPublic()); lm.setLayerType(dto.getLayerType()); lm.setReadOnly(dto.isReadOnly()); lm.setDynamicLayerConfiguration(dto.getLayerConfiguration()); lm.getWidgetInfo().putAll(dto.getWidgetInfo()); return lm; }
private ListGridRecord toGridRecord(LayerModelDto lm) { ListGridRecord record = new ListGridRecord(); record.setAttribute(FLD_ID, lm.getId()); record.setAttribute(FLD_NAME, lm.getName()); record.setAttribute(FLD_TYPE, lm.getLayerType()); record.setAttribute(FLD_PUBLIC, lm.isPublic()); record.setAttribute(FLD_ACTIVE, lm.isActive()); record.setAttribute(FLD_OWNER, lm.getOwner()); record.setAttribute(FLD_ACTIONS, " "); record.setAttribute(FLD_OBJECT, lm); return record; }
public LayerModel fromDto(LayerModelDto dto) throws GeomajasException { if (dto == null) { return null; } LayerModel lm = new LayerModel(); lm.setActive(dto.isActive()); lm.setClientLayerId(dto.getClientLayerId()); lm.setId(dto.getId()); lm.setName(dto.getName()); lm.setPublic(dto.isPublic()); lm.setLayerType(dto.getLayerType()); lm.setReadOnly(dto.isReadOnly()); lm.setDynamicLayerConfiguration(dto.getLayerConfiguration()); lm.getWidgetInfo().putAll(dto.getWidgetInfo()); return lm; }
public void onLayerModelChange(LayerModelEvent lme) { if (getRecordList() != null) { Record oldr = getRecordList().find(FLD_ID, lme.getLayerModel().getId()); if (oldr != null) { removeData(oldr); } } if (!lme.isDeleted()) { ListGridRecord record = toGridRecord(lme.getLayerModel()); addData(record); if (lme.isNewInstance()) { deselectAllRecords(); selectRecord(record); } } } }
throw new IllegalArgumentException("No layer configuration given."); } else { LayerModel target = layerModelService.getLayerModelById(request.getLayerModel().getId()); if (target == null) { throw new IllegalArgumentException("No datalayer found for id: " + request.getLayerModel().getId()); } else { LayerModel source = dtoService.fromDto(request.getLayerModel());
throw new IllegalArgumentException("No layer configuration given."); } else { LayerModel target = layerModelService.getLayerModelById(request.getLayerModel().getId()); if (target == null) { throw new IllegalArgumentException("No datalayer found for id: " + request.getLayerModel().getId()); } else { LayerModel source = dtoService.fromDto(request.getLayerModel());