diff --git a/README.md b/README.md index 31c818b..e8d5df8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# gCube System - VRE Apps Integration Portlet +# gCube System - Register VRE Users Portlet -This component is a Liferay 6.2.6 CE Porlet which iinteracts with the VRE Modeler service during new VRE Creations +This component is a Liferay 6.2.6 CE Porlet which allow to select a user from the portal and the user to the VRE. ## Structure of the project * The source code is present in the src folder. diff --git a/pom.xml b/pom.xml index 4f72415..4e7291f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 @@ -73,6 +74,10 @@ custom-portal-handler provided + + org.gcube.common + storagehub-client-library + org.gcube.portal notifications-common-library @@ -83,16 +88,6 @@ aslsocial provided - - org.gcube.common - home-library-jcr - provided - - - org.gcube.common - home-library - provided - org.gcube.portal social-networking-library @@ -195,7 +190,7 @@ org.apache.maven.plugins maven-war-plugin - + compile @@ -211,7 +206,7 @@ org.apache.maven.plugins maven-compiler-plugin - ${maven.compiler.source} + ${maven.compiler.source} ${maven.compiler.target} diff --git a/src/main/java/org/gcube/portlets/admin/manageusers/server/ManageUsersServiceImpl.java b/src/main/java/org/gcube/portlets/admin/manageusers/server/ManageUsersServiceImpl.java index 596ce73..3d53a0e 100644 --- a/src/main/java/org/gcube/portlets/admin/manageusers/server/ManageUsersServiceImpl.java +++ b/src/main/java/org/gcube/portlets/admin/manageusers/server/ManageUsersServiceImpl.java @@ -10,11 +10,11 @@ import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager; import org.gcube.applicationsupportlayer.social.NotificationsManager; import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingSite; import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser; -import org.gcube.common.homelibrary.home.HomeLibrary; -import org.gcube.common.homelibrary.home.workspace.Workspace; import org.gcube.common.portal.PortalContext; import org.gcube.common.scope.impl.ScopeBean; import org.gcube.common.scope.impl.ScopeBean.Type; +import org.gcube.common.storagehub.client.plugins.AbstractPlugin; +import org.gcube.common.storagehub.client.proxies.MessageManagerClient; import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper; import org.gcube.portal.notifications.bean.GenericItemBean; import org.gcube.portal.notifications.thread.MessageNotificationsThread; @@ -220,8 +220,8 @@ public class ManageUsersServiceImpl extends RemoteServiceServlet implements Mana PortalContext pContext = PortalContext.getConfiguration(); String scope = pContext.getCurrentScope(getThreadLocalRequest()); GCubeUser currentUser = pContext.getCurrentUser(getThreadLocalRequest()); - Workspace workspace = HomeLibrary.getUserWorkspace(currentUser.getUsername()); - + + MessageManagerClient client = AbstractPlugin.messages().build(); List recipientIds = new ArrayList(); recipientIds.add(addressee.getId()); @@ -236,7 +236,8 @@ public class ManageUsersServiceImpl extends RemoteServiceServlet implements Mana String subject = "Registration to VRE notification"; String body = "Dear "+addressee.getName()+", \n\n I just registered you to the VRE " + pContext.getCurrentGroupName(getThreadLocalRequest())+" on the " + gatewayName + ". \n\n"; body += "Please, click here to access the VRE: " + vreURL; - String messageId = workspace.getWorkspaceMessageManager().sendMessageToPortalLogins(subject, body, new ArrayList(), recipientIds); + String messageId = client.sendMessage(recipientIds, subject, body, new ArrayList()); + _log.debug("Sending message notification to: " + recipientIds.toString()); NotificationsManager nm = new ApplicationNotificationsManager(new SocialNetworkingSite(getThreadLocalRequest()), scope, new SocialNetworkingUser(