Last modified by Thomas Mortagne on 2023/10/13

<
From version < 7.1 >
edited by Guillaume Delhumeau
on 2015/09/23
To version < 11.1 >
edited by Guillaume Delhumeau
on 2015/09/23
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -31,10 +31,23 @@
31 31  
32 32  For more information, see [[Content Organization>>platform:Features.ContentOrganization||anchor="HHistory"]].
33 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 +
34 34  == Miscellaneous ==
35 35  
36 36  <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!>
37 37  
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.
38 38  * 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).
39 39  
40 40  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.
... ... @@ -41,10 +41,248 @@
41 41  
42 42  = For Developers =
43 43  
44 -== <developer feature N> ==
57 +== Nested Spaces ==
45 45  
46 -<description of developer feature N>
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.
47 47  
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 +
48 48  == Deprecated and Retired projects ==
49 49  
50 50  <description of deprecated and retired projects>
... ... @@ -53,11 +53,27 @@
53 53  
54 54  The following dependencies have been upgraded:
55 55  
56 -* <list libraries that have been upgraded>
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]]
57 57  
58 58  == Miscellaneous ==
59 59  
60 -<other dev stuff to add and link to JIRA for all issues fixed>
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.
61 61  
62 62  = Translations =
63 63  

Get Connected