Delete Object in Alfresco 5.1

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 11:01 AM
I need to delete a node object as well as a forum post in Alfresco 5.1 but I don't see more the repo webscript
In Alfresco 4.0.e I had the possibility to invoke the REST API:
DELETE /alfresco/service/api/node/{store_type}/{store_id}/{id} (see screenshot)
I try to create a new repo webscript using cmisServer root object but receive an error "cmisServer is not defined"
Is there an alternative way to do the same thing in Alfresco 5.1?
Regards
Vincenzo
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 04:06 PM
http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/deleteme.txt?cmis...
To delete the file.
If you want to get the object instead, you could do:
http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/deleteme.txt?cmis...
This is consistent with the CMIS API using the raw browser binding, so read more on that if you need help.
Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2016 08:22 AM
However I need to delete a node (forum post object) using it's noderef (Eg. workspace://SpaceStore/xxxxxxxx…..), is it possible using the CMIS API with browser binding?
Moreover, if I create a repo webscript to do this work, is there a cmis root object in javascript to delete a post node (I see that cmiserver root object is missing in Alfresco 5.1)?
Thx
Vincenzo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2016 10:19 AM
But if you are in a repo webscript there is no reason to use CMIS to do this. Just use the ScriptNode object and call the remove method on that.
http://docs.alfresco.com/community/references/API-JS-remove.html
Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2018 02:19 AM
Hey Jeff,
Is this method still available in 5.2? When a do something like
a href="http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root/sites/test-site/documentLibrary/index.html?cmisaction=delete">
It simply downloads the file instead of deleting. Do these delete requests always need to be in a form so that we are not "GET" requesting and always "POST"ing. I'm sure this is a stupid question so I apologize, but I figured I'd reach out because someone else may be having this problem as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2018 11:18 PM
Yes, 5.2 still supports CMIS 1.1 and the browser binding. However, I'm seeing the same thing as you are when I do a GET.
I used cmislib to verify that the browser binding being used here still is able to delete objects. The way that works is that it does a POST against the root URL (http://alfresco.local:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root) with the content-type set to "application/x-www-form-urlencoded" and the objectId and cmisaction as parameters.
So, if you really need that to be a link, use JQuery or similar to do a POST and it should work.
