From c57b44c3f44a8b7b49259cb30ddd50dee494daf8 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 8 Oct 2015 17:19:18 +0000 Subject: [PATCH] 915: TDM - Support the Spanish language Task-Url: https://support.d4science.org/issues/915 Updated Spanish Support git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@119547 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../gwtservice/client/rpc/TDGWTService.java | 10 + .../client/rpc/TDGWTServiceAsync.java | 3 + .../gwtservice/server/SessionConstants.java | 2 + .../td/gwtservice/server/SessionUtil.java | 42 +- .../gwtservice/server/TDGWTServiceImpl.java | 924 ++++++++++++------ .../server/TDGWTServiceMessagesConstants.java | 17 + .../user/td/gwtservice/shared/Constants.java | 3 + .../td/gwtservice/shared/i18n/InfoLocale.java | 40 + .../td/gwtservice/client/Messages.properties | 2 - .../gwtservice/client/Messages_fr.properties | 2 - .../server/TDGWTServiceMessages.properties | 2 + .../server/TDGWTServiceMessages_en.properties | 2 + .../server/TDGWTServiceMessages_es.properties | 2 + .../server/TDGWTServiceMessages_it.properties | 2 + 14 files changed, 768 insertions(+), 285 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessagesConstants.java create mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/shared/i18n/InfoLocale.java delete mode 100644 src/main/resources/org/gcube/portlets/user/td/gwtservice/client/Messages.properties delete mode 100644 src/main/resources/org/gcube/portlets/user/td/gwtservice/client/Messages_fr.properties create mode 100644 src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages.properties create mode 100644 src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_en.properties create mode 100644 src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_es.properties create mode 100644 src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_it.properties diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java index 4b80485..017224e 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java @@ -21,6 +21,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.geospatial.GeospatialCreateC import org.gcube.portlets.user.td.gwtservice.shared.geospatial.GeospatialDownscaleCSquareSession; import org.gcube.portlets.user.td.gwtservice.shared.history.OpHistory; import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession; +import org.gcube.portlets.user.td.gwtservice.shared.i18n.InfoLocale; import org.gcube.portlets.user.td.gwtservice.shared.json.JSONExportSession; import org.gcube.portlets.user.td.gwtservice.shared.licenses.LicenceData; import org.gcube.portlets.user.td.gwtservice.shared.map.MapCreationSession; @@ -114,6 +115,15 @@ public interface TDGWTService extends RemoteService { */ public UserInfo hello() throws TDGWTServiceException; + + /** + * Set locale on server + * + * @param infoLocale + * @throws TDGWTServiceException + */ + public void setLocale(InfoLocale infoLocale) throws TDGWTServiceException; + /** * Retrieve pending Tasks and set them as background tasks * diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java index 39c9d93..2ad8861 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java @@ -20,6 +20,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.geospatial.GeospatialCreateC import org.gcube.portlets.user.td.gwtservice.shared.geospatial.GeospatialDownscaleCSquareSession; import org.gcube.portlets.user.td.gwtservice.shared.history.OpHistory; import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession; +import org.gcube.portlets.user.td.gwtservice.shared.i18n.InfoLocale; import org.gcube.portlets.user.td.gwtservice.shared.json.JSONExportSession; import org.gcube.portlets.user.td.gwtservice.shared.licenses.LicenceData; import org.gcube.portlets.user.td.gwtservice.shared.map.MapCreationSession; @@ -98,6 +99,8 @@ public interface TDGWTServiceAsync { .create(TDGWTService.class); void hello(AsyncCallback callback); + + void setLocale(InfoLocale infoLocale,AsyncCallback callback); void pendingTasksRetrieve(AsyncCallback callback); diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionConstants.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionConstants.java index 81e3535..15f09e9 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionConstants.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionConstants.java @@ -7,6 +7,8 @@ package org.gcube.portlets.user.td.gwtservice.server; * */ public class SessionConstants { + public static final String INFO_LOCALE="INFO_LOCALE"; + public static final String SCOPE_TO_CURRENT_TRID_MAP = "SCOPE_TO_CURRENT_TRID_MAP"; public static final String SCOPE_TO_CURRENT_TABULAR_RESOURCE_MAP = "SCOPE_TO_CURRENT_TABULAR_RESOURCE_MAP"; public static final String SCOPE_TO_CURRENT_TABULAR_RESOURCES_OPEN_MAP = "SCOPE_TO_CURRENT_TABULAR_RESOURCES_OPEN_MAP"; diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java index 62cb81c..d43ed96 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java @@ -6,6 +6,8 @@ package org.gcube.portlets.user.td.gwtservice.server; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Locale; +import java.util.ResourceBundle; import javax.servlet.http.HttpSession; @@ -28,6 +30,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.geometry.GeometryCreatePoint import org.gcube.portlets.user.td.gwtservice.shared.geospatial.GeospatialCreateCoordinatesSession; import org.gcube.portlets.user.td.gwtservice.shared.geospatial.GeospatialDownscaleCSquareSession; import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession; +import org.gcube.portlets.user.td.gwtservice.shared.i18n.InfoLocale; import org.gcube.portlets.user.td.gwtservice.shared.json.JSONExportSession; import org.gcube.portlets.user.td.gwtservice.shared.map.MapCreationSession; import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyAndDetachColumnRulesSession; @@ -91,7 +94,11 @@ public class SessionUtil { ASLSession session; if (username == null) { logger.warn("no user found in session, use test user"); - throw new TDGWTSessionExpiredException("Session Expired!"); + + InfoLocale infoLocale=getInfoLocale(httpSession); + Locale locale=new Locale(infoLocale.getLanguage()); + ResourceBundle messages=ResourceBundle.getBundle(TDGWTServiceMessagesConstants.TDGWTServiceMessages, locale); + throw new TDGWTSessionExpiredException(messages.getString(TDGWTServiceMessagesConstants.sessionExpired)); /* // Remove comment for Test @@ -115,6 +122,33 @@ public class SessionUtil { return session; } + + + // + public static InfoLocale getInfoLocale( + HttpSession httpSession) { + InfoLocale infoLocale = (InfoLocale) httpSession + .getAttribute(SessionConstants.INFO_LOCALE); + if (infoLocale != null) { + return infoLocale; + } else { + infoLocale = new InfoLocale("en"); + httpSession.setAttribute(SessionConstants.INFO_LOCALE, + infoLocale); + return infoLocale; + } + } + + public static void setInfoLocale(HttpSession httpSession, InfoLocale infoLocale) { + InfoLocale infoL = (InfoLocale) httpSession + .getAttribute(SessionConstants.INFO_LOCALE); + if (infoL != null) { + httpSession.removeAttribute(SessionConstants.INFO_LOCALE); + } + httpSession.setAttribute(SessionConstants.INFO_LOCALE, + infoLocale); + + } /** * Set in session the Tabular Resource List retrieved from service only for @@ -2707,4 +2741,10 @@ public class SessionUtil { } + + + + + + } diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index 0114be2..dafd657 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -17,7 +17,9 @@ import java.util.GregorianCalendar; import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; +import java.util.ResourceBundle; import java.util.Set; import javax.servlet.ServletException; @@ -179,6 +181,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.geospatial.GeospatialCreateC import org.gcube.portlets.user.td.gwtservice.shared.geospatial.GeospatialDownscaleCSquareSession; import org.gcube.portlets.user.td.gwtservice.shared.history.OpHistory; import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession; +import org.gcube.portlets.user.td.gwtservice.shared.i18n.InfoLocale; import org.gcube.portlets.user.td.gwtservice.shared.json.JSONExportSession; import org.gcube.portlets.user.td.gwtservice.shared.licenses.LicenceData; import org.gcube.portlets.user.td.gwtservice.shared.map.MapCreationSession; @@ -308,7 +311,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements private static final String NO_VALID_TABULAR_RESOURCE_ID_PRESENT = "No valid tabular resource id present!"; private static final String TABULAR_RESOURCE_IS_FINAL = "Tabular Resource Is Final!"; private static final String TABULAR_RESOURCE_IS_LOCKED = "Tabular Resource Is Locked!"; - private static final String SECURITY_EXCEPTION_RIGHTS = "Security exception, you don't have the required rights!"; private static final long serialVersionUID = -5707400086333186368L; private static Logger logger = LoggerFactory @@ -316,11 +318,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements private static SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm"); - + private static SimpleDateFormat sdfPerformance = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SSS"); - - + @Override public void init() throws ServletException { super.init(); @@ -346,9 +347,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public UserInfo hello() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); + UserInfo userInfo = new UserInfo(aslSession.getUsername(), aslSession.getGroupId(), aslSession.getGroupName(), aslSession.getScope(), aslSession.getScopeName(), @@ -360,7 +363,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); logger.error("Hello(): " + e.getLocalizedMessage(), e); @@ -369,6 +374,58 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } + /** + * + * {@inheritDoc} + */ + @Override + public void setLocale(InfoLocale infoLocale) throws TDGWTServiceException { + HttpSession session = null; + try { + session = this.getThreadLocalRequest().getSession(); + SessionUtil.getAslSession(session); + + if (infoLocale == null || infoLocale.getLanguage() == null + || infoLocale.getLanguage().isEmpty()) { + infoLocale = new InfoLocale("en"); + } + SessionUtil.setInfoLocale(session, infoLocale); + + } catch (TDGWTServiceException e) { + e.printStackTrace(); + throw e; + } catch (SecurityException e) { + e.printStackTrace(); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); + } catch (Throwable e) { + e.printStackTrace(); + logger.error("setLocale(): " + e.getLocalizedMessage(), e); + throw new TDGWTServiceException(e.getLocalizedMessage()); + } + } + + /** + * Retrieve Messages Bundle + * + * @param session + * @return + */ + protected ResourceBundle getResourceBundle(HttpSession session) { + InfoLocale infoLocale; + if (session == null) { + infoLocale = new InfoLocale("en"); + } else { + infoLocale = SessionUtil.getInfoLocale(session); + } + Locale locale = new Locale(infoLocale.getLanguage()); + ResourceBundle messages = ResourceBundle.getBundle( + TDGWTServiceMessagesConstants.TDGWTServiceMessages, locale); + return messages; + + } + /** * * {@inheritDoc} @@ -376,8 +433,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getPeriodDataTypes() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); ArrayList periodDataTypes = new ArrayList(); @@ -405,7 +463,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); + } catch (Throwable e) { logger.error("getPeriodDataTypes(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException("Error retrieving period types: " @@ -420,8 +481,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getHierarchicalRelationshipForPeriodDataTypes( PeriodDataType periodDataType) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); ArrayList hierarchicalPeriodDataTypes = new ArrayList(); @@ -453,7 +515,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("getPeriodDataTypes(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException( @@ -471,8 +535,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public HashMap> getValueDataFormatsMap() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); HashMap> columnDataTypeFormats = new HashMap>(); @@ -503,7 +568,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("getValueDataFormats(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException( @@ -521,8 +588,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getValueDataFormatsOfColumnDataType( ColumnDataType columnDataType) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); ArrayList valueDataFormats = new ArrayList(); @@ -546,7 +614,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "getValueDataFormatsOfColumnDataType(): " @@ -563,9 +633,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public Integer pendingTasksRetrieve() throws TDGWTServiceException { + HttpSession session = null; try { - - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("pendingTasksRetrieve()"); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -617,7 +687,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("pendingTaskRetrieve(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException("Error retrieving pending tasks: " @@ -631,8 +703,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public TRId restoreUISession(TRId startTRId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); if (startTRId == null || startTRId.getId() == null || startTRId.getId().isEmpty()) { @@ -687,7 +760,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("restoreUISession(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException("Error in UI Session Restore: " @@ -703,8 +778,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public void setTabResource(TabResource tabResource) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); setCurrentTabResource(tabResource, session); @@ -743,8 +819,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public TRId getCurrentTRId() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); TRId trId = SessionUtil.getTRId(session); @@ -762,7 +839,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("getCurrentTRID(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException("Error retrieving TR id: " @@ -777,8 +856,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public void closeAllTabularResources() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); SessionUtil.setTabResource(session, null); @@ -790,7 +870,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("getCurrentTRID(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException("Error retrieving TR id: " @@ -806,10 +888,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public void closeTabularResourceAndOpen(TRId openTRId, TRId closeTRId) throws TDGWTServiceException { + HttpSession session = null; try { + session = this.getThreadLocalRequest().getSession(); logger.debug("closeTabularResourceAndOpen(): Open[" + openTRId + "], Close[" + closeTRId + "]"); - HttpSession session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); SessionUtil.removeFromCurrentTabularResourcesOpen(session, closeTRId); @@ -837,7 +920,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("getCurrentTRID(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException("Error retrieving TR id: " @@ -849,9 +934,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public void closeTabularResource(TRId closeTRId) throws TDGWTServiceException { + HttpSession session = null; try { + session = this.getThreadLocalRequest().getSession(); logger.debug("closeTabularResource(): " + closeTRId); - HttpSession session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); SessionUtil.removeFromCurrentTabularResourcesOpen(session, @@ -866,7 +952,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("getCurrentTRID(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException("Error retrieving TR id: " @@ -882,9 +970,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public TRId setActiveTabularResource(TRId activeTRId) throws TDGWTServiceException { + HttpSession session = null; try { + session = this.getThreadLocalRequest().getSession(); logger.debug("setActiveTabularResource(): " + activeTRId); - HttpSession session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); TabResource tabResource = SessionUtil .getFromCurrentTabularResourcesOpen(session, activeTRId); @@ -975,7 +1064,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("getCurrentTRID(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException("Error retrieving TR id: " @@ -987,9 +1078,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public TabResource getInSessionTabResourceInfo() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); - + session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); TabResource currentTR = SessionUtil.getTabResource(session); @@ -999,7 +1090,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error setting TabResource parameter: " @@ -1016,8 +1109,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public TabResource getTabResourceInformation() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -1046,7 +1140,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements ArrayList trMetadatas = getTRMetadata(tr); updateTabResourceInformation(currentTR, trMetadatas); - + currentTR.setDate(tr.getCreationDate().getTime()); currentTR.setValid(tr.isValid()); currentTR.setFinalized(tr.isFinalized()); @@ -1064,7 +1158,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error setting TabResource parameter: " @@ -1082,9 +1178,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public TabResource getTabResourceInformation(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); if (trId == null) { logger.error("GetTabularREsourceInformation TRId is null"); @@ -1124,7 +1220,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error setting TabResource parameter: " @@ -1190,8 +1288,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public Long getTimeTableId(PeriodDataType periodDataType) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -1211,7 +1310,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error retrieving Time Table: " + e.getLocalizedMessage(), @@ -1228,8 +1329,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements * {@inheritDoc} */ public ArrayList getColumns() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); TabResource currentTR = SessionUtil.getTabResource(session); @@ -1332,7 +1434,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error retrieving Columns: " + e.getLocalizedMessage(), e); @@ -1351,8 +1455,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getColumns(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -1450,7 +1555,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error retrieving Columns: " + e.getLocalizedMessage(), e); @@ -1469,8 +1576,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getColumnWithViewColumnIncluded(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -1572,7 +1680,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error retrieving Columns: " + e.getLocalizedMessage(), e); @@ -1592,8 +1702,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getColumnWithOnlyViewColumnInRel(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -1733,7 +1844,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error retrieving Columns: " + e.getLocalizedMessage(), e); @@ -1752,8 +1865,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public ArrayList getColumnsForStatistical(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -1884,7 +1998,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error retrieving Columns: " + e.getLocalizedMessage(), e); @@ -1986,8 +2102,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public ColumnData getColumn(String columnLocalId, TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -2076,7 +2193,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("Error retrieving Column: " + e.getLocalizedMessage(), e); @@ -2091,8 +2210,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public ColumnData getColumn(TRId trId, String columnName) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -2179,7 +2299,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("Error retrieving Column: " + e.getLocalizedMessage(), e); @@ -2195,8 +2317,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getValidationColumns(String columnId, TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -2295,7 +2418,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error retrieving Validation Columns: " @@ -2314,8 +2439,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getValidationColumns(TRId trId, String columnName) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -2412,7 +2538,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error retrieving Validation Columns: " @@ -2429,8 +2557,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public TableData getLastTable(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("getLastTable(): " + trId); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -2594,7 +2723,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("Error in getLastTable(): " + e.getLocalizedMessage(), e); @@ -2608,8 +2739,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements * {@inheritDoc} */ public TableData getTable(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("getTable(): " + trId); @@ -2763,7 +2895,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("Error in getTable(): " + e.getLocalizedMessage(), e); throw new TDGWTServiceException("Error in getTable(): " @@ -2778,8 +2912,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements * {@inheritDoc} */ public void tdOpen(TDOpenSession s) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); SessionUtil.setTDOpenSession(session, s); return; @@ -3052,8 +3187,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements * {@inheritDoc} */ public void setCodelistsPagingLoader() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -3092,7 +3228,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); logger.error("Error retrieving Codelist in setCodelistsPagingLoader(): " @@ -3109,8 +3247,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public CodelistPagingLoadResult getCodelistsPagingLoader( CodelistPagingLoadConfig plc) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); logger.debug(plc.toString()); @@ -3175,7 +3314,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); logger.error("Error retrieving Codelist in getCodelistsPagingLoader(): " @@ -3427,8 +3568,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getTabularResourcesAndLastTables() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("GetTabularResources"); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -3464,7 +3606,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); logger.error("Error retrieving TabularResources: " @@ -3484,8 +3628,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getTabularResources() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("GetTabularResources"); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -3521,7 +3666,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); logger.error("Error retrieving TabularResources: " @@ -3540,8 +3687,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public void removeTabularResource(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); if (trId == null) { @@ -3575,7 +3723,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error deleting the tabular resource: " @@ -3592,8 +3742,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public TabResource createTabularResource(TabResource tabResource) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); if (tabResource == null) { @@ -3623,7 +3774,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error creating new TabularResource: " @@ -3639,14 +3792,15 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements * {@inheritDoc} */ public ArrayList getCodelists() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); - - //Remove this for multiple source + session = this.getThreadLocalRequest().getSession(); + + // Remove this for multiple source SDMXRegistrySource sdmxRegistrySource = new SDMXRegistrySource(); SessionUtil.setSDMXRegistrySource(session, sdmxRegistrySource); // - + return SessionUtil.retrieveCodelists(session); } catch (TDGWTServiceException e) { @@ -3659,15 +3813,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } - - - /** * {@inheritDoc} */ public ArrayList getDatasets() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); return SessionUtil.retrieveDatasets(session); } catch (TDGWTServiceException e) { @@ -3684,8 +3836,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements * {@inheritDoc} */ public ArrayList getAgencies() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); return SessionUtil.retrieveAgencies(session); } catch (TDGWTServiceException e) { @@ -3705,8 +3858,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startSDMXImport(SDMXImportSession sdmxImportSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setSDMXImportSession(session, sdmxImportSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -3753,7 +3907,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in SDMX Import: " @@ -3770,8 +3926,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ private TRId retrieveTabularResourceBasicData(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -3822,7 +3979,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error on Service: " @@ -3836,8 +3995,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public void setSDMXRegistrySource(SDMXRegistrySource sdmxRegistrySource) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setSDMXRegistrySource(session, sdmxRegistrySource); return; @@ -3860,8 +4020,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public void setCSVSession(CSVImportSession importSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setCSVImportSession(session, importSession); return; @@ -4004,8 +4165,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements logger.debug("StartCSVImport: " + csvImportSession); CSVFileUploadSession fileUploadSession = null; + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); if (session == null) { throw new TDGWTServiceException( "Error retrieving the session: null"); @@ -4085,7 +4247,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements logger.error(e1.getLocalizedMessage()); } e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { try { if (fileUploadSession != null @@ -4192,8 +4356,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public String getTRCreationDate(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("GetTRMetadata on " + trId.toString()); @@ -4228,8 +4393,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public Boolean isTabularResourceValid(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("IsTabularResourceValid: " + trId.toString()); @@ -4248,7 +4414,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("Error checking if it is a valid tabular resource: " + e.getLocalizedMessage(), e); @@ -4267,8 +4435,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public Boolean isTabularResourceFinalized(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("IsTabularResourceFinalized: " + trId.toString()); @@ -4286,7 +4455,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error checking if it is a finalized tabular resource: " @@ -4306,8 +4477,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public Boolean isTabularResourceLocked(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("IsTabularResourceLocked: " + trId); @@ -4325,7 +4497,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error("Error checking if it is a locked tabular resource: " + e.getLocalizedMessage(), e); @@ -4385,7 +4559,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements TRValidUntilMetadata validUntilMetadata = new TRValidUntilMetadata(); Calendar cal = ((ValidUntilMetadata) trMetadata) .getValue(); - validUntilMetadata.setValue(cal.getTime()); + validUntilMetadata.setValue(cal + .getTime()); listTRMetadata.add(validUntilMetadata); } else { if (trMetadata instanceof LicenceMetadata) { @@ -4413,7 +4588,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(null); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error in getTRMetadata(): " + e.getLocalizedMessage(), e); @@ -4429,8 +4606,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getTRMetadata(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("GetTRMetadata on " + trId); @@ -4489,7 +4667,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements TRValidUntilMetadata validUntilMetadata = new TRValidUntilMetadata(); Calendar cal = ((ValidUntilMetadata) trMetadata) .getValue(); - validUntilMetadata.setValue(cal.getTime()); + validUntilMetadata.setValue(cal + .getTime()); listTRMetadata.add(validUntilMetadata); } else { if (trMetadata instanceof LicenceMetadata) { @@ -4519,7 +4698,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error in getTRMetadata(): " + e.getLocalizedMessage(), e); @@ -4536,8 +4717,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public TabValidationsMetadata getTableValidationsMetadata(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("GetTableValidationsMetadata on " + trId.toString()); @@ -4576,7 +4758,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error in getTableValidationMetadata(): " @@ -4593,8 +4777,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public ArrayList getTableMetadata(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("GetTableMetadata on " + trId.toString()); @@ -4812,14 +4997,14 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public String startSDMXExport(SDMXExportSession exportSession) throws TDGWTServiceException { + HttpSession session = null; try { - - logger.debug("Start SDMX Export"); - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); if (session == null) { throw new TDGWTServiceException( "Error retrieving the session: null"); } + logger.debug("Start SDMX Export"); logger.debug("Session:" + session.getId()); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -4883,7 +5068,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in SDMXExport: " @@ -4899,10 +5086,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startCSVExport(CSVExportSession exportSession) throws TDGWTServiceException { + HttpSession session = null; try { + session = this.getThreadLocalRequest().getSession(); logger.debug("Start CSV Export"); - HttpSession session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); TRId trId = SessionUtil.getTRId(session); @@ -4957,7 +5145,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in CSV Export: " @@ -4973,10 +5163,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startJSONExport(JSONExportSession exportSession) throws TDGWTServiceException { + HttpSession session = null; try { - + session = this.getThreadLocalRequest().getSession(); logger.debug("Start JSON Export"); - HttpSession session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); TRId trId = SessionUtil.getTRId(session); @@ -5030,7 +5220,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in JSON Export: " @@ -5047,8 +5239,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startChangeColumnType( ChangeColumnTypeSession changeColumnTypeSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); SessionUtil.setChangeColumnTypeSession(session, @@ -5096,7 +5289,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in ChangeColumnType: " @@ -5150,7 +5345,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in AddColumn: " @@ -5176,8 +5373,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public String startDeleteColumn(DeleteColumnSession deleteColumnSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setDeleteColumnSession(session, deleteColumnSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -5224,7 +5422,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in DeleteColumn: " @@ -5295,7 +5495,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in filter column: " @@ -5381,7 +5583,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException( @@ -5397,8 +5601,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ public String startLabelColumn(LabelColumnSession labelColumnSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setLabelColumnSession(session, labelColumnSession); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug(labelColumnSession.toString()); @@ -5458,7 +5663,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error Changing The Column Label: " @@ -5475,8 +5682,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startChangeTableType( ChangeTableTypeSession changeTableTypeSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setChangeTableTypeSession(session, changeTableTypeSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -5522,7 +5730,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error Changing Table Type: " @@ -5539,8 +5749,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getColumnsForDimension(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -5627,7 +5838,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error in getColumnsForDimension() retrieving Columns: " @@ -5644,8 +5857,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startDeleteRows(DeleteRowsSession deleteRowsSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setDeleteRowsSession(session, deleteRowsSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -5689,7 +5903,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error Deleting Rows: " @@ -5707,8 +5923,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startCloneTabularResource( CloneTabularResourceSession cloneTabularResourceSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -5777,7 +5994,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error Cloning: " @@ -5793,8 +6012,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startDuplicates(DuplicatesSession duplicatesSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setDuplicatesSession(session, duplicatesSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -5838,7 +6058,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException( @@ -5847,8 +6069,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } } - - //TODO + + // TODO /** * * {@inheritDoc} @@ -5856,8 +6078,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startValidationsDelete(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -5877,7 +6100,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements Task trTask = service.removeValidations(tabularResourceId); logger.debug("Start Task on service: TaskId " + trTask.getId()); - + TaskWrapper taskWrapper = new TaskWrapper(trTask, UIOperationsId.ValidationsDelete, trId); SessionUtil.setStartedTask(session, taskWrapper); @@ -5887,19 +6110,17 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); - throw new TDGWTServiceException( - "Error deleting validations: " - + e.getLocalizedMessage()); + throw new TDGWTServiceException("Error deleting validations: " + + e.getLocalizedMessage()); } } - - - private ArrayList retrieveShareInfo(TabularResource tr) throws TDGWTServiceException { try { @@ -5925,7 +6146,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements return contacts; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(null); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in retrieveShareInfo: " @@ -5941,8 +6164,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public void setShare(ShareTabResource shareInfo) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("ShareInfo: " + shareInfo); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -5976,7 +6200,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error on service"); @@ -5990,8 +6216,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public void setShareTemplate(ShareTemplate shareTemplate) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("ShareTemplate: " + shareTemplate); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -6025,7 +6252,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error on service"); @@ -6038,8 +6267,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public void setShareRule(ShareRule shareRule) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("ShareRule: " + shareRule); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -6073,7 +6303,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error on service"); @@ -6082,9 +6314,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public boolean checkTabularResourceNotFinal(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("checkTabularResourceNotFinal: " + trId); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -6101,7 +6333,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("Error in checkTabularResourceNotFinal: " + e.getLocalizedMessage()); @@ -6119,8 +6353,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public void setTabResourceInformation(TabResource tabResource) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("SetTabResourceInformation: " + tabResource); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -6222,7 +6457,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("Error in setTabResourceInformation: " + e.getLocalizedMessage()); @@ -6240,8 +6477,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public void setTabResourceToFinal(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("SetTabResourceToFinal: " + trId); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -6274,7 +6512,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("Error in setTabResourceToFinal: " + e.getLocalizedMessage()); @@ -6293,8 +6533,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public ArrayList getOccurrencesForBatchReplace( OccurrencesForReplaceBatchColumnSession occurrencesForReplaceBatchColumnSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("GetOccurencesForBatchReplace: " + occurrencesForReplaceBatchColumnSession.toString()); @@ -6313,7 +6554,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("Error in GetOccurencesForBatchReplace: " + e.getLocalizedMessage()); @@ -6331,8 +6574,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public ArrayList getTemplates() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("GetTemplates"); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -6367,8 +6611,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements Contacts owner = new Contacts("", desc.getOwner(), false); templateData.setOwner(owner); templateData.setContacts(retrieveTemplateShareInfo(desc)); - if(desc.getCreationdDate()!=null){ - templateData.setCreationDate(desc.getCreationdDate().getTime()); + if (desc.getCreationdDate() != null) { + templateData.setCreationDate(desc.getCreationdDate() + .getTime()); } else { templateData.setCreationDate(null); } @@ -6382,7 +6627,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("Error in GetTemplates: " + e.getLocalizedMessage()); e.printStackTrace(); @@ -6421,7 +6668,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements return contacts; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(null); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in retrieveShareInfo: " @@ -6437,8 +6686,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startTemplateApply(TemplateApplySession templateApplySession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("startTemplateApply: " + templateApplySession); SessionUtil.setTemplateApplySession(session, templateApplySession); @@ -6479,7 +6729,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("Error StartTemplateApply: " + e.getLocalizedMessage()); e.printStackTrace(); @@ -6496,8 +6748,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public void templateDelete(TemplateDeleteSession templateDeleteSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("startTemplateDelete: " + templateDeleteSession); @@ -6520,7 +6773,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements "Error StartTemplateDelete: No such Template"); } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("Error StartTemplateDelete: " + e.getLocalizedMessage()); @@ -6538,8 +6793,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startReplaceColumn(ReplaceColumnSession replaceColumnSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setReplaceColumnSession(session, replaceColumnSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -6585,7 +6841,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException( @@ -6603,8 +6861,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startReplaceBatchColumn( ReplaceBatchColumnSession replaceBatchColumnSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setReplaceBatchColumnSession(session, replaceBatchColumnSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -6656,7 +6915,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException( @@ -6672,8 +6933,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public ArrayList getLocales() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); @SuppressWarnings("unused") ASLSession aslSession = SessionUtil.getAslSession(session); @@ -6702,8 +6964,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public OpHistory getLastOperationInfo() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("getLastOperationInfo()"); @@ -6748,7 +7011,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("getLastOperationInfo(): " + e.getLocalizedMessage()); e.printStackTrace(); @@ -6766,8 +7031,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public OpHistory getLastOperationInfo(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("getLastOperationInfo: " + trId); @@ -6805,7 +7071,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("getLastOperationInfo(): " + e.getLocalizedMessage()); e.printStackTrace(); @@ -6821,8 +7089,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public ArrayList getHistory() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("getHistory()"); @@ -6868,7 +7137,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("getHistory(): " + e.getLocalizedMessage()); e.printStackTrace(); @@ -6885,8 +7156,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getHistory(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("getHistory(): " + trId); @@ -6925,7 +7197,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("getHistory(): " + e.getLocalizedMessage()); e.printStackTrace(); @@ -6940,8 +7214,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public String startDiscard(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("StartDiscard: " + trId); @@ -7030,7 +7305,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("discard(): " + e.getLocalizedMessage()); e.printStackTrace(); @@ -7046,8 +7323,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startRollBack(RollBackSession rollBackSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("rollBack(): " + rollBackSession); @@ -7092,7 +7370,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.debug("rollBack(): " + e.getLocalizedMessage()); e.printStackTrace(); @@ -7127,8 +7407,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ValidationsTasksMetadata getValidationsTasksMetadata(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("GetTableValidationsMetadata on " + trId.toString()); @@ -7227,7 +7508,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error in getValidationsTasksMetadata(): " @@ -7241,8 +7524,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startEditRow(EditRowSession editRowSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setEditRowSession(session, editRowSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -7290,7 +7574,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in operation: " @@ -7307,8 +7593,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ColumnData getConnection(RefColumn refColumn) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("GetConnection on " + refColumn.toString()); @@ -7358,8 +7645,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startTaskResubmit(TaskResubmitSession taskResubmitSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setTaskResubmitSession(session, taskResubmitSession); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("StartTaskResubmit: " + taskResubmitSession); @@ -7405,7 +7693,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in resubmit task: " @@ -7417,8 +7707,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startTaskResume(TaskResumeSession taskResumeSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setTaskResumeSession(session, taskResumeSession); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("StartTaskResume: " + taskResumeSession); @@ -7553,7 +7844,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in resume task: " @@ -7566,8 +7859,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startExtractCodelist( ExtractCodelistSession extractCodelistSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setExtractCodelistSession(session, extractCodelistSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -7617,7 +7911,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in extract codelist: " @@ -7682,7 +7978,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in split column: " @@ -7748,7 +8046,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in split column: " @@ -7761,8 +8061,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public void setCodelistMappingSession( CodelistMappingSession codelistMappingSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setCodelistMappingSession(session, codelistMappingSession); return; @@ -7870,9 +8171,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startCodelistMappingImport( CodelistMappingSession codelistMappingSession) throws TDGWTServiceException { + HttpSession session = null; try { - - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); if (session == null) { throw new TDGWTServiceException("Session is null"); } @@ -7902,7 +8203,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException( @@ -8040,7 +8343,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in start group by: " @@ -8099,7 +8404,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in start Time Aggregation: " @@ -8110,8 +8417,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startNormalization(NormalizationSession normalizationSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setNormalizationSession(session, normalizationSession); ASLSession aslSession = SessionUtil.getAslSession(session); if (normalizationSession == null) { @@ -8162,7 +8470,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in start normalization: " @@ -8175,8 +8485,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startDenormalization( DenormalizationSession denormalizationSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setDenormalizationSession(session, denormalizationSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -8228,7 +8539,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in start denormalization: " @@ -8244,8 +8557,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startUnion(UnionSession unionSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setUnionSession(session, unionSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -8288,7 +8602,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in union: " @@ -8305,8 +8621,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public void startChangeColumnsPosition( ChangeColumnsPositionSession changeColumnsPositionSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setChangeColumnsPositionSession(session, changeColumnsPositionSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -8347,7 +8664,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in change position: " @@ -8364,8 +8683,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startReplaceByExternal( ReplaceByExternalSession replaceByExternalSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setReplaceByExternalSession(session, replaceByExternalSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -8410,7 +8730,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in replace by external: " @@ -8427,8 +8749,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startStatisticalOperation( StatisticalOperationSession statisticalOperationSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setStatisticalOperationSession(session, statisticalOperationSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -8472,7 +8795,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in statistical operation: " @@ -8489,8 +8814,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public OperationMonitor getOperationMonitor( OperationMonitorSession operationMonitorSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); TaskWrapper taskWrapper = SessionUtil.getStartedTask(session, @@ -8520,8 +8846,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements */ @Override public ArrayList getLicences() throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.getAslSession(session); ArrayList licences = new ArrayList(); @@ -8530,7 +8857,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements LicenceData licenceData; for (int i = 0; i < licencesArray.length; i++) { licence = licencesArray[i]; - licenceData = new LicenceData(i, licence.toString(),licence.getName()); + licenceData = new LicenceData(i, licence.toString(), + licence.getName()); licences.add(licenceData); } @@ -8541,7 +8869,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in get Licences: " @@ -8558,8 +8888,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public OperationMonitor getBackgroundOperationMonitorForSpecificTask( OperationMonitorSession operationMonitorSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); OperationMonitor operationMonitor = null; @@ -8624,8 +8955,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public ArrayList getBackgroundOperationMonitor( BackgroundOperationMonitorSession backgroundOperationMonitorSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("getBackgroundOperationMonitor(): " + backgroundOperationMonitorSession); @@ -8713,8 +9045,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getResourcesTD(TRId trId) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -8743,7 +9076,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error retrieving resources: " + e.getLocalizedMessage(), e); @@ -8760,8 +9095,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public ArrayList getResourcesTDByType(TRId trId, ResourceTDType resourceTDType) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); AuthorizationProvider.instance.set(new AuthorizationToken( @@ -8792,7 +9128,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error retrieving resources by type: " @@ -8810,8 +9148,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public void removeResource(RemoveResourceSession removeResourceSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("Remove Resource: " + removeResourceSession); @@ -8844,8 +9183,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw new TDGWTServiceException( "Error removing Resource no descriptor set"); } - for(ResourceTDDescriptor resourceTDDescriptor:removeResourceSession.getResources()){ - service.removeResurce(resourceTDDescriptor.getId()); + for (ResourceTDDescriptor resourceTDDescriptor : removeResourceSession + .getResources()) { + service.removeResurce(resourceTDDescriptor.getId()); } } else { throw new TDGWTServiceException( @@ -8858,7 +9198,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { logger.error( "Error deleting the resource: " + e.getLocalizedMessage(), @@ -8875,8 +9217,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String startMapCreation(MapCreationSession mapCreationSession) throws TDGWTServiceException { + HttpSession session = null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setMapCreationSession(session, mapCreationSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -8919,7 +9262,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error creating the map: " @@ -8935,10 +9280,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public String getUriFromResolver(UriResolverSession uriResolverSession) throws TDGWTServiceException { + String link = ""; + HttpSession session = null; try { - String link = ""; - - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); ASLSession aslSession = SessionUtil.getAslSession(session); logger.debug("Get uri from resolver: " + uriResolverSession); @@ -8951,7 +9296,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException( @@ -8968,8 +9315,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startChartTopRating( ChartTopRatingSession chartTopRatingSession) throws TDGWTServiceException { + HttpSession session=null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil .setChartTopRatingSession(session, chartTopRatingSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -9015,7 +9363,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error creating top rating chart: " @@ -9031,8 +9381,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements @Override public void saveResource(SaveResourceSession saveResourceSession) throws TDGWTServiceException { + HttpSession session=null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setSaveResourceSession(session, saveResourceSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -9085,7 +9436,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error saving the resource: " @@ -9125,26 +9478,23 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements "This resource does not have valid storage id: " + storageId); } - - MimeTypeSupport mime=saveResourceSession.getMime(); - String fileName=""; - - if(mime==null|| mime.compareTo(MimeTypeSupport._unknow)==0){ - fileName=saveResourceSession.getFileName(); + + MimeTypeSupport mime = saveResourceSession.getMime(); + String fileName = ""; + + if (mime == null || mime.compareTo(MimeTypeSupport._unknow) == 0) { + fileName = saveResourceSession.getFileName(); } else { - fileName=saveResourceSession.getFileName()+ - mime.getExtension(); + fileName = saveResourceSession.getFileName() + mime.getExtension(); } - - + logger.debug("Create Item On Workspace: [storageId=" + storageId + " ,user: " + aslSession.getUsername() + " ,fileName: " + fileName + " ,fileDescription: " + saveResourceSession.getFileDescription() + " ,mimetype:" + mimeType + " ,folder: " + saveResourceSession.getItemId() + "]"); - - + FilesStorage storage = new FilesStorage(); storage.createItemOnWorkspaceByStorageId(storageId, aslSession.getUsername(), fileName, @@ -9190,28 +9540,25 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw new TDGWTServiceException( "This resource does not have valid link: " + link); } - - MimeTypeSupport mime=saveResourceSession.getMime(); - String fileName=""; - - if(mime==null|| mime.compareTo(MimeTypeSupport._unknow)==0){ - fileName=saveResourceSession.getFileName(); + + MimeTypeSupport mime = saveResourceSession.getMime(); + String fileName = ""; + + if (mime == null || mime.compareTo(MimeTypeSupport._unknow) == 0) { + fileName = saveResourceSession.getFileName(); } else { - fileName=saveResourceSession.getFileName()+ - mime.getExtension(); + fileName = saveResourceSession.getFileName() + mime.getExtension(); } - - + logger.debug("Create Item On Workspace: [uri=" + link + " ,user: " - + aslSession.getUsername() + " ,fileName: " - + fileName + " ,fileDescription: " + + aslSession.getUsername() + " ,fileName: " + fileName + + " ,fileDescription: " + saveResourceSession.getFileDescription() + " ,mimetype:" + mimeType + " ,folder: " + saveResourceSession.getItemId() + "]"); FilesStorage storage = new FilesStorage(); - storage.createItemOnWorkspace(link, aslSession.getUsername(), - fileName, + storage.createItemOnWorkspace(link, aslSession.getUsername(), fileName, saveResourceSession.getFileDescription(), mimeType, saveResourceSession.getItemId()); } @@ -9224,8 +9571,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startGeospatialCreateCoordinates( GeospatialCreateCoordinatesSession geospatialCreateCoordinatesSession) throws TDGWTServiceException { + HttpSession session=null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setGeospatialCreateCoordinatesSession(session, geospatialCreateCoordinatesSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -9280,7 +9628,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException( @@ -9298,8 +9648,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startGeospatialDownscaleCSquare( GeospatialDownscaleCSquareSession geospatialDownscaleCSquareSession) throws TDGWTServiceException { + HttpSession session=null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setGeospatialDownscaleCSquareSession(session, geospatialDownscaleCSquareSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -9354,7 +9705,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in downscale C-Square: " @@ -9371,8 +9724,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements public String startGeometryCreatePoint( GeometryCreatePointSession geometryCreatePointSession) throws TDGWTServiceException { + HttpSession session=null; try { - HttpSession session = this.getThreadLocalRequest().getSession(); + session = this.getThreadLocalRequest().getSession(); SessionUtil.setGeometryCreatePointSession(session, geometryCreatePointSession); ASLSession aslSession = SessionUtil.getAslSession(session); @@ -9428,7 +9782,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error creating geometry point: " @@ -9524,7 +9880,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in apply rules on column: " @@ -9603,7 +9961,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in apply rules on table: " @@ -9677,7 +10037,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in detach rules on column: " @@ -9741,7 +10103,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw e; } catch (SecurityException e) { e.printStackTrace(); - throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS); + ResourceBundle messages = getResourceBundle(session); + throw new TDGWTServiceException( + messages.getString(TDGWTServiceMessagesConstants.securityExceptionRights)); } catch (Throwable e) { e.printStackTrace(); throw new TDGWTServiceException("Error in detach rules on column: " diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessagesConstants.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessagesConstants.java new file mode 100644 index 0000000..7605fd1 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessagesConstants.java @@ -0,0 +1,17 @@ +package org.gcube.portlets.user.td.gwtservice.server; + +/** + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ +public class TDGWTServiceMessagesConstants { + + public static final String TDGWTServiceMessages = "org.gcube.portlets.user.td.gwtservice.server.TDGWTServiceMessages"; + + public static final String sessionExpired = "sessionExpired"; + + public static final String securityExceptionRights = "securityExceptionRights"; + +} diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java index 28dbab1..1c37b32 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java @@ -16,6 +16,8 @@ public class Constants { public final static String FILE_XML_MIMETYPE = "application/xml"; public final static String FILE_CSV_MIMETYPE = "text/csv"; + + public static final String PARAMETER_ENCODING = "encoding"; public static final String PARAMETER_HASHEADER = "hasHeader"; @@ -128,4 +130,5 @@ public class Constants { public static final String PARAMETER_RESOURCE_NAME = "name"; public static final String PARAMETER_RESOURCE_DESCRIPTION = "description"; + } diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/i18n/InfoLocale.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/i18n/InfoLocale.java new file mode 100644 index 0000000..392a14b --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/i18n/InfoLocale.java @@ -0,0 +1,40 @@ +package org.gcube.portlets.user.td.gwtservice.shared.i18n; + +import java.io.Serializable; + +/** + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ +public class InfoLocale implements Serializable { + + private static final long serialVersionUID = -8025774800803525216L; + + private String language; + + public InfoLocale() { + super(); + } + + public InfoLocale(String language) { + super(); + this.language = language; + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + @Override + public String toString() { + return "InfoLocale [language=" + language + "]"; + } + + +} diff --git a/src/main/resources/org/gcube/portlets/user/td/gwtservice/client/Messages.properties b/src/main/resources/org/gcube/portlets/user/td/gwtservice/client/Messages.properties deleted file mode 100644 index c222555..0000000 --- a/src/main/resources/org/gcube/portlets/user/td/gwtservice/client/Messages.properties +++ /dev/null @@ -1,2 +0,0 @@ -sendButton = Send -nameField = Enter your name \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/gwtservice/client/Messages_fr.properties b/src/main/resources/org/gcube/portlets/user/td/gwtservice/client/Messages_fr.properties deleted file mode 100644 index b4a7627..0000000 --- a/src/main/resources/org/gcube/portlets/user/td/gwtservice/client/Messages_fr.properties +++ /dev/null @@ -1,2 +0,0 @@ -sendButton = Envoyer -nameField = Entrez votre nom \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages.properties b/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages.properties new file mode 100644 index 0000000..6178e1f --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages.properties @@ -0,0 +1,2 @@ +sessionExpired = Session Expired! +securityExceptionRights = Security exception, you don't have the required rights! diff --git a/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_en.properties b/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_en.properties new file mode 100644 index 0000000..6178e1f --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_en.properties @@ -0,0 +1,2 @@ +sessionExpired = Session Expired! +securityExceptionRights = Security exception, you don't have the required rights! diff --git a/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_es.properties b/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_es.properties new file mode 100644 index 0000000..eb3f134 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_es.properties @@ -0,0 +1,2 @@ +sessionExpired = Sesión Ha Finalizado! +securityExceptionRights = Excepción de seguridad, usted no tiene los derechos necesarios! \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_it.properties b/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_it.properties new file mode 100644 index 0000000..ec04268 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceMessages_it.properties @@ -0,0 +1,2 @@ +sessionExpired = Sessione Scaduta! +securityExceptionRights = Eccezione di sicurezza, non si dispone dei diritti necessari!