Author: mmcallis
Date: 2008-02-14 23:44:18 -0500 (Thu, 14 Feb 2008)
New Revision: 9985
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
Log:
5.2.2.5. Building and deploying your portlet
revising with more content so that it is consistent with
5.2.1. Deploying your First Portlet
*** this will break the book***, but I wanted a backup :)
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-15
02:42:15 UTC (rev 9984)
+++
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-15
04:44:18 UTC (rev 9985)
@@ -137,7 +137,7 @@
</sect2>-->
<sect2>
- <title>Deploying your First Portlet</title>
+ <title>Deploying your first Portlet</title>
<sect3>
<title>Introduction</title>
<para>
@@ -518,7 +518,7 @@
<sect3 id="first_portlet_build">
<title>Building your Portlet</title>
<para>
- A pre-compiled
<filename>HelloWorldPortlet/helloworldportlet.war</filename> file is created
after extracting the <filename>HelloWorldPortlet.zip</filename> file. To
manually build the <filename>helloworldportlet.war</filename> file:
+ The <filename>HelloWorldPortlet.zip</filename> file contains a
pre-compiled <filename>helloworldportlet.war</filename> file; however, to
manually build the <filename>helloworldportlet.war</filename> file:
</para>
<para>
<orderedlist>
@@ -534,7 +534,7 @@
</listitem>
<listitem>
<para>
- Run the <command>ant deploy</command> command:
+ Run the <command>ant deploy</command> command. On Microsoft Windows,
the output will be similar to the following:
</para>
<para>
<mediaobject>
@@ -543,6 +543,9 @@
</imageobject>
</mediaobject>
</para>
+ <para>
+ Note: the directory names will be different for your system.
+ </para>
</listitem>
</orderedlist>
</para>
@@ -553,12 +556,12 @@
<orderedlist>
<listitem>
<para>
- If you do not have the
<filename>HelloWorldPortlet/helloworldportlet.war</filename> file, change into
the <filename>HelloWorldPortlet/</filename> directory, and run the
<command>ant deploy</command> command. This creates a
<filename>helloworldportlet.war</filename> file.
+ If you do not have the
<filename>HelloWorldPortlet/helloworldportlet.war</filename> file, change into
the <filename>HelloWorldPortlet/</filename> directory, and run the
<command>ant deploy</command> command. This creates the
<filename>helloworldportlet.war</filename> file.
</para>
</listitem>
<listitem>
<para>
- To expand the war file, change into the
<filename>HelloWorldPortlet/</filename> directory, and run the
<command>ant explode</command> command:
+ To expand the war file, change into the
<filename>HelloWorldPortlet/</filename> directory, and run the
<command>ant explode</command> command. On Microsoft Windows, the output will
be similar to the following:
</para>
<para>
<mediaobject>
@@ -567,6 +570,9 @@
</imageobject>
</mediaobject>
</para>
+ <para>
+ Note: the directory names will be different for your system.
+ </para>
</listitem>
</orderedlist>
</para>
@@ -863,7 +869,95 @@
</para>
</sect3>
<sect3>
- <title>Building and deploying your portlet</title>
+ <title>Building your Portlet</title>
+ <para>
+ The <filename>HelloWorldJSPPortlet.zip</filename> file contains a
pre-compiled <filename>helloworldjspportlet.war</filename> file; however, to
manually build the <filename>helloworldjspportlet.war</filename> file:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Change into the <filename>HelloWorldJSPPortlet/</filename>
directory, and remove the existing
<filename>helloworldjspportlet.war</filename> file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If required, edit the
<filename>HelloWorldJSPPortlet/src/main/org/jboss/portlet/hello/HelloWorldJSPPortlet.java</filename>
file, and the XML descriptors in the
<filename>HelloWorldJSPPortlet/src/resources/helloworldjspportlet-war/WEB-INF</filename>
directory.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Run the <command>ant deploy</command> command. On Linux, the output
will be similar to the following:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center"
fileref="images/tutorials/jsp_portlet/jsp_ant_deploy.png"
valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ Note: the directory names will be different for your system.
+ </para>
+ <para>
+ Expanding the <filename>helloworldjspportlet.war</filename> file allows
you to deploy the portlet as an expanded directory, which makes development easier. As
well, it gives you access to the XML descriptors, resource files, JSF, and JSP pages. To
expand the <filename>helloworldjspportlet.war</filename> file:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ If you do not have the
<filename>HelloWorldJSPPortlet/helloworldjspportlet.war</filename> file,
change into the <filename>HelloWorldJSPPortlet/</filename> directory, and run
the <command>ant deploy</command> command. This creates the
<filename>helloworldjspportlet.war</filename> file.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ To expand the war file, change into the
<filename>HelloWorldJSPPortlet/</filename> directory, and run the
<command>ant explode</command> command. On Linux, the output will be similar
to the following:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center"
fileref="images/tutorials/jsp_portlet/jsp_ant_explode.png"
valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <para>
+ Note: the directory names will be different for your system.
+ </para>
+ <para>
+ The <command>ant explode</command> command creates a directory
structure such as the following:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center"
fileref="images/tutorials/jsp_portlet/exploded.gif"
valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>
+ The expanded war file and the XML descriptors are located in the
<filename>HelloWorldPortlet/output/lib/exploded/helloworldportlet.war/</filename>
directory.
+ </para>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<para>If you have downloaded the sample, you can execute the build.xml
with ant or inside your IDE.
Executing the <literal>deploy</literal> target will compile
all source files and produce a
<literal>helloworldjspportlet.war</literal> file in a way
similar to what we saw in
@@ -873,7 +967,7 @@
The <literal>explode</literal> target will produce the
following:
<mediaobject>
<imageobject>
- <imagedata align="center"
fileref="images/tutorials/jsp_portlet/exploded.gif"
valign="middle"/>
+ <imagedata align="center"
fileref="images/tutorials/jsp_ant_explode.png" valign="middle"/>
</imageobject>
</mediaobject>
</para>