Commit 16ad6d13 authored by Boris Kocherov's avatar Boris Kocherov

improve documentation thanks @jerome

parent 9ae50ec1
......@@ -40,8 +40,11 @@ rJS(window)
});
```
In parent gadget downloadJSON() can be declared. DownloadJSON() can be used to
fetch schema from jio storage. Example:
In parent gadget downloadJSON() can be declared. downloadJSON() can be used to
fetch schema from [jio storage](https://jio.nexedi.com/). Gadget runs downloadJSON()
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)
......@@ -50,11 +53,25 @@ rJS(window)
url = arr[0],
reference,
args;
// return g.jio_getAttachment(id, "data", {format: "json"});
if (url.startsWith("urn:jio:reference?")) {
reference = decodeURIComponent(url.replace("urn:jio:reference?", ""));
args = {
query: '(portal_type: "JSON Schema") AND ((reference: "' + reference + '"))',
query: Query.objectToSearchText({
type: "complex",
operator: "AND",
query_list: [
{
key: "portal_type",
type: "simple",
value: "JSON Schema"
},
{
key: "reference",
type: "simple",
value: reference
}
]
}),
limit: [0, 1],
select_list: [],
sort_on: [["modification_date", "descending"]]
......
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