mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Changed PublishEventProcessor so that it correctly updates the Publishing Status on the PublishingEvent node.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29042 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -48,6 +48,7 @@ import javax.annotation.Resource;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.service.cmr.publishing.MutablePublishingPackage;
|
||||
import org.alfresco.service.cmr.publishing.PublishingEvent;
|
||||
import org.alfresco.service.cmr.publishing.PublishingPackage;
|
||||
import org.alfresco.service.cmr.publishing.PublishingService;
|
||||
import org.alfresco.service.cmr.publishing.StatusUpdate;
|
||||
@@ -355,8 +356,15 @@ public class PublishEventActionTest extends AbstractPublishingIntegrationTest
|
||||
assertNotNull(eventId);
|
||||
NodeRef eventNode = new NodeRef(eventId);
|
||||
assertTrue(nodeService.exists(eventNode));
|
||||
Serializable eventStatus = nodeService.getProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS);
|
||||
assertEquals(PublishingEvent.Status.SCHEDULED.name(), eventStatus);
|
||||
|
||||
action.executeImpl(null, eventNode);
|
||||
|
||||
// Check Status has changed to COMPLETE
|
||||
eventStatus = nodeService.getProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS);
|
||||
assertEquals(PublishingEvent.Status.COMPLETE.name(), eventStatus);
|
||||
|
||||
return eventNode;
|
||||
}
|
||||
|
||||
|
@@ -65,10 +65,12 @@ public class PublishingEventProcessor
|
||||
|
||||
public void processEventNode(NodeRef eventNode)
|
||||
{
|
||||
ParameterCheck.mandatory("actionedUponNodeRef", eventNode);
|
||||
ParameterCheck.mandatory("eventNode", eventNode);
|
||||
try
|
||||
{
|
||||
behaviourFilter.disableAllBehaviours();
|
||||
String inProgressStatus = PublishingEvent.Status.IN_PROGRESS.name();
|
||||
nodeService.setProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS, inProgressStatus);
|
||||
PublishingEvent event = eventHelper.getPublishingEvent(eventNode);
|
||||
NodeRef environment = eventHelper.getEnvironmentNodeForPublishingEvent(eventNode);
|
||||
String channelName = event.getChannelName();
|
||||
@@ -81,6 +83,8 @@ public class PublishingEventProcessor
|
||||
{
|
||||
publishEvent(channel, event);
|
||||
updateStatus(channel, environment, event.getStatusUpdate());
|
||||
String completedStatus = PublishingEvent.Status.COMPLETE.name();
|
||||
nodeService.setProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS, completedStatus);
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
Reference in New Issue
Block a user