diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 0b07bb5..38f9b3b 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -4,6 +4,12 @@ + + uses + + + uses + diff --git a/pom.xml b/pom.xml index e49e49b..d2db365 100644 --- a/pom.xml +++ b/pom.xml @@ -72,10 +72,13 @@ org.gcube.portal custom-portal-handler - [2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT) provided - + + org.gcube.portlets.widgets + session-checker + [1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT) + commons-io commons-io @@ -114,12 +117,12 @@ gwt-jsonmaker provided - - - - - - + + org.gcube.portlets.widgets + wsmail-widget + [2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT) + compile + org.apache.httpcomponents httpclient diff --git a/src/main/java/org/gcube/portlets/user/socialprofile/client/ui/DisplayProfile.java b/src/main/java/org/gcube/portlets/user/socialprofile/client/ui/DisplayProfile.java index f03b381..f55fd1c 100644 --- a/src/main/java/org/gcube/portlets/user/socialprofile/client/ui/DisplayProfile.java +++ b/src/main/java/org/gcube/portlets/user/socialprofile/client/ui/DisplayProfile.java @@ -8,6 +8,7 @@ import org.gcube.portlets.user.socialprofile.client.SocialProfile; import org.gcube.portlets.user.socialprofile.client.SocialService; import org.gcube.portlets.user.socialprofile.client.SocialServiceAsync; import org.gcube.portlets.user.socialprofile.shared.UserContext; +import org.gcube.portlets.widgets.wsmail.client.forms.MailForm; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.RunAsyncCallback; @@ -287,8 +288,7 @@ public class DisplayProfile extends Composite { GWT.runAsync(new RunAsyncCallback() { @Override public void onSuccess() { - //TODO: -// new MailForm(listToLogin); + new MailForm(listToLogin); } public void onFailure(Throwable reason) { Window.alert("Could not load this component: " + reason.getMessage()); diff --git a/src/main/java/org/gcube/portlets/user/socialprofile/server/SocialServiceImpl.java b/src/main/java/org/gcube/portlets/user/socialprofile/server/SocialServiceImpl.java index 543286e..cde0e6b 100644 --- a/src/main/java/org/gcube/portlets/user/socialprofile/server/SocialServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/socialprofile/server/SocialServiceImpl.java @@ -43,6 +43,7 @@ import org.gcube.resources.discovery.client.api.DiscoveryClient; import org.gcube.resources.discovery.client.queries.api.SimpleQuery; import org.gcube.vomanagement.usermanagement.UserManager; import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager; +import org.gcube.vomanagement.usermanagement.model.CustomAttributeKeys; import org.gcube.vomanagement.usermanagement.model.GCubeUser; import org.json.simple.parser.ContainerFactory; import org.json.simple.parser.JSONParser; @@ -234,10 +235,9 @@ public class SocialServiceImpl extends RemoteServiceServlet implements SocialSer @Override public Boolean saveHeadline(String newHeadline) { - com.liferay.portal.model.User user; try { - //TODO: - return false; + UserManager um = new LiferayUserManager(); + return um.updateJobTitle(um.getUserId(getASLSession().getUsername()), newHeadline); } catch (Exception e) { e.printStackTrace(); return false; @@ -246,10 +246,11 @@ public class SocialServiceImpl extends RemoteServiceServlet implements SocialSer } @Override public Boolean saveIsti(String institution) { - com.liferay.portal.model.User user; + //try save the location/industry try { - //TODO: - return false; + UserManager um = new LiferayUserManager(); + um.saveCustomAttr(um.getUserId(getASLSession().getUsername()), CustomAttributeKeys.USER_LOCATION_INDUSTRY.getKeyName(), institution); + return true; } catch (Exception e) { e.printStackTrace(); return false; @@ -444,10 +445,12 @@ public class SocialServiceImpl extends RemoteServiceServlet implements SocialSer user.setJobTitle(escapeHtml(checkedHeadline)); } //location and industry - if (location.compareTo("") != 0 && industry.compareTo("") != 0) - user.setOpenId(escapeHtml(location + " | " + industry)); + String locationOrIndustry = ""; + if (location.compareTo("") != 0 && industry.compareTo("") != 0) { + locationOrIndustry = escapeHtml(location + " | " + industry); + } else if (location.compareTo("") != 0 || industry.compareTo("") != 0) - user.setOpenId(escapeHtml(location + industry)); + locationOrIndustry = escapeHtml(location + industry); //summary if (summary.compareTo("") != 0) user.setComments(escapeHtml(summary)); @@ -468,6 +471,9 @@ public class SocialServiceImpl extends RemoteServiceServlet implements SocialSer UserLocalServiceUtil.updatePortrait(user.getUserId(), pictureData); } } + + //update the location/industry + new LiferayUserManager().saveCustomAttr(user.getUserId(), CustomAttributeKeys.USER_LOCATION_INDUSTRY.getKeyName(), locationOrIndustry); if (toReturn) return publicProfileURL; else return null; diff --git a/src/main/resources/org/gcube/portlets/user/socialprofile/SocialProfile.gwt.xml b/src/main/resources/org/gcube/portlets/user/socialprofile/SocialProfile.gwt.xml index 24200a4..868845d 100644 --- a/src/main/resources/org/gcube/portlets/user/socialprofile/SocialProfile.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/socialprofile/SocialProfile.gwt.xml @@ -7,7 +7,8 @@ - + + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 627b4ad..5e99f90 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -15,23 +15,37 @@ /socialprofile/socialService - - - - + + mailWisdgetServlet + org.gcube.portlets.widgets.wsmail.server.WsMailServiceImpl + + + + mailWisdgetServlet + /socialprofile/mailWisdgetServlet + + + + workspaceExplorer + org.gcube.portlets.widgets.wsexplorer.server.WorkspaceExplorerServiceImpl + + + + workspaceExplorer + /socialprofile/WorkspaceExplorerService + + + + checkServlet + org.gcube.portlets.widgets.sessionchecker.server.SessionCheckerServiceImpl + + + + checkServlet + /socialprofile/checksession + + - - - - - - - - - - - - SocialProfile.html