mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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"
|
||||||
|
@@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -111,11 +111,22 @@ 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)
|
{
|
||||||
|
// 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.");
|
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.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user