adapted to the new HomeLibrary
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@82356 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
98e9767f4b
commit
69724b6b81
|
@ -5,6 +5,9 @@
|
|||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
||||
<dependent-module archiveName="pickuser-widget-0.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickuser-widget/pickuser-widget">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
||||
<property name="context-root" value="share-updates"/>
|
||||
</wb-module>
|
||||
|
|
26
pom.xml
26
pom.xml
|
@ -74,13 +74,13 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||
<artifactId>aslsocial</artifactId>
|
||||
<scope>provided</scope>
|
||||
<artifactId>aslcore</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.core</groupId>
|
||||
<artifactId>gcf</artifactId>
|
||||
<scope>provided</scope>
|
||||
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||
<artifactId>aslsocial</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
|
@ -92,21 +92,17 @@
|
|||
<artifactId>pickuser-widget</artifactId>
|
||||
<version>[0.2.0-SNAPSHOT, 1.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>home-library</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>custom-portal-handler</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||
<artifactId>aslcore</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>home-library</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.dvos</groupId>
|
||||
<artifactId>usermanagement-core</artifactId>
|
||||
|
|
|
@ -3,8 +3,9 @@ package org.gcube.portlets.user.shareupdates.server;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.applicationsupportlayer.social.NotificationsManager;
|
||||
import org.gcube.common.core.utils.logging.GCUBEClientLog;
|
||||
import org.gcube.portlets.user.pickuser.shared.PickingUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -12,7 +13,7 @@ import org.gcube.portlets.user.pickuser.shared.PickingUser;
|
|||
*
|
||||
*/
|
||||
public class MentionNotificationsThread implements Runnable {
|
||||
private static GCUBEClientLog _log = new GCUBEClientLog(MentionNotificationsThread.class);
|
||||
private static Logger _log = LoggerFactory.getLogger(MentionNotificationsThread.class);
|
||||
|
||||
private String postText;
|
||||
private String postId;
|
||||
|
|
|
@ -22,6 +22,11 @@ import org.gcube.application.framework.core.session.ASLSession;
|
|||
import org.gcube.application.framework.core.session.SessionManager;
|
||||
import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager;
|
||||
import org.gcube.applicationsupportlayer.social.NotificationsManager;
|
||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
||||
import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException;
|
||||
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
||||
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
||||
import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException;
|
||||
import org.gcube.common.scope.impl.ScopeBean;
|
||||
import org.gcube.common.scope.impl.ScopeBean.Type;
|
||||
import org.gcube.portal.custom.communitymanager.OrganizationsUtil;
|
||||
|
@ -35,12 +40,6 @@ import org.gcube.portal.databook.shared.FeedType;
|
|||
import org.gcube.portal.databook.shared.PrivacyLevel;
|
||||
import org.gcube.portal.databook.shared.UserInfo;
|
||||
import org.gcube.portal.databook.shared.ex.FeedIDNotFoundException;
|
||||
import org.gcube.portlets.user.homelibrary.home.HomeLibrary;
|
||||
import org.gcube.portlets.user.homelibrary.home.User;
|
||||
import org.gcube.portlets.user.homelibrary.home.exceptions.HomeNotFoundException;
|
||||
import org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException;
|
||||
import org.gcube.portlets.user.homelibrary.home.workspace.Workspace;
|
||||
import org.gcube.portlets.user.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException;
|
||||
import org.gcube.portlets.user.pickuser.shared.PickingUser;
|
||||
import org.gcube.portlets.user.shareupdates.client.ShareUpdateService;
|
||||
import org.gcube.portlets.user.shareupdates.server.metaseeker.MetaSeeker;
|
||||
|
@ -49,7 +48,6 @@ import org.gcube.portlets.user.shareupdates.shared.LinkPreview;
|
|||
import org.gcube.portlets.user.shareupdates.shared.UserSettings;
|
||||
import org.gcube.vomanagement.usermanagement.GroupManager;
|
||||
import org.gcube.vomanagement.usermanagement.UserManager;
|
||||
import org.gcube.vomanagement.usermanagement.exception.UserManagementPortalException;
|
||||
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayGroupManager;
|
||||
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager;
|
||||
import org.gcube.vomanagement.usermanagement.model.GroupModel;
|
||||
|
@ -115,8 +113,8 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
|
|||
if (user == null) {
|
||||
_log.warn("USER IS NULL setting test.user and Running OUTSIDE PORTAL");
|
||||
user = "test.user";
|
||||
// user = "massimiliano.assante";
|
||||
// SessionManager.getInstance().getASLSession(sessionID, user).setScope("/gcube/devsec/devVRE");
|
||||
// user = "massimiliano.assante";
|
||||
// SessionManager.getInstance().getASLSession(sessionID, user).setScope("/gcube/devsec/devVRE");
|
||||
withinPortal = false;
|
||||
}
|
||||
else {
|
||||
|
@ -670,25 +668,14 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
|
|||
try {
|
||||
if (withinPortal) {
|
||||
UserManager um = new LiferayUserManager();
|
||||
Workspace workspace = getWorkspace();
|
||||
List<User> users = workspace.getHome().getHomeManager().getUsers();
|
||||
for (User user : users) {
|
||||
//_log.trace("Trying to get additional info for "+user.getPortalLogin());
|
||||
if (user.getPortalLogin().compareTo("test.user") != 0) { //skip test.user
|
||||
UserModel curr = null;
|
||||
GroupManager gm = new LiferayGroupManager();
|
||||
List<UserModel> users = um.listUsersByGroup(gm.getRootVO().getGroupId());
|
||||
for (UserModel user : users) {
|
||||
if (user.getScreenName().compareTo("test.user") != 0) { //skip test.user
|
||||
String thumbnailURL = "";
|
||||
try {
|
||||
curr = um.getUserByScreenName(user.getPortalLogin());
|
||||
com.liferay.portal.model.UserModel lifeUser = UserLocalServiceUtil.getUserByScreenName(OrganizationsUtil.getCompany().getCompanyId(), user.getPortalLogin());
|
||||
thumbnailURL = "/image/user_male_portrait?img_id="+lifeUser.getPortraitId();
|
||||
} catch (UserManagementPortalException ume) {
|
||||
_log.error("Error while getUserByScreenName for " + user.getPortalLogin());
|
||||
portalUsers.add(new PickingUser(user.getId(), user.getPortalLogin(), user.getPortalLogin(), "unknown image"));
|
||||
}
|
||||
if (curr != null)
|
||||
portalUsers.add(new PickingUser(user.getId(), curr.getScreenName(), curr.getFullname(), thumbnailURL));
|
||||
|
||||
|
||||
com.liferay.portal.model.UserModel lifeUser = UserLocalServiceUtil.getUserByScreenName(OrganizationsUtil.getCompany().getCompanyId(), user.getScreenName());
|
||||
thumbnailURL = "/image/user_male_portrait?img_id="+lifeUser.getPortraitId();
|
||||
portalUsers.add(new PickingUser(user.getUserId(), user.getScreenName(), user.getFullname(), thumbnailURL));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -718,7 +705,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
|
|||
*/
|
||||
private Workspace getWorkspace() throws InternalErrorException, HomeNotFoundException, WorkspaceFolderNotFoundException {
|
||||
final ASLSession session = getASLSession();
|
||||
Workspace workspace = HomeLibrary.getUserWorkspace(session);
|
||||
Workspace workspace = HomeLibrary.getUserWorkspace(session.getUsername());
|
||||
return workspace;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue