cancel
Showing results for 
Search instead for 
Did you mean: 

Change name property (not found path)

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!
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
As you have seen there are two different things the PATH to a node and the NAME of the node.    To avoid confusion its best to keep the two in agreement.  But as you have seen there are slightly different encoding rules for paths.


If you use the FileFolderService then this is all handled for you.

spilby
Confirmed Champ
Confirmed Champ
Sorry, I don't understand… I must to change the path too? The FileFolderService have a method to set the PATH of the node? I can't see a set method to do this Smiley Surprised\

spilby
Confirmed Champ
Confirmed Champ
I modify the text of the question, this is more accurate.

Anyone knows the problem? Why the path don't change but the name yes? How can I change the path?

Thanks a lot

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.