Hotfix/rm 3114 patch fails
- Update release version to 2.2.1.5
- make admin service a listener, ordered to execute last
- protect service behaviours from execution until custom map is loaded
- integration tests
@abozianu and @onechiforescu please take a look at this too.
See merge request !86
Feature 2.4/rm 3030 preview not available declared record
RM-3030 - The documents declared as records in their Details page don't have the preview available afterwards.
I've noticed different behavior when doing steps in different order: if the file is declared as record before navigating to document details page, the error doesn't reproduce; if document details page is accessed first and after declare the file as record, there is an Access Denied exception.
In the first case the node for preview has the File Plan aspect, in the second one it doesn't.
See merge request !105
Feature 2.4/rm 3266 foreground reject action in unfiled records not working
RM-3266 - Documents get into a "hybrid" state when the Unfiled records inherited from File Plan rule rejects declared records.
If we run the reject rule in foreground it will run in the same transaction with create-record. **CreateRecordAction** will move the file to RM site and add all the RM aspects to it (including rma:filePlanComponent) then **RejectAction** will move the file back to the collaboration site and remove all the RM aspects from it. Because the two actions run in the same transaction **FilePlanComponentAspect.onAddAspect** will run at the end of the transaction to set the property rma:rootNodeRef and apply the rma:filePlanComponent aspect on all the renditions. By setting the property rma:rootNodeRef the **rma:filePlanComponent** is added back on the node.
When listing the files in the community site these nodes match the rmDocLibRecord template becuse they have **rma:filePlanComponent** aspect but we fail to list them because they are not records. The rejected files should match rmDocLibRejectedRecord template.
I added an extra check in the onAddAspect method to make sure we don't add back RM properties if the aspect rma:filePlanComponent has been removed in the same transaction it has been added.
Another solution that worked is changing the notification frequency of the onAddAspect method from **NotificationFrequency.TRANSACTION_COMMIT** to **NotificationFrequency.EVERY_EVENT** but I think it will affect the performance a lot more.
See merge request !113
Feature 2.4/rm 3216 list rm files in imap
RM-3216 - IMAP:Emails messages not available after adding a file and declaring as record
The problem is in Alfresco core in the method getPathFromSites from ImapServiceImpl. When declaring a file as a record the node becomes an Inplace Record and the primary parent becomes the Unfiled Records folder. The IMAP service tries to get the record path relative to the site so it goes recursively to the primary parent and checks if it reached the site node with the following condition:
```java
if (nodeService.getType(ref).equals(SiteModel.TYPE_SITE))
```
As the RM site is of type rma:rmsite this clause will fail and the method goes up to the root node which doesn't have any parent and we get a NullPointerException. The if condition should be:
```java
if (dictionaryService.isSubClass(nodeService.getType(ref), SiteModel.TYPE_SITE))
```
This is why no RM folder is listed trough IMAP.
To fix the issue I extended ImapServiceImpl and overwrote the method that needed to be fixed.
See merge request !107
Feature 2.4/rm 3077 linked and cut off records properties not available for users with no access to linked folder
Uses runAsSystem for obtaining instructions, recordCategory and categoryId in RecordsManagementNodeFormFilter.AddTransientProperties()
See merge request !94
Feature 2.4/rm 2967 rm audit error if user is deleted
RM-2967 - The admin tools audit throws an error when trying to access full information if deleted users created/updated data.
- Added exists check in RecordsManagementAuditServiceImpl.java to avoid the illegal argument exception.
- Added an empty check in rm-audit.js to remove the "-" if the username is empty because if the user is deleted the text is "Create Person -"
- Added a null check in AuditLogGet.java because if you delete the RM site and access the audit page you get a null pointer exception
While testing the issue I noticed that the Create Person audit entry appears only after the user is deleted. The audit event is created with immediate auditing on false which makes sense if we only want to audit users related to RM site. If the "Create Person" log appears only after the user was deleted there isn't a reason to try getting the username property at all from a node that we know it doesn't exist.
See merge request !95
- remove public init method from AdministrationService
- make admin service impl ordered listener, always goes last
- protect execution of service behaviours until custom map init'ed
Feature 2.4/rm 3000 set property value in rm rules not working
RM-3000 - The set property value action can not be used in RM rules page.
Because the actions were not working as expected in other languages the mechanism has been changed to use localization in MNT-6350 and a caching mechanism has been implemented. So the getLocalizedParameterDefinitions is called only once at server startup. The actions in RM have been added before this change and we continued to implement getParameterDefintions.
The method getLocalizedParameterDefinitions which is protected calls addParameterDefinitions to build the results so I've overridden addParameterDefinitions to include the delegate's parameters for DelegateAction.
The actions executeScript and sendEmail were also affected by this change. I've added unit test to cover all 3 of them.
See merge request !81
- Modified pom to use the maven-release-plugin
- Disable doclint
- Removed the explicit call to maven-source-plugin. The source jars will be created by the maven-release-plugin