mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merging DEV/SWIFT to HEAD:
r28365-28366: Implemented call to ChannelType.publish() from PublishingEventAction via ChannelImpl. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28370 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
package org.alfresco.repo.publishing;
|
||||
|
||||
import static org.alfresco.model.ContentModel.ASSOC_CONTAINS;
|
||||
import static org.alfresco.repo.publishing.PublishingModel.ASPECT_PUBLISHED;
|
||||
import static org.alfresco.repo.publishing.PublishingModel.ASSOC_LAST_PUBLISHING_EVENT;
|
||||
import static org.alfresco.repo.publishing.PublishingModel.NAMESPACE;
|
||||
|
||||
@@ -113,18 +114,19 @@ public class PublishingEventProcessor
|
||||
|
||||
public NodeRef publishEntry(Channel channel, PublishingPackageEntry entry, NodeRef eventNode)
|
||||
{
|
||||
NodeRef mappedNode = channelHelper.mapSourceToEnvironment(entry.getNodeRef(), channel.getNodeRef());
|
||||
if(mappedNode == null)
|
||||
NodeRef publishedNode = channelHelper.mapSourceToEnvironment(entry.getNodeRef(), channel.getNodeRef());
|
||||
if(publishedNode == null)
|
||||
{
|
||||
mappedNode = publishNewNode(channel.getNodeRef(), entry.getSnapshot());
|
||||
publishedNode = publishNewNode(channel.getNodeRef(), entry.getSnapshot());
|
||||
}
|
||||
else
|
||||
{
|
||||
updatePublishedNode(mappedNode, entry);
|
||||
updatePublishedNode(publishedNode, entry);
|
||||
}
|
||||
QName qName = QName.createQName(NAMESPACE, eventNode.getId());
|
||||
nodeService.addChild(mappedNode, eventNode, ASSOC_LAST_PUBLISHING_EVENT, qName);
|
||||
return mappedNode;
|
||||
nodeService.addChild(publishedNode, eventNode, ASSOC_LAST_PUBLISHING_EVENT, qName);
|
||||
channel.publish(publishedNode);
|
||||
return publishedNode;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,6 +192,7 @@ public class PublishingEventProcessor
|
||||
{
|
||||
Set<QName> aspectsToRemove = nodeService.getAspects(publishedNode);
|
||||
aspectsToRemove.removeAll(newAspects);
|
||||
aspectsToRemove.remove(ASPECT_PUBLISHED);
|
||||
for (QName aspectToRemove : aspectsToRemove)
|
||||
{
|
||||
nodeService.removeAspect(publishedNode, aspectToRemove);
|
||||
|
Reference in New Issue
Block a user