cancel
Showing results for 
Search instead for 
Did you mean: 

How to rename an existing folder in Alfresco 5.0.a?

jaikisanugale
Champ in-the-making
Champ in-the-making
I need a sample code to rename an existing folder.

For example, I have the folder at /Customer/C1098/Docket/Docket4/

I have this to rename any folder in the above path. So the output could be any one of the following:

1. /Customer/C7865/Docket/Docket4/
   OR
2. /Customer/C1098/NewDockets/Docket4/
   OR
3. /Customer/C1098/Docket/Docket5/
   
Thank you in advance !
3 REPLIES 3

kaynezhang
World-Class Innovator
World-Class Innovator
It depends on which api you are using:
For JAVA foundation api please use moveNode of NodeService
For OpenCMIS api ,you can use moveObject of ObjectService
For webscript api ,you can use ""move-to" post wbscript

Thanks kaynezhang!

I will be using OpenCMIS API, can you please share sample code if any, since I am new to Alfresco!

Thanks in advance!

kaynezhang
World-Class Innovator
World-Class Innovator

Session session =***;
session.getBinding().getObjectService().moveObject(arg0, arg1, arg2, arg3, arg4);