Commit c4805946 authored by Yann Mombrun's avatar Yann Mombrun

Merge branch 'develop'

* develop:
  Bump to stable version 2.3.3
  Minor cleanup of javadocs and properties
  Work on #4 and try to release some connections
  Bump to next dev version 2.3.3-SNAP
parents dc4b83ea a79a7c33
Pipeline #2692 passed with stage
in 27 seconds
......@@ -9,7 +9,7 @@
</parent>
<artifactId>weblab-metaview</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
<packaging>war</packaging>
<name>WebLab Metaview</name>
......
/**
* WEBLAB: Service oriented integration platform for media mining and intelligence applications
*
* Copyright (C) 2004 - 2016 Airbus Defence and Space
* Copyright (C) 2004 - 2018 Airbus Defence and Space SAS
*
* 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
......@@ -28,10 +28,11 @@ import org.ow2.weblab.portlet.business.bean.config.map.GroupLayerConfig;
* @author emilien
*/
public class DisplayMetaConfBean {
private boolean useGeoserverExposedMap;
private GroupLayerConfig layersConfig;
......@@ -39,21 +40,33 @@ public class DisplayMetaConfBean {
/**
* The default constructor that initialises the fields
*/
public DisplayMetaConfBean() {
this.properties = new TreeMap<>();
this.useGeoserverExposedMap = false;
this.layersConfig = new GroupLayerConfig();
}
/**
* @return the properties
*/
public Map<String, Boolean> getProperties() {
return this.properties;
}
public void setProperties(Map<String, Boolean> properties) {
/**
* @param properties
* The properties to set
*/
public void setProperties(final Map<String, Boolean> properties) {
this.properties = properties;
}
......@@ -63,26 +76,38 @@ public class DisplayMetaConfBean {
* @return the useGeoserverExposedMap
*/
public boolean isUseGeoserverExposedMap() {
return this.useGeoserverExposedMap;
}
/**
* @param useGeoserverExposedMap the useGeoserverExposedMap to set
* @param useGeoserverExposedMap
* the useGeoserverExposedMap to set
*/
public void setUseGeoserverExposedMap(boolean useGeoserverExposedMap) {
public void setUseGeoserverExposedMap(final boolean useGeoserverExposedMap) {
this.useGeoserverExposedMap = useGeoserverExposedMap;
}
/**
* @return The layer config
*/
public GroupLayerConfig getLayersConfig() {
return layersConfig;
return this.layersConfig;
}
public void setLayersConfig(GroupLayerConfig layersConfig) {
/**
* @param layersConfig
* The layer config to set
*/
public void setLayersConfig(final GroupLayerConfig layersConfig) {
this.layersConfig = layersConfig;
}
......
/**
* WEBLAB: Service oriented integration platform for media mining and intelligence applications
*
* Copyright (C) 2004 - 2016 Airbus Defence and Space
* Copyright (C) 2004 - 2018 Airbus Defence and Space SAS
*
* 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
......@@ -32,17 +32,28 @@ public class EditMetaConfBean {
private boolean useGeoserverExposedMap;
private GroupLayerConfig layersConfig;
private Map<String, List<String>> properties;
/**
* @return The properties
*/
public Map<String, List<String>> getProperties() {
return this.properties;
}
/**
* @param properties
* The properties to set
*/
public void setProperties(final Map<String, List<String>> properties) {
this.properties = properties;
}
......@@ -51,6 +62,7 @@ public class EditMetaConfBean {
* @return the useGeoserverExposedMap
*/
public boolean isUseGeoserverExposedMap() {
return this.useGeoserverExposedMap;
}
......@@ -59,17 +71,27 @@ public class EditMetaConfBean {
* @param useGeoserverExposedMap
* the useGeoserverExposedMap to set
*/
public void setUseGeoserverExposedMap(boolean useGeoserverExposedMap) {
public void setUseGeoserverExposedMap(final boolean useGeoserverExposedMap) {
this.useGeoserverExposedMap = useGeoserverExposedMap;
}
/**
* @return The group layer config
*/
public GroupLayerConfig getLayersConfig() {
return layersConfig;
return this.layersConfig;
}
public void setLayersConfig(GroupLayerConfig layersConfig) {
/**
* @param layersConfig
* The layer config to set
*/
public void setLayersConfig(final GroupLayerConfig layersConfig) {
this.layersConfig = layersConfig;
}
......
/**
* WEBLAB: Service oriented integration platform for media mining and intelligence applications
*
* Copyright (C) 2004 - 2016 Airbus Defence and Space
* Copyright (C) 2004 - 2018 Airbus Defence and Space SAS
*
* 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
......@@ -28,22 +28,41 @@ public class ServiceDescription {
private String uri, label;
/**
* @return the uri
*/
public String getUri() {
return this.uri;
}
public void setUri(String uri) {
/**
* @param uri
* the uri to set
*/
public void setUri(final String uri) {
this.uri = uri;
}
/**
* @return the label
*/
public String getLabel() {
return this.label;
}
public void setLabel(String label) {
/**
* @param label
* the label to set
*/
public void setLabel(final String label) {
this.label = label;
}
}
......@@ -21,6 +21,9 @@ import java.util.Date;
import javax.annotation.Resource;
/**
* @author kdesir
*/
@Resource
public class TimeConfig {
......@@ -31,27 +34,49 @@ public class TimeConfig {
private String formatDateTimeForJSTL;
/**
* The default constructor that initialises todays date
*/
public TimeConfig() {
this.setMaxEndDateMS(new Date());
}
/**
* @return the max end date in ms
*/
public long getMaxEndDateMS() {
return this.maxEndDateMS;
}
/**
* @param maxEndDateMS
* The max end date (using a date object)
*/
public void setMaxEndDateMS(final Date maxEndDateMS) {
this.maxEndDateMS = maxEndDateMS.getTime();
}
/**
* @return the formatDateTimeForJSTL
*/
public String getFormatDateTimeForJSTL() {
return this.formatDateTimeForJSTL;
}
/**
* @param formatDateTimeForJSTL
* the formatDateTimeForJSTL to set
*/
public void setFormatDateTimeForJSTL(final String formatDateTimeForJSTL) {
this.formatDateTimeForJSTL = formatDateTimeForJSTL;
}
......
/**
* WEBLAB: Service oriented integration platform for media mining and intelligence applications
*
* Copyright (C) 2004 - 2016 Airbus Defence and Space
* Copyright (C) 2004 - 2018 Airbus Defence and Space SAS
*
* 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
......@@ -21,31 +21,51 @@ import java.util.LinkedList;
import java.util.List;
/**
* @author fdangelo
*/
public class GroupLayerConfig extends LayerConfig {
private static final String EPSG_4326 = "EPSG:4326";
private List<LayerConfig> layers;
private static final String EPSG_4326="EPSG:4326";
private String projection = GroupLayerConfig.EPSG_4326;
public GroupLayerConfig(GroupLayerConfig glc){
this.layers = new LinkedList<LayerConfig>();
for(LayerConfig layer : glc.layers) {
this.layers.add((LayerConfig)layer.clone());
/**
* @param glc
* The layer config
*/
public GroupLayerConfig(final GroupLayerConfig glc) {
this.layers = new LinkedList<>();
if (glc != null) {
for (final LayerConfig layer : glc.layers) {
this.layers.add((LayerConfig) layer.clone());
}
this.projection = glc.projection;
}
this.projection = glc.projection;
}
/**
* The default constructor
*/
public GroupLayerConfig() {
this.layers = new LinkedList<LayerConfig>();
this(null);
}
/**
* @return the layers
*/
public List<LayerConfig> getLayers() {
return this.layers;
}
......@@ -55,21 +75,26 @@ public class GroupLayerConfig extends LayerConfig {
* the layers to set
*/
public void setLayers(final List<LayerConfig> layers) {
this.layers = layers;
}
/**
* @return the projection
*/
public String getProjection() {
return projection;
return this.projection;
}
/**
* @param projection the projection to set
* @param projection
* the projection to set
*/
public void setProjection(String projection) {
public void setProjection(final String projection) {
this.projection = projection;
}
......@@ -77,6 +102,7 @@ public class GroupLayerConfig extends LayerConfig {
@Override
protected Object clone() {
final GroupLayerConfig clone = new GroupLayerConfig();
this.enrichClone(clone);
clone.projection = this.projection;
......
/**
* WEBLAB: Service oriented integration platform for media mining and intelligence applications
*
* Copyright (C) 2004 - 2016 Airbus Defence and Space
* Copyright (C) 2004 - 2018 Airbus Defence and Space SAS
*
* 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
......@@ -33,24 +33,41 @@ public class DataTaglib {
private Map<String, String> languages;
public Map<String, String> getLanguages() {
return this.languages;
/**
* @return the formats
*/
public Map<String, String> getFormats() {
return this.formats;
}
public void setLanguages(final Map<String, String> languages) {
this.languages = languages;
/**
* @param formats
* the formats to set
*/
public void setFormats(final Map<String, String> formats) {
this.formats = formats;
}
public Map<String, String> getFormats() {
return this.formats;
/**
* @return the languages
*/
public Map<String, String> getLanguages() {
return this.languages;
}
public void setFormats(final Map<String, String> formats) {
this.formats = formats;
}
/**
* @param languages
* the languages to set
*/
public void setLanguages(final Map<String, String> languages) {
this.languages = languages;
}
}
/**
* WEBLAB: Service oriented integration platform for media mining and intelligence applications
*
* Copyright (C) 2004 - 2017 Airbus Defence and Space
* Copyright (C) 2004 - 2018 Airbus Defence and Space SAS
*
* 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
......@@ -37,6 +37,7 @@ import org.apache.http.impl.conn.ProxySelectorRoutePlanner;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.util.EntityUtils;
import org.ow2.weblab.core.extended.exception.WebLabCheckedException;
import org.ow2.weblab.core.extended.util.ResourceUtil;
import org.ow2.weblab.core.model.Resource;
......@@ -72,9 +73,11 @@ public class RestResourceSaverService implements ResourceSaverService {
* The URL of the rest service to be called in order to save the edition
* @throws MalformedURLException
* If the URL is not valid
* @throws URISyntaxException If the url of the servce cannot be converted into an URI
* @throws URISyntaxException
* If the url of the servce cannot be converted into an URI
*/
public RestResourceSaverService(final String url) throws MalformedURLException, URISyntaxException {
super();
this.logger = LogFactory.getLog(this.getClass());
this.url = new URL(url).toURI();
......@@ -94,6 +97,7 @@ public class RestResourceSaverService implements ResourceSaverService {
@Override
public boolean saveResource(final Resource resource) throws IOException, WebLabCheckedException {
final DefaultHttpClient httpClient = new DefaultHttpClient(this.cm, this.httpParams);
if ((System.getProperty("http.proxyHost") != null) || "true".equals(System.getProperty("java.net.useSystemProxies"))) {
......@@ -104,16 +108,24 @@ public class RestResourceSaverService implements ResourceSaverService {
}
final HttpPost httpPost = new HttpPost(this.url);
final StringEntity xmlEntity = new StringEntity(ResourceUtil.saveToXMLString(resource), RestResourceSaverService.APPLICATION_XML);
httpPost.setEntity(xmlEntity);
try {
final StringEntity xmlEntity = new StringEntity(ResourceUtil.saveToXMLString(resource), RestResourceSaverService.APPLICATION_XML);
httpPost.setEntity(xmlEntity);
final HttpResponse response = httpClient.execute(httpPost);
EntityUtils.consumeQuietly(response.getEntity());
final HttpResponse response = httpClient.execute(httpPost);
final int statusCode = response.getStatusLine().getStatusCode();
if (((statusCode >= 200) && (statusCode < 300)) || (statusCode == 304)) {
return true;
}
this.logger.warn("Received an error HTTP code (" + statusCode + ") when accessing saving resource " + resource.getUri() + ".");
final int statusCode = response.getStatusLine().getStatusCode();
if (((statusCode >= 200) && (statusCode < 300)) || (statusCode == 304)) {
return true;
} finally {
// Release connection
httpPost.reset();
}
this.logger.warn("Received an error HTTP code (" + statusCode + ") when accessing saving resource " + resource.getUri() + ".");
return false;
}
......
......@@ -3,7 +3,7 @@ portlet.title = Metadata view
portlet.warning.session_expired = Session expired
meta.useAsSource = Use as new source
meta.defaultTitle = Title unavailable
meta.metadata = meta-data
meta.metadata = metadata
meta.hasNativeContent = Native Content:
meta.hasNormalisedContent = Normalised Content:
meta.isGeneratedFrom = Generated from:
......@@ -31,12 +31,16 @@ meta.coverage = Coverage:
meta.right = Right:
meta.modified = Modification date:
meta.created = Creation date:
meta.meta_name = Metadata:
meta.meta_value = Value:
meta.hasRank = Rank:
meta.hasDescription = Description:
meta.hasScore = Score:
meta.gatheringDate = Gathering date:
meta.mainDate = Date of document:
meta.catego = Classification:
meta.extent = Media extension:
meta.topic = Topic:
meta.projectName = Crawling project name:
meta.hasOriginalFileSize = Original file size:
meta.refersTo = Refers to:
......@@ -59,13 +63,17 @@ meta.edit.commented = Comment
meta.edit.reliability = Reliability
meta.edit.credibility = Credibility
meta.edit.subject = Subject
meta.edit.toKeep = ToKeep
meta.label.toKeep = To Keep
meta.edit.toKeep = Protected
meta.label.toKeep = To protect
meta.edit.lat = lat
meta.edit.lon = long
meta.help.subject=Subjects value separated by commas
meta.help.comment=Insert your comment
meta.reset=Reset
meta.edit.error.credibreliable=This field cannot be empty.
meta.errorSave= An error occured, new metadatas will not be saved.
meta.errorSave= An error occured, new metadata will not be saved.
meta.addMetaButton=Add Metadata
meta.cancelButton=Cancel
meta.saveButton=Save
......@@ -73,12 +81,19 @@ meta.editButton=Edit
portlet.meta.configuration = Displayed metadata
meta.save_config = Save
portlet.no_meta = No meta-data to display
portlet.leave = You are going to leave the WebLab Platform, are you sure you want to access external networks ?
thumbnail.image.alt = Overview
portlet.no_meta = No metadata to display
portlet.leave = You are going to leave the application, are you sure you want to access external networks?
portlet.sources.button.add=Add
portlet.sources.button.cancel=Cancel
portlet.sources.useAsSourceContent=Add this link to the source management list?
portlet.sources.useAsSourceTitle=Source addition
\ No newline at end of file
portlet.add_basket = Add document to current workspace
portlet.pin_basket = Add to a workspace (to be selected)
portlet.show_menu = Display the menu
portlet.confirmPinToBasket = Do you want to add the selected document to a workspace (to be selected)?
portlet.confirmAddToBasket = Do you want to add the selected document to your selected workspace?
portlet.confirm.cancel = Cancel
portlet.confirm.add = Add
javax.portlet.title=Portlet de visualisation des métadonnées
portlet.title = Portlet de visualisation des métadonnées
portlet.warning.session_expired = Votre session a expiré
javax.portlet.title=Portlet de visualisation des m\u00e9tadonn\u00e9es
portlet.title = Portlet de visualisation des m\u00e9tadonn\u00e9es
portlet.warning.session_expired = Votre session a expir\u00e9
meta.useAsSource = Ajouter comme source
meta.defaultTitle = Titre indisponible
meta.metadata = Meta-données
meta.metadata = M\u00e9tadonn\u00e9es
meta.hasNativeContent = Contenu natif&nbsp;:
meta.hasNormalisedContent = Contenu normalisé&nbsp;:
meta.isGeneratedFrom = Géneré depuis&nbsp;:
meta.isProducedFrom = Identifiant système&nbsp;:
meta.isResultOf = Resultat de&nbsp;:
meta.hasNumberOfResults = Nombre de résultats&nbsp;:
meta.hasNormalisedContent = Contenu normalis\u00e9&nbsp;:
meta.isGeneratedFrom = G\u00e9ner\u00e9 depuis&nbsp;:
meta.isProducedFrom = Identifiant syst\u00E8me&nbsp;:
meta.isResultOf = R\u00e9sultat de&nbsp;:
meta.hasNumberOfResults = Nombre de r\u00e9sultats&nbsp;:
meta.isExposedAs = Document natif&nbsp;:
meta.title = Titre&nbsp;:
meta.creator = Créateur&nbsp;:
meta.abstract = Résumé&nbsp;:
meta.catego = Catégorie&nbsp;:
meta.creator = Cr\u00e9ateur&nbsp;:
meta.abstract = R\u00e9sum\u00e9&nbsp;:
meta.catego = Cat\u00e9gorie&nbsp;:
meta.subject = Sujet et mots-clefs&nbsp;:
meta.description = Commentaires créateur&nbsp;:
meta.publisher = Editeur&nbsp;:
meta.description = Commentaires cr\u00e9ateur&nbsp;:
meta.publisher = \u00C9diteur&nbsp;:
meta.contributor = Contributeur&nbsp;:
meta.date = Date&nbsp;:
meta.type = Type de document&nbsp;:
......@@ -30,57 +30,68 @@ meta.relation = Relation&nbsp;:
meta.coverage = Couverture spatiale ou temporelle&nbsp;:
meta.right = Droit&nbsp;:
meta.modified = Date de modification&nbsp;:
meta.created = Date de création&nbsp;:
meta.meta_name = Métadonnée&nbsp;:
meta.created = Date de cr\u00e9ation&nbsp;:
meta.meta_name = M\u00e9tadonn\u00e9e&nbsp;:
meta.meta_value = Valeur&nbsp;:
meta.hasRank = Rang&nbsp;:
meta.hasDescription = Description&nbsp;:
meta.hasScore = Pertinence&nbsp;:
meta.gatheringDate = Date de collecte&nbsp;:
meta.mainDate = Date du document&nbsp;:
meta.catego = Classification&nbsp;:
meta.extent = Statistiques sur le document&nbsp;:
meta.projectName = Nom du projet lié à la collecte&nbsp;:
meta.topic = Th\u00E8me&nbsp;:
meta.projectName = Nom du projet li\u00e9 \u00e0 la collecte&nbsp;:
meta.hasOriginalFileSize = Taille du fichier source&nbsp;:
meta.refersTo = Documents externes liés&nbsp;:
meta.seeAlso = Voir également&nbsp;:
meta.refersTo = Documents externes li\u00e9s&nbsp;:
meta.seeAlso = Voir \u00e9galement&nbsp;:
meta.availableTranslations = Traductions&nbsp;:
meta.originalLanguageVersion = Version d'origine
meta.rate = Note :
meta.commented = Commentaire :
meta.reliability = Fiabilité :
meta.credibility = Crédibilité :
meta.toKeep = Protégé :
meta.location = Emplacement du document :
meta.rate = Score&nbsp;:
meta.commented = Commentaire&nbsp;:
meta.reliability = Fiabilit\u00e9&nbsp;:
meta.credibility = Cr\u00e9dibilit\u00e9&nbsp;:
meta.toKeep = Prot\u00e9g\u00e9&nbsp;:
meta.location = Emplacement du document&nbsp;:
meta.label.location = Emplacement du document
meta.speaker = Locuteurs :
meta.speaker = Locuteurs&nbsp;:
meta.edit.rate = Note
meta.edit.rate = Score
meta.edit.commented = Commentaire
meta.edit.reliability = Fiabilité
meta.edit.credibility = Crédibili
meta.edit.reliability = Fiabilit\u00e9
meta.edit.credibility = Cr\u00e9dibilit\u00e9
meta.edit.subject = Sujet
meta.edit.toKeep = garder
meta.label.toKeep = A garder
meta.edit.toKeep = Prot\u00e9g\u00e9
meta.label.toKeep = \u00C0 prot\u00e9ger
meta.edit.lat = lat
meta.edit.lon = long
meta.edit.error.credibreliable=Ce champ ne peut être vide.
meta.errorSave= Une erreur s'est produite, les nouvelles métadonnées ne seront pas sauvegardées.
meta.addMetaButton=Ajouter des métadonnées
meta.help.subject=Valeur des sujets s\u00e9par\u00e9s par des virgules
meta.help.comment=Ins\u00e9rer votre commentaire
meta.reset=R\u00e9initialiser
meta.edit.error.credibreliable=Ce champ ne peut \u00eatre vide.
meta.errorSave= Une erreur s'est produite, les nouvelles m\u00e9tadonn\u00e9es ne seront pas sauvegard\u00e9es.