Merged V3.4-BUG-FIX

30520: Revisited timestamp propagation (cm:modified) now that the system does this by default
          - Original low-level code (Hibernate optimizations) pulled back into NodeService implementation
          - Use case driven prompting to touch the parent node
          - Full indexing and policy callbacks against parent (was missing completely)
          - Optimizations to ensure parent node modifications are only done where required and
            the same transaction is used where possible
          - 1s accuracy limit is maintained to prevent unnecessary modifications
          - Enhanced tests to cover use cases where propagation is expected
            - ALF-10262: Timestamp propagation is enabled by default
          - Fixes or will fix:
            - ALF-10291: Test disabled: SOLRTrackingComponentTest (various)
            - ALF-7433: A file deleted using the web UI still appears in a NFS mount but with NULL stats
            - ALF-10271: Test disabled: ArchiveAndRestoreTest.testAR7889ArchiveAndRestoreMustNotModifyAuditable
            - ALF-10267: Test disabled: NodeServiceTest.testArchiveAndRestore
         Also
          - Found problem where cm:auditable properties could be modified directly against the cached values
          - Extended locking of cached entities to the AuditablePropertiesEntity


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30598 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2011-09-19 11:30:56 +00:00
parent 5e3cb4cb96
commit fb406b769b
14 changed files with 606 additions and 683 deletions

View File

@@ -20,6 +20,7 @@ package org.alfresco.repo.domain.node;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -68,7 +69,9 @@ public interface NodeDAO extends NodeBulkLoader
/**
*
* @return Returns the ID of the current transaction entry
* @return Returns the ID of the current transaction entry or <tt>null</tt> if
* there have not been any modifications to nodes registered in the
* transaction
*/
public Long getCurrentTransactionId();
@@ -123,6 +126,13 @@ public interface NodeDAO extends NodeBulkLoader
public boolean exists(NodeRef nodeRef);
public boolean exists(Long nodeId);
/**
* @return Returns <tt>true</tt> if the node was last modified in the current
* transaction, otherwise <tt>false</tt>.
* @throws InvalidNodeRefException if there is no record of the node, past or present
*/
public boolean isInCurrentTxn(Long nodeId);
/**
* Get the current status of the node, including deleted nodes.
*
@@ -192,9 +202,9 @@ public interface NodeDAO extends NodeBulkLoader
/**
* @param nodeTypeQName the new type QName for the node or <tt>null</tt> to keep the existing one
* @param nodeLocale the new locale for the node or <tt>null</tt> to keep the existing one
* @param propagate should this update be propagated to parent audit properties?
* @return <tt>true</tt> if any changes were made
*/
public void updateNode(Long nodeId, QName nodeTypeQName, Locale nodeLocale, boolean propagate);
public boolean updateNode(Long nodeId, QName nodeTypeQName, Locale nodeLocale);
public void setNodeAclId(Long nodeId, Long aclId);
@@ -233,6 +243,17 @@ public interface NodeDAO extends NodeBulkLoader
public boolean removeNodeProperties(Long nodeId, Set<QName> propertyQNames);
/**
* Pull the <b>cm:modified</b> up to the current time without changing any other
* <b>cm:auditable</b> properties. The change may be done in the current transaction
* or in a later transaction.
*
* @param nodeId the node to change
* @param modifiedDate the date to set for <b>cm:modified</b>
* @return Returns <tt>true</tt> if the <b>cm:modified</b> property was actually set
*/
public boolean setModifiedDate(Long nodeId, Date date);
/*
* Aspects
*/