<
From version < 9.1 >
edited by Vincent Massol
on 2015/07/29
To version < 9.2 >
edited by Vincent Massol
on 2015/07/29
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -44,13 +44,32 @@
44 44  * checkCurrentAuthor: indicate if the current author right should be checked
45 45  * checkCurrentUser: indicate if the result should be filtered based on current user right (only implemented by SOLR right now)
46 46  
47 -== JS API changes for Nested Spaces ==
47 +== JS API changes ==
48 48  
49 49  * It's now possible to create a Nested Spaces Reference using XWik'is Javascript API. For example:(((
50 50  {{code language="javascript"}}
51 -var reference = new XWiki.DocumentReference('wiki', ['space1', 'space2'], 'page');
51 +// Construct a Nested Space reference
52 +var reference = new XWiki.SpaceReference('wiki', ['space1', 'space2']);
53 +expect(XWiki.Model.serialize(reference)).toEqual('wiki:space1.space2');
54 +reference = new XWiki.DocumentReference('wiki', ['space1', 'space2'], 'page');
55 +expect(XWiki.Model.serialize(reference)).toEqual('wiki:space1.space2.page');
56 +// Construct a non-Nested Space reference
57 +reference = new XWiki.SpaceReference('wiki', 'space');
58 +expect(XWiki.Model.serialize(reference)).toEqual('wiki:space');
59 +// Try passing non-valid space parameters
60 +expect(function() {new XWiki.SpaceReference('wiki', [])}).toThrow('Missing mandatory space name or invalid type for: []');
61 +expect(function() {new XWiki.SpaceReference('wiki', 12)}).toThrow('Missing mandatory space name or invalid type for: [12]');
52 52  {{/code}}
53 53  )))
64 +* A new ##XWiki.EntityReference.equals()## method has been added. For example:(((
65 +{{code language="javascript"}}
66 +var reference1 = new XWiki.DocumentReference('wiki', ['space1', 'space2'], 'page');
67 +var reference2 = new XWiki.DocumentReference('wiki', ['space1', 'space2'], 'page');
68 +var reference3 = new XWiki.DocumentReference('wiki2', ['space1', 'space2'], 'page');
69 +expect(reference1.equals(reference2)).toBe(true);
70 +expect(reference1.equals(reference3)).toBe(false);
71 +{{/code}}
72 +)))
54 54  
55 55  == Deprecated and Retired projects ==
56 56  

Get Connected