1
votes

I am very new Alfresco user. We have uploaded 18000 documents to Alfresco. Then we noticed that some categories are not correct. We would like to upload them again, but we don't know how to delete existing documents. Is there any way to delete all documents that were uploaded yesterday?

2
Are you looking to do it through the Share UI, through Java, JavaScript, CIFS, WebDAV, CMIS? Any of those? None of those? - Gagravarr
Any of those. Preferably easiest way. - George Jove
Share UI would be best option for us as we don't want to touch code base. - George Jove
Using any of the APIs, or one of the protocols involves no changes to the codebase either! - Gagravarr
ok, can you give me more details how. (or document link). If you write it as a post, I can mark it as an answer. - George Jove

2 Answers

6
votes

The best way is to use a code based method (JavaScript or CMIS). So, the easiest way is to create a JavaScript file in Data Dictionary/Script folder with something like this:

    // execute a lucene search across the repository for pdf documents in a specific folder created the exact day
   var docs = search.luceneSearch("PATH:\"/app:company_home/cm:myFolder//*\" AND @cm\\:content.mimetype:\"application/pdf\" AND @cm\\:created:2013-05-21");
   var i;
   for (i=0; i<docs.length; i++)
   {
   docs[i].remove();
   }

although 18k documents could probably create some memory issues in your JVM.

Maybe the script will interrupt at some point, and you'll have to restart the machine and execute script again.

0
votes

I would use the WebDAV to delete that.

First, from a window running PC. I would add a network place for the webDAV of alfresco.

Then from Window explorer, I will delete very easily like as deleting folders/files in window.

You can google for webDAV api URL to add.