Wiki source code of Exports

Version 56.1 by Iulia Balan on 2015/09/22

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 XWiki offers the ability to export a single wiki page or a set of wiki pages into several formats. To perform a page export click on "Export" in the "More actions" menu, then click "Export as PDF".
6
7 {{image reference="ExportFlamingo.png"/}}
8
9 {{image reference="ExportFlamingoPDF.png"/}}
10
11 // "Export" as it appears using the Flamingo Skin. //
12
13 {{warning}}
14 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.
15 {{/warning}}
16
17 = PDF Export =
18
19 Starting with XWiki Enterprise 3.1, PDF Export has also an UI interface to manage the PDF Export
20
21 {{image reference="pdfExportOptions.png"/}}
22
23 To export a page as PDF use the action menu as explained above or use the following type of URL:
24
25 {{code language="none"}}
26 http://server/xwiki/bin/export/Space/Page?format=pdf
27 {{/code}}
28
29 To export several pages as PDF use the following type of URL (see the ##pages## parameter below):
30
31 {{code language="none"}}
32 http://server/xwiki/bin/export/Space/Page?format=pdf&pages=Admin.Page_A&pages=Admin.Page_B&pages=Admin.Page_C...
33 {{/code}}
34
35 In addition the following URL parameters can be added to refine what should be exported:
36
37 * ##pages##: there can be several such parameters, each representing a page to export. For example: ##&pages=Main.WebHome&pages=Blog.WebHome##.
38 {{info}}When ##pages## parameters are specified, the current document specified in the URL isn't used{{/info}}
39 * ##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.
40 * ##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.
41 * ##pagebreaks##: if the value is set to ##1## then a page break is inserted between all exported pages.
42 * ##comments##: if set to ##1## then also export the comments.
43 * ##attachments##: if set to ##1## then also export the attachments (only if they are images).
44
45 {{info}}
46 It's also possible to [[customize how the generated PDF looks like>>platform:AdminGuide.Configuration#HCustomizingthePDFexportLook26Feel]]. There's a panel that provides [[an UI for PDF Export options.>>extensions:Extension.PDF Export Panel Application]]
47 {{/info}}
48
49 = ODT Export =
50
51 {{info}}
52 ODT Export is available starting with XWiki Enterprise 6.3.
53 {{/info}}
54
55 {{image reference="ExportFlamingoPDF.png"/}}
56
57 If you configure your wiki to work with an office server ([[LibreOffice>>http://www.libreoffice.org/]] or [[OpenOffice>>http://www.openoffice.org/]]) as described in the [[Office Importer Application>>http://extensions.xwiki.org/xwiki/bin/view/Extension/Office+Importer+Application]] you'll notice a new entry in the export modal popup (as long as you are connected to the office server).
58
59 {{info}}
60 You can tweak the export URL to export to other office formats supported by your office server. For instance ##/xwiki/bin/export/Sandbox/WebHome?format=doc## exports Sandbox.WebHome page to Microsoft Word's proprietary DOC format.
61 {{/info}}
62
63 = RTF Export =
64
65 The RTF export works in the same manner as the PDF export.
66
67 {{info}}XWiki 6.2{{/info}} Similar to the ODT export, you need an office server started to see the RTF export option.
68
69 = XAR Export =
70
71 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.
72
73 To export a page as a XAR use the action menu as explained above or use the following type of URL (note that the ##Space/Page## part in the URL is ignored and the Export action only takes into account the ##pages## Query String parameter):
74
75 {{code language="none"}}
76 http://server/xwiki/bin/export/Space/Page?format=xar&pages=Space.Page
77 {{/code}}
78
79 In addition the following URL parameters can be added to refine what should be exported:
80
81 * ##pages##: there can be several such parameters, each representing a pattern of pages to export (prior to XWiki 6.3, only fixed page names could be specified, not patterns). Here is the format of an export pattern:(((
82 {{code language="none"}}
83 wikiid:pageFullNamePattern
84 {{/code}}
85
86 * ##wikiid##: the name of the wiki from where to get the wiki pages
87 * ##pageFullNamePattern##: the full name pattern of the page based on [[SQL "LIKE" comparator>>http://www.techonthenet.com/sql/like.php]]. Remember that the character {{{%}}} has to be converted in {{{%25}}} in an URL.
88 )))
89 * ##history##: if defined then also export the page's history. Example: ##&history=true##
90 * ##backup##: if defined then the XWiki document author of each page remains the same as the one exported when reimporting into an XWiki instance.
91 * ##author##: if defined, specifies the author's name in the XAR export which can later be viewed when reimporting into an XWiki instance.
92 * ##description##: if defined, gives a description added to the XAR export which can later be viewed when reimporting into an XWiki instance.
93 * ##license##: if defined, specifies the license to the XAR export which can later be viewed when reimporting into an XWiki instance.
94 * ##version##: if defined, specifies the version of the export to the XAR.
95
96 Some examples:
97
98 * Exports all pages in the ##Main## space:(((
99 {{code language="none"}}http://server/xwiki/bin/export/Space/Page?format=xar&pages=Main.%25{{/code}}
100 )))
101 * Exports all pages in the current wiki:(((
102 {{code language="none"}}
103 http://server/xwiki/bin/export/Space/Page?format=xar&pages=%25.%25
104 {{/code}}
105 )))
106 * Exports the pages ##Main.WebHome## and ##Blog.WebHome##:(((
107 {{code language="none"}}
108 http://server/xwiki/bin/export/Space/Page?format=xar&pages=Main.WebHome&pages=Blog.WebHome
109 {{/code}}
110 )))
111
112 = HTML Export =
113
114 {{info}}
115 HTML Export is available starting with XWiki Entreprise 6.3.
116 {{/info}}
117
118 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.
119
120 To export a page as HTML use the action menu as explained above or use the following type of URL:
121
122 {{code language="none"}}
123 http://server/xwiki/bin/export/Space/Page?format=html
124 {{/code}}
125
126 In addition the following URL parameters can be added to refine what should be exported:
127
128 * ##name##: the name of the generated Zip file.
129 * ##description##: the comment in the generated Zip file.
130 * ##pages##: there can be several such parameters, each representing a pattern of pages to export. Here is the format of an export pattern:(((
131 {{code language="none"}}
132 wikiid:pageFullNamePattern
133 {{/code}}
134
135 * ##wikiid##: the name of the wiki from where to get the wiki pages
136 * ##pageFullNamePattern##: the full name pattern of the page based on [[SQL "LIKE" comparator>>http://www.techonthenet.com/sql/like.php]]. Remember that the character {{{%}}} has to be converted in {{{%25}}} in an URL.
137 )))
138
139 Some examples:
140
141 * Exports the current page from the current wiki:(((
142 {{code language="none"}}http://server/xwiki/bin/export/Space/Page?format=html{{/code}}
143 )))
144 * Exports the current page from the current wiki in ##packagename.zip##:(((
145 {{code language="none"}}
146 http://server/xwiki/bin/export/Space/Page?format=html&name=packagename
147 {{/code}}
148 )))
149 * Exports all the pages from the ##Space## space as well as the ##Space2.Page## page from the current wiki:(((
150 {{code language="none"}}http://server/xwiki/bin/export/Space/Page?format=html&pages=Space.%25&pages=Space2.Page{{/code}}
151 )))
152 * Exports all the pages from the ##Space## space located in the ##wiki2## subwiki:(((
153 {{code language="none"}}
154 http://server/xwiki/bin/export/Space/Page?format=html&pages=wiki2:Space.%25
155 {{/code}}
156 )))

Get Connected