diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java index 8a6785e..a233f75 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java @@ -53,13 +53,14 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C public static final String TEST_SCOPE = "/gcube/devsec/devVRE"; public static final String TEST_USER = "test.user"; - - public static final String CKAN_TOKEN_KEY = "ckanToken"; - public static final String CKAN_LICENSES_KEY = "ckanLicenses"; - private static final String CKAN_ORGANIZATIONS_KEY = "ckanOrganizations"; - private static final String CKAN_PROFILES_KEY = "ckanProfiles"; private final static String TEST_SEC_TOKEN = "4620e6d0-2313-4f48-9d54-eb3efd01a810"; + // ckan keys for ASL + private static final String CKAN_TOKEN_KEY = "ckanToken"; + private static final String CKAN_LICENSES_KEY = "ckanLicenses"; // licenses + private static final String CKAN_ORGANIZATIONS_PUBLISH_KEY = "ckanOrganizationsPublish"; // here he can publish + private static final String CKAN_PROFILES_KEY = "ckanProfiles"; // product profiles + private Object LOCK = new Object(); // library util instance @@ -170,9 +171,9 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C CKanUtilsImpl ckanUtils = getCkanUtilsObj(); - if(session.getAttribute(CKAN_ORGANIZATIONS_KEY) != null){ - orgsName = (List)session.getAttribute(CKAN_ORGANIZATIONS_KEY); - logger.debug("List of organizations was into session"); + if(session.getAttribute(CKAN_ORGANIZATIONS_PUBLISH_KEY) != null){ + orgsName = (List)session.getAttribute(CKAN_ORGANIZATIONS_PUBLISH_KEY); + logger.info("List of organizations was into session"); } else{ if(getCkanUtilsObj().isSysAdmin(username, getUserCKanTokenFromSession())){ @@ -199,8 +200,8 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C logger.debug("The user has a role ADMIN/EDITOR into org " + entry.getKey()); } } - session.setAttribute(CKAN_ORGANIZATIONS_KEY, orgsName); - logger.debug("Organizations name for user " + username + " has been saved into session"); + session.setAttribute(CKAN_ORGANIZATIONS_PUBLISH_KEY, orgsName); + logger.info("Organizations name for user " + username + " has been saved into session"); } return orgsName; @@ -244,7 +245,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C if(session.getAttribute(CKAN_PROFILES_KEY) != null){ beans = (List)session.getAttribute(CKAN_PROFILES_KEY); - logger.debug("List of profiles was into session"); + logger.info("List of profiles was into session"); } else{ @@ -289,7 +290,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C beans.add(bean); } - logger.debug("List of beans is " + beans); + logger.info("List of beans is " + beans); session.setAttribute(CKAN_PROFILES_KEY, beans); logger.debug("List of profiles has been saved into session");