Re: [xwiki-users] Selective space export

2009-09-07 Thread Caleb James DeLisle
Oops, the mail client bungled my code. You can download it as an
application here:
http://code.xwiki.org/xwiki/bin/download/Applications/LargeExportBySpaceApplicationDownloads/Main.largeExportBySpace.xar

Caleb James DeLisle wrote:
> I modified the large export script to support individual spaces. With my
> modded version, you can also export to a directory rather than zip
> compressing the export (you can then zip the contents of the dir
> manually), hopefully skipping the zip compression will save enough ram
> to prevent running out of heap space.
>
> You say you have a 1gb database, are there lots of big attachments or
> just a ridiculous number of pages? It might be that one attachment is so
> big that it breaks the export engine.
>
> How long does it take to run out of memory? If it takes a long time,
> then it is probably too much data -> my script might fix it.
> If it's immediate, you are probably almost out of ram already. the
> HSQLDB database (which comes with the package) shares ram with XWiki,
> HSQL also seems to move the entire database to ram so you will need more
> than -Xmx1024m
> You can specify more memory with Xmx than you actually have physical ram
> because it can use swap space.
>
> here is my modified export script, I'll post it to the code zone after I
> decide if it needs any more features.
>
>
>
>
>
>
> 1.1 Large Export
>
> <%
>
> import com.xpn.xwiki.*;
> import com.xpn.xwiki.doc.*;
> import com.xpn.xwiki.plugin.packaging.*;
> import java.util.zip.*;
> import com.xpn.xwiki.util.Util;
>
> def getXAR(String filename, XWikiContext context) {
> def request = context.getRequest();
> def export = context.getWiki().getPluginApi("package", context);
> List spaces = request.getParameterMap().get("spaces");
> export.setWithVersions(true);
> export.setAuthorName("XWiki.Admin");
> export.setDescription("");
> export.setLicence("");
> export.setVersion("");
> export.setBackupPack(true);
> export.setName("backup");
> def pack = export.getPackage();
> //pack.addAllWikiDocuments(context);
> ArrayList docNames = new ArrayList();
> for(String space : spaces){
> for(String docName : context.getWiki().getSpaceDocsName(space,
> context)){
> pack.add(docName,
> com.xpn.xwiki.plugin.packaging.DocumentInfo.ACTION_OVERWRITE, context);
> }
> }
> if(request.dir){
> pack.exportToDir(new File(filename), context);
> }else{
> pack.export(new FileOutputStream(new File(filename)), context);
> }
> }
>
> if (request.filename) {
>getXAR(request.filename, context.getContext())
>   } else {
> %>
> 
> 
> 
> File/directory to write to: name="filename" size="60" />
> 
> 
> <%
> for(String space : xwiki.getSpaces()){
> println(space+" value=\""+space+"\"/>\n");
> }
> %>
> Don't zip files, output to directory 
> 
> 
> 
> <%
>   }
> %>
>
>
>
>
>
>
>
> [Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
>   
>> Hi Francisco!
>>
>> Hernández Cuchí wrote:
>>   
>> 
>>> Hi, 
>>>
>>> That is not really what I want. My problem is that I have an xwiki 1.7.14 
>>> and I wanto to move to a 2.0milestone 2 in another machine. I get a lot of 
>>> corrupted xar files (cannot open them with 7zip) because of java memory 
>>> heap exception (even if they are spaces of only one page!). So I need a 
>>> different way of exporting the data, because if I have 40 spaces, 10 xar 
>>> files are corrupted. Even, I wrote my own snippet to get the spaces 
>>> exported selectively, but still getting corrupted xar files. So, ¿is it 
>>> posible to backup the database and import it in the new installation?
>>>   
>>> 
>>>   
>> Hopefully I will face a similar workflow in the following weeks, so let 
>> see if I am able to help here :-)
>>
>> As far as I understand, you have to XWiki installations. Each of them on 
>> a different box. What you are looking for is to move the whole 1.7.14 
>> database to a brand new 2.0m2 in a different box.
>>
>> If this is what you want and although this not solve the doubts about 
>> why do exports get corrupted, you can export the whole XWiki database 
>> schema, reimport it in the new database installation (if there is one in 
>> the same box where you have installed the new XWiki instance) and 
>> provided you have correctly configured username and password in 
>> hibernate.cfg.xml file it must work.
>>
>> The first time the new XWiki instances starts, the required database 
>> schema updated will be performed by the system. I've done that severel 
>> times in the past without any problem working with MySQL databases. 
>> There have been issues related with schema updates in early releases, 
>> but I've not read anything about them lately. In fact, it is a similar 
>> process to install a new XWiki from the scratch but dealing with an 
>> existing database. If XWiki finds a database, it will use it instead of 
>> creating a new one.
>>
>> Of course modifications done to Velocit

Re: [xwiki-users] Selective space export

2009-09-07 Thread Caleb James DeLisle
I modified the large export script to support individual spaces. With my
modded version, you can also export to a directory rather than zip
compressing the export (you can then zip the contents of the dir
manually), hopefully skipping the zip compression will save enough ram
to prevent running out of heap space.

You say you have a 1gb database, are there lots of big attachments or
just a ridiculous number of pages? It might be that one attachment is so
big that it breaks the export engine.

How long does it take to run out of memory? If it takes a long time,
then it is probably too much data -> my script might fix it.
If it's immediate, you are probably almost out of ram already. the
HSQLDB database (which comes with the package) shares ram with XWiki,
HSQL also seems to move the entire database to ram so you will need more
than -Xmx1024m
You can specify more memory with Xmx than you actually have physical ram
because it can use swap space.

here is my modified export script, I'll post it to the code zone after I
decide if it needs any more features.






1.1 Large Export

<%

import com.xpn.xwiki.*;
import com.xpn.xwiki.doc.*;
import com.xpn.xwiki.plugin.packaging.*;
import java.util.zip.*;
import com.xpn.xwiki.util.Util;

def getXAR(String filename, XWikiContext context) {
def request = context.getRequest();
def export = context.getWiki().getPluginApi("package", context);
List spaces = request.getParameterMap().get("spaces");
export.setWithVersions(true);
export.setAuthorName("XWiki.Admin");
export.setDescription("");
export.setLicence("");
export.setVersion("");
export.setBackupPack(true);
export.setName("backup");
def pack = export.getPackage();
//pack.addAllWikiDocuments(context);
ArrayList docNames = new ArrayList();
for(String space : spaces){
for(String docName : context.getWiki().getSpaceDocsName(space,
context)){
pack.add(docName,
com.xpn.xwiki.plugin.packaging.DocumentInfo.ACTION_OVERWRITE, context);
}
}
if(request.dir){
pack.exportToDir(new File(filename), context);
}else{
pack.export(new FileOutputStream(new File(filename)), context);
}
}

if (request.filename) {
   getXAR(request.filename, context.getContext())
  } else {
%>



File/directory to write to:


<%
for(String space : xwiki.getSpaces()){
println(space+"\n");
}
%>
Don't zip files, output to directory 



<%
  }
%>







[Ricardo Rodriguez] Your EPEC Network ICT Team wrote:
> Hi Francisco!
>
> Hernández Cuchí wrote:
>   
>> Hi, 
>>
>> That is not really what I want. My problem is that I have an xwiki 1.7.14 
>> and I wanto to move to a 2.0milestone 2 in another machine. I get a lot of 
>> corrupted xar files (cannot open them with 7zip) because of java memory heap 
>> exception (even if they are spaces of only one page!). So I need a different 
>> way of exporting the data, because if I have 40 spaces, 10 xar files are 
>> corrupted. Even, I wrote my own snippet to get the spaces exported 
>> selectively, but still getting corrupted xar files. So, ¿is it posible to 
>> backup the database and import it in the new installation?
>>   
>> 
> Hopefully I will face a similar workflow in the following weeks, so let 
> see if I am able to help here :-)
>
> As far as I understand, you have to XWiki installations. Each of them on 
> a different box. What you are looking for is to move the whole 1.7.14 
> database to a brand new 2.0m2 in a different box.
>
> If this is what you want and although this not solve the doubts about 
> why do exports get corrupted, you can export the whole XWiki database 
> schema, reimport it in the new database installation (if there is one in 
> the same box where you have installed the new XWiki instance) and 
> provided you have correctly configured username and password in 
> hibernate.cfg.xml file it must work.
>
> The first time the new XWiki instances starts, the required database 
> schema updated will be performed by the system. I've done that severel 
> times in the past without any problem working with MySQL databases. 
> There have been issues related with schema updates in early releases, 
> but I've not read anything about them lately. In fact, it is a similar 
> process to install a new XWiki from the scratch but dealing with an 
> existing database. If XWiki finds a database, it will use it instead of 
> creating a new one.
>
> Of course modifications done to Velocity templates, skins,... not stored 
> in the database must be done separately. Also, as with a regular update, 
> you must be extremely cautious when importing the new default xar file 
> for the new release.
>
> HTH,
>
> Ricardo
>
>   

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Selective space export

2009-09-07 Thread [Ricardo Rodriguez] Your EPEC Network ICT Team
Hi Francisco!

Hernández Cuchí wrote:
> Hi, 
>
> That is not really what I want. My problem is that I have an xwiki 1.7.14 and 
> I wanto to move to a 2.0milestone 2 in another machine. I get a lot of 
> corrupted xar files (cannot open them with 7zip) because of java memory heap 
> exception (even if they are spaces of only one page!). So I need a different 
> way of exporting the data, because if I have 40 spaces, 10 xar files are 
> corrupted. Even, I wrote my own snippet to get the spaces exported 
> selectively, but still getting corrupted xar files. So, ¿is it posible to 
> backup the database and import it in the new installation?
>   
Hopefully I will face a similar workflow in the following weeks, so let 
see if I am able to help here :-)

As far as I understand, you have to XWiki installations. Each of them on 
a different box. What you are looking for is to move the whole 1.7.14 
database to a brand new 2.0m2 in a different box.

If this is what you want and although this not solve the doubts about 
why do exports get corrupted, you can export the whole XWiki database 
schema, reimport it in the new database installation (if there is one in 
the same box where you have installed the new XWiki instance) and 
provided you have correctly configured username and password in 
hibernate.cfg.xml file it must work.

The first time the new XWiki instances starts, the required database 
schema updated will be performed by the system. I've done that severel 
times in the past without any problem working with MySQL databases. 
There have been issues related with schema updates in early releases, 
but I've not read anything about them lately. In fact, it is a similar 
process to install a new XWiki from the scratch but dealing with an 
existing database. If XWiki finds a database, it will use it instead of 
creating a new one.

Of course modifications done to Velocity templates, skins,... not stored 
in the database must be done separately. Also, as with a regular update, 
you must be extremely cautious when importing the new default xar file 
for the new release.

HTH,

Ricardo

-- 
Ricardo Rodríguez
Your EPEC Network ICT Team

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Selective space export

2009-09-07 Thread Ludovic Dubost

Have you tried:

http://code.xwiki.org/xwiki/bin/view/Applications/ImportExportApplication

It has space export..

Ludovic


Hernández Cuchí a écrit :
> Hi, 
>
> That is not really what I want. My problem is that I have an xwiki 1.7.14 and 
> I wanto to move to a 2.0milestone 2 in another machine. I get a lot of 
> corrupted xar files (cannot open them with 7zip) because of java memory heap 
> exception (even if they are spaces of only one page!). So I need a different 
> way of exporting the data, because if I have 40 spaces, 10 xar files are 
> corrupted. Even, I wrote my own snippet to get the spaces exported 
> selectively, but still getting corrupted xar files. So, ¿is it posible to 
> backup the database and import it in the new installation?
>
> BTW, I attach the code I wrote for selective space exporting (no optimiced, 
> no commented).
>
>
> 
> #set($spaces = $xwiki.spaces)
> There are $spaces.size() spaces
> #set($base ="?format=xar&history=false")
> #set( $url=$doc.getURL("export")+$base)
> #set( $url=$url.toString.replace("/view/","/export/"))
>
>
>
>
> 
> 
>  
> 
>
> 
>
>
>   Export 
>   
> 
>
> 
>
>
>  
>
>
>
>
>
>
>
>
> #foreach($space in $spaces)
>
>   
> #set($contador=0)
>
>   #set($parametros = "&name="+$space)
>
>   #foreach ($item in $xwiki.getSpaceDocsName($space))
>  #set($contador=$contador +1)
>  #set($parametros = $parametros + "&pages=" + $space + "." + $item )
>
>
> #end
>
>
>
> #set( $parametros=$parametro.toString.replace("/view/","/export/"))
>
> Export $space con $contador paginas
> 
> Añadir
> 
> 
> #set($rdoc = $xwiki.getDocument($space).getTranslatedDocument())
> #set($view_url=$rdoc.getURL('view'))
>
> Ir
> 
>
> 
>
> #end
>
> 
>
> 
>
>
> 
> function writeit(txt,cosa)
> {
>
> var tbox = document.getElementById(cosa);
> if (tbox)
> {
> tbox.value =tbox.value+ txt;
> }
> }
>
> function appendit(txt,cosa,link)
> {
>
> var tbox = document.getElementById(cosa);
> var linkea = document.getElementById(link);
> if (tbox)
> {
> tbox.value = tbox.value+txt;
> linkea.href="$url" +tbox.value;
> }
> }
> 
> 
> Thanks
>
> Francisco
>
>
>
>
> -Mensaje original-
> De: users-boun...@xwiki.org [mailto:users-boun...@xwiki.org] En nombre de 
> Steven Calkins
> Enviado el: lunes, 07 de septiembre de 2009 17:33
> Para: XWiki Users
> Asunto: Re: [xwiki-users] Selective space export
>
> Hallo Francisco,
>
> I recently exported my entire database for the first time. I noticed that 
> when you import the XAR file there are checkboxes that permit you to leave 
> out what you want. Is that what you need? Xwiki permits choosing which spaces 
> to import, but the choice is on the import side not the export side. To 
> export the entire DB you need to have Admin rights, though.
>
> Best regards,
>
>
> Steven Calkins
> -Ursprüngliche Nachricht-
> Von: users-boun...@xwiki.org [mailto:users-boun...@xwiki.org] Im Auftrag von 
> Hernández Cuchí, Francisco Ricardo
> Gesendet: Montag, 7. September 2009 12:51
> An: XWiki Users
> Betreff: [xwiki-users] Selective space export
>
> 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)
>
>$spacesText.get($space))selected="selected"#end>$space
>
> #end
>
>  
>
> #macro(spaceselect $selectspace $spaces $spacesText)
>
>   
>
> #spaceoption("All" $selectspace $spacesText)
>
> #foreach($space in $spaces)
>
>   #spaceoption($space $selectspace $spacesText)
>
> #end
>
>   
>
> #end
>
>  
>
> 
>
>   {pre}
>
> 
>
>   Space #spaceselect($space $spaces $spacesText)  value="Ver"/>
>
> 
>
>   {/pre}
>
> 
>
>  
>
> #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/"))
>
> Exportar
>
> #end
>
>  
>
> --
>
> Francisco Hernández Cuchí
>
> Jefe de Servicios Sistemas de Información 
>
> OFICINA ESPAÑOLA DE PATENTES Y MARCAS
>

Re: [xwiki-users] Selective space export

2009-09-07 Thread Hernández Cuchí , Francisco Ricardo
Hi, 

That is not really what I want. My problem is that I have an xwiki 1.7.14 and I 
wanto to move to a 2.0milestone 2 in another machine. I get a lot of corrupted 
xar files (cannot open them with 7zip) because of java memory heap exception 
(even if they are spaces of only one page!). So I need a different way of 
exporting the data, because if I have 40 spaces, 10 xar files are corrupted. 
Even, I wrote my own snippet to get the spaces exported selectively, but still 
getting corrupted xar files. So, ¿is it posible to backup the database and 
import it in the new installation?

BTW, I attach the code I wrote for selective space exporting (no optimiced, no 
commented).



#set($spaces = $xwiki.spaces)
There are $spaces.size() spaces
#set($base ="?format=xar&history=false")
#set( $url=$doc.getURL("export")+$base)
#set( $url=$url.toString.replace("/view/","/export/"))






 




   
  Export 
  





 








#foreach($space in $spaces)

  
#set($contador=0)

  #set($parametros = "&name="+$space)

  #foreach ($item in $xwiki.getSpaceDocsName($space))
 #set($contador=$contador +1)
 #set($parametros = $parametros + "&pages=" + $space + "." + $item )


#end



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

Export $space con $contador paginas

Añadir


#set($rdoc = $xwiki.getDocument($space).getTranslatedDocument())
#set($view_url=$rdoc.getURL('view'))

Ir




#end







function writeit(txt,cosa)
{

var tbox = document.getElementById(cosa);
if (tbox)
{
tbox.value =tbox.value+ txt;
}
}

function appendit(txt,cosa,link)
{

var tbox = document.getElementById(cosa);
var linkea = document.getElementById(link);
if (tbox)
{
tbox.value = tbox.value+txt;
linkea.href="$url" +tbox.value;
}
}


Thanks

Francisco




-Mensaje original-
De: users-boun...@xwiki.org [mailto:users-boun...@xwiki.org] En nombre de 
Steven Calkins
Enviado el: lunes, 07 de septiembre de 2009 17:33
Para: XWiki Users
Asunto: Re: [xwiki-users] Selective space export

Hallo Francisco,

I recently exported my entire database for the first time. I noticed that when 
you import the XAR file there are checkboxes that permit you to leave out what 
you want. Is that what you need? Xwiki permits choosing which spaces to import, 
but the choice is on the import side not the export side. To export the entire 
DB you need to have Admin rights, though.

Best regards,


Steven Calkins
-Ursprüngliche Nachricht-
Von: users-boun...@xwiki.org [mailto:users-boun...@xwiki.org] Im Auftrag von 
Hernández Cuchí, Francisco Ricardo
Gesendet: Montag, 7. September 2009 12:51
An: XWiki Users
Betreff: [xwiki-users] Selective space export

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)

  $space

#end

 

#macro(spaceselect $selectspace $spaces $spacesText)

  

#spaceoption("All" $selectspace $spacesText)

#foreach($space in $spaces)

  #spaceoption($space $selectspace $spacesText)

#end

  

#end

 



  {pre}



  Space #spaceselect($space $spaces $spacesText) 



  {/pre}



 

#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/"))

Exportar

#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

Re: [xwiki-users] Selective space export

2009-09-07 Thread Steven Calkins
Hallo Francisco,

I recently exported my entire database for the first time. I noticed that when 
you import the XAR file there are checkboxes that permit you to leave out what 
you want. Is that what you need? Xwiki permits choosing which spaces to import, 
but the choice is on the import side not the export side. To export the entire 
DB you need to have Admin rights, though.

Best regards,


Steven Calkins
-Ursprüngliche Nachricht-
Von: users-boun...@xwiki.org [mailto:users-boun...@xwiki.org] Im Auftrag von 
Hernández Cuchí, Francisco Ricardo
Gesendet: Montag, 7. September 2009 12:51
An: XWiki Users
Betreff: [xwiki-users] Selective space export

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)

  $space

#end

 

#macro(spaceselect $selectspace $spaces $spacesText)

  

#spaceoption("All" $selectspace $spacesText)

#foreach($space in $spaces)

  #spaceoption($space $selectspace $spacesText)

#end

  

#end

 



  {pre}



  Space #spaceselect($space $spaces $spacesText) 



  {/pre}



 

#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/"))

Exportar

#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
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Problem with Access Level

2009-09-07 Thread Nikos Georgosopoulos
I have changed a bit the displayDocumentList macro in
xwiki/templates/macros.vm and now it work for me:

#foreach($docName in $docNames)
  #set($document = $xwiki.getDocument($docName).getTranslatedDocument())
#if($xwiki.hasAccessLevel("view", $context.user, $document.fullName))
  #if(!$blacklistedSpaces.contains($document.getSpace()))
#set($discard = $documentList.add($document))
  #end
#end
  #end

Try it and tell me if it works for you
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Selective space export

2009-09-07 Thread Hernández Cuchí , Francisco Ricardo
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)

  $space

#end

 

#macro(spaceselect $selectspace $spaces $spacesText)

  

#spaceoption("All" $selectspace $spacesText)

#foreach($space in $spaces)

  #spaceoption($space $selectspace $spacesText)

#end

  

#end

 



  {pre}



  Space #spaceselect($space $spaces $spacesText) 



  {/pre}



 

#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/"))

Exportar

#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
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] users Digest, Vol 26, Issue 12

2009-09-07 Thread Jason Binstock
thank you very much for the new wiki

i will put it to good use :)


On 6-Sep-09, at 3:00 AM, users-requ...@xwiki.org wrote:

> Send users mailing list submissions to
>   users@xwiki.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>   http://lists.xwiki.org/mailman/listinfo/users
> or, via email, send a message with subject or body 'help' to
>   users-requ...@xwiki.org
>
> You can reach the person managing the list at
>   users-ow...@xwiki.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of users digest..."
>
>
> Today's Topics:
>
>   1. Re: [psiu] new wiki request (Vincent Massol)
>   2. Re: iclei-eval new wiki request (Vincent Massol)
>   3. Re: iclei-eval new wiki request (Nick Fahey)
>
>
> --
>
> Message: 1
> Date: Sat, 5 Sep 2009 13:17:57 +0200
> From: Vincent Massol 
> Subject: Re: [xwiki-users] [psiu] new wiki request
> To: XWiki Users 
> Message-ID: 
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Hi Jason,
>
> On Sep 3, 2009, at 12:38 PM, Jason Binstock wrote:
>
>> I'd like to start a new wiki for my fraternity to keep us better
>> organized and so I can learn more about the administration of XWiki
>>
>> ideally the server name would be:  psiu.myxwiki.org
>>
>> my username for myxwiki.org is jason53
>
> Your wiki has been created:
> http://psiu.myxwiki.org/xwiki/bin/view/Main/
>
> Enjoy it
>
> Thanks
> -Vincent
>
>
>
> --
>
> Message: 2
> Date: Sat, 5 Sep 2009 13:33:50 +0200
> From: Vincent Massol 
> Subject: Re: [xwiki-users] iclei-eval new wiki request
> To: XWiki Users 
> Message-ID: <4dbc926a-4904-4bb7-9d17-f247c71bb...@massol.net>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Hi Nick,
>
> On Sep 5, 2009, at 11:05 AM, Nick Fahey wrote:
>
>> Hi,
>>
>> I'm itching to get an evaluation xwiki instance in place for our
>> not-for-profit organisation. I'm reasonably certain that xwiki will
>> become our intranet platform and I'd like to dress up a dummy site to
>> demonstrate to others in my organisation.
>>
>> For an outline of who ICLEI is and what we do, please see:
>> http://www.iclei.org/index.php?id=global-about-iclei
>>
>> In short, we are a global not-for-profit membership organisation of
>> local governments working on environmental sustainability. We have  
>> 250
>> staff across 13 offices, worldwide.
>>
>> My MyXWiki.org username is: NickFahey
>
> Created
> http://iclei.myxwiki.org/xwiki/bin/view/Main/
>
> Enjoy!
> -Vincent
>
>
>
> --
>
> Message: 3
> Date: Sun, 06 Sep 2009 08:58:40 +1000
> From: Nick Fahey 
> Subject: Re: [xwiki-users] iclei-eval new wiki request
> To: XWiki Users 
> Message-ID: <4aa2ed20.4040...@iclei.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Dear Vincent,
>
> Thanks very much. I'm looking forward to exploring.
>
> Regards,
> Nick
>
> Vincent Massol wrote:
>> Hi Nick,
>>
>> On Sep 5, 2009, at 11:05 AM, Nick Fahey wrote:
>>
>>
>>> Hi,
>>>
>>> I'm itching to get an evaluation xwiki instance in place for our
>>> not-for-profit organisation. I'm reasonably certain that xwiki will
>>> become our intranet platform and I'd like to dress up a dummy site  
>>> to
>>> demonstrate to others in my organisation.
>>>
>>> For an outline of who ICLEI is and what we do, please see:
>>> http://www.iclei.org/index.php?id=global-about-iclei
>>>
>>> In short, we are a global not-for-profit membership organisation of
>>> local governments working on environmental sustainability. We have  
>>> 250
>>> staff across 13 offices, worldwide.
>>>
>>> My MyXWiki.org username is: NickFahey
>>>
>>
>> Created
>> http://iclei.myxwiki.org/xwiki/bin/view/Main/
>>
>> Enjoy!
>> -Vincent
>>
>> ___
>> users mailing list
>> users@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/users
>>
>
>
>
> --
>
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>
>
> End of users Digest, Vol 26, Issue 12
> *

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users