UPDATED distro folder

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/admin/register-vre-users@125133 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2016-03-14 17:30:09 +00:00
parent 5f0634e2da
commit b9c338756e
11 changed files with 87 additions and 66 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/register-vre-users-1.4.2-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/register-vre-users-2.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
@ -31,5 +31,5 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/register-vre-users-1.4.2-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/register-vre-users-2.0.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -5,7 +5,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <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"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="invites-common-library-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/invites-common-library/invites-common-library"> <dependent-module archiveName="invites-common-library-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/invites-common-library/invites-common-library">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<faceted-project> <faceted-project>
<fixed facet="wst.jsdt.web"/> <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="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.7"/> <installed facet="java" version="1.7"/>
<installed facet="liferay.portlet" version="6.0"/> <installed facet="liferay.portlet" version="6.2"/>
</faceted-project> </faceted-project>

View File

@ -1,2 +0,0 @@

View File

@ -1,7 +1 @@
gCube System - License ${gcube.license}
------------------------------------------------------------
The gCube/gCore software is licensed as Free Open Source software conveying to the EUPL (http://ec.europa.eu/idabc/eupl).
The software and documentation is provided by its authors/distributors "as is" and no expressed or
implied warranty is given for its use, quality or fitness for a particular case.

View File

@ -1,6 +0,0 @@
Mantainers
-------
* Massimiliano Assante (massimiliano.assante@isti.cnr.it), CNR Pisa,
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo".

View File

@ -1,35 +1,45 @@
The gCube System - Social Library The gCube System
------------------------------------------------------------ ------------------------------------------------------------
This work is partially funded by the European Commission in the ${gcube.description}
context of the iMarine project (www.i-marine.eu), under the 1st call of FP7 IST priority.
${gcube.funding}
Version
--------------------------------------------------
${version} (${buildDate})
Please see the file named "changelog.xml" in this directory for the release notes.
Authors Authors
------- -------
Massimiliano Assante
*
Version and Release Date Massimiliano Assante (massimiliano.assante-AT-isti.cnr.it), Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy).
------------------------
Jan 2013
Description Maintainers
----------- -----------
Social networking Library
Massimiliano Assante (massimiliano.assante-AT-isti.cnr.it), Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" - CNR, Pisa (Italy).
Download information
--------------------
Source code is available from SVN: Documentation
https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/notifications
Binaries can be downloaded from:
http://software.d4science.research-infrastructures.eu/
Documentation
------------- -------------
Documentation is available on-line from the Projects Documentation Wiki:
Documentation is available on - line from the Projects Documentation wiki:
{gcube.wikiRoot}/gcube/index.php/UserManagement_Core
Support
--------------------------------------------------
Bugs and support requests can be reported in the gCube issue tracking tool:
${gcube.issueTracking}
Licensing Licensing
--------- --------------------------------------------------
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.

View File

@ -1 +0,0 @@
${scm.url}

33
pom.xml
View File

@ -12,7 +12,7 @@
<groupId>org.gcube.portlets.admin</groupId> <groupId>org.gcube.portlets.admin</groupId>
<artifactId>register-vre-users</artifactId> <artifactId>register-vre-users</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>1.4.2-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
<name>Register VRE Users</name> <name>Register VRE Users</name>
<description> <description>
Rigister VRE Users Portlet allow to select a user from the portal and add her to the VRE. Rigister VRE Users Portlet allow to select a user from the portal and add her to the VRE.
@ -29,7 +29,7 @@
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory> <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<liferay.version>6.2.5</liferay.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties> </properties>
@ -57,6 +57,12 @@
<version>${gwtVersion}</version> <version>${gwtVersion}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<scope>provided</scope>
<version>${gwtVersion}</version>
</dependency>
<dependency> <dependency>
<groupId>org.gcube.applicationsupportlayer</groupId> <groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId> <artifactId>aslcore</artifactId>
@ -70,6 +76,7 @@
<dependency> <dependency>
<groupId>org.gcube.portal</groupId> <groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId> <artifactId>custom-portal-handler</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -132,10 +139,30 @@
<groupId>org.gcube.dvos</groupId> <groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId> <artifactId>usermanagement-core</artifactId>
<scope>provided</scope> <scope>provided</scope>
<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>
<dependency> <dependency>
<groupId>com.liferay.portal</groupId> <groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId> <artifactId>util-bridges</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-taglib</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-java</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -11,7 +11,7 @@ import org.gcube.common.homelibrary.home.HomeLibrary;
import org.gcube.common.homelibrary.home.workspace.Workspace; import org.gcube.common.homelibrary.home.workspace.Workspace;
import org.gcube.common.scope.impl.ScopeBean; import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.common.scope.impl.ScopeBean.Type; import org.gcube.common.scope.impl.ScopeBean.Type;
import org.gcube.portal.custom.communitymanager.OrganizationsUtil; import org.gcube.portal.custom.communitymanager.SiteManagerUtil;
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper; import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
import org.gcube.portal.notifications.bean.GenericItemBean; import org.gcube.portal.notifications.bean.GenericItemBean;
import org.gcube.portal.notifications.thread.MessageNotificationsThread; import org.gcube.portal.notifications.thread.MessageNotificationsThread;
@ -21,9 +21,9 @@ import org.gcube.vomanagement.usermanagement.GroupManager;
import org.gcube.vomanagement.usermanagement.UserManager; import org.gcube.vomanagement.usermanagement.UserManager;
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault; import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException; import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayGroupManager; import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
import org.gcube.vomanagement.usermanagement.impl.liferay.LiferayUserManager; import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
import org.gcube.vomanagement.usermanagement.model.UserModel; import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -103,23 +103,23 @@ public class ManageUsersServiceImpl extends RemoteServiceServlet implements Man
public ArrayList<PortalUserDTO> getNonBelongingUsersForVRE() { public ArrayList<PortalUserDTO> getNonBelongingUsersForVRE() {
try { try {
long companyId = OrganizationsUtil.getCompany().getCompanyId(); long companyId = SiteManagerUtil.getCompany().getCompanyId();
_log.trace("Setting Thread Permission"); _log.trace("Setting Thread Permission");
User user = UserLocalServiceUtil.getUserByScreenName(companyId, ScopeHelper.getAdministratorUsername()); User user = UserLocalServiceUtil.getUserByScreenName(companyId, ScopeHelper.getAdministratorUsername());
PermissionChecker permissionChecker = PermissionCheckerFactoryUtil.create(user, false); PermissionChecker permissionChecker = PermissionCheckerFactoryUtil.create(user);
PermissionThreadLocal.setPermissionChecker(permissionChecker); PermissionThreadLocal.setPermissionChecker(permissionChecker);
_log.trace("Setting Permission ok!"); _log.trace("Setting Permission ok!");
ArrayList<PortalUserDTO> unregisteredUsers = new ArrayList<PortalUserDTO>(); ArrayList<PortalUserDTO> unregisteredUsers = new ArrayList<PortalUserDTO>();
List<UserModel> notBelongingUsers = userM.listUnregisteredUsersByGroup(getCurrentGroupID()); List<GCubeUser> notBelongingUsers = userM.listUnregisteredUsersByGroup(getCurrentGroupID());
for (UserModel u : notBelongingUsers) { for (GCubeUser u : notBelongingUsers) {
String id = u.getScreenName(); String id = u.getScreenName();
user = UserLocalServiceUtil.getUserByScreenName(companyId, id); user = UserLocalServiceUtil.getUserByScreenName(companyId, id);
String position = (user.getExpandoBridge().getAttribute(POSITION) != null) ? user.getExpandoBridge().getAttribute(POSITION).toString() : ""; String position = (user.getExpandoBridge().getAttribute(POSITION) != null) ? user.getExpandoBridge().getAttribute(POSITION).toString() : "";
String labs = (user.getExpandoBridge().getAttribute(LABS) != null) ? user.getExpandoBridge().getAttribute(LABS).toString() : ""; String labs = (user.getExpandoBridge().getAttribute(LABS) != null) ? user.getExpandoBridge().getAttribute(LABS).toString() : "";
if ((u.getLastname() != null && u.getLastname().compareTo("") != 0)) { if ((u.getLastName() != null && u.getLastName().compareTo("") != 0)) {
String firstLetter = u.getLastname().substring(0,1); String firstLetter = u.getLastName().substring(0,1);
String scope = getASLSession().getScope(); String scope = getASLSession().getScope();
ScopeBean validator = new ScopeBean(scope); ScopeBean validator = new ScopeBean(scope);
String email = u.getEmail(); String email = u.getEmail();
@ -127,7 +127,7 @@ public class ManageUsersServiceImpl extends RemoteServiceServlet implements Man
if (validator.is(Type.VRE)) { if (validator.is(Type.VRE)) {
email = "********@"+ email.split("@")[1]; email = "********@"+ email.split("@")[1];
} }
PortalUserDTO myUser = new PortalUserDTO(username, firstLetter, u.getFirstname(), u.getLastname(), email, position, labs); PortalUserDTO myUser = new PortalUserDTO(username, firstLetter, u.getFirstName(), u.getLastName(), email, position, labs);
unregisteredUsers.add(myUser); unregisteredUsers.add(myUser);
} }
} }
@ -203,10 +203,10 @@ public class ManageUsersServiceImpl extends RemoteServiceServlet implements Man
* @return the current group ID or null if an exception is thrown * @return the current group ID or null if an exception is thrown
* @throws Exception * @throws Exception
*/ */
private String getCurrentGroupID() { private long getCurrentGroupID() {
ASLSession session = getASLSession(); ASLSession session = getASLSession();
_log.debug("The current group NAME is --> " + session.getGroupName()); _log.debug("The current group NAME is --> " + session.getGroupName());
String toReturn = null; long toReturn = -1;
try { try {
toReturn = groupM.getGroupId(session.getGroupName()); toReturn = groupM.getGroupId(session.getGroupName());
} catch (UserManagementSystemException | GroupRetrievalFault e) { } catch (UserManagementSystemException | GroupRetrievalFault e) {

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
"http://java.sun.com/dtd/web-app_2_3.dtd"> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<web-app>
<!-- Servlets --> <!-- Servlets -->
<servlet> <servlet>
<servlet-name>manageUsersServlet</servlet-name> <servlet-name>manageUsersServlet</servlet-name>