cancel
Showing results for 
Search instead for 
Did you mean: 

Deletion of versions of a file using web script

pankajkumar
Champ in-the-making
Champ in-the-making
I have deleted older versions of some documents using web script. Now I want to free space on contentstore being used by deleted versions using web script. Please suggest how it can be achieved.
4 REPLIES 4

abarisone
Star Contributor
Star Contributor
Hi,
as far as I know you can only achieve the desired result by using Java http://stackoverflow.com/questions/5230120/how-to-delete-the-versions-for-particular-space-document
You can always build your own Java-backed webscript to perform the operation.

Regards,
Andrea

mitpatoliya
Star Collaborator
Star Collaborator
I think for that you need to have java backed webscript.
If you go under your alf_data there you can see the contentstore.deleted folder which keeps all the deleted files.
AFIK alfresco service does not provide any API to delete those files.
So, you need to write your own code which will delete the respective binaries from that folder.

nikes
Champ on-the-rise
Champ on-the-rise
If your files are in trashcan, you can delete it from Explorer UI, or trashcan cleaner at http://forge.alfresco.com/gf/project/trashcancleaner/

Using lucene you can try searching for the document in archive store (Never tried!), if you get the node, check if you can get the noderef and then delete it.

Whenever you perform a delete, it goes in trashcan by default. Through API, if you want to delete content permanently then just add temporary aspect(ContentModel.ASPECT_TEMPORARY) to that content before delete action.

-Nikesh

mitpatoliya
Star Collaborator
Star Collaborator
Pankaj,

Actually Each and every content residing under alfresco follows particular lifecycle.
Content in Alfresco> (on deletion) > Archive Store > (after cleaner run)>Deleted from Archivestore but binary file still there in content.deleted folder of alf_data

So, you need to understand this before you do any operation