Commit e5ea75c0 authored by Yann Mombrun's avatar Yann Mombrun

Stable version 2.2.5.

Hide useless controls on the map.
Minor fixes of the javadocs, warning, indentation

git-svn-id: svn://svn.forge.objectweb.org/svnroot/weblab/trunk/WebLabServices/Portlets/metadata-portlet@4642 a803c184-d8de-4a0e-a52b-d3eef88212b6
parent da469d44
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</parent> </parent>
<artifactId>weblab-metaview</artifactId> <artifactId>weblab-metaview</artifactId>
<version>2.2.5-SNAPSHOT</version> <version>2.2.5</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>WebLab Metaview</name> <name>WebLab Metaview</name>
...@@ -102,6 +102,11 @@ ...@@ -102,6 +102,11 @@
<artifactId>spring-webmvc-portlet</artifactId> <artifactId>spring-webmvc-portlet</artifactId>
<version>${spring.version}</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.ow2.weblab.components</groupId>
<artifactId>weblab-taglib</artifactId>
<version>0.1.3</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
...@@ -152,6 +152,8 @@ public class EditMetaServices { ...@@ -152,6 +152,8 @@ public class EditMetaServices {
* the class of the value * the class of the value
* @param val * @param val
* the current value * the current value
* @param <T>
* The provided type of the value to write
*/ */
public <T> void write(final Resource resource, final String prefix, final URI propertyURI, final String localname, final Class<T> clazz, final T val) { public <T> void write(final Resource resource, final String prefix, final URI propertyURI, final String localname, final Class<T> clazz, final T val) {
final BaseAnnotator ba = new BaseAnnotator(resource); final BaseAnnotator ba = new BaseAnnotator(resource);
......
/** /**
* WEBLAB: Service oriented integration platform for media mining and intelligence applications * WEBLAB: Service oriented integration platform for media mining and intelligence applications
* *
* Copyright (C) 2004 - 2016 Airbus Defence and Space * Copyright (C) 2004 - 2017 Airbus Defence and Space
* *
* This library is free software; you can redistribute it and/or modify it under the terms of * This library is free software; you can redistribute it and/or modify it under the terms of
* the GNU Lesser General Public License as published by the Free Software Foundation; either * the GNU Lesser General Public License as published by the Free Software Foundation; either
...@@ -43,19 +43,12 @@ public class LiferayPermissionServiceImpl implements PermissionService { ...@@ -43,19 +43,12 @@ public class LiferayPermissionServiceImpl implements PermissionService {
public LiferayPermissionServiceImpl(final List<String> adminRoles) { public LiferayPermissionServiceImpl(final List<String> adminRoles) {
this.adminRoles = adminRoles; this.adminRoles = adminRoles;
} }
/*
* (non-Javadoc)
*
* @see org.ow2.weblab.portlet.business.service.PermissionService#hasAdminRole(javax.portlet.ResourceRequest)
*/
@Override @Override
public boolean hasAdminRole(final PortletRequest request) throws SystemException { public boolean hasAdminRole(final PortletRequest request) throws SystemException {
final ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); final ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
final User user = themeDisplay.getUser(); final User user = themeDisplay.getUser();
...@@ -68,4 +61,5 @@ public class LiferayPermissionServiceImpl implements PermissionService { ...@@ -68,4 +61,5 @@ public class LiferayPermissionServiceImpl implements PermissionService {
} }
return false; return false;
} }
} }
...@@ -72,7 +72,7 @@ public class RestResourceSaverService implements ResourceSaverService { ...@@ -72,7 +72,7 @@ public class RestResourceSaverService implements ResourceSaverService {
* The URL of the rest service to be called in order to save the edition * The URL of the rest service to be called in order to save the edition
* @throws MalformedURLException * @throws MalformedURLException
* If the URL is not valid * If the URL is not valid
* @throws URISyntaxException * @throws URISyntaxException If the url of the servce cannot be converted into an URI
*/ */
public RestResourceSaverService(final String url) throws MalformedURLException, URISyntaxException { public RestResourceSaverService(final String url) throws MalformedURLException, URISyntaxException {
super(); super();
......
...@@ -108,10 +108,10 @@ public class WSBusinessServicesImpl implements MetaViewBusinessServices { ...@@ -108,10 +108,10 @@ public class WSBusinessServicesImpl implements MetaViewBusinessServices {
/** /**
* Method to get URI from a receive PieceOfKnowledge using * Method to get URI from a receive PieceOfKnowledge using POK_PROPERTY_DOC_URI
* POK_PROPERTY_DOC_URI
* *
* @param pok * @param pok
* The event received, containing a uri of document to load
* @return URI if exist null otherwise * @return URI if exist null otherwise
*/ */
@Override @Override
......
...@@ -191,15 +191,14 @@ public class EditMetaController { ...@@ -191,15 +191,14 @@ public class EditMetaController {
final Map<String, String[]> parameterMap = request.getParameterMap(); final Map<String, String[]> parameterMap = request.getParameterMap();
final EditMetaServices editMetaServices = new EditMetaServices(editMeta, this.timeConfig); final EditMetaServices editMetaServices = new EditMetaServices(editMeta, this.timeConfig);
editMetaServices.writeContent(resource, parameterMap); editMetaServices.writeContent(resource, parameterMap);
boolean worked = false;
try { try {
worked = this.resourceSaverService.saveResource(resource); boolean worked = this.resourceSaverService.saveResource(resource);
if (!worked) { if (!worked) {
this.logger.warn("The resource " + resource.getUri() + " may not be saved."); this.logger.warn("The resource " + resource.getUri() + " may not be saved.");
} }
model.addAttribute(EditMetaController.EDIT_ERROR, Boolean.valueOf(!worked)); model.addAttribute(EditMetaController.EDIT_ERROR, Boolean.valueOf(!worked));
} catch (final IOException | WebLabCheckedException e) { } catch (final IOException | WebLabCheckedException e) {
model.addAttribute(EditMetaController.EDIT_ERROR, Boolean.valueOf(!worked)); model.addAttribute(EditMetaController.EDIT_ERROR, Boolean.TRUE);
this.logger.error("An error occured saving the resource " + resource.getUri() + ".", e); this.logger.error("An error occured saving the resource " + resource.getUri() + ".", e);
} }
model.addAttribute(EditMetaController.RESOURCE, resource); model.addAttribute(EditMetaController.RESOURCE, resource);
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
...@@ -21,21 +21,15 @@ ...@@ -21,21 +21,15 @@
<constructor-arg name="editMetaData" type="org.ow2.weblab.portlet.business.bean.EditMetaConfBean" ref="editMetaData" /> <constructor-arg name="editMetaData" type="org.ow2.weblab.portlet.business.bean.EditMetaConfBean" ref="editMetaData" />
<constructor-arg name="timeConfig" type="org.ow2.weblab.portlet.business.bean.TimeConfig" ref="timeConfig" /> <constructor-arg name="timeConfig" type="org.ow2.weblab.portlet.business.bean.TimeConfig" ref="timeConfig" />
<constructor-arg name="dataTaglib" type="org.ow2.weblab.portlet.business.bean.taglib.DataTaglib" ref="dataTaglib" /> <constructor-arg name="dataTaglib" type="org.ow2.weblab.portlet.business.bean.taglib.DataTaglib" ref="dataTaglib" />
<constructor-arg name="resourceSaverService" type="org.ow2.weblab.portlet.business.service.ResourceSaverService" <constructor-arg name="resourceSaverService" type="org.ow2.weblab.portlet.business.service.ResourceSaverService" ref="restSaverService" />
ref="restSaverService" /> <constructor-arg name="permissionService" type="org.ow2.weblab.portlet.business.service.PermissionService" ref="permissionService" />
<constructor-arg name="permissionService" type="org.ow2.weblab.portlet.business.service.PermissionService"
ref="permissionService" />
</bean> </bean>
<bean class="org.ow2.weblab.portlet.mvc.spring.controller.MetaViewController"> <bean class="org.ow2.weblab.portlet.mvc.spring.controller.MetaViewController">
<constructor-arg name="metaviewBusinessService" type="org.ow2.weblab.portlet.business.service.MetaViewBusinessServices" <constructor-arg name="metaviewBusinessService" type="org.ow2.weblab.portlet.business.service.MetaViewBusinessServices" ref="metaviewBusinessService" />
ref="metaviewBusinessService" /> <constructor-arg name="permissionService" type="org.ow2.weblab.portlet.business.service.PermissionService" ref="permissionService" />
<constructor-arg name="permissionService" type="org.ow2.weblab.portlet.business.service.PermissionService" <constructor-arg name="metaDisplayConf" type="org.ow2.weblab.portlet.business.bean.DisplayMetaConfBean" ref="displayMeta" />
ref="permissionService" /> <constructor-arg name="rdfProperties" type="org.ow2.weblab.portlet.business.bean.RDFPropertiesConfBean" ref="rdfProperties" />
<constructor-arg name="metaDisplayConf" type="org.ow2.weblab.portlet.business.bean.DisplayMetaConfBean"
ref="displayMeta" />
<constructor-arg name="rdfProperties" type="org.ow2.weblab.portlet.business.bean.RDFPropertiesConfBean"
ref="rdfProperties" />
<constructor-arg name="sourceTypeTab" type="java.lang.String" value="website" /> <constructor-arg name="sourceTypeTab" type="java.lang.String" value="website" />
<constructor-arg name="allowSourceEventing" type="java.lang.Boolean" value="false" /> <constructor-arg name="allowSourceEventing" type="java.lang.Boolean" value="false" />
</bean> </bean>
......
...@@ -66,7 +66,12 @@ function openLayerMap(useGeoserverExposedMap, serverUrlPrefix) { ...@@ -66,7 +66,12 @@ function openLayerMap(useGeoserverExposedMap, serverUrlPrefix) {
var map = new ol.Map({ var map = new ol.Map({
layers : [ rasterLayer, vectorLayer ], layers : [ rasterLayer, vectorLayer ],
target : canvas, target : canvas,
view : view view : view,
controls : ol.control.defaults({
zoom : false,
attribution : false,
rotate : false
})
}); });
map.on('singleclick', function(evt) { map.on('singleclick', function(evt) {
......
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