Feature 2.4/rm 3285
Added check not to be able to put null in cache, for nodes that are not records and don't have a filePlan.
Added unit test for it.
See merge request !128
Feature 2.4/rm 3233 non electronic records can not have properties changed through rules in unfiled records
When setting a foreground rule to change one properties for files that enter to a folder from Unfiled Records, when trying to create a nonElectronic record sometimes because it was very hard to reproduce this issue, SetPropertyValueActionExecuter is executed before adding the Record aspect from RecordsManagementContainerType.onCreateChildAssociation() and that's why it fails when checking UpdateProperties capability.
When creating "rma:nonElectronicDocument" document formprocessor is used and at some point updateNode from node service is used to update the properties. Therefore I made sure that each time when udating "rma:nonElectronicDocument" node the Record aspect is added if not present.
See merge request !124
Feature 2.4/rm 2925 no option to delete destroyed record folder
RM-2925 - No option to delete destroyed record folder (which maintain record metadata after destroy)
Made Delete action available for destroyed record folder, added unit test class.
See merge request !92
Feature 2.4/rm 3283 outlook integration email with attachments
RM-3283 - Outlook Integration:Emails cannot be added to Unfiled Records (having a rule set) using Alfresco Outlook Integration
When adding emails with attachments in alfresco a hidden folder of type wpsmail-v2:attachment-folder (subtype of cm:folder) is added to hold the attachment files. When such an email is added in Unfilled Records container the RecordsManagementContainerType.onCreateChildAssociation policy is fired which transforms any subtype of folder into a record folder. When the rule tries to file this folder in another record folder we get an exception from trying to add a record folder in another record folder.
To fix this issue I added an extra check to avoid applying the conversion rule on hidden nodes. I also added a unit test for both hidden and non hidden folders.
See merge request !123
Feature 2.4/rm 3216 regression imap
RM-3274 - Error creating bean with name 'imapServiceBootstrap'
I added an invalid authentication util bean reference to the extended IMAP service and the setter was missing.
See merge request !117
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
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