mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Removed the Environment from the publishing implementation.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29183 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -73,11 +73,11 @@ public class PublishingEventProcessor
|
||||
nodeService.setProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS, inProgressStatus);
|
||||
PublishingEvent event = eventHelper.getPublishingEvent(eventNode);
|
||||
NodeRef environment = eventHelper.getEnvironmentNodeForPublishingEvent(eventNode);
|
||||
String channelName = event.getChannelName();
|
||||
Channel channel = channelHelper.getChannel(environment, channelName, channelService);
|
||||
String channelName = event.getChannelId();
|
||||
Channel channel = channelService.getChannel(channelName);
|
||||
if (channel == null)
|
||||
{
|
||||
fail(event, "No channel found");
|
||||
fail(eventNode, "No channel found");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -87,6 +87,10 @@ public class PublishingEventProcessor
|
||||
nodeService.setProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS, completedStatus);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
fail(eventNode, e.getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
behaviourFilter.enableAllBehaviours();
|
||||
@@ -109,10 +113,10 @@ public class PublishingEventProcessor
|
||||
message += urlShortener.shortenUrl(nodeUrl);
|
||||
}
|
||||
}
|
||||
Set<String> channels = update.getChannelNames();
|
||||
for (String channelName : channels)
|
||||
Set<String> channels = update.getChannelIds();
|
||||
for (String channelId : channels)
|
||||
{
|
||||
Channel channel = channelHelper.getChannel(environment, channelName, channelService);
|
||||
Channel channel = channelService.getChannel(channelId);
|
||||
if(channel != null && channel.getChannelType().canPublishStatusUpdates())
|
||||
{
|
||||
channel.updateStatus(message);
|
||||
@@ -143,9 +147,10 @@ public class PublishingEventProcessor
|
||||
}
|
||||
|
||||
|
||||
public void fail(PublishingEvent event, String msg)
|
||||
public void fail(NodeRef eventNode, String msg)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
String completedStatus = PublishingEvent.Status.FAILED.name();
|
||||
nodeService.setProperty(eventNode, PublishingModel.PROP_PUBLISHING_EVENT_STATUS, completedStatus);
|
||||
}
|
||||
|
||||
public NodeRef publishEntry(Channel channel, PublishingPackageEntry entry, NodeRef eventNode)
|
||||
@@ -159,8 +164,7 @@ public class PublishingEventProcessor
|
||||
{
|
||||
updatePublishedNode(publishedNode, entry);
|
||||
}
|
||||
QName qName = QName.createQName(NAMESPACE, eventNode.getId());
|
||||
nodeService.addChild(publishedNode, eventNode, ASSOC_LAST_PUBLISHING_EVENT, qName);
|
||||
eventHelper.linkeToLastEvent(publishedNode, eventNode);
|
||||
channel.publish(publishedNode);
|
||||
return publishedNode;
|
||||
}
|
||||
|
Reference in New Issue
Block a user