Ready for review

Finish the XAR format conversion on the Extensions wiki

Last modified by Eleni Cojocariu on 2026/08/20 15:19

The Extensions-wiki half of the XAR format documentation conversion. Its companion on www.xwiki.org, which rewrites the two pages the content moves to, is Finish the XAR format documentation conversion. A change request cannot span two wikis, which is why this is a second one.

Please merge this one after its companion, and not before: until the companion lands, this page is still the only place carrying the complete element list and the format-version changelog, and the Technical ID that the "Documentation" button below resolves through is set by that change request.

XAR Format Specifications

The prose is replaced by a pointer at the two pages it moved to, per Handle Original Documentation Pages. The page is kept rather than deleted, since it is an Extensions-wiki page and is still linked from three dated release notes.

The other two steps of that guide are already done: the page has no attachments left to delete, and its 21 backlinks were triaged and the 13 that needed it repointed across www, extensions and dev — including this extension's own description field. Left alone deliberately: the three dated release notes and the registry entries, which point at the extension page on purpose.

XAR Module

Sets the website field, which is what adds the "Documentation" button to the extension page and makes it list the migrated documentation. The id in the URL is the new pages' Technical ID (xwiki:org.xwiki.platform:xwiki-platform-xar), which the companion change request sets — hence the merge order above.

One thing this does not do

The page carries a comment from Francisco Laferriere (Oct 2024) asking for the XML details that tell a terminal Page from a non-terminal one. The new pages do not answer it yet, and a comment does not travel with a migration. Worth answering on the new Format for Document XML page rather than losing here.

All changes

Summary

Details

Page properties
Content
... ... @@ -1,295 +1,5 @@
1 -{{toc/}}
1 +The XAR format is documented in the XWiki documentation:
2 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.
3 +* [[XAR Format Specifications>>xwiki:documentation.xs.admin.exports.export-content-xar-format.format-specifications.WebHome]], for the archive and its ##package.xml## descriptor.
4 +* [[Format for Document XML>>xwiki:documentation.xs.admin.exports.export-content-xar-format.format-specifications.document-xml.WebHome]], for the XML file of a Page.
4 4  
5 -= Format for package.xml =
6 -
7 -== Current Format ==
8 -
9 -{{warning}}
10 - WIP for migration at: [[XAR Format Specifications>>xwiki:documentation.xs.admin.exports.export-content-xar-format.format-specifications.WebHome]]
11 -{{/warning}}
12 -
13 -{{code language="xml"}}
14 -<package>
15 - <infos>
16 - <name>Package Name</name>
17 - <description>A description of the package</description>
18 - <licence>Some License 2.0</licence>
19 - <author>XWiki.User</author>
20 - <extensionId>extension-id</extensionId>
21 - <version>1.0</version>
22 - <backupPack>false</backupPack>
23 - </infos>
24 - <files>
25 - <file language="" defaultAction="0" type="home">Main.WebHome</file>
26 - <file language="" defaultAction="0">Space.NestedSpace.Page</file>
27 - <file language="" defaultAction="0">Space.TranslatedPage</file>
28 - <file language="fr" defaultAction="0">Space.TranslatedPage</file>
29 - </files>
30 -</package>
31 -{{/code}}
32 -
33 -* ##name##: name representing what's contained in the XAR
34 -* ##description##: more detailed description of the content of the XAR
35 -* ##license##: can be set to specify under which license this XAR content is published
36 -* ##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).
37 -* ##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.
38 -* ##preserveVersion## (optional): if set to true then the history is preserved (the history for each page is part of its XML)
39 -* ##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.
40 -* ##files##
41 -** ##language##: the language of the page. The default page content should use an empty string.
42 -** ##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. More details about those can be found on [[XAR Extensions documentation>>extensions:Extension.Extension Module.Extensions.XAR||anchor="HStandardtypes"]]
43 -** ##defaultAction## {{warning}}deprecated{{/warning}}: when applied (which is not very often) this is the default action to apply on the document
44 -*** ##-1##: undefined, its exact interpretation depends on what is reading it
45 -*** ##0##: overwrite, whatever is in the database should be overwritten. This is what Maven XAR plugin set by default when generating the XAR.
46 -*** ##1##: skip, skip this document
47 -*** ##2##: merge, try to merge the document with what's in the database
48 -** The value inside the ##file## element is the reference of the page, relative to the current wiki (i.e. ##Space.Page##)
49 -
50 -All the date are stored as the number of milliseconds since January 1, 1970, 00:00:00 in GMT time zone.
51 -
52 -== Changelog ==
53 -
54 -=== 1.1 ===
55 -
56 -//XWiki 10.3//
57 -
58 -* Added optional ##type## attribute in ##<file>## elements
59 -
60 -= Format for Document XML =
61 -
62 -== Current Format ==
63 -
64 -{{warning}}
65 - WIP for migration at: [[XAR Format Specifications>>xwiki:documentation.xs.admin.exports.export-content-xar-format.format-specifications.document-xml.WebHome]]
66 -{{/warning}}
67 -
68 -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).
69 -
70 -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>>xwiki:Documentation.DevGuide.Architecture.URL Architecture.Standard URL Format||anchor="HParameter:xpage"]].
71 -
72 -{{code}}
73 -<xwikidoc version="1.5" reference="Space.NestedSpace.Page" locale="">
74 - <web>Space.NestedSpace</web>
75 - <name>Page</name>
76 - <language/>
77 - <defaultLanguage>en</defaultLanguage>
78 - <translation>0</translation>
79 - <creator>XWiki.creator</creator>
80 - <creationDate>946684800000</creationDate>
81 - <versions>jrcsrevisions</versions>
82 - <parent>parent</parent>
83 - <author>XWiki.author</author>
84 - <originalMetadataAuthor>XWiki.originalAuthor</originalMetadataAuthor>
85 - <customClass>customclass</customClass>
86 - <contentAuthor>XWiki.contentAuthor</contentAuthor>
87 - <date>946771200000</date>
88 - <contentUpdateDate>946857600000</contentUpdateDate>
89 - <version>1.1</version>
90 - <title>title</title>
91 - <defaultTemplate>defaultTemplate</defaultTemplate>
92 - <validationScript>validationScript</validationScript>
93 - <comment>comment</comment>
94 - <minorEdit>false</minorEdit>
95 - <syntaxId>syntax/1.0</syntaxId>
96 - <hidden>true</hidden>
97 - <content>content</content>
98 - <renderedcontent/>
99 - <attachment>
100 - <filename>attachment.txt</filename>
101 - <versions>jrcsrevisions</versions>
102 - <author>XWiki.author</author>
103 - <date>947030400000</date>
104 - <version>1.3</version>
105 - <comment>comment</comment>
106 - <content>AAECAwQFBgcICQ==</content>
107 - <filesize>10</filesize>
108 - <revisions>
109 - <revision>
110 - <author>XWiki.author11</author>
111 - <date>747030400000</date>
112 - <version>1.1</version>
113 - <comment>Comment 1.1</comment>
114 - <content>MS4x</content>
115 - </revision>
116 - <revision>
117 - <author>XWiki.author12</author>
118 - <date>847030400000</date>
119 - <version>1.2</version>
120 - <comment>Comment 1.2</comment>
121 - <contentAlias>1.1</contentAlias>
122 - </revision>
123 - <revision>
124 - <author>XWiki.author13</author>
125 - <date>947030400000</date>
126 - <version>1.3</version>
127 - <comment>Comment 1.3</comment>
128 - <contentAlias/>
129 - </revision>
130 - </revisions>
131 - </attachment>
132 - <class>
133 - <name>Space.NestedSpace.Page</name>
134 - <customClass>customClass</customClass>
135 - <customMapping>customMapping</customMapping>
136 - <defaultViewSheet>defaultViewSheet</defaultViewSheet>
137 - <defaultEditSheet>defaultEditSheet</defaultEditSheet>
138 - <defaultWeb>defaultWeb</defaultWeb>
139 - <nameField>nameField</nameField>
140 - <validationScript>validationScript</validationScript>
141 - <prop1>
142 - <disabled>0</disabled>
143 - <name>prop1</name>
144 - <number>1</number>
145 - <numberType>long</numberType>
146 - <prettyName>Prop1</prettyName>
147 - <size>30</size>
148 - <unmodifiable>0</unmodifiable>
149 - <classType>com.xpn.xwiki.objects.classes.NumberClass</classType>
150 - </prop1>
151 - </class>
152 - <object>
153 - <name>Space.NestedSpace.Page</name>
154 - <number>0</number>
155 - <className>Space.NestedSpace.Page</className>
156 - <guid>e2167721-2a64-430c-9520-bac1c0ee68cb</guid>
157 - <class>
158 - <name>Space.NestedSpace.Page</name>
159 - <customClass>customClass</customClass>
160 - <customMapping>customMapping</customMapping>
161 - <defaultViewSheet>defaultViewSheet</defaultViewSheet>
162 - <defaultEditSheet>defaultEditSheet</defaultEditSheet>
163 - <defaultWeb>defaultWeb</defaultWeb>
164 - <nameField>nameField</nameField>
165 - <validationScript>validationScript</validationScript>
166 - <prop1>
167 - <disabled>0</disabled>
168 - <name>prop1</name>
169 - <number>1</number>
170 - <numberType>long</numberType>
171 - <prettyName>Prop1</prettyName>
172 - <size>30</size>
173 - <unmodifiable>0</unmodifiable>
174 - <classType>com.xpn.xwiki.objects.classes.NumberClass</classType>
175 - </prop1>
176 - </class>
177 - <property>
178 - <prop1>1</prop1>
179 - </property>
180 - </object>
181 - <object>
182 - <name>Space.NestedSpace.Page</name>
183 - <number>0</number>
184 - <className>otherclass</className>
185 - <guid>8eaeac52-e2f2-47b2-87e1-bc6909597b39</guid>
186 - <class>
187 - <name>otherclass</name>
188 - <customClass>customClass2</customClass>
189 - <customMapping>customMapping2</customMapping>
190 - <defaultViewSheet>defaultViewSheet2</defaultViewSheet>
191 - <defaultEditSheet>defaultEditSheet2</defaultEditSheet>
192 - <defaultWeb>defaultWeb2</defaultWeb>
193 - <nameField>nameField2</nameField>
194 - <validationScript>validationScript2</validationScript>
195 - <prop2>
196 - <disabled>0</disabled>
197 - <name>prop2</name>
198 - <number>1</number>
199 - <numberType>long</numberType>
200 - <prettyName>Prop2</prettyName>
201 - <size>30</size>
202 - <unmodifiable>0</unmodifiable>
203 - <classType>com.xpn.xwiki.objects.classes.NumberClass</classType>
204 - </prop2>
205 - </class>
206 - <property>
207 - <prop2>2</prop2>
208 - </property>
209 - </object>
210 -</xwikidoc>
211 -{{/code}}
212 -
213 -* ##xwikidoc##: the root XML element
214 -** //version// {{info}}since [[1.1>>||anchor="H1.1-1"]]{{/info}}: the version of the XML format, if no specified then it's ##1.0##
215 -** //reference// {{info}}since [[1.2>>||anchor="H1.2"]]{{/info}}: the reference of the document
216 -** //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
217 -** ##web##: {{warning}}deprecated since [[1.2>>||anchor="H1.2"]] in favor of the the //reference// attribute{{/warning}} property containing the unique space of the document, not taken into account when //reference// attribute is set in ##xwikidoc##
218 -** ##name##: {{warning}}deprecated since [[1.2>>||anchor="H1.2"]] in favor of the the //reference// attribute{{/warning}} the name of the document, not taken into account when //reference// attribute is set in ##xwikidoc##
219 -** ##language##: {{warning}}deprecated since [[1.2>>||anchor="H1.2"]] in favor of the the //locale// attribute{{/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##
220 -** ##date##: the last modification date of the document (format: epoch date and time UTC)
221 -** ##contentUpdateDate##: the last modification date of the document content (format: epoch date and time UTC)
222 -** ##versions##: a serialized version of the ##com.xpn.xwiki.doc.rcs.XWikiRCSArchive## Java object
223 -** {{version since="16.10.0RC1"}}##enforceRequiredRights##: whether [[required rights>>extensions:Extension.Security Module||anchor="HRequiredRights"]] shall be enforced. Only present when the value is ##true## for increased backwards-compatibility.{{/version}}
224 -
225 -* ##attachment##
226 -** //filename//: the name of the file
227 -** //author//: the author of the attachment
228 -** //date//: epoch date and time UTC
229 -** //version//: the version of the attachment
230 -** //comment//: the comment associated to the version of the attachment
231 -** //content//: the binary content serialized in base64
232 -** //filesize//: the size of the attachment in bytes
233 -** //mimetype//: the MIME type of the attachment (as expressed by the [[RFC 6838>>https://tools.ietf.org/html/rfc6838]])
234 -** //charset//: the charset of the attachment (as expressed in the HTTP Content-Type)
235 -** //versions// {{warning}}deprecated since [[1.4>>||anchor="H1.4"]] in vafor of //revisions//{{/warning}}: JRCS Archive dump containing the history of the attachment, deprecated since 12.0
236 -** //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"
237 -*** //revision/contentAlias//: an alias to the content of the indicated version of the attachment revision. Empty string for current attachment.
238 -
239 -{{todo}}
240 -Put some documentation for other elements
241 -{{/todo}}
242 -
243 -== Changelog ==
244 -
245 -=== 1.7 ===
246 -
247 -//XWiki 18.2.0//
248 -
249 -Add the concept of object property type: an attribute specifying the type of an object property if the corresponding class is missing.
250 -
251 -=== 1.6 ===
252 -
253 -//XWiki 16.10.0//
254 -
255 -Add the flag for enforcing required rights.
256 -
257 -=== 1.5 ===
258 -
259 -//XWiki 14.0//
260 -
261 -Add the concept of original metadata document author.
262 -
263 -=== 1.4 ===
264 -
265 -//XWiki 12.0//
266 -
267 -New format for attachments revisions which allows streaming and deduplication.
268 -
269 -=== 1.3 ===
270 -
271 -//XWiki 9.0//
272 -
273 -Use XML 1.1 (instead of 1.0).
274 -
275 -=== 1.2 ===
276 -
277 -//XWiki 7.2//
278 -
279 -Support for nested spaces.
280 -
281 -* ##<web>##, ##<name>## and ##<language>## are deprecated (but still produced)
282 -* new ##reference## and ##locale## attributes in ##<document>## element
283 -
284 -=== 1.1 ===
285 -
286 -//XWiki 6.2//
287 -
288 -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().
289 -
290 -New ##version## attribute in ##<document>## element to indicate the XAR format version (i.e. ##1.1## here).
291 -
292 -The formatting changed are:
293 -
294 -* order of elements changed a bit
295 -* the XML is indented

Summary

Details

ExtensionCode.ExtensionClass[0]
Website
... ... @@ -1,0 +1,1 @@
1 +https://www.xwiki.org/xwiki/bin/view/DocApp/Code/ExtensionLD?id=xwiki%3Aorg.xwiki.platform%3Axwiki-platform-xar&name=%22XAR%20Module%22

Approvers

Approvers have not been explicitly defined for this Change Request. Approvers will be based entirely on approval rights.
This Change Request is ready for review.
No conflicts to show.
The change request cannot be published without valid approval or if at least one review request for changes.

Get Connected