mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
MNT-22138: Document Filed to RM File Plan under categories with cut off retention schedule no longer accessible to non admin users in collab site
- Limited to certain code blocks to run as system.
This commit is contained in:
@@ -894,79 +894,70 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
|||||||
@Override
|
@Override
|
||||||
public boolean isNextDispositionActionEligible(NodeRef nodeRef)
|
public boolean isNextDispositionActionEligible(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
boolean result = false;
|
return authenticationUtil.runAsSystem(new RunAsWork<Boolean>()
|
||||||
// Get the disposition instructions
|
|
||||||
DispositionSchedule di = getDispositionSchedule(nodeRef);
|
|
||||||
DispositionAction nextDa = getNextDispositionAction(nodeRef);
|
|
||||||
if (di != null &&
|
|
||||||
this.nodeService.hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE) &&
|
|
||||||
nextDa != null)
|
|
||||||
{
|
{
|
||||||
// for accession step we can have also AND between step conditions
|
public Boolean doWork() throws Exception
|
||||||
Boolean combineSteps = false;
|
|
||||||
if (nextDa.getName().equals("accession"))
|
|
||||||
{
|
{
|
||||||
NodeRef accessionNodeRef = di.getDispositionActionDefinitionByName("accession").getNodeRef();
|
boolean result = false;
|
||||||
if (accessionNodeRef != null) {
|
// Get the disposition instructions
|
||||||
Boolean combineStepsProp = (Boolean)this.nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS);
|
DispositionSchedule di = getDispositionSchedule(nodeRef);
|
||||||
if (combineStepsProp != null)
|
DispositionAction nextDa = getNextDispositionAction(nodeRef);
|
||||||
{
|
if (di != null &&
|
||||||
combineSteps = combineStepsProp;
|
nodeService.hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE) &&
|
||||||
}
|
nextDa != null) {
|
||||||
}
|
// for accession step we can have also AND between step conditions
|
||||||
}
|
Boolean combineSteps = false;
|
||||||
Date asOf = (Date)this.nodeService.getProperty(nextDa.getNodeRef(), PROP_DISPOSITION_AS_OF);
|
if (nextDa.getName().equals("accession")) {
|
||||||
Boolean asOfDateInPast = false;
|
NodeRef accessionNodeRef = di.getDispositionActionDefinitionByName("accession").getNodeRef();
|
||||||
if (asOf != null)
|
if (accessionNodeRef != null) {
|
||||||
{
|
Boolean combineStepsProp = (Boolean) nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS);
|
||||||
asOfDateInPast = asOf.before(new Date());
|
if (combineStepsProp != null) {
|
||||||
}
|
combineSteps = combineStepsProp;
|
||||||
if (asOfDateInPast && !combineSteps)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if(!asOfDateInPast && combineSteps)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
DispositionAction da = new DispositionActionImpl(serviceRegistry, nextDa.getNodeRef());
|
|
||||||
DispositionActionDefinition dad = da.getDispositionActionDefinition();
|
|
||||||
if (dad != null)
|
|
||||||
{
|
|
||||||
boolean firstComplete = dad.eligibleOnFirstCompleteEvent();
|
|
||||||
|
|
||||||
List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(nextDa.getNodeRef(), ASSOC_EVENT_EXECUTIONS, RegexQNamePattern.MATCH_ALL);
|
|
||||||
for (ChildAssociationRef assoc : assocs)
|
|
||||||
{
|
|
||||||
NodeRef eventExecution = assoc.getChildRef();
|
|
||||||
Boolean isCompleteValue = (Boolean)this.nodeService.getProperty(eventExecution, PROP_EVENT_EXECUTION_COMPLETE);
|
|
||||||
boolean isComplete = false;
|
|
||||||
if (isCompleteValue != null)
|
|
||||||
{
|
|
||||||
isComplete = isCompleteValue.booleanValue();
|
|
||||||
|
|
||||||
// implement AND and OR combination of event completions
|
|
||||||
if (isComplete)
|
|
||||||
{
|
|
||||||
result = true;
|
|
||||||
if (firstComplete)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
Date asOf = (Date) nodeService.getProperty(nextDa.getNodeRef(), PROP_DISPOSITION_AS_OF);
|
||||||
result = false;
|
Boolean asOfDateInPast = false;
|
||||||
if (!firstComplete)
|
if (asOf != null) {
|
||||||
{
|
asOfDateInPast = asOf.before(new Date());
|
||||||
break;
|
}
|
||||||
|
if (asOfDateInPast && !combineSteps) {
|
||||||
|
return true;
|
||||||
|
} else if (!asOfDateInPast && combineSteps) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
DispositionAction da = new DispositionActionImpl(serviceRegistry, nextDa.getNodeRef());
|
||||||
|
DispositionActionDefinition dad = da.getDispositionActionDefinition();
|
||||||
|
if (dad != null) {
|
||||||
|
boolean firstComplete = dad.eligibleOnFirstCompleteEvent();
|
||||||
|
|
||||||
|
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(nextDa.getNodeRef(), ASSOC_EVENT_EXECUTIONS, RegexQNamePattern.MATCH_ALL);
|
||||||
|
for (ChildAssociationRef assoc : assocs) {
|
||||||
|
NodeRef eventExecution = assoc.getChildRef();
|
||||||
|
Boolean isCompleteValue = (Boolean) nodeService.getProperty(eventExecution, PROP_EVENT_EXECUTION_COMPLETE);
|
||||||
|
boolean isComplete = false;
|
||||||
|
if (isCompleteValue != null) {
|
||||||
|
isComplete = isCompleteValue.booleanValue();
|
||||||
|
|
||||||
|
// implement AND and OR combination of event completions
|
||||||
|
if (isComplete) {
|
||||||
|
result = true;
|
||||||
|
if (firstComplete) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result = false;
|
||||||
|
if (!firstComplete) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -510,12 +510,13 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
|
|||||||
// Set the indicators array
|
// Set the indicators array
|
||||||
setIndicators(rmNodeValues, nodeRef);
|
setIndicators(rmNodeValues, nodeRef);
|
||||||
|
|
||||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
|
// Set the actions array
|
||||||
@Override
|
setActions(rmNodeValues, nodeRef);
|
||||||
public Void doWork() {
|
|
||||||
|
|
||||||
// Set the actions array
|
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||||
setActions(rmNodeValues, nodeRef);
|
{
|
||||||
|
public Void doWork() throws Exception
|
||||||
|
{
|
||||||
|
|
||||||
//Add details of the next incomplete event in the disposition schedule
|
//Add details of the next incomplete event in the disposition schedule
|
||||||
if (dispositionService.getNextDispositionAction(nodeRef) != null)
|
if (dispositionService.getNextDispositionAction(nodeRef) != null)
|
||||||
@@ -525,9 +526,10 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
|
|||||||
if (!details.isEventComplete())
|
if (!details.isEventComplete())
|
||||||
{
|
{
|
||||||
HashMap properties = ((HashMap) rmNodeValues.get("properties"));
|
HashMap properties = ((HashMap) rmNodeValues.get("properties"));
|
||||||
properties.put("combineDispositionStepConditions", nodeService.getProperty(dispositionService.getNextDispositionAction(nodeRef).getDispositionActionDefinition().getNodeRef(), PROP_COMBINE_DISPOSITION_STEP_CONDITIONS));
|
properties.put("combineDispositionStepConditions", nodeService.getProperty(dispositionService.getNextDispositionAction(nodeRef).getDispositionActionDefinition().getNodeRef(), PROP_COMBINE_DISPOSITION_STEP_CONDITIONS));
|
||||||
properties.put("incompleteDispositionEvent", details.getEventName());
|
properties.put("incompleteDispositionEvent", details.getEventName());
|
||||||
properties.put("dispositionEventCombination", nodeService.getProperty(dispositionService.getNextDispositionAction(nodeRef).getDispositionActionDefinition().getNodeRef(), PROP_DISPOSITION_EVENT_COMBINATION));
|
properties.put("dispositionEventCombination", nodeService.getProperty(dispositionService.getNextDispositionAction(nodeRef).getDispositionActionDefinition().getNodeRef(), PROP_DISPOSITION_EVENT_COMBINATION));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user