Author: mmcallis
Date: 2008-02-14 03:06:18 -0500 (Thu, 14 Feb 2008)
New Revision: 9967
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
Log:
revising 5.2.2.3. Portlet Class with variablelists.
Periodic backup. This will break the book until later
commits.
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
===================================================================
---
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-14
07:17:39 UTC (rev 9966)
+++
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-14
08:06:18 UTC (rev 9967)
@@ -659,12 +659,11 @@
<sect3>
<title>Portlet Class</title>
<para>
- Included in the <ulink
-
url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles...
- download bundle</ulink> you should have one java source file:
-
<literal>HelloWorldJSPPortlet\src\main\org\jboss\portlet\hello\HelloWorldJSPPortlet.java</literal>,
- containing the following:
- <programlisting><![CDATA[package org.jboss.portlet.hello;
+ The <ulink
url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles...
contains a
<filename>HelloWorldJSPPortlet/src/main/org/jboss/portlet/hello/HelloWorldJSPPortlet.java</filename>
file:
+ </para>
+ <para>
+<screen><![CDATA[
+package org.jboss.portlet.hello;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
@@ -727,24 +726,27 @@
.getRequestDispatcher("/WEB-INF/jsp/edit.jsp");
prd.include(rRequest, rResponse);
}
-}]]></programlisting>
- Now let's look at some of our methods:
- <itemizedlist>
- <listitem>
- <para>
- <programlisting><![CDATA[protected void
doHelp(RenderRequest rRequest, RenderResponse rResponse) { ... }
+}]]>
+</screen>
+</para>
+<para>
+ <variablelist>
+ <varlistentry><term><screen><![CDATA[
+protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) { ... }
// And
-protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) { ... }
]]></programlisting>
- Support for these Modes must be declared in the portlet.xml. They
will be triggered when a user
- clicks on the respective icons in the portlet window titlebar, or
through generated links within
- the portlet.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[public void
processAction(ActionRequest aRequest, ActionResponse aResponse)
+protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) { ... } ]]>
+</screen></term>
+<listitem>
+ <para>
+ Support for these modes must be declared in the
<filename>HelloWorldJSPPortlet/WEB-INF/portlet.xml</filename> file. They will
be triggered when a user clicks on the respective icons in the portlet window titlebar, or
through generated links within the portlet.
+ </para>
+</listitem>
+</varlistentry>
+<variablelist>
+ <varlistentry><term><screen><![CDATA[
+public void processAction(ActionRequest aRequest, ActionResponse aResponse)
throws PortletException, IOException, UnavailableException
{
String sYourname = (String) aRequest.getParameter("yourname");
@@ -752,9 +754,16 @@
// do something
aResponse.setRenderParameter("yourname", sYourname);
-}]]></programlisting>
- This method will be triggered upon clicking on an
<literal>ActionURL</literal> from our
- <literal>view.jsp</literal>. It will retrieve
<literal>yourname</literal> from the HTML form,
+}]]>
+</screen></term>
+<listitem>
+ <para>
+ This method is triggered when a user clicks on an
<computeroutput>actionURL</computeroutput>, which is defined in the
<filename>HelloWorldJSPPortlet/WEB-INF/jsp/view.jsp</filename> file. This
retrieves <computeroutput>yourname</computeroutput> from the HTML form, and
passes it as a <literal>renderParameter</literal> to the
<literal>doView()</literal> method.
+ </para>
+</listitem>
+</varlistentry>
+
+ It will retrieve <literal>yourname</literal> from the HTML form,
and pass it along as a
<literal>renderParameter</literal> to the
<literal>doView()</literal>
method.
</para>