private List<NamedObject> getClientLayerInfoObject(DynamicLayerConfiguration lc) throws Exception { if (lc == null) { throw new IllegalArgumentException("Need a DynamicLayerConfiguration"); } List<NamedObject> objects = new ArrayList<BeanDefinitionDtoConverterService.NamedObject>(); if (lc.getServerLayerInfo() instanceof VectorLayerInfo) { NamedStyleInfo nsi = ((VectorLayerInfo) lc.getServerLayerInfo()).getNamedStyleInfos().get(0); objects.add(new NamedObjectImpl(nsi, nsi.getName())); } objects.add(new NamedObjectImpl(lc.getClientLayerInfo(), lc.getClientLayerInfo().getId())); return objects; }
private List<NamedObject> getClientLayerInfoObject(DynamicLayerConfiguration lc) throws Exception { if (lc == null) { throw new IllegalArgumentException("Need a DynamicLayerConfiguration"); } List<NamedObject> objects = new ArrayList<BeanDefinitionDtoConverterService.NamedObject>(); if (lc.getServerLayerInfo() instanceof VectorLayerInfo) { NamedStyleInfo nsi = ((VectorLayerInfo) lc.getServerLayerInfo()).getNamedStyleInfos().get(0); objects.add(new NamedObjectImpl(nsi, nsi.getName())); } objects.add(new NamedObjectImpl(lc.getClientLayerInfo(), lc.getClientLayerInfo().getId())); return objects; }
dataSourceName = ((VectorLayerInfo) lm.getDynamicLayerConfiguration().getServerLayerInfo()) .getFeatureInfo().getDataSourceName(); } catch (Exception e) {
dataSourceName = ((VectorLayerInfo) lm.getDynamicLayerConfiguration().getServerLayerInfo()) .getFeatureInfo().getDataSourceName(); } catch (Exception e) {
public DynamicLayerConfiguration getData() { Bbox bounds = layerConfig.getServerLayerInfo().getMaxExtent(); if (bounds == null) { bounds = new Bbox(); layerConfig.getServerLayerInfo().setMaxExtent(bounds); layerConfig.getClientLayerInfo().setMaxExtent(bounds); } bounds.setX(minX.getValueAsFloat()); bounds.setY(minY.getValueAsFloat()); bounds.setMaxX(maxX.getValueAsFloat()); bounds.setMaxY(maxY.getValueAsFloat()); return layerConfig; } }
public void setData(DynamicLayerConfiguration layerConfig) { clearValues(); this.layerConfig = layerConfig; Bbox bounds = layerConfig.getServerLayerInfo().getMaxExtent(); if (bounds != null) { minX.setValue(bounds.getX()); minY.setValue(bounds.getY()); maxX.setValue(bounds.getMaxX()); maxY.setValue(bounds.getMaxY()); } }
target.setMinScale(cli.getMinimumScale()); target.setPublic(ud.isPublic()); target.setLayerType(source.getDynamicLayerConfiguration().getServerLayerInfo(). getLayerType()); target.setDynamicLayerConfiguration(source.getDynamicLayerConfiguration());
target.setMinScale(cli.getMinimumScale()); target.setPublic(ud.isPublic()); target.setLayerType(source.getDynamicLayerConfiguration().getServerLayerInfo(). getLayerType()); target.setDynamicLayerConfiguration(source.getDynamicLayerConfiguration());
@Override public void execute(CreateLayerModelRequest request, LayerModelResponse response) throws Exception { if (request.getConfiguration() == null || request.getConfiguration().getClientLayerInfo() == null || request.getConfiguration().getClientLayerInfo().getUserData() == null) { Exception e = new IllegalArgumentException("Error while saving layermodel: configuration is required."); log.error(e.getLocalizedMessage()); throw e; } DeskmanagerClientLayerInfo ud = (DeskmanagerClientLayerInfo) request.getConfiguration().getClientLayerInfo() .getUserData(); ClientLayerInfo cvli = request.getConfiguration().getClientLayerInfo(); LayerModel lm = new LayerModel(); lm.setDynamicLayerConfiguration(request.getConfiguration()); lm.setActive(ud.isActive()); lm.setPublic(ud.isPublic()); lm.setName(cvli.getLabel()); lm.setClientLayerId(cvli.getId()); lm.setDefaultVisible(cvli.isVisible()); lm.setMaxScale(cvli.getMaximumScale()); lm.setMinScale(cvli.getMinimumScale()); lm.setLayerType(request.getConfiguration().getServerLayerInfo().getLayerType()); Territory g = ((DeskmanagerSecurityContext) securityContext).getTerritory(); if (g != null && g.getId() > 0) { // 0 = superuser lm.setOwner(groupService.getById(g.getId())); } layerModelService.saveOrUpdateLayerModel(lm); response.setLayerModel(dtoService.toDto(lm, false/* TODO: , request.getLocale() */)); }
@Override public void execute(CreateLayerModelRequest request, LayerModelResponse response) throws Exception { if (request.getConfiguration() == null || request.getConfiguration().getClientLayerInfo() == null || request.getConfiguration().getClientLayerInfo().getUserData() == null) { Exception e = new IllegalArgumentException("Error while saving layermodel: configuration is required."); LOG.error(e.getLocalizedMessage()); throw e; } DeskmanagerClientLayerInfo ud = (DeskmanagerClientLayerInfo) request.getConfiguration().getClientLayerInfo() .getUserData(); ClientLayerInfo cvli = request.getConfiguration().getClientLayerInfo(); LayerModel lm = new LayerModel(); lm.setDynamicLayerConfiguration(request.getConfiguration()); lm.setActive(ud.isActive()); lm.setPublic(ud.isPublic()); lm.setName(cvli.getLabel()); lm.setClientLayerId(cvli.getId()); lm.setDefaultVisible(cvli.isVisible()); lm.setMaxScale(cvli.getMaximumScale()); lm.setMinScale(cvli.getMinimumScale()); lm.setLayerType(request.getConfiguration().getServerLayerInfo().getLayerType()); Territory g = ((DeskmanagerSecurityContext) securityContext).getTerritory(); if (g != null && g.getId() > 0) { // 0 = superuser lm.setOwner(groupService.getById(g.getId())); } layerModelService.saveOrUpdateLayerModel(lm); response.setLayerModel(dtoService.toDto(lm, false/* TODO: , request.getLocale() */)); }