As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
// 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(); } }
var docs = search.luceneSearch("PATH:'app:company_home/cm:Revisar/cm:Aprobados//.' AND @cm\\:modified:[NOW TO MAX]");
var sdate=today.getFullYear()+"\-"+(today.getMonth()+1)+"\-"+today.getDate() + "T00:00:00"; var tdate=today.getFullYear()+"\-"+(today.getMonth()+1)+"\-"+(today.getDate()+1) + "T00:00:00"; var spath="'+PATH:\""+aprobados.displayPath +"//*\" + "; var scontent="@\\{http\\://www.alfresco.org/model/content/1.0\\}content.mimetype:application/pdf + "; var qdate="@cm\\:modified:[" + sdate + " TO " + tdate +"]'"; var strq=spath+scontent+qdate; // Do the search and save the vales var nodes=search.luceneSearch(strq);