mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user