Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 365 lines (295 sloc) 20.645 kB
d7ce407 @mojit0 Initialize repository.
mojit0 authored
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
3 <head>
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
5 <title>API: MojitoServer Composite.common (YUI Library)</title>
6
7 <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css?stamp=1327685401.85" />
8 <link rel="stylesheet" type="text/css" href="assets/api.css?stamp=1327685401.85" />
9
10 <script type="text/javascript" src="assets/api-js?stamp=1327685401.85"></script>
11 <script type="text/javascript" src="assets/ac-js?stamp=1327685401.85"></script>
12 </head>
13
14 <body id="yahoo-com">
15
16 <div id="doc3" class="yui-t2">
17 <div id="hd">
18 <h1><a href="http://developer.yahoo.com/yui/" title="mojito">mojito</a></h1>
19 <h3>MojitoServer&nbsp; <span class="subtitle">0.1.0</span></h3>
20 <a href="./index.html" title="mojito">mojito</a>
21 &gt; <a href="./module_MojitoServer.html" title="MojitoServer">MojitoServer</a>
22 &gt; Composite.common
23
24 <form onsubmit="return false">
25 <div id="propertysearch">
26 Search: <input autocomplete="off" id="searchinput" />
27 <div id="searchresults">
28 &nbsp;
29 </div>
30 </div>
31 </form>
32 </div>
33
34 <div id="bd">
35 <div id="yui-main">
36 <div class="yui-b">
37 <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
38 <fieldset>
39 <legend>Filters</legend>
40 <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
41 <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
42 <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
43 </fieldset>
44 </form>
45
46 <h2>
47
48
49
50
51 Class <b property="yui:name">Composite.common</b>
52 <span class="extends">
53 </span>
54
55 </h2>
56 <!-- class tree goes here -->
57
58
59
60
61 <div class="summary description" property="yui:description">
62 <strong>Access point:</strong> <em>ac.composite.*</em>
63 Provides methods for working with many Mojits.
64 </div>
65
66
67 <div rel="yui:properties" resource="#properties">
68
69 </div>
70
71 <div rel="yui:methods" resource="#methods">
72 <div class="section method details">
73 <h3 id="methods">Methods</h3>
74 <div class="content">
75 <div class="" rel="yui:method" resource="#method_done">
76 <h4>
77 <a name="method_done">done</a></h4>
78 <div class="detail" >
79 <code>
80
81
82
83 void
84 <strong property="yui:name">done</strong>
85 (
86
87
88 opts
89
90
91 )
92 </code>
93
94 <div class="description" property="yui:description">
95 Automatically dispatches all the children of this mojit and collects their executed values into the view
96 template, keyed by the child's name within the mojit's configuration. For example, given the mojit spec:
97 <pre>
98 "specs": {
99 "parent": {
100 "type": "MyCompositeMojit",
101 "config": {
102 "children": {
103 "foo": {
104 "type": "FooMojit"
105 },
106 "bar": {
107 "type": "BarMojit"
108 }
109 }
110 }
111 }
112 }
113 </pre>
114 And given the view template:
115 <pre>
116 &lt;div id=&quot;{{mojit_uuid}}&quot;&gt;
117 &lt;h1&gt;{{title}}&lt;/h1&gt;
118 &lt;div class=&quot;fooslot&quot;&gt;
119 {{{foo}}}
120 &lt;/div&gt;
121 &lt;div class=&quot;barslot&quot;&gt;
122 {{{bar}}}
123 &lt;/div&gt;
124 &lt;/div&gt;
125 </pre>
126 And the controller:
127 <pre>
128 Y.mojito.controller = {
129 index: function(ac) {
130 ac.composite.done({
131 template: { title: 'Hello there' } // for the view only
132 });
133 }
134 };
135 </pre>
136 This will execute the child intances of the "FooMojit" and "BarMojit", returning their rendered values into
137 the parent's view template, thus rendering the full parent view including the children.
138 All the parent parameters are passed along to children.
139 </div>
140
141 <div class="description">
142
143 <dl rel="yui:parameters">
144 <dt>Parameters:</dt>
145 <dd rel="yui:parameter">
146 <code><span property="yui:name">opts</span>
147 &lt;<span property="yui:type">object</span>&gt;
148 </code>
149 <span property="yui:description"> The configuration object to be used. <em>template<em> can be used to provide additional
150 view template values.</span>
151 </dd>
152 </dl>
153
154 <dl>
155 <dt>Returns:
156 <code property="yui:return">
157 void
158 </code></dt>
159 <dd property="yui:returnInfo"></dd>
160 </dl>
161
162
163
164
165 </div>
166
167 </div>
168 <hr />
169 </div>
170 <div class="" rel="yui:method" resource="#method_execute">
171 <h4>
172 <a name="method_execute">execute</a></h4>
173 <div class="detail" >
174 <code>
175
176
177
178 void
179 <strong property="yui:name">execute</strong>
180 (
181
182
183 cfg
184
185
186 ,
187 cb
188
189
190 )
191 </code>
192
193 <div class="description" property="yui:description">
194 This method requires an explicit config object and returns
195 a RMP compliant object via a callback.
196 <pre>
197 cfg = {
198 children: {
199 slot-1: {
200 type: "default",
201 action: "index"
202 },
203 slot-2: {
204 type: "default",
205 action: "index",
206 params: {
207 route: {},
208 url: {},
209 body: {},
210 file: {}
211 }
212 }
213 },
214 assets: {}
215 }
216 </pre>
217 The "callback" is an object containg the child slots with its
218 rendered data.
219 <pre>
220 callback({
221 slot-1: <string>,
222 slot-2: <string>
223 },
224 {
225 http: {}
226 assets: {}
227 })
228 </pre>
229 </div>
230
231 <div class="description">
232
233 <dl rel="yui:parameters">
234 <dt>Parameters:</dt>
235 <dd rel="yui:parameter">
236 <code><span property="yui:name">cfg</span>
237 &lt;<span property="yui:type">object</span>&gt;
238 </code>
239 <span property="yui:description"> The configuration object to be used</span>
240 </dd>
241 <dd rel="yui:parameter">
242 <code><span property="yui:name">cb</span>
243 &lt;<span property="yui:type">function</span>&gt;
244 </code>
245 <span property="yui:description"> The callback that will be called</span>
246 </dd>
247 </dl>
248
249 <dl>
250 <dt>Returns:
251 <code property="yui:return">
252 void
253 </code></dt>
254 <dd property="yui:returnInfo"></dd>
255 </dl>
256
257
258
259
260 </div>
261
262 </div>
263 <hr />
264 </div>
265 </div>
266 </div>
267
268 </div>
269
270 <div rel="yui:events" resource="#events">
271
272
273 </div>
274
275 <div rel="yui:attributes" resource="#configattributes">
276
277 </div>
278
279 </div>
280 </div>
281 <div class="yui-b">
282 <div class="nav">
283
284 <div id="moduleList" class="module">
285 <h4>Modules</h4>
286 <ul class="content">
287 <li class=""><a href="module_ActionContext.html" title="ActionContext">ActionContext</a></li>
288 <li class=""><a href="module_ActionContextAddon.html" title="ActionContextAddon">ActionContextAddon</a></li>
289 <li class=""><a href="module_CommonLibs.html" title="CommonLibs">CommonLibs</a></li>
290 <li class=""><a href="module_MojitoClient.html" title="MojitoClient">MojitoClient</a></li>
291 <li class="selected"><a href="module_MojitoServer.html" title="MojitoServer">MojitoServer</a></li>
292 </ul>
293 </div>
294
295 <div id="classList" class="module">
296 <h4>Classes</h4>
297 <ul class="content">
298 <li class="selected"><a href="Composite.common.html" title="Composite.common">Composite.common</a></li>
299 <li class=""><a href="Config.common.html" title="Config.common">Config.common</a></li>
300 <li class=""><a href="Cookie.client.html" title="Cookie.client">Cookie.client</a></li>
301 <li class=""><a href="Cookie.server.html" title="Cookie.server">Cookie.server</a></li>
302 <li class=""><a href="Http.server.html" title="Http.server">Http.server</a></li>
303 <li class=""><a href="Intl.common.html" title="Intl.common">Intl.common</a></li>
304 <li class=""><a href="MojitoServer.html" title="MojitoServer">MojitoServer</a></li>
305 <li class=""><a href="Params.common.html" title="Params.common">Params.common</a></li>
306 <li class=""><a href="Partial.common.html" title="Partial.common">Partial.common</a></li>
307 <li class=""><a href="Url.common.html" title="Url.common">Url.common</a></li>
308 </ul>
309 </div>
310
311 <!--
312 <div id="fileList" class="module">
313 <h4>Files</h4>
314 <ul class="content">
315 <li class=""><a href="analytics.common.js.html" title="analytics.common.js">analytics.common.js</a></li>
316 <li class=""><a href="composite.common.js.html" title="composite.common.js">composite.common.js</a></li>
317 <li class=""><a href="config.common.js.html" title="config.common.js">config.common.js</a></li>
318 <li class=""><a href="controller.common.js.html" title="controller.common.js">controller.common.js</a></li>
319 <li class=""><a href="controller.server.js.html" title="controller.server.js">controller.server.js</a></li>
320 <li class=""><a href="controller.server.js.html" title="controller.server.js">controller.server.js</a></li>
321 <li class=""><a href="cookie.client.js.html" title="cookie.client.js">cookie.client.js</a></li>
322 <li class=""><a href="cookie.server.js.html" title="cookie.server.js">cookie.server.js</a></li>
323 <li class=""><a href="glob.js.html" title="glob.js">glob.js</a></li>
324 <li class=""><a href="http.server.js.html" title="http.server.js">http.server.js</a></li>
325 <li class=""><a href="index.js.html" title="index.js">index.js</a></li>
326 <li class=""><a href="index.js.html" title="index.js">index.js</a></li>
327 <li class=""><a href="intl.common.js.html" title="intl.common.js">intl.common.js</a></li>
328 <li class=""><a href="mu.client.js.html" title="mu.client.js">mu.client.js</a></li>
329 <li class=""><a href="mu.server.js.html" title="mu.server.js">mu.server.js</a></li>
330 <li class=""><a href="output-handler.server.js.html" title="output-handler.server.js">output-handler.server.js</a></li>
331 <li class=""><a href="params.common.js.html" title="params.common.js">params.common.js</a></li>
332 <li class=""><a href="partial.common.js.html" title="partial.common.js">partial.common.js</a></li>
333 <li class=""><a href="server-log.js.html" title="server-log.js">server-log.js</a></li>
334 <li class=""><a href="store-provider.server.js.html" title="store-provider.server.js">store-provider.server.js</a></li>
335 <li class=""><a href="store.server.js.html" title="store.server.js">store.server.js</a></li>
336 <li class=""><a href="url.common.js.html" title="url.common.js">url.common.js</a></li>
337 </ul>
338 </div>
339 -->
340
341
342 <div id="methodsList" class="module">
343 <h4>Methods</h4>
344 <ul class="content">
345 <li class=""><a href="#method_done" title="done">done</a></li>
346 <li class=""><a href="#method_execute" title="execute">execute</a></li>
347 </ul>
348 </div>
349
350
351
352 </div>
353 </div>
354 </div>
355 <div id="ft">
356 <hr />
357 Copyright &copy; 2012 Yahoo! Inc. All rights reserved.
358 </div>
359 </div>
360 <script type="text/javascript">
361 ALL_YUI_PROPS = [{"url": "Http.server.html#method_addHeader", "access": "", "host": "Http.server", "type": "method", "name": "addHeader"}, {"url": "Http.server.html#method_addHeaders", "access": "", "host": "Http.server", "type": "method", "name": "addHeaders"}, {"url": "MojitoServer.html#method_addMojitoToExpressApp", "access": "", "host": "MojitoServer", "type": "method", "name": "addMojitoToExpressApp"}, {"url": "Params.common.html#method_all", "access": "", "host": "Params.common", "type": "method", "name": "all"}, {"url": "Params.common.html#method_body", "access": "", "host": "Params.common", "type": "method", "name": "body"}, {"url": "MojitoServer.html#method_createServer", "access": "", "host": "MojitoServer", "type": "method", "name": "createServer"}, {"url": "Composite.common.html#method_done", "access": "", "host": "Composite.common", "type": "method", "name": "done"}, {"url": "Composite.common.html#method_execute", "access": "", "host": "Composite.common", "type": "method", "name": "execute"}, {"url": "Params.common.html#method_files", "access": "", "host": "Params.common", "type": "method", "name": "files"}, {"url": "Intl.common.html#method_formatDate", "access": "", "host": "Intl.common", "type": "method", "name": "formatDate"}, {"url": "Params.common.html#method_getAll", "access": "", "host": "Params.common", "type": "method", "name": "getAll"}, {"url": "Params.common.html#method_getFromBody", "access": "", "host": "Params.common", "type": "method", "name": "getFromBody"}, {"url": "Params.common.html#method_getFromMerged", "access": "", "host": "Params.common", "type": "method", "name": "getFromMerged"}, {"url": "Params.common.html#method_getFromRoute", "access": "", "host": "Params.common", "type": "method", "name": "getFromRoute"}, {"url": "Params.common.html#method_getFromUrl", "access": "", "host": "Params.common", "type": "method", "name": "getFromUrl"}, {"url": "Http.server.html#method_getHeader", "access": "", "host": "Http.server", "type": "method", "name": "getHeader"}, {"url": "Http.server.html#method_getHeaders", "access": "", "host": "Http.server", "type": "method", "name": "getHeaders"}, {"url": "Http.server.html#method_getRequest", "access": "", "host": "Http.server", "type": "method", "name": "getRequest"}, {"url": "Http.server.html#method_getResponse", "access": "", "host": "Http.server", "type": "method", "name": "getResponse"}, {"url": "Partial.common.html#method_invoke", "access": "", "host": "Partial.common", "type": "method", "name": "invoke"}, {"url": "Http.server.html#method_isXhr", "access": "", "host": "Http.server", "type": "method", "name": "isXhr"}, {"url": "Intl.common.html#method_lang", "access": "", "host": "Intl.common", "type": "method", "name": "lang"}, {"url": "Params.common.html#method_merged", "access": "", "host": "Params.common", "type": "method", "name": "merged"}, {"url": "Http.server.html#method_redirect", "access": "", "host": "Http.server", "type": "method", "name": "redirect"}, {"url": "Partial.common.html#method_render", "access": "", "host": "Partial.common", "type": "method", "name": "render"}, {"url": "Params.common.html#method_route", "access": "", "host": "Params.common", "type": "method", "name": "route"}, {"url": "Http.server.html#method_setHeader", "access": "", "host": "Http.server", "type": "method", "name": "setHeader"}, {"url": "Http.server.html#method_setHeaders", "access": "", "host": "Http.server", "type": "method", "name": "setHeaders"}, {"url": "Params.common.html#method_url", "access": "", "host": "Params.common", "type": "method", "name": "url"}];
362 </script>
363 </body>
364 </html>
Something went wrong with that request. Please try again.