MOB-1073: RM Ghosted Records

- The <archive> setting on model class definitions (controlling archival on node deletion) is now paid attention to for aspects as well as types
- Archive is on by default for aspects and off by default for types
- If a node's type or any of its aspects has archiving off then it will be purged rather than archived
- Only the cm:content and cm:folder types currently have archiving switched on
- RM subtypes of cm:content and cm:folder plus rm:record aspect switch off archiving
- A module can now include global property overrides in classpath*:alfresco/module/*/alfresco-global.properties
- The RM module currently sets two global properties:
   system.content.eagerOrphanCleanup=true # Switches on synchronous content purging
   rm.ghosting.enabled=true               # Enables the new RM ghosting functionality
- When ghosting is switched on, for nodes with the rma:record aspect the DestroyAction synchronously removes all content properties and applies the rma:ghosted aspect
- TODO: Any properties required for rma:ghosted?


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@15990 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2009-08-28 15:26:15 +00:00
parent d5a1794c18
commit 7fbccecd71
5 changed files with 40 additions and 31 deletions

View File

@@ -22,6 +22,8 @@
<value>classpath:alfresco/repository.properties</value> <value>classpath:alfresco/repository.properties</value>
<value>classpath:alfresco/domain/transaction.properties</value> <value>classpath:alfresco/domain/transaction.properties</value>
<!-- <value>classpath:alfresco/jndi.properties</value> --> <!-- <value>classpath:alfresco/jndi.properties</value> -->
<!-- Overrides supplied by modules -->
<value>classpath*:alfresco/module/*/alfresco-global.properties</value>
<!-- Installer or user-provided defaults --> <!-- Installer or user-provided defaults -->
<value>classpath*:alfresco-global.properties</value> <value>classpath*:alfresco-global.properties</value>
</list> </list>

View File

@@ -792,6 +792,8 @@
<aspect name="cm:workingcopy"> <aspect name="cm:workingcopy">
<title>Working Copy</title> <title>Working Copy</title>
<!-- Explicitly turn off archiving for all nodes with this aspect -->
<archive>false</archive>
<properties> <properties>
<property name="cm:workingCopyOwner"> <property name="cm:workingCopyOwner">
<type>d:text</type> <type>d:text</type>

View File

@@ -143,6 +143,8 @@
<!-- aspect to tag temporary nodes --> <!-- aspect to tag temporary nodes -->
<aspect name="sys:temporary"> <aspect name="sys:temporary">
<title>Temporary</title> <title>Temporary</title>
<!-- Explicitly turn off archiving for all nodes with this aspect -->
<archive>false</archive>
</aspect> </aspect>
<!-- details stored on archived nodes --> <!-- details stored on archived nodes -->

View File

@@ -312,7 +312,7 @@ import org.alfresco.service.namespace.QName;
if (parentClass != null && archive == null) if (parentClass != null && archive == null)
{ {
// archive not explicitly set on this class and there is a parent class // archive not explicitly set on this class and there is a parent class
inheritedArchive = ((M2ClassDefinition)parentClass).isArchive(); inheritedArchive = ((M2ClassDefinition)parentClass).getArchive();
} }
} }
@@ -375,23 +375,17 @@ import org.alfresco.service.namespace.QName;
} }
/** /**
* @return Returns the archive flag, which defaults to <tt>false</tt> * @return Returns the archive flag, which defaults to <tt>true</tt> for aspects and <tt>false</tt> for other classes
*/ */
public boolean isArchive() public boolean isArchive()
{ {
if (archive == null) Boolean isArchive = getArchive();
{ return isArchive == null ? isAspect() : isArchive.booleanValue();
if (inheritedArchive != null) }
{
return inheritedArchive.booleanValue(); protected Boolean getArchive()
} {
else return archive == null ? inheritedArchive : archive;
{
// default to false
return false;
}
}
return archive;
} }
/* (non-Javadoc) /* (non-Javadoc)

View File

@@ -93,8 +93,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
private static Log loggerPaths = LogFactory.getLog(DbNodeServiceImpl.class.getName() + ".paths"); private static Log loggerPaths = LogFactory.getLog(DbNodeServiceImpl.class.getName() + ".paths");
private NodeDaoService nodeDaoService; private NodeDaoService nodeDaoService;
/** A set of aspects, the presence of which indicate that nodes must not be archived */
private Set<QName> ignoreArchiveAspects;
private StoreArchiveMap storeArchiveMap; private StoreArchiveMap storeArchiveMap;
private NodeService avmNodeService; private NodeService avmNodeService;
private NodeIndexer nodeIndexer; private NodeIndexer nodeIndexer;
@@ -745,24 +743,35 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
Set<QName> nodeAspectQNames = nodeDaoService.getNodeAspects(nodeId); Set<QName> nodeAspectQNames = nodeDaoService.getNodeAspects(nodeId);
// check if we need to archive the node // check if we need to archive the node
StoreRef archiveStoreRef = null; StoreRef storeRef = nodeRef.getStoreRef();
if (nodeAspectQNames.contains(ContentModel.ASPECT_TEMPORARY) || StoreRef archiveStoreRef = storeArchiveMap.get(storeRef);
nodeAspectQNames.contains(ContentModel.ASPECT_WORKING_COPY))
if (archiveStoreRef == null)
{ {
// The node is either temporary or a working copy. requiresDelete = true;
// It can not be archived.
requiresDelete = true;
} }
else else
{ {
StoreRef storeRef = nodeRef.getStoreRef(); // get the type and check if we need archiving.
archiveStoreRef = storeArchiveMap.get(storeRef); TypeDefinition typeDef = dictionaryService.getType(nodeTypeQName);
// get the type and check if we need archiving if (typeDef == null || !typeDef.isArchive())
TypeDefinition typeDef = dictionaryService.getType(nodeTypeQName); {
if (typeDef == null || !typeDef.isArchive() || archiveStoreRef == null) requiresDelete = true;
{ }
requiresDelete = true; else
} {
// If the type wants archiving, check whether any applied aspects have explicitly turned off the
// archive flag
for (QName nodeAspectQName : nodeAspectQNames)
{
typeDef = dictionaryService.getType(nodeAspectQName);
if (typeDef != null && !typeDef.isArchive())
{
requiresDelete = true;
break;
}
}
}
} }
if (requiresDelete) if (requiresDelete)