ListaVuotaCestino

Questa la lista dei documenti nel Cestino

( def emptybin = 0 // set to 1 if you want to empty the trash bin for the whole wiki)

{{groovy}} def emptybin = 0 // set to 1 if you want to empty the trash bin for the whole wiki

def query = "select distinct ddoc.fullName from XWikiDeletedDocument as ddoc " query += "where not exists (from XWikiDocument as doc where doc.fullName=ddoc.fullName)" def trashed = xwiki.search(query) if(trashed.size() > 0) {   def deleted = 0 println "= Trashed documents: =" for(trash in trashed) {     println "* " + trash + " (" + xwiki.getDeletedDocuments(trash, "").size() + " versions)" if (emptybin == 1) xwiki.getDeletedDocuments(trash, "").each{ xwiki.getXWiki().getRecycleBinStore().deleteFromRecycleBin( xwiki.getDocument(it.fullName).document, it.getId(), xcontext.context, true); deleted++; }   } if (emptybin == 1) println "nDeleted " + deleted + " trashed document. Trash bin is now empty." }
else println "Everything's clean. No trashed document found." {{/groovy}}