Implemented channel.put Rest method for renaming channels. Also renamed publishing-events-for-node.get to publishing-events.get.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29312 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
N Smith
2011-07-25 15:06:14 +00:00
parent 12a03e1653
commit 4be0baaeb3
9 changed files with 68 additions and 138 deletions

View File

@@ -294,14 +294,14 @@ public class ChannelServiceImpl implements ChannelService
/**
* {@inheritDoc}
*/
public void renameChannel(String oldName, String newName)
public void renameChannel(Channel channel, String newName)
{
NodeRef channelContainer = getChannelContainer();
NodeRef channel = nodeService.getChildByName(channelContainer, ContentModel.ASSOC_CONTAINS, oldName);
if (channel != null)
NodeRef channelNode = channel.getNodeRef();
if (channelNode != null && nodeService.exists(channelNode))
{
nodeService.setProperty(channel, ContentModel.PROP_NAME, newName);
nodeService.moveNode(channel, channelContainer, ContentModel.ASSOC_CONTAINS,
NodeRef channelContainer = getChannelContainer();
nodeService.setProperty(channelNode, ContentModel.PROP_NAME, newName);
nodeService.moveNode(channelNode, channelContainer, ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.APP_MODEL_1_0_URI, newName));
}
}
@@ -331,8 +331,7 @@ public class ChannelServiceImpl implements ChannelService
@Override
public Channel getChannelById(String id)
{
if(id!=null&& id.isEmpty()==false
&& NodeRef.isNodeRef(id))
if(id!=null&& NodeRef.isNodeRef(id))
{
NodeRef node = new NodeRef(id);
return channelHelper.buildChannelObject(node, this);