Delete folder with REST+Javascript

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2014 01:03 PM
Hi to All!
I'm trying to realize these three steps:
<strong>1) create a user for example "TOM"</strong> (done succesfully as shown here):
<strong>2) delete a user, like "TOM"</strong> (done succesfully as shown here):
<strong>3) now i would like to delete also the "TOM" directory from repository</strong> (how can I do it??? can someone show it to me???):
thaks!!!
I'm trying to realize these three steps:
<strong>1) create a user for example "TOM"</strong> (done succesfully as shown here):
$.ajax({ type : 'POST', async : false, url : "/alfresco/service/api/people", data : JSON.stringify({ "userName": "TOM", "firstName": "testfirst", "lastName": "testlast", "email": "m1350@t.it", "password": "password", "disableAccount": false, "quota": -1, "groups": "" }), dataType : 'json', contentType : 'application/json', success : function(response) { alert(response); }, error : function(response) { alert(response); }});
<strong>2) delete a user, like "TOM"</strong> (done succesfully as shown here):
$.ajax({ type : 'DELETE', async : false, url : "/alfresco/service/api/people/TOM", dataType : 'json', contentType : 'application/json', success : function(response) { alert(response); }, error : function(response) { alert(response); }});
<strong>3) now i would like to delete also the "TOM" directory from repository</strong> (how can I do it??? can someone show it to me???):
(how can I do it??? can someone show it to me???)………
thaks!!!
Labels:
- Labels:
-
Archive
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2014 07:50 AM
you can use api for deleting folder and then have similar call.
http://localhost:8080/alfresco/service/api/node/%7Bstore_type%7D/%7Bstore_id%7D/%7Bid%7D/tree?contin...}
http://localhost:8080/alfresco/service/api/path/%7Bstore_type%7D/%7Bstore_id%7D/%7Bnodepath%7D/tree?...}
Deletes the specified folder and all of its child and descendant objects.
http://localhost:8080/alfresco/service/api/node/%7Bstore_type%7D/%7Bstore_id%7D/%7Bid%7D/tree?contin...}
http://localhost:8080/alfresco/service/api/path/%7Bstore_type%7D/%7Bstore_id%7D/%7Bnodepath%7D/tree?...}
Deletes the specified folder and all of its child and descendant objects.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2014 07:49 AM
Hi mitpatoliya,
I did not find the api you are suggesting, under:
http://localhost:8080/alfresco/service/index/uri/
I'm using Alfresco Community 5
I did not find the api you are suggesting, under:
http://localhost:8080/alfresco/service/index/uri/
I'm using Alfresco Community 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2014 09:03 PM
I think he is referring to following.
https://wiki.alfresco.com/wiki/Repository_RESTful_API_Reference
Delete tree (deleteTree) section
https://wiki.alfresco.com/wiki/Repository_RESTful_API_Reference
Delete tree (deleteTree) section

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2014 04:47 AM
Thanks you all for contributing.
Now, I know how to perform in my hypothetical client the steps (1) (2) (3)… but before I can run the third step, I have to determine {store_type},{store_id},{id}
How can I get, with my hypothetical client, those information?
thanks
Now, I know how to perform in my hypothetical client the steps (1) (2) (3)… but before I can run the third step, I have to determine {store_type},{store_id},{id}
How can I get, with my hypothetical client, those information?
thanks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2014 05:48 AM
Hi,
The {store_type},{store_id},{id} you're seaching for make the NodeRef.
Here you can find info about NodeRefs https://wiki.alfresco.com/wiki/Node_References_and_Store_Protocols
Use the Alfresco Explorer, navigate to the folder you want to delete, select View Details and in the Links section set your mouse on Alfresco Node Reference hyperlink.
At the bottom left of you browser you will see the NodeRef you need.
If you want to do it programmatically I would suggest you to perform a query using as a filteting criteria TOM and type=cm:folder(or the corresponding type if not default).
Regards,
Andrea
The {store_type},{store_id},{id} you're seaching for make the NodeRef.
Here you can find info about NodeRefs https://wiki.alfresco.com/wiki/Node_References_and_Store_Protocols
Use the Alfresco Explorer, navigate to the folder you want to delete, select View Details and in the Links section set your mouse on Alfresco Node Reference hyperlink.
At the bottom left of you browser you will see the NodeRef you need.
If you want to do it programmatically I would suggest you to perform a query using as a filteting criteria TOM and type=cm:folder(or the corresponding type if not default).
Regards,
Andrea
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2014 11:08 PM
Normally what I do is go Administration Console>>Node Browser>>workspace://SpacesStore then try lucence query to see all the metadata of the content. Then I get all the necessary node with ids.
