largeExportBySpace


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(); for(String space : spaces){ for(String docName : context.getWiki().getSpaceDocsName(space, context)){ pack.add(space+"."+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 { %> should be save at : tomcat/logs/

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

http://skins.ow2.org/skins/skinOW2/images/Featuredvideo.png
  • Panel: Security, Privacy, data Integrity
http://skins.ow2.org/skins/skinOW2/images/watchallvideos.png

 


This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 6.4.4 - Documentation
Powered by XWiki Hosted by Xsalto Free PageRank Checker Creative Commons 2.0 license Legal Notice