RM-459: It's possible to move/copy record directly to the category root

* Unable to copy/move record into filePlan root
  * UI no longer errors if record is present in file plan root, allowing user to fix data



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0@39403 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2012-07-18 00:37:07 +00:00
parent e8fe0ffd36
commit 8460fedec4
2 changed files with 11 additions and 13 deletions

View File

@@ -179,24 +179,24 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
public void init()
{
// Register the association behaviours
this.policyComponent.bindAssociationBehaviour(
policyComponent.bindAssociationBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
TYPE_RECORD_FOLDER,
ContentModel.ASSOC_CONTAINS,
new JavaBehaviour(this, "onFileContent", NotificationFrequency.TRANSACTION_COMMIT));
this.policyComponent.bindAssociationBehaviour(
policyComponent.bindAssociationBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
TYPE_FILE_PLAN,
ContentModel.ASSOC_CONTAINS,
new JavaBehaviour(this, "onAddContentToContainer", NotificationFrequency.EVERY_EVENT));
this.policyComponent.bindAssociationBehaviour(
policyComponent.bindAssociationBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
TYPE_RECORD_CATEGORY,
ContentModel.ASSOC_CONTAINS,
new JavaBehaviour(this, "onAddContentToContainer", NotificationFrequency.EVERY_EVENT));
policyComponent.bindAssociationBehaviour(
policyComponent.bindAssociationBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
ASPECT_RECORD,
RenditionModel.ASSOC_RENDITION,
@@ -204,7 +204,7 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
);
// Register script execution behaviour on RM property update.
this.policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onUpdateProperties"),
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onUpdateProperties"),
ASPECT_FILE_PLAN_COMPONENT,
new JavaBehaviour(this, "onChangeToAnyRmProperty", NotificationFrequency.TRANSACTION_COMMIT));
@@ -266,14 +266,10 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
*/
public void onAddContentToContainer(ChildAssociationRef childAssocRef, boolean bNew)
{
if (childAssocRef.getTypeQName().equals(ContentModel.ASSOC_CONTAINS))
NodeRef nodeRef = childAssocRef.getChildRef();
if (instanceOf(nodeRef, ContentModel.TYPE_CONTENT) == true)
{
QName childType = nodeService.getType(childAssocRef.getChildRef());
if(childType.equals(ContentModel.TYPE_CONTENT))
{
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_ERROR_ADD_CONTENT_CONTAINER));
}
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_ERROR_ADD_CONTENT_CONTAINER));
}
}

View File

@@ -47,7 +47,9 @@ public class ClosedCapabilityCondition extends AbstractCapabilityCondition
List<ChildAssociationRef> assocs = nodeService.getParentAssocs(nodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef assoc : assocs)
{
if (rmService.isRecordFolderClosed(assoc.getParentRef()) == true)
NodeRef parent = assoc.getParentRef();
if (rmService.isRecordFolder(parent) == true &&
rmService.isRecordFolderClosed(parent) == true)
{
result = true;
break;