Feature completed

feature/19603
Massimiliano Assante 4 years ago
parent 1bfe766ead
commit 6def1c6dcd

@ -27,7 +27,7 @@
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="owner.project.facets" value="java"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>

@ -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

@ -10,7 +10,7 @@
</parent>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
<version>2.5.0</version>
<version>2.5.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>User Management API</name>

@ -297,6 +297,15 @@ public interface UserManager {
* @throws UserRetrievalFault
*/
List<GCubeMembershipRequest> 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<GCubeMembershipRequest> listPendingMembershipRequestsByGroup(long groupId) throws UserManagementSystemException, GroupRetrievalFault, UserRetrievalFault;
/**
*
* @param requestId

@ -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<GCubeMembershipRequest> 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<GCubeMembershipRequest> toReturn = new ArrayList<GCubeMembershipRequest>();
try {
@SuppressWarnings("unchecked")
List<MembershipRequest> 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}
*/

@ -466,6 +466,14 @@ public class LiferayWSUserManager implements UserManager{
// TODO Auto-generated method stub
return null;
}
@Override
public List<GCubeMembershipRequest> listPendingMembershipRequestsByGroup(
long groupId) throws UserManagementSystemException,
GroupRetrievalFault, UserRetrievalFault {
// TODO Auto-generated method stub
return null;
}
@Override
public GCubeMembershipRequest getMembershipRequestsById(

Loading…
Cancel
Save