diff --git a/.classpath b/.classpath
index 6bb377e..966f0c1 100644
--- a/.classpath
+++ b/.classpath
@@ -27,7 +27,7 @@
-
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..303d1f0
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,50 @@
+
+# Changelog for workspace
+
+All notable changes to this project will be documented in this file.
+This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v2.5.1] [r4.25.0] - 2020-07-10
+
+[#19603]Enhance performance of VRE membership requests retrieval by adding dedicated method for retrieving pending requests by groupid
+
+## [v2.5.0] - 2020-03-21
+
+Added getRandomAdmin user method and(improved performance for method for getting listUsersByGroupAndRole
+
+## [v2.4.2] - 2019-02-28
+
+[#16190] Avoid returning Liferay Site Roles in UserManagement Core Library
+
+## [v2.4.0] - 2018-03-08
+
+Create user method automatic set email as verified
+
+Added list users methods by range
+
+Added search users method by groupId and Keywords
+
+## [v2.3.1] - 2017-07-01
+
+Improvements on Liferay's JSON APIs.
+
+## [v2.3.0] - 2017-02-01
+
+Added partial support to Liferay's JSON apis.
+
+## [v2.2.0] - 2016-012-06
+
+Added method to read VirtualGroups associated to sites
+
+[#6115] Fix for bug
+
+## [v2.1.0] - 2016-09-28
+
+Added efficient method to retireve VRE logo URLs
+
+Replaced logging from liferay so that it is possible to change level at runtime
+
+## [v2.0.0] - 2016-06-23
+
+First release after upgrading to Liferay 6.2
+
diff --git a/pom.xml b/pom.xml
index a05a10c..d31f7bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
org.gcube.dvos
usermanagement-core
- 2.5.0
+ 2.5.1-SNAPSHOT
jar
User Management API
diff --git a/src/main/java/org/gcube/vomanagement/usermanagement/UserManager.java b/src/main/java/org/gcube/vomanagement/usermanagement/UserManager.java
index c9723e1..982d389 100644
--- a/src/main/java/org/gcube/vomanagement/usermanagement/UserManager.java
+++ b/src/main/java/org/gcube/vomanagement/usermanagement/UserManager.java
@@ -297,6 +297,15 @@ public interface UserManager {
* @throws UserRetrievalFault
*/
List listMembershipRequestsByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
+ /**
+ *
+ * @param groupId the LR groupId
+ * @return the list of {@link GCubeMembershipRequest} with status requested and users given the LR GroupId @see {@link MembershipRequestStatus}
+ * @throws UserManagementSystemException
+ * @throws GroupRetrievalFault
+ * @throws UserRetrievalFault
+ */
+ List listPendingMembershipRequestsByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
/**
*
* @param requestId
diff --git a/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayUserManager.java b/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayUserManager.java
index 9ced8f5..a85bfa7 100644
--- a/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayUserManager.java
+++ b/src/main/java/org/gcube/vomanagement/usermanagement/impl/LiferayUserManager.java
@@ -29,6 +29,9 @@ import org.gcube.vomanagement.usermanagement.model.GatewayRolesNames;
import org.gcube.vomanagement.usermanagement.model.MembershipRequestStatus;
import org.gcube.vomanagement.usermanagement.util.ManagementUtils;
+import com.liferay.portal.kernel.dao.orm.DynamicQuery;
+import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
+import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
@@ -38,6 +41,7 @@ import com.liferay.portal.kernel.util.DigesterUtil;
import com.liferay.portal.kernel.util.HttpUtil;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil;
+import com.liferay.portal.kernel.util.PortalClassLoaderUtil;
import com.liferay.portal.model.Contact;
import com.liferay.portal.model.EmailAddress;
import com.liferay.portal.model.Group;
@@ -894,6 +898,48 @@ public class LiferayUserManager implements UserManager {
}
return toReturn;
}
+ /*
+ * MEMBERSHIP REQUESTS
+ */
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List listPendingMembershipRequestsByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault {
+ try {
+ Group g = GroupLocalServiceUtil.getGroup(groupId);
+ _log.debug("Asked for pending users list of group: "+g.getName());
+ } catch (PortalException e1) {
+ throw new GroupRetrievalFault("Group not existing", groupId, e1);
+ } catch (SystemException e) {
+ e.printStackTrace();
+ }
+
+
+ DynamicQuery queryListPendingMembershipRequestsByGroup = DynamicQueryFactoryUtil.forClass
+ (MembershipRequest.class, PortalClassLoaderUtil.getClassLoader());
+
+ queryListPendingMembershipRequestsByGroup.add(PropertyFactoryUtil.forName("statusId").eq(new Integer ("2")));
+ queryListPendingMembershipRequestsByGroup.add(PropertyFactoryUtil.forName("groupId").eq(new Long(groupId)));
+
+ List toReturn = new ArrayList();
+ try {
+
+ @SuppressWarnings("unchecked")
+ List list = MembershipRequestLocalServiceUtil.dynamicQuery(queryListPendingMembershipRequestsByGroup);
+ for (MembershipRequest req : list) {
+ if (req.getGroupId() == groupId) {
+ toReturn.add(mapLRMembershipRequest(req));
+ }
+ }
+
+ } catch (SystemException e) {
+ e.printStackTrace();
+ } catch (PortalException e) {
+ e.printStackTrace();
+ }
+ return toReturn;
+ }
/**
* {@inheritDoc}
*/
diff --git a/src/main/java/org/gcube/vomanagement/usermanagement/impl/ws/LiferayWSUserManager.java b/src/main/java/org/gcube/vomanagement/usermanagement/impl/ws/LiferayWSUserManager.java
index cef0358..a0c0cdb 100644
--- a/src/main/java/org/gcube/vomanagement/usermanagement/impl/ws/LiferayWSUserManager.java
+++ b/src/main/java/org/gcube/vomanagement/usermanagement/impl/ws/LiferayWSUserManager.java
@@ -466,6 +466,14 @@ public class LiferayWSUserManager implements UserManager{
// TODO Auto-generated method stub
return null;
}
+
+ @Override
+ public List listPendingMembershipRequestsByGroup(
+ long groupId) throws UserManagementSystemException,
+ GroupRetrievalFault, UserRetrievalFault {
+ // TODO Auto-generated method stub
+ return null;
+ }
@Override
public GCubeMembershipRequest getMembershipRequestsById(