|
525
|
1 |
<!DOCTYPE html> |
|
|
2 |
<html lang="en"> |
|
|
3 |
<head> |
|
|
4 |
<meta charset="utf-8"> |
|
|
5 |
<title>DataSchema</title> |
|
|
6 |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic"> |
|
|
7 |
<link rel="stylesheet" href="../../build/cssgrids/cssgrids-min.css"> |
|
|
8 |
<link rel="stylesheet" href="../assets/css/main.css"> |
|
|
9 |
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css"> |
|
|
10 |
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png"> |
|
|
11 |
<script src="../../build/yui/yui-min.js"></script> |
|
|
12 |
|
|
|
13 |
</head> |
|
|
14 |
<body> |
|
|
15 |
<!-- |
|
|
16 |
<a href="https://github.com/yui/yui3"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a> |
|
|
17 |
--> |
|
|
18 |
<div id="doc"> |
|
|
19 |
<div id="hd"> |
|
|
20 |
<h1><img src="http://yuilibrary.com/img/yui-logo.png"></h1> |
|
|
21 |
</div> |
|
|
22 |
|
|
|
23 |
<a href="#toc" class="jump">Jump to Table of Contents</a> |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
<h1>DataSchema</h1> |
|
|
27 |
<div class="yui3-g"> |
|
|
28 |
<div class="yui3-u-3-4"> |
|
|
29 |
<div id="main"> |
|
|
30 |
<div class="content"><div class="intro"> |
|
|
31 |
<p> |
|
|
32 |
The DataSchema Utility applies a given schema against data of arbitrary |
|
|
33 |
formats, normalizing input such as JSON, XML, or delimited text into a |
|
|
34 |
JavaScript object with known properties. The value of the DataSchema |
|
|
35 |
Utility is in its ability to translate data from a variety of sources |
|
|
36 |
into a consistent format for consumption by components in a predictable |
|
|
37 |
manner. |
|
|
38 |
</p> |
|
|
39 |
</div> |
|
|
40 |
|
|
|
41 |
<h2 id="getting-started">Getting Started</h2> |
|
|
42 |
|
|
|
43 |
<p> |
|
|
44 |
To include the source files for DataSchema and its dependencies, first load |
|
|
45 |
the YUI seed file if you haven't already loaded it. |
|
|
46 |
</p> |
|
|
47 |
|
|
|
48 |
<pre class="code prettyprint"><script src="http://yui.yahooapis.com/3.10.3/build/yui/yui-min.js"></script></pre> |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
<p> |
|
|
52 |
Next, create a new YUI instance for your application and populate it with the |
|
|
53 |
modules you need by specifying them as arguments to the <code>YUI().use()</code> method. |
|
|
54 |
YUI will automatically load any dependencies required by the modules you |
|
|
55 |
specify. |
|
|
56 |
</p> |
|
|
57 |
|
|
|
58 |
<pre class="code prettyprint"><script> |
|
|
59 |
// Create a new YUI instance and populate it with the required modules. |
|
|
60 |
YUI().use('dataschema', function (Y) { |
|
|
61 |
// DataSchema is available and ready for use. Add implementation |
|
|
62 |
// code here. |
|
|
63 |
}); |
|
|
64 |
</script></pre> |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
<p> |
|
|
68 |
For more information on creating YUI instances and on the |
|
|
69 |
<a href="http://yuilibrary.com/yui/docs/api/classes/YUI.html#method_use"><code>use()</code> method</a>, see the |
|
|
70 |
documentation for the <a href="../yui/index.html">YUI Global Object</a>. |
|
|
71 |
</p> |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
<h2 id="using">Using the DataSchema</h2> |
|
|
75 |
|
|
|
76 |
<p>This section describes how to use the DataSchema in further detail.</p> |
|
|
77 |
|
|
|
78 |
<h3 id="basics">DataSchema basics</h3> |
|
|
79 |
|
|
|
80 |
<p> |
|
|
81 |
DataSchema classes are standalone static utilities that accept data input |
|
|
82 |
plus a schema definition and return a JavaScript object with the following |
|
|
83 |
properties: |
|
|
84 |
</p> |
|
|
85 |
|
|
|
86 |
<table> |
|
|
87 |
<thead> |
|
|
88 |
<tr> |
|
|
89 |
<th>Property</th> |
|
|
90 |
<th>Type</th> |
|
|
91 |
<th>Description</th> |
|
|
92 |
</tr> |
|
|
93 |
</thead> |
|
|
94 |
<tbody> |
|
|
95 |
<tr> |
|
|
96 |
<td><code>results</code></td> |
|
|
97 |
<td>Array</td> |
|
|
98 |
<td>An array of data.</td> |
|
|
99 |
</tr> |
|
|
100 |
<tr> |
|
|
101 |
<td><code>meta</code></td> |
|
|
102 |
<td>Object</td> |
|
|
103 |
<td>Arbitrary data values filtered from the input data.</td> |
|
|
104 |
</tr> |
|
|
105 |
</tbody> |
|
|
106 |
</table> |
|
|
107 |
|
|
|
108 |
<p> |
|
|
109 |
Note that the schema you define will depend on which subclass of DataSchema |
|
|
110 |
is being used. |
|
|
111 |
</p> |
|
|
112 |
|
|
|
113 |
<h4 id="array">DataSchema.Array</h4> |
|
|
114 |
|
|
|
115 |
<p> |
|
|
116 |
Use DataSchema.Array when working with JavaScript arrays. These arrays may |
|
|
117 |
contain JavaScript objects, other arrays, or primitive values. |
|
|
118 |
</p> |
|
|
119 |
|
|
|
120 |
<pre class="code prettyprint">// A sample array of objects |
|
|
121 |
[ |
|
|
122 |
{make:"Chevrolet",model:"Bel Air",year:1957}, |
|
|
123 |
{make:"Dodge",model:"Dart",year:1964}, |
|
|
124 |
{make:"Ford",model:"Mustang",year:1968} |
|
|
125 |
]; |
|
|
126 |
|
|
|
127 |
// A sample array of arrays |
|
|
128 |
[ |
|
|
129 |
["Chevrolet", "Bel Air", 1957], |
|
|
130 |
["Dodge", "Dart", 1964], |
|
|
131 |
["Ford", "Mustang", 1968] |
|
|
132 |
]; |
|
|
133 |
|
|
|
134 |
// A sample array of primitives |
|
|
135 |
[ |
|
|
136 |
"1957 Chevrolet Bel Air", "1964 Dodge Dart", "1968 Ford Mustang" |
|
|
137 |
];</pre> |
|
|
138 |
|
|
|
139 |
|
|
|
140 |
<p>Define a schema with the following properties for your array data:</p> |
|
|
141 |
|
|
|
142 |
<table> |
|
|
143 |
<thead> |
|
|
144 |
<tr> |
|
|
145 |
<th>Property</th> |
|
|
146 |
<th>Type</th> |
|
|
147 |
<th>Description</th> |
|
|
148 |
</tr> |
|
|
149 |
</thead> |
|
|
150 |
<tbody> |
|
|
151 |
<tr> |
|
|
152 |
<td><code>resultFields</code></td> |
|
|
153 |
<td>Array</td> |
|
|
154 |
<td>Keys to assign to the values contained in the array.</td> |
|
|
155 |
</tr> |
|
|
156 |
</tbody> |
|
|
157 |
</table> |
|
|
158 |
|
|
|
159 |
<pre class="code prettyprint">var mySchema = { |
|
|
160 |
resultFields: [{key:"make"}, {key:"model"}, {key:"year"}] |
|
|
161 |
}; |
|
|
162 |
|
|
|
163 |
// Returns an object with the properties "results" and "meta" |
|
|
164 |
var myOutput = Y.DataSchema.Array.apply(mySchema, myData);</pre> |
|
|
165 |
|
|
|
166 |
|
|
|
167 |
<h4 id="json">DataSchema.JSON</h4> |
|
|
168 |
|
|
|
169 |
<p> |
|
|
170 |
Use DataSchema.JSON when working with JavaScript objects or JSON data. |
|
|
171 |
Typically, your data will hold meta values as well as an internal array of |
|
|
172 |
tabular data. |
|
|
173 |
</p> |
|
|
174 |
|
|
|
175 |
<pre class="code prettyprint">// Sample JSON data |
|
|
176 |
{ |
|
|
177 |
"profile":{ |
|
|
178 |
"current":160, |
|
|
179 |
"target":150 |
|
|
180 |
}, |
|
|
181 |
"program": [ |
|
|
182 |
{ |
|
|
183 |
"category":"exercise", |
|
|
184 |
"weekly schedule":[ |
|
|
185 |
{"day":"sunday", "activity":"swimming"}, |
|
|
186 |
{"day":"monday", "activity":"running"}, |
|
|
187 |
{"day":"tuesday", "activity":"biking"}, |
|
|
188 |
{"day":"wednesday", "activity":"running"}, |
|
|
189 |
{"day":"thursday", "activity":"swimming"}, |
|
|
190 |
{"day":"friday", "activity":"running"}, |
|
|
191 |
{"day":"saturday", "activity":"golf"} |
|
|
192 |
] |
|
|
193 |
} |
|
|
194 |
] |
|
|
195 |
};</pre> |
|
|
196 |
|
|
|
197 |
|
|
|
198 |
<p> |
|
|
199 |
Locators are string values in your schema that use dot notation or bracket |
|
|
200 |
syntax to point to data values within the object. Define a schema with the |
|
|
201 |
following properties for your object data: |
|
|
202 |
</p> |
|
|
203 |
|
|
|
204 |
<table> |
|
|
205 |
<thead> |
|
|
206 |
<tr> |
|
|
207 |
<th>Property</th> |
|
|
208 |
<th>Type</th> |
|
|
209 |
<th>Description</th> |
|
|
210 |
</tr> |
|
|
211 |
</thead> |
|
|
212 |
<tbody> |
|
|
213 |
<tr> |
|
|
214 |
<td><code>metaFields</code></td> |
|
|
215 |
<td>Object</td> |
|
|
216 |
<td>Key/locator pairs that point to arbitrary data values.</td> |
|
|
217 |
</tr> |
|
|
218 |
<tr> |
|
|
219 |
<td><code>resultListLocator</code></td> |
|
|
220 |
<td>String</td> |
|
|
221 |
<td>Locator to an internal array of tabular data.</td> |
|
|
222 |
</tr> |
|
|
223 |
<tr> |
|
|
224 |
<td><code>resultFields</code></td> |
|
|
225 |
<td>Array</td> |
|
|
226 |
<td>Keys to assign to the values contained in the array.</td> |
|
|
227 |
</tr> |
|
|
228 |
</tbody> |
|
|
229 |
</table> |
|
|
230 |
|
|
|
231 |
<pre class="code prettyprint">var mySchema = { |
|
|
232 |
metaFields: {current:"profile.current", target:"profile.target"}, |
|
|
233 |
resultListLocator: "program[0]['weekly schedule']", |
|
|
234 |
resultFields: [{key:"day"}, {key:"activity"}] |
|
|
235 |
}; |
|
|
236 |
|
|
|
237 |
// Returns an object with the properties "results" and "meta" |
|
|
238 |
var myOutput = Y.DataSchema.JSON.apply(mySchema, myData);</pre> |
|
|
239 |
|
|
|
240 |
|
|
|
241 |
<h4 id="xml">DataSchema.XML</h4> |
|
|
242 |
|
|
|
243 |
<p> |
|
|
244 |
<strong>Note:</strong> XML parsing currently has known issues on the |
|
|
245 |
Android WebKit browser. |
|
|
246 |
</p> |
|
|
247 |
|
|
|
248 |
<p> |
|
|
249 |
Use DataSchema.XML when working with XML data. As with JSON data, your XML |
|
|
250 |
data may hold meta values as well as an internal node list of tabular |
|
|
251 |
data. |
|
|
252 |
</p> |
|
|
253 |
|
|
|
254 |
<pre class="code prettyprint">// Sample XML data |
|
|
255 |
<Response> |
|
|
256 |
<Session>542235629</Session> |
|
|
257 |
<Tracks start="1" count="10" total="98" errorCount="0" |
|
|
258 |
defaultSort="popularity+" description="Top 100 Tracks" |
|
|
259 |
name="Top 100 Tracks"> |
|
|
260 |
<Track id="59672468" rating="-1" title="I Kissed A Girl"> |
|
|
261 |
<Artist id="30326214" rating="-1">Katy Perry</Artist> |
|
|
262 |
<ItemInfo><ChartPosition last="26" this="1"/></ItemInfo> |
|
|
263 |
</Track> |
|
|
264 |
<Track id="47973564" rating="-1" title="Shake It"> |
|
|
265 |
<Artist id="45575683" rating="-1">Metro Station</Artist> |
|
|
266 |
<ItemInfo><ChartPosition last="27" this="2"/></ItemInfo> |
|
|
267 |
</Track> |
|
|
268 |
<Track id="52207363" rating="-1" title="Bleeding Love"> |
|
|
269 |
<Artist id="37956508" rating="-1">Leona Lewis</Artist> |
|
|
270 |
<ItemInfo><ChartPosition last="28" this="3"/></ItemInfo> |
|
|
271 |
</Track> |
|
|
272 |
</Tracks> |
|
|
273 |
</Response></pre> |
|
|
274 |
|
|
|
275 |
|
|
|
276 |
<p> |
|
|
277 |
Locators are XPath string values in your schema that point to data values |
|
|
278 |
within the XML. Define a schema with the following properties for your XML |
|
|
279 |
data: |
|
|
280 |
</p> |
|
|
281 |
|
|
|
282 |
<table> |
|
|
283 |
<thead> |
|
|
284 |
<tr> |
|
|
285 |
<th>Property</th> |
|
|
286 |
<th>Type</th> |
|
|
287 |
<th>Description</th> |
|
|
288 |
</tr> |
|
|
289 |
</thead> |
|
|
290 |
<tbody> |
|
|
291 |
<tr> |
|
|
292 |
<td><code>metaFields</code></td> |
|
|
293 |
<td>Object</td> |
|
|
294 |
<td>Key/locator pairs that point to arbitrary data values.</td> |
|
|
295 |
</tr> |
|
|
296 |
<tr> |
|
|
297 |
<td><code>resultListLocator</code></td> |
|
|
298 |
<td>String</td> |
|
|
299 |
<td>Locator to an internal node list of tabular data.</td> |
|
|
300 |
</tr> |
|
|
301 |
<tr> |
|
|
302 |
<td><code>resultFields</code></td> |
|
|
303 |
<td>Array</td> |
|
|
304 |
<td>Keys to assign to the values contained in the array. Locators may be defined to point to complex nested values or values held in attributes.</td> |
|
|
305 |
</tr> |
|
|
306 |
</tbody> |
|
|
307 |
</table> |
|
|
308 |
|
|
|
309 |
<pre class="code prettyprint">var mySchema = { |
|
|
310 |
metaFields: {session:"//Session", total:"//Tracks/@total"}, |
|
|
311 |
resultListLocator: "Track", // node name or XPath |
|
|
312 |
resultFields: [{key:"song", locator:"@title"}, {key:"artist", locator:"Artist"}, {key:"rank", locator:"ItemInfo/ChartPosition/@this"}] |
|
|
313 |
}; |
|
|
314 |
|
|
|
315 |
// Returns an object with the properties "results" and "meta" |
|
|
316 |
var myOutput = Y.DataSchema.XML.apply(mySchema, myData);</pre> |
|
|
317 |
|
|
|
318 |
|
|
|
319 |
<h4 id="text">DataSchema.Text</h4> |
|
|
320 |
|
|
|
321 |
<p> |
|
|
322 |
Use DataSchema.Text when working with delimited textual data. Typically, |
|
|
323 |
your data will not contain meta values. |
|
|
324 |
</p> |
|
|
325 |
|
|
|
326 |
<pre class="code prettyprint">// Sample text data |
|
|
327 |
notebooks, 100, spiral-bound |
|
|
328 |
pencils, 300, #2 erasers |
|
|
329 |
pens, 500, blue ink</pre> |
|
|
330 |
|
|
|
331 |
|
|
|
332 |
<p>Define a schema with the following properties for your text data:</p> |
|
|
333 |
|
|
|
334 |
<table> |
|
|
335 |
<thead> |
|
|
336 |
<tr> |
|
|
337 |
<th>Property</th> |
|
|
338 |
<th>Type</th> |
|
|
339 |
<th>Description</th> |
|
|
340 |
</tr> |
|
|
341 |
</thead> |
|
|
342 |
<tbody> |
|
|
343 |
<tr> |
|
|
344 |
<td><code>resultDelimiter</code></td> |
|
|
345 |
<td>String</td> |
|
|
346 |
<td>Delimiter separating each row of tabular data</td> |
|
|
347 |
</tr> |
|
|
348 |
<tr> |
|
|
349 |
<td><code>fieldDelimiter</code></td> |
|
|
350 |
<td>String</td> |
|
|
351 |
<td>Delimiter separating each column of tabular data</td> |
|
|
352 |
</tr> |
|
|
353 |
<tr> |
|
|
354 |
<td><code>resultFields</code></td> |
|
|
355 |
<td>Array</td> |
|
|
356 |
<td>Keys to assign to the values contained in each field (column).</td> |
|
|
357 |
</tr> |
|
|
358 |
</tbody> |
|
|
359 |
</table> |
|
|
360 |
|
|
|
361 |
<pre class="code prettyprint">var mySchema = { |
|
|
362 |
resultDelimiter: "\\n", |
|
|
363 |
fieldDelimiter: ",", |
|
|
364 |
resultFields: [{key:"product"}, {key:"quantity"}, {key:"detail"}]; |
|
|
365 |
|
|
|
366 |
// Returns an object with the properties "results" and "meta" |
|
|
367 |
var myOutput = Y.DataSchema.Text.apply(mySchema, myData);</pre> |
|
|
368 |
|
|
|
369 |
|
|
|
370 |
<h3 id="plugin">DataSchema as a DataSource plugin</h3> |
|
|
371 |
|
|
|
372 |
<p> |
|
|
373 |
DataSchema plugins integrate DataSource's retrieval functionality with |
|
|
374 |
schema-based normalization of the retrieved data for further consumption by |
|
|
375 |
another component. There are currently four available DataSource plugins: |
|
|
376 |
DataSourceArraySchema, DataSourceJSONSchema, DataSourceXMLSchema, and |
|
|
377 |
DataSourceTextSchema. |
|
|
378 |
</p> |
|
|
379 |
|
|
|
380 |
<pre class="code prettyprint">myDataSource.plug({fn: Y.Plugin.DataSourceJSONSchema, cfg: { |
|
|
381 |
schema: { |
|
|
382 |
resultListLocator: "ResultSet.Result", |
|
|
383 |
resultFields: ["Title"] |
|
|
384 |
} |
|
|
385 |
}}); |
|
|
386 |
|
|
|
387 |
// myCallback functions will receive the schema-normalized response object |
|
|
388 |
myDataSource.sendRequest({ |
|
|
389 |
request: myRequest, |
|
|
390 |
callback: myCallback |
|
|
391 |
});</pre> |
|
|
392 |
|
|
|
393 |
|
|
|
394 |
<h2 id="knownissues">Known Issues</h2> |
|
|
395 |
|
|
|
396 |
<p> |
|
|
397 |
<strong>Known Android issues (bugs 2529621, 2529758, 2529775):</strong> XML |
|
|
398 |
parsing is currently buggy on the Android WebKit browser. |
|
|
399 |
</p> |
|
|
400 |
</div> |
|
|
401 |
</div> |
|
|
402 |
</div> |
|
|
403 |
|
|
|
404 |
<div class="yui3-u-1-4"> |
|
|
405 |
<div class="sidebar"> |
|
|
406 |
|
|
|
407 |
<div id="toc" class="sidebox"> |
|
|
408 |
<div class="hd"> |
|
|
409 |
<h2 class="no-toc">Table of Contents</h2> |
|
|
410 |
</div> |
|
|
411 |
|
|
|
412 |
<div class="bd"> |
|
|
413 |
<ul class="toc"> |
|
|
414 |
<li> |
|
|
415 |
<a href="#getting-started">Getting Started</a> |
|
|
416 |
</li> |
|
|
417 |
<li> |
|
|
418 |
<a href="#using">Using the DataSchema</a> |
|
|
419 |
<ul class="toc"> |
|
|
420 |
<li> |
|
|
421 |
<a href="#basics">DataSchema basics</a> |
|
|
422 |
<ul class="toc"> |
|
|
423 |
<li> |
|
|
424 |
<a href="#array">DataSchema.Array</a> |
|
|
425 |
</li> |
|
|
426 |
<li> |
|
|
427 |
<a href="#json">DataSchema.JSON</a> |
|
|
428 |
</li> |
|
|
429 |
<li> |
|
|
430 |
<a href="#xml">DataSchema.XML</a> |
|
|
431 |
</li> |
|
|
432 |
<li> |
|
|
433 |
<a href="#text">DataSchema.Text</a> |
|
|
434 |
</li> |
|
|
435 |
</ul> |
|
|
436 |
</li> |
|
|
437 |
<li> |
|
|
438 |
<a href="#plugin">DataSchema as a DataSource plugin</a> |
|
|
439 |
</li> |
|
|
440 |
</ul> |
|
|
441 |
</li> |
|
|
442 |
<li> |
|
|
443 |
<a href="#knownissues">Known Issues</a> |
|
|
444 |
</li> |
|
|
445 |
</ul> |
|
|
446 |
</div> |
|
|
447 |
</div> |
|
|
448 |
|
|
|
449 |
|
|
|
450 |
|
|
|
451 |
<div class="sidebox"> |
|
|
452 |
<div class="hd"> |
|
|
453 |
<h2 class="no-toc">Examples</h2> |
|
|
454 |
</div> |
|
|
455 |
|
|
|
456 |
<div class="bd"> |
|
|
457 |
<ul class="examples"> |
|
|
458 |
|
|
|
459 |
|
|
|
460 |
<li data-description="Schema parsing a JavaScript array."> |
|
|
461 |
<a href="dataschema-array.html">DataSchema.Array</a> |
|
|
462 |
</li> |
|
|
463 |
|
|
|
464 |
|
|
|
465 |
|
|
|
466 |
<li data-description="Schema parsing JSON data."> |
|
|
467 |
<a href="dataschema-json.html">DataSchema.JSON</a> |
|
|
468 |
</li> |
|
|
469 |
|
|
|
470 |
|
|
|
471 |
|
|
|
472 |
<li data-description="Schema parsing XML data."> |
|
|
473 |
<a href="dataschema-xml.html">DataSchema.XML for XML Data</a> |
|
|
474 |
</li> |
|
|
475 |
|
|
|
476 |
|
|
|
477 |
|
|
|
478 |
<li data-description="Schema parsing data held in TABLE elements."> |
|
|
479 |
<a href="dataschema-table.html">DataSchema.XML for HTML Tables</a> |
|
|
480 |
</li> |
|
|
481 |
|
|
|
482 |
|
|
|
483 |
|
|
|
484 |
<li data-description="Schema parsing delimited plain-text data."> |
|
|
485 |
<a href="dataschema-text.html">DataSchema.Text</a> |
|
|
486 |
</li> |
|
|
487 |
|
|
|
488 |
|
|
|
489 |
|
|
|
490 |
<li data-description="Parsing data into specified types as the schema is being applied."> |
|
|
491 |
<a href="dataschema-parsing.html">Enforcing DataTypes</a> |
|
|
492 |
</li> |
|
|
493 |
|
|
|
494 |
|
|
|
495 |
|
|
|
496 |
|
|
|
497 |
|
|
|
498 |
|
|
|
499 |
|
|
|
500 |
|
|
|
501 |
|
|
|
502 |
|
|
|
503 |
|
|
|
504 |
|
|
|
505 |
|
|
|
506 |
|
|
|
507 |
</ul> |
|
|
508 |
</div> |
|
|
509 |
</div> |
|
|
510 |
|
|
|
511 |
|
|
|
512 |
|
|
|
513 |
<div class="sidebox"> |
|
|
514 |
<div class="hd"> |
|
|
515 |
<h2 class="no-toc">Examples That Use This Component</h2> |
|
|
516 |
</div> |
|
|
517 |
|
|
|
518 |
<div class="bd"> |
|
|
519 |
<ul class="examples"> |
|
|
520 |
|
|
|
521 |
|
|
|
522 |
|
|
|
523 |
|
|
|
524 |
|
|
|
525 |
|
|
|
526 |
|
|
|
527 |
|
|
|
528 |
|
|
|
529 |
|
|
|
530 |
|
|
|
531 |
|
|
|
532 |
|
|
|
533 |
|
|
|
534 |
<li data-description="The Local DataSource manages retrieval of in-page data, from JavaScript arrays and objects to DOM elements."> |
|
|
535 |
<a href="../datasource/datasource-local.html">DataSource.Local</a> |
|
|
536 |
</li> |
|
|
537 |
|
|
|
538 |
|
|
|
539 |
|
|
|
540 |
<li data-description="The Get DataSource, which manages retrieval of data from remote sources via the Get Utility, can be useful for accessing data from cross-domain servers without the need for a proxy."> |
|
|
541 |
<a href="../datasource/datasource-get.html">DataSource.Get</a> |
|
|
542 |
</li> |
|
|
543 |
|
|
|
544 |
|
|
|
545 |
|
|
|
546 |
<li data-description="The IO DataSource manages retrieval of data from remote sources, via the IO Utility."> |
|
|
547 |
<a href="../datasource/datasource-io.html">DataSource.IO</a> |
|
|
548 |
</li> |
|
|
549 |
|
|
|
550 |
|
|
|
551 |
|
|
|
552 |
<li data-description="The Function DataSource, which manages retrieval of data from a JavaScript function, provides a highly customizeable mechanism for implementer-defined data retrieval algorithms"> |
|
|
553 |
<a href="../datasource/datasource-function.html">DataSource.Function</a> |
|
|
554 |
</li> |
|
|
555 |
|
|
|
556 |
|
|
|
557 |
|
|
|
558 |
<li data-description="Use the DataSourceCache plugin to enable caching and reduce server calls to remote sources."> |
|
|
559 |
<a href="../datasource/datasource-caching.html">DataSource with Caching</a> |
|
|
560 |
</li> |
|
|
561 |
|
|
|
562 |
|
|
|
563 |
|
|
|
564 |
<li data-description="The DataSourceCache plugin supports offline caching so that cached data persists across browser sessions."> |
|
|
565 |
<a href="../datasource/datasource-offlinecache.html">DataSource with Offline Cache</a> |
|
|
566 |
</li> |
|
|
567 |
|
|
|
568 |
|
|
|
569 |
</ul> |
|
|
570 |
</div> |
|
|
571 |
</div> |
|
|
572 |
|
|
|
573 |
</div> |
|
|
574 |
</div> |
|
|
575 |
</div> |
|
|
576 |
</div> |
|
|
577 |
|
|
|
578 |
<script src="../assets/vendor/prettify/prettify-min.js"></script> |
|
|
579 |
<script>prettyPrint();</script> |
|
|
580 |
|
|
|
581 |
<script> |
|
|
582 |
YUI.Env.Tests = { |
|
|
583 |
examples: [], |
|
|
584 |
project: '../assets', |
|
|
585 |
assets: '../assets/dataschema', |
|
|
586 |
name: 'dataschema', |
|
|
587 |
title: 'DataSchema', |
|
|
588 |
newWindow: '', |
|
|
589 |
auto: false |
|
|
590 |
}; |
|
|
591 |
YUI.Env.Tests.examples.push('dataschema-array'); |
|
|
592 |
YUI.Env.Tests.examples.push('dataschema-json'); |
|
|
593 |
YUI.Env.Tests.examples.push('dataschema-xml'); |
|
|
594 |
YUI.Env.Tests.examples.push('dataschema-table'); |
|
|
595 |
YUI.Env.Tests.examples.push('dataschema-text'); |
|
|
596 |
YUI.Env.Tests.examples.push('dataschema-parsing'); |
|
|
597 |
YUI.Env.Tests.examples.push('datasource-local'); |
|
|
598 |
YUI.Env.Tests.examples.push('datasource-get'); |
|
|
599 |
YUI.Env.Tests.examples.push('datasource-io'); |
|
|
600 |
YUI.Env.Tests.examples.push('datasource-function'); |
|
|
601 |
YUI.Env.Tests.examples.push('datasource-caching'); |
|
|
602 |
YUI.Env.Tests.examples.push('datasource-offlinecache'); |
|
|
603 |
|
|
|
604 |
</script> |
|
|
605 |
<script src="../assets/yui/test-runner.js"></script> |
|
|
606 |
|
|
|
607 |
|
|
|
608 |
|
|
|
609 |
</body> |
|
|
610 |
</html> |