From version < 45.1 >
edited by Thomas Mortagne
on 2020/01/09 17:02
To version < 46.1 >
edited by Thomas Mortagne
on 2020/01/09 17:03
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -217,7 +217,7 @@
217 217  ** //filesize//: the size of the attachment in bytes
218 218  ** //mimetype//: the MIME type of the attachment (as expressed by the [[RFC 6838>>https://tools.ietf.org/html/rfc6838]])
219 219  ** //charset//: the charset of the attachment (as expressed in the HTTP Content-Type)
220 -** //versions//: JRCS Archive dump containing the history of the attachment, deprecated since 12.0
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 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 222  *** //revision/contentAlias//: an alias to the content of the indicated version of the attachment revision. Empty string for current attachment.
223 223  

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.

package.xml


 
   Package Name
   A description of the package
   Some License 2.0
   XWiki.User
   extension-id
   1.0
   false
 
 
    language="" defaultAction="0" type="home">Main.WebHome
    language="" defaultAction="0">Space.NestedSpace.Page
    language="" defaultAction="0">Space.TranslatedPage
    language="fr" defaultAction="0">Space.TranslatedPage
 
  • name: name representing what's contained in the XAR
  • description: more detailed description of the content of the XAR
  • license: can be set to specify under which license this XAR content is published
  • 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).
  • 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.
  • preserveVersion (optional): if set to true then the history is preserved (the history for each page is part of its XML)
  • 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.
  • files
    • language: the language of the page. The default page content should use an empty string.
    • type since 1.1: the type of the document, it's possible to set any type since extensions can contribute new type. The standard types are the following:
      • default: used to force the default. Edit and delete are not allowed and a 3-way merge is applied to the document during upgrades.
      • configuration: a document containing configuration. Edit is allowed and the document is never upgraded.
      • 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.
      • 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.
    • defaultAction deprecated: when applied (which is not very often) this is the default action to apply on the document
      • -1: undefined, its exact interpretation depends on what is reading it
      • 0: overwrite, whatever is in the database should be overwritten. This is what Maven XAR plugin set by default when generating the XAR.
      • 1: skip, skip this document
      • 2: merge, try to merge the document with what's in the database
    • The value inside the file element is the reference of the page, relative to the current wiki (i.e. Space.Page)

Changelog

1.1

XWiki 10.3

  • Added optional type attribute in elements

Document XML file

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).

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.

version="1.4" reference="Space.NestedSpace.Page" locale="">
 Space.NestedSpace
 Page
 
 en
 0
 XWiki.creator
 946684800000
 jrcsrevisions
 parent
 XWiki.author
 customclass
 XWiki.contentAuthor
 946771200000
 946857600000
 1.1
 </span>title<span style="font-weight: bold; color: #008000;">
 defaultTemplate
 validationScript
 comment
 false
 syntax/1.0
 true
 content
 
 
   attachment.txt
   jrcsrevisions
   XWiki.author
   947030400000
   1.3
   comment
   AAECAwQFBgcICQ==
   10
   
     
       XWiki.author11
       747030400000
       1.1
       Comment 1.1
       MS4x
     
     
       XWiki.author12
       847030400000
       1.2
       Comment 1.2
       1.1
     
     
       XWiki.author13
       947030400000
       1.3
       Comment 1.3
       
     
   
 
 
   Space.NestedSpace.Page
   customClass
   customMapping
   defaultViewSheet
   defaultEditSheet
   defaultWeb
   nameField
   validationScript
   
     0
     prop1
     1
     long
     Prop1
     30
     0
     com.xpn.xwiki.objects.classes.NumberClass
   
 
 
   Space.NestedSpace.Page
   0
   Space.NestedSpace.Page
   e2167721-2a64-430c-9520-bac1c0ee68cb
   
     Space.NestedSpace.Page
     customClass
     customMapping
     defaultViewSheet
     defaultEditSheet
     defaultWeb
     nameField
     validationScript
     
       0
       prop1
       1
       long
       Prop1
       30
       0
       com.xpn.xwiki.objects.classes.NumberClass
     
   
   
     1
   
 

 
   Space.NestedSpace.Page
   0
   otherclass
   8eaeac52-e2f2-47b2-87e1-bc6909597b39
   
     otherclass
     customClass2
     customMapping2
     defaultViewSheet2
     defaultEditSheet2
     defaultWeb2
     nameField2
     validationScript2
     
       0
       prop2
       1
       long
       Prop2
       30
       0
       com.xpn.xwiki.objects.classes.NumberClass
     
   
   
     2
   
 

  • xwikidoc: the root XML element
    • version since 1.1: the version of the XML format, if no specified then it's 1.0 
    • reference since 1.2: the reference of the document
    • locale since 1.2: the locale (as defined in Java Locale specifications) of the document
    • web: deprecated since 1.2 property containing the unique space of the document, not taken into account when reference attribute is set in xwikidoc
    • name: deprecated since 1.2 the name of the document, not taken into account when reference attribute is set in xwikidoc
    • language: deprecated since 1.2 the locale (as defined in Java Locale specifications) of the document, not taken into account when reference attribute is set in xwikidoc
  • attachment
    • filename: the name of the file
    • author: the author of the attachment
    • date: epoch date and time
    • version: the version of the attachment
    • comment: the comment associated to the version of the attachment
    • content: the binary content serialized in base64
    • filesize: the size of the attachment in bytes
    • mimetype: the MIME type of the attachment (as expressed by the RFC 6838)
    • charset: the charset of the attachment (as expressed in the HTTP Content-Type)
    • versions: JRCS Archive dump containing the history of the attachment, deprecated since 12.0
    • versions deprecated since 1.4: JRCS Archive dump containing the history of the attachment, deprecated since 12.0
    • revisions since 1.4: the revisions of the attachment (replace versions), contains the same properties than the attachment plus "contentAlias"
      • revision/contentAlias: an alias to the content of the indicated version of the attachment revision. Empty string for current attachment.

TODO

Put some documentation for other elements

Changelog

1.4

XWiki 12.0

New format for attachments revisions which allows streaming and deduplication.

1.3

XWiki 9.0

Use XML 1.1 (instead of 1.0).

1.2

XWiki 7.2

Support for nested spaces.

  • , and are deprecated (but still produced)
  • new reference and locale attributes in element

1.1

XWiki 6.2

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().

New  version attribute in element to indicate the XAR format version (i.e. 1.1 here).

The formatting changed are:

  • order of elements changed a bit
  • the XML is indented

Get Connected