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

rename downloadJSON() to resolveExternalReference() thanks @jerome

parent 16ad6d13
...@@ -40,15 +40,15 @@ rJS(window) ...@@ -40,15 +40,15 @@ rJS(window)
}); });
``` ```
In parent gadget downloadJSON() can be declared. downloadJSON() can be used to In parent gadget resolveExternalReference() can be declared. resolveExternalReference() can be used to
fetch schema from [jio storage](https://jio.nexedi.com/). Gadget runs downloadJSON() 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 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 only for `urn:jio:reference?`. Example which demonstrates how a schema can be fetched
from jio storage: from jio storage:
```javascript ```javascript
rJS(window) rJS(window)
.allowPublicAcquisition("downloadJSON", function (arr) { .allowPublicAcquisition("resolveExternalReference", function (arr) {
var g = this, var g = this,
url = arr[0], url = arr[0],
reference, reference,
...@@ -218,7 +218,7 @@ gadget consists of three parts: ...@@ -218,7 +218,7 @@ gadget consists of three parts:
to generate schema selector. Contains various schema optimisations to generate schema selector. Contains various schema optimisations
which reduce user choice according to schema logic. 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 links - it allows to use gadget inside officejs application and work
with schemas saved in jio storage. Relative links are correctly resolved too. with schemas saved in jio storage. Relative links are correctly resolved too.
......
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
if (download_url.startsWith("urn:jio:")) { if (download_url.startsWith("urn:jio:")) {
queue = RSVP.Queue() queue = RSVP.Queue()
.push(function () { .push(function () {
return g.downloadJSON(download_url); return g.resolveExternalReference(download_url);
}); });
} else { } else {
queue = RSVP.Queue() queue = RSVP.Queue()
...@@ -636,7 +636,7 @@ ...@@ -636,7 +636,7 @@
g.props = {}; g.props = {};
g.options = {}; g.options = {};
}) })
.declareAcquiredMethod("downloadJSON", "downloadJSON") .declareAcquiredMethod("resolveExternalReference", "resolveExternalReference")
.declareAcquiredMethod("notifyChange", "notifyChange") .declareAcquiredMethod("notifyChange", "notifyChange")
.allowPublicAcquisition("rootNotifyChange", function () { .allowPublicAcquisition("rootNotifyChange", function () {
this.props.changed = true; 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