Compare commits
No commits in common. "master" and "Feature/21269" have entirely different histories.
master
...
Feature/21
|
@ -1,36 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-module deploy-name="UsersManagementPortlet-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"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<property name="java-output-path" value="/UsersManagementPortlet/target/classes"/>
|
||||
|
||||
|
||||
<property name="context-root" value="UsersManagementPortlet-portlet"/>
|
||||
|
||||
|
||||
|
||||
</wb-module>
|
||||
|
||||
|
||||
|
||||
</wb-module>
|
||||
|
||||
</project-modules>
|
||||
|
|
|
@ -5,7 +5,7 @@ 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).
|
||||
|
||||
|
||||
## [v4.0.0] - 2021-05-13
|
||||
## [v4.0.0-SNAPSHOT] - 2021-05-13
|
||||
|
||||
- Feature #21269: make roles either assigned or removed in different operations, not mixed.
|
||||
- Ported to git, see other changelog.xml for more changelogs.
|
||||
|
|
9
pom.xml
9
pom.xml
|
@ -17,7 +17,7 @@
|
|||
<packaging>war</packaging>
|
||||
<name>UsersManagement Portlet</name>
|
||||
<description>UsersManagementPortlet portlet</description>
|
||||
<version>4.0.0</version>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
<scm>
|
||||
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection>
|
||||
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection>
|
||||
|
@ -37,7 +37,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<version>3.6.1-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
@ -47,6 +47,7 @@
|
|||
<dependency>
|
||||
<groupId>com.liferay.portal</groupId>
|
||||
<artifactId>portal-service</artifactId>
|
||||
<version>${liferay.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -57,6 +58,7 @@
|
|||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -68,6 +70,7 @@
|
|||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.18</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jstl</groupId>
|
||||
|
@ -114,7 +117,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.portal.mailing</groupId>
|
||||
<artifactId>email-templates-library</artifactId>
|
||||
<version>[1.5.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
|
|
@ -27,8 +27,6 @@ import org.gcube.portal.mailing.message.EmailAddress;
|
|||
import org.gcube.portal.mailing.message.Recipient;
|
||||
import org.gcube.portal.mailing.message.RecipientType;
|
||||
import org.gcube.portal.mailing.service.EmailTemplateService;
|
||||
import org.gcube.portal.mailing.templates.TemplateManagerHasAssignedRoles;
|
||||
import org.gcube.portal.mailing.templates.TemplateManagerHasRevokedRoles;
|
||||
import org.gcube.portal.mailing.templates.TemplateUserApprovedRequestVRE;
|
||||
import org.gcube.portal.mailing.templates.TemplateUserHasBeenUnregisteredVRE;
|
||||
import org.gcube.portal.mailing.templates.TemplateUserRejectedRequestVRE;
|
||||
|
@ -1459,49 +1457,29 @@ public class UsersManagementPortletHome extends GenericPortlet {
|
|||
* @throws UserManagementSystemException
|
||||
* @throws GroupRetrievalFault
|
||||
*/
|
||||
public void notifyUsersByEmailOnRoleAssignment(
|
||||
long groupId, GCubeUser userToReceiveTheMail,
|
||||
GCubeUser manager, GCubeGroup group, List<GCubeRole> newRoles,
|
||||
HttpServletRequest httpServletRequest) throws UserManagementSystemException, GroupRetrievalFault {
|
||||
public void notifyUsersByEmailOnRoleAssignment(long groupId, GCubeUser userToReceiveTheMail, GCubeUser manager, GCubeGroup group, List<GCubeRole> newRoles, HttpServletRequest httpServletRequest) throws UserManagementSystemException, GroupRetrievalFault {
|
||||
_log.debug("Notifying user by email on role assignment for user: " + userToReceiveTheMail.getUsername() + " for context name: " + group.getGroupName() );
|
||||
String gatewayName = PortalContext.getConfiguration().getGatewayName(httpServletRequest);
|
||||
String gatewayURL = PortalContext.getConfiguration().getGatewayURL(httpServletRequest);
|
||||
|
||||
//send email to the assignee
|
||||
ArrayList<String> managersEmails = getVREManagersEmailsForGroup(groupId);
|
||||
|
||||
int recSize = managersEmails.size() + 1;
|
||||
Recipient[] recs = new Recipient[recSize];
|
||||
recs[0] = new Recipient(new EmailAddress(userToReceiveTheMail.getEmail()), RecipientType.TO);
|
||||
if (!managersEmails.isEmpty()) {
|
||||
int i = 1;
|
||||
for (String mEmail : managersEmails){
|
||||
recs[i] = new Recipient(new EmailAddress(mEmail), RecipientType.BCC);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
String properEmailSubject = EmailPartsConstruction.getRoleAssignmentRevokeSubject(new LiferayGroupManager().getGroup(groupId).getGroupName());
|
||||
TemplateUserRolesModifiedForGroup templateUserRolesModifiedForGroup =
|
||||
new TemplateUserRolesModifiedForGroup(gatewayName, gatewayURL,
|
||||
|
||||
TemplateUserRolesModifiedForGroup templateUserRolesModifiedForGroup = new TemplateUserRolesModifiedForGroup(
|
||||
PortalContext.getConfiguration().getGatewayName(httpServletRequest), PortalContext.getConfiguration().getGatewayURL(httpServletRequest),
|
||||
group, userToReceiveTheMail, manager, newRoles, new ArrayList<>(), new Date() );
|
||||
|
||||
_log.info("Sending email to user: " + userToReceiveTheMail.getUsername() + ". His roles have been modified within the context of VRE: " + group.getGroupName());
|
||||
EmailTemplateService.send(properEmailSubject, (org.gcube.common.portal.mailing.templates.Template)templateUserRolesModifiedForGroup, httpServletRequest, new Recipient(userToReceiveTheMail.getEmail()));
|
||||
|
||||
String[] theRoles = new String[newRoles.size()];
|
||||
int i = 0;
|
||||
for (GCubeRole role : newRoles) {
|
||||
theRoles[i] = role.getRoleName();
|
||||
i++;
|
||||
}
|
||||
//send email to the manager
|
||||
ArrayList<String> managersEmails = getVREManagersEmailsForGroup(groupId);
|
||||
_log.info("Sending email to VRE Managers about user: " + userToReceiveTheMail.getUsername() + ". His roles have been modified within the context of VRE: " + group.getGroupName());
|
||||
String managersEmailSubject = "Roles assignment notification on " + group.getGroupName();
|
||||
if (!managersEmails.isEmpty()) {
|
||||
for (String mEmail : managersEmails){
|
||||
TemplateManagerHasAssignedRoles managersTemplate =
|
||||
new TemplateManagerHasAssignedRoles(
|
||||
userToReceiveTheMail,
|
||||
manager.getFullname(),
|
||||
group.getGroupName(),
|
||||
theRoles,
|
||||
gatewayName,
|
||||
gatewayURL);
|
||||
|
||||
EmailTemplateService.send(managersEmailSubject, managersTemplate, httpServletRequest, new Recipient(mEmail));
|
||||
}
|
||||
}
|
||||
EmailTemplateService.send(properEmailSubject, (org.gcube.common.portal.mailing.templates.Template)templateUserRolesModifiedForGroup, httpServletRequest, recs);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param groupId
|
||||
|
@ -1515,41 +1493,26 @@ public class UsersManagementPortletHome extends GenericPortlet {
|
|||
*/
|
||||
public void notifyUsersByEmailOnRoleRevokation(long groupId, GCubeUser userToReceiveTheMail, GCubeUser manager, GCubeGroup group, List<GCubeRole> revokeRoles, HttpServletRequest httpServletRequest) throws UserManagementSystemException, GroupRetrievalFault {
|
||||
_log.debug("Notifying user by email on role revokation for user: " + userToReceiveTheMail.getUsername() + " for context name: " + group.getGroupName() );
|
||||
String gatewayName = PortalContext.getConfiguration().getGatewayName(httpServletRequest);
|
||||
String gatewayURL = PortalContext.getConfiguration().getGatewayURL(httpServletRequest);
|
||||
|
||||
//send email to the assignee
|
||||
ArrayList<String> managersEmails = getVREManagersEmailsForGroup(groupId);
|
||||
|
||||
int recSize = managersEmails.size() + 1;
|
||||
Recipient[] recs = new Recipient[recSize];
|
||||
recs[0] = new Recipient(new EmailAddress(userToReceiveTheMail.getEmail()), RecipientType.TO);
|
||||
if (!managersEmails.isEmpty()) {
|
||||
int i = 1;
|
||||
for (String mEmail : managersEmails){
|
||||
recs[i] = new Recipient(new EmailAddress(mEmail), RecipientType.BCC);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
String properEmailSubject = EmailPartsConstruction.getRoleAssignmentRevokeSubject(new LiferayGroupManager().getGroup(groupId).getGroupName());
|
||||
TemplateUserRolesModifiedForGroup templateUserRolesModifiedForGroup =
|
||||
new TemplateUserRolesModifiedForGroup(gatewayName, gatewayURL,
|
||||
|
||||
TemplateUserRolesModifiedForGroup templateUserRolesModifiedForGroup = new TemplateUserRolesModifiedForGroup(
|
||||
PortalContext.getConfiguration().getGatewayName(httpServletRequest), PortalContext.getConfiguration().getGatewayURL(httpServletRequest),
|
||||
group, userToReceiveTheMail, manager, new ArrayList<>(), revokeRoles, new Date() );
|
||||
|
||||
_log.info("Sending email to user: " + userToReceiveTheMail.getUsername() + ". His roles have been modified within the context of VRE: " + group.getGroupName());
|
||||
EmailTemplateService.send(properEmailSubject, (org.gcube.common.portal.mailing.templates.Template)templateUserRolesModifiedForGroup, httpServletRequest, new Recipient(userToReceiveTheMail.getEmail()));
|
||||
|
||||
String[] theRoles = new String[revokeRoles.size()];
|
||||
int i = 0;
|
||||
for (GCubeRole role : revokeRoles) {
|
||||
theRoles[i] = role.getRoleName();
|
||||
i++;
|
||||
}
|
||||
//send email to the manager
|
||||
ArrayList<String> managersEmails = getVREManagersEmailsForGroup(groupId);
|
||||
_log.info("Sending email to VRE Managers about user: " + userToReceiveTheMail.getUsername() + ". His roles have been modified within the context of VRE: " + group.getGroupName());
|
||||
String managersEmailSubject = "Revoked roles notification on " + group.getGroupName();
|
||||
if (!managersEmails.isEmpty()) {
|
||||
for (String mEmail : managersEmails){
|
||||
TemplateManagerHasRevokedRoles managersTemplate =
|
||||
new TemplateManagerHasRevokedRoles(
|
||||
userToReceiveTheMail,
|
||||
manager.getFullname(),
|
||||
group.getGroupName(),
|
||||
theRoles,
|
||||
gatewayName,
|
||||
gatewayURL);
|
||||
|
||||
EmailTemplateService.send(managersEmailSubject, managersTemplate, httpServletRequest, new Recipient(mEmail));
|
||||
}
|
||||
}
|
||||
EmailTemplateService.send(properEmailSubject, (org.gcube.common.portal.mailing.templates.Template)templateUserRolesModifiedForGroup, httpServletRequest, recs);
|
||||
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -21,6 +21,5 @@ function navBar(){
|
|||
// }
|
||||
$(this).closest('div.dataTables_filter').find('label input:first').animate({width:'toggle'});
|
||||
$(this).toggleClass('active');
|
||||
$(this).closest('div.dataTables_filter').find('label input:first').focus();
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue