var carpeta = args.carpeta;
var resultados = new Array();
var espacio = roothome.childByNamePath(carpeta);
for each(n in espacio.children)
{
if ( n.isDocument == true )
{
// salida+="Ruta de los archivos: "+n.displayPath+"/"+n.name+"\n\r";
resultados[resultados.length]=n;
}
}
// aquí me gustaría ordenarlos
model.resultados=resultados;
var carpeta = args.carpeta;
var resultados = new Array();
var espacio = roothome.childByNamePath(carpeta);
for each(n in espacio.children)
{
if ( n.isDocument == true )
{
// salida+="Ruta de los archivos: "+n.displayPath+"/"+n.name+"\n\r";
resultados[resultados.length]=n;
}
}
// aquí me gustaría ordenarlos
resultados.sort(Sorting);
model.resultados=resultados;
//funcion de ordenacion
function Sorting(a, b) {
var x = a.properties["cm:created"];
var y = b.properties["cm:created"];
return ((x > y) ? 1 : -1);
}
<#list space.childrenByXPath[".//*[subtypeOf('cm:content')]"]?sort_by(["properties", "cm:created"]) as child>
Muchas Gracias!!!![]()
Era lo que buscaba.
Gracias por tu colaboración.
Feliz Año Nuevo!!!
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.