Hi Everyone,
I have requirement of Creating folder hierarchy using REST API. I am able to create single single folder using following call:-
http://localhost:8080/alfresco/service/api/site/folder/Test/documentLibrary/Test 1
i want my folder hierarchy as follows:-
Site:- Test Container:- documentLibrary folder hierarchy as :- Test 1/Test 2/Test 3/Test 4.
i am able to acheive it by running it again and again but want it in one go.
Also like i am able to create folders using content create API by providing relative path by using below call:-
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children relativepath as:- test/documentLibrary/test1/test2/test3/test4 also by providing filedata and nodetype. but i want only folder hierarchy without content.
can i create folder hierarchy anyway by using relative path?
Please do guide me out on this.
Thanks and Regards,
Piyush.
There is no way to create a hierarchy in just one call. You have to call it multiple times.
Hi @afaust ,
Is there anyway such task can be acheive through CMIS API call?.
Any other way possible for this without using Alfresco API services ? cause i am creating standalone java application for it.
Thanks,
Piyush.
No - AFAIK there are no standard APIs that you can use to create an entire path in one call. You would have to create a custom web script / action for that. The latter could be triggered via Alfresco ReST API as far as I know (I have never done / tried that myself).
Hi,
If I understand correctly the question, i think it is now possible.
The Api explorer doc says :
"The relativePath specifies the folder structure to create relative to the node nodeId. Folders in the
relativePath that do not exist are created before the node is created."
I have tried this and the folders are all well created in one call....
Best regards
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.