Wiki source code of Release Notes for XWiki 7.2

Version 12.1 by Guillaume Delhumeau on 2015/09/23

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 This is the release notes for [[XWiki Commons>>http://commons.xwiki.org]], [[XWiki Rendering>>http://rendering.xwiki.org]], [[XWiki Platform>>http://platform.xwiki.org]] and [[XWiki Enterprise>>http://enterprise.xwiki.org]]. They share the same release notes as they are released together and have the same version.
6
7 <insert description of release here>
8
9 = New and Noteworthy (since XWiki 7.1) =
10
11 [[Full list of issues fixed and Dashboard for <version>>>http://jira.xwiki.org/secure/Dashboard.jspa?selectPageId=<fill id here>]].
12
13 == Nested Pages ==
14
15 It's now possible to create wiki pages inside other wiki pages. More specifically we've decided to drop the concept of Space in the UI (it's still there at the API/platform level) and instead, to replace it with the concept of Nested Pages.
16
17 We've also decided to drop the concept of Parent/Child relationship since it was too complex for end users to have 2 hierarchies: the Space/Page hierarchy and the Parent/Child hierarchy. The Parent/Child hierarchy also had limitations: you couldn't inherit page permissions for example. Thus the idea is to have a single hierarchy based on Nested Pages.
18
19 Advantages of Nested Pages:
20
21 * The URL reflects the page hierarchy
22 * Finer-grained control: Ability to set permissions at each level
23 * Generally speaking, a nicer and simpler way to organize your content hierarchically
24 * Moving and Deleting pages updates the hierarchy
25
26 Terminology:
27
28 * **Nested Page** (a.k.a **Non-Terminal Page**): This is a wiki page that can have children pages. Technically a Nested Page is implemented as a Nested Space (i.e. a **WebHome** page).
29 * **Non-Nested Page** (a.k.a **Terminal Page**): This a wiki page that cannot have children pages. Applications and script can create Terminal Pages. Advanced Users will also be able to create Terminal Pages from the UI. Standard Users will only be able to create Nested Pages.
30 * **Nested Space**: A Space which has another Space as parent. As mentioned above, a Nested Page is technically implemented as a Nested Space. You will used the term Nested Space when speaking technically about XWiki APIs for example but when talking about UI you should favor using the term Nested Page instead.
31
32 For more information, see [[Content Organization>>platform:Features.ContentOrganization||anchor="HHistory"]].
33
34 == Script right ==
35
36 A new Script Right has been added to allow controlling who has the right to write Scripts. Specifically anyone with Edit rights can edit a page and write a Script in it. However, when the page is rendered the script will only execute if the last author of the page has the Script right.
37
38 {{image reference="[email protected]"/}}
39
40 Example when the author of a script doesn't have the Script right:
41
42 {{image reference="[email protected]"/}}
43
44 == Miscellaneous ==
45
46 <insert misc user stuff and important bug fix descriptions here in a list, when they are too small to warrant a section by themselves - Change the version in the URL below!>
47
48 * When a space home page has an empty title (and the space home page doesn't have a sheet or the sheet doesn't control the title) then the displayed title is now the space name instead of 'WebHome'.
49 * The [[Document Tree Macro>>extensions:Extension.Document Tree Macro]] has a new parameter called ##showSpaceAsDocument## which allows you to merge the space nodes with the space home page nodes.
50 * The list of available template providers is now sorted by document full name.
51 * The [[Orphaned Pages>>extensions:Extension.Index Application||anchor="HAllorphanedDocuments"]] tab from the [[Document Index>>extensions:Extension.Index Application||anchor="HAccessingtheIndexes"]] is now displayed only when [[the Parent-Child Hierarchy Mode>>ReleaseNotesXWiki72M2||anchor="HHidingoftheParent-ChildRelationship"]] is enabled (which is not the case by default).
52
53 See the [[full list of JIRA issues>>http://jira.xwiki.org/sr/jira.issueviews:searchrequest-printable/temp/SearchRequest.html?jqlQuery=project+in+%28XCOMMONS%2C+XRENDERING%2C+XWIKI%2C+XE%29+and+status+%3D+Closed+and+resolution+%3D+Fixed+and+fixVersion+%3D+%22<version>%22&tempMax=1000]] fixed in this release.
54
55 = For Developers =
56
57 == Nested Spaces ==
58
59 Since Nested Spaces were already planned and supported in APIs like ##DocumentReference## there are not too many changes for those who were using recent APIs but there is still some and here are the main ones.
60
61 === Space Reference instead of Space name ===
62
63 The heart of the implementation is that the field that used to contain the unique document space now contain the possibly Nested Space Reference. In practice it means that:
64
65 * "##.##" (dot), "##:##" (colon) and "##\##" (baskslash) characters, which are part of a Space name will now be escaped (using the "##\##" character) in the ##space## (##XWD_WEB##) field from the Document's table in the Database. For example a space named ##Space:with.special\char## will be stored as ##{{{Space\:with\.special\\char}}}##.
66 * Same as for the database, the ##XWikiDocument/Document#getSpace()## methods now return a serialized Reference to the Space instead of what used to be the unique Space name (basically it return what's in the database). Same logic for ##XWikiDocument#setSpace()##. Those field have been deprecated a long time ago but they are still used in lots of places...
67 * Various APIs are also affected by this Space name to Space Reference input change:
68 ** ##XWiki#getSpaceDocsName## methods (both in the public and private XWiki API)
69 ** All the default ##XWikiURLFactory## implementation methods accepting a Space as parameter have been modified to accept a serialized Space Reference. Extensions/code implementing ##XWikiURLFactory## (or extending classes implementing ##XWikiURLFactory## such as ##XWikiServletURLFactory##) will need to be modified to handle nested spaces passed in the ##space## parameter of the various APIs. Here's how to parse Spaces passed as a String:(((
70 {{code language="java"}}
71 private EntityReferenceResolver<String> relativeEntityReferenceResolver =
72 Utils.getComponent(EntityReferenceResolver.TYPE_STRING, "relative");
73 ...
74 or
75 ...
76 @Inject
77 @Named("relative")
78 private EntityReferenceResolver<String> relativeEntityReferenceResolver;
79 ...
80 private List<String> extractSpaceNames(String spaces)
81 {
82 List<String> spaceNames = new ArrayList<>();
83 // Parse the spaces list into Space References
84 EntityReference spaceReference = this.relativeEntityReferenceResolver.resolve(spaces, EntityType.SPACE);
85 for (EntityReference reference : spaceReference.getReversedReferenceChain()) {
86 spaceNames.add(reference.getName());
87 }
88 return spaceNames;
89 }
90 {{/code}}
91 )))
92 ** Extensions/code implementing ##ExportURLFactoryActionHandler## will also need to be modified to handle nested Spaces passed in the ##space## parameter.
93 * Extensions/code implementing ##EntityReferenceSerializer## or ##DocumentReferenceResolver## must now handle Nested Spaces (in the past they were already supposed to handle Nested Spaces but since it was not used they could take shortcuts and it wasn't visible. It's now going to fail, see [[XWIKI-12191>>http://jira.xwiki.org/browse/XWIKI-12191]]).
94
95 === Space separator properly taken into account ===
96
97 The Reference syntax specification was already indication that "##.##" was supposed to be escaped in the space part of the Reference but it was not really taken into account so not escaping it was not making any difference. This is now fixed in the various standard String Reference resolvers so a Reference that don't follow the specification and did not escaped the "##.##" in the space part will be cut is several nested spaces. Anything that was serialized with one of the standard serializers was properly escaped so not worry here, the issue will be more for hand written or hardcoded String References.
98
99 === New XAR format ===
100
101 To support exporting/importing nested spaces some changes has been made to the XAR format. The format remain upward and downward compatible (except that you won't get nested spaces in your < 7.2 instance obviously).
102
103 Two new attributes has been added to the ##<xwikidoc>## root XML element
104
105 * ##reference##: the complete local Reference of the document in standard Reference format. ##<web>## and ##<name>## are deprecated (but still set). ##<web>## keep containing the (unescaped) space name when there is only one space and will contain the space Reference when there is several (when imported in a < 7.2 instance a document exported from a nested space will end up in a space having as name the space reference).
106 * ##locale##: the locale of the document. ##<language>## is deprecated. It was not technically needed in the context of nested spaces but it makes having the Reference as attribute more consistent. It also make getting all the entries from a new format XAR easier and faster since document space and name would be placed anywhere in the document.
107
108 === REST module ===
109
110 * The REST module now supports Nested Spaces. Example of url to access the page ##A.B.C.MyPage##: ##/xwiki/rest/wikis/xwiki/spaces/A/spaces/B/spaces/C/pages/MyPage##.
111
112 === URL modules ===
113
114 The URL modules have been modified to support Nested Spaces. As a consequence the [[URL formats supported by the ##standard## URL scheme have been modified>>extensions:Extension.Standard URL API]].
115
116 === New Rename/Delete Jobs ===
117
118 New code has been developed to support Nested Documents/Nested Spaces and Script Services have been provided and they now run inside Jobs to better handle the fact that they are long-running operations.
119
120 However you can start to test this by using the following Script Services APIs:
121
122 * Copy a Space(((
123 {{code language="none"}}
124 #set ($source = $services.model.resolveSpace('Path.To.Source'))
125 #set ($destination = $services.model.resolveSpace('Path.To.New.Parent'))
126 $services.refactoring.copy($source, $destination).join()
127 {{/code}}
128 )))
129 * Copy a Space As(((
130 {{code language="none"}}
131 #set ($source = $services.model.resolveSpace('Path.To.Source'))
132 #set ($destination = $services.model.resolveSpace('Path.To.New.Name'))
133 $services.refactoring.copyAs($source, $destination).join()
134 {{/code}}
135 )))
136 * Move a Space(((
137 {{code language="none"}}
138 #set ($source = $services.model.resolveSpace('Path.To.Source'))
139 #set ($destination = $services.model.resolveSpace('Path.To.New.Parent'))
140 $services.refactoring.move($source, $destination).join()
141 {{/code}}
142 )))
143 * Move a Document(((
144 {{code language="none"}}
145 #set ($source = $services.model.resolveDocument('Path.To.Source.WebHome'))
146 #set ($destination = $services.model.resolveSpace('Path.To.New.Parent'))
147 $services.refactoring.move($source, $destination).join()
148 {{/code}}
149 )))
150 * Rename a Space(((
151 {{code language="none"}}
152 #set ($source = $services.model.resolveSpace('Path.To.Source'))
153 $services.refactoring.rename($source, 'NewName').join()
154 {{/code}}
155 )))
156 * Rename a Document(((
157 {{code language="none"}}
158 #set ($source = $services.model.resolveDocument('Path.To.Source.WebHome'))
159 $services.refactoring.rename($source, 'NewName').join()
160 {{/code}}
161 )))
162 * Delete a Document(((
163 {{code language="none"}}
164 #set ($source = $services.model.resolveDocument('Path.To.Source.WebHome'))
165 $services.refactoring.delete($source).join()
166 {{/code}}
167 )))
168 * Delete a Space(((
169 {{code language="none"}}
170 #set ($source = $services.model.resolveSpace('Path.To.Source'))
171 $services.refactoring.delete($source).join()
172 {{/code}}
173 )))
174 * Convert a Terminal Document to a Nested Document(((
175 {{code language="none"}}
176 #set ($source = $services.model.resolveDocument('Path.To.Page'))
177 $services.refactoring.convertToNestedDocument($source).join()
178 {{/code}}
179 )))
180 * Convert a Nested Document to a Terminal Document(((
181 {{code language="none"}}
182 #set ($source = $services.model.resolveDocument('Path.To.Source.WebHome'))
183 $services.refactoring.convertToTerminalDocument($source).join()
184 {{/code}}
185 )))
186
187 === New create action parameters and logic ===
188
189 The create action now accepts a ##spaceReference## parameter and a ##name## parameter, together with an optional ##tocreate=terminal## parameter (usable on non-terinal documents). The previous space parameters was not scalable in the context of Nested Spaces since it was just a top-level space name so it did not allow the creation of deeper space levels. More details are available in the [[create action's documentation>>platform:DevGuide.Standard URL Format||anchor="HAction:create"]].
190
191 These logic is now also available in the improved create UI, with the terminal pages option appearing only for advanced users and being checked or unchecked by default, depending on the type of the current document:
192 {{image reference="[email protected]"/}}
193
194 == New Reference-related APIs ==
195
196 Various new API around References has been introduced while adding support for nested spaces.
197
198 === Complete References Providers ===
199
200 Complete References Providers (for DocumentReference, SpaceReference and WikiReference) with default or ##current## hints. They allow getting complete Reference created from each default or current part of those references (for example in SpaceReference you end up with the space of the XWikiContext document and the XWikiContext wiki)
201
202 {{code language="java"}}
203 @Inject
204 Provider<DocumentReference> defaultDocumentReference;
205
206 @Inject
207 @Named("current")
208 Provider<DocumentReference> currentDocumentReference;
209 {{/code}}
210
211 === org.xwiki.model.reference.EntityReferenceProvider ===
212
213 ##org.xwiki.model.reference.EntityReferenceProvider## replaces ##org.xwiki.model.reference.EntityReferenceValueProvider##. It's essentially the same thing but with ##EntityReference## instead of string which allow getting multiple spaces when you ask for the current ##EntityType.SPACE## for example.
214
215 {{code language="java"}}
216 @Inject
217 EntityReferenceProvider provider;
218 {{/code}}
219
220 === Properly support any kind of References in getDocument and getURL ===
221
222 ##com.xpn.xwiki.XWiki#getDocument(EntityReference)## and ##com.xpn.xwiki.api.XWiki#getDocument(EntityReference)## support any kind of Reference properly (e.g. a Space Reference will return the space home page, an Object Reference will return the Object Document Reference, etc).
223
224 Same for ##com.xpn.xwiki.XWiki#getURL(EntityReference)## and ##com.xpn.xwiki.api.XWiki#getURL(EntityReference)##.
225
226 === New helpers in EntityReference ===
227
228 * ##boolean equals(EntityReference otherReference, EntityType to)##: same as equals but only take into account Reference parts up to the passed entity type (included)
229 * ##boolean equals(EntityReference otherReference, EntityType from, EntityType to)##: same as equals but only take into account Reference parts between passed entity types (included)
230 * ##boolean equalsNonRecursive(EntityReference otherReference)##: same as equals but does not take into account the parent
231
232 === New helpers in LocalDocumentReference ===
233
234 * ##LocalDocumentReference(String pageName, EntityReference spaceReference)##: allowed created a LocalDocumentReference from a Space Reference instead of just the space name
235
236 === org.xwiki.model.reference.SpaceReferenceResolver ===
237
238 New default ##String## and ##EntityReference## based SpaceReferenceResolver has been added. It's the same behavior then ##DocumentReferenceBehavior## but for spaces.
239
240 {{code language="java"}}
241 @Inject
242 SpaceReferenceResolver<String> stringResolver;
243
244 @Inject
245 SpaceReferenceResolver<EntityReference> referenceResolver;
246 {{/code}}
247
248 === New model Script Service helpers ===
249
250 * new help to escape an entity name according to default Reference syntax as in:(((
251 {{code language="velocity"}}
252 $services.model.escape('some.space:with\specialchars', 'SPACE')
253 {{/code}}
254
255 will print
256
257 {{code language="nonde"}}
258 some\.space\:with\\specialchars
259 {{/code}}
260 )))
261 * you can retrieve a node from an ##EntityReferenceTree## using its reference:(((
262 {{code language="velocity"}}
263 #set ($alice = $services.model.resolveDocument('wiki:Users.Alice.WebHome'))
264 #set ($bob = $services.model.resolveDocument('wiki:Users.Directory'))
265 #set ($tree = $services.model.toTree($alice, $bob))
266 #set ($usersNode = $tree.get($bob.lastSpaceReference))
267 {{/code}}
268 )))
269
270 === New components to generate REST URLs ===
271
272 * The component ##RestURLGenerator## has been added. Its role, in the long terme, is to generate a REST URL for any kind of EntityReference. It currently handles ##DocumentReference## and ##SpaceReference##.
273 * The corresponding script service has been added: ##$services.rest## with the method ##$services.rest.url($entityReference)##.
274
275 === Resolve nested spaces in JavaScript ===
276
277 {{code language="js"}}
278 var spaceReference = XWiki.Model.resolve('A.B.C', XWiki.EntityType.SPACE);
279 spaceReference.getReversedReferenceChain().map(function(entityReference) {
280 return entityReference.name;
281 }).join(' > ');
282 // Produces: A > B > C
283 {{/code}}
284
285 See the [[JavaScript API documentation>>platform:DevGuide.JavaScriptAPI||anchor="HWorkwithEntityReferences"]] for more details.
286
287 == New readonly XWikiContext provider ==
288
289 You can inject a new "readonly" XWikiContext the following way:
290
291 {{code language="java"}}
292 @Inject
293 @Named("readonly")
294 Provider<XWikiContext> roXWikiContextProvider;
295 {{/code}}
296
297 The difference with default provider is that the readonly one won't try to create a new XWikiContext and will return null if it can't find any. It's been introduce for some low level components that were used during XWikiContext creation but in general it should be used by any component that only search for some XWikiContext property that might be null even in a valid XWikiContext.
298
299 == Deprecated and Retired projects ==
300
301 <description of deprecated and retired projects>
302
303 == Upgrades ==
304
305 The following dependencies have been upgraded:
306
307 * [[httpclient 4.5>>http://jira.xwiki.org/browse/XCOMMONS-815]]
308 * [[cssparser 0.9.16>>http://jira.xwiki.org/browse/XCOMMONS-817]]
309 * [[less4j 1.12.0>>http://jira.xwiki.org/browse/XWIKI-12161]]
310 * [[Joda-Time 2.8.1>>http://jira.xwiki.org/browse/XWIKI-12159]]
311 * [[Bootstrap 3.3.5>>http://jira.xwiki.org/browse/XWIKI-12211]]
312 * [[Infinispan 7.2.3>>http://jira.xwiki.org/browse/XWIKI-12227]]
313 * [[HSQLDB 2.3.3>>http://jira.xwiki.org/browse/XE-1491]]
314 * [[JGroups 3.6.4>>http://jira.xwiki.org/browse/XWIKI-12215]]
315 * [[Jackson 2.5.4>>http://jira.xwiki.org/browse/XCOMMONS-828]]
316
317 == Miscellaneous ==
318
319 * Objects, attachments and the document's class are now clearly not considered content, but metadata. Thus, any change in these will set the document's (XWikiDocument) metadataDirty flag to true and not touch the document's contentDirty flag unless there is an actual change in the document's content or title fields. This is also in line with the original intent of the contentAuthor document field. The direct impact of this is that the contentAuthor field will be updated only when the content is changed and thus the programming/script rights of a document will be changed much less often than before and much less by accident.
320 * custom Maven properties which have a special meaning (like ##xwiki.extension.features##) are not ##duplicated## in Extension custom properties anymore
321 * standard fields names have been added to ##org.xwiki.extension.rating.RatingExtension##
322 * URL configuration now use default ConfigurationSource provider instead of only ##xwiki.properties## one which means it's possible to overwrite properties for each wiki among other things
323 * Added ability to set and change the URL scheme to use in the Execution Context. This allows code to dynamically change the generated URLs when Rendering a document (useful when performing an Export for example).
324 * Started a new ##filesystem## URL Scheme for exporting Resources to the filesystem and generating URLs to them (useful for the HTML Export for example). At the moment, only the ##webjars## Resource Type is using it and all other Resource Types are using the old ##XWikiURLFactory## class.
325 * A new DocumentModelBridge.getContentAuthorReference() method has been added to allow accessing the content author of a document without depending on oldcore.
326 * Deprecate XWiki.parseContent(...) since it is was misleading and outdated. Its documentation mentioned that the passed content is parsed as velocity code, but it was actually doing much more than that and had some unwanted side-effect. Instead, use the parse/renderer that is specific to the type of content you have. See more details in [[XWIKI-12299>>http://jira.xwiki.org/browse/XWIKI-12299]].
327 * A new script service is available to retrieve the status of a specified job or the status of the currently running job from a specified group. See the [[Job Module>>extensions:Extension.Job Module||anchor="HScriptService"]] documentation for details.
328
329 = Translations =
330
331 The following translations have been updated:
332
333 {{language codes="none, none"/}}
334
335 = Tested Browsers & Databases =
336
337 {{include reference="TestReports.ManualTestReportTemplateSummary"/}}
338
339 = Performances tests compared to 6.4.5 =
340
341 There hasn't really been much performance work on this version so we get mostly the same result than in [[7.1 release note>>ReleaseNotesXWiki71]]. The important point here was to check if nested spaces ha much impact on performances.
342
343 {{display reference="test:Performances.Jetty HSQLDB single wiki 645 to 72" section="HSummary"/}}
344
345 More details on [[performance comparison on single wiki between 7.2 and 6.4.5>>test:Performances.Jetty HSQLDB single wiki 645 to 72]].
346
347 = Known issues =
348
349 * [[Bugs we know about>>http://jira.xwiki.org/secure/IssueNavigator.jspa?reset=true&jqlQuery=category+%3D+%22Top+Level+Projects%22+AND+issuetype+%3D+Bug+AND+resolution+%3D+Unresolved+ORDER+BY+updated+DESC]]
350
351 = Backward Compatibility and Migration Notes =
352
353 == General Notes ==
354
355 When upgrading make sure you compare your ##xwiki.cfg##, ##xwiki.properties## and ##web.xml## files with the newest version since some configuration parameters may have been modified or added. Note that you should add ##xwiki.store.migration=1## so that XWiki will attempt to automatically migrate your current database to the new schema. Make sure you backup your Database before doing anything.
356
357 == Issues specific to XWiki 7.2 ==
358
359 === Nested spaces ===
360
361 See [[previous Nested spaces section>>||anchor="HNestedSpaces"]] for details on what changes in the way some API and the database are dealing with the Document Space.
362
363 Note that some existing Extensions are impacted and may break slightly: Extensions taking some user input and creating Spaces based on that will most likely display {{{"\."}}}, {{{"\:"}}} and {{{"\\"}}} in the UI. Unless they already clean the user input and remove ".", ":" and "\" characters. So for example if a user enter a Space name of "my.space":
364
365 * before 7.2: the Extension would create/display a Space named "my.space"
366 * after 7.2: the Extension will create/display a Space named "my\.space"
367
368 === URLs ===
369
370 In order to support Nested Documents and have the ability that typing a URL such as ##/A## will lead to ##A.WebHome## we have stopped supporting URLs that don't specify the ##view## action (when ##xwiki.showviewaction=1##). Thus URLs such as ##/xwiki/bin/Something## now need to be written as ##/xwiki/bin/view/Something##. If ##xwiki.showviewaction=0## then you can still write ##/xwiki/bin/<something>## provided that ##<something>## isn't equal to ##view##. If it is (you have a space named ##view##) then you need to use ##/xwiki/bin/view/view[...]##.
371
372 === Templates ===
373
374 All the templates specific to [[extensions:Extension.Colibri Skin]] had been moved to it. If your skin depends on some of these templates, you should set Colibri as parent of your skin.
375
376 == API Breakages ==
377
378 The following APIs were modified since XWiki 7.1:
379
380 {{code language="none"}}
381 <clirr output here>
382 {{/code}}

Get Connected