mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-623: Unable to rename record folder
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@47783 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -236,37 +236,4 @@
|
||||
</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Site Service -->
|
||||
|
||||
<!-- <bean id="siteService" class="org.alfresco.repo.site.ExtendedSiteServiceImpl" init-method="init">
|
||||
<property name="nodeService" ref="NodeService"/>
|
||||
<property name="directNodeService" ref="nodeService"/>
|
||||
<property name="fileFolderService" ref="FileFolderService"/>
|
||||
<property name="searchService" ref="SearchService"/>
|
||||
<property name="namespaceService" ref="NamespaceService"/>
|
||||
<property name="permissionService" ref="PermissionService"/>
|
||||
<property name="authenticationContext" ref="authenticationContext"/>
|
||||
<property name="personService" ref="PersonService"/>
|
||||
<property name="activityService" ref="activityService"/>
|
||||
<property name="taggingService" ref="TaggingService"/>
|
||||
<property name="authorityService" ref="authorityService"/>
|
||||
<property name="dictionaryService" ref="DictionaryService"/>
|
||||
<property name="tenantAdminService" ref="tenantAdminService"/>
|
||||
<property name="transactionHelper" ref="retryingTransactionHelper"/>
|
||||
<property name="sitesXPath">
|
||||
<value>./${spaces.company_home.childname}/st:sites</value>
|
||||
</property>
|
||||
<property name="tenantService" ref="tenantService"/>
|
||||
<property name="roleComparator" ref="siteRoleComparator" />
|
||||
<property name="sysAdminParams" ref="sysAdminParams"/>
|
||||
<property name="behaviourFilter" ref="policyBehaviourFilter" />
|
||||
<property name="sitesPermissionsCleaner" ref="sitesPermissionsCleaner"/>
|
||||
<property name="cannedQueryRegistry" ref="siteCannedQueryRegistry"/>
|
||||
<property name="policyComponent" ref="policyComponent"/>
|
||||
<property name="publicServiceAccessService" ref="PublicServiceAccessService" />
|
||||
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
</bean>
|
||||
-->
|
||||
</beans>
|
@@ -119,22 +119,26 @@ public class RecordCopyBehaviours implements RecordsManagementModel
|
||||
*/
|
||||
public void onMoveRecordNode(ChildAssociationRef oldChildAssocRef, ChildAssociationRef newChildAssocRef)
|
||||
{
|
||||
final NodeRef newNodeRef = newChildAssocRef.getChildRef();
|
||||
final NodeService nodeService = rmServiceRegistry.getNodeService();
|
||||
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
||||
// check the records parent has actually changed
|
||||
if (oldChildAssocRef.getParentRef().equals(newChildAssocRef.getParentRef()) == false)
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
final NodeRef newNodeRef = newChildAssocRef.getChildRef();
|
||||
final NodeService nodeService = rmServiceRegistry.getNodeService();
|
||||
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
||||
{
|
||||
if (nodeService.exists(newNodeRef) == true)
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
// Remove unwanted aspects
|
||||
removeUnwantedAspects(nodeService, newNodeRef);
|
||||
if (nodeService.exists(newNodeRef) == true)
|
||||
{
|
||||
// Remove unwanted aspects
|
||||
removeUnwantedAspects(nodeService, newNodeRef);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}, AuthenticationUtil.getAdminUserName());
|
||||
}, AuthenticationUtil.getAdminUserName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,40 +150,43 @@ public class RecordCopyBehaviours implements RecordsManagementModel
|
||||
@SuppressWarnings("unused")
|
||||
public void onMoveRecordFolderNode(ChildAssociationRef oldChildAssocRef, ChildAssociationRef newChildAssocRef)
|
||||
{
|
||||
final NodeRef newNodeRef = newChildAssocRef.getChildRef();
|
||||
final NodeService nodeService = rmServiceRegistry.getNodeService();
|
||||
final RecordsManagementService rmService = rmServiceRegistry.getRecordsManagementService();
|
||||
final RecordsManagementActionService rmActionService = rmServiceRegistry.getRecordsManagementActionService();
|
||||
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
if (oldChildAssocRef.getParentRef().equals(newChildAssocRef.getParentRef()) == false)
|
||||
{
|
||||
final NodeRef newNodeRef = newChildAssocRef.getChildRef();
|
||||
final NodeService nodeService = rmServiceRegistry.getNodeService();
|
||||
final RecordsManagementService rmService = rmServiceRegistry.getRecordsManagementService();
|
||||
final RecordsManagementActionService rmActionService = rmServiceRegistry.getRecordsManagementActionService();
|
||||
|
||||
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
|
||||
{
|
||||
if (nodeService.exists(newNodeRef) == true)
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
// Remove unwanted aspects
|
||||
removeUnwantedAspects(nodeService, newNodeRef);
|
||||
if (nodeService.exists(newNodeRef) == true)
|
||||
{
|
||||
// Remove unwanted aspects
|
||||
removeUnwantedAspects(nodeService, newNodeRef);
|
||||
|
||||
// TODO .. this isn't right!!
|
||||
// .. what if the folder is in motion .. do we really want to lose all the disposition information?
|
||||
// .. how do we merge from one disposition schedule to another
|
||||
// .. for now throw unsupportedOperationException and refactor when considered
|
||||
throw new UnsupportedOperationException("Moving a record folder is currently not supported.");
|
||||
|
||||
// // Trigger folder setup
|
||||
// rmActionService.executeRecordsManagementAction(newNodeRef, "setupRecordFolder");
|
||||
//
|
||||
// // Sort out the child records
|
||||
// for (NodeRef record : rmService.getRecords(newNodeRef))
|
||||
// {
|
||||
// removeUnwantedAspects(nodeService, record);
|
||||
// rmActionService.executeRecordsManagementAction(record, "file");
|
||||
// }
|
||||
}
|
||||
|
||||
// TODO .. this isn't right!!
|
||||
// .. what if the folder is in motion .. do we really want to lose all the disposition information?
|
||||
// .. how do we merge from one disposition schedule to another
|
||||
// .. for now throw unsupportedOperationException and refactor when considered
|
||||
throw new UnsupportedOperationException("Moving a record folder is currently not supported.");
|
||||
|
||||
// // Trigger folder setup
|
||||
// rmActionService.executeRecordsManagementAction(newNodeRef, "setupRecordFolder");
|
||||
//
|
||||
// // Sort out the child records
|
||||
// for (NodeRef record : rmService.getRecords(newNodeRef))
|
||||
// {
|
||||
// removeUnwantedAspects(nodeService, record);
|
||||
// rmActionService.executeRecordsManagementAction(record, "file");
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}, AuthenticationUtil.getAdminUserName());
|
||||
}, AuthenticationUtil.getAdminUserName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user