cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the name of a node?

spilby
Confirmed Champ
Confirmed Champ
Hi,

To change the name of a node I do this (with a java backed webscript):


getNodeService().setProperty(nodeRef, QName.createQName("http://www.alfresco.org/model/content/1.0", "name"), "012345");


I go to alfresco share and I see the name property with the new name and if I do


getFileFolderService().getFileInfo(nodeRef).getName()


returns me the new name. All seems ok.

But lucene don't find me the new folder and doing a


getNodeService().getPath(nodeRef)


I can see that the path has the older name. How can I update the path? Is necessary to update another property in addition to the name?

Thanks a lot!
3 REPLIES 3

romschn
Star Collaborator
Star Collaborator
Try using FileFolderService's rename() method and see if it works for you or not.

Hope this helps.

spilby
Confirmed Champ
Confirmed Champ
I do a
getFileFolderService().rename(nodeRef, name);
with the new name, but the result is the same. The name of the node is changed (getFileInfo(nodeRef).getName() returns me the new name), but the getPath returns me the old name… Smiley Surprised(

spilby
Confirmed Champ
Confirmed Champ
No one? Someone knows how change the path name of a node? I need this information, please. Thanks a lot.