porting to liferay 6.2 almost complete
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/vre-members@126332 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3a90295ef1
commit
d1286a27e4
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/vre-members-1.0.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/vre-members-2.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
|
@ -31,5 +31,5 @@
|
|||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/vre-members-1.0.1-SNAPSHOT/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/vre-members-2.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
eclipse.preferences.version=1
|
||||
validateFragments=false
|
||||
validation.use-project-settings=true
|
|
@ -1,10 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="${module}">
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
<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="/src/main/resources"/>
|
||||
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
||||
<property name="context-root" value="vre-members"/>
|
||||
</wb-module>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="vre-members-portlet">
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources" />
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp"
|
||||
tag="defaultRootSource" />
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java" />
|
||||
|
||||
<dependent-module archiveName="gcube-widgets-2.0.0-SNAPSHOT.jar"
|
||||
deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes" />
|
||||
<property name="context-root" value="vre-members" />
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<installed facet="jst.web" version="2.3"/>
|
||||
<installed facet="jst.web" version="3.0"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
<installed facet="java" version="1.7"/>
|
||||
<installed facet="liferay.portlet" version="6.2"/>
|
||||
</faceted-project>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
{"ide":{"scriptPaths":[]},"plugins":{"aui":{},"liferay":{},"yui":{}},"libs":["ecma5","browser"]}
|
24
pom.xml
24
pom.xml
|
@ -13,7 +13,7 @@
|
|||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>vre-members</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<name>gCube VRE Members Portlet</name>
|
||||
<description>
|
||||
VRE Members display the members of the current VRE
|
||||
|
@ -25,12 +25,12 @@
|
|||
</scm>
|
||||
<properties>
|
||||
<!-- Convenience property to set the GWT version -->
|
||||
<gwtVersion>2.5.1</gwtVersion>
|
||||
<gwtVersion>2.7.0</gwtVersion>
|
||||
<distroDirectory>distro</distroDirectory>
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||
|
||||
<liferay.version>6.2.5</liferay.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
@ -49,21 +49,35 @@
|
|||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-user</artifactId>
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-servlet</artifactId>
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-dev</artifactId>
|
||||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.gwtbootstrap</groupId>
|
||||
<artifactId>gwt-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>gcube-widgets</artifactId>
|
||||
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>custom-portal-handler</artifactId>
|
||||
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -74,7 +88,7 @@
|
|||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||
<artifactId>aslcore</artifactId>
|
||||
|
@ -88,10 +102,12 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.dvos</groupId>
|
||||
<artifactId>usermanagement-core</artifactId>
|
||||
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.liferay.portal</groupId>
|
||||
<artifactId>portal-service</artifactId>
|
||||
<version>${liferay.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -7,71 +7,40 @@ import org.gcube.portlets.user.vremembers.client.MembersServiceAsync;
|
|||
import org.gcube.portlets.user.vremembers.client.ui.DisplayBadge;
|
||||
import org.gcube.portlets.user.vremembers.shared.BelongingUser;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Column;
|
||||
import com.github.gwtbootstrap.client.ui.Row;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.Grid;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.HasAlignment;
|
||||
import com.google.gwt.user.client.ui.HasVerticalAlignment;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
|
||||
public class VREMembersPanel extends Composite {
|
||||
/**
|
||||
* Create a remote service proxy to talk to the server-side Greeting service.
|
||||
*/
|
||||
public class VREMembersPanel extends FlowPanel {
|
||||
|
||||
private final MembersServiceAsync vreMemberService = GWT.create(MembersService.class);
|
||||
|
||||
public static final String loading = GWT.getModuleBaseURL() + "../images/members-loader.gif";
|
||||
|
||||
private Image loadingImage;
|
||||
|
||||
private VerticalPanel mainPanel = new VerticalPanel();
|
||||
public VREMembersPanel() {
|
||||
super();
|
||||
loadingImage = new Image(loading);
|
||||
mainPanel.add(loadingImage);
|
||||
showLoader();
|
||||
vreMemberService.getOrganizationUsers(new AsyncCallback<ArrayList<BelongingUser>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(ArrayList<BelongingUser> users) {
|
||||
mainPanel.clear();
|
||||
mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
|
||||
mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
|
||||
clear();
|
||||
if (users == null || users.isEmpty()) {
|
||||
mainPanel.add(new HTML("<div class=\"frame\" style=\"font-size: 16px;\">Ops, something went wrong. Please <a href=\"javascript: location.reload();\">reload<a/> this page.</div>"));
|
||||
add(new HTML("<div class=\"frame\" style=\"font-size: 16px;\">Ops, something went wrong. Please <a href=\"javascript: location.reload();\">reload<a/> this page.</div>"));
|
||||
} else {
|
||||
Grid grid = new Grid(users.size()/4+1, 4);
|
||||
mainPanel.add(grid);
|
||||
|
||||
for (int i = 0; i < users.size(); i++) {
|
||||
grid.setWidget(i/4, i%4, new DisplayBadge(users.get(i)));
|
||||
|
||||
add(new DisplayBadge(users.get(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
mainPanel.add(new HTML("<div class=\"nofeed-message\">" +
|
||||
add(new HTML("<div class=\"nofeed-message\">" +
|
||||
"Sorry, looks like something is broken with the server connection<br> " +
|
||||
"Please check your connection and try refresh this page.</div>"));
|
||||
|
||||
}
|
||||
});
|
||||
initWidget(mainPanel);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void showLoader() {
|
||||
mainPanel.clear();
|
||||
mainPanel.setWidth("100%");
|
||||
mainPanel.setHeight("300px");
|
||||
mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
|
||||
mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
|
||||
mainPanel.add(loadingImage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,12 +4,9 @@ import org.gcube.portlets.user.vremembers.shared.BelongingUser;
|
|||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.AnchorElement;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.Window.Location;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
|
|
|
@ -9,16 +9,15 @@ import org.gcube.application.framework.core.session.ASLSession;
|
|||
import org.gcube.application.framework.core.session.SessionManager;
|
||||
import org.gcube.common.scope.impl.ScopeBean;
|
||||
import org.gcube.common.scope.impl.ScopeBean.Type;
|
||||
import org.gcube.portal.custom.communitymanager.OrganizationsUtil;
|
||||
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
||||
import org.gcube.portal.databook.client.GCubeSocialNetworking;
|
||||
import org.gcube.portlets.user.vremembers.client.MembersService;
|
||||
import org.gcube.portlets.user.vremembers.shared.BelongingUser;
|
||||
import org.gcube.vomanagement.usermanagement.GroupManager;
|
||||
import org.gcube.vomanagement.usermanagement.UserManager;
|
||||
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayGroupManager;
|
||||
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager;
|
||||
import org.gcube.vomanagement.usermanagement.model.UserModel;
|
||||
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
|
||||
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
|
||||
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -86,10 +85,10 @@ public class MembersServiceImpl extends RemoteServiceServlet implements MembersS
|
|||
UserManager um = new LiferayUserManager();
|
||||
GroupManager gm = new LiferayGroupManager();
|
||||
ScopeBean sb = new ScopeBean(scope);
|
||||
List<UserModel> users = null;
|
||||
List<GCubeUser> users = null;
|
||||
|
||||
if (sb.is(Type.INFRASTRUCTURE)) {
|
||||
users = new ArrayList<UserModel>();
|
||||
users = new ArrayList<GCubeUser>();
|
||||
return new ArrayList<BelongingUser>();
|
||||
}
|
||||
else if (sb.is(Type.VRE)) { //must be in VRE
|
||||
|
@ -102,12 +101,15 @@ public class MembersServiceImpl extends RemoteServiceServlet implements MembersS
|
|||
_log.error("Error, you must be in SCOPE VRE OR INFRASTURCTURE, you are in VO SCOPE returning no users");
|
||||
return portalUsers;
|
||||
}
|
||||
for (UserModel user : users) {
|
||||
if (user.getScreenName().compareTo("test.user") != 0) { //skip test.user
|
||||
String thumbnailURL = "";
|
||||
com.liferay.portal.model.User lifeUser = UserLocalServiceUtil.getUserByScreenName(OrganizationsUtil.getCompany().getCompanyId(), user.getScreenName());
|
||||
thumbnailURL = lifeUser.isMale() ? "/image/user_male_portrait?img_id="+lifeUser.getPortraitId() : "/image/user_female_portrait?img_id="+lifeUser.getPortraitId();
|
||||
portalUsers.add(new BelongingUser(user.getScreenName(), user.getFullname(), thumbnailURL, lifeUser.getJobTitle(), lifeUser.getOpenId(), getUserProfileLink(user.getScreenName() ),lifeUser.getPortraitId() != 0));
|
||||
for (GCubeUser user : users) {
|
||||
if (user.getUsername().compareTo("test.user") != 0) { //skip test.user
|
||||
portalUsers.add(
|
||||
new BelongingUser(
|
||||
user.getUsername(),
|
||||
user.getFullname(),
|
||||
user.getUserAvatarURL(),
|
||||
user.getJobTitle(),
|
||||
user.getLocation_industry(), getUserProfileLink(user.getUsername() ), true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<inherits name='com.google.gwt.user.User' />
|
||||
|
||||
<!-- <set-property name="user.agent" value="gecko1_8,safari" /> -->
|
||||
|
||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||
<inherits name='org.gcube.portal.databook.GCubeSocialNetworking' />
|
||||
<!-- Other module inherits -->
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
.framed {
|
||||
display: inline-block;
|
||||
font-family: 'Helvetica Neue', Arial, sans-serif;
|
||||
width: 200px;
|
||||
height: 290px;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
background: #FFF;
|
||||
border-radius: 6px !important;
|
||||
-moz-border-radius: 6px !important;
|
||||
-webkit-border-radius: 6px !important;
|
||||
border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border: 1px solid #DBDBDB;
|
||||
}
|
||||
|
||||
|
@ -16,13 +17,13 @@
|
|||
padding: 10px;
|
||||
margin: 10px;
|
||||
background: #FFF;
|
||||
border-radius: 6px !important;
|
||||
-moz-border-radius: 6px !important;
|
||||
-webkit-border-radius: 6px !important;
|
||||
border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border: 1px solid #DBDBDB;
|
||||
}
|
||||
|
||||
.user-photo {
|
||||
img.user-photo {
|
||||
padding: 5px;
|
||||
border: 1px solid #E6E6E6;
|
||||
width: 180px;
|
||||
|
@ -31,6 +32,7 @@
|
|||
|
||||
.user-details {
|
||||
padding: 5px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.photo-details {
|
||||
|
@ -38,29 +40,27 @@
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
a.person-link {
|
||||
color: #444444;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
font-size: 15px !important;
|
||||
font-weight: bold !important;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
a.person-link,a.person-link:visited {
|
||||
a.person-link, a.person-link:visited {
|
||||
cursor: pointer;
|
||||
cursor: hand;
|
||||
font-size: 16x;
|
||||
font-size: 16px !important;
|
||||
text-decoration: none;
|
||||
color: #3B5998;
|
||||
color: #3B5998 !important;
|
||||
}
|
||||
|
||||
a.person-link:hover {
|
||||
opacity: 0.8;
|
||||
font-size: 16x;
|
||||
font-size: 16x !important;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
.headline {
|
||||
font-size: 13px;
|
||||
color: #444444;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.0.0//EN" "http://www.liferay.com/dtd/liferay-display_6_0_0.dtd">
|
||||
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.2.0//EN" "http://www.liferay.com/dtd/liferay-display_6_2_0.dtd">
|
||||
|
||||
<display>
|
||||
<category name="gCube Social Apps">
|
||||
|
|
|
@ -4,6 +4,6 @@ module-incremental-version=1
|
|||
tags=
|
||||
short-description=
|
||||
change-log=
|
||||
page-url=http://www.d4science.org
|
||||
author=D4Science.org
|
||||
page-url=http://www.gcube-system.org
|
||||
author=Massimiliano Assante
|
||||
licenses=EUPL
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 5.2.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_0_0.dtd">
|
||||
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.2.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_2_0.dtd">
|
||||
|
||||
<liferay-portlet-app>
|
||||
<portlet>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE web-app
|
||||
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||
"http://java.sun.com/dtd/web-app_2_3.dtd">
|
||||
|
||||
<web-app>
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
||||
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||
version="3.0">
|
||||
|
||||
<!-- Servlets -->
|
||||
<servlet>
|
||||
|
|
Loading…
Reference in New Issue