Finished implementing Unpublishing.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29625 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
N Smith
2011-08-09 11:01:23 +00:00
parent d004bc3e90
commit 0dc8ed5929
23 changed files with 666 additions and 477 deletions

View File

@@ -49,7 +49,6 @@ import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.AccessPermission;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.NamespaceService;
@@ -87,8 +86,6 @@ public class ChannelHelper
public NodeRef createChannelNode(NodeRef parent, ChannelType channelType, String channelName,
Map<QName, Serializable> props)
{
Set<AccessPermission> permissions = permissionService.getPermissions(parent);
QName channelQName = getChannelQName(channelName);
QName channelNodeType = channelType.getChannelNodeType();
ChildAssociationRef channelAssoc =
@@ -120,6 +117,18 @@ public class ChannelHelper
* @return
*/
public NodeRef mapSourceToEnvironment(NodeRef source, final NodeRef channelNode)
{
return mapSourceToEnvironment(source, channelNode, nodeService);
}
/**
* Given a noderef from the editorial space (e.g. the doclib), this returns the corresponding noderef published to the specified channel.
* @param source
* @param channelNode
* @param nodeService
* @return
*/
public static NodeRef mapSourceToEnvironment(NodeRef source, final NodeRef channelNode, final NodeService nodeService)
{
if(source == null || channelNode == null)
{
@@ -145,6 +154,16 @@ public class ChannelHelper
* @return
*/
public NodeRef mapEnvironmentToSource(NodeRef publishedNode)
{
return mapEnvironmentToSource(publishedNode, nodeService);
}
/**
* Given a published noderef, this returns the corresponding source noderef in the editorial space (doclib).
* @param publishedNode
* @return
*/
public static NodeRef mapEnvironmentToSource(NodeRef publishedNode, NodeService nodeService)
{
List<AssociationRef> assocs = nodeService.getTargetAssocs(publishedNode, ASSOC_SOURCE);
return NodeUtils.getSingleAssocNode(assocs, true);