mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -22,6 +22,8 @@
|
||||
<value>classpath:alfresco/repository.properties</value>
|
||||
<value>classpath:alfresco/domain/transaction.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 -->
|
||||
<value>classpath*:alfresco-global.properties</value>
|
||||
</list>
|
||||
|
@@ -792,6 +792,8 @@
|
||||
|
||||
<aspect name="cm:workingcopy">
|
||||
<title>Working Copy</title>
|
||||
<!-- Explicitly turn off archiving for all nodes with this aspect -->
|
||||
<archive>false</archive>
|
||||
<properties>
|
||||
<property name="cm:workingCopyOwner">
|
||||
<type>d:text</type>
|
||||
|
@@ -143,6 +143,8 @@
|
||||
<!-- aspect to tag temporary nodes -->
|
||||
<aspect name="sys:temporary">
|
||||
<title>Temporary</title>
|
||||
<!-- Explicitly turn off archiving for all nodes with this aspect -->
|
||||
<archive>false</archive>
|
||||
</aspect>
|
||||
|
||||
<!-- details stored on archived nodes -->
|
||||
|
@@ -312,7 +312,7 @@ import org.alfresco.service.namespace.QName;
|
||||
if (parentClass != null && archive == null)
|
||||
{
|
||||
// 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()
|
||||
{
|
||||
if (archive == null)
|
||||
{
|
||||
if (inheritedArchive != null)
|
||||
{
|
||||
return inheritedArchive.booleanValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
// default to false
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return archive;
|
||||
Boolean isArchive = getArchive();
|
||||
return isArchive == null ? isAspect() : isArchive.booleanValue();
|
||||
}
|
||||
|
||||
protected Boolean getArchive()
|
||||
{
|
||||
return archive == null ? inheritedArchive : archive;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@@ -93,8 +93,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
private static Log loggerPaths = LogFactory.getLog(DbNodeServiceImpl.class.getName() + ".paths");
|
||||
|
||||
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 NodeService avmNodeService;
|
||||
private NodeIndexer nodeIndexer;
|
||||
@@ -745,24 +743,35 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
Set<QName> nodeAspectQNames = nodeDaoService.getNodeAspects(nodeId);
|
||||
|
||||
// check if we need to archive the node
|
||||
StoreRef archiveStoreRef = null;
|
||||
if (nodeAspectQNames.contains(ContentModel.ASPECT_TEMPORARY) ||
|
||||
nodeAspectQNames.contains(ContentModel.ASPECT_WORKING_COPY))
|
||||
StoreRef storeRef = nodeRef.getStoreRef();
|
||||
StoreRef archiveStoreRef = storeArchiveMap.get(storeRef);
|
||||
|
||||
if (archiveStoreRef == null)
|
||||
{
|
||||
// The node is either temporary or a working copy.
|
||||
// It can not be archived.
|
||||
requiresDelete = true;
|
||||
requiresDelete = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
StoreRef storeRef = nodeRef.getStoreRef();
|
||||
archiveStoreRef = storeArchiveMap.get(storeRef);
|
||||
// get the type and check if we need archiving
|
||||
TypeDefinition typeDef = dictionaryService.getType(nodeTypeQName);
|
||||
if (typeDef == null || !typeDef.isArchive() || archiveStoreRef == null)
|
||||
{
|
||||
requiresDelete = true;
|
||||
}
|
||||
// get the type and check if we need archiving.
|
||||
TypeDefinition typeDef = dictionaryService.getType(nodeTypeQName);
|
||||
if (typeDef == null || !typeDef.isArchive())
|
||||
{
|
||||
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)
|
||||
|
Reference in New Issue
Block a user