Show last authors
1 {{toc/}}
2
3 A XAR file is a ZIP file with extension ".xar" containing an (optional) "package.xml" descriptor file and in which each document (including the document's history, xobjects, attachments, xclass, etc.) is in a XML file.
4
5 = package.xml =
6
7 {{code language="xml"}}
8 <package>
9 <infos>
10 <name>Package Name</name>
11 <description>A description of the package</description>
12 <licence>Some License 2.0</licence>
13 <author>XWiki.User</author>
14 <extensionId>extension-id</extensionId>
15 <version>1.0</version>
16 <backupPack>false</backupPack>
17 </infos>
18 <files>
19 <file language="" defaultAction="0" type="home">Main.WebHome</file>
20 <file language="" defaultAction="0">Space.NestedSpace.Page</file>
21 <file language="" defaultAction="0">Space.TranslatedPage</file>
22 <file language="fr" defaultAction="0">Space.TranslatedPage</file>
23 </files>
24 </package>
25 {{/code}}
26
27 * ##name##: name representing what's contained in the XAR
28 * ##description##: more detailed description of the content of the XAR
29 * ##license##: can be set to specify under which license this XAR content is published
30 * ##author##: Wiki author of this XAR. This is important. When the XAR is going to be imported, if the "import as backup pack" option is selected, the author mentioned in this field will be preserved (the pages will have this author as their last author).
31 * ##extensionId## (optional): if set then this marks the XAR as containing an Extension. Thus when you import it, the Extension Manager will be able to match it with its Extension database and perform versioning verifications.
32 * ##preserveVersion## (optional): if set to true then the history is preserved (the history for each page is part of its XML)
33 * ##backupPack##: if true it means that the XAR is a backup pack. It's up to the import to decide whether to import it as a backup pack or not but this provides the information that it is a backup pack.
34 * ##files##
35 ** ##language##: the language of the page. The default page content should use an empty string.
36 ** ##type## {{info}}since [[1.1>>||anchor="H1.1"]]{{/info}}: the type of the document, it's possible to set any type since extensions can contribute new type. The standard types are the following:
37 *** ##default##: used to force the default. Edit and delete are not allowed and a 3-way merge is applied to the document during upgrades.
38 *** ##configuration##: a document containing configuration. Edit is allowed and the document is never upgraded.
39 *** ##demo##: a document which purpose is to provide demo data. Edit and delete are allowed and the document is upgraded only if it's not been customized.
40 *** ##customizable## (since XWiki 10.4): a document meant to be modified but not deleted. Edit is allowed and the document is upgraded only if it's not been customized.
41 ** ##defaultAction## {{warning}}deprecated{{/warning}}: when applied (which is not very often) this is the default action to apply on the document
42 *** ##-1##: undefined, its exact interpretation depends on what is reading it
43 *** ##0##: overwrite, whatever is in the database should be overwritten. This is what Maven XAR plugin set by default when generating the XAR.
44 *** ##1##: skip, skip this document
45 *** ##2##: merge, try to merge the document with what's in the database
46 ** The value inside the ##file## element is the reference of the page, relative to the current wiki (i.e. ##Space.Page##)
47
48 == Changelog ==
49
50 === 1.1 ===
51
52 //XWiki 10.3//
53
54 * Added optional ##type## attribute in ##<file>## elements
55
56 = Document XML file =
57
58 Usually the documents files are located in a path where each parent space is a folder (as in ##Space/NestedSpace/Page.xml##) but this is not technically mandatory and parsers won't take the path into account (only what is indicated in the actual document file).
59
60 You can see the XML of a document by exporting it and opening the XAR or by using the [[##xpage=xml## parameter when on wiki page URL>>platform:DevGuide.Standard URL Format||anchor="HParameter:xpage"]].
61
62 {{code}}
63 <xwikidoc version="1.4" reference="Space.NestedSpace.Page" locale="">
64 <web>Space.NestedSpace</web>
65 <name>Page</name>
66 <language/>
67 <defaultLanguage>en</defaultLanguage>
68 <translation>0</translation>
69 <creator>XWiki.creator</creator>
70 <creationDate>946684800000</creationDate>
71 <versions>jrcsrevisions</versions>
72 <parent>parent</parent>
73 <author>XWiki.author</author>
74 <customClass>customclass</customClass>
75 <contentAuthor>XWiki.contentAuthor</contentAuthor>
76 <date>946771200000</date>
77 <contentUpdateDate>946857600000</contentUpdateDate>
78 <version>1.1</version>
79 <title>title</title>
80 <defaultTemplate>defaultTemplate</defaultTemplate>
81 <validationScript>validationScript</validationScript>
82 <comment>comment</comment>
83 <minorEdit>false</minorEdit>
84 <syntaxId>syntax/1.0</syntaxId>
85 <hidden>true</hidden>
86 <content>content</content>
87 <renderedcontent/>
88 <attachment>
89 <filename>attachment.txt</filename>
90 <versions>jrcsrevisions</versions>
91 <author>XWiki.author</author>
92 <date>947030400000</date>
93 <version>1.3</version>
94 <comment>comment</comment>
95 <content>AAECAwQFBgcICQ==</content>
96 <filesize>10</filesize>
97 <revisions>
98 <revision>
99 <author>XWiki.author11</author>
100 <date>747030400000</date>
101 <version>1.1</version>
102 <comment>Comment 1.1</comment>
103 <content>MS4x</content>
104 </revision>
105 <revision>
106 <author>XWiki.author12</author>
107 <date>847030400000</date>
108 <version>1.2</version>
109 <comment>Comment 1.2</comment>
110 <contentAlias>1.1</contentAlias>
111 </revision>
112 <revision>
113 <author>XWiki.author13</author>
114 <date>947030400000</date>
115 <version>1.3</version>
116 <comment>Comment 1.3</comment>
117 <contentAlias/>
118 </revision>
119 </revisions>
120 </attachment>
121 <class>
122 <name>Space.NestedSpace.Page</name>
123 <customClass>customClass</customClass>
124 <customMapping>customMapping</customMapping>
125 <defaultViewSheet>defaultViewSheet</defaultViewSheet>
126 <defaultEditSheet>defaultEditSheet</defaultEditSheet>
127 <defaultWeb>defaultWeb</defaultWeb>
128 <nameField>nameField</nameField>
129 <validationScript>validationScript</validationScript>
130 <prop1>
131 <disabled>0</disabled>
132 <name>prop1</name>
133 <number>1</number>
134 <numberType>long</numberType>
135 <prettyName>Prop1</prettyName>
136 <size>30</size>
137 <unmodifiable>0</unmodifiable>
138 <classType>com.xpn.xwiki.objects.classes.NumberClass</classType>
139 </prop1>
140 </class>
141 <object>
142 <name>Space.NestedSpace.Page</name>
143 <number>0</number>
144 <className>Space.NestedSpace.Page</className>
145 <guid>e2167721-2a64-430c-9520-bac1c0ee68cb</guid>
146 <class>
147 <name>Space.NestedSpace.Page</name>
148 <customClass>customClass</customClass>
149 <customMapping>customMapping</customMapping>
150 <defaultViewSheet>defaultViewSheet</defaultViewSheet>
151 <defaultEditSheet>defaultEditSheet</defaultEditSheet>
152 <defaultWeb>defaultWeb</defaultWeb>
153 <nameField>nameField</nameField>
154 <validationScript>validationScript</validationScript>
155 <prop1>
156 <disabled>0</disabled>
157 <name>prop1</name>
158 <number>1</number>
159 <numberType>long</numberType>
160 <prettyName>Prop1</prettyName>
161 <size>30</size>
162 <unmodifiable>0</unmodifiable>
163 <classType>com.xpn.xwiki.objects.classes.NumberClass</classType>
164 </prop1>
165 </class>
166 <property>
167 <prop1>1</prop1>
168 </property>
169 </object>
170 <object>
171 <name>Space.NestedSpace.Page</name>
172 <number>0</number>
173 <className>otherclass</className>
174 <guid>8eaeac52-e2f2-47b2-87e1-bc6909597b39</guid>
175 <class>
176 <name>otherclass</name>
177 <customClass>customClass2</customClass>
178 <customMapping>customMapping2</customMapping>
179 <defaultViewSheet>defaultViewSheet2</defaultViewSheet>
180 <defaultEditSheet>defaultEditSheet2</defaultEditSheet>
181 <defaultWeb>defaultWeb2</defaultWeb>
182 <nameField>nameField2</nameField>
183 <validationScript>validationScript2</validationScript>
184 <prop2>
185 <disabled>0</disabled>
186 <name>prop2</name>
187 <number>1</number>
188 <numberType>long</numberType>
189 <prettyName>Prop2</prettyName>
190 <size>30</size>
191 <unmodifiable>0</unmodifiable>
192 <classType>com.xpn.xwiki.objects.classes.NumberClass</classType>
193 </prop2>
194 </class>
195 <property>
196 <prop2>2</prop2>
197 </property>
198 </object>
199 </xwikidoc>
200 {{/code}}
201
202 * ##xwikidoc##: the root XML element
203 ** //version// {{info}}since [[1.1>>||anchor="H1.1-1"]]{{/info}}: the version of the XML format, if no specified then it's ##1.0##
204 ** //reference// {{info}}since [[1.2>>||anchor="H1.2"]]{{/info}}: the reference of the document
205 ** //locale// {{info}}since [[1.2>>||anchor="H1.2"]]{{/info}}: the locale (as defined in [[Java Locale specifications>>http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html]]) of the document
206 ** ##web##: {{warning}}deprecated since [[1.2>>||anchor="H1.2"]]{{/warning}} property containing the unique space of the document, not taken into account when //reference// attribute is set in ##xwikidoc##
207 ** ##name##: {{warning}}deprecated since [[1.2>>||anchor="H1.2"]]{{/warning}} the name of the document, not taken into account when //reference// attribute is set in ##xwikidoc##
208 ** ##language##: {{warning}}deprecated since [[1.2>>||anchor="H1.2"]]{{/warning}} the locale (as defined in [[Java Locale specifications>>http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html]]) of the document, not taken into account when //reference// attribute is set in ##xwikidoc##
209
210 * ##attachment##
211 ** //filename//: the name of the file
212 ** //author//: the author of the attachment
213 ** //date//: epoch date and time
214 ** //version//: the version of the attachment
215 ** //comment//: the comment associated to the version of the attachment
216 ** //content//: the binary content serialized in base64
217 ** //filesize//: the size of the attachment in bytes
218 ** //mimetype//: the MIME type of the attachment (as expressed by the [[RFC 6838>>https://tools.ietf.org/html/rfc6838]])
219 ** //charset//: the charset of the attachment (as expressed in the HTTP Content-Type)
220 ** //versions// {{warning}}deprecated since [[1.4>>||anchor="H1.4"]]{{/warning}}: JRCS Archive dump containing the history of the attachment, deprecated since 12.0
221 ** //revisions// {{info}}since [[1.4>>||anchor="H1.4"]]{{/info}}: the revisions of the attachment (replace //versions//), contains the same properties than the attachment plus "contentAlias"
222 *** //revision/contentAlias//: an alias to the content of the indicated version of the attachment revision. Empty string for current attachment.
223
224 {{todo}}
225 Put some documentation for other elements
226 {{/todo}}
227
228 == Changelog ==
229
230 === 1.4 ===
231
232 //XWiki 12.0//
233
234 New format for attachments revisions which allows streaming and deduplication.
235
236 === 1.3 ===
237
238 //XWiki 9.0//
239
240 Use XML 1.1 (instead of 1.0).
241
242 === 1.2 ===
243
244 //XWiki 7.2//
245
246 Support for nested spaces.
247
248 * ##<web>##, ##<name>## and ##<language>## are deprecated (but still produced)
249 * new ##reference## and ##locale## attributes in ##<document>## element
250
251 === 1.1 ===
252
253 //XWiki 6.2//
254
255 No meaningful change. It's just to mark the difference between the first version of the XML produced by Filter module (1.1) and the XML produced by XWikiDocument#toXML().
256
257 New ##version## attribute in ##<document>## element to indicate the XAR format version (i.e. ##1.1## here).
258
259 The formatting changed are:
260
261 * order of elements changed a bit
262 * the XML is indented

Get Connected