diff --git a/pom.xml b/pom.xml index 6196c99..1b9b368 100644 --- a/pom.xml +++ b/pom.xml @@ -209,6 +209,22 @@ update them in DevMode --> ${webappDirectory}/WEB-INF/classes + + + src/main/java + + **/*.csv + + + + + + + + + + + diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java index db01754..6a6ec99 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java @@ -34,7 +34,7 @@ import org.gcube.portlets.user.geoportaldataentry.server.MongoServiceUtil.Conces import org.gcube.portlets.user.geoportaldataentry.server.config.GNARoleRitghtsConfigReader; import org.gcube.portlets.user.geoportaldataentry.shared.ACTION_ON_ITEM; import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; -import org.gcube.portlets.user.geoportaldataentry.shared.GNAUserRightsConfigNotFoundException; +import org.gcube.portlets.user.geoportaldataentry.shared.GNAUserRightsConfigException; import org.gcube.portlets.user.geoportaldataentry.shared.GcubeUserRole; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; import org.gcube.portlets.user.geoportaldataentry.shared.GeonaISConfig; @@ -920,7 +920,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen UserRights userRights = new UserRights(scope, toRoleRight); LOG.info("returning: " + userRights); return userRights; - } catch (UserRetrievalFault | GroupRetrievalFault | GNAUserRightsConfigNotFoundException e) { + } catch (UserRetrievalFault | GroupRetrievalFault | GNAUserRightsConfigException e) { LOG.error("An error occurred during getMyRightsInTheContext: " + user, e); Map permissions = new HashMap(); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/config/GNARoleRitghtsConfigReader.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/config/GNARoleRitghtsConfigReader.java index 6a97d8b..81cc0c7 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/config/GNARoleRitghtsConfigReader.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/config/GNARoleRitghtsConfigReader.java @@ -9,7 +9,7 @@ import java.util.List; import java.util.Map; import org.gcube.portlets.user.geoportaldataentry.shared.ACTION_ON_ITEM; -import org.gcube.portlets.user.geoportaldataentry.shared.GNAUserRightsConfigNotFoundException; +import org.gcube.portlets.user.geoportaldataentry.shared.GNAUserRightsConfigException; import org.gcube.portlets.user.geoportaldataentry.shared.GcubeUserRole; import org.gcube.portlets.user.geoportaldataentry.shared.RoleRights; import org.gcube.portlets.user.geoportaldataentry.shared.RoleRights.OPERATION_TYPE; @@ -37,11 +37,12 @@ public class GNARoleRitghtsConfigReader { * Read user rights config. * * @return the list - * @throws GNAUserRightsConfigNotFoundException the GNA user rights config not + * @throws GNAUserRightsConfigException the GNA user rights config not * found exception */ - public static List readRoleRightsConfig() throws GNAUserRightsConfigNotFoundException { - + public static List readRoleRightsConfig() throws GNAUserRightsConfigException { + LOG.debug("readRoleRightsConfig called"); + File configurationFile = null; try { @@ -131,9 +132,9 @@ public class GNARoleRitghtsConfigReader { Log.info("Returning user rights config: " + listUserRights); return listUserRights; - } catch (IOException e) { - LOG.error("An error occurred on reading the property file " + USER_RIGHTS_CONFIG_FILENAME, e); - throw new GNAUserRightsConfigNotFoundException("Error on reading the base layers. Is the file '" + } catch (Exception e) { + LOG.error("An error occurred on reading the configuration file " + USER_RIGHTS_CONFIG_FILENAME, e); + throw new GNAUserRightsConfigException("Error on reading the configuration file. Is the file '" + USER_RIGHTS_CONFIG_FILENAME + "' in the application path?"); } finally { diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNAUserRightsConfigException.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNAUserRightsConfigException.java new file mode 100644 index 0000000..7684f94 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNAUserRightsConfigException.java @@ -0,0 +1,8 @@ +package org.gcube.portlets.user.geoportaldataentry.shared; + +@SuppressWarnings("serial") +public class GNAUserRightsConfigException extends Exception { + public GNAUserRightsConfigException(String message) { + super(message); + } +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNAUserRightsConfigNotFoundException.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNAUserRightsConfigNotFoundException.java deleted file mode 100644 index 525c906..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/shared/GNAUserRightsConfigNotFoundException.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.gcube.portlets.user.geoportaldataentry.shared; - -@SuppressWarnings("serial") -public class GNAUserRightsConfigNotFoundException extends Exception { - public GNAUserRightsConfigNotFoundException(String message) { - super(message); - } -} \ No newline at end of file diff --git a/src/test/java/org/gcube/portlets/user/geoportaldataentry/client/TestClass.java b/src/test/java/org/gcube/portlets/user/geoportaldataentry/client/TestClass.java index 453ed95..14af4bd 100644 --- a/src/test/java/org/gcube/portlets/user/geoportaldataentry/client/TestClass.java +++ b/src/test/java/org/gcube/portlets/user/geoportaldataentry/client/TestClass.java @@ -21,20 +21,6 @@ public class TestClass { private static String CONTEXT = "/gcube/devsec/devVRE"; private static String USERNAME = "francesco.mangiacrapa"; -// LocalDateTime ldt = ConvertToServiceModel.toLocalDateTime("2020-10-01 10:20"); -// System.out.println(ldt.toString()); -// -// String latitudine = "-899.2986"; -// // System.out.println(latitudine.matches("^[-]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$")); -// -// String longitude = "0"; -// System.out.println(longitude.matches("\\s*[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$")); -// -// GeoportalDataEntryServiceImpl g = new GeoportalDataEntryServiceImpl(); -// g.getLinksFor("", ConstantsGeoPortalDataEntryApp.RECORD_TYPE.CONCESSIONE.toString()); - - // getListOfConcessioni(); - //@Before public void init() { ScopeProvider.instance.set(CONTEXT);