Changes for page XAR Extensions
Last modified by Thomas Mortagne on 2021/03/02 18:22
From version 2.1
edited by Thomas Mortagne
on 2017/04/18 10:24
on 2017/04/18 10:24
Change comment:
There is no comment for this version
To version 3.1
edited by Thomas Mortagne
on 2018/04/23 14:07
on 2018/04/23 14:07
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -2,11 +2,11 @@ 2 2 3 3 {{toc/}} 4 4 5 -= Script service 5 += Script service = 6 6 7 7 The XAR extension handler expose a ScriptService component for XAR extension specific features. 8 8 9 -== XAR Repair 9 +== XAR Repair == 10 10 11 11 Sometimes you have pages coming from an extension in the database but lost the actual extension index. The most common use case is when upgrading from a pre extension manager version of XWiki. 12 12 ... ... @@ -27,7 +27,7 @@ 27 27 public Job repairInstalledExtension(String id, String version, String wiki) 28 28 {{/code}} 29 29 30 -== Extension Diff 30 +== Extension Diff == 31 31 32 32 [since 7.0] 33 33 ... ... @@ -58,7 +58,7 @@ 58 58 public List<String> getDiffJobId(String feature, String namespace) 59 59 {{/code}} 60 60 61 -== Conflict handling 61 +== Conflict handling == 62 62 63 63 [since 9.2] 64 64 ... ... @@ -72,7 +72,7 @@ 72 72 public ConflictQuestion.ConflictType[] getConflictTypes() 73 73 {{/code}} 74 74 75 -== Document to extension 75 +== Document to extension == 76 76 77 77 [since 9.3] 78 78 ... ... @@ -79,6 +79,7 @@ 79 79 The script service provide a set of API to link document to the installed extension where they originated from. 80 80 81 81 It's possible to: 82 + 82 82 * get extensions associated to a specific document reference 83 83 * it's possible to get a ##com.xpn.xwiki.api.Document## instance of a document coming from a XAR package 84 84 * reset a document to it's standard (as in what it looks like in the XAR package) version ... ... @@ -121,3 +121,12 @@ 121 121 */ 122 122 public Document getInstalledExtensionDocument(DocumentReference reference) throws XarExtensionExtension 123 123 {{/code}} 125 + 126 += Customize upgrade behavior = 127 + 128 +10.3 introduced XAR entry types to customize install/upgrade behavior but XAR Extension also provide an extension point for more complex use cases: ##org.xwiki.extension.xar.XWikiDocumentMerger##. You can implement this role which one of the following hint: 129 + 130 +* the XAR entry type name ("home", "configuration", etc) to customize the behavior of this type of XAR entry 131 +* or the reference with ##document:## prefix (for example ##document:XWiki.XWikiPreferences##) to customize the behavior of this specific document 132 + 133 +The method ##merge## will will called every time a document need to be installed/upgraded the the 3 versions of the document (previous standard version, current version in the database, new standard version) and the XWikiDocumentMergerConfiguration which provide information about the type, conflict resolution, etc.