04-03-2014 02:53 AM
// We create the folder to place the txt file
var subir = space.childByNamePath("Subir Facturas");
var recoger = subir.childByNamePath("Recoger");
// If there is already a txt file we must delete it
for each (var doc in recoger.children) {
if (doc.mimetype == "text/plain");
doc.remove();
}
// Get the path to the parent space where to look for the files
var revision = space.childByNamePath("Revisar");
var aprobados = revision.childByNamePath("Aprobadas");
var today = new Date();
var ano = today.getFullYear();
var buscarAno = aprobados.childByNamePath(ano);
// Now we firstly create the txt file
//String fecha = today.getDate() + "-" + today.getMonth() +1 + "-" + today.getFullYear();
file = recoger.createFile("metadatos_facturas.txt");
// We run the search for all the pdf files that have been modified today in the
// space of the current year
var docs = search.xpathSearch([cm:modified]=today,buscarAno);
// For each doc found matching the search clause we must write their metadata in the
// txt file - one row with metadata per file found
for each (docs) {
if (docs!=null && docs.mimetype == "application/pdf")
{
workingcopy=file.checkout();
workingcopy.content = "|"+docs.name+"|"+docs.start_date+"|"+docs.Private_Id+"|=";
file = workingcopy.checkin();
}
}
04-14-2014 09:36 PM
04-14-2014 11:18 PM
search.luceneSearch('+@cm\:modified:[2013-09-20T00:00:00.000 TO 2013-11-20T23:59:59.999] AND +PATH:"//app:company_home//cm:Aprobados//*" AND +@cm\:content.mimetype:text/plain');
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.