Commit c57e7a89 authored by Fabien D'Angelo's avatar Fabien D'Angelo

configuration and jsp for remote WMS geoserver

parent 309df8b2
Pipeline #2201 passed with stages
in 1 minute and 51 seconds
......@@ -31,6 +31,8 @@ public class DisplayMetaConfBean {
private boolean useGeoserverExposedMap;
private GroupLayerConfig layersConfig;
private Map<String, Boolean> properties;
......@@ -40,6 +42,7 @@ public class DisplayMetaConfBean {
public DisplayMetaConfBean() {
this.properties = new TreeMap<>();
this.useGeoserverExposedMap = false;
this.layersConfig = new GroupLayerConfig();
}
......@@ -71,4 +74,16 @@ public class DisplayMetaConfBean {
this.useGeoserverExposedMap = useGeoserverExposedMap;
}
public GroupLayerConfig getLayersConfig() {
return layersConfig;
}
public void setLayersConfig(GroupLayerConfig layersConfig) {
this.layersConfig = layersConfig;
}
}
......@@ -35,12 +35,14 @@ import org.ow2.weblab.core.extended.exception.WebLabCheckedException;
import org.ow2.weblab.core.model.Resource;
import org.ow2.weblab.portlet.business.bean.EditMetaConfBean;
import org.ow2.weblab.portlet.business.bean.TimeConfig;
import org.ow2.weblab.portlet.business.bean.config.map.GroupLayerConfig;
import org.ow2.weblab.portlet.business.bean.taglib.DataTaglib;
import org.ow2.weblab.portlet.business.service.PermissionService;
import org.ow2.weblab.portlet.business.service.ResourceSaverService;
import org.ow2.weblab.portlet.business.service.impl.EditMetaServices;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.portlet.ModelAndView;
......@@ -122,6 +124,11 @@ public class EditMetaController {
this.resourceSaverService = resourceSaverService;
this.permissionService = permissionService;
}
@ModelAttribute("layersConfig")
public GroupLayerConfig getLayersConfig() {
return this.editMetaData.getLayersConfig();
}
@ResourceMapping("editmeta")
......@@ -146,10 +153,6 @@ public class EditMetaController {
if (!model.containsAttribute(EditMetaController.USE_GEOSERVER_EXPOSED_MAP)) {
model.addAttribute(EditMetaController.USE_GEOSERVER_EXPOSED_MAP, Boolean.valueOf(this.editMetaData.isUseGeoserverExposedMap()));
}
if (!model.containsAttribute(EditMetaController.LAYERS_CONFIG)) {
model.addAttribute(EditMetaController.LAYERS_CONFIG, this.editMetaData.getLayersConfig());
}
if (!model.containsAttribute(EditMetaController.EDIT_ERROR)) {
model.addAttribute(EditMetaController.EDIT_ERROR, Boolean.FALSE);
......
......@@ -40,6 +40,7 @@ import org.ow2.weblab.core.services.InvalidParameterException;
import org.ow2.weblab.core.services.UnexpectedException;
import org.ow2.weblab.portlet.business.bean.DisplayMetaConfBean;
import org.ow2.weblab.portlet.business.bean.RDFPropertiesConfBean;
import org.ow2.weblab.portlet.business.bean.config.map.GroupLayerConfig;
import org.ow2.weblab.portlet.business.service.MetaViewBusinessServices;
import org.ow2.weblab.portlet.business.service.PermissionService;
import org.springframework.stereotype.Controller;
......@@ -67,7 +68,7 @@ import com.liferay.portal.kernel.exception.SystemException;
@Controller
@RequestMapping(value = "VIEW")
@SessionAttributes({ "resource", "isEmptyModel", "isLoadedResource", "rdfProperties", "translations", "metaDisplay", "editMetaData", "timeConfig", "dataTaglib", "dataLanguage",
"useGeoserverExposedMap", "editError" })
"useGeoserverExposedMap", "layersConfig", "editError" })
public class MetaViewController {
......@@ -130,6 +131,11 @@ public class MetaViewController {
public Boolean getUseGeoserverExposedMap() {
return Boolean.valueOf(this.metaDisplayConf.isUseGeoserverExposedMap());
}
@ModelAttribute("layersConfig")
public GroupLayerConfig getLayersConfig() {
return this.metaDisplayConf.getLayersConfig();
}
@ModelAttribute("rdfProperties")
......
......@@ -129,22 +129,7 @@
<bean id="displayMeta" class="org.ow2.weblab.portlet.business.bean.DisplayMetaConfBean">
<property name="useGeoserverExposedMap" value="false" />
<property name="layersConfig">
<bean id="layerGeoserver" class="org.ow2.weblab.portlet.business.bean.config.map.GroupLayerConfig">
<property name="projection" value="EPSG:3857"/>
<property name="layers">
<list>
<bean name="baseLayerLocal" class="org.ow2.weblab.portlet.business.bean.config.map.WMSLayerConfig">
<property name="visible" value="true" />
<property name="relativeUrl" value="/geoserver-weblab/wms" />
<property name="layer" value="vtpa:HYP_HR_SR_OB_DR" />
<property name="tiled" value="true" />
<property name="nameKey" value="Legend.Layers.earthRasterLayer" />
</bean>
</list>
</property>
</bean>
</property>
<property name="layersConfig" ref="layerGeoserver"/>
<property name="properties">
<map>
<!-- Documents properties -->
......@@ -202,6 +187,7 @@
<bean id="editMetaData" class="org.ow2.weblab.portlet.business.bean.EditMetaConfBean">
<property name="useGeoserverExposedMap" value="false" />
<property name="layersConfig" ref="layerGeoserver"/>
<property name="properties">
<map>
<entry key="title">
......@@ -423,5 +409,20 @@
</property>
</bean>
<bean id="layerGeoserver" class="org.ow2.weblab.portlet.business.bean.config.map.GroupLayerConfig">
<property name="projection" value="EPSG:3857"/>
<property name="layers">
<list>
<bean name="baseLayerLocal" class="org.ow2.weblab.portlet.business.bean.config.map.WMSLayerConfig">
<property name="visible" value="true" />
<property name="relativeUrl" value="/geoserver-weblab/wms" />
<property name="layer" value="vtpa:HYP_HR_SR_OB_DR" />
<property name="tiled" value="true" />
<property name="nameKey" value="Legend.Layers.earthRasterLayer" />
</bean>
</list>
</property>
</bean>
</beans>
\ No newline at end of file
......@@ -25,7 +25,7 @@
return false;
});
jQuery(document).ready(function() {
openLayerMap(${useGeoserverExposedMap}, '${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}');
openLayerMap(${useGeoserverExposedMap}, '${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}', ${layersConfig});
jQuery("#buttonAdd").click(function($) {
jQuery("#editView").slideDown(function() {
jQuery(".meta_data_table").hide();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment