05-19-2010 12:16 PM
<#assign contador = 0 >
<#assign tamanio = 0 >
<#list space.childrenByXPath[".//*"] as child>
<#if child.isDocument>
<#assign contador = contador+1 >
<#assign tamanio = tamanio + child.size>
</#if>
</#list>
<#assign tamanio = (tamanio/1024)/>
<#assign tamanio = (tamanio/1024)/>
<table border="0" celpadding="0" cellspacing="0">
<tr><td>Numero de docs en el espacio: ${contador}</td></tr>
<tr><td>Tamaño de los documentos: ${tamanio}</td></tr>
</table>
05-19-2010 01:51 PM
05-20-2010 03:34 AM
05-20-2010 03:44 AM
<table>
<#macro recurse_macro node depth>
<#if node.isContainer>
<tr>
<td align='left'>(${depth})
<#if (depth>0) >
<#list 1..depth as i>.</#list>
</#if>
<img src="/alfresco${node.icon16}"> <a href="/alfresco${node.url}">${node.properties.name}</a>
</td>
</tr>
<#list node.children as child>
<#if child.isContainer && node.children?size != 0 >
<@recurse_macro node=child depth=depth+1/>
</#if>
</#list>
</#if>
</#macro>
<b>Recursive Listing of Spaces:</b>
<table border="1" celpadding="1" cellspacing="1">
<tr><th> Name Space </th></tr>
<@recurse_macro node=companyhome depth=0/>
</table>
05-20-2010 07:20 AM
05-24-2010 12:34 PM
09-03-2010 10:30 AM
09-04-2010 02:07 PM
09-28-2010 04:18 PM
var carpeta = args.carpeta;
var resultados = new Array();
var espacio = roothome.childByNamePath(carpeta);
var i=0;
for(var j=0; j<espacio.children.length; j++){
var hijo = espacio.children[j];
if(hijo.isDocument){
resultados[i]=hijo;
i++;
}
// A partir de aquí no me entra , no sé como acceder a un asubcarpeta en webscript
if(hijo.isContainer){
var espacio2 = roothome.childByNamePath(carpeta+"/"+hijo.name);
for(var x=0; x<espacio2.children.length; x++){
var hijo2=espacio2.childen[x];
if(hijo2.isDocument){
resultados[i]=hijo2;
i++;
}
}
}
}
model.resultados=resultados;
09-29-2010 04:28 AM
… Lo que tengo que realizar es recorrer una carpeta y sus subcarpetas recursivamente, y obtener los documentos de dichas carpetas.
En el js, solo consigo recorrer la carpeta de un nivel, pero el resto no me funciona, no sé como crear una subcarpeta en webscritp, te muestro el código para ver si me podrías comentar como tirar:
function muestraRutas(node)
{
for each(n in node.children)
{
if ( n.isDocument )
salida+="Ruta de los archivos: "+n.displayPath+"/"+n.name+"\n\r";
for ( var i = 0; i < n.children.length; i++ ) {
if ( n.children[i].isContainer == true )
muestraRutas( n.children[i] );
}
}
}
// Objetos modificables
var nodo_raiz = "" ;
var salida = "";
var logFile = script.parent.childByNamePath( "muestraRutas.txt" );
// Precondiciones
if ( logFile == null )
logFile = script.parent.createFile( "muestraRutas.txt" );
if ( nodo_raiz == "" )
{
var space = companyhome;
}
else{
var space = companyhome.childByNamePath( nodo_raiz );
}
if (space != null) {
muestraRutas( space );
}
else{
salida += "Error al localizar el espacio raiz: " + nodo_raiz + "\n\r";
if (logger.isLoggingEnabled())
{
logger.log("Error al localizar el espacio raiz: " + nodo_raiz );
}
}
logFile.content = salida;
logFile.save();
logFile.content;
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.