AnsweredAssumed Answered

Changing the name of a category

Question asked by damiar on Jun 25, 2009
Latest reply on Jun 30, 2009 by damiar
Hey all,

I'm having problems changing the name of an existent category named "Compliance". This category contains nodes and other sub categories associated to it. I could make a webscript that changed the name of this category from "Compliance" to "sox". The problem is that in other webscripts I was using a Lucene search to get the nodes inside this category, so I thought that just changing the part "cm:Compliance" to "cm:sox" in the Lucene query would be enough to keep this search webscript working.

Well, that was not the case, because the name of the category now seems to be both the old one and the new one. I mean, if I execute something like someNode.childByNamePath("sox") I get the correct node, but if I execute a Lucene query using the path of this node (e.g. +PATH:"/cm:generalclassifiable/cm:finance-hub/cm:sox") I get an empty array, BUT if I execute a Lucene search using the old name I get the correct node! (e.g. +PATH:"/cm:generalclassifiable/cm:finance-hub/cm:Compliance"). This is really weird since the "Compliance" node that I get using Lucene is the same node that I get using #childByNamePath("sox"). And if I read its 'name' property it returns "sox".

Let's put an example…

As you can see in  this picture, I'm using a query that returns the nodes inside some subfolder of the 'Compliance' category:

In this second picture I'm executing the same query but using 'sox':

And in this third picture what I try to show you is how the same node has both the old name and the new one!

I need some help on this, what should I do in order to make the new name ("sox") the only one name? I mean, what should I do in order to make the Lucene search return the correct nodes when I use "sox" in the query?