Changes for page XWiki JavaScript API

Last modified by Simon Urli on 2022/09/14

From version 33.2
edited by Vincent Massol
on 2015/07/30
Change comment: typo
To version 35.1
edited by Guillaume Delhumeau
on 2015/08/27
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.gdelhumeau
Content
... ... @@ -200,13 +200,14 @@
200 200  
201 201  {{code language="javascript"}}
202 202  require(['xwiki-meta'], function (xm) {
203 - xm.document // get the current document (eg: Main.WebHome)
204 - xm.wiki // get the current wiki (eg: xwiki)
205 - xm.space // get the current space (eg: Main)
206 - xm.page // get the current page name (eg: WebHome)
207 - xm.version // get the current document version (eg: 1.1)
208 - xm.restURL // get the REST url of the current doc (eg: /xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome)
209 - xm.form_token // get the current CSRF token that you should pass to your scripts to avoid CSRF attacks.
203 + xm.documentReference // since 7.3M2, get the reference of the current document (as a DocumentReference object).
204 + xm.document // get the current document (eg: Main.WebHome) -- deprecated since 7.3M2, use documentReference instead
205 + xm.wiki // get the current wiki (eg: xwiki) -- deprecated since 7.3M2, use documentReference instead
206 + xm.space // get the current space (eg: Main) -- deprecated since 7.3M2, use documentReference instead
207 + xm.page // get the current page name (eg: WebHome) -- deprecated since 7.3M2, use documentReference instead
208 + xm.version // get the current document version (eg: 1.1)
209 + xm.restURL // get the REST url of the current doc (eg: /xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome)
210 + xm.form_token // get the current CSRF token that you should pass to your scripts to avoid CSRF attacks.
210 210  });
211 211  {{/code}}
212 212  
... ... @@ -301,3 +301,8 @@
301 301  expect(reference1.equals(reference3)).toBe(false);
302 302  {{/code}}
303 303  
305 +In 7.2M2 a new XWiki.EntityReferenceTree class which partially mimic Java EntityReferenceTree on Javascript side. There is not much yet, it was mostly introduced to make easier to manipulate a serialized Java EntityReferenceTree.
306 +
307 +{{code}}
308 +this.entities = XWiki.EntityReferenceTree.fromJSONObject(transport.responseText.evalJSON());
309 +{{/code}}

Get Connected