RM: prevent publication of changes if node no longer exists

* fix occasional build failure



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@54106 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-08-15 06:57:48 +00:00
parent 08f4bddd65
commit 0438a8e6ad

View File

@@ -97,37 +97,40 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter
// Deal with each updated disposition action in turn // Deal with each updated disposition action in turn
for (NodeRef nodeRef : nodeRefs) for (NodeRef nodeRef : nodeRefs)
{ {
// Mark the update node as publishing in progress if (nodeService.exists(nodeRef) == true)
markPublishInProgress(nodeRef);
try
{ {
Date start = new Date(); // Mark the update node as publishing in progress
if (logger.isDebugEnabled() == true) markPublishInProgress(nodeRef);
try
{ {
logger.debug("Starting publish of updates ..."); Date start = new Date();
logger.debug(" - for " + nodeRef.toString()); if (logger.isDebugEnabled() == true)
logger.debug(" - at " + start.toString()); {
logger.debug("Starting publish of updates ...");
logger.debug(" - for " + nodeRef.toString());
logger.debug(" - at " + start.toString());
}
// Publish updates
publishUpdates(nodeRef);
if (logger.isDebugEnabled() == true)
{
Date end = new Date();
long duration = end.getTime() - start.getTime();
logger.debug("Completed publish of updates ...");
logger.debug(" - for " + nodeRef.toString());
logger.debug(" - at " + end.toString());
logger.debug(" - duration " + Long.toString(duration));
}
} }
finally
// Publish updates
publishUpdates(nodeRef);
if (logger.isDebugEnabled() == true)
{ {
Date end = new Date(); // Ensure the update node has either completed the publish or is marked as no longer in progress
long duration = end.getTime() - start.getTime(); unmarkPublishInProgress(nodeRef);
logger.debug("Completed publish of updates ...");
logger.debug(" - for " + nodeRef.toString());
logger.debug(" - at " + end.toString());
logger.debug(" - duration " + Long.toString(duration));
} }
} }
finally
{
// Ensure the update node has either completed the publish or is marked as no longer in progress
unmarkPublishInProgress(nodeRef);
}
} }
return null; return null;
}; };
@@ -209,8 +212,11 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter
behaviourFilter.disableBehaviour(nodeRef, TYPE_DISPOSITION_ACTION_DEFINITION); behaviourFilter.disableBehaviour(nodeRef, TYPE_DISPOSITION_ACTION_DEFINITION);
try try
{ {
// Mark the node as publish in progress if (nodeService.exists(nodeRef) == true)
nodeService.setProperty(nodeRef, PROP_PUBLISH_IN_PROGRESS, true); {
// Mark the node as publish in progress
nodeService.setProperty(nodeRef, PROP_PUBLISH_IN_PROGRESS, true);
}
} }
finally finally
{ {