mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V1.3 to HEAD(3161:3179)
svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3161 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3179 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3406 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -645,10 +645,11 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
|
||||
public void deleteNode(NodeRef nodeRef)
|
||||
{
|
||||
boolean isArchivedNode = false;
|
||||
boolean isArchivedNode = false;
|
||||
boolean requiresDelete = false;
|
||||
|
||||
// Invoke policy behaviours
|
||||
invokeBeforeDeleteNode(nodeRef);
|
||||
// Invoke policy behaviours
|
||||
invokeBeforeDeleteNode(nodeRef);
|
||||
|
||||
// get the node
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
@@ -659,11 +660,27 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
Set<QName> nodeAspectQNames = node.getAspects();
|
||||
|
||||
// check if we need to archive the node
|
||||
StoreRef storeRef = nodeRef.getStoreRef();
|
||||
StoreRef archiveStoreRef = storeArchiveMap.getArchiveMap().get(storeRef);
|
||||
// get the type and check if we need archiving
|
||||
TypeDefinition typeDef = dictionaryService.getType(node.getTypeQName());
|
||||
if (typeDef == null || !typeDef.isArchive() || archiveStoreRef == null)
|
||||
StoreRef archiveStoreRef = null;
|
||||
if (nodeAspectQNames.contains(ContentModel.ASPECT_TEMPORARY))
|
||||
{
|
||||
// the node has the temporary aspect meaning
|
||||
// it can not be archived
|
||||
requiresDelete = true;
|
||||
isArchivedNode = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
StoreRef storeRef = nodeRef.getStoreRef();
|
||||
archiveStoreRef = storeArchiveMap.getArchiveMap().get(storeRef);
|
||||
// get the type and check if we need archiving
|
||||
TypeDefinition typeDef = dictionaryService.getType(node.getTypeQName());
|
||||
if (typeDef == null || !typeDef.isArchive() || archiveStoreRef == null)
|
||||
{
|
||||
requiresDelete = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (requiresDelete)
|
||||
{
|
||||
// perform a normal deletion
|
||||
nodeDaoService.deleteNode(node, true);
|
||||
|
Reference in New Issue
Block a user