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:
N Smith
2011-06-13 15:45:43 +00:00
parent caef326c23
commit 33e06bb4f5
10 changed files with 358 additions and 23 deletions

View File

@@ -25,7 +25,6 @@ import java.util.Map;
import org.alfresco.service.cmr.publishing.channels.Channel;
import org.alfresco.service.cmr.publishing.channels.ChannelType;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName;
/**
@@ -37,19 +36,19 @@ public class ChannelImpl implements Channel
private final NodeRef nodeRef;
private final ChannelType channelType;
private final String name;
private final NodeService nodeService;
private final ChannelHelper channelHelper;
/**
* @param channelType
* @param name
* @param channelService
*/
public ChannelImpl(ChannelType channelType, NodeRef nodeRef, String name, NodeService nodeService)
public ChannelImpl(ChannelType channelType, NodeRef nodeRef, String name, ChannelHelper channelHelper)
{
this.nodeRef = nodeRef;
this.channelType = channelType;
this.name = name;
this.nodeService = nodeService;
this.channelHelper = channelHelper;
}
/**
@@ -81,7 +80,39 @@ public class ChannelImpl implements Channel
*/
public Map<QName, Serializable> getProperties()
{
return nodeService.getProperties(nodeRef);
return channelHelper.getChannelProperties(nodeRef);
}
/**
* {@inheritDoc}
*/
@Override
public void publish(NodeRef nodeToPublish)
{
if(channelHelper.canPublish(nodeToPublish, channelType))
{
channelType.publish(nodeToPublish, getProperties());
}
}
/**
* {@inheritDoc}
*/
@Override
public void unPublish(NodeRef nodeToUnpublish)
{
// TODO Auto-generated method stub
}
/**
* {@inheritDoc}
*/
@Override
public void updateStatus(String status)
{
// TODO Auto-generated method stub
}
}