Merged V2.9 to HEAD

10561: Merged V2.2 to V2.9
      9882: Node DAO separation
   10580: Merged V2.2 to V2.9
      10576: Missing onContentDelete firing
      10577: More policies: beforeCreateNode and beforeDeleteNode when archiving nodes in hierarchy
         - Updated UsageService and TenantService to conform to the new node DAO (more separation)
         - TODO: Tenant node interceptor not present.  This must be added if Multi-Tentant features are required.
   - NodeMonitor event processing now checks that the nodes are still valid before processing.
   - onMove firing was breaking NodeMonitor.  Changed onMove to not fire when nodes are moved between stores.
   - Raised ALFCOM-1912: ClassCastException when accessing property of type ver2:versionNumber
   - Pull setFixedAcls fully into Node DAO for simpler and speedier execution


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10709 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-09-04 00:11:13 +00:00
parent 0876d67c4d
commit 3227355279
58 changed files with 4610 additions and 3230 deletions

View File

@@ -25,33 +25,26 @@
package org.alfresco.repo.node.index;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.search.Indexer;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Handles the node policy callbacks to ensure that the node hierarchy is properly
* indexed.
* Passes index information to the index services.
*
* @author Derek Hulley
*/
@SuppressWarnings("unused")
public class NodeIndexer
implements NodeServicePolicies.OnCreateNodePolicy,
NodeServicePolicies.OnUpdateNodePolicy,
NodeServicePolicies.OnDeleteNodePolicy,
NodeServicePolicies.OnCreateChildAssociationPolicy,
NodeServicePolicies.OnDeleteChildAssociationPolicy
{
/** the component to register the behaviour with */
private PolicyComponent policyComponent;
private static Log logger = LogFactory.getLog(NodeIndexer.class);
/** the component to index the node hierarchy */
private Indexer indexer;
private TenantService tenantService;
/** enabled or disabled */
private boolean enabled;
@@ -60,14 +53,6 @@ public class NodeIndexer
enabled = true;
}
/**
* @param policyComponent used for registrations
*/
public void setPolicyComponent(PolicyComponent policyComponent)
{
this.policyComponent = policyComponent;
}
/**
* @param indexer the indexer that will be index
*/
@@ -76,80 +61,64 @@ public class NodeIndexer
this.indexer = indexer;
}
public void setTenantService(TenantService tenantService)
{
this.tenantService = tenantService;
}
/* package */ void setEnabled(boolean enabled)
{
this.enabled = enabled;
}
/**
* Registers the policy behaviour methods
* @deprecated
*/
public void init()
{
policyComponent.bindClassBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateNode"),
this,
new JavaBehaviour(this, "onCreateNode"));
policyComponent.bindClassBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onUpdateNode"),
this,
new JavaBehaviour(this, "onUpdateNode"));
policyComponent.bindClassBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onDeleteNode"),
this,
new JavaBehaviour(this, "onDeleteNode"));
policyComponent.bindAssociationBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateChildAssociation"),
this,
new JavaBehaviour(this, "onCreateChildAssociation"));
policyComponent.bindAssociationBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onDeleteChildAssociation"),
this,
new JavaBehaviour(this, "onDeleteChildAssociation"));
logger.warn("NodeIndexer.init() has been deprecated.");
}
public void onCreateNode(ChildAssociationRef childAssocRef)
public void indexCreateNode(ChildAssociationRef childAssocRef)
{
if (enabled)
{
indexer.createNode(tenantService.getName(childAssocRef));
indexer.createNode(childAssocRef);
}
}
public void onUpdateNode(NodeRef nodeRef)
public void indexUpdateNode(NodeRef nodeRef)
{
if (enabled)
{
indexer.updateNode(tenantService.getName(nodeRef));
indexer.updateNode(nodeRef);
}
}
public void onDeleteNode(ChildAssociationRef childAssocRef, boolean isArchivedNode)
public void indexDeleteNode(ChildAssociationRef childAssocRef)
{
if (enabled)
{
indexer.deleteNode(tenantService.getName(childAssocRef));
indexer.deleteNode(childAssocRef);
}
}
public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNew)
{
if (!isNew && enabled)
{
indexer.createChildRelationship(tenantService.getName(childAssocRef));
}
}
public void onDeleteChildAssociation(ChildAssociationRef childAssocRef)
public void indexCreateChildAssociation(ChildAssociationRef childAssocRef)
{
if (enabled)
{
indexer.deleteChildRelationship(tenantService.getName(childAssocRef));
indexer.createChildRelationship(childAssocRef);
}
}
public void indexDeleteChildAssociation(ChildAssociationRef childAssocRef)
{
if (enabled)
{
indexer.deleteChildRelationship(childAssocRef);
}
}
public void indexUpdateChildAssociation(ChildAssociationRef oldChildAssocRef, ChildAssociationRef newChildAssocRef)
{
if (enabled)
{
indexer.updateChildRelationship(oldChildAssocRef, newChildAssocRef);
}
}
}