mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-1280: It's possible to create a folder in the root of File Plan via FTP/CIFS/WebDav/NFS
RM-1281: Not possible to create folders in Categories via FTP/CIFS/WebDav/NFS git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.1@63128 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
parent="org_alfresco_module_rm_BaseBehaviour">
|
||||
<property name="dictionaryService" ref="DictionaryService"/>
|
||||
<property name="recordsManagementIdentifierService" ref="recordsManagementIdentifierService"/>
|
||||
<property name="recordFolderService" ref="recordFolderService" />
|
||||
</bean>
|
||||
|
||||
<bean id="org_alfresco_module_rm_RmSiteType"
|
||||
|
@@ -21,10 +21,11 @@ package org.alfresco.module.org_alfresco_module_rm.model.behaviour;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderServiceImpl;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
||||
import org.alfresco.repo.policy.JavaBehaviour;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
@@ -55,6 +56,9 @@ public class RecordContainerType implements RecordsManagementModel,
|
||||
/** Identity service */
|
||||
private IdentifierService recordsManagementIdentifierService;
|
||||
|
||||
/** record folder service */
|
||||
private RecordFolderServiceImpl recordFolderService;
|
||||
|
||||
/**
|
||||
* Set the policy component
|
||||
* @param policyComponent policy component
|
||||
@@ -94,6 +98,14 @@ public class RecordContainerType implements RecordsManagementModel,
|
||||
this.recordsManagementIdentifierService = recordsManagementIdentifierService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordFolderService record folder service
|
||||
*/
|
||||
public void setRecordFolderService(RecordFolderServiceImpl recordFolderService)
|
||||
{
|
||||
this.recordFolderService = recordFolderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bean initialisation method
|
||||
*/
|
||||
@@ -141,10 +153,21 @@ public class RecordContainerType implements RecordsManagementModel,
|
||||
// This occurs if the RM folder has been created via IMap, WebDav, etc
|
||||
if (nodeService.hasAspect(child, ASPECT_FILE_PLAN_COMPONENT) == false)
|
||||
{
|
||||
// TODO it may not always be a record folder ... perhaps if the current user is a admin it would be a record category??
|
||||
// check the type of the parent to determine what 'kind' of artifact to create
|
||||
NodeRef parent = childAssocRef.getParentRef();
|
||||
QName parentType = nodeService.getType(parent);
|
||||
|
||||
// Assume any created folder is a rma:recordFolder
|
||||
if (dictionaryService.isSubClass(parentType, TYPE_FILE_PLAN))
|
||||
{
|
||||
// create a rma:recordCategoty since we are in the root of the file plan
|
||||
nodeService.setType(child, TYPE_RECORD_CATEGORY);
|
||||
}
|
||||
else
|
||||
{
|
||||
// create a rma:recordFolder and initialise record folder
|
||||
nodeService.setType(child, TYPE_RECORD_FOLDER);
|
||||
recordFolderService.initialiseRecordFolder(child);
|
||||
}
|
||||
}
|
||||
|
||||
// Catch all to generate the rm id (assuming it doesn't already have one!)
|
||||
|
@@ -99,7 +99,7 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
|
||||
public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean bNew)
|
||||
{
|
||||
NodeRef nodeRef = childAssocRef.getChildRef();
|
||||
if (nodeService.exists(nodeRef) == true)
|
||||
if (nodeService.exists(nodeRef) == true && instanceOf(nodeRef, TYPE_RECORD_FOLDER))
|
||||
{
|
||||
initialiseRecordFolder(nodeRef);
|
||||
}
|
||||
|
Reference in New Issue
Block a user