Compare commits

...

2 Commits

Author SHA1 Message Date
Diamantis Tziotzios 37ab19b945 Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring 2024-06-07 12:11:18 +03:00
Diamantis Tziotzios 8d4fbaa804 added tenant path to tenant notifiactions 2024-06-07 12:10:58 +03:00
25 changed files with 100 additions and 19 deletions

View File

@ -361,6 +361,10 @@ public class DepositServiceImpl implements DepositService {
fieldInfoList.add(new FieldInfo("{reasonName}", DataType.String, this.queryFactory.query(UserQuery.class).disableTracking().ids(this.userScope.getUserId()).first().getName()));
fieldInfoList.add(new FieldInfo("{name}", DataType.String, dmp.getLabel()));
fieldInfoList.add(new FieldInfo("{id}", DataType.String, dmp.getId().toString()));
if(this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){
fieldInfoList.add(new FieldInfo("{tenant-url-path}", DataType.String, String.format("/t/%s", this.tenantScope.getTenantCode())));
}
data.setFields(fieldInfoList);
event.setData(this.jsonHandlingService.toJsonSafe(data));

View File

@ -405,6 +405,9 @@ public class DescriptionServiceImpl implements DescriptionService {
fieldInfoList.add(new FieldInfo("{reasonName}", DataType.String, this.queryFactory.query(UserQuery.class).disableTracking().ids(this.userScope.getUserId()).first().getName()));
fieldInfoList.add(new FieldInfo("{name}", DataType.String, description.getLabel()));
fieldInfoList.add(new FieldInfo("{id}", DataType.String, description.getId().toString()));
if(this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){
fieldInfoList.add(new FieldInfo("{tenant-url-path}", DataType.String, String.format("/t/%s", this.tenantScope.getTenantCode())));
}
data.setFields(fieldInfoList);
event.setData(this.jsonHandlingService.toJsonSafe(data));

View File

@ -284,6 +284,9 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic
fieldInfoList.add(new FieldInfo("{recipient}", DataType.String, user.getName()));
fieldInfoList.add(new FieldInfo("{templateName}", DataType.String, descriptionTemplate.getLabel()));
fieldInfoList.add(new FieldInfo("{templateID}", DataType.String, descriptionTemplate.getId().toString()));
if(this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){
fieldInfoList.add(new FieldInfo("{tenant-url-path}", DataType.String, String.format("/t/%s", this.tenantScope.getTenantCode())));
}
data.setFields(fieldInfoList);
event.setData(this.jsonHandlingService.toJsonSafe(data));
this.eventHandler.handle(event);

View File

@ -330,6 +330,9 @@ public class DmpServiceImpl implements DmpService {
fieldInfoList.add(new FieldInfo("{reasonName}", DataType.String, this.queryFactory.query(UserQuery.class).disableTracking().ids(this.userScope.getUserId()).first().getName()));
fieldInfoList.add(new FieldInfo("{name}", DataType.String, dmp.getLabel()));
fieldInfoList.add(new FieldInfo("{id}", DataType.String, dmp.getId().toString()));
if(this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){
fieldInfoList.add(new FieldInfo("{tenant-url-path}", DataType.String, String.format("/t/%s", this.tenantScope.getTenantCode())));
}
data.setFields(fieldInfoList);
event.setData(this.jsonHandlingService.toJsonSafe(data));
@ -1497,6 +1500,9 @@ public class DmpServiceImpl implements DmpService {
fieldInfoList.add(new FieldInfo("{planname}", DataType.String, dmp.getLabel()));
fieldInfoList.add(new FieldInfo("{planrole}", DataType.String, role.toString()));
fieldInfoList.add(new FieldInfo("{id}", DataType.String, dmp.getId().toString()));
if(this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){
fieldInfoList.add(new FieldInfo("{tenant-url-path}", DataType.String, String.format("/t/%s", this.tenantScope.getTenantCode())));
}
data.setFields(fieldInfoList);
event.setData(this.jsonHandlingService.toJsonSafe(data));
this.eventHandler.handle(event);
@ -1519,6 +1525,9 @@ public class DmpServiceImpl implements DmpService {
fieldInfoList.add(new FieldInfo("{confirmationToken}", DataType.String, token));
fieldInfoList.add(new FieldInfo("{planname}", DataType.String, dmp.getLabel()));
fieldInfoList.add(new FieldInfo("{planrole}", DataType.String, role.toString()));
if(this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){
fieldInfoList.add(new FieldInfo("{tenant-url-path}", DataType.String, String.format("/t/%s", this.tenantScope.getTenantCode())));
}
data.setFields(fieldInfoList);
event.setData(this.jsonHandlingService.toJsonSafe(data));
this.eventHandler.handle(event);

View File

@ -536,6 +536,9 @@ public class UserServiceImpl implements UserService {
fieldInfoList.add(new FieldInfo("{userName}", DataType.String, currentUser.getName()));
fieldInfoList.add(new FieldInfo("{confirmationToken}", DataType.String, token));
fieldInfoList.add(new FieldInfo("{expiration_time}", DataType.String, this.secondsToTime(this.notificationProperties.getEmailExpirationTimeSeconds())));
if(this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){
fieldInfoList.add(new FieldInfo("{tenant-url-path}", DataType.String, String.format("/t/%s", this.tenantScope.getTenantCode())));
}
data.setFields(fieldInfoList);
event.setData(this.jsonHandlingService.toJsonSafe(data));
this.eventHandler.handle(event);
@ -560,6 +563,9 @@ public class UserServiceImpl implements UserService {
List<FieldInfo> fieldInfoList = new ArrayList<>();
fieldInfoList.add(new FieldInfo("{confirmationToken}", DataType.String, token));
fieldInfoList.add(new FieldInfo("{expiration_time}", DataType.String, this.secondsToTime(this.notificationProperties.getEmailExpirationTimeSeconds())));
if(this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){
fieldInfoList.add(new FieldInfo("{tenant-url-path}", DataType.String, String.format("/t/%s", this.tenantScope.getTenantCode())));
}
data.setFields(fieldInfoList);
event.setData(this.jsonHandlingService.toJsonSafe(data));
this.eventHandler.handle(event);

View File

@ -57,10 +57,13 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{planname}]': null
'[{planrole}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
cc: [ ]
cc-mode: 0
bcc: [ ]
@ -79,11 +82,14 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{planname}]': null
'[{planrole}]': null
'[{reasonName}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
cc: [ ]
cc-mode: 0
bcc: [ ]
@ -102,10 +108,13 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{reasonName}]': null
'[{name}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
cc: [ ]
cc-mode: 0
bcc: [ ]
@ -124,10 +133,13 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{reasonName}]': null
'[{name}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
cc: [ ]
cc-mode: 0
bcc: [ ]
@ -146,10 +158,13 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{reasonName}]': null
'[{name}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
cc: [ ]
cc-mode: 0
bcc: [ ]
@ -168,10 +183,13 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{reasonName}]': null
'[{name}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
cc: [ ]
cc-mode: 0
bcc: [ ]
@ -190,10 +208,13 @@ notification:
optional:
- key: "{expiration_time}"
value: ---
- key: "{tenant-url-path}"
value:
formatting:
'[{userName}]': null
'[{installation-url}]': null
'[{expiration_time}]': null
'[{tenant-url-path}]': null
cc: [ ]
cc-mode: 0
bcc: [ ]
@ -214,8 +235,11 @@ notification:
value: email
- key: "{expiration_time}"
value: --
- key: "{tenant-url-path}"
value:
formatting:
'[{email}]': null
'[{tenant-url-path}]': null
cc: [ ]
cc-mode: 0
bcc: [ ]
@ -234,10 +258,13 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{reasonName}]': null
'[{name}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
cc: [ ]
cc-mode: 0
bcc: [ ]
@ -256,9 +283,12 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{templateName}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
cc: [ ]
cc-mode: 0
bcc: [ ]
@ -321,11 +351,14 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{planname}]': null
'[{planrole}]': null
'[{reasonName}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
priority-key: null
cipher-fields: [ ]
- #planModified
@ -340,12 +373,15 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{reasonName}]': null
'[{name}]': null
'[{installation-url}]': null
'[{id}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
priority-key: null
cipher-fields: [ ]
- #planFinalised
@ -360,12 +396,15 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{reasonName}]': null
'[{name}]': null
'[{installation-url}]': null
'[{id}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
priority-key: null
cipher-fields: [ ]
- #desriptionModified
@ -380,12 +419,15 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{reasonName}]': null
'[{name}]': null
'[{installation-url}]': null
'[{id}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
priority-key: null
cipher-fields: [ ]
- #descriptionFinalised
@ -400,12 +442,15 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{reasonName}]': null
'[{name}]': null
'[{installation-url}]': null
'[{id}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
priority-key: null
cipher-fields: [ ]
- #mergeAccountConfirmation
@ -420,6 +465,8 @@ notification:
optional:
- key: "{expiration_time}"
value: ---
- key: "{tenant-url-path}"
value:
formatting:
'[{userName}]': null
'[{installation-url}]': null
@ -441,9 +488,12 @@ notification:
value: email
- key: "{expiration_time}"
value: --
- key: "{tenant-url-path}"
value:
formatting:
'[{email}]': null
'[{expiration_time}]': null
'[{tenant-url-path}]': null
priority-key: null
cipher-fields: [ ]
- #planDeposit
@ -458,12 +508,15 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{reasonName}]': null
'[{name}]': null
'[{installation-url}]': null
'[{id}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
priority-key: null
cipher-fields: [ ]
- #descriptionTemplateInvitation
@ -478,11 +531,14 @@ notification:
optional:
- key: "{recipient}"
value:
- key: "{tenant-url-path}"
value:
formatting:
'[{templateName}]': null
'[{installation-url}]': null
'[{templateID}]': null
'[{recipient}]': null
'[{tenant-url-path}]': null
priority-key: null
cipher-fields: [ ]
template-cache:

View File

@ -270,7 +270,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td> <a href="{installation-url}/descriptions/overview/{id}" target="_blank">Click here to view it.</a> </td>
<td> <a href="{installation-url}{tenant-url-path}/descriptions/overview/{id}" target="_blank">Click here to view it.</a> </td>
</tr>
</tbody>
</table>

View File

@ -7,6 +7,6 @@
<body class="">
<p>Dear {recipient},</p>
<p>{reasonName} just finalised the Description {name}.</p>
<a href="{installation-url}/descriptions/overview/{id}" target="_blank">Click here to view it.</a>
<a href="{installation-url}{tenant-url-path}/descriptions/overview/{id}" target="_blank">Click here to view it.</a>
</body>
</html>

View File

@ -270,7 +270,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td> <a href="{installation-url}/descriptions/overview/{id}" target="_blank">Click here to view it.</a> </td>
<td> <a href="{installation-url}{tenant-url-path}/descriptions/overview/{id}" target="_blank">Click here to view it.</a> </td>
</tr>
</tbody>
</table>

View File

@ -7,6 +7,6 @@
<body class="">
<p>Dear {recipient},</p>
<p>{reasonName} just made changes to the Description {name}.</p>
<a href="{installation-url}/descriptions/overview/{id}" target="_blank">Click here to view it.</a>
<a href="{installation-url}{tenant-url-path}/descriptions/overview/{id}" target="_blank">Click here to view it.</a>
</body>
</html>

View File

@ -271,7 +271,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td> <a href="{installation-url}/description-templates/{templateID}" target="_blank">{templateName}</a> </td>
<td> <a href="{installation-url}{tenant-url-path}/description-templates/{templateID}" target="_blank">{templateName}</a> </td>
</tr>
</tbody>
</table>

View File

@ -8,6 +8,6 @@
<p>Dear {recipient},</p>
<p>You have been invited to co-develop the Template {templateName}.</p>
<p>Click the button to redirect to {templateName}.</p>
<a href="{installation-url}/description-templates/{templateID}" target="_blank">{templateName}</a>
<a href="{installation-url}{tenant-url-path}/description-templates/{templateID}" target="_blank">{templateName}</a>
</body>
</html>

View File

@ -271,7 +271,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td> <a href="{installation-url}/login/merge/confirmation/{confirmationToken}" target="_blank">Confirm Merge Request</a> </td>
<td> <a href="{installation-url}{tenant-url-path}/login/merge/confirmation/{confirmationToken}" target="_blank">Confirm Merge Request</a> </td>
</tr>
</tbody>
</table>

View File

@ -9,6 +9,6 @@
<h2>User {userName} have sent you a merge Request.</h2>
<p>Please confirm that you want to merge your {installation-url} account with that account.
<br/>The link will expire in {expiration_time}.</p>
<a href="{installation-url}/login/merge/confirmation/{confirmationToken}" target="_blank">Confirm Merge Request</a>
<a href="{installation-url}{tenant-url-path}/login/merge/confirmation/{confirmationToken}" target="_blank">Confirm Merge Request</a>
</body>
</html>

View File

@ -270,7 +270,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td> <a href="{installation-url}/plans/overview/{id}" target="_blank">Click here to view it.</a> </td>
<td> <a href="{installation-url}{tenant-url-path}/plans/overview/{id}" target="_blank">Click here to view it.</a> </td>
</tr>
</tbody>
</table>

View File

@ -7,6 +7,6 @@
<body class="">
<p>Dear {recipient},</p>
<p>{reasonName} just publish the {name}.</p>
<a href="{installation-url}/plans/overview/{id}" target="_blank">Click here to view it.</a>
<a href="{installation-url}{tenant-url-path}/plans/overview/{id}" target="_blank">Click here to view it.</a>
</body>
</html>

View File

@ -270,7 +270,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td> <a href="{installation-url}/plans/overview/{id}" target="_blank">Click here to view it.</a> </td>
<td> <a href="{installation-url}{tenant-url-path}/plans/overview/{id}" target="_blank">Click here to view it.</a> </td>
</tr>
</tbody>
</table>

View File

@ -7,6 +7,6 @@
<body class="">
<p>Dear {recipient},</p>
<p>{reasonName} just finalised the Plan {name}.</p>
<a href="{installation-url}/plans/overview/{id}" target="_blank">Click here to view it.</a>
<a href="{installation-url}{tenant-url-path}/plans/overview/{id}" target="_blank">Click here to view it.</a>
</body>
</html>

View File

@ -271,7 +271,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td> <a href="{installation-url}/plans/overview/{id}" target="_blank">Join</a> </td>
<td> <a href="{installation-url}{tenant-url-path}/plans/overview/{id}" target="_blank">Join</a> </td>
</tr>
</tbody>
</table>

View File

@ -9,6 +9,6 @@
<p>Dear {recipient},</p>
<p>{reasonName} just added you to collaborate to the Plan {planname} with role {planrole}.</p>
<p>Click the button to redirect to {planname}.</p>
<a href="{installation-url}/plans/overview/{id}" target="_blank">Join</a>
<a href="{installation-url}{tenant-url-path}/plans/overview/{id}" target="_blank">Join</a>
</body>
</html>

View File

@ -271,7 +271,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td> <a href="{installation-url}/plans/invitation/{confirmationToken}" target="_blank">Join</a> </td>
<td> <a href="{installation-url}{tenant-url-path}/plans/invitation/{confirmationToken}" target="_blank">Join</a> </td>
</tr>
</tbody>
</table>

View File

@ -270,7 +270,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td> <a href="{installation-url}/plans/overview/{id}" target="_blank">Click here to view it.</a> </td>
<td> <a href="{installation-url}{tenant-url-path}/plans/overview/{id}" target="_blank">Click here to view it.</a> </td>
</tr>
</tbody>
</table>

View File

@ -7,7 +7,7 @@
<body class="">
<p>Dear {recipient},</p>
<p>{reasonName} just made changes to the Plan {name}.</p>
<a href="{installation-url}/plans/overview/{id}" target="_blank">Click here to view it.</a>
<a href="{installation-url}{tenant-url-path}/plans/overview/{id}" target="_blank">Click here to view it.</a>
</table>
</body>
</html>

View File

@ -271,7 +271,7 @@
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td> <a href="{installation-url}/login/unlink/confirmation/{confirmationToken}" target="_blank">Confirm Unlink Request</a> </td>
<td> <a href="{installation-url}{tenant-url-path}/login/unlink/confirmation/{confirmationToken}" target="_blank">Confirm Unlink Request</a> </td>
</tr>
</tbody>
</table>

View File

@ -9,6 +9,6 @@
<h2>You have made a request to unlink your email account in OpenCDMP.</h2>
<p>Please confirm that you want to unlink your {email} account.
<br/>The link will expire in {expiration_time}.</p>
<a href="{installation-url}/login/unlink/confirmation/{confirmationToken}" target="_blank">Confirm Unlink Request</a>
<a href="{installation-url}{tenant-url-path}/login/unlink/confirmation/{confirmationToken}" target="_blank">Confirm Unlink Request</a>
</body>
</html>