Implemented Unpublishing of content.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29593 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
N Smith
2011-08-07 15:42:23 +00:00
parent 1ebd026918
commit 9696a74002
15 changed files with 149 additions and 77 deletions

View File

@@ -21,7 +21,6 @@ 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_PUBLISHED_CHANNEL;
import static org.alfresco.repo.publishing.PublishingModel.ASSOC_SOURCE;
import static org.alfresco.repo.publishing.PublishingModel.PROP_CHANNEL;
import static org.alfresco.repo.publishing.PublishingModel.PROP_CHANNEL_TYPE;
@@ -132,13 +131,8 @@ public class ChannelHelper
public Boolean apply(AssociationRef assoc)
{
NodeRef publishedNode = assoc.getSourceRef();
List<AssociationRef> channelAssoc = nodeService.getTargetAssocs(publishedNode, ASSOC_PUBLISHED_CHANNEL);
if(CollectionUtils.isEmpty(channelAssoc))
{
return false;
}
NodeRef target = channelAssoc.get(0).getTargetRef();
return target.equals(channelNode);
NodeRef parent = nodeService.getPrimaryParent(publishedNode).getParentRef();
return channelNode.equals(parent);
}
};
AssociationRef assoc = CollectionUtils.findFirst(sourceAssocs, acceptor);
@@ -322,11 +316,6 @@ public class ChannelHelper
public void addPublishedAspect(NodeRef publishedNode, NodeRef channelNode)
{
nodeService.addAspect(publishedNode, ASPECT_PUBLISHED, null);
List<AssociationRef> channelAssoc = nodeService.getTargetAssocs(publishedNode, ASSOC_PUBLISHED_CHANNEL);
if(CollectionUtils.isEmpty(channelAssoc))
{
nodeService.createAssociation(publishedNode, channelNode, ASSOC_PUBLISHED_CHANNEL);
}
}
private List<ChildAssociationRef> getChannelAssocs(NodeRef channelContainer)