Changeset 5635

Show
Ignore:
Timestamp:
10/13/08 16:46:27 (5 weeks ago)
Author:
magi@…
Message:

Updated manual. Improvements on application embedding.

Location:
trunk/doc/manual
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/book.xml

    r5071 r5635  
    1717                </author> 
    1818 
    19                 <pubdate>2008-07-08</pubdate> 
     19                <pubdate>2008-10-09</pubdate> 
    2020 
    2121                <publisher> 
  • trunk/doc/manual/part1-application.xml

    r5554 r5635  
    13601360                                <classname>ApplicationServlet</classname> servlet generates an initial 
    13611361                                page that contains the correct parameters for the specific 
    1362                                 application. You can view the initial page easily by opening an 
    1363                                 application in a web browser and viewing its source code. The easiest way 
    1364                                 to embed an application is simply to copy and paste the embedding code 
    1365                                 from the initial page. 
     1362                                application. You can easily configure it to load multiple IT Mill Toolkit 
     1363                                applications on the same page, assuming that they use the same widget set. 
     1364                        </para> 
     1365 
     1366                        <para> 
     1367                                 You can view the initial page for your application easily simply by 
     1368                                 opening the application in a web browser and viewing the HTML source 
     1369                                 code. You could just copy and paste the embedding code from the default 
     1370                                 initial page. It has, however, some extra functionality that is not 
     1371                                 normally needed: it generates some of the script content with 
     1372                                 <methodname>document.write()</methodname> calls, which is useful only 
     1373                                 when you are running the application as a portlet in a portal. The method 
     1374                                 outlined below is much simpler. 
     1375                        </para> 
     1376 
     1377                        <para> 
     1378                                The <filename>WebContent/multiapp.html</filename> file included in the IT 
     1379                                Mill Toolkit installation package provides an example of embedding 
     1380                                (multiple) IT Mill Toolkit applications in a page. After launching the 
     1381                                demo application, you can view the example at URL 
     1382                                <uri>http://localhost:8888/multiapp.html</uri>. Notice that the example 
     1383                                assumes the use of root context for the applications 
     1384                                (<parameter>/</parameter>). 
    13661385                        </para> 
    13671386 
     
    13881407                                                the application URI and parameters and load the IT Mill Toolkit 
    13891408                                                Client-Side Engine. The <varname>itmill</varname> variable is an 
    1390                                                 associative map that contains parameters for the engine. The two 
    1391                                                 required parameters are the application URI, 
    1392                                                 <varname>appUri</varname>, and path info, 
    1393                                                 <varname>pathInfo</varname>. They are defined simply as follows: 
     1409                                                associative map that can contain various runtime data used by the 
     1410                                                Client-Side Engine of IT Mill Toolkit. The 
     1411                                                <varname>toolkitConfigurations</varname> item is itself an 
     1412                                                associate map that contains parameters for each of the 
     1413                                                applications embedded in the page. The map must contain the 
     1414                                                following items: 
    13941415                                        </para> 
    13951416 
    1396                                         <programlisting>    &lt;script type="text/javascript"&gt; 
    1397         var itmill = {appUri:'Calc', pathInfo: '/'}; 
    1398     &lt;/script&gt;</programlisting> 
     1417                                        <table> 
     1418                                                <title>toolkitConfigurations parameters</title> 
     1419                                                <tgroup cols="2" align="left"> 
     1420                                                        <tbody> 
     1421                                                                <row valign="top"> 
     1422                                                                        <entry><classname>appUri</classname></entry> 
     1423                                                                        <entry>The application URI consists of the context and 
     1424                                                                        the application path. If the context is 
     1425                                                                        <literal>/mycontext</literal> and the application path 
     1426                                                                        is <literal>myapp</literal>, the 
     1427                                                                        <parameter>appUri</parameter> would be 
     1428                                                                        <literal>/mycontext/myapp</literal>. The 
     1429                                                                        <filename>multiapp.html</filename> example assumes the 
     1430                                                                        use of root context, which is used in the demo 
     1431                                                                        application.</entry> 
     1432                                                                </row> 
     1433                                                                <row valign="top"> 
     1434                                                                        <entry><classname>pathInfo</classname></entry> 
     1435                                                                        <entry>The <parameter>PATHINFO</parameter> parameter 
     1436                                                                        for the Servlet.</entry> 
     1437                                                                </row> 
     1438                                                                <row valign="top"> 
     1439                                                                        <entry><classname>themeUri</classname></entry> 
     1440                                                                        <entry>URI of the application theme. The URI must 
     1441                                                                        include application context and the path to the theme 
     1442                                                                        directory. Themes are, by default, stored under the 
     1443                                                                        <filename>/ITMILL/themes/</filename> path.</entry> 
     1444                                                                </row> 
     1445                                                                <row valign="top"> 
     1446                                                                        <entry><classname>versionInfo</classname></entry> 
     1447                                                                        <entry>This item is itself an associative map that 
     1448                                                                        contains two parameters: 
     1449                                                                        <parameter>toolkitVersion</parameter> contains the 
     1450                                                                        version number of the IT Mill Toolkit version used by 
     1451                                                                        the application. The 
     1452                                                                        <parameter>applicationVersion</parameter> parameter 
     1453                                                                        contains the version of the particular 
     1454                                                                        application.</entry> 
     1455                                                                </row> 
     1456                                                        </tbody> 
     1457                                                </tgroup> 
     1458                                        </table> 
     1459 
     1460                                        <para> 
     1461                                                The following example defines two applications to run in the same 
     1462                                                window: the Calculator and Hello World examples. In the example, 
     1463                                                the application context is <literal>/tk5</literal>. 
     1464                                        </para> 
     1465 
     1466                                        <programlisting>&lt;script type="text/javascript"&gt; 
     1467    var itmill = { 
     1468        toolkitConfigurations: { 
     1469            '<emphasis role="bold">calc</emphasis>': { 
     1470                appUri:'<emphasis role="bold">/tk5/Calc</emphasis>', 
     1471                pathInfo: '<emphasis role="bold">/</emphasis>', 
     1472                themeUri: '<emphasis role="bold">/tk5/ITMILL/themes/example</emphasis>', 
     1473                versionInfo : { 
     1474                    toolkitVersion:"5.9.9-INTERNAL-NONVERSIONED-DEBUG-BUILD", 
     1475                    applicationVersion:"NONVERSIONED" 
     1476                } 
     1477            }, 
     1478            '<emphasis role="bold">hello</emphasis>': { 
     1479                appUri:'<emphasis role="bold">/tk5/HelloWorld</emphasis>', 
     1480                pathInfo: '<emphasis role="bold">/</emphasis>', 
     1481                themeUri: '<emphasis role="bold">/tk5/ITMILL/themes/example</emphasis>', 
     1482                versionInfo : { 
     1483                    toolkitVersion:"5.9.9-INTERNAL-NONVERSIONED-DEBUG-BUILD", 
     1484                    applicationVersion:"NONVERSIONED" 
     1485                } 
     1486            } 
     1487        }}; 
     1488&lt;/script&gt;</programlisting> 
    13991489                                </listitem> 
    14001490 
     
    14061496                                        </para> 
    14071497 
    1408                                         <programlisting>&lt;script language='javascript' src='/<emphasis>itmill-toolkit-examples</emphasis>/ITMILL/widgets 
    1409 ets/com.itmill.toolkit.terminal.gwt.DefaultWidgetSet/com.itmill.toolkit.te 
    1410 rminal.gwt.DefaultWidgetSet.nocache.js'&gt;&lt;/script&gt;</programlisting> 
     1498                                        <programlisting>&lt;script language='javascript' 
     1499    src='/<emphasis>itmill-toolkit-examples</emphasis>/ITMILL/widgetsets/com.itmill.toolk 
     1500it.terminal.gwt.DefaultWidgetSet/com.itmill.toolkit.terminal.gwt.DefaultWi 
     1501dgetSet.nocache.js'&gt;&lt;/script&gt;</programlisting> 
    14111502 
    14121503                                        <para>