Hello everybody.

 

 

Because of a java memory problem when exporting my wiki, I want to do selective 
space exports. The problem is that there is no easy snippet to do it. I found 
some code to export one space, and would be great to hace something with 
chekboxes or similiar to quickly select wich space to export. I am not good at 
the scripting language yet, so some help would be great.

 

 

I attach the code for one space exporting

 

#if(!$request.space)

  #set($space = "All")

#else

  #set($space = $request.space)

#end

#set($spacesText = {})

#set($spaces = $xwiki.spaces)

#set($ok = $spacesText.put("All","All"))

#foreach($space in $spaces)

  #set($ok = $spacesText.put($space,$space))

#end

 

#macro(spaceoption $space $selectspace $spacesText)

  <option value="$spacesText.get($space)" #if($selectspace == 
$spacesText.get($space))selected="selected"#end>$space</option>

#end

 

#macro(spaceselect $selectspace $spaces $spacesText)

  <select name="space">

    #spaceoption("All" $selectspace $spacesText)

    #foreach($space in $spaces)

      #spaceoption($space $selectspace $spacesText)

    #end

  </select>

#end

 

<form action="">

  {pre}

    <div class="centered">

      Space #spaceselect($space $spaces $spacesText) <input type="submit" 
value="Ver"/>

    </div>

  {/pre}

</form>

 

#if ($request.space)

    1.1 List of docs that will be Exported

 

  #set($parametros = "?format=xar&history=false&name="+$space)

 

  #foreach ($item in $xwiki.getSpaceDocsName($request.space))

     * $item

     #set( $parametros = $parametros + "&pages=" + $space + "." + $item )

  #end

#set( $parametros=$doc.getURL("export")+$parametros )

#set( $parametros=$parametro.toString.replace("/view/","/export/"))

<a href="$parametros">Exportar</a>

#end

 

--

Francisco Hernández Cuchí

Jefe de Servicios Sistemas de Información 

OFICINA ESPAÑOLA DE PATENTES Y MARCAS

 

**********************************************************************************************
IMPORTANTE: El contenido de este correo y ficheros adjuntos es confidencial y 
está dirigido únicamente 
para el destinatario/s.
Si Ud recibe este correo por error, por favor póngase en contacto con su 
administrador de correo o con el 
emisor immediatamente y no difunda su contenido a nadie ni haga copias.
*** Este correo ha sido escaneado de virus y contenido malicioso ***
**********************************************************************************************
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to