JBoss Portal SVN: r9698 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-01 02:49:00 -0500 (Fri, 01 Feb 2008)
New Revision: 9698
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
Log:
revising structure of 2.3.3. Building and Deploying from the Sources
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 07:06:19 UTC (rev 9697)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 07:49:00 UTC (rev 9698)
@@ -312,30 +312,30 @@
</sect2>
<sect2 id="building_deploying_from_source">
<title>Building and Deploying from the Sources</title>
- <para>To build and deploy JBoss Portal from the sources, change into the <filename>JBOSS_PORTAL_INSTALL_DIRECTORY/build/</filename> directory. Microsoft Windows users need to run the <command>build.bat deploy</command> command, and Linux users need to run the <command>./build.sh deploy</command> command.
+ <para>
+ During the first build, third-party libraries will be obtained from an online
+ repository, so you must be connected to the Internet, and if you are behind a proxy server, you also
+ need to define your proxy server address and proxy server port number. If you are running Linux, add the following line to the <filename>JBOSS_INSTALLATION_DIRECTORY/bin/run.sh</filename> file:
</para>
<para>
- During the first build, third-party libraries will be obtained from an online
- repository, so you must be connected to Internet, and if you are behind a proxy server, you also
- need to define your proxy address and host. If you are running Linux, add the following line to the <filename>JBOSS_INSTALLATION_DIRECTORY/bin/run.sh</filename> file:
- </para>
- <para>
<screen>
JAVA_OPTS=-Dhttp.proxyHost=<<replaceable>proxy-hostname</replaceable>> -Dhttp.proxyPort=<<replaceable>proxy-port</replaceable>>
</screen>
- </para>
- <para>
- Replace <replaceable>proxy-hostname</replaceable> with the proxy server's hostname, and <replaceable>proxy-port</replaceable> with the correct proxy server port number. If you are running Microsoft Windows, add the following line to the <filename>JBOSS_INSTALLATION_DIRECTORY/bin/run.bat</filename> file:
- </para>
- <para>
+ </para>
+ <para>
+ Replace <replaceable>proxy-hostname</replaceable> with the proxy server's hostname, and <replaceable>proxy-port</replaceable> with the correct proxy server port number. If you are running Microsoft Windows, add the following line to the <filename>JBOSS_INSTALLATION_DIRECTORY/bin/run.bat</filename> file:
+ </para>
+ <para>
<screen>
set JAVA_OPTS=-Dhttp.proxyHost=<<replaceable>proxy-hostname</replaceable>> -Dhttp.proxyPort=<<replaceable>proxy-port</replaceable>>
</screen>
+ </para>
+ <para>
+ Replace <replaceable>proxy-hostname</replaceable> with the proxy server's hostname, and <replaceable>proxy-port</replaceable> with the correct proxy server port number.
</para>
+ <para>To build and deploy JBoss Portal from the sources, change into the <filename>JBOSS_PORTAL_HOME_DIRECTORY/build/</filename> directory. Microsoft Windows users need to run the <command>build.bat deploy</command> command, and Linux users need to run the <command>./build.sh deploy</command> command.
+ </para>
<para>
- Replace <replaceable>proxy-hostname</replaceable> with the proxy server's hostname, and <replaceable>proxy-port</replaceable> with the correct proxy server port number.
- </para>
- <para>
At the end of the build process, the <filename>jboss-portal.sar</filename> file is copied into the <filename>JBOSS_HOME/server/default/deploy/</filename> directory:
</para>
<mediaobject>
@@ -368,11 +368,14 @@
</screen>
</para>
<para>
- After <command>./build.sh deploy-ha</command> completes, the <filename>jboss-portal-ha.sar</filename> file is copied into the <filename>JBOSS_HOME/server/all/deploy/</filename> directory.
+ After the <command>./build.sh deploy-ha</command> command completes, the <filename>jboss-portal-ha.sar</filename> file is copied into the <filename>JBOSS_HOME/server/all/deploy/</filename> directory.
</para>
</listitem>
</orderedlist>
</para>
+ <para>
+ To build the clustered version on Microsoft Windows, repeat the above steps, replacing <command>./build.sh</command> with <command>build.bat</command>.
+ </para>
</sect2>
<sect2>
<title>Setting up the database</title>
16 years, 3 months
JBoss Portal SVN: r9697 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-01 02:06:19 -0500 (Fri, 01 Feb 2008)
New Revision: 9697
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
Log:
2.3.3. Building and Deploying from the Sources
updating section with more verbose instructions
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 05:11:42 UTC (rev 9696)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 07:06:19 UTC (rev 9697)
@@ -311,41 +311,68 @@
</sect3>
</sect2>
<sect2 id="building_deploying_from_source">
- <title>Building and Deploying from Sources</title>
- <para>To build and deploy the JBoss Portal service, go to
- <filename>JBOSS_PORTAL_HOME_DIRECTORY/build</filename>
- and type:
- <programlisting>build deploy</programlisting>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/build_deploy.png"/>
- </imageobject>
+ <title>Building and Deploying from the Sources</title>
+ <para>To build and deploy JBoss Portal from the sources, change into the <filename>JBOSS_PORTAL_INSTALL_DIRECTORY/build/</filename> directory. Microsoft Windows users need to run the <command>build.bat deploy</command> command, and Linux users need to run the <command>./build.sh deploy</command> command.
+ </para>
+ <para>
+ During the first build, third-party libraries will be obtained from an online
+ repository, so you must be connected to Internet, and if you are behind a proxy server, you also
+ need to define your proxy address and host. If you are running Linux, add the following line to the <filename>JBOSS_INSTALLATION_DIRECTORY/bin/run.sh</filename> file:
+ </para>
+ <para>
+<screen>
+JAVA_OPTS=-Dhttp.proxyHost=<<replaceable>proxy-hostname</replaceable>> -Dhttp.proxyPort=<<replaceable>proxy-port</replaceable>>
+</screen>
+ </para>
+ <para>
+ Replace <replaceable>proxy-hostname</replaceable> with the proxy server's hostname, and <replaceable>proxy-port</replaceable> with the correct proxy server port number. If you are running Microsoft Windows, add the following line to the <filename>JBOSS_INSTALLATION_DIRECTORY/bin/run.bat</filename> file:
+ </para>
+ <para>
+<screen>
+set JAVA_OPTS=-Dhttp.proxyHost=<<replaceable>proxy-hostname</replaceable>> -Dhttp.proxyPort=<<replaceable>proxy-port</replaceable>>
+</screen>
+ </para>
+ <para>
+ Replace <replaceable>proxy-hostname</replaceable> with the proxy server's hostname, and <replaceable>proxy-port</replaceable> with the correct proxy server port number.
+ </para>
+ <para>
+ At the end of the build process, the <filename>jboss-portal.sar</filename> file is copied into the <filename>JBOSS_HOME/server/default/deploy/</filename> directory:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/build_deploy.png"/>
+ </imageobject>
</mediaobject>
- <note>
- <para>During the first compilation, third-party libraries will be obtained from an online
- repository, you need to be connected to Internet and if you are behind a proxy, you also
- need to define your proxy address and host by adding:
- <literal>JAVA_OPTS=-Dhttp.proxyHost=<Proxy Host> -Dhttp.proxyPort=<Proxy Port></literal> in your environment.
- </para>
- </note>
- <note>To build the clustered version, you will need to go to
- <filename>JBOSS_PORTAL_HOME_DIRECTORY/build</filename>
- and type:
- <command>build main</command>
- Then, go to
- <filename>JBOSS_PORTAL_HOME_DIRECTORY/core</filename>
- and type:
- <command>build deploy-ha</command>
- This will copy the
- <filename>jboss-portal-ha.sar</filename>
- to your
- <filename>all</filename>
- configuration for you.
- </note>
- At the end of the build process, the
- <filename>jboss-portal.sar</filename>
- is copied to <filename>JBOSS_HOME/server/default/deploy</filename>.
- </para>
+ <para>
+ To build the clustered version on Linux Operating Systems:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Change into the <filename>JBOSS_PORTAL_HOME_DIRECTORY/build/</filename> directory, and run the following command:
+ </para>
+ <para>
+<screen>
+./build.sh main
+</screen>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Change into the <filename>JBOSS_PORTAL_HOME_DIRECTORY/core/</filename> directory, and run the following command:
+ </para>
+ <para>
+<screen>
+./build.sh deploy-ha
+</screen>
+ </para>
+ <para>
+ After <command>./build.sh deploy-ha</command> completes, the <filename>jboss-portal-ha.sar</filename> file is copied into the <filename>JBOSS_HOME/server/all/deploy/</filename> directory.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
</sect2>
<sect2>
<title>Setting up the database</title>
16 years, 3 months
JBoss Portal SVN: r9696 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-01 00:11:42 -0500 (Fri, 01 Feb 2008)
New Revision: 9696
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
Log:
revising content: 2.3.2.2. Operating System Environment Settings
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 04:12:08 UTC (rev 9695)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 05:11:42 UTC (rev 9696)
@@ -253,37 +253,22 @@
</para>
</sect2>
<sect2>
- <title>Setting up the application server</title>
+ <title>Setting up the JBoss Application Server</title>
<sect3>
- <title>Application Server Setup</title>
- <para>Of course you will need to install JBoss Application Server prior to installing JBoss
- portal, if you didn't do so yet, please install JBoss EAP 4.2 or JBoss AS 4.2.2. If you have a
- subscription contract with Red Hat, you can have access to the EAP
- version from the <ulink url="http://network.jboss.com/">support portal</ulink>.
- For the other versions you can get them
- <ulink
- url="http://labs.jboss.com/portal/jbossas/download/index.html"
- >here
- </ulink>
- .
- </para>
+ <title>JBoss Application Server Setup</title>
+ <para>Before deploying JBoss Portal, make sure you have JBoss EAP or JBoss AS installed. Customers who have access to the <ulink url="https://support.redhat.com/portal/login.html">JBoss Customer Support Portal (CSP)</ulink> should download and install JBoss EAP 4.2. Customers who do not have access to the JBoss CSP are advised to use <ulink url="http://labs.jboss.com/jbossas/downloads/">JBoss AS</ulink>. For JBoss AS installation instructions, please refer to the <ulink url="http://labs.jboss.com/jbossas/docs/index.html">JBoss AS Installation Guide</ulink>.
+ </para>
</sect3>
<sect3 id="install_source_env">
- <title>Operating System Environment Setting</title>
- <para>For the build targets to work, you must first set the
- <filename>JBOSS_HOME</filename>
- environment variable in your
- operating system, to the root directory of the JBoss Application Server installation.
- </para>
- <para>In Windows, this is accomplished by going to
- <emphasis>Start > Settings > Control Panel > System > Advanced > Environment Variables</emphasis>
- . Now under the
+ <title>Operating System Environment Settings</title>
+ <para>For build targets to work, you must configure a <filename>JBOSS_HOME</filename> environment variable. This environment variable must point to the root directory of the JBoss EAP or JBoss AS installation directory, which is the directory where the JBoss EAP or JBoss AS files were extracted to.
+ </para>
+ <para>When using Microsoft Windows, this is accomplished by going to
+ <emphasis>Start > Settings > Control Panel > System > Advanced > Environment Variables</emphasis>. Under the
<emphasis>System Variables</emphasis>
section, click
- <emphasis>New</emphasis>
- . You will be setting the
- <filename>JBOSS_HOME</filename>
- environment variable to the location of your JBoss Application Server installation:
+ <emphasis>New</emphasis>. Set the <filename>JBOSS_HOME</filename>
+ environment variable to the location of your JBoss EAP or JBoss AS installation directory:
<mediaobject>
<imageobject>
<imagedata align="center" valign="middle" fileref="images/setup/win_envsetup.gif"/>
@@ -291,13 +276,42 @@
</mediaobject>
</para>
<para>
- On a Unix-like Operating System, you would accomplish this by typing:
- <command>export JBOSS_HOME=/path/to/your/jboss/directory</command>
- </para>
- </sect3>
+ To configure the <filename>JBOSS_HOME</filename> environment variable on Linux:
+ </para>
+ <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Add the following line to the <filename>~/.bashrc</filename> file. Note: this must be configured while logged in as the user who will run JBoss EAP or JBoss AS:
+ </para>
+ <para>
+<screen>
+export JBOSS_HOME=/path/to/installation/
+</screen>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Run the following command to enable the <filename>JBOSS_HOME</filename> environment variable:
+ </para>
+ <para>
+<screen>
+source ~/.bashrc
+</screen>
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <note>
+ <title>JBoss EAP <filename>JBOSS_HOME</filename> Environment Variable</title>
+ <para>
+ If you are running JBoss EAP, configure the <filename>JBOSS_HOME</filename> environment variable to point to the <filename>/path/to/jboss-eap-<replaceable>version</replaceable>/jboss-as/</filename> directory.
+ </para>
+ </note>
+ </sect3>
</sect2>
<sect2 id="building_deploying_from_source">
- <title>Building/Deploying from Sources</title>
+ <title>Building and Deploying from Sources</title>
<para>To build and deploy the JBoss Portal service, go to
<filename>JBOSS_PORTAL_HOME_DIRECTORY/build</filename>
and type:
16 years, 3 months
JBoss Portal SVN: r9695 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-01-31 23:12:08 -0500 (Thu, 31 Jan 2008)
New Revision: 9695
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
Log:
2.3.1. Getting the Sources few sentence rewrites
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 02:10:51 UTC (rev 9694)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 04:12:08 UTC (rev 9695)
@@ -191,8 +191,8 @@
<sect2>
<title>Getting the Sources</title>
<para>
- The JBoss Portal source files can be obtained from the the
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">JBoss Portal Downloads</ulink> page. The source files downloaded uses a <filename>JBoss Portal Source Code</filename> naming convention. As well, they can be obtained from SVN:
+ The JBoss Portal source files can be obtained from the
+ <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">JBoss Portal Downloads</ulink> page. The source files download uses a <filename>JBoss Portal Source Code</filename> naming convention. As well, the sources can be obtained from SVN:
</para>
<para>
<itemizedlist>
@@ -209,7 +209,7 @@
</itemizedlist>
</para>
<para>
- Several parts have been extracted from the repositories above. These modules have a different lifecycle and a different version scheme. The following is a list of modules used in JBoss Portal 2.6.3, and the locations of their source code:
+ Several modules have been extracted from the JBoss Portal SVN repository. These modules have a different lifecycle and a different version scheme. The following is a list of modules used in JBoss Portal 2.6.3, and the locations of their source code:
</para>
<para>
<itemizedlist>
@@ -241,7 +241,7 @@
</itemizedlist>
</para>
<para>
- After checking out the source from SVN, or after extracting the <filename>JBoss Portal Source Code</filename> zip file, the directory structure will be similar to the following:
+ After checking out the source from SVN, or after extracting the <filename>JBoss Portal Source Code</filename> zip file, a directory structure similar to the following will be created:
</para>
<mediaobject>
<imageobject>
@@ -249,7 +249,7 @@
</imageobject>
</mediaobject>
<para>
- If the source files were obtained from SVN, there will be an empty <filename>thirdparty</filename> directory. This directory will contain files after building the JBoss Portal source in <xref linkend="building_deploying_from_source" />. For more information about the JBoss Portal SVN, and accessing different versions of the JBoss Portal codebase, please visit the <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalSVNRepo">Portal SVN Repo</ulink> page on the JBoss Wiki.
+ If the source files were obtained from SVN, change into the <filename>trunk/src/</filename> directory to see the directories from the above image. As well, there will be an empty <filename>thirdparty</filename> directory. This directory will contain files after building the JBoss Portal source code (<xref linkend="building_deploying_from_source" />). For more information about the JBoss Portal SVN repository, and accessing different versions of the JBoss Portal codebase, please visit the <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalSVNRepo">JBoss Portal SVN Repo</ulink> page on the JBoss Wiki.
</para>
</sect2>
<sect2>
16 years, 3 months
JBoss Portal SVN: r9694 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-01-31 21:10:51 -0500 (Thu, 31 Jan 2008)
New Revision: 9694
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
Log:
2.3.1. Getting the Sources updating, rephrasing,
adding content
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 00:46:09 UTC (rev 9693)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 02:10:51 UTC (rev 9694)
@@ -190,53 +190,68 @@
<title>Installing from Sources</title>
<sect2>
<title>Getting the Sources</title>
- <para>There are two ways for you to obtain the JBoss Portal source files:
- <itemizedlist>
- <listitem>
- <para>From our
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">download page</ulink>
- </para>
- </listitem>
- <listitem>
- <para>From SVN, using the following URL:
- <itemizedlist>
- <listitem>http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Branch_2_6 : For the latest sources of the 2.6 branch</listitem>
- <listitem>http://anonsvn.jboss.org/repos/portal/trunk/ : For the latest sources</listitem>
- </itemizedlist>
- <note>
- For more information on Portal SVN, and accessing different versions of the Portal codebase,
- please visit
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalSVNRepo">this wiki article</ulink>.
- </note>
- </para>
- </listitem>
- </itemizedlist>
- <note><para>Several parts have been extracted from the code above. Those modules have a different lifecycle and
- a different versioning. Here is the list of modules used in JBoss Portal 2.6.3 and the location of the source code.
- <itemizedlist>
- <listitem><para>JBoss Portal Common 1.1.0:</para> <para>http://anonsvn.jboss.org/repos/portal/modules/common/tags/JBP_COMMON_1_1_0</para></listitem>
- <listitem>JBoss Portal Web 1.1: http://anonsvn.jboss.org/repos/portal/modules/web/tags/JBP_WEB_1_1_0</listitem>
- <listitem>JBoss Portal Test 1.0.1: http://anonsvn.jboss.org/repos/portal/modules/test/tags/JBP_TEST_1_0_1</listitem>
- <listitem>JBoss Portal Portlet 1.0.1: http://anonsvn.jboss.org/repos/portal/modules/portlet/tags/JBP_PORTLET_1_0_1</listitem>
- <listitem>JBoss Portal Identity 1.0.1: http://anonsvn.jboss.org/repos/portal/modules/identity/tags/JBP_IDENTITY_...</listitem>
- </itemizedlist>
- </para>
- </note>
- </para>
- <para>
- After checking out of SVN or extracting the Source zip, your directory structure should look like this:
+ <para>
+ The JBoss Portal source files can be obtained from the the
+ <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">JBoss Portal Downloads</ulink> page. The source files downloaded uses a <filename>JBoss Portal Source Code</filename> naming convention. As well, they can be obtained from SVN:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ the latest source files of the 2.6 branch: <emphasis>http://anonsvn.jboss.org/repos/portal/branches/JBoss_Portal_Branch_2_6</emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ the latest sources: <emphasis>http://anonsvn.jboss.org/repos/portal/trunk/</emphasis>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Several parts have been extracted from the repositories above. These modules have a different lifecycle and a different version scheme. The following is a list of modules used in JBoss Portal 2.6.3, and the locations of their source code:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ JBoss Portal Common 1.1.0: <emphasis>http://anonsvn.jboss.org/repos/portal/modules/common/tags/JBP_COMMON_1_1_0</emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ JBoss Portal Web 1.1: <emphasis>http://anonsvn.jboss.org/repos/portal/modules/web/tags/JBP_WEB_1_1_0</emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ JBoss Portal Test 1.0.1: <emphasis>http://anonsvn.jboss.org/repos/portal/modules/test/tags/JBP_TEST_1_0_1</emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ JBoss Portal Portlet 1.0.1: <emphasis>http://anonsvn.jboss.org/repos/portal/modules/portlet/tags/JBP_PORTLET_1_0_1</emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ JBoss Portal Identity 1.0.1: <emphasis>http://anonsvn.jboss.org/repos/portal/modules/identity/tags/JBP_IDENTITY_...</emphasis>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ After checking out the source from SVN, or after extracting the <filename>JBoss Portal Source Code</filename> zip file, the directory structure will be similar to the following:
+ </para>
<mediaobject>
<imageobject>
<imagedata align="center" valign="middle" fileref="images/setup/svncodir.png"/>
</imageobject>
</mediaobject>
- <note>
- <para>The screenshot above, shows the downloaded source directory. Those of you checking out from SVN, will get
- an empty <emphasis>thirdparty</emphasis> directory. This directory will be filled when you first run the build
- in the following steps.</para>
- </note>
- </para>
- </sect2>
+ <para>
+ If the source files were obtained from SVN, there will be an empty <filename>thirdparty</filename> directory. This directory will contain files after building the JBoss Portal source in <xref linkend="building_deploying_from_source" />. For more information about the JBoss Portal SVN, and accessing different versions of the JBoss Portal codebase, please visit the <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=PortalSVNRepo">Portal SVN Repo</ulink> page on the JBoss Wiki.
+ </para>
+ </sect2>
<sect2>
<title>Setting up the application server</title>
<sect3>
@@ -281,7 +296,7 @@
</para>
</sect3>
</sect2>
- <sect2>
+ <sect2 id="building_deploying_from_source">
<title>Building/Deploying from Sources</title>
<para>To build and deploy the JBoss Portal service, go to
<filename>JBOSS_PORTAL_HOME_DIRECTORY/build</filename>
16 years, 3 months
JBoss Portal SVN: r9693 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168 and 9 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-31 19:46:09 -0500 (Thu, 31 Jan 2008)
New Revision: 9693
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerListenerInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLGenerationListenerChain.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/PortletURLSnapshot.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener1.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener2.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListenerTestCase.java
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/WEB-INF/
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/WEB-INF/web.xml
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletApplicationInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletParameter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletParameterMap.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/BaseURLImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
modules/portlet/trunk/test/src/test/build.xml
modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
Log:
- implemented PortletURLGenerationListener
- started to write test cases for PortletURLGenerationListener
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerInfoBuilder.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -38,6 +38,7 @@
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaData;
+import org.jboss.portal.portlet.impl.metadata.ListenerMetaData;
import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData;
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.LifeCyclePhase;
@@ -148,6 +149,10 @@
throw new Error(e);
}
}
+ if (tmp.getListeners() == null)
+ {
+ tmp.setListeners(new ArrayList<ListenerMetaData>());
+ }
}
}
@@ -266,6 +271,7 @@
//
String defaultNamespace = XMLConstants.NULL_NS_URI;
+ List<ContainerListenerInfo> listeners = Collections.emptyList();
if (this.portletApplicationMD instanceof PortletApplication20MetaData)
{
PortletApplication20MetaData tmp = (PortletApplication20MetaData)this.portletApplicationMD;
@@ -297,6 +303,16 @@
}
//
+ listeners = new ArrayList<ContainerListenerInfo>(tmp.getListeners().size());
+ for (ListenerMetaData listenerMD : tmp.getListeners())
+ {
+ ContainerListenerInfo listener = build(listenerMD);
+ listeners.add(listener);
+ }
+ listeners = Collections.unmodifiableList(listeners);
+
+
+ //
// for (FilterMetaData filterMD : tmp.getFilterCollection())
// {
// ContainerFilterInfo filter = build(filterMD);
@@ -304,9 +320,17 @@
}
//
- return new ContainerPortletApplicationInfo(defaultNamespace);
+ return new ContainerPortletApplicationInfo(defaultNamespace, listeners);
}
+ private ContainerListenerInfo build(ListenerMetaData listenerMD)
+ {
+ return new ContainerListenerInfo(
+ listenerMD.getListenerClass(),
+ listenerMD.getDisplayName(),
+ listenerMD.getDescription());
+ }
+
private ContainerFilterInfo build(FilterMetaData filterMD)
{
Map<String, String> initParameters = new HashMap<String, String>();
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerListenerInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerListenerInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerListenerInfo.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerListenerInfo
+{
+
+ /** . */
+ private final String className;
+
+ /** . */
+ private final LocalizedString displayName;
+
+ /** . */
+ private final LocalizedString description;
+
+ public ContainerListenerInfo(String className, LocalizedString displayName, LocalizedString description)
+ {
+ this.className = className;
+ this.displayName = displayName;
+ this.description = description;
+ }
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletApplicationInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletApplicationInfo.java 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletApplicationInfo.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -22,6 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.info;
+import java.util.List;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
@@ -32,13 +34,24 @@
/** . */
private final String defaultNamespace;
- public ContainerPortletApplicationInfo(String defaultNamespace)
+ /** . */
+ private final List<ContainerListenerInfo> listeners;
+
+ public ContainerPortletApplicationInfo(
+ String defaultNamespace,
+ List<ContainerListenerInfo> listeners)
{
this.defaultNamespace = defaultNamespace;
+ this.listeners = listeners;
}
public String getDefaultNamespace()
{
return defaultNamespace;
}
+
+ public List<ContainerListenerInfo> getListeners()
+ {
+ return listeners;
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -23,18 +23,26 @@
package org.jboss.portal.portlet.impl.jsr168;
import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.PortletURLGenerationListenerChain;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
+import org.jboss.portal.portlet.impl.info.ContainerListenerInfo;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.container.PortletContainer;
+import org.apache.log4j.Logger;
import javax.portlet.PortletContext;
+import javax.portlet.PortletURLGenerationListener;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Set;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Collections;
+import java.lang.reflect.Constructor;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -43,6 +51,9 @@
public class PortletApplicationImpl implements PortletApplication
{
+ /** Logger. */
+ protected final Logger log;
+
/** . */
protected final ContainerPortletApplicationInfo info;
@@ -67,6 +78,9 @@
/** . */
protected String version;
+ /** . */
+ protected PortletURLGenerationListener urlListener;
+
/**
* Todo remove meta data reference and use info instead.
*
@@ -89,6 +103,7 @@
this.portletAPIFactory = portletAPIFactory;
this.portlets = new LinkedHashMap<String, PortletContainer>();
this.context = context;
+ this.log = Logger.getLogger("org.jboss.portal.portlet.application." + context.getContextPath().replace('.', '_'));
}
public String getId()
@@ -130,14 +145,63 @@
public void start() throws Exception
{
- version = metaData.getVersion();
- portletContext = new PortletContextImpl(context.getServletContext());
+ List<PortletURLGenerationListener> listeners = Collections.emptyList();
+ for (ContainerListenerInfo listenerInfo : info.getListeners())
+ {
+ String className = listenerInfo.getClassName();
+ ClassLoader classLoader = context.getClassLoader();
+ try
+ {
+ Class clazz = classLoader.loadClass(className);
+ if (PortletURLGenerationListener.class.isAssignableFrom(clazz))
+ {
+ Constructor ctor = clazz.getConstructor();
+ PortletURLGenerationListener listener = (PortletURLGenerationListener)ctor.newInstance();
+ if (listeners.size() == 0)
+ {
+ listeners = new LinkedList<PortletURLGenerationListener>();
+ }
+ listeners.add(listener);
+ }
+ else
+ {
+ log.info("Cannot create filter with class " + className + " because it does not implement the PortletURLGenerationListener interface");
+ }
+ }
+ catch (IllegalAccessException e)
+ {
+ log.error("Cannot create filter with class " + className + " because the class is not accessible", e);
+ }
+ catch (NoSuchMethodException e)
+ {
+ log.error("Cannot create filter with class " + className + " because it does not have an no argument constructor", e);
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.error("Cannot create filter with class " + className + " because the class cannot be loaded", e);
+ }
+ catch (InstantiationException e)
+ {
+ log.error("Cannot create filter with class " + className + " because it cannot be instantiated", e);
+ }
+ catch (Error e)
+ {
+ log.error("Cannot create filter with class " + className + " because of an error", e);
+ }
+ }
+
+ //
+ this.version = metaData.getVersion();
+ this.portletContext = new PortletContextImpl(context.getServletContext());
+ this.urlListener = listeners.size() == 0 ? null : new PortletURLGenerationListenerChain(Collections.unmodifiableList(listeners));
+
}
public void stop()
{
- version = null;
- portletContext = null;
+ this.version = null;
+ this.portletContext = null;
+ this.urlListener = null;
}
public String getVersion()
@@ -150,6 +214,17 @@
return portletContext;
}
+ public <T> T getListener(Class<T> type)
+ {
+ if (type == PortletURLGenerationListener.class)
+ {
+ return type.cast(urlListener);
+ }
+
+ //
+ return null;
+ }
+
// WebApp implementation ********************************************************************************************
public Set<PortletContainer> getPortletContainers()
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletParameter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletParameter.java 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletParameter.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -31,16 +31,14 @@
enum Scope
{
-
PUBLIC, PRIVATE
-
}
/** The entry scope. */
private final Scope scope;
/** The entry value. */
- private String[] values;
+ private final String[] values;
PortletParameter(Scope scope, String[] values)
{
@@ -57,9 +55,4 @@
{
return values;
}
-
- void setValues(String[] values)
- {
- this.values = values;
- }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletParameterMap.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletParameterMap.java 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletParameterMap.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -58,6 +58,13 @@
this.navigationInfo = navigationInfo;
}
+ public PortletParameterMap(PortletParameterMap original)
+ {
+ this.navigationInfo = original.navigationInfo;
+ this.entries = new HashMap<String, PortletParameter>(original.entries);
+ this.publicEntryRemovals = new HashSet<String>(publicEntryRemovals);
+ }
+
public String getParameterValue(String name)
{
String[] values = getParameterValues(name);
@@ -122,36 +129,34 @@
private void internalPut(String name, String[] value, boolean cloneValue)
{
+ if (cloneValue)
+ {
+ value = value.clone();
+ }
+
// Look if we have an entry already
PortletParameter entry = entries.get(name);
//
- PortletParameter.Scope scope;
if (entry == null)
{
ParameterInfo parameterInfo = navigationInfo.getPublicParameter(name);
- scope = parameterInfo == null ? PortletParameter.Scope.PRIVATE : PortletParameter.Scope.PUBLIC;
- }
- else
- {
- scope = entry.getScope();
- }
- //
- if (cloneValue)
- {
- value = value.clone();
- }
+ //
+ PortletParameter.Scope scope = parameterInfo == null ? PortletParameter.Scope.PRIVATE : PortletParameter.Scope.PUBLIC;
- //
- if (entry == null)
- {
- publicEntryRemovals.remove(name);
+ //
+ if (scope == PortletParameter.Scope.PUBLIC)
+ {
+ publicEntryRemovals.remove(name);
+ }
+
+ //
entries.put(name, new PortletParameter(scope, value));
}
else
{
- entry.setValues(value);
+ entries.put(name, new PortletParameter(entry.getScope(), value));
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/BaseURLImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/BaseURLImpl.java 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/BaseURLImpl.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -24,11 +24,12 @@
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.portlet.impl.jsr168.PortletParameterMap;
+import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
import org.jboss.portal.common.NotYetImplemented;
import javax.portlet.BaseURL;
import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletURLGenerationListener;
import java.util.Map;
import java.io.Writer;
import java.io.IOException;
@@ -47,31 +48,44 @@
protected final PortletRequestImpl preq;
/** . */
- protected final InternalContainerURL url;
+ protected Boolean secure;
/** . */
- protected Boolean secure;
+ protected final boolean filterable;
- protected BaseURLImpl(PortletInvocation invocation, PortletRequestImpl preq, InternalContainerURL url)
+ protected BaseURLImpl(
+ PortletInvocation invocation,
+ PortletRequestImpl preq,
+ boolean filterable)
{
this.inv = invocation;
this.preq = preq;
- this.url = url;
+ this.filterable = filterable;
}
+ protected BaseURLImpl(BaseURLImpl original)
+ {
+ this.inv = original.inv;
+ this.preq = original.preq;
+ this.filterable = false;
+ }
+
/** @throws IllegalArgumentException if the name is null */
public void setParameter(String name, String value)
{
+ InternalContainerURL url = getContainerURL();
url.setParameter(name, value);
}
public void setParameter(String name, String[] values)
{
+ InternalContainerURL url = getContainerURL();
url.setParameter(name, values);
}
public void setParameters(Map<String, String[]> parameters)
{
+ InternalContainerURL url = getContainerURL();
url.setParameters(parameters);
}
@@ -82,7 +96,8 @@
public Map<String, String[]> getParameterMap()
{
- throw new NotYetImplemented();
+ InternalContainerURL url = getContainerURL();
+ return url.getParameters();
}
public void write(Writer writer) throws IOException
@@ -107,10 +122,33 @@
public String toString()
{
+ PortletURLGenerationListener listener = ((PortletApplicationImpl)preq.container.getApplication()).getListener(PortletURLGenerationListener.class);
+
+ //
+ InternalContainerURL url;
+ if (listener != null)
+ {
+ // Create a safe clone
+ BaseURLImpl clone = createClone();
+ clone.filter(listener);
+ url = clone.getContainerURL();
+ }
+ else
+ {
+ url = getContainerURL();
+ }
+
+ //
PortletInvocationContext responseContext = inv.getContext();
return responseContext.renderURL(url, secure, null, true);
}
+ protected abstract void filter(PortletURLGenerationListener listener);
+
+ protected abstract BaseURLImpl createClone();
+
+ protected abstract InternalContainerURL getContainerURL();
+
protected static abstract class InternalContainerURL implements org.jboss.portal.portlet.ContainerURL
{
@@ -120,5 +158,8 @@
protected abstract void setParameters(Map<String, String[]> parameters);
+ protected abstract Map<String, String[]> getParameters();
+
}
+
}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLGenerationListenerChain.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLGenerationListenerChain.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLGenerationListenerChain.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.api;
+
+import javax.portlet.PortletURLGenerationListener;
+import javax.portlet.PortletURL;
+import javax.portlet.ResourceURL;
+import java.util.List;
+
+/**
+ * An implementation of the API that chains.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletURLGenerationListenerChain implements PortletURLGenerationListener
+{
+
+ /** . */
+ private PortletURLGenerationListener[] listeners;
+
+ public PortletURLGenerationListenerChain(List<PortletURLGenerationListener> listeners)
+ {
+ this.listeners = listeners.toArray(new PortletURLGenerationListener[listeners.size()]);
+ }
+
+ public void filterActionURL(PortletURL portletURL)
+ {
+ for (PortletURLGenerationListener listener : listeners)
+ {
+ try
+ {
+ listener.filterActionURL(portletURL);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void filterRenderURL(PortletURL portletURL)
+ {
+ for (PortletURLGenerationListener listener : listeners)
+ {
+ try
+ {
+ listener.filterRenderURL(portletURL);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void filterResourceURL(ResourceURL resourceURL)
+ {
+ for (PortletURLGenerationListener listener : listeners)
+ {
+ try
+ {
+ listener.filterResourceURL(resourceURL);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.impl.jsr168.api;
import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.impl.jsr168.PortletParameterMap;
import org.jboss.portal.portlet.ActionURL;
@@ -36,6 +37,7 @@
import javax.portlet.PortletURL;
import javax.portlet.WindowState;
import javax.portlet.WindowStateException;
+import javax.portlet.PortletURLGenerationListener;
import java.util.Map;
/**
@@ -48,26 +50,38 @@
public static PortletURLImpl createActionURL(PortletInvocation invocation, PortletRequestImpl preq)
{
InternalActionURL url = new InternalActionURL();
- return new PortletURLImpl(invocation, preq, url);
+ return new PortletURLImpl(invocation, preq, url, true);
}
public static PortletURLImpl createRenderURL(PortletInvocation invocation, PortletRequestImpl preq)
{
InternalRenderURL url = new InternalRenderURL(new PortletParameterMap(preq.navigationInfo));
- return new PortletURLImpl(invocation, preq, url);
+ return new PortletURLImpl(invocation, preq, url, true);
}
/** . */
private final InternalPortletURL url;
- private PortletURLImpl(PortletInvocation invocation, PortletRequestImpl preq, InternalPortletURL url)
+ private PortletURLImpl(
+ PortletInvocation invocation,
+ PortletRequestImpl preq,
+ InternalPortletURL url,
+ boolean filterable)
{
- super(invocation, preq, url);
+ super(invocation, preq, filterable);
//
this.url = url;
}
+ public PortletURLImpl(PortletURLImpl original)
+ {
+ super(original);
+
+ //
+ this.url = original.url instanceof InternalRenderURL ? new InternalRenderURL((InternalRenderURL)original.url) : new InternalActionURL((InternalActionURL)original.url);
+ }
+
public void setWindowState(WindowState windowState) throws WindowStateException
{
if (!preq.isWindowStateAllowed(windowState))
@@ -100,12 +114,12 @@
public PortletMode getPortletMode()
{
- throw new NotYetImplemented();
+ return url.portletMode;
}
public WindowState getWindowState()
{
- throw new NotYetImplemented();
+ return url.windowState;
}
public void removePublicRenderParameter(String name)
@@ -113,6 +127,28 @@
url.removePublicRenderParameter(name);
}
+ protected InternalContainerURL getContainerURL()
+ {
+ return url;
+ }
+
+ protected BaseURLImpl createClone()
+ {
+ return new PortletURLImpl(this);
+ }
+
+ protected void filter(PortletURLGenerationListener listener)
+ {
+ if (url instanceof InternalActionURL)
+ {
+ listener.filterActionURL(this);
+ }
+ else
+ {
+ listener.filterRenderURL(this);
+ }
+ }
+
private static abstract class InternalPortletURL extends InternalContainerURL implements org.jboss.portal.portlet.PortletURL
{
@@ -122,6 +158,18 @@
/** . */
protected PortletMode portletMode;
+ protected InternalPortletURL()
+ {
+ this.windowState = null;
+ this.portletMode = null;
+ }
+
+ protected InternalPortletURL(InternalPortletURL original)
+ {
+ this.windowState = original.windowState;
+ this.portletMode = original.portletMode;
+ }
+
public Mode getMode()
{
if (portletMode != null)
@@ -154,6 +202,14 @@
this.interactionState = ParametersStateString.create();
}
+ private InternalActionURL(InternalActionURL original)
+ {
+ super(original);
+
+ //
+ this.interactionState = ParametersStateString.create(ParameterMap.clone(original.interactionState.getParameters()));
+ }
+
public StateString getInteractionState()
{
return interactionState;
@@ -177,6 +233,11 @@
protected void removePublicRenderParameter(String name)
{
}
+
+ protected Map<String, String[]> getParameters()
+ {
+ return ParameterMap.clone(interactionState.getParameters());
+ }
}
private static class InternalRenderURL extends InternalPortletURL implements RenderURL
@@ -189,6 +250,14 @@
this.parameters = parameters;
}
+ private InternalRenderURL(InternalRenderURL original)
+ {
+ super(original);
+
+ //
+ this.parameters = new PortletParameterMap(original.parameters);
+ }
+
public StateString getNavigationalState()
{
return ParametersStateString.create(parameters.getPrivateMapSnapshot());
@@ -218,5 +287,10 @@
{
parameters.removePublicParameterValue(name);
}
+
+ protected Map<String, String[]> getParameters()
+ {
+ return ParameterMap.clone(parameters.getMap());
+ }
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -27,8 +27,10 @@
import org.jboss.portal.portlet.cache.CacheLevel;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.common.util.ParameterMap;
import javax.portlet.ResourceURL;
+import javax.portlet.PortletURLGenerationListener;
import java.util.Map;
import java.util.HashMap;
@@ -68,9 +70,10 @@
private ResourceURLImpl(
PortletInvocation invocation,
PortletRequestImpl preq,
- InternalResourceURL url)
+ InternalResourceURL url,
+ boolean filterable)
{
- super(invocation, preq, url);
+ super(invocation, preq, filterable);
//
this.url = url;
@@ -82,6 +85,14 @@
}
}
+ private ResourceURLImpl(ResourceURLImpl original)
+ {
+ super(original);
+
+ //
+ this.url = new InternalResourceURL(original.url);
+ }
+
public void setResourceID(String resourceID)
{
if (resourceID != null)
@@ -131,9 +142,24 @@
}
}
+ protected InternalContainerURL getContainerURL()
+ {
+ return url;
+ }
+
+ protected BaseURLImpl createClone()
+ {
+ return new ResourceURLImpl(this);
+ }
+
+ protected void filter(PortletURLGenerationListener listener)
+ {
+ listener.filterResourceURL(this);
+ }
+
public static ResourceURLImpl createResourceURL(PortletInvocation invocation, PortletRequestImpl preq)
{
- return new ResourceURLImpl(invocation, preq, new InternalResourceURL());
+ return new ResourceURLImpl(invocation, preq, new InternalResourceURL(), true);
}
private static class InternalResourceURL extends InternalContainerURL implements org.jboss.portal.portlet.ResourceURL
@@ -156,6 +182,14 @@
this.parameters = ParametersStateString.create();
}
+ private InternalResourceURL(InternalResourceURL original)
+ {
+ this.id = original.id;
+ this.parentCacheLevel = original.parentCacheLevel;
+ this.cacheLevel = original.cacheLevel;
+ this.parameters = ParametersStateString.create(ParameterMap.clone(original.parameters.getParameters()));
+ }
+
protected void setParameter(String name, String value)
{
parameters.setValue(name, value);
@@ -171,6 +205,11 @@
parameters.replace(parameterMap);
}
+ protected Map<String, String[]> getParameters()
+ {
+ return ParameterMap.clone(parameters.getParameters());
+ }
+
public StateString getResourceState()
{
return parameters;
Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/PortletURLSnapshot.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/PortletURLSnapshot.java (rev 0)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/PortletURLSnapshot.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -0,0 +1,165 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portleturl;
+
+import org.jboss.unit.api.Assert;
+
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+import javax.portlet.PortletURL;
+import javax.portlet.ResourceURL;
+import java.util.Map;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletURLSnapshot
+{
+
+ /** . */
+ public static LinkedList<PortletURLSnapshot> queue = new LinkedList<PortletURLSnapshot>();
+
+ public static PortletURLSnapshot next()
+ {
+ Assert.assertTrue(queue.size() > 0);
+ return queue.removeFirst();
+ }
+
+ public static int size()
+ {
+ return queue.size();
+ }
+
+ /** . */
+ private static final int ACTION = 0;
+
+ /** . */
+ private static final int RENDER = 1;
+
+ /** . */
+ private static final int RESOURCE = 2;
+
+ /** . */
+ final Class source;
+
+ /** . */
+ final int type;
+
+ /** . */
+ final PortletMode portletMode;
+
+ /** . */
+ final WindowState windowState;
+
+ /** . */
+ final Map<String, String[]> parameters;
+
+ public static PortletURLSnapshot createActionURL(Class source, PortletURL actionURL)
+ {
+ return new PortletURLSnapshot(source, ACTION, actionURL);
+ }
+
+ public static PortletURLSnapshot createRenderURL(Class source, PortletURL renderURL)
+ {
+ return new PortletURLSnapshot(source, RENDER, renderURL);
+ }
+
+ public static PortletURLSnapshot createResourceURL(Class source, ResourceURL resourceURL)
+ {
+ return new PortletURLSnapshot(source, resourceURL);
+ }
+
+ public static PortletURLSnapshot createActionURL(Class source, PortletMode portletMode, WindowState windowState, Map<String, String[]> parameters)
+ {
+ return new PortletURLSnapshot(source, ACTION, portletMode, windowState, parameters);
+ }
+
+ public static PortletURLSnapshot createRenderRL(Class source, PortletMode portletMode, WindowState windowState, Map<String, String[]> parameters)
+ {
+ return new PortletURLSnapshot(source, RENDER, portletMode, windowState, parameters);
+ }
+
+ public static PortletURLSnapshot createResourceURL(Class source, Map<String, String[]> parameters)
+ {
+ return new PortletURLSnapshot(source, parameters);
+ }
+
+ private PortletURLSnapshot(Class source, int type, PortletURL portletURL)
+ {
+ this.source = source;
+ this.type = type;
+ this.portletMode = portletURL.getPortletMode();
+ this.windowState = portletURL.getWindowState();
+ this.parameters = portletURL.getParameterMap();
+ }
+
+ private PortletURLSnapshot(Class source, ResourceURL portletURL)
+ {
+ this.source = source;
+ this.type = RESOURCE;
+ this.portletMode = null;
+ this.windowState = null;
+ this.parameters = portletURL.getParameterMap();
+ }
+
+ private PortletURLSnapshot(Class source, int type, PortletMode portletMode, WindowState windowState, Map<String, String[]> parameters)
+ {
+ this.source = source;
+ this.type = type;
+ this.portletMode = portletMode;
+ this.windowState = windowState;
+ this.parameters = parameters;
+ }
+
+ private PortletURLSnapshot(Class source, Map<String, String[]> parameters)
+ {
+ this.source = source;
+ this.type = RESOURCE;
+ this.portletMode = null;
+ this.windowState = null;
+ this.parameters = parameters;
+ }
+
+ public void assertEquals(PortletURLSnapshot actual)
+ {
+ Assert.assertNotNull(actual);
+ Assert.assertEquals(source, actual.source);
+ Assert.assertEquals(type, actual.type);
+ Assert.assertEquals(parameters.keySet(), actual.parameters.keySet());
+ for (Map.Entry<String, String[]> entry : parameters.entrySet())
+ {
+ Assert.assertEquals(entry.getValue(), actual.parameters.get(entry.getKey()));
+ }
+ if (type == RESOURCE)
+ {
+
+ }
+ else
+ {
+ Assert.assertEquals(portletMode, actual.portletMode);
+ Assert.assertEquals(windowState, actual.windowState);
+ }
+ }
+}
Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener.java (rev 0)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portleturl;
+
+import javax.portlet.PortletURLGenerationListener;
+import javax.portlet.PortletURL;
+import javax.portlet.ResourceURL;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class URLGenerationListener implements PortletURLGenerationListener
+{
+
+ public void filterActionURL(PortletURL portletURL)
+ {
+ PortletURLSnapshot.queue.addLast(PortletURLSnapshot.createActionURL(getClass(), portletURL));
+ }
+
+ public void filterRenderURL(PortletURL portletURL)
+ {
+ PortletURLSnapshot.queue.addLast(PortletURLSnapshot.createRenderURL(getClass(), portletURL));
+ }
+
+ public void filterResourceURL(ResourceURL resourceURL)
+ {
+ PortletURLSnapshot.queue.addLast(PortletURLSnapshot.createResourceURL(getClass(), resourceURL));
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener1.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener1.java (rev 0)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener1.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portleturl;
+
+import javax.portlet.PortletURLGenerationListener;
+import javax.portlet.PortletURL;
+import javax.portlet.ResourceURL;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class URLGenerationListener1 extends URLGenerationListener
+{
+}
Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener2.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener2.java (rev 0)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListener2.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portleturl;
+
+import javax.portlet.PortletURLGenerationListener;
+import javax.portlet.PortletURL;
+import javax.portlet.ResourceURL;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class URLGenerationListener2 extends URLGenerationListener
+{
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListenerTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListenerTestCase.java (rev 0)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portleturl/URLGenerationListenerTestCase.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr286.tck.portleturl;
+
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.*;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import javax.portlet.PortletMode;
+import java.io.IOException;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+@TestCase
+public class URLGenerationListenerTestCase
+{
+ public URLGenerationListenerTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ PortletURL actionURL = response.createActionURL();
+
+ //
+ actionURL.toString();
+ PortletURLSnapshot actionSnapshot1 = PortletURLSnapshot.next();
+ PortletURLSnapshot actionSnapshot2 = PortletURLSnapshot.next();
+ assertEquals(0, PortletURLSnapshot.size());
+ actionSnapshot1.assertEquals(PortletURLSnapshot.createActionURL(URLGenerationListener1.class, null, null, new HashMap<String, String[]>()));
+ actionSnapshot2.assertEquals(PortletURLSnapshot.createActionURL(URLGenerationListener2.class, null, null, new HashMap<String, String[]>()));
+
+ //
+ actionURL.setPortletMode(PortletMode.EDIT);
+ actionURL.toString();
+ actionSnapshot1 = PortletURLSnapshot.next();
+ actionSnapshot2 = PortletURLSnapshot.next();
+ assertEquals(0, PortletURLSnapshot.size());
+ actionSnapshot1.assertEquals(PortletURLSnapshot.createActionURL(URLGenerationListener1.class, PortletMode.EDIT, null, new HashMap<String, String[]>()));
+ actionSnapshot2.assertEquals(PortletURLSnapshot.createActionURL(URLGenerationListener2.class, PortletMode.EDIT, null, new HashMap<String, String[]>()));
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-01 00:46:09 UTC (rev 9693)
@@ -299,6 +299,6 @@
public String getContextPath()
{
- throw new NotYetImplemented();
+ return webApp.getContextPath();
}
}
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-02-01 00:46:09 UTC (rev 9693)
@@ -350,6 +350,7 @@
<package-jsr286-tck-test test="stateawareresponse"/>
<package-jsr286-tck-test test="portletrequests"/>
<package-jsr286-tck-test test="resourceserving"/>
+ <package-jsr286-tck-test test="portleturl"/>
<package-jsr286-api-test test="event"/>
Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/WEB-INF/portlet.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/WEB-INF/portlet.xml (rev 0)
+++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/WEB-INF/portlet.xml 2008-02-01 00:46:09 UTC (rev 9693)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+ <portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>EDIT</portlet-mode>
+ </supports>
+ <supported-public-render-parameter>foo</supported-public-render-parameter>
+ </portlet>
+
+ <listener>
+ <listener-class>org.jboss.portal.test.portlet.jsr286.tck.portleturl.URLGenerationListener1</listener-class>
+ </listener>
+ <listener>
+ <listener-class>org.jboss.portal.test.portlet.jsr286.tck.portleturl.URLGenerationListener2</listener-class>
+ </listener>
+
+</portlet-app>
Added: modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/WEB-INF/web.xml (rev 0)
+++ modules/portlet/trunk/test/src/test/resources/jsr286/tck/portleturl-war/WEB-INF/web.xml 2008-02-01 00:46:09 UTC (rev 9693)
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <listener>
+ <listener-class>org.jboss.portal.unit.PortletTestSuite</listener-class>
+ </listener>
+</web-app>
Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-02-01 00:44:39 UTC (rev 9692)
+++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-02-01 00:46:09 UTC (rev 9693)
@@ -179,6 +179,10 @@
<class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId" value="test-jsr286-tck-resourceserving.war"/>
</generic>
+ <generic>
+ <class name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
+ <property name="archiveId" value="test-jsr286-tck-portleturl.war"/>
+ </generic>
<!--Spec API Assertions tests-->
<generic>
16 years, 3 months
JBoss Portal SVN: r9692 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-01-31 19:44:39 -0500 (Thu, 31 Jan 2008)
New Revision: 9692
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
Log:
rephrasing and adding a bit more content to
2.2.2. Deploying JBoss Portal
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 00:02:29 UTC (rev 9691)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 00:44:39 UTC (rev 9692)
@@ -2,12 +2,13 @@
<chapter id="installation">
<title>Installation</title>
<para>Depending on your needs, there are several different methods to install JBoss Portal. Pre-configured clustered versions (<computeroutput>JBoss Portal Binary (Clustered)</computeroutput>) are available from the
- <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">JBoss Portal Downloads</ulink> page. Clustered versions of JBoss Portal must be deployed in the <filename><replaceable>JBOSS_INSTALLATION_DIRECTORY</replaceable>/server/all/deploy/</filename> directory. All JBoss AS instances must reference the same datasource. See <xref linkend="clustering"/> for details on how to configure JBoss Portal for clustering.
+ <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">JBoss Portal Downloads</ulink> page. Clustered versions of JBoss Portal must be deployed in the <filename>JBOSS_INSTALLATION_DIRECTORY/server/all/deploy/</filename> directory. All JBoss AS instances must reference the same datasource. See <xref linkend="clustering"/> for details on how to configure JBoss Portal for clustering.
</para>
<sect1 id="install_bundle">
<title>JBoss Portal and JBoss AS Bundle</title>
<para>This is the easiest and fastest way to get JBoss Portal installed and running. The JBoss Portal and JBoss AS bundle contains JBoss AS, JBoss Portal, and the embedded Hypersonic SQL database. To install the JBoss Portal and JBoss AS bundle:
</para>
+ <para>
<orderedlist>
<listitem>
<para>
@@ -21,7 +22,7 @@
</listitem>
<listitem>
<para>
- <emphasis role="bold">Start the server:</emphasis> change into the <filename><replaceable>JBOSS_INSTALLATION_DIRECTORY</replaceable>/bin</filename> directory. On Microsoft Windows, execute <command>run.bat</command>. On Linux, run the <command>./run.sh</command> command.
+ <emphasis role="bold">Start the server:</emphasis> change into the <filename>JBOSS_INSTALLATION_DIRECTORY/bin/</filename> directory. On Microsoft Windows, execute <command>run.bat</command>. On Linux, run the <command>./run.sh</command> command.
</para>
</listitem>
<listitem>
@@ -30,27 +31,28 @@
</para>
</listitem>
</orderedlist>
+ </para>
<note>
<title>SQL Errors</title>
<para>
Tables are automatically created the first time JBoss Portal starts. When deployed for the first time, JBoss Portal checks for the existence of the initial tables, which have not been created yet. This causes errors such as the following, which can safely be ignored:
</para>
<para>
- <programlisting>
+ <programlisting><![CDATA[
WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
ERROR [JDBCExceptionReporter] Table not found in statement ...
WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
- </programlisting>
+ ]]></programlisting>
</para>
</note>
</sect1>
<sect1 id="install_binary">
<title>Installing the Binary Download</title>
<para>The binary package typically consists of the
- <filename>jboss-portal.sar</filename> directory, documentation such as the JBoss Portal User Guide and the JBoss Portal Reference Guide, and a set of pre-configured Datasource descriptors that allow
+ <filename>jboss-portal.sar/</filename> directory, documentation such as the JBoss Portal User Guide and the JBoss Portal Reference Guide, and a set of pre-configured Datasource descriptors that allow
JBoss Portal to communicate with an external database. This installation method is recommended for users who already have JBoss EAP or JBoss AS installed, or those who need to install JBoss Portal in a clustered environment.</para>
<sect2>
<title>Setting up your Environment</title>
@@ -89,6 +91,7 @@
<para>
To configure a database to use with JBoss Portal:
</para>
+ <para>
<orderedlist>
<listitem>
<para>
@@ -106,6 +109,7 @@
</para>
</listitem>
</orderedlist>
+ </para>
</sect3>
<sect3>
<title>Datasource Configuration</title>
@@ -142,39 +146,44 @@
</sect2>
<sect2>
<title>Deploying JBoss Portal</title>
+ <para>
+ To start JBoss EAP or JBoss AS and deploy JBoss Portal:
+ </para>
<para>
<orderedlist>
<listitem>
<para>
- <emphasis role="bold">Deploy:</emphasis>
- Copy the datasource descriptor file (*-ds.xml) you modified above AND the
- <emphasis>jboss-portal.sar</emphasis>
- from the download folder to
- <filename>JBOSS_INSTALL_DIRECTORY/server/default/deploy/.</filename>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis role="bold">Start the Server:</emphasis>
- Go to <filename>JBOSS_INSTALL_DIRECTORY/bin</filename> and execute <command>run.bat</command> (<command>run.sh</command>, if
- Linux)
- </para>
- </listitem>
- </orderedlist>
- <note>During the first boot (ever), SQL errors in the log, like the one below, can be safely ignored. They
- are thrown when the portal checks for the existence of the initial tables, before it creates them for
- you.
- <programlisting><![CDATA[16:43:39,234 WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
-16:43:39,234 ERROR [JDBCExceptionReporter] Table not found in statement ...]]></programlisting>
- </note>
- Point your browser to
- <emphasis>http://localhost:8080/portal</emphasis>
- , and you should see the Portal HomePage. You can now login using one of the two default accounts:
- <emphasis>user/user</emphasis>
- or
- <emphasis>admin/admin</emphasis>
- .
- </para>
+ <emphasis role="bold">Datasource descriptor:</emphasis> if you have not done so already, change into the <filename>setup</filename> subdirectory where the JBoss Portal binary was extracted to. Copy the correct Datasource descriptor file (<filename>*-ds.xml</filename>) you modified in the previous steps into the <filename>JBOSS_INSTALLATION_DIRECTORY/server/<replaceable>configuration</replaceable>/deploy/</filename> directory.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Start the server:</emphasis> change into the <filename>JBOSS_INSTALLATION_DIRECTORY/bin/</filename> directory. On Microsoft Windows, execute <command>run.bat</command>. On Linux, run the <command>./run.sh</command> command.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">Log in to JBoss Portal:</emphasis> using a Web browser, navigate to <computeroutput>http://localhost:8080/portal</computeroutput> to open the JBoss Portal homepage. Log in using one of the two default accounts: username <emphasis>user</emphasis>, password <emphasis>user</emphasis>, or username <emphasis>admin</emphasis>, password <emphasis>admin</emphasis>.
+ </para>
+ </listitem>
+ </orderedlist>
+ </para>
+ <note>
+ <title>SQL Errors</title>
+ <para>
+ Tables are automatically created the first time JBoss Portal starts. When deployed for the first time, JBoss Portal checks for the existence of the initial tables, which have not been created yet. This causes errors such as the following, which can safely be ignored:
+ </para>
+ <para>
+<programlisting><![CDATA[
+WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
+ERROR [JDBCExceptionReporter] Table not found in statement ...
+WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
+ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_repositoryentry' doesn't exist
+WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
+ERROR [JDBCExceptionReporter] Table 'jbossportal.jbp_cms_version_refs' doesn't exist
+]]></programlisting>
+ </para>
+ </note>
</sect2>
</sect1>
<sect1 id="install_source">
16 years, 3 months
JBoss Portal SVN: r9691 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-01-31 19:02:29 -0500 (Thu, 31 Jan 2008)
New Revision: 9691
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
Log:
adding more content to 2.2.1.4. Datasource Configuration
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-01-31 23:58:12 UTC (rev 9690)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2008-02-01 00:02:29 UTC (rev 9691)
@@ -57,7 +57,7 @@
<sect3 id="install_binarydownload">
<title>Getting the Binary</title>
<para>
- The binary download is available from the <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">JBoss Portal Downloads</ulink> page. Look for the <computeroutput>JBoss Portal Binary</computeroutput> package. Once the binary zip file is downloaded and extracted, the folder hierarchy will look like the following:
+ The binary download is available from the <ulink url="http://labs.jboss.com/portal/jbossportal/download/index.html">JBoss Portal Downloads</ulink> page. Look for the <computeroutput>JBoss Portal Binary</computeroutput> package. Once the binary zip file has been downloaded and extracted, the folder hierarchy will look similar to the following:
</para>
<para>
<mediaobject>
@@ -92,7 +92,7 @@
<orderedlist>
<listitem>
<para>
- <emphasis role="bold">Create a new Database:</emphasis> this guide assumes that the new database will be called <emphasis>jbossportal</emphasis>.
+ <emphasis role="bold">Create a new database:</emphasis> this guide assumes that the new database will be called <emphasis>jbossportal</emphasis>.
</para>
</listitem>
<listitem>
@@ -108,24 +108,22 @@
</orderedlist>
</sect3>
<sect3>
- <title>DataSource Configuration</title>
- <para>
- The JBoss Portal download you extracted in
- <xref linkend="install_binarydownload"/>
- contains pre-configured datasource descriptors, you can use for most popular RDBMS under the
- <emphasis>setup</emphasis>
- directory. For more details about the datasource descriptor or if your database server is not part
- of the pre-built descriptors, please refer to
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">the dedicated wiki page.</ulink>
- <mediaobject>
- <imageobject>
- <imagedata align="center" valign="middle" fileref="images/setup/dsfiles.png"/>
- </imageobject>
+ <title>Datasource Configuration</title>
+ <para>
+ The JBoss Portal binary download that was extracted in <xref linkend="install_binarydownload"/>, contains pre-configured Datasource descriptors for the more popular databases. Datasource descriptors are provided for the MySQL 4, MySQL 5, PostgreSQL, Microsoft SQL Server, and Oracle databases, and can be found in the <filename>setup</filename> subdirectory where the JBoss Portal binary was extracted to:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" valign="middle" fileref="images/setup/dsfiles.png"/>
+ </imageobject>
</mediaobject>
- </para>
- <para>At this point, you should configure the one that suits you best with your Database and JDBC
- driver.
- <programlisting><![CDATA[
+ <para>
+ Copy the Datasource descriptor that matches your database into the <filename>JBOSS_INSTALLATION_DIRECTORY/server/<replaceable>configuration</replaceable>/deploy/</filename> directory, where <replaceable>configuration</replaceable> is either all, default, minimal, or production. For example, if you are using the production configuration, copy the Datasource descriptor into the <filename>JBOSS_INSTALLATION_DIRECTORY/server/production/deploy/</filename> directory.
+ </para>
+ <para>
+ After the Datasource descriptor has been copied into the <filename>deploy</filename> directory, make sure the username, password, connection-url, and driver-class are correct for your chosen database. Datasource descriptor files can be deployed to test before being used in production. The following is an example Datasource descriptor for the PostgreSQL database:
+ </para>
+<programlisting><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
@@ -136,11 +134,10 @@
<password>portalpassword</password>
</local-tx-datasource>
</datasources>
- ]]></programlisting>
- Please verify that the username, password, url, and driver-class are correct for
- your flavor of DB. You can deploy the datasource file by itself to test, in
- advance.
- </para>
+]]></programlisting>
+ <para>
+ For further details about Datasource descriptors, please refer to the <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">JBoss JDBC Datasource wiki page</ulink>.
+ </para>
</sect3>
</sect2>
<sect2>
16 years, 3 months