mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -179,24 +179,24 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
|
|||||||
public void init()
|
public void init()
|
||||||
{
|
{
|
||||||
// Register the association behaviours
|
// Register the association behaviours
|
||||||
this.policyComponent.bindAssociationBehaviour(
|
policyComponent.bindAssociationBehaviour(
|
||||||
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
|
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
|
||||||
TYPE_RECORD_FOLDER,
|
TYPE_RECORD_FOLDER,
|
||||||
ContentModel.ASSOC_CONTAINS,
|
ContentModel.ASSOC_CONTAINS,
|
||||||
new JavaBehaviour(this, "onFileContent", NotificationFrequency.TRANSACTION_COMMIT));
|
new JavaBehaviour(this, "onFileContent", NotificationFrequency.TRANSACTION_COMMIT));
|
||||||
|
|
||||||
this.policyComponent.bindAssociationBehaviour(
|
policyComponent.bindAssociationBehaviour(
|
||||||
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
|
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
|
||||||
TYPE_FILE_PLAN,
|
TYPE_FILE_PLAN,
|
||||||
ContentModel.ASSOC_CONTAINS,
|
ContentModel.ASSOC_CONTAINS,
|
||||||
new JavaBehaviour(this, "onAddContentToContainer", NotificationFrequency.EVERY_EVENT));
|
new JavaBehaviour(this, "onAddContentToContainer", NotificationFrequency.EVERY_EVENT));
|
||||||
this.policyComponent.bindAssociationBehaviour(
|
policyComponent.bindAssociationBehaviour(
|
||||||
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
|
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
|
||||||
TYPE_RECORD_CATEGORY,
|
TYPE_RECORD_CATEGORY,
|
||||||
ContentModel.ASSOC_CONTAINS,
|
ContentModel.ASSOC_CONTAINS,
|
||||||
new JavaBehaviour(this, "onAddContentToContainer", NotificationFrequency.EVERY_EVENT));
|
new JavaBehaviour(this, "onAddContentToContainer", NotificationFrequency.EVERY_EVENT));
|
||||||
|
|
||||||
policyComponent.bindAssociationBehaviour(
|
policyComponent.bindAssociationBehaviour(
|
||||||
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
|
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
|
||||||
ASPECT_RECORD,
|
ASPECT_RECORD,
|
||||||
RenditionModel.ASSOC_RENDITION,
|
RenditionModel.ASSOC_RENDITION,
|
||||||
@@ -204,7 +204,7 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Register script execution behaviour on RM property update.
|
// 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,
|
ASPECT_FILE_PLAN_COMPONENT,
|
||||||
new JavaBehaviour(this, "onChangeToAnyRmProperty", NotificationFrequency.TRANSACTION_COMMIT));
|
new JavaBehaviour(this, "onChangeToAnyRmProperty", NotificationFrequency.TRANSACTION_COMMIT));
|
||||||
|
|
||||||
@@ -266,14 +266,10 @@ public class RecordsManagementServiceImpl implements RecordsManagementService,
|
|||||||
*/
|
*/
|
||||||
public void onAddContentToContainer(ChildAssociationRef childAssocRef, boolean bNew)
|
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());
|
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_ERROR_ADD_CONTENT_CONTAINER));
|
||||||
|
|
||||||
if(childType.equals(ContentModel.TYPE_CONTENT))
|
|
||||||
{
|
|
||||||
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_ERROR_ADD_CONTENT_CONTAINER));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,7 +47,9 @@ public class ClosedCapabilityCondition extends AbstractCapabilityCondition
|
|||||||
List<ChildAssociationRef> assocs = nodeService.getParentAssocs(nodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
|
List<ChildAssociationRef> assocs = nodeService.getParentAssocs(nodeRef, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
|
||||||
for (ChildAssociationRef assoc : assocs)
|
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;
|
result = true;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user