RM-942: It's possible to move/copy/link to/from and delete from closed folder

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@56073 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-09-27 08:21:32 +00:00
parent 19625297bb
commit 09cb2a56e9
3 changed files with 16 additions and 4 deletions

View File

@@ -135,6 +135,7 @@
<entry key="capabilityCondition.recordFiled" value="true"/> <entry key="capabilityCondition.recordFiled" value="true"/>
</map> </map>
</property> </property>
<property name="targetCapability" ref="rmFileRecordsCapability"/>
</bean> </bean>
<bean id="rmCopyRecordFolderCapability" <bean id="rmCopyRecordFolderCapability"

View File

@@ -363,7 +363,7 @@ public class RecordServiceImpl implements RecordService,
policyComponent.bindClassBehaviour( policyComponent.bindClassBehaviour(
NodeServicePolicies.OnRemoveAspectPolicy.QNAME, NodeServicePolicies.OnRemoveAspectPolicy.QNAME,
ContentModel.ASPECT_NO_CONTENT, ContentModel.ASPECT_NO_CONTENT,
new JavaBehaviour(this, "onRemoveAspect", NotificationFrequency.TRANSACTION_COMMIT)); new JavaBehaviour(this, "onRemoveAspect", NotificationFrequency.EVERY_EVENT));
} }
/** /**

View File

@@ -111,10 +111,21 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
public void onCreateChildAssociationInRecordFolder(ChildAssociationRef childAssocRef, boolean bNew) public void onCreateChildAssociationInRecordFolder(ChildAssociationRef childAssocRef, boolean bNew)
{ {
NodeRef nodeRef = childAssocRef.getChildRef(); NodeRef nodeRef = childAssocRef.getChildRef();
if (nodeService.exists(nodeRef) == true && if (nodeService.exists(nodeRef) == true)
instanceOf(nodeRef, ContentModel.TYPE_FOLDER) == true)
{ {
throw new AlfrescoRuntimeException("You can't create a folder within an exisiting record folder."); // ensure folders are never added to a record folder
if (instanceOf(nodeRef, ContentModel.TYPE_FOLDER) == true)
{
throw new AlfrescoRuntimeException("You can't create a folder within an exisiting record folder.");
}
// ensure nothing is being added to a closed record folder
NodeRef recordFolder = childAssocRef.getParentRef();
Boolean isClosed = (Boolean) this.nodeService.getProperty(recordFolder, PROP_IS_CLOSED);
if (isClosed != null && Boolean.TRUE.equals(isClosed) == true)
{
throw new AlfrescoRuntimeException("You can't add new items to a closed record folder.");
}
} }
} }