mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
MNT-18806 create a new content bin for the copy on copy complete behavior
This commit is contained in:
@@ -143,6 +143,8 @@
|
|||||||
<property name="recordService" ref="RecordService" />
|
<property name="recordService" ref="RecordService" />
|
||||||
<property name="dispositionService" ref="DispositionService" />
|
<property name="dispositionService" ref="DispositionService" />
|
||||||
<property name="quickShareService" ref="QuickShareService"/>
|
<property name="quickShareService" ref="QuickShareService"/>
|
||||||
|
<property name="fileFolderService" ref="FileFolderService"/>
|
||||||
|
<property name="contentService" ref="ContentService"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="rma.recordComponentIdentifier" class="org.alfresco.module.org_alfresco_module_rm.model.rma.aspect.RecordComponentIdentifierAspect" parent="rm.baseBehaviour">
|
<bean id="rma.recordComponentIdentifier" class="org.alfresco.module.org_alfresco_module_rm.model.rma.aspect.RecordComponentIdentifierAspect" parent="rm.baseBehaviour">
|
||||||
|
@@ -51,9 +51,13 @@ import org.alfresco.repo.policy.annotation.BehaviourBean;
|
|||||||
import org.alfresco.repo.policy.annotation.BehaviourKind;
|
import org.alfresco.repo.policy.annotation.BehaviourKind;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
|
import org.alfresco.service.cmr.model.FileFolderService;
|
||||||
import org.alfresco.service.cmr.quickshare.QuickShareService;
|
import org.alfresco.service.cmr.quickshare.QuickShareService;
|
||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.alfresco.service.cmr.repository.ContentData;
|
import org.alfresco.service.cmr.repository.ContentData;
|
||||||
|
import org.alfresco.service.cmr.repository.ContentReader;
|
||||||
|
import org.alfresco.service.cmr.repository.ContentService;
|
||||||
|
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.ScriptService;
|
import org.alfresco.service.cmr.repository.ScriptService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
@@ -94,6 +98,12 @@ public class RecordAspect extends AbstractDisposableItem
|
|||||||
/** quickShare service */
|
/** quickShare service */
|
||||||
private QuickShareService quickShareService;
|
private QuickShareService quickShareService;
|
||||||
|
|
||||||
|
/** File folder service */
|
||||||
|
private FileFolderService fileFolderService;
|
||||||
|
|
||||||
|
/** Content service */
|
||||||
|
private ContentService contentService;
|
||||||
|
|
||||||
/** I18N */
|
/** I18N */
|
||||||
private static final String MSG_CANNOT_UPDATE_RECORD_CONTENT = "rm.service.update-record-content";
|
private static final String MSG_CANNOT_UPDATE_RECORD_CONTENT = "rm.service.update-record-content";
|
||||||
|
|
||||||
@@ -130,6 +140,24 @@ public class RecordAspect extends AbstractDisposableItem
|
|||||||
this.quickShareService = quickShareService;
|
this.quickShareService = quickShareService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param fileFolderService file folder service
|
||||||
|
*/
|
||||||
|
public void setFileFolderService(FileFolderService fileFolderService)
|
||||||
|
{
|
||||||
|
this.fileFolderService = fileFolderService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param contentService content service
|
||||||
|
*/
|
||||||
|
public void setContentService(ContentService contentService)
|
||||||
|
{
|
||||||
|
this.contentService = contentService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Behaviour to ensure renditions have the appropriate extended security.
|
* Behaviour to ensure renditions have the appropriate extended security.
|
||||||
*
|
*
|
||||||
@@ -358,6 +386,11 @@ public class RecordAspect extends AbstractDisposableItem
|
|||||||
{
|
{
|
||||||
// then remove any extended security from the newly copied record
|
// then remove any extended security from the newly copied record
|
||||||
extendedSecurityService.remove(targetNodeRef);
|
extendedSecurityService.remove(targetNodeRef);
|
||||||
|
|
||||||
|
//create a new content URL for the copy
|
||||||
|
ContentReader reader = fileFolderService.getReader(targetNodeRef);
|
||||||
|
ContentWriter writer = contentService.getWriter(targetNodeRef, ContentModel.PROP_CONTENT, true);
|
||||||
|
writer.putContent(reader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user