Last modified by Thomas Mortagne on 2017/03/24

<
From version < 51.1 >
edited by Guillaume Delhumeau
on 2015/09/24
To version < 52.1 >
edited by Guillaume Delhumeau
on 2015/09/24
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -321,6 +321,70 @@
321 321  
322 322  As explained previously, these logic is 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 page.
323 323  
324 +== JS API Improvements ==
325 +
326 +* It's now possible to create a Nested Spaces Reference using XWiki's Javascript API. For example:(((
327 +{{code language="javascript"}}
328 +// Construct a Nested Space reference
329 +var reference = new XWiki.SpaceReference('wiki', ['space1', 'space2']);
330 +expect(XWiki.Model.serialize(reference)).toEqual('wiki:space1.space2');
331 +reference = new XWiki.DocumentReference('wiki', ['space1', 'space2'], 'page');
332 +expect(XWiki.Model.serialize(reference)).toEqual('wiki:space1.space2.page');
333 +// Construct a non-Nested Space reference
334 +reference = new XWiki.SpaceReference('wiki', 'space');
335 +expect(XWiki.Model.serialize(reference)).toEqual('wiki:space');
336 +// Try passing non-valid space parameters
337 +expect(function() {new XWiki.SpaceReference('wiki', [])}).toThrow('Missing mandatory space name or invalid type for: []');
338 +expect(function() {new XWiki.SpaceReference('wiki', 12)}).toThrow('Missing mandatory space name or invalid type for: [12]');
339 +{{/code}}
340 +)))
341 +* A new ##XWiki.EntityReference.equals()## method has been added. For example:(((
342 +{{code language="javascript"}}
343 +var reference1 = new XWiki.DocumentReference('wiki', ['space1', 'space2'], 'page');
344 +var reference2 = new XWiki.DocumentReference('wiki', ['space1', 'space2'], 'page');
345 +var reference3 = new XWiki.DocumentReference('wiki2', ['space1', 'space2'], 'page');
346 +expect(reference1.equals(reference2)).toBe(true);
347 +expect(reference1.equals(reference3)).toBe(false);
348 +{{/code}}
349 +)))
350 +* A new ##XWiki.EntityReference.fromJSONObject(obejct)## has been added to create a Javascript ##XWiki.EntityReference## from a Java ##EntityReference## directly serialized as JSON:(((
351 +{{code language="javascript"}}
352 +var reference = XWiki.EntityReference.fromJSONObject(jsonText.evalJSON());
353 +{{/code}}
354 +)))
355 +* A new ##XWiki.EntityReferenceTree## JS class has been added, which partially mimics the Java ##EntityReferenceTree## Class. It's still missing features though as it was introduced mostly to make it easier to manipulate a serialized Java ##EntityReferenceTree##.
356 +
357 +== Updated Document Tree Macro ==
358 +
359 +The [[Document Tree Macro>>extensions:Extension.Document Tree Macro]] now supports Nested Pages and Nested Spaces modes. Specifically, the following changes have been made:
360 +
361 +* removed the ##showSpaceAsDocument## parameter (was introduced recently in 7.2M1)
362 +* deprecated the ##showChildDocuments## parameter
363 +* added the ##hierarchyMode## parameter with two supported values: ##reference## (default) and ##parentchild##
364 +
365 +As a result, you can use the document tree macro like this:
366 +
367 +* Nested Page Tree(((
368 +{{code language="none"}}
369 +{{documentTree/}}
370 +{{/code}}
371 +)))
372 +* Nested Space + Page Tree(((
373 +{{code language="none"}}
374 +{{documentTree showSpaces="true" /}}
375 +{{/code}}
376 +)))
377 +* Parent-Child Page Tree(((
378 +{{code language="none"}}
379 +{{documentTree hierarchyMode="parentchild" /}}
380 +{{/code}}
381 +)))
382 +* Old Page Index Tree (i.e. Parent-Child mixed with space grouping)(((
383 +{{code language="none"}}
384 +{{documentTree hierarchyMode="parentchild" showSpaces="true" /}}
385 +{{/code}}
386 +)))
387 +
324 324  == New Reference-related APIs ==
325 325  
326 326  Various new API around References has been introduced while adding support for nested spaces.
... ... @@ -402,6 +402,18 @@
402 402  * The component ##RestURLGenerator## has been added. Its role, in the long term, is to generate a REST URL for any kind of EntityReference. It currently handles ##DocumentReference## and ##SpaceReference##.
403 403  * The corresponding script service has been added: ##$services.rest## with the method ##$services.rest.url($entityReference)##.
404 404  
469 +== Reference Scripting API for Nested Spaces ==
470 +
471 +The Script API for Entity References has been updated with new APIs to support creating Nested Spaces references. For example:
472 +
473 +{{code language="none"}}
474 +{{velocity}}
475 +$services.model.createDocumentReference("wiki", ["space1", "space2"], "page")
476 +$services.model.createDocumentReference("wiki", ["space1", "space2"], "page", "default")
477 +$services.model.createSpaceReference(["space1", "space2"], $services.model.createWikiReference("wiki"))
478 +{{/velocity}}
479 +{{/code}}
480 +
405 405  === Resolve nested spaces in JavaScript ===
406 406  
407 407  {{code language="js"}}
... ... @@ -450,82 +450,6 @@
450 450  * ##checkCurrentAuthor()##: indicate if the current author right should be checked
451 451  * ##checkCurrentUser()##: indicate if the result should be filtered based on current user Right (only implemented by SOLR right now)
452 452  
453 -== JS API Improvements ==
454 -
455 -* It's now possible to create a Nested Spaces Reference using XWiki's Javascript API. For example:(((
456 -{{code language="javascript"}}
457 -// Construct a Nested Space reference
458 -var reference = new XWiki.SpaceReference('wiki', ['space1', 'space2']);
459 -expect(XWiki.Model.serialize(reference)).toEqual('wiki:space1.space2');
460 -reference = new XWiki.DocumentReference('wiki', ['space1', 'space2'], 'page');
461 -expect(XWiki.Model.serialize(reference)).toEqual('wiki:space1.space2.page');
462 -// Construct a non-Nested Space reference
463 -reference = new XWiki.SpaceReference('wiki', 'space');
464 -expect(XWiki.Model.serialize(reference)).toEqual('wiki:space');
465 -// Try passing non-valid space parameters
466 -expect(function() {new XWiki.SpaceReference('wiki', [])}).toThrow('Missing mandatory space name or invalid type for: []');
467 -expect(function() {new XWiki.SpaceReference('wiki', 12)}).toThrow('Missing mandatory space name or invalid type for: [12]');
468 -{{/code}}
469 -)))
470 -* A new ##XWiki.EntityReference.equals()## method has been added. For example:(((
471 -{{code language="javascript"}}
472 -var reference1 = new XWiki.DocumentReference('wiki', ['space1', 'space2'], 'page');
473 -var reference2 = new XWiki.DocumentReference('wiki', ['space1', 'space2'], 'page');
474 -var reference3 = new XWiki.DocumentReference('wiki2', ['space1', 'space2'], 'page');
475 -expect(reference1.equals(reference2)).toBe(true);
476 -expect(reference1.equals(reference3)).toBe(false);
477 -{{/code}}
478 -)))
479 -* A new ##XWiki.EntityReference.fromJSONObject(obejct)## has been added to create a Javascript ##XWiki.EntityReference## from a Java ##EntityReference## directly serialized as JSON:(((
480 -{{code language="javascript"}}
481 -var reference = XWiki.EntityReference.fromJSONObject(jsonText.evalJSON());
482 -{{/code}}
483 -)))
484 -* A new ##XWiki.EntityReferenceTree## JS class has been added, which partially mimics the Java ##EntityReferenceTree## Class. It's still missing features though as it was introduced mostly to make it easier to manipulate a serialized Java ##EntityReferenceTree##.
485 -
486 -== Updated Document Tree Macro ==
487 -
488 -The [[Document Tree Macro>>extensions:Extension.Document Tree Macro]] now supports Nested Pages and Nested Spaces modes. Specifically, the following changes have been made:
489 -
490 -* removed the ##showSpaceAsDocument## parameter (was introduced recently in 7.2M1)
491 -* deprecated the ##showChildDocuments## parameter
492 -* added the ##hierarchyMode## parameter with two supported values: ##reference## (default) and ##parentchild##
493 -
494 -As a result, you can use the document tree macro like this:
495 -
496 -* Nested Page Tree(((
497 -{{code language="none"}}
498 -{{documentTree/}}
499 -{{/code}}
500 -)))
501 -* Nested Space + Page Tree(((
502 -{{code language="none"}}
503 -{{documentTree showSpaces="true" /}}
504 -{{/code}}
505 -)))
506 -* Parent-Child Page Tree(((
507 -{{code language="none"}}
508 -{{documentTree hierarchyMode="parentchild" /}}
509 -{{/code}}
510 -)))
511 -* Old Page Index Tree (i.e. Parent-Child mixed with space grouping)(((
512 -{{code language="none"}}
513 -{{documentTree hierarchyMode="parentchild" showSpaces="true" /}}
514 -{{/code}}
515 -)))
516 -
517 -== Reference Scripting API for Nested Spaces ==
518 -
519 -The Script API for Entity References has been updated with new APIs to support creating Nested Spaces references. For example:
520 -
521 -{{code language="none"}}
522 -{{velocity}}
523 -$services.model.createDocumentReference("wiki", ["space1", "space2"], "page")
524 -$services.model.createDocumentReference("wiki", ["space1", "space2"], "page", "default")
525 -$services.model.createSpaceReference(["space1", "space2"], $services.model.createWikiReference("wiki"))
526 -{{/velocity}}
527 -{{/code}}
528 -
529 529  == XWiki Select Widget ==
530 530  
531 531  A [[new widget has been introduced>>platform:DevGuide.XWikiSelect]], to have a rich select box:
... ... @@ -669,3 +669,4 @@
669 669  {{code language="none"}}
670 670  <clirr output here>
671 671  {{/code}}
672 +

Get Connected