[Laszlo-checkins] r8548 - openlaszlo/trunk/lps/components/rpc
lou@openlaszlo.org
lou at openlaszlo.org
Fri Apr 4 05:35:47 PDT 2008
Author: lou
Date: 2008-04-04 05:35:32 -0700 (Fri, 04 Apr 2008)
New Revision: 8548
Modified:
openlaszlo/trunk/lps/components/rpc/webapprpc.lzx
Log:
Change 20080404-lou-w by lou at loumac.local on 2008-04-04 08:27:16 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: fix webapprpc reference page
Bugs Fixed: LPP-5656
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Details: add introductory paragraphs and live example from r3.4
add missing links from r3.4, link check and fix all links
Tests: visual verify
Modified: openlaszlo/trunk/lps/components/rpc/webapprpc.lzx
===================================================================
--- openlaszlo/trunk/lps/components/rpc/webapprpc.lzx 2008-04-04 12:34:11 UTC (rev 8547)
+++ openlaszlo/trunk/lps/components/rpc/webapprpc.lzx 2008-04-04 12:35:32 UTC (rev 8548)
@@ -9,30 +9,6 @@
</allow>
</security>
- <!--- A class to get an http web application object and invoke its methods.
- Remote method signatures are:
-
- getAttribute(name) - returns object, array, or primitive type.
- getAttributeNames() - returns array of attribute names.
- getMajorVersion() - returns the major version number of the Java
- Servlet API that the remote servlet supports.
- getMinorVersion() - returns the minor version number of the Java
- Servlet API that the remote servlet supports.
- getMimeType(filename) - returns the MIME type of the specified
- filename, or null if the MIME type is not known.
- getServerInfo() - returns the name and version of the servlet container
- on which the servlet is running.
- getServletContextName() - returns the name of this web application
- correponding to this ServletContext as specified in the deployment
- descriptor for this web application by the display-name element.
- log(msg) - writes the specified message to a servlet log file, usually
- an event log; returns void.
- removeAttribute(name) - remove attribute named name; returns void.
- setAttribute(name,value) - set attribute named name with value; returns
- void.
-
- See javax.servlet.ServletContext in the Java Servlet API documentation
- for more information. -->
<class name="webapprpc" extends="rpc">
<!--- @keywords private -->
@@ -76,11 +52,223 @@
return ok;
</method>
+ <doc>
+ <tag name="shortdesc"><text>WebappRPC object</text></tag>
+ <text>
+ <p>A class to get an http web application object and invoke its methods. Remote
+ method signatures are:</p>
+
+
+ <ul>
+
+ <li>
+ <dfn>getAttribute(name)</dfn>: returns object, array, or primitive
+ type.</li>
+
+ <li>
+ <dfn>getAttributeNames()</dfn>: returns array of attribute names.</li>
+
+ <li>
+ <dfn>getMajorVersion()</dfn>: returns the major version number of the Java
+ Servlet API that the remote servlet supports.</li>
+
+ <li>
+ <dfn>getMinorVersion()</dfn>: returns the minor version number of the Java
+ Servlet API that the remote servlet supports.</li>
+
+ <li>
+ <dfn>getMimeType(filename)</dfn>: returns the MIME type of the specified
+ filename, or null if the MIME type is not known.</li>
+
+ <li>
+ <dfn>getServerInfo()</dfn>: returns the name and version of the servlet
+ container on which the servlet is running.</li>
+
+ <li>
+ <dfn>getServletContextName()</dfn>: returns the name of this web application
+ correponding to this ServletContext as specified in the deployment
+ descriptor for this web application by the display-name element.</li>
+
+ <li>
+ <dfn>log(msg)</dfn>: writes the specified message to a servlet log file,
+ usually an event log; returns void.</li>
+
+ <li>
+ <dfn>removeAttribute(name)</dfn>: remove attribute named name; returns
+ void.</li>
+
+ <li>
+ <dfn>setAttribute(name,value)</dfn>: set attribute named name with value;
+ returns void.</li>
+
+ </ul>
+
+
+ <p>See <a href="http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html" shape="rect">
+ javax.servlet.ServletContext</a> in the <a href="http://java.sun.com/products/servlet/2.3/javadoc/" shape="rect">Java Servlet API</a>
+ documentation for details.</p>
+ <example>
+ <![CDATA[
+ <canvas width="800" height="500" debug="true">
+
+ <debug x="300" y="20" width="500" height="400" />
+
+ <webapprpc id="webapp" autoload="false">
+
+ <handler name="oninit">
+ Debug.write('loading webapp object...');
+ this.load();
+ </handler>
+
+ <handler name="onload">
+ Debug.write('webapp object loaded');
+ canvas.buttons.setAttribute('visible', true);
+ </handler>
+
+ <handler name="ondata" args="data">
+ if (data == LzRPC.t_void) {
+ Debug.write("default ondata: void");
+ } else {
+ Debug.write("default ondata:", data);
+ }
+ </handler>
+
+ <handler name="onerror" args="error">
+ Debug.write("default onerror:", error);
+ </handler>
+
+ <remotecall funcname="getMajorVersion" />
+
+ <remotecall funcname="getMinorVersion" />
+
+ <remotecall name="htmlGetMimeType" funcname="getMimeType">
+ <param value="'foo.html'" />
+ </remotecall>
+
+ <remotecall name="swfGetMimeType" funcname="getMimeType">
+ <param value="'foo.swf'" />
+ </remotecall>
+
+ <remotecall funcname="getServerInfo" />
+
+ <remotecall funcname="getServletContextName" />
+
+ <!-- look in your servlet container's log for this message-->
+ <remotecall funcname="log">
+ <param value="'a message'" />
+ </remotecall>
+
+ <remotecall name="getmyattr" funcname="getAttribute">
+ <param value="'myattr'" />
+ </remotecall>
+
+ <remotecall name="getmyother" funcname="getAttribute">
+ <param value="${'myother'}" />
+ </remotecall>
+
+ <remotecall funcname="getAttributeNames" />
+
+ <remotecall name="removemyattr" funcname="removeAttribute">
+ <param value="'myattr'" />
+ </remotecall>
+
+ <remotecall name="removemyother" funcname="removeAttribute">
+ <param value="'myother'" />
+ </remotecall>
+
+ <remotecall name="setmyattr" funcname="setAttribute">
+ <param value="'myattr'" />
+ <param value="'MY ATTRIBUTE'" />
+ </remotecall>
+
+ <remotecall name="setmyother" funcname="setAttribute">
+ <param value="'myother'" />
+ <param value="'MY OTHER'" />
+ </remotecall>
+
+ </webapprpc>
+
+
+ <view name="buttons" x="10" y="10" layout="spacing: 5" visible="false">
+
+ <button text="getMajorVersion" onclick="webapp.getMajorVersion.invoke()" />
+ <button text="getMinorVersion" onclick="webapp.getMinorVersion.invoke()" />
+
+ <button text="htmlGetMimeType" onclick="webapp.htmlGetMimeType.invoke()" />
+ <button text="swfGetMimeType" onclick="webapp.swfGetMimeType.invoke()" />
+ <button text="getServerInfo" onclick="webapp.getServerInfo.invoke()" />
+ <button text="getServletContextName" onclick="webapp.getServletContextName.invoke()" />
+
+ <!-- look in your servlet container's log for this message-->
+ <button text="log" onclick="webapp.log.invoke()" />
+
+ <view x="20" layout="spacing: 5">
+
+ <attribute name="myDel" value="null" type="expression" />
+
+ <handler name="oninit">
+ this.myDel = new LzDelegate(this, 'myhandler');
+ </handler>
+
+ <method name="myhandler" args="data">
+ Debug.write('myhandler:', data);
+ </method>
+
+ <button text="setmyattr" onclick="webapp.setmyattr.invoke()" />
+
+ <button text="setmyother" onclick="webapp.setmyother.invoke()" />
+
+ <button text="getmyattr" onclick="webapp.getmyattr.invoke()" />
+
+ <button text="getmyother" onclick="webapp.getmyother.invoke()" />
+
+ <button text="getAttributeNames" onclick="webapp.getAttributeNames.invoke()" />
+
+ <button text="getmyattr (w/params)" onclick="webapp.getmyattr.invoke(['myattr'])" />
+
+ <button text="getmyattr (w/params and delegate)">
+ <handler name="onclick">
+ webapp.getmyattr.invoke(['myattr'], parent.mydel);
+ </handler>
+ </button>
+
+ <button text="removemyattr" onclick="webapp.removemyattr.invoke()" />
+
+ <button text="removemyother" onclick="webapp.removemyother.invoke()" />
+
+ </view>
+ </view>
+ </canvas>
+ ]]>
+ </example>
+ <p><b>See Also:</b></p>
+ <ul>
+ <li>
+ <a href="lz.rpc.html"><code class="classname">rpc</code></a>
+ </li>
+ <li>
+ <a href="lz.javarpc.html"><code class="classname">javarpc</code></a>
+ </li>
+ <li>
+ <a href="lz.sessionrpc.html"><code class="classname">sessionrpc</code></a>
+ </li>
+ <li>
+ <a href="lz.remotecall.html"><code class="classname">remotecall</code></a>
+ </li>
+ <li>
+ <a href="../developers/rpc.html" target="laszlo-dguide" shape="rect">Developer's Guide: RPC chapter</a>
+ </li>
+ <li>
+ <a href="../developers/rpc-javarpc.html" target="laszlo-dguide" shape="rect">Developer's Guide: JavaRPC chapter</a>
+ </li>
+ </ul>
+ </text>
+ </doc>
</class>
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
More information about the Laszlo-checkins
mailing list