Simple status box for the sidebar.
[elgg_plugins.git] / yui / docs / DataSource.html
blobcd178b32eec12b1d8e773d0d5164517ac5dbcf3a
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <title>API: datasource DataSource (YUI Library)</title>
5 <link rel="stylesheet" type="text/css" href="assets/api.css">
6 </head>
8 <body id="yahoo-com">
9 <div id="doc3" class="yui-t2">
11 <div id="hd">
12 <h1>Yahoo! UI Library</h1>
13 <h3>DataSource Utility&nbsp; <span class="subtitle">2.2.0</span></h3>
14 <p>
15 <a href="./index.html">Yahoo! UI Library</a>
16 &gt; <a href="./module_datasource.html">datasource</a>
17 &gt; DataSource
19 </p>
20 </div>
22 <div id="bd">
23 <div id="yui-main">
24 <div class="yui-b">
27 <h2>
32 Class <b>DataSource</b>
33 <span class="extends">
34 </span>
36 <span class="extends">
37 - uses
39 <a href="YAHOO.util.EventProvider.html">YAHOO.util.EventProvider</a>
41 </span>
43 </code>
44 </h2>
45 <!-- class tree goes here -->
50 <div class="summary description">
51 The DataSource class defines and manages a live set of data for widgets to
52 interact with. Examples of live databases include in-memory
53 local data such as a JavaScript array, a JavaScript function, or JSON, or
54 remote data such as data retrieved through an XHR connection.
55 </div>
57 <div class="section constructor details">
58 <h3><a name="constructor_detail">Constructor</a></h3>
59 <div class="content">
60 <div class="detail">
61 <strong>DataSource</strong>
62 <code>
67 oLiveData
70 oConfigs
72 </code>
73 <div class="description">
74 <dl>
75 <dt>Parameters:</dt>
76 <dd>
77 <code>oLiveData
78 &lt;Object&gt;
79 </code>
80 Pointer to live database
81 </dd>
82 <dd>
83 <code>oConfigs
84 &lt;Object&gt;
85 </code>
86 (optional) Object literal of configuration values
87 </dd>
88 </dl>
91 </div>
92 </div>
93 </div>
94 </div>
96 <div class="section field details">
97 <h3><a name="field_detail">Properties</a></h3>
98 <div class="content">
99 <h4><a name="_aCache">_aCache</a>
100 <code>- private Object[]</code>
101 </h4>
102 <div class="detail">
103 <div class="description">
104 Local cache of data result objects indexed chronologically.
105 </div>
106 </div>
111 <hr />
112 <h4><a name="_nIndex">_nIndex</a>
113 <code>- private Number</code>
114 </h4>
115 <div class="detail">
116 <div class="description">
117 Internal class variable to index multiple DataSource instances.
118 </div>
119 </div>
124 <hr />
125 <h4><a name="_sName">_sName</a>
126 <code>- private String</code>
127 </h4>
128 <div class="detail">
129 <div class="description">
130 Name of DataSource instance.
131 </div>
132 </div>
137 <hr />
138 <h4><a name="_xhrCallback">_xhrCallback</a>
139 <code>- private object</code>
140 </h4>
141 <div class="detail">
142 <div class="description">
143 Connection Manager callback object
144 </div>
145 </div>
150 <hr />
151 <h4><a name="connMgr">connMgr</a>
152 <code>- Object</code>
153 </h4>
154 <div class="detail">
155 <div class="description">
156 Alias to YUI Connection Manager. Allows implementers to specify their own
157 subclasses of the YUI Connection Manager utility.
158 </div>
159 </div>
162 <div class="default">
163 Default Value: YAHOO.util.Connect
164 </div>
167 <hr />
168 <h4><a name="connTimeout">connTimeout</a>
169 <code>- Number</code>
170 </h4>
171 <div class="detail">
172 <div class="description">
173 If data is accessed over XHR via Connection Manager, the connection timeout is
174 configurable in milliseconds the XHR connection will wait for a server
175 response. A a value of zero indicates the XHR connection will wait forever.
176 Any value greater than zero will use the Connection utility's Auto-Abort
177 feature.
178 </div>
179 </div>
182 <div class="default">
183 Default Value: 0
184 </div>
187 <hr />
188 <h4><a name="dataType">dataType</a>
189 <code>- Number</code>
190 </h4>
191 <div class="detail">
192 <div class="description">
193 Where the live data is held.
194 </div>
195 </div>
198 <div class="default">
199 Default Value: YAHOO.util.DataSource.TYPE_UNKNOWN
200 </div>
203 <hr />
204 <h4><a name="ERROR_DATAINVALID">ERROR_DATAINVALID</a>
205 <code>- final String</code>
206 </h4>
207 <div class="detail">
208 <div class="description">
209 Error message for invalid data responses.
210 </div>
211 </div>
214 <div class="default">
215 Default Value: "Invalid data"
216 </div>
219 <hr />
220 <h4><a name="ERROR_DATANULL">ERROR_DATANULL</a>
221 <code>- final String</code>
222 </h4>
223 <div class="detail">
224 <div class="description">
225 Error message for null data responses.
226 </div>
227 </div>
230 <div class="default">
231 Default Value: "Null data"
232 </div>
235 <hr />
236 <h4><a name="liveData">liveData</a>
237 <code>- Object</code>
238 </h4>
239 <div class="detail">
240 <div class="description">
241 Pointer to live database.
242 </div>
243 </div>
248 <hr />
249 <h4><a name="maxCacheEntries">maxCacheEntries</a>
250 <code>- Number</code>
251 </h4>
252 <div class="detail">
253 <div class="description">
254 Max size of the local cache. Set to 0 to turn off caching. Caching is
255 useful to reduce the number of server connections. Recommended only for data
256 sources that return comprehensive results for queries or when stale data is
257 not an issue.
258 </div>
259 </div>
262 <div class="default">
263 Default Value: 0
264 </div>
267 <hr />
268 <h4><a name="responseType">responseType</a>
269 <code>- Number</code>
270 </h4>
271 <div class="detail">
272 <div class="description">
273 Format of response.
274 </div>
275 </div>
278 <div class="default">
279 Default Value: YAHOO.util.DataSource.TYPE_UNKNOWN
280 </div>
283 <hr />
284 <h4><a name="TYPE_JSARRAY">TYPE_JSARRAY</a>
285 <code>- final Number</code>
286 </h4>
287 <div class="detail">
288 <div class="description">
289 Type is a JavaScript Array.
290 </div>
291 </div>
294 <div class="default">
295 Default Value: 0
296 </div>
299 <hr />
300 <h4><a name="TYPE_JSFUNCTIOn">TYPE_JSFUNCTIOn</a>
301 <code>- final Number</code>
302 </h4>
303 <div class="detail">
304 <div class="description">
305 Type is a JavaScript Function.
306 </div>
307 </div>
310 <div class="default">
311 Default Value: 1
312 </div>
315 <hr />
316 <h4><a name="TYPE_JSON">TYPE_JSON</a>
317 <code>- final Number</code>
318 </h4>
319 <div class="detail">
320 <div class="description">
321 Type is JSON.
322 </div>
323 </div>
326 <div class="default">
327 Default Value: 3
328 </div>
331 <hr />
332 <h4><a name="TYPE_TEXT">TYPE_TEXT</a>
333 <code>- final Number</code>
334 </h4>
335 <div class="detail">
336 <div class="description">
337 Type is plain text.
338 </div>
339 </div>
342 <div class="default">
343 Default Value: 5
344 </div>
347 <hr />
348 <h4><a name="TYPE_UNKNOWN">TYPE_UNKNOWN</a>
349 <code>- final Number</code>
350 </h4>
351 <div class="detail">
352 <div class="description">
353 Type is unknown.
354 </div>
355 </div>
358 <div class="default">
359 Default Value: -1
360 </div>
363 <hr />
364 <h4><a name="TYPE_XHR">TYPE_XHR</a>
365 <code>- final Number</code>
366 </h4>
367 <div class="detail">
368 <div class="description">
369 Type is hosted on a server via an XHR connection.
370 </div>
371 </div>
374 <div class="default">
375 Default Value: 2
376 </div>
379 <hr />
380 <h4><a name="TYPE_XML">TYPE_XML</a>
381 <code>- final Number</code>
382 </h4>
383 <div class="detail">
384 <div class="description">
385 Type is XML.
386 </div>
387 </div>
390 <div class="default">
391 Default Value: 4
392 </div>
395 <hr />
398 </div>
399 </div>
401 <div class="section field inheritance">
402 <h4>Properties inherited from <a href="YAHOO.util.EventProvider.html">YAHOO.util.EventProvider</a>:</h4>
403 <div class="content">
404 <code>
406 <a href="YAHOO.util.EventProvider.html#__yui_events">__yui_events</a>,
407 <a href="YAHOO.util.EventProvider.html#__yui_subscribers">__yui_subscribers</a>
408 </code>
409 </div>
410 </div>
412 <div class="section method details">
413 <h3><a name="methodDetails">Methods</a></h3>
414 <div class="content">
415 <h4>
416 <a name="_xhrFailure">_xhrFailure</a></h4>
417 <div class="detail">
418 <code>
419 private
422 void
423 <strong>_xhrFailure</strong>
427 oResponse
431 </code>
433 <div class="description">
434 Connection Manager failure handler
435 </div>
437 <div class="description">
439 <dl>
440 <dt>Parameters:</dt>
441 <dd>
442 <code>oResponse &lt;Object&gt;</code>
443 HTTPXMLRequest object
444 </dd>
445 </dl>
447 <dl>
448 <dt>Returns:
449 <code>
450 void
451 </code></dt>
452 <dd></dd>
453 </dl>
455 </div>
457 </div>
458 <hr />
459 <h4>
460 <a name="_xhrSuccess">_xhrSuccess</a></h4>
461 <div class="detail">
462 <code>
463 private
466 void
467 <strong>_xhrSuccess</strong>
471 oResponse
475 </code>
477 <div class="description">
478 Connection Manager success handler
479 </div>
481 <div class="description">
483 <dl>
484 <dt>Parameters:</dt>
485 <dd>
486 <code>oResponse &lt;Object&gt;</code>
487 HTTPXMLRequest object
488 </dd>
489 </dl>
491 <dl>
492 <dt>Returns:
493 <code>
494 void
495 </code></dt>
496 <dd></dd>
497 </dl>
499 </div>
501 </div>
502 <hr />
503 <h4>
504 <a name="addToCache">addToCache</a></h4>
505 <div class="detail">
506 <code>
510 void
511 <strong>addToCache</strong>
515 oRequest
519 oResponse
523 </code>
525 <div class="description">
526 Adds a new item to the cache. If cache is full, evicts the stalest item
527 before adding the new item.
528 </div>
530 <div class="description">
532 <dl>
533 <dt>Parameters:</dt>
534 <dd>
535 <code>oRequest &lt;Object&gt;</code>
536 Request object.
537 </dd>
538 <dd>
539 <code>oResponse &lt;Object&gt;</code>
540 Response object to cache.
541 </dd>
542 </dl>
544 <dl>
545 <dt>Returns:
546 <code>
547 void
548 </code></dt>
549 <dd></dd>
550 </dl>
552 </div>
554 </div>
555 <hr />
556 <h4>
557 <a name="flushCache">flushCache</a></h4>
558 <div class="detail">
559 <code>
563 void
564 <strong>flushCache</strong>
567 </code>
569 <div class="description">
570 Flushes cache.
571 </div>
573 <div class="description">
576 <dl>
577 <dt>Returns:
578 <code>
579 void
580 </code></dt>
581 <dd></dd>
582 </dl>
584 </div>
586 </div>
587 <hr />
588 <h4>
589 <a name="getCachedResponse">getCachedResponse</a></h4>
590 <div class="detail">
591 <code>
595 Object
596 <strong>getCachedResponse</strong>
600 oRequest
604 oCallback
608 oCaller
612 </code>
614 <div class="description">
615 Overridable method passes request to cache and returns cached response if any,
616 refreshing the hit in the cache as the newest item. Returns null if there is
617 no cache hit.
618 </div>
620 <div class="description">
622 <dl>
623 <dt>Parameters:</dt>
624 <dd>
625 <code>oRequest &lt;Object&gt;</code>
626 Request object.
627 </dd>
628 <dd>
629 <code>oCallback &lt;Function&gt;</code>
630 Handler function to receive the response
631 </dd>
632 <dd>
633 <code>oCaller &lt;Object&gt;</code>
634 The Calling object that is making the request
635 </dd>
636 </dl>
638 <dl>
639 <dt>Returns:
640 <code>
641 Object
642 </code></dt>
643 <dd>Cached response object or null.</dd>
644 </dl>
646 </div>
648 </div>
649 <hr />
650 <h4>
651 <a name="handleResponse">handleResponse</a></h4>
652 <div class="detail">
653 <code>
657 void
658 <strong>handleResponse</strong>
662 oRequest
666 oRawResponse
670 oCallback
674 oCaller
678 </code>
680 <div class="description">
681 Handles raw data response from live data source.
682 </div>
684 <div class="description">
686 <dl>
687 <dt>Parameters:</dt>
688 <dd>
689 <code>oRequest &lt;Object&gt;</code>
690 Request object
691 </dd>
692 <dd>
693 <code>oRawResponse &lt;Object&gt;</code>
694 The raw response from the live database
695 </dd>
696 <dd>
697 <code>oCallback &lt;Function&gt;</code>
698 Handler function to receive the response
699 </dd>
700 <dd>
701 <code>oCaller &lt;Object&gt;</code>
702 The calling object that is making the request
703 </dd>
704 </dl>
706 <dl>
707 <dt>Returns:
708 <code>
709 void
710 </code></dt>
711 <dd></dd>
712 </dl>
714 </div>
716 </div>
717 <hr />
718 <h4>
719 <a name="isCacheHit">isCacheHit</a></h4>
720 <div class="detail">
721 <code>
725 Boolean
726 <strong>isCacheHit</strong>
730 oRequest
734 oCachedRequest
738 </code>
740 <div class="description">
741 Default overridable method matches given request to given cached request.
742 Returns true if is a hit, returns false otherwise. Implementers should
743 override this method to customize the cache-matching algorithm.
744 </div>
746 <div class="description">
748 <dl>
749 <dt>Parameters:</dt>
750 <dd>
751 <code>oRequest &lt;Object&gt;</code>
752 Request object.
753 </dd>
754 <dd>
755 <code>oCachedRequest &lt;Object&gt;</code>
756 Cached request object.
757 </dd>
758 </dl>
760 <dl>
761 <dt>Returns:
762 <code>
763 Boolean
764 </code></dt>
765 <dd>True if given request matches cached request, false otherwise.</dd>
766 </dl>
768 </div>
770 </div>
771 <hr />
772 <h4>
773 <a name="makeConnection">makeConnection</a></h4>
774 <div class="detail">
775 <code>
779 void
780 <strong>makeConnection</strong>
784 oRequest
788 oCallback
792 oCaller
796 </code>
798 <div class="description">
799 Overridable method provides default functionality to make a connection to
800 live data in order to send request. The response coming back is then
801 forwarded to the handleResponse function. This method should be customized
802 for more complex implementations.
803 </div>
805 <div class="description">
807 <dl>
808 <dt>Parameters:</dt>
809 <dd>
810 <code>oRequest &lt;Object&gt;</code>
811 Request object.
812 </dd>
813 <dd>
814 <code>oCallback &lt;Function&gt;</code>
815 Handler function to receive the response
816 </dd>
817 <dd>
818 <code>oCaller &lt;Object&gt;</code>
819 The Calling object that is making the request
820 </dd>
821 </dl>
823 <dl>
824 <dt>Returns:
825 <code>
826 void
827 </code></dt>
828 <dd></dd>
829 </dl>
831 </div>
833 </div>
834 <hr />
835 <h4>
836 <a name="parseArrayData">parseArrayData</a></h4>
837 <div class="detail">
838 <code>
842 Object
843 <strong>parseArrayData</strong>
847 oRequest
851 oRawResponse
855 </code>
857 <div class="description">
858 Overridable method parses raw array data into a response object.
859 </div>
861 <div class="description">
863 <dl>
864 <dt>Parameters:</dt>
865 <dd>
866 <code>oRequest &lt;Object&gt;</code>
867 Request object.
868 </dd>
869 <dd>
870 <code>oRawResponse &lt;Object&gt;</code>
871 The raw response from the live database
872 </dd>
873 </dl>
875 <dl>
876 <dt>Returns:
877 <code>
878 Object
879 </code></dt>
880 <dd>Parsed response object</dd>
881 </dl>
883 </div>
885 </div>
886 <hr />
887 <h4>
888 <a name="parseJSONData">parseJSONData</a></h4>
889 <div class="detail">
890 <code>
894 Object
895 <strong>parseJSONData</strong>
899 oRequest
903 oRawResponse
907 </code>
909 <div class="description">
910 Overridable method parses raw JSON data into a response object.
911 </div>
913 <div class="description">
915 <dl>
916 <dt>Parameters:</dt>
917 <dd>
918 <code>oRequest &lt;Object&gt;</code>
919 Request object
920 </dd>
921 <dd>
922 <code>oRawResponse &lt;Object&gt;</code>
923 The raw response from the live database
924 </dd>
925 </dl>
927 <dl>
928 <dt>Returns:
929 <code>
930 Object
931 </code></dt>
932 <dd>Parsed response object</dd>
933 </dl>
935 </div>
937 </div>
938 <hr />
939 <h4>
940 <a name="parseTextData">parseTextData</a></h4>
941 <div class="detail">
942 <code>
946 Object
947 <strong>parseTextData</strong>
951 oRequest
955 oRawResponse
959 </code>
961 <div class="description">
962 Overridable method parses raw plain text data into a response object.
963 </div>
965 <div class="description">
967 <dl>
968 <dt>Parameters:</dt>
969 <dd>
970 <code>oRequest &lt;Object&gt;</code>
971 Request object
972 </dd>
973 <dd>
974 <code>oRawResponse &lt;Object&gt;</code>
975 The raw response from the live database
976 </dd>
977 </dl>
979 <dl>
980 <dt>Returns:
981 <code>
982 Object
983 </code></dt>
984 <dd>Parsed response object</dd>
985 </dl>
987 </div>
989 </div>
990 <hr />
991 <h4>
992 <a name="parseXMLData">parseXMLData</a></h4>
993 <div class="detail">
994 <code>
998 Object
999 <strong>parseXMLData</strong>
1003 oRequest
1007 oRawResponse
1011 </code>
1013 <div class="description">
1014 Overridable method parses raw XML data into a response object.
1015 </div>
1017 <div class="description">
1019 <dl>
1020 <dt>Parameters:</dt>
1021 <dd>
1022 <code>oRequest &lt;Object&gt;</code>
1023 Request object
1024 </dd>
1025 <dd>
1026 <code>oRawResponse &lt;Object&gt;</code>
1027 The raw response from the live database
1028 </dd>
1029 </dl>
1031 <dl>
1032 <dt>Returns:
1033 <code>
1034 Object
1035 </code></dt>
1036 <dd>Parsed response object</dd>
1037 </dl>
1039 </div>
1041 </div>
1042 <hr />
1043 <h4>
1044 <a name="sendRequest">sendRequest</a></h4>
1045 <div class="detail">
1046 <code>
1050 void
1051 <strong>sendRequest</strong>
1055 oRequest
1059 oCallback
1063 oCaller
1067 </code>
1069 <div class="description">
1070 First looks for cached response, then sends request to live data.
1071 </div>
1073 <div class="description">
1075 <dl>
1076 <dt>Parameters:</dt>
1077 <dd>
1078 <code>oRequest &lt;Object&gt;</code>
1079 Request object
1080 </dd>
1081 <dd>
1082 <code>oCallback &lt;Function&gt;</code>
1083 Handler function to receive the response
1084 </dd>
1085 <dd>
1086 <code>oCaller &lt;Object&gt;</code>
1087 The Calling object that is making the request
1088 </dd>
1089 </dl>
1091 <dl>
1092 <dt>Returns:
1093 <code>
1094 void
1095 </code></dt>
1096 <dd></dd>
1097 </dl>
1099 </div>
1101 </div>
1102 <hr />
1103 <h4>
1104 <a name="toString">toString</a></h4>
1105 <div class="detail">
1106 <code>
1110 String
1111 <strong>toString</strong>
1114 </code>
1116 <div class="description">
1117 Public accessor to the unique name of the DataSource instance.
1118 </div>
1120 <div class="description">
1123 <dl>
1124 <dt>Returns:
1125 <code>
1126 String
1127 </code></dt>
1128 <dd>Unique name of the DataSource instance.</dd>
1129 </dl>
1131 </div>
1133 </div>
1134 <hr />
1135 </div>
1136 </div>
1138 <div class="section field inheritance">
1139 <h4>Methods inherited from <a href="YAHOO.util.EventProvider.html">YAHOO.util.EventProvider</a>:</h4>
1140 <div class="content">
1141 <code>
1143 <a href="YAHOO.util.EventProvider.html#createEvent">createEvent</a>,
1144 <a href="YAHOO.util.EventProvider.html#fireEvent">fireEvent</a>,
1145 <a href="YAHOO.util.EventProvider.html#hasEvent">hasEvent</a>,
1146 <a href="YAHOO.util.EventProvider.html#subscribe">subscribe</a>,
1147 <a href="YAHOO.util.EventProvider.html#unsubscribe">unsubscribe</a>,
1148 <a href="YAHOO.util.EventProvider.html#unsubscribeAll">unsubscribeAll</a>
1149 </code>
1150 </div>
1151 </div>
1153 <div class="section method details">
1154 <h3><a name="methodDetails">Events</a></h3>
1155 <div class="content">
1156 <h4>
1157 <a name="cacheFlushEvent">cacheFlushEvent</a></h4>
1158 <div class="detail">
1159 <code>
1163 <strong>cacheFlushEvent</strong>
1168 </code>
1170 <div class="description">
1171 Fired when the local cache is flushed.
1172 </div>
1174 <div class="description">
1179 </div>
1181 </div>
1182 <hr />
1183 <h4>
1184 <a name="cacheRequestEvent">cacheRequestEvent</a></h4>
1185 <div class="detail">
1186 <code>
1190 <strong>cacheRequestEvent</strong>
1195 oArgs.request
1199 oArgs.callback
1203 oArgs.caller
1208 </code>
1210 <div class="description">
1211 Fired when a request is made to the local cache.
1212 </div>
1214 <div class="description">
1217 <dl>
1218 <dt>Parameters:</dt>
1219 <dd>
1220 <code>oArgs.request &lt;Object&gt;</code>
1221 The request object.
1222 </dd>
1223 <dd>
1224 <code>oArgs.callback &lt;Function&gt;</code>
1225 The callback function.
1226 </dd>
1227 <dd>
1228 <code>oArgs.caller &lt;Object&gt;</code>
1229 The parent object of the callback function.
1230 </dd>
1231 </dl>
1234 </div>
1236 </div>
1237 <hr />
1238 <h4>
1239 <a name="dataErrorEvent">dataErrorEvent</a></h4>
1240 <div class="detail">
1241 <code>
1245 <strong>dataErrorEvent</strong>
1250 oArgs.request
1254 oArgs.callback
1258 oArgs.caller
1262 oArgs.message
1267 </code>
1269 <div class="description">
1270 Fired when an error is encountered with the live data source.
1271 </div>
1273 <div class="description">
1276 <dl>
1277 <dt>Parameters:</dt>
1278 <dd>
1279 <code>oArgs.request &lt;Object&gt;</code>
1280 The request object.
1281 </dd>
1282 <dd>
1283 <code>oArgs.callback &lt;Function&gt;</code>
1284 The callback function.
1285 </dd>
1286 <dd>
1287 <code>oArgs.caller &lt;Object&gt;</code>
1288 The parent object of the callback function.
1289 </dd>
1290 <dd>
1291 <code>oArgs.message &lt;String&gt;</code>
1292 The error message.
1293 </dd>
1294 </dl>
1297 </div>
1299 </div>
1300 <hr />
1301 <h4>
1302 <a name="getCachedResponseEvent">getCachedResponseEvent</a></h4>
1303 <div class="detail">
1304 <code>
1308 <strong>getCachedResponseEvent</strong>
1313 oArgs.request
1317 oArgs.response
1321 oArgs.callback
1325 oArgs.caller
1330 </code>
1332 <div class="description">
1333 Fired when data is retrieved from the local cache.
1334 </div>
1336 <div class="description">
1339 <dl>
1340 <dt>Parameters:</dt>
1341 <dd>
1342 <code>oArgs.request &lt;Object&gt;</code>
1343 The request object.
1344 </dd>
1345 <dd>
1346 <code>oArgs.response &lt;Object&gt;</code>
1347 The response object.
1348 </dd>
1349 <dd>
1350 <code>oArgs.callback &lt;Function&gt;</code>
1351 The callback function.
1352 </dd>
1353 <dd>
1354 <code>oArgs.caller &lt;Object&gt;</code>
1355 The parent object of the callback function.
1356 </dd>
1357 </dl>
1360 </div>
1362 </div>
1363 <hr />
1364 <h4>
1365 <a name="parseResponseEvent">parseResponseEvent</a></h4>
1366 <div class="detail">
1367 <code>
1371 <strong>parseResponseEvent</strong>
1376 oArgs.request
1380 oArgs.response
1384 oArgs.callback
1388 oArgs.caller
1393 </code>
1395 <div class="description">
1396 Fired when live data source sends response.
1397 </div>
1399 <div class="description">
1402 <dl>
1403 <dt>Parameters:</dt>
1404 <dd>
1405 <code>oArgs.request &lt;Object&gt;</code>
1406 The request object.
1407 </dd>
1408 <dd>
1409 <code>oArgs.response &lt;Object&gt;</code>
1410 The raw response object.
1411 </dd>
1412 <dd>
1413 <code>oArgs.callback &lt;Function&gt;</code>
1414 The callback function.
1415 </dd>
1416 <dd>
1417 <code>oArgs.caller &lt;Object&gt;</code>
1418 The parent object of the callback function.
1419 </dd>
1420 </dl>
1423 </div>
1425 </div>
1426 <hr />
1427 <h4>
1428 <a name="requestEvent">requestEvent</a></h4>
1429 <div class="detail">
1430 <code>
1434 <strong>requestEvent</strong>
1439 oArgs.request
1443 oArgs.callback
1447 oArgs.caller
1452 </code>
1454 <div class="description">
1455 Fired when a request is sent to the live data source.
1456 </div>
1458 <div class="description">
1461 <dl>
1462 <dt>Parameters:</dt>
1463 <dd>
1464 <code>oArgs.request &lt;Object&gt;</code>
1465 The request object.
1466 </dd>
1467 <dd>
1468 <code>oArgs.callback &lt;Function&gt;</code>
1469 The callback function.
1470 </dd>
1471 <dd>
1472 <code>oArgs.caller &lt;Object&gt;</code>
1473 The parent object of the callback function.
1474 </dd>
1475 </dl>
1478 </div>
1480 </div>
1481 <hr />
1482 <h4>
1483 <a name="responseCacheEvent">responseCacheEvent</a></h4>
1484 <div class="detail">
1485 <code>
1489 <strong>responseCacheEvent</strong>
1494 oArgs.request
1498 oArgs.response
1502 oArgs.callback
1506 oArgs.caller
1511 </code>
1513 <div class="description">
1514 Fired when response is cached.
1515 </div>
1517 <div class="description">
1520 <dl>
1521 <dt>Parameters:</dt>
1522 <dd>
1523 <code>oArgs.request &lt;Object&gt;</code>
1524 The request object.
1525 </dd>
1526 <dd>
1527 <code>oArgs.response &lt;Object&gt;</code>
1528 The parsed response object.
1529 </dd>
1530 <dd>
1531 <code>oArgs.callback &lt;Function&gt;</code>
1532 The callback function.
1533 </dd>
1534 <dd>
1535 <code>oArgs.caller &lt;Object&gt;</code>
1536 The parent object of the callback function.
1537 </dd>
1538 </dl>
1541 </div>
1543 </div>
1544 <hr />
1545 <h4>
1546 <a name="responseParseEvent">responseParseEvent</a></h4>
1547 <div class="detail">
1548 <code>
1552 <strong>responseParseEvent</strong>
1557 oArgs.request
1561 oArgs.response
1565 oArgs.callback
1569 oArgs.caller
1574 </code>
1576 <div class="description">
1577 Fired when response is parsed.
1578 </div>
1580 <div class="description">
1583 <dl>
1584 <dt>Parameters:</dt>
1585 <dd>
1586 <code>oArgs.request &lt;Object&gt;</code>
1587 The request object.
1588 </dd>
1589 <dd>
1590 <code>oArgs.response &lt;Object&gt;</code>
1591 The parsed response object.
1592 </dd>
1593 <dd>
1594 <code>oArgs.callback &lt;Function&gt;</code>
1595 The callback function.
1596 </dd>
1597 <dd>
1598 <code>oArgs.caller &lt;Object&gt;</code>
1599 The parent object of the callback function.
1600 </dd>
1601 </dl>
1604 </div>
1606 </div>
1607 <hr />
1608 </div>
1609 </div>
1615 </div>
1616 </div>
1617 <div class="yui-b">
1618 <div class="nav">
1620 <div class="module">
1621 <h4>Modules</h4>
1622 <ul class="content">
1624 <li class=""><a href="module_animation.html">animation</a></li>
1626 <li class=""><a href="module_autocomplete.html">autocomplete</a></li>
1628 <li class=""><a href="module_button.html">button</a></li>
1630 <li class=""><a href="module_calendar.html">calendar</a></li>
1632 <li class=""><a href="module_connection.html">connection</a></li>
1634 <li class=""><a href="module_container.html">container</a></li>
1636 <li class="selected"><a href="module_datasource.html">datasource</a></li>
1638 <li class=""><a href="module_datatable.html">datatable</a></li>
1640 <li class=""><a href="module_dom.html">dom</a></li>
1642 <li class=""><a href="module_dragdrop.html">dragdrop</a></li>
1644 <li class=""><a href="module_element.html">element</a></li>
1646 <li class=""><a href="module_event.html">event</a></li>
1648 <li class=""><a href="module_history.html">history</a></li>
1650 <li class=""><a href="module_logger.html">logger</a></li>
1652 <li class=""><a href="module_menu.html">menu</a></li>
1654 <li class=""><a href="module_slider.html">slider</a></li>
1656 <li class=""><a href="module_tabview.html">tabview</a></li>
1658 <li class=""><a href="module_treeview.html">treeview</a></li>
1660 <li class=""><a href="module_yahoo.html">yahoo</a></li>
1661 </ul>
1662 </div>
1664 <div class="module">
1665 <h4>Classes</h4>
1666 <ul class="content">
1667 <li class="selected"><a href="DataSource.html">DataSource</a></li>
1668 </ul>
1669 </div>
1671 <div class="module">
1672 <h4>Files</h4>
1673 <ul class="content">
1674 <li class=""><a href="DataSource.js.html">DataSource.js</a></li>
1675 </ul>
1676 </div>
1678 <div class="module">
1679 <h4>Properties</h4>
1680 <ul class="content">
1681 <li><a href="#_aCache">_aCache</a>
1682 <!--<code>&lt;Number&gt;</code>-->
1683 </li>
1684 <li><a href="#_nIndex">_nIndex</a>
1685 <!--<code>&lt;Number&gt;</code>-->
1686 </li>
1687 <li><a href="#_sName">_sName</a>
1688 <!--<code>&lt;Number&gt;</code>-->
1689 </li>
1690 <li><a href="#_xhrCallback">_xhrCallback</a>
1691 <!--<code>&lt;Number&gt;</code>-->
1692 </li>
1693 <li><a href="#connMgr">connMgr</a>
1694 <!--<code>&lt;Number&gt;</code>-->
1695 </li>
1696 <li><a href="#connTimeout">connTimeout</a>
1697 <!--<code>&lt;Number&gt;</code>-->
1698 </li>
1699 <li><a href="#dataType">dataType</a>
1700 <!--<code>&lt;Number&gt;</code>-->
1701 </li>
1702 <li><a href="#ERROR_DATAINVALID">ERROR_DATAINVALID</a>
1703 <!--<code>&lt;Number&gt;</code>-->
1704 </li>
1705 <li><a href="#ERROR_DATANULL">ERROR_DATANULL</a>
1706 <!--<code>&lt;Number&gt;</code>-->
1707 </li>
1708 <li><a href="#liveData">liveData</a>
1709 <!--<code>&lt;Number&gt;</code>-->
1710 </li>
1711 <li><a href="#maxCacheEntries">maxCacheEntries</a>
1712 <!--<code>&lt;Number&gt;</code>-->
1713 </li>
1714 <li><a href="#responseType">responseType</a>
1715 <!--<code>&lt;Number&gt;</code>-->
1716 </li>
1717 <li><a href="#TYPE_JSARRAY">TYPE_JSARRAY</a>
1718 <!--<code>&lt;Number&gt;</code>-->
1719 </li>
1720 <li><a href="#TYPE_JSFUNCTIOn">TYPE_JSFUNCTIOn</a>
1721 <!--<code>&lt;Number&gt;</code>-->
1722 </li>
1723 <li><a href="#TYPE_JSON">TYPE_JSON</a>
1724 <!--<code>&lt;Number&gt;</code>-->
1725 </li>
1726 <li><a href="#TYPE_TEXT">TYPE_TEXT</a>
1727 <!--<code>&lt;Number&gt;</code>-->
1728 </li>
1729 <li><a href="#TYPE_UNKNOWN">TYPE_UNKNOWN</a>
1730 <!--<code>&lt;Number&gt;</code>-->
1731 </li>
1732 <li><a href="#TYPE_XHR">TYPE_XHR</a>
1733 <!--<code>&lt;Number&gt;</code>-->
1734 </li>
1735 <li><a href="#TYPE_XML">TYPE_XML</a>
1736 <!--<code>&lt;Number&gt;</code>-->
1737 </li>
1738 </ul>
1739 </div>
1741 <div class="module">
1742 <h4>Methods</h4>
1743 <ul class="content">
1744 <li><!--<code>void</code>-->
1745 <a href="#_xhrFailure">_xhrFailure</a>
1746 </li>
1747 <li><!--<code>void</code>-->
1748 <a href="#_xhrSuccess">_xhrSuccess</a>
1749 </li>
1750 <li><!--<code>void</code>-->
1751 <a href="#addToCache">addToCache</a>
1752 </li>
1753 <li><!--<code>void</code>-->
1754 <a href="#flushCache">flushCache</a>
1755 </li>
1756 <li><!--<code>Object</code>-->
1757 <a href="#getCachedResponse">getCachedResponse</a>
1758 </li>
1759 <li><!--<code>void</code>-->
1760 <a href="#handleResponse">handleResponse</a>
1761 </li>
1762 <li><!--<code>Boolean</code>-->
1763 <a href="#isCacheHit">isCacheHit</a>
1764 </li>
1765 <li><!--<code>void</code>-->
1766 <a href="#makeConnection">makeConnection</a>
1767 </li>
1768 <li><!--<code>Object</code>-->
1769 <a href="#parseArrayData">parseArrayData</a>
1770 </li>
1771 <li><!--<code>Object</code>-->
1772 <a href="#parseJSONData">parseJSONData</a>
1773 </li>
1774 <li><!--<code>Object</code>-->
1775 <a href="#parseTextData">parseTextData</a>
1776 </li>
1777 <li><!--<code>Object</code>-->
1778 <a href="#parseXMLData">parseXMLData</a>
1779 </li>
1780 <li><!--<code>void</code>-->
1781 <a href="#sendRequest">sendRequest</a>
1782 </li>
1783 <li><!--<code>String</code>-->
1784 <a href="#toString">toString</a>
1785 </li>
1786 </ul>
1787 </div>
1789 <div class="module">
1790 <h4>Events</h4>
1791 <ul class="content">
1792 <li>
1793 <a href="#cacheFlushEvent">cacheFlushEvent</a>
1794 </li>
1795 <li>
1796 <a href="#cacheRequestEvent">cacheRequestEvent</a>
1797 </li>
1798 <li>
1799 <a href="#dataErrorEvent">dataErrorEvent</a>
1800 </li>
1801 <li>
1802 <a href="#getCachedResponseEvent">getCachedResponseEvent</a>
1803 </li>
1804 <li>
1805 <a href="#parseResponseEvent">parseResponseEvent</a>
1806 </li>
1807 <li>
1808 <a href="#requestEvent">requestEvent</a>
1809 </li>
1810 <li>
1811 <a href="#responseCacheEvent">responseCacheEvent</a>
1812 </li>
1813 <li>
1814 <a href="#responseParseEvent">responseParseEvent</a>
1815 </li>
1816 </ul>
1817 </div>
1820 </div>
1821 </div>
1822 </div>
1823 <div id="ft">
1824 <hr />
1825 Copyright &copy; 2007 Yahoo! Inc. All rights reserved.
1826 </div>
1827 </div>
1828 </body>
1829 </html>