Wiki source code of Exports
Version 12.8 by Silvia Macovei on 2009/10/08
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
12.1 | 1 | = Exports = |
![]() |
1.1 | 2 | |
3 | XWiki offers the ability to export a single wiki page or a set of wiki pages into several formats: | ||
4 | |||
![]() |
12.3 | 5 | {{toc start=2 depth=6 numbered=false scope=page /}} |
![]() |
12.1 | 6 | |
![]() |
1.1 | 7 | To perform a page export simply go to the page, select the "Print" menu (in the Albatross/Toucan skins - if you use another skin it may be located somewhere else) and select the type of export you wish to perform as shown in the following screenshot. |
8 | |||
![]() |
12.1 | 9 | image:export.png |
![]() |
1.1 | 10 | |
![]() |
12.1 | 11 | {{warning}}Right now we don't have any user interface for exporting a set of wiki pages. This is a [[work in progress>>http://jira.xwiki.org/jira/browse/XWIKI-1289]]. However it's possible to export a set of pages by following the instructions below for each export format.{{/warning}} |
![]() |
3.1 | 12 | |
![]() |
12.1 | 13 | == PDF Export == |
![]() |
1.1 | 14 | |
![]() |
12.1 | 15 | To export a page as PDF use the action menu as explained above or use the following type of URL: |
![]() |
3.1 | 16 | |
![]() |
12.1 | 17 | {{code language="none"}}http://server/xwiki/bin/export/Spave/Page?format=pdf{{/code}} |
18 | |||
![]() |
3.1 | 19 | In addition the following URL parameters can be added to refine what should be exported: |
![]() |
12.5 | 20 | * ##pages##: there can be several such parameters, each representing a page to export. For example: ##&pages=Main.WebHome&pages=Blog.WebHome##. |
![]() |
12.3 | 21 | * ##includechilds##: the value is a number specifying the depth of children pages to include in the PDF export. For example ##&includechilds=2## will include all children pages of the page to export, all its children (i.e. pages which have the page as its parent) and all the children's children. |
![]() |
12.7 | 22 | * ##includelinks##: the value is a number specifying the depth of linked pages to include in the PDF export. For example ##&includelinks=2## will include all pages linked from the page to export and the links in the linked pages. |
23 | * ##pagebreaks##: if the value is set to ##1## then a page break is inserted between all exported pages. | ||
![]() |
12.3 | 24 | * ##comments##: if set to ##1## then also export the comments. |
25 | * ##attachments##: if set to ##1## then also export the attachments (only if they are images). | ||
26 | |||
![]() |
12.1 | 27 | {{info}}It's also possible to [[customize how the generated PDF looks like>>platform:AdminGuide.Configuration#HCustomizingthePDFexportLook26Feel]].{{/info}} |
![]() |
3.1 | 28 | |
![]() |
12.1 | 29 | == RTF Export == |
![]() |
4.2 | 30 | |
![]() |
4.1 | 31 | The RTF export works exactly in the same manner as the PDF export. |
32 | |||
![]() |
12.1 | 33 | == XAR Export == |
![]() |
1.1 | 34 | |
![]() |
12.1 | 35 | The XAR export allows exporting pages in the internal XML format used by XWiki. This is the format that you can use to [[Import/Export>>platform:AdminGuide.ImportExport]] pages and applications into/from XWiki instances. |
![]() |
12.3 | 36 | |
![]() |
4.1 | 37 | To export a page as a XAR use the action menu as explained above or use the following type of URL: |
38 | |||
![]() |
12.1 | 39 | {{code language="none"}}http://server/xwiki/bin/export/Spave/Page?format=xar{{/code}} |
40 | |||
![]() |
4.1 | 41 | In addition the following URL parameters can be added to refine what should be exported: |
![]() |
12.1 | 42 | |
![]() |
12.6 | 43 | * ##pages##: there can be several such parameters, each representing a page to export. For example: ##&pages=Main.WebHome&pages=Blog.WebHome##. |
44 | * ##history##: if defined then also export the page's history. Example: ##&history=true## | ||
![]() |
12.8 | 45 | * ##backup##: if defined then the XWiki document author of each page remains the same as the one exported when reimporting into an XWiki instance. |
46 | * ##author##: if defined, specifies the author's name in the XAR export which can later be viewed when reimporting into an XWiki instance. | ||
47 | * ##description##: if defined, gives a description added to the XAR export which can later be viewed when reimporting into an XWiki instance. | ||
48 | * ##license##: if defined, specifies the license to the XAR export which can later be viewed when reimporting into an XWiki instance. | ||
![]() |
12.6 | 49 | * ##version##: if defined, specifies the version of the export to the XAR. |
![]() |
4.1 | 50 | |
![]() |
12.1 | 51 | == HTML Export == |
![]() |
1.1 | 52 | |
![]() |
10.2 | 53 | The HTML export allows exporting wiki pages as static HTML pages independent from the XWiki engine. All pages are exported in view mode. That way you can export a whole space containing documentation and access it on your computer without any web server. The export is done with the current skin. |
![]() |
12.3 | 54 | |
![]() |
10.1 | 55 | To export a page as HTML use the action menu as explained above or use the following type of URL: |
![]() |
9.1 | 56 | |
![]() |
12.1 | 57 | {{code language="none"}}http://server/xwiki/bin/export/Space/Page?format=html{{/code}} |
58 | |||
![]() |
5.1 | 59 | In addition the following URL parameters can be added to refine what should be exported: |
![]() |
12.1 | 60 | |
![]() |
12.6 | 61 | * ##name##: the name of the generated Zip file. |
62 | * ##description##: the comment in the generated Zip file. | ||
63 | * ##pages##: there can be several such parameters, each representing a pattern of pages to export. Here is the format of an export pattern: ##wikinamepattern:pageFullNamePattern## | ||
![]() |
12.3 | 64 | ** ##wikinamepattern##: the name of the wiki based on [[Java regular expressions>>http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html#construct]] |
65 | ** ##pageFullNamePatern##: the full name pattern of the page based on [[HQL "LIKE" comparator>>http://www.techonthenet.com/sql/like.php]]. Remember that the character % has to be converted in %25 in an URL. | ||
66 | |||
![]() |
5.1 | 67 | Some examples : |
68 | |||
![]() |
12.1 | 69 | * Exports the current page from the current wiki: |
![]() |
5.1 | 70 | |
![]() |
12.1 | 71 | {{code language="none"}}http://server/xwiki/bin/export/Space/Page?format=html{{/code}} |
![]() |
6.1 | 72 | |
![]() |
12.3 | 73 | * Exports the current page from the current wiki in ##packagename.zip##: |
![]() |
7.1 | 74 | |
![]() |
12.1 | 75 | {{code language="none"}}http://server/xwiki/bin/export/Space/Page?format=html&name=packagename{{/code}} |
76 | |||
![]() |
12.3 | 77 | * Exports all the pages from the ##Space## space as well as the ##Space2.Page## page from the current wiki: |
![]() |
12.1 | 78 | |
79 | {{code language="none"}}http://server/xwiki/bin/export/Space/Page?format=html&pages=Space.%25&pages=Space2.Page{{/code}} | ||
80 | |||
![]() |
12.3 | 81 | * Exports all the pages from the ##Space## space located in the ##wiki2## subwiki: |
![]() |
12.1 | 82 | |
83 | {{code language="none"}}http://server/xwiki/bin/export/Space/Page?format=html&pages=wiki2:Space.%25{{/code}} | ||
84 | |||
85 | * Exports all the pages from all wikis/subwikis: | ||
86 | |||
87 | {{code language="none"}}http://server/xwiki/bin/export/Space/Page?format=html&pages=.*:%25{{/code}} |