Commit 1364588d authored by Boris Kocherov's avatar Boris Kocherov

rename downloadJSON() to resolveExternalReference() thanks @jerome

parent 16ad6d13
......@@ -40,15 +40,15 @@ rJS(window)
});
```
In parent gadget downloadJSON() can be declared. downloadJSON() can be used to
fetch schema from [jio storage](https://jio.nexedi.com/). Gadget runs downloadJSON()
In parent gadget resolveExternalReference() can be declared. resolveExternalReference() can be used to
fetch schema from [jio storage](https://jio.nexedi.com/). Gadget runs resolveExternalReference()
for fetching schema if schema_url starts with `urn:jio:` but path absolutisation works
only for `urn:jio:reference?`. Example which demonstrates how a schema can be fetched
from jio storage:
```javascript
rJS(window)
.allowPublicAcquisition("downloadJSON", function (arr) {
.allowPublicAcquisition("resolveExternalReference", function (arr) {
var g = this,
url = arr[0],
reference,
......@@ -218,7 +218,7 @@ gadget consists of three parts:
to generate schema selector. Contains various schema optimisations
which reduce user choice according to schema logic.
* Using of parent_gadget.downloadJSON() to resolve "urn:jio:" url schema
* Using of parent_gadget.resolveExternalReference() to resolve "urn:jio:" url schema
links - it allows to use gadget inside officejs application and work
with schemas saved in jio storage. Relative links are correctly resolved too.
......
......@@ -272,7 +272,7 @@
if (download_url.startsWith("urn:jio:")) {
queue = RSVP.Queue()
.push(function () {
return g.downloadJSON(download_url);
return g.resolveExternalReference(download_url);
});
} else {
queue = RSVP.Queue()
......@@ -636,7 +636,7 @@
g.props = {};
g.options = {};
})
.declareAcquiredMethod("downloadJSON", "downloadJSON")
.declareAcquiredMethod("resolveExternalReference", "resolveExternalReference")
.declareAcquiredMethod("notifyChange", "notifyChange")
.allowPublicAcquisition("rootNotifyChange", function () {
this.props.changed = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment