cancel
Showing results for 
Search instead for 
Did you mean: 

Change the name of a node

pmrreddy
Champ on-the-rise
Champ on-the-rise
Hi all,

In alfresco  i created a folder with name of ep1 and later i have a requirement to change it to the ETP1 i have the nodeRef so wrote a small java script got node and changed the properties of it like


node.properties["cm:name"] = "ETP1";
node.properties["cm:title"] = "ETP1"
node.save();

and conformed it by retrieving the properties of its changed perfectly but problem is when go through the node browser of it showing the childname as oldname(cm:ep1) in nodebrowser how can i change it because it will cause the problem when i query a lucene with child by name path


2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator
use node.setName(***);

Hi Kaynezhang


Thanx for the post, issue was solved as normal way only

when setting the name of node i just done like node.properties["cm:name"] instead of that node.name = <user vale> will solved the issue.