mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge branch 'feature/RM-5244_IncompleteAspectLeftBehind' into 'master'
RM-5244 - make sure the incomplete node tagger is run after the record aspect is added (workaround) See merge request !317
This commit is contained in:
@@ -1075,6 +1075,7 @@
|
|||||||
<property name="dispositionService" ref="DispositionService"/>
|
<property name="dispositionService" ref="DispositionService"/>
|
||||||
<property name="recordableVersionService" ref="RecordableVersionService"/>
|
<property name="recordableVersionService" ref="RecordableVersionService"/>
|
||||||
<property name="alwaysEditURIs" ref="recordService_alwaysEditURIs" />
|
<property name="alwaysEditURIs" ref="recordService_alwaysEditURIs" />
|
||||||
|
<property name="incompleteNodeTagger" ref="incompleteNodeTagger" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- Defines a list of namespace URIs for properties, which should be always editable -->
|
<!-- Defines a list of namespace URIs for properties, which should be always editable -->
|
||||||
|
@@ -80,6 +80,7 @@ import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionModel
|
|||||||
import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionService;
|
import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionService;
|
||||||
import org.alfresco.repo.content.ContentServicePolicies;
|
import org.alfresco.repo.content.ContentServicePolicies;
|
||||||
import org.alfresco.repo.node.NodeServicePolicies;
|
import org.alfresco.repo.node.NodeServicePolicies;
|
||||||
|
import org.alfresco.repo.node.integrity.IncompleteNodeTagger;
|
||||||
import org.alfresco.repo.policy.ClassPolicyDelegate;
|
import org.alfresco.repo.policy.ClassPolicyDelegate;
|
||||||
import org.alfresco.repo.policy.PolicyComponent;
|
import org.alfresco.repo.policy.PolicyComponent;
|
||||||
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
||||||
@@ -270,6 +271,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
private ClassPolicyDelegate<BeforeRecordRejection> beforeRecordRejectionDelegate;
|
private ClassPolicyDelegate<BeforeRecordRejection> beforeRecordRejectionDelegate;
|
||||||
private ClassPolicyDelegate<OnRecordRejection> onRecordRejectionDelegate;
|
private ClassPolicyDelegate<OnRecordRejection> onRecordRejectionDelegate;
|
||||||
|
|
||||||
|
private IncompleteNodeTagger incompleteNodeTagger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param identifierService identifier service
|
* @param identifierService identifier service
|
||||||
*/
|
*/
|
||||||
@@ -414,6 +417,11 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
this.recordableVersionService = recordableVersionService;
|
this.recordableVersionService = recordableVersionService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setIncompleteNodeTagger(IncompleteNodeTagger incompleteNodeTagger)
|
||||||
|
{
|
||||||
|
this.incompleteNodeTagger = incompleteNodeTagger;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init method
|
* Init method
|
||||||
*/
|
*/
|
||||||
@@ -448,6 +456,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
if (nodeService.exists(nodeRef) && nodeService.hasAspect(nodeRef, ASPECT_RECORD))
|
if (nodeService.exists(nodeRef) && nodeService.hasAspect(nodeRef, ASPECT_RECORD))
|
||||||
{
|
{
|
||||||
generateRecordIdentifier(nodeService, identifierService, nodeRef);
|
generateRecordIdentifier(nodeService, identifierService, nodeRef);
|
||||||
|
reevaluateIncompleteTag(nodeRef);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -471,6 +480,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
if (ContentData.hasContent(contentData) && contentData.getSize() > 0)
|
if (ContentData.hasContent(contentData) && contentData.getSize() > 0)
|
||||||
{
|
{
|
||||||
appendIdentifierToName(nodeService, nodeRef);
|
appendIdentifierToName(nodeService, nodeRef);
|
||||||
|
reevaluateIncompleteTag(nodeRef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1835,6 +1845,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
if (nodeService.exists(nodeRef) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_HIDDEN) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCKABLE))
|
if (nodeService.exists(nodeRef) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_HIDDEN) && !nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCKABLE))
|
||||||
{
|
{
|
||||||
generateRecordIdentifier(nodeService, identifierService, nodeRef);
|
generateRecordIdentifier(nodeService, identifierService, nodeRef);
|
||||||
|
reevaluateIncompleteTag(nodeRef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1893,4 +1904,22 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
|||||||
OnRecordRejection policy = onRecordRejectionDelegate.get(qnames);
|
OnRecordRejection policy = onRecordRejectionDelegate.get(qnames);
|
||||||
policy.onRecordRejection(nodeRef);
|
policy.onRecordRejection(nodeRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RM-5244 - workaround to make sure the incomplete aspect is removed
|
||||||
|
*
|
||||||
|
* @param nodeRef the node to reevaluate for
|
||||||
|
*/
|
||||||
|
private void reevaluateIncompleteTag(NodeRef nodeRef)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Check if the node has the aspect because the reevaluation is expensive.
|
||||||
|
* If the node doesn't have the aspect it means IncompleteNodeTagger didn't load before TransactionBehaviourQueue
|
||||||
|
* and we don't need to reevaluate.
|
||||||
|
*/
|
||||||
|
if(nodeService.hasAspect(nodeRef, ContentModel.ASPECT_INCOMPLETE))
|
||||||
|
{
|
||||||
|
incompleteNodeTagger.beforeCommit(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user