AnsweredAssumed Answered

Change Name and Title for document

Question asked by irenailievska on Feb 11, 2015
Latest reply on Feb 16, 2015 by irenailievska
I need to create pop-up dialog action to change the name and title of the documents. I tried doing this by using Java, but even if I change the name and the title there is one thing that I can not change. When I open from the admin console Node Browser and find the node that needed change of name and title I see that the old name stands for the node.
I have document Proposition.pdf in folder Folder 1.
It has:
cm:name = Proposition.pdf
cm:title = Proposition.pdf
…. other stuff….
and the child name when I see it from the parent folder cm:Proposition.pdf
I want to change the name from Proposition.pdf to New proposition.pdf
After I click on the action the I get:
cm:name = New proposition.pdf
cm:title = New proposition.pdf
…. other stuff….
and the child name when I see it from the parent folder is the old name cm:Proposition.pdf.
It turns out if I try to execute from the java script console from the admin panel : = "New proposition.pdf"; I get the thing that I want. But I have no idea how to do this in Java. Is there a way to do this in java code or to execute java script in the java class ?
I don't know how to create JavaScript functions such as in actions.js. If someone wants to enlighten me I would be forever grateful :D

Thanks in advance,