JBoss Portal SVN: r10043 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-20 03:49:47 -0500 (Wed, 20 Feb 2008)
New Revision: 10043
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
6.1.1. The JBoss Portlet DTD
finished changing itemizedlist to variablelist
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-20 08:23:52 UTC (rev 10042)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-20 08:49:47 UTC (rev 10043)
@@ -119,7 +119,7 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-Element <![CDATA[<!ELEMENT portlet-name (#PCDATA)>]]>
+<![CDATA[<!ELEMENT portlet-name (#PCDATA)>]]>
</screen></term>
<listitem>
<para>
@@ -128,7 +128,7 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-Element <![CDATA[<!ELEMENT remotable (#PCDATA)>]]>
+<![CDATA[<!ELEMENT remotable (#PCDATA)>]]>
</screen></term>
<listitem>
<para>
@@ -137,7 +137,7 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-Element <![CDATA[<!ELEMENT ajax (partial-refresh)>]]>
+<![CDATA[<!ELEMENT ajax (partial-refresh)>]]>
</screen></term>
<listitem>
<para>
@@ -155,7 +155,7 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-Element <![CDATA[<!ELEMENT session-config (distributed)>]]>
+<![CDATA[<!ELEMENT session-config (distributed)>]]>
</screen></term>
<listitem>
<para>
@@ -174,7 +174,7 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-Element <![CDATA[<!ELEMENT distributed (#PCDATA)>]]>
+<![CDATA[<!ELEMENT distributed (#PCDATA)>]]>
</screen></term>
<listitem>
<para>
@@ -183,7 +183,7 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-Element <![CDATA[<!ELEMENT transaction (trans-attribute)>]]>
+<![CDATA[<!ELEMENT transaction (trans-attribute)>]]>
</screen></term>
<listitem>
<para>
@@ -202,7 +202,7 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-Element <![CDATA[<!ELEMENT trans-attribute (#PCDATA)>]]>
+<![CDATA[<!ELEMENT trans-attribute (#PCDATA)>]]>
</screen></term>
<listitem>
<para>
@@ -211,62 +211,102 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-Element <![CDATA[<!ELEMENT header-content (link | script | meta)*>]]>
+<![CDATA[<!ELEMENT header-content (link | script | meta)*>]]>
</screen></term>
-
-</para><para><programlisting><![CDATA[Specify content which should be included in the portal aggregated page when the portlet
-is present on that page. This setting only applies when the portlet is used in the local mode.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT link EMPTY>]]>
-</para><para><programlisting><![CDATA[
-No content is allowed inside an link element.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT script (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The script header element can contain inline script definitions.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT meta EMPTY>]]>
-</para><para><programlisting><![CDATA[No content is allowed for meta element.]]></programlisting></para>
-</listitem><listitem>
-<para>
+<listitem>
+ <para>
+ Specify content which should be included in the portal aggregated page when the portlet
+is present on that page. This setting only applies when the portlet is used in the local mode.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<![CDATA[<!ELEMENT link EMPTY>]]>
+</screen></term>
+<listitem>
+ <para>
+ No content is allowed inside an link element.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<![CDATA[<!ELEMENT script (#PCDATA)>]]>
+</screen></term>
+<listitem>
+ <para>
+ The script header element can contain inline script definitions.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<![CDATA[<!ELEMENT meta EMPTY>]]>
+</screen></term>
+<listitem>
+ <para>
+ No content is allowed for meta element.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
Element <![CDATA[<!ELEMENT service (service-name,service-class,service-ref)>]]>
-</para><para><programlisting><![CDATA[Declare a service that will be injected by the portlet container as an
-attribute of the portlet context.
-
-Example:
-
+</screen></term>
+<listitem>
+ <para>
+ Declare a service that will be injected by the portlet container as an attribute of the portlet context.
+ </para>
+ <para>
+ For example:
+ </para>
+ <para>
+<screen><![CDATA[
<service>
<service-name>UserModule</service-name>
<service-class>org.jboss.portal.identity.UserModule</service-class>
<service-ref>:service=Module,type=User</service-ref>
-</service>
-
-In the portlet it is then possible to use it by doing a lookup on the service
-name, for example in the init() lifecycle method :
-
+</service>]]>
+</screen>
+ </para>
+ <para>In the portlet it is then possible to use it by doing a lookup on the service name, for example in the init() lifecycle method :
+ </para>
+ <para>
+<screen><![CDATA[
public void init()
{
UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
-}]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT service-name (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The service name that will be used to bind the service as a portlet context attribute.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT service-class (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The full qualified name of the interface that the service implements.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT service-ref (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The reference to the service. In the JMX Microkernel environment it consist of the JMX
-name of the service MBean. For an MBean reference if the domain is left out, then the
-current domain of the portal will be used.]]></programlisting></para>
-</listitem></itemizedlist>
-
- </para>
+}]]>
+</screen>
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<![CDATA[<!ELEMENT service-name (#PCDATA)>]]>
+</screen></term>
+<listitem>
+ <para>
+ The service name that will be used to bind the service as a portlet context attribute.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<![CDATA[<!ELEMENT service-class (#PCDATA)>]]>
+</screen></term>
+<listitem>
+ <para>
+ The full qualified name of the interface that the service implements.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<![CDATA[<!ELEMENT service-ref (#PCDATA)>]]>
+</screen></term>
+<listitem>
+ <para>
+ The reference to the service. In the JMX Microkernel environment it consist of the JMX name of the service MBean. For an MBean reference if the domain is left out, then the current domain of the portal will be used.
+ </para>
+</listitem>
+</varlistentry>
+</variablelist>
+</para>
</sect2>
<sect2>
<title>Portlet Instance DTD</title>
16 years, 7 months
JBoss Portal SVN: r10042 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-20 03:23:52 -0500 (Wed, 20 Feb 2008)
New Revision: 10042
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
revising 6.1.1. The JBoss Portlet DTD
replacing itemizedlist with variablelist
*** this will break the book until later commits ***
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-20 07:49:06 UTC (rev 10041)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-20 08:23:52 UTC (rev 10042)
@@ -145,55 +145,75 @@
</para>
</listitem>
</varlistentry>
-
-
-
- The ajax tag allows to configure the ajax capabilities of the portlet. If
-the portlet is tagged as partial-refresh then the portal may use partial page
-refreshing and render only that portlet. If the portlet partial-refresh value
-is false, then the portal will perform a full page refresh when the portlet is refreshed.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT partial-refresh (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The authorized values for the partial-refresh element are true or false.]]></programlisting></para>
-</listitem><listitem>
-<para>
+<varlistentry><term><screen><![CDATA[
+<!ELEMENT partial-refresh (#PCDATA)>]]>
+</screen></term>
+<listitem>
+ <para>
+ The authorized values for the partial-refresh element are true or false.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
Element <![CDATA[<!ELEMENT session-config (distributed)>]]>
-</para><para><programlisting><![CDATA[This element configure the portlet session of the portlet.
-
-The distributed element instructs the container to distribute the session attributes
-using the portal session replication. It applies only to local portlets are not to
-remote portlets. The default value is false.
-
-Example:
-
+</screen></term>
+<listitem>
+ <para>
+ This element configure the portlet session of the portlet. The distributed element instructs the container to distribute the session attributes using the portal session replication. It applies only to local portlets are not to remote portlets. The default value is false.
+ </para>
+ <para>
+ For example:
+ </para>
+ <para>
+<screen><![CDATA[
<session-config>
<distributed>true</distributed>
-</session-config>]]></programlisting></para>
-</listitem><listitem>
-<para>
+</session-config>]]>
+</screen>
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
Element <![CDATA[<!ELEMENT distributed (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The authorized values for the distributed element are true or false.]]></programlisting></para>
-</listitem><listitem>
-<para>
+</screen></term>
+<listitem>
+ <para>
+ The authorized values for the distributed element are true or false.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
Element <![CDATA[<!ELEMENT transaction (trans-attribute)>]]>
-</para><para><programlisting><![CDATA[Defines how the portlet behaves with the transactionnal context. The default value
-is Never.
-
-Example:
-
+</screen></term>
+<listitem>
+ <para>
+ Defines how the portlet behaves with the transactionnal context. The default value is Never.
+ </para>
+ <para>
+ For example:
+ </para>
+ <para>
+<screen><![CDATA[
<transaction>
<trans-attribute>Required</transaction>
-<transaction>]]></programlisting></para>
-</listitem><listitem>
-<para>
+<transaction>]]>
+</screen>
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
Element <![CDATA[<!ELEMENT trans-attribute (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[
-The trans-attribute value defines the transactionnal behavior. The accepted values
-are Required, Mandatory, Never, Supports, NotSupported and RequiresNew.]]></programlisting></para>
-</listitem><listitem>
-<para>
+</screen></term>
+<listitem>
+ <para>
+ The trans-attribute value defines the transactionnal behavior. The accepted values are Required, Mandatory, Never, Supports, NotSupported and RequiresNew.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
Element <![CDATA[<!ELEMENT header-content (link | script | meta)*>]]>
+</screen></term>
+
</para><para><programlisting><![CDATA[Specify content which should be included in the portal aggregated page when the portlet
is present on that page. This setting only applies when the portlet is used in the local mode.]]></programlisting></para>
</listitem><listitem>
16 years, 7 months
JBoss Portal SVN: r10041 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-20 02:49:06 -0500 (Wed, 20 Feb 2008)
New Revision: 10041
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
6.1.1. The JBoss Portlet DTD
replacing itemizedlist with variablelist
*** this will break the book until later commits ***
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-20 05:45:06 UTC (rev 10040)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-20 07:49:06 UTC (rev 10041)
@@ -72,59 +72,83 @@
The files for the DTDs are located in the <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/</filename> directory.
</para>
<sect2>
- <title>JBoss Portlet DTD</title>
+ <title>The JBoss Portlet DTD</title>
<para>
-<itemizedlist>
+ The following list refers to elements found in the JBoss Portlet DTD, <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/jboss-portlet_<replaceable>version_number</replaceable>.dtd</filename>:
+ </para>
+ <para>
+ <variablelist>
+ <varlistentry><term><screen><![CDATA[
+<!ELEMENT portlet-app (remotable?,portlet*,service*)>]]>
+</screen></term>
<listitem>
-<para>
-Element <![CDATA[<!ELEMENT portlet-app (remotable?,portlet*,service*)>]]>
-</para><para><programlisting><![CDATA[The remotable element is used to configure the default behavior of the portlets with
-respect to WSRP exposure.
-
-For each portlet defined in portlet.xml, it is possible to configure specific
-settings of the portlet container.
-
-It is also possible to inject services in the portlet context of the application
-using the service elements.]]></programlisting></para>
-</listitem><listitem>
-<para>
-Element <![CDATA[<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,header-content?)>]]>
-</para><para><programlisting><![CDATA[Additional configuration for a portlet.
-
-The portlet-name defines the name of the portlet. It must match a portlet defined already
-in portlet.xml of the same web application.
-
-The remotable element configures the portlet exposure to WSRP. If no value is present
-then the value considered is either the value defined globally at the portlet
-application level or false.
-
-The trans-attribute value specifies the behavior of the portlet when it is invoked at
-runtime with respect to the transactionnal context. According to how the portlet is
-invoked a transaction may exist or not before the portlet is invoked. Usually in the
-local context the portal transaction could be present. By default the value considered is
- NotSupported which means that the portal transaction will be suspended for the duration
- of the portlet invocation.
-
-Example:
-
+ <para>
+ Use the <computeroutput>remotable</computeroutput> element to configure the default behavior of portlets with respect to WSRP exposure: if no value is given, the value is either the value globally defined at the portlet application level, or false. Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>.
+ </para>
+ <para>
+ You can configure specific settings for the portlet container for each portlet defined in the <filename>WEB-INF/portlet.xml</filename> file. Use the <computeroutput>service</computeroutput> element to inject services into the portlet context of applications.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,header-content?)>]]>
+</screen></term>
+<listitem>
+ <para>
+ Additional configuration for a portlet. The <computeroutput>portlet-name</computeroutput> element defines the portlet name. It must match a portlet defined in the <filename>WEB-INF/portlet.xml</filename> file for that application.
+ </para>
+ <para>
+ Use the <computeroutput>remotable</computeroutput> element to configure the default behavior of portlets with respect to WSRP exposure: if no value is given, the value is either the value globally defined at the portlet application level, or false. Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>.
+ </para>
+ <para>
+ The <computeroutput>trans-attribute</computeroutput> element specifies the behavior of the portlet when it is invoked at runtime, with respect to the transactionnal context. Depending on how the portlet is
+invoked, a transaction may or may not exist before the portlet is invoked. The portal transaction is usually present in the local context. By default, the value is <computeroutput>NotSupported</computeroutput>, which means that the portal transaction will be suspended for the duration of the portlet invocation.
+ </para>
+ <para>
+ The following example uses the <computeroutput>portlet-name</computeroutput>, <computeroutput>remotable</computeroutput>, and <computeroutput>trans-attribute</computeroutput> elements:
+ </para>
+ <para>
+<screen><![CDATA[
<portlet>
<portlet-name>MyPortlet</portlet-name>
<remotable>true</remotable>
<trans-attribute>Required</trans-attribute>
-</portlet>]]></programlisting></para>
-</listitem><listitem>
-<para>
+</portlet>]]>
+</screen>
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
Element <![CDATA[<!ELEMENT portlet-name (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The portlet name.]]></programlisting></para>
-</listitem><listitem>
-<para>
+</screen></term>
+<listitem>
+ <para>
+ The portlet name.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
Element <![CDATA[<!ELEMENT remotable (#PCDATA)>]]>
-</para><para><programlisting><![CDATA[The remotable value is used for WSRP exposure. The accepted values are the
-litterals true of false.]]></programlisting></para>
-</listitem><listitem>
-<para>
+</screen></term>
+<listitem>
+ <para>
+ Use the <computeroutput>remotable</computeroutput> element to configure the default behavior of portlets with respect to WSRP exposure: if no value is given, the value is either the value globally defined at the portlet application level, or false. Accepted values are <computeroutput>true</computeroutput> and <computeroutput>false</computeroutput>.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
Element <![CDATA[<!ELEMENT ajax (partial-refresh)>]]>
-</para><para><programlisting><![CDATA[The ajax tag allows to configure the ajax capabilities of the portlet. If
+</screen></term>
+<listitem>
+ <para>
+ Use the <computeroutput>ajax</computeroutput> element to configure the Asynchronous JavaScript and XML (AJAX) capabilities of the portlet. If a portlet uses the <computeroutput>true</computeroutput> value for the <computeroutput>partial-refresh</computeroutput> element, then the portal uses partial page refreshing, and only renders that portlet. If the <computeroutput>partial-refresh</computeroutput> element uses a <computeroutput>false</computeroutput> value, the portal uses a full-page refresh when the portlet is refreshed.
+ </para>
+</listitem>
+</varlistentry>
+
+
+
+ The ajax tag allows to configure the ajax capabilities of the portlet. If
the portlet is tagged as partial-refresh then the portal may use partial page
refreshing and render only that portlet. If the portlet partial-refresh value
is false, then the portal will perform a full page refresh when the portlet is refreshed.]]></programlisting></para>
16 years, 7 months
JBoss Portal SVN: r10040 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-20 00:45:06 -0500 (Wed, 20 Feb 2008)
New Revision: 10040
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
minor revisions/rephrasing
6.1. Changes from previous releases
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-20 03:19:54 UTC (rev 10039)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-20 05:45:06 UTC (rev 10040)
@@ -24,7 +24,7 @@
</screen>
</para>
<para>
- If you do not use the DTD declaration, the previous mechanism for XML validation will be used. The DTD is more strict, specifically with the order of the XML elements. For example, the following will be valid if you are not using the DTD, but will be rejected if you are:
+ If you do not use the DTD declaration, the previous mechanism for XML validation will be used. The DTD is more strict, specifically with the order of XML elements. The following is an example from a <filename>*-object.xml</filename> descriptor, which will be valid if you are not using the DTD, but will be rejected if you are:
</para>
<para>
<screen><![CDATA[
@@ -41,14 +41,36 @@
<if-exists>overwrite</if-exists>]]>
</screen>
</para>
- <para>The various DTD available are:</para>
+ <para>
+ The following DTDs are available:
+ </para>
+ <para>
<itemizedlist>
- <listitem>For -object.xml descriptors: "-//JBoss Portal//DTD Portal Object 2.6//EN"</listitem>
- <listitem>For jboss-app.xml descriptors: "-//JBoss Portal//DTD JBoss Web Application 2.6//EN"</listitem>
- <listitem>For jboss-portlet.xml descriptors: "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"</listitem>
- <listitem>For portlet-instances.xml descriptors: "-//JBoss Portal//DTD Portlet Instances 2.6//EN"</listitem>
+ <listitem>
+ <para>
+ for <filename>-object.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD Portal Object 2.6//EN"</userinput>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ for <filename>jboss-app.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD JBoss Web Application 2.6//EN"</userinput>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ for <filename>jboss-portlet.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD JBoss Portlet 2.6//EN"</userinput>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ for <filename>portlet-instances.xml</filename> descriptors: <userinput>"-//JBoss Portal//DTD Portlet Instances 2.6//EN"</userinput>
+ </para>
+ </listitem>
</itemizedlist>
- <para>Those files are available in the <emphasis>jboss-portal.sar/dtd/</emphasis> folder</para>
+</para>
+<para>
+ The files for the DTDs are located in the <filename>$JBOSS_HOME/server/<replaceable>configuration</replaceable>/deploy/jboss-portal.sar/dtd/</filename> directory.
+</para>
<sect2>
<title>JBoss Portlet DTD</title>
<para>
16 years, 7 months
JBoss Portal SVN: r10039 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-19 22:19:54 -0500 (Tue, 19 Feb 2008)
New Revision: 10039
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
start minor revisions for 6.1. Changes from previous releases
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-20 02:33:20 UTC (rev 10038)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-20 03:19:54 UTC (rev 10039)
@@ -9,33 +9,38 @@
</chapterinfo>
<title>XML Descriptors</title>
<sect1>
- <title>Changes since previous releases</title>
- <para>The previous releases of JBoss Portal did not have an external schema to validate the various XML
- descriptors although it was internally validated by the portal. Since 2.6 we have worked on providing
- Document Type Definition (DTD) for the various descriptors. The DTD validation will be only effective
- if you XML descriptors declares it like that:</para>
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+ <title>Changes from previous releases</title>
+ <para>The previous releases of JBoss Portal did not have an external schema to validate the various XML descriptors; however, it was internally validated by the portal. Since JBoss Portal 2.6, a Document Type Definition (DTD) has been provided to validate descriptors.
+ </para>
+ <para>
+ To use the DTD, add the following declaration to the start of the desired descriptors:
+ </para>
+ <para>
+<screen><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE deployments PUBLIC
"-//JBoss Portal//DTD Portal Object 2.6//EN"
-"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-...]]></programlisting>
- <para>If you do not perform the declaration then the previous mechanism will be used. The main difference
- between using the DTD and not is that the additional DTD validation is more strict specifically on the order
- of the XML elements. The following example will be accepted without the DTD declaration and will not with the DTD
- declaration:</para>
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<deployment>
- <if-exists>overwrite</if-exists>
- <parent-ref>default.default</parent-ref>
- ...
-</deployment>]]></programlisting>
- <para>The correct descriptor is rather:</para>
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<deployment>
- <parent-ref>default.default</parent-ref>
- <if-exists>overwrite</if-exists>
- ...
-</deployment>]]></programlisting>
+"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">]]>
+</screen>
+ </para>
+ <para>
+ If you do not use the DTD declaration, the previous mechanism for XML validation will be used. The DTD is more strict, specifically with the order of the XML elements. For example, the following will be valid if you are not using the DTD, but will be rejected if you are:
+ </para>
+ <para>
+<screen><![CDATA[
+<if-exists>overwrite</if-exists>
+<parent-ref>default.default</parent-ref>]]>
+</screen>
+ </para>
+ <para>
+ The correct element order, and one which would be valid against the DTD, would be as follows:
+ </para>
+ <para>
+<screen><![CDATA[
+<parent-ref>default.default</parent-ref>
+<if-exists>overwrite</if-exists>]]>
+</screen>
+ </para>
<para>The various DTD available are:</para>
<itemizedlist>
<listitem>For -object.xml descriptors: "-//JBoss Portal//DTD Portal Object 2.6//EN"</listitem>
16 years, 7 months
JBoss Portal SVN: r10038 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-19 21:33:20 -0500 (Tue, 19 Feb 2008)
New Revision: 10038
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
Log:
minor corrections, with/in etc
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-20 00:40:46 UTC (rev 10037)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-20 02:33:20 UTC (rev 10038)
@@ -999,7 +999,7 @@
<sect3>
<title>Introduction</title>
<para>
- This section describes how to deploy a JSF portlet in JBoss Portal, using the Apache MyFaces JSF implementation in JBoss AS or JBoss EAP. Before proceeding, download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...">HelloWorldJSFSunRIPortlet</ulink> from <ulink url="http://labs.jboss.com/portletswap/">JBoss PortletSwap</ulink>.
+ This section describes how to deploy a JSF portlet in JBoss Portal, using the Apache MyFaces JSF implementation in JBoss AS and JBoss EAP. Before proceeding, download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...">HelloWorldJSFSunRIPortlet</ulink> from <ulink url="http://labs.jboss.com/portletswap/">JBoss PortletSwap</ulink>.
</para>
</sect3>
<sect3>
@@ -1128,7 +1128,7 @@
Without the <filename>faces-config.xml</filename> file, the application would work the same outside of the portlet as it would inside a portlet container. In this example, a basic user bean, <computeroutput><managed-bean-name>user</managed-bean-name></computeroutput>, and a navigation rule are defined, which handle the submission of the original form in the <filename>HelloWorldJSFSunRIPortlet/WEB-INF/jsp/index.jsp</filename> file.
</para>
<para>
- The following is an example of the <computeroutput>Faces Servlet</computeroutput> section from the <filename>HelloWorldJSFSunRIPortlet/WEB-INF/web.xml</filename> file:
+ The following is an example of the <computeroutput>Faces Servlet</computeroutput> and <computeroutput>Faces Servlet Mapping</computeroutput> sections from the <filename>HelloWorldJSFSunRIPortlet/WEB-INF/web.xml</filename> file:
</para>
<para>
<screen><![CDATA[
@@ -1156,23 +1156,13 @@
</screen>
</para>
<para>
- <variablelist>
- <varlistentry><term><screen><![CDATA[
-<url-pattern>*.jsf</url-pattern>]]>
-</screen></term>
-<listitem>
- <para>
- For the Sun JSF RI, this definition is mandatory to associate files with <filename>.jsf</filename> extensions with the Apache MyFaces servlet.
- </para>
-</listitem>
-</varlistentry>
-</variablelist>
+ For Sun JSF RI portlets, the <computeroutput>Faces Servlet</computeroutput> and <computeroutput>Faces Servlet Mapping</computeroutput> sections are required to associate files with the <filename>.jsf</filename> extension to the Apache MyFaces servlet.
</para>
<para>
<warning>
<title>Classes for the JSF-Portlet bridge are not included</title>
<para>
- Unlike Apache MyFaces, the classes for the JSF-Portlet bridge are not included with the JSF implementation, JBoss AS, or JBoss EAP. This library must be available in your application package. Navigate to the <ulink url="https://jsfportletbridge.dev.java.net/servlets/ProjectDocumentList">JSF-Portlet bridge webpage</ulink> to download the JSF-Portlet bridge library.
+ Unlike Apache MyFaces, the classes for the JSF-Portlet bridge are not included in the JSF implementation, JBoss AS, or JBoss EAP. This library must be available in your application package. Navigate to the <ulink url="https://jsfportletbridge.dev.java.net/servlets/ProjectDocumentList">JSF-Portlet bridge webpage</ulink> to download the JSF-Portlet bridge library.
</para>
</warning>
</para>
@@ -1337,7 +1327,7 @@
<sect3>
<title>Introduction</title>
<para>
- This section describes how to deploy a JSF portlet in JBoss Portal, using the Apache MyFaces JSF implementation in JBoss AS or JBoss EAP. Before proceeding, download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...">HelloWorldJSFMyFaces42Portlet</ulink> from <ulink url="http://labs.jboss.com/portletswap/">JBoss PortletSwap</ulink>.
+ This section describes how to deploy a JSF portlet in JBoss Portal, using the Apache MyFaces JSF implementation in JBoss AS and JBoss EAP. Before proceeding, download the <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_6/bundles/HelloWorl...">HelloWorldJSFMyFaces42Portlet</ulink> from <ulink url="http://labs.jboss.com/portletswap/">JBoss PortletSwap</ulink>.
</para>
<para>
Apache MyFaces can be used globally for the entire server, replacing the Sun JSF RI libraries, but the HelloWorldJSFMyFaces42Portlet uses its own libraries, and will not affect the application server.
16 years, 7 months
JBoss Portal SVN: r10037 - in modules/common/trunk/common/src: test/java/org/jboss/portal/test/common/util and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-02-19 19:40:46 -0500 (Tue, 19 Feb 2008)
New Revision: 10037
Modified:
modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/CollectionMap.java
modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/ListMap.java
modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/SetMap.java
modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/util/CollectionMapTestCase.java
Log:
- JBPORTAL-1833: SetMap now properly uses comparator, added test case.
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/CollectionMap.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/CollectionMap.java 2008-02-20 00:03:59 UTC (rev 10036)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/CollectionMap.java 2008-02-20 00:40:46 UTC (rev 10037)
@@ -22,13 +22,14 @@
******************************************************************************/
package org.jboss.portal.common.util;
-import java.util.Map;
+import java.io.Serializable;
import java.util.Collection;
-import java.util.Iterator;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
-import java.io.Serializable;
/**
* A map of collections.
@@ -41,13 +42,15 @@
/** The underlying map. */
private final Map<K, Collection<V>> map;
+ /** An optional comparator. */
+ protected Comparator<V> comparator;
public CollectionMap()
{
map = init(null);
}
- public CollectionMap(SetMap<K, V> other) throws IllegalArgumentException
+ public CollectionMap(CollectionMap<K, V> other) throws IllegalArgumentException
{
if (other == null)
{
@@ -56,6 +59,31 @@
map = init(other);
}
+ public CollectionMap(CollectionMap<K, V> other, Comparator<V> comparator) throws IllegalArgumentException
+ {
+ this(other);
+ initComparator(comparator);
+ }
+
+ public CollectionMap(Comparator<V> comparator)
+ {
+ this();
+
+ initComparator(comparator);
+ }
+
+ private void initComparator(Comparator<V> comparator)
+ {
+ //
+ if (comparator == null)
+ {
+ throw new IllegalArgumentException("No null comparator allowed");
+ }
+
+ //
+ this.comparator = comparator;
+ }
+
/**
* Add an object in the set keyed under the specified key.
*
@@ -78,9 +106,7 @@
add(collection, o);
}
- /**
- * Return the set of keys.
- */
+ /** Return the set of keys. */
public final Set<K> keySet()
{
return map.keySet();
@@ -156,9 +182,7 @@
}
}
- /**
- * Return the collection specified by the key.
- */
+ /** Return the collection specified by the key. */
public Collection<V> get(K key)
{
return map.get(key);
@@ -194,10 +218,12 @@
{
return iterator.hasNext();
}
+
public V next()
{
return iterator.next();
}
+
public void remove()
{
iterator.remove();
@@ -232,9 +258,8 @@
protected abstract void add(Collection<V> c, V o);
/**
- * Removes an object from the collection. The type of the object to remove is intentionnally
- * <code>Object</code> and not the parameterized type <code><V></code> because the Collection<V>
- * interface is designed that way.
+ * Removes an object from the collection. The type of the object to remove is intentionnally <code>Object</code> and
+ * not the parameterized type <code><V></code> because the Collection<V> interface is designed that way.
*
* @param c the collection to remove from
* @param o the object to remove
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/ListMap.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/ListMap.java 2008-02-20 00:03:59 UTC (rev 10036)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/ListMap.java 2008-02-20 00:40:46 UTC (rev 10037)
@@ -22,12 +22,11 @@
******************************************************************************/
package org.jboss.portal.common.util;
-import java.util.Collection;
-import java.util.Comparator;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
-import java.util.Set;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -36,9 +35,6 @@
public class ListMap<K, V> extends CollectionMap<K, V>
{
- /** An optional comparator. */
- protected Comparator<V> comparator;
-
public ListMap()
{
}
@@ -50,35 +46,15 @@
public ListMap(SetMap<K, V> other, Comparator<V> comparator) throws IllegalArgumentException
{
- super(other);
-
- //
- if (comparator == null)
- {
- throw new IllegalArgumentException("No null comparator allowed");
- }
-
- //
- this.comparator = comparator;
+ super(other, comparator);
}
public ListMap(Comparator<V> comparator)
{
- super();
-
- //
- if (comparator == null)
- {
- throw new IllegalArgumentException("No null comparator allowed");
- }
-
- //
- this.comparator = comparator;
+ super(comparator);
}
- /**
- * Return the list specified by the key.
- */
+ /** Return the list specified by the key. */
public List<V> get(K key)
{
return (List<V>)super.get(key);
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/SetMap.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/SetMap.java 2008-02-20 00:03:59 UTC (rev 10036)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/util/SetMap.java 2008-02-20 00:40:46 UTC (rev 10037)
@@ -22,17 +22,15 @@
******************************************************************************/
package org.jboss.portal.common.util;
+import java.util.Collection;
+import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
-import java.util.Comparator;
-import java.util.TreeSet;
import java.util.SortedSet;
-import java.util.Collection;
-import java.util.Map;
+import java.util.TreeSet;
/**
- * A map of set. This object does not handle synchronization and use HashMap and HashSet
- * as underlying data structures;
+ * A map of set. This object does not handle synchronization and use HashMap and HashSet as underlying data structures;
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7322 $
@@ -43,9 +41,6 @@
/** Version. */
static final long serialVersionUID = -7239767000556095977L;
- /** An optional comparator. */
- protected Comparator<V> comparator;
-
public SetMap()
{
}
@@ -83,9 +78,7 @@
this.comparator = comparator;
}
- /**
- * Return the set specified by the key.
- */
+ /** Return the set specified by the key. */
public Set<V> get(K key)
{
return (Set<V>)super.get(key);
Modified: modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/util/CollectionMapTestCase.java
===================================================================
--- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/util/CollectionMapTestCase.java 2008-02-20 00:03:59 UTC (rev 10036)
+++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/util/CollectionMapTestCase.java 2008-02-20 00:40:46 UTC (rev 10037)
@@ -28,6 +28,7 @@
import org.jboss.portal.common.util.SetMap;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
@@ -80,6 +81,54 @@
testThrowNPE(new ListMap<Key, Value>());
}
+ public void testSorting()
+ {
+ Comparator<Value> comp = new Comparator<Value>()
+ {
+ public int compare(Value o1, Value o2)
+ {
+ return o1.i - o2.i;
+ }
+ };
+
+ testComparatorSorting(new ListMap<Key, Value>(comp));
+ testComparatorSorting(new SetMap<Key, Value>(comp));
+ }
+
+ private void testComparatorSorting(CollectionMap<Key, Value> map)
+ {
+ Value v1 = new Value(1);
+ Value v2 = new Value(2);
+ Value v3 = new Value(3);
+ Value v4 = new Value(4);
+
+ map.put(k1, v2);
+ map.put(k1, v4);
+ map.put(k1, v3);
+ map.put(k1, v1);
+
+ Iterator<Value> iterator = map.iterator(k1);
+ for (int i = 0; iterator.hasNext(); i++)
+ {
+ Value value = iterator.next();
+ switch (i)
+ {
+ case 0:
+ assertEquals(v1, value);
+ break;
+ case 1:
+ assertEquals(v2, value);
+ break;
+ case 2:
+ assertEquals(v3, value);
+ break;
+ case 3:
+ assertEquals(v4, value);
+ break;
+ }
+ }
+ }
+
private void testNormal(CollectionMap<Key, Value> map)
{
assertFalse(map.contains(k1, v1));
@@ -212,6 +261,22 @@
private static class Value
{
+ int i;
+
+ private Value()
+ {
+ }
+
+ private Value(int i)
+ {
+ this.i = i;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Value " + i;
+ }
}
private static class ValueExt extends Value
16 years, 7 months
JBoss Portal SVN: r10036 - in modules/portlet/trunk/test/src: test/resources/portal/samples/basic-war/WEB-INF and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 19:03:59 -0500 (Tue, 19 Feb 2008)
New Revision: 10036
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo3.jsp
Log:
add a couple of stuff
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-19 22:17:41 UTC (rev 10035)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-20 00:03:59 UTC (rev 10036)
@@ -155,6 +155,12 @@
List<AbstractBeanMetaData> toInstall = new ArrayList<AbstractBeanMetaData>();
//
+ AbstractBeanMetaData kernelPortletApplicationMD = createKernelPortletApplicationMetaData(builder.getApplication(), kernelPortletApplicationId);
+
+ //
+ toInstall.add(kernelPortletApplicationMD);
+
+ //
for (ContainerPortletInfo containerInfo : builder.getPortlets())
{
//
@@ -165,7 +171,7 @@
// Inject the kernel portlet application in the kernel portlet container
AbstractDependencyValueMetaData kernelPortletApplicationDependencyMD = new AbstractDependencyValueMetaData(kernelPortletApplicationId);
- kernelPortletApplicationDependencyMD.setDependentState(ControllerState.START);
+// kernelPortletApplicationDependencyMD.setDependentState(ControllerState.START);
kernelPortletContainerMD.getProperties().add(new AbstractPropertyMetaData("kernelPortletApplication", kernelPortletApplicationDependencyMD));
// Install the kernel portlet container on the kernel portlet application
@@ -173,7 +179,7 @@
installKernelPortletContainerMD.setBean(kernelPortletApplicationId);
installKernelPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
installKernelPortletContainerMD.setMethodName("addKernelPortletContainer");
- installKernelPortletContainerMD.setDependentState(ControllerState.START);
+// installKernelPortletContainerMD.setState(ControllerState.st);
kernelPortletContainerMD.getInstalls().add(installKernelPortletContainerMD);
// Uninstall the kernel portlet container from the kernel portlet application
@@ -181,19 +187,13 @@
uninstallKernelPortletContainerMD.setBean(kernelPortletApplicationId);
uninstallKernelPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
uninstallKernelPortletContainerMD.setMethodName("removeKernelPortletContainer");
- uninstallKernelPortletContainerMD.setDependentState(ControllerState.START);
+// uninstallKernelPortletContainerMD.setState(ControllerState.INSTANTIATED);
kernelPortletContainerMD.getUninstalls().add(uninstallKernelPortletContainerMD);
//
toInstall.add(kernelPortletContainerMD);
}
- //
- AbstractBeanMetaData kernelPortletApplicationMD = createKernelPortletApplicationMetaData(builder.getApplication(), kernelPortletApplicationId);
-
- //
- toInstall.add(kernelPortletApplicationMD);
-
// Install beans
for (AbstractBeanMetaData beanMetaData : toInstall)
{
Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/WEB-INF/portlet.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/WEB-INF/portlet.xml 2008-02-19 22:17:41 UTC (rev 10035)
+++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/WEB-INF/portlet.xml 2008-02-20 00:03:59 UTC (rev 10036)
@@ -34,7 +34,7 @@
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
- <title>ExceptionPortlet</title>
+ <title>Exception portlet</title>
</portlet-info>
</portlet>
@@ -48,8 +48,22 @@
<mime-type>text/javascript</mime-type>
</supports>
<portlet-info>
- <title>HeaderPortlet</title>
+ <title>Header portlet</title>
</portlet-info>
</portlet>
+ <portlet>
+ <portlet-name>FailDuringInitPortlet</portlet-name>
+ <portlet-class>org.jboss.portal.portlet.portal.samples.basic.FailDuringInitPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supports>
+ <mime-type>text/javascript</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Fail during init portlet</title>
+ </portlet-info>
+ </portlet>
+
</portlet-app>
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo3.jsp
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo3.jsp 2008-02-19 22:17:41 UTC (rev 10035)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo3.jsp 2008-02-20 00:03:59 UTC (rev 10036)
@@ -14,9 +14,10 @@
<jbp:portlet name="Foo" applicationName="bar"/>
</jsp:attribute>
<jsp:attribute name="rightcol">
+
<jbp:portlet name="ExceptionPortlet" applicationName="samples-basic"/>
-
<jbp:portlet name="HeaderPortlet" applicationName="samples-basic" id="header-portlet"/>
+ <jbp:portlet name="FailDuringInitPortlet" applicationName="samples-basic" id="header-portlet"/>
</jsp:attribute>
16 years, 7 months
JBoss Portal SVN: r10035 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/container and 4 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 17:17:41 -0500 (Tue, 19 Feb 2008)
New Revision: 10035
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/EventRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceRequestImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
Log:
reduce the number of kernel beans
Modified: modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletRequestHandler.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -267,7 +267,12 @@
}
//
- ParameterMap publicNS = pageState.getPublicNavigationalState(portletRequest.getWindowId());
+ ParameterMap publicNS = null;
+ if (pageState != null)
+ {
+ publicNS = pageState.getPublicNavigationalState(portletRequest.getWindowId());
+ }
+
PortletInvocationContext portletInvocationContext = context.createPortletInvocationContext(portletRequest.getWindowId(), pageState);
ActionInvocation actionInvocation = new ActionInvocation(portletInvocationContext);
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -45,7 +45,7 @@
*
* @return the portlet containers
*/
- Collection<PortletContainer> getPortletContainers();
+ Collection<? extends PortletContainer> getPortletContainers();
/**
* Returns a specific container or null if it does not exist
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -44,7 +44,7 @@
{
public ActionRequestImpl createActionRequest(ActionInvocation invocation)
{
- return new ActionRequestImpl(invocation);
+ return new ActionRequestImpl(null, invocation);
}
public ActionResponseImpl createActionResponse(ActionInvocation invocation, ActionRequestImpl actionRequest)
@@ -54,7 +54,7 @@
public EventRequestImpl createEventRequest(EventInvocation invocation)
{
- return new EventRequestImpl(invocation);
+ return new EventRequestImpl(null, invocation);
}
public EventResponseImpl createEventResponse(EventInvocation invocation, EventRequestImpl eventRequest)
@@ -64,7 +64,7 @@
public RenderRequestImpl createRenderRequest(RenderInvocation invocation)
{
- return new RenderRequestImpl(invocation);
+ return new RenderRequestImpl(null, invocation);
}
public RenderResponseImpl createRenderResponse(RenderInvocation invocation, RenderRequestImpl renderRequest)
@@ -74,7 +74,7 @@
public ResourceRequestImpl createResourceRequest(ResourceInvocation invocation)
{
- return new ResourceRequestImpl(invocation);
+ return new ResourceRequestImpl(null, invocation);
}
public ResourceResponseImpl createResourceResponse(ResourceInvocation invocation, ResourceRequestImpl renderRequest)
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -463,28 +463,28 @@
FilterChainImpl<?> chain;
if (invocation instanceof ActionInvocation)
{
- req = new ActionRequestImpl((ActionInvocation)invocation);
+ req = new ActionRequestImpl(this, (ActionInvocation)invocation);
resp = new ActionResponseImpl((ActionInvocation)invocation, req);
phase = "ACTION_PHASE";
chain = new FilterChainImpl<ActionFilter>(actionFilterList, ActionFilter.class);
}
else if (invocation instanceof RenderInvocation)
{
- req = new RenderRequestImpl((RenderInvocation)invocation);
+ req = new RenderRequestImpl(this, (RenderInvocation)invocation);
resp = new RenderResponseImpl((RenderInvocation)invocation, req);
phase = "RENDER_PHASE";
chain = new FilterChainImpl<RenderFilter>(renderFilterList, RenderFilter.class);
}
else if (invocation instanceof EventInvocation)
{
- req = new EventRequestImpl((EventInvocation)invocation);
+ req = new EventRequestImpl(this, (EventInvocation)invocation);
resp = new EventResponseImpl((EventInvocation)invocation, req);
phase = "EVENT_PHASE";
chain = new FilterChainImpl<EventFilter>(eventFilterList, EventFilter.class);
}
else if (invocation instanceof ResourceInvocation)
{
- req = new ResourceRequestImpl((ResourceInvocation)invocation);
+ req = new ResourceRequestImpl(this, (ResourceInvocation)invocation);
resp = new ResourceResponseImpl((ResourceInvocation)invocation, req);
phase = "RESOURCE_SERVING_PHASE";
chain = new FilterChainImpl<ResourceFilter>(resourceFilterList, ResourceFilter.class);
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.impl.jsr168.api;
import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
import javax.portlet.ActionRequest;
@@ -32,8 +33,8 @@
*/
public class ActionRequestImpl extends ClientDataRequestImpl implements ActionRequest
{
- public ActionRequestImpl(ActionInvocation invocation)
+ public ActionRequestImpl(PortletContainerImpl container, ActionInvocation invocation)
{
- super(invocation);
+ super(container, invocation);
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -25,6 +25,7 @@
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.ResourceInvocation;
import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
import javax.portlet.ClientDataRequest;
import java.io.InputStream;
@@ -42,17 +43,17 @@
/** . */
protected final RequestContext requestContext;
- public ClientDataRequestImpl(ActionInvocation invocation)
+ public ClientDataRequestImpl(PortletContainerImpl container, ActionInvocation invocation)
{
- super(invocation);
+ super(container, invocation);
//
this.requestContext = invocation.getRequestContext();
}
- public ClientDataRequestImpl(ResourceInvocation invocation)
+ public ClientDataRequestImpl(PortletContainerImpl container, ResourceInvocation invocation)
{
- super(invocation);
+ super(container, invocation);
//
this.requestContext = invocation.getRequestContext();
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/EventRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/EventRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/EventRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.impl.jsr168.api;
import org.jboss.portal.portlet.invocation.EventInvocation;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
import javax.portlet.EventRequest;
import javax.portlet.Event;
@@ -40,9 +41,9 @@
/** . */
private EventInvocation eventInvocation;
- public EventRequestImpl(EventInvocation invocation)
+ public EventRequestImpl(PortletContainerImpl container, EventInvocation invocation)
{
- super(invocation);
+ super(container, invocation);
//
this.eventInvocation = invocation;
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -138,9 +138,8 @@
/** . */
private final String contextPath;
- public PortletRequestImpl(PortletInvocation invocation)
+ public PortletRequestImpl(PortletContainerImpl container, PortletInvocation invocation)
{
- PortletContainerImpl container = (PortletContainerImpl)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
int mode = this instanceof RenderRequest ? PortletPreferencesImpl.RENDER : PortletPreferencesImpl.ACTION;
PropertyContext prefs = (PropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PropertyContext.PREFERENCES_ATTRIBUTE);
PreferencesValidator validator = container.getPreferencesValidator();
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.impl.jsr168.api;
import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.common.util.MultiValuedPropertyMap;
@@ -39,9 +40,9 @@
/** . */
private final String validationToken;
- public RenderRequestImpl(RenderInvocation invocation)
+ public RenderRequestImpl(PortletContainerImpl container, RenderInvocation invocation)
{
- super(invocation);
+ super(container, invocation);
//
this.validationToken = invocation.getValidationToken();
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceRequestImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceRequestImpl.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceRequestImpl.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -24,6 +24,7 @@
import org.jboss.portal.portlet.invocation.ResourceInvocation;
import org.jboss.portal.portlet.impl.jsr168.ResourceRequestParameterMap;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
import org.jboss.portal.common.util.MultiValuedPropertyMap;
import org.jboss.portal.common.util.ParameterMap;
@@ -41,9 +42,9 @@
/** . */
private final ResourceInvocation resourceInvocation;
- public ResourceRequestImpl(ResourceInvocation invocation)
+ public ResourceRequestImpl(PortletContainerImpl container, ResourceInvocation invocation)
{
- super(invocation);
+ super(container, invocation);
//
this.resourceInvocation = invocation;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -30,6 +30,9 @@
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.PortletException;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletURL;
import java.io.IOException;
import java.io.PrintWriter;
@@ -40,6 +43,58 @@
public class AdminPortlet extends GenericPortlet
{
+ public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, IOException
+ {
+
+ String lifeCycle = req.getParameter("lifecycle");
+
+ //
+ String applicationId = req.getParameter("application");
+
+ //
+ if (applicationId != null)
+ {
+ // Use an alias
+ PortletApplicationRegistry registry = (PortletApplicationRegistry)getPortletContext().getAttribute("PortletApplicationDeployer");
+
+ //
+ ManagedPortletApplication application = registry.getManagedPortletApplication(applicationId);
+
+ //
+ String containerId = req.getParameter("container");
+
+ //
+ if (containerId != null)
+ {
+ final ManagedPortletContainer container = application.getManagedPortletContainer(containerId);
+
+ //
+ if ("start".equals(lifeCycle))
+ {
+ try
+ {
+ container.managedStart();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ else if ("stop".equals(lifeCycle))
+ {
+ // Async stop otherwise it is not possible to stop the admin portlet (self deadlock)
+ new Thread()
+ {
+ public void run()
+ {
+ container.managedStop();
+ }
+ }.start();
+ }
+ }
+ }
+ }
+
protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, IOException
{
@@ -52,10 +107,26 @@
for (ManagedPortletApplication application : registry.getManagedPortletApplications())
{
+ PortletURL url = resp.createActionURL();
+ url.setParameter("application", application.getId());
+
+ //
writer.print("<ul><li>Application " + application.getId() + " " + application.getStatus() + "</li><ul>");
+
+ //
for (ManagedPortletContainer container : application.getManagedPortletContainers())
{
- writer.print("<li>Container " + container.getId() + " " + container.getStatus() + "</li>");
+
+ url.setParameter("container", container.getId());
+
+ url.setParameter("lifecycle", "stop");
+ String stopURL = url.toString();
+
+ url.setParameter("lifecycle", "start");
+ String startURL = url.toString();
+
+ writer.print("<li>Container " + container.getId() + " " + container.getStatus() + "<a href=\"" +
+ startURL + "\">Start</a> <a href=\"" + stopURL + "\">Stop</a>" + "</li>");
}
writer.print("</ul></ul>");
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -24,8 +24,15 @@
import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.object.PortletApplicationObject;
import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
+import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
+import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
+import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
import org.jboss.portal.web.WebApp;
import javax.servlet.ServletContext;
@@ -37,32 +44,46 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class KernelPortletApplication extends KernelObject implements PortletApplicationContext, ManagedPortletApplication
+public class KernelPortletApplication extends KernelObject implements PortletApplicationContext, ManagedPortletApplication, PortletApplication
{
/** . */
private final WebApp webApp;
/** . */
- private PortletApplication portletApplication;
+ final PortletApplicationObject portletApplication;
/** . */
private final Map<String, KernelPortletContainer> kernelPortletContainers;
- public KernelPortletApplication(WebApp webApp)
+ public KernelPortletApplication(
+ ContainerPortletApplicationInfo info,
+ PortletApplication10MetaData metaData,
+ JBossApplicationMetaData jbossMetaData,
+ PortletAPIFactory portletAPIFactory,
+ WebApp webApp)
{
this.webApp = webApp;
- this.portletApplication = null;
+ this.portletApplication = new PortletApplicationImpl(info, metaData, jbossMetaData, portletAPIFactory);
this.kernelPortletContainers = new HashMap<String, KernelPortletContainer>();
+
+ //
+ portletApplication.setContext(this);
}
public void addKernelPortletContainer(KernelPortletContainer kernelPortletContainer)
{
kernelPortletContainers.put(kernelPortletContainer.getPortletContainer().getId(), kernelPortletContainer);
+
+ //
+ portletApplication.addContainer(kernelPortletContainer.portletContainer);
}
public void removeKernelPortletContainer(KernelPortletContainer kernelPortletContainer)
{
+ portletApplication.removeContainer(kernelPortletContainer.portletContainer);
+
+ //
kernelPortletContainers.remove(kernelPortletContainer.getPortletContainer().getId());
}
@@ -71,17 +92,14 @@
return portletApplication;
}
- public void setPortletApplication(PortletApplication portletApplication)
- {
- this.portletApplication = portletApplication;
- }
-
public void start() throws Exception
{
+ portletApplication.start();
}
public void stop()
{
+ portletApplication.stop();
}
// PortletApplicationContext ****************************************************************************************
@@ -127,4 +145,21 @@
{
return kernelPortletContainers.get(portletContainerId);
}
+
+ // PortletApplication ***********************************************************************************************
+
+ public Collection<? extends PortletContainer> getPortletContainers()
+ {
+ return kernelPortletContainers.values();
+ }
+
+ public PortletContainer getPortletContainer(String containerId)
+ {
+ return kernelPortletContainers.get(containerId);
+ }
+
+ public PortletApplicationContext getContext()
+ {
+ return this;
+ }
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java 2008-02-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -24,23 +24,39 @@
import org.jboss.portal.portlet.container.PortletContainerContext;
import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.object.PortletContainerObject;
import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
+import org.jboss.portal.common.invocation.InvocationException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class KernelPortletContainer extends KernelObject implements PortletContainerContext, ManagedPortletContainer
+public class KernelPortletContainer extends KernelObject implements PortletContainerContext, ManagedPortletContainer, PortletContainer
{
/** . */
- private PortletContainer portletContainer;
+ final PortletContainerObject portletContainer;
/** . */
private KernelPortletApplication kernelPortletApplication;
+ public KernelPortletContainer(ContainerPortletInfo info)
+ {
+ portletContainer = new PortletContainerImpl(info);
+
+ //
+ portletContainer.setContext(this);
+ }
+
public KernelPortletApplication getKernelPortletApplication()
{
return kernelPortletApplication;
@@ -49,6 +65,16 @@
public void setKernelPortletApplication(KernelPortletApplication kernelPortletApplication)
{
this.kernelPortletApplication = kernelPortletApplication;
+
+ //
+ if (kernelPortletApplication != null)
+ {
+ portletContainer.setApplication(kernelPortletApplication.portletApplication);
+ }
+ else
+ {
+ portletContainer.setApplication(null);
+ }
}
public PortletContainer getPortletContainer()
@@ -56,17 +82,14 @@
return portletContainer;
}
- public void setPortletContainer(PortletContainer portletContainer)
- {
- this.portletContainer = portletContainer;
- }
-
public void start() throws Exception
{
+ portletContainer.start();
}
public void stop()
{
+ portletContainer.stop();
}
//
@@ -88,6 +111,8 @@
return portletContainer.getId();
}
+ //
+
public ManagedPortletApplication getManagedPortletApplication()
{
return kernelPortletApplication;
@@ -97,4 +122,21 @@
{
return portletContainer.getInfo();
}
+
+ // PortletContainer implementation **********************************************************************************
+
+ public PortletInvocationResponse dispatch(PortletInvocation invocation) throws PortletInvokerException, InvocationException
+ {
+ return portletContainer.dispatch(invocation);
+ }
+
+ public PortletApplication getApplication()
+ {
+ return kernelPortletApplication;
+ }
+
+ public PortletContainerContext getContext()
+ {
+ return this;
+ }
}
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-19 21:16:51 UTC (rev 10034)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2008-02-19 22:17:41 UTC (rev 10035)
@@ -44,8 +44,6 @@
import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
import org.jboss.portal.portlet.impl.jsr168.ContainerInfoBuilderContextImpl;
-import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
-import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
@@ -88,13 +86,13 @@
this.installed = new LinkedHashMap<String, KernelControllerContext>();
}
- public AbstractBeanMetaData createKernelPortletContainerMetaData(String kernelPortletContainerId)
+ public AbstractBeanMetaData createKernelPortletContainerMetaData(String kernelPortletContainerId, ContainerPortletInfo portletInfo)
{
AbstractBeanMetaData beanMD = new AbstractBeanMetaData(kernelPortletContainerId, KernelPortletContainer.class.getName());
//
AbstractConstructorMetaData ctorMD = new AbstractConstructorMetaData();
- ctorMD.setParameters(new ArrayList<ParameterMetaData>());
+ ctorMD.setParameters(Tools.toList((ParameterMetaData)new AbstractParameterMetaData(ContainerPortletInfo.class.getName(), portletInfo)));
beanMD.setConstructor(ctorMD);
//
@@ -110,61 +108,18 @@
return beanMD;
}
- public AbstractBeanMetaData createKernelPortletApplicationMetaData(String kernelPortletApplicationId)
+ public AbstractBeanMetaData createKernelPortletApplicationMetaData(ContainerPortletApplicationInfo portletApplicationInfo, String kernelPortletApplicationId)
{
AbstractBeanMetaData beanMD = new AbstractBeanMetaData(kernelPortletApplicationId, KernelPortletApplication.class.getName());
//
AbstractConstructorMetaData ctorMD = new AbstractConstructorMetaData();
- ctorMD.setParameters(Tools.toList((ParameterMetaData)new AbstractParameterMetaData(WebApp.class.getName(), webApp)));
- beanMD.setConstructor(ctorMD);
-
- //
- beanMD.setProperties(new HashSet<PropertyMetaData>());
- beanMD.setInstalls(new ArrayList<InstallMetaData>());
- beanMD.setUninstalls(new ArrayList<InstallMetaData>());
-
- //
- beanMD.setStart(new AbstractLifecycleMetaData("start"));
- beanMD.setStop(new AbstractLifecycleMetaData("stop"));
-
- //
- return beanMD;
- }
-
- public AbstractBeanMetaData createPortletContainerMetaData(String portletContainerId, ContainerPortletInfo portletInfo)
- {
- AbstractBeanMetaData beanMD = new AbstractBeanMetaData(portletContainerId, PortletContainerImpl.class.getName());
-
- //
- AbstractConstructorMetaData ctorMD = new AbstractConstructorMetaData();
- ctorMD.setParameters(Tools.toList((ParameterMetaData)new AbstractParameterMetaData(ContainerPortletInfo.class.getName(), portletInfo)));
- beanMD.setConstructor(ctorMD);
-
- //
- beanMD.setProperties(new HashSet<PropertyMetaData>());
- beanMD.setInstalls(new ArrayList<InstallMetaData>());
- beanMD.setUninstalls(new ArrayList<InstallMetaData>());
-
- //
- beanMD.setStart(new AbstractLifecycleMetaData("start"));
- beanMD.setStop(new AbstractLifecycleMetaData("stop"));
-
- //
- return beanMD;
- }
-
- public AbstractBeanMetaData createPortletApplicationMetaData(ContainerPortletApplicationInfo portletApplicationInfo, String portletApplicationId)
- {
- AbstractBeanMetaData beanMD = new AbstractBeanMetaData(portletApplicationId, PortletApplicationImpl.class.getName());
-
- //
- AbstractConstructorMetaData ctorMD = new AbstractConstructorMetaData();
ctorMD.setParameters(Tools.toList(
(ParameterMetaData)new AbstractParameterMetaData(ContainerPortletApplicationInfo.class.getName(), portletApplicationInfo),
new AbstractParameterMetaData(PortletApplication10MetaData.class.getName(), metaData),
new AbstractParameterMetaData(JBossApplicationMetaData.class.getName(), (Object)null),
- new AbstractParameterMetaData(PortletAPIFactory.class.getName(), new AbstractDependencyValueMetaData("PortletAPIFactory"))));
+ new AbstractParameterMetaData(PortletAPIFactory.class.getName(), new AbstractDependencyValueMetaData("PortletAPIFactory")),
+ new AbstractParameterMetaData(WebApp.class.getName(), webApp)));
beanMD.setConstructor(ctorMD);
//
@@ -189,12 +144,9 @@
KernelController controller = kernel.getController();
//
- String portletApplicationId = "PortletApplication[" + webApp.getContextPath() + "]";
+ String kernelPortletApplicationId = "PortletApplication[" + webApp.getContextPath() + "]";
//
- String kernelPortletApplicationId = "KernelPortletApplication[" + webApp.getContextPath() + "]";
-
- //
ContainerInfoBuilderContext builderContext = new ContainerInfoBuilderContextImpl(metaData, webApp);
ContainerInfoBuilder builder = new ContainerInfoBuilder(metaData, builderContext);
builder.build();
@@ -206,44 +158,11 @@
for (ContainerPortletInfo containerInfo : builder.getPortlets())
{
//
- String portletContainerId = "PortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
- String kernelPortletContainerId = "KernelPortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
+ String kernelPortletContainerId = "PortletContainer[" + webApp.getContextPath() + "," + containerInfo.getName() + "]";
//
- AbstractBeanMetaData portletContainerMD = createPortletContainerMetaData(portletContainerId, containerInfo);
- AbstractBeanMetaData kernelPortletContainerMD = createKernelPortletContainerMetaData(kernelPortletContainerId);
+ AbstractBeanMetaData kernelPortletContainerMD = createKernelPortletContainerMetaData(kernelPortletContainerId, containerInfo);
- //
- AbstractDependencyValueMetaData portletContainerContextDependencyMD = new AbstractDependencyValueMetaData(kernelPortletContainerId);
- portletContainerContextDependencyMD.setDependentState(ControllerState.INSTANTIATED);
- portletContainerMD.getProperties().add(new AbstractPropertyMetaData("context", portletContainerContextDependencyMD));
-
- //
- AbstractDependencyValueMetaData portletContainerDependencyMD = new AbstractDependencyValueMetaData(portletContainerId);
- portletContainerDependencyMD.setDependentState(ControllerState.START);
- kernelPortletContainerMD.getProperties().add(new AbstractPropertyMetaData("portletContainer", portletContainerDependencyMD));
-
- //
- AbstractDependencyValueMetaData portletApplicationDependencyMD = new AbstractDependencyValueMetaData(portletApplicationId);
- portletApplicationDependencyMD.setDependentState(ControllerState.START);
- portletContainerMD.getProperties().add(new AbstractPropertyMetaData("application", portletApplicationDependencyMD));
-
- // Install the portlet container on the portlet application
- AbstractInstallMetaData installPortletContainerMD = new AbstractInstallMetaData();
- installPortletContainerMD.setBean(portletApplicationId);
- installPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
- installPortletContainerMD.setMethodName("addContainer");
- installPortletContainerMD.setDependentState(ControllerState.START);
- portletContainerMD.getInstalls().add(installPortletContainerMD);
-
- // Uninstall the portlet container from the portlet application
- AbstractInstallMetaData uninstallPortletContainerMD = new AbstractInstallMetaData();
- uninstallPortletContainerMD.setBean(portletApplicationId);
- uninstallPortletContainerMD.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(new ThisValueMetaData())));
- uninstallPortletContainerMD.setMethodName("removeContainer");
- uninstallPortletContainerMD.setDependentState(ControllerState.START);
- kernelPortletContainerMD.getUninstalls().add(uninstallPortletContainerMD);
-
// Inject the kernel portlet application in the kernel portlet container
AbstractDependencyValueMetaData kernelPortletApplicationDependencyMD = new AbstractDependencyValueMetaData(kernelPortletApplicationId);
kernelPortletApplicationDependencyMD.setDependentState(ControllerState.START);
@@ -266,26 +185,13 @@
kernelPortletContainerMD.getUninstalls().add(uninstallKernelPortletContainerMD);
//
- toInstall.add(portletContainerMD);
toInstall.add(kernelPortletContainerMD);
}
//
- AbstractBeanMetaData portletApplicationMD = createPortletApplicationMetaData(builder.getApplication(), portletApplicationId);
- AbstractBeanMetaData kernelPortletApplicationMD = createKernelPortletApplicationMetaData(kernelPortletApplicationId);
+ AbstractBeanMetaData kernelPortletApplicationMD = createKernelPortletApplicationMetaData(builder.getApplication(), kernelPortletApplicationId);
//
- AbstractDependencyValueMetaData portletApplicationContextDependencyMD = new AbstractDependencyValueMetaData(kernelPortletApplicationId);
- portletApplicationContextDependencyMD.setDependentState(ControllerState.INSTANTIATED);
- portletApplicationMD.getProperties().add(new AbstractPropertyMetaData("context", portletApplicationContextDependencyMD));
-
- //
- AbstractDependencyValueMetaData portletApplicationDependencyMD = new AbstractDependencyValueMetaData(portletApplicationId);
- portletApplicationDependencyMD.setDependentState(ControllerState.START);
- kernelPortletApplicationMD.getProperties().add(new AbstractPropertyMetaData("portletApplication", portletApplicationDependencyMD));
-
- //
- toInstall.add(portletApplicationMD);
toInstall.add(kernelPortletApplicationMD);
// Install beans
@@ -356,10 +262,6 @@
//
log.debug("Uninstalled");
-
- //
-// portletApplicationControllerContext = null;
-// portletContainerControllerContexts = null;
}
private void logBeanFailure(KernelControllerContext context)
16 years, 7 months
JBoss Portal SVN: r10034 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/container/managed and 7 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-19 16:16:51 -0500 (Tue, 19 Feb 2008)
New Revision: 10034
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedObject.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedObjectStatus.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/admin/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/admin/ui/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelObject.java
modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portlet.xml
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/admin.jsp
Modified:
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java
modules/portlet/trunk/test/src/test/build.xml
Log:
- start to build small UI for displaying managed container object status, need to add life cycle change
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-02-19 18:37:25 UTC (rev 10033)
+++ modules/portlet/trunk/build/pom.xml 2008-02-19 21:16:51 UTC (rev 10034)
@@ -39,7 +39,7 @@
<version.javassist>3.6-beta</version.javassist>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
<version.jboss.portal.common>1.2.0-Beta1</version.jboss.portal.common>
- <version.jboss.portal.web>1.2.0-Beta1</version.jboss.portal.web>
+ <version.jboss.portal.web>1.2.0-SNAPSHOT</version.jboss.portal.web>
<version.jboss.unit>1.2.0-Beta1</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedObject.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedObject.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedObject.java 2008-02-19 21:16:51 UTC (rev 10034)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.container.managed;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface ManagedObject
+{
+
+ ManagedObjectStatus getStatus();
+
+ void managedStart() throws Exception;
+
+ void managedStop();
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedObjectStatus.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedObjectStatus.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedObjectStatus.java 2008-02-19 21:16:51 UTC (rev 10034)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.container.managed;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public enum ManagedObjectStatus
+{
+
+ STOPPED, STARTED, FAILED
+
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java 2008-02-19 18:37:25 UTC (rev 10033)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletApplication.java 2008-02-19 21:16:51 UTC (rev 10034)
@@ -28,17 +28,14 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public interface ManagedPortletApplication
+public interface ManagedPortletApplication extends ManagedObject
{
String getId();
- void managedStart() throws Exception;
-
- void managedStop();
-
Collection<? extends ManagedPortletContainer> getManagedPortletContainers();
ManagedPortletContainer getManagedPortletContainer(String portletContainerId);
+
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java 2008-02-19 18:37:25 UTC (rev 10033)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/managed/ManagedPortletContainer.java 2008-02-19 21:16:51 UTC (rev 10034)
@@ -28,7 +28,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public interface ManagedPortletContainer
+public interface ManagedPortletContainer extends ManagedObject
{
String getId();
@@ -37,8 +37,4 @@
ManagedPortletApplication getManagedPortletApplication();
- void managedStart() throws Exception;
-
- void managedStop();
-
}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/admin/ui/AdminPortlet.java 2008-02-19 21:16:51 UTC (rev 10034)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.portal.admin.ui;
+
+import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
+import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
+import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AdminPortlet extends GenericPortlet
+{
+
+ protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, IOException
+ {
+
+ resp.setContentType("text/html");
+
+ PrintWriter writer = resp.getWriter();
+
+ // Use an alias
+ PortletApplicationRegistry registry = (PortletApplicationRegistry)getPortletContext().getAttribute("PortletApplicationDeployer");
+
+ for (ManagedPortletApplication application : registry.getManagedPortletApplications())
+ {
+ writer.print("<ul><li>Application " + application.getId() + " " + application.getStatus() + "</li><ul>");
+ for (ManagedPortletContainer container : application.getManagedPortletContainers())
+ {
+ writer.print("<li>Container " + container.getId() + " " + container.getStatus() + "</li>");
+ }
+ writer.print("</ul></ul>");
+ }
+
+ writer.close();
+
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelObject.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelObject.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelObject.java 2008-02-19 21:16:51 UTC (rev 10034)
@@ -0,0 +1,125 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.test;
+
+import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.portal.portlet.container.managed.ManagedObject;
+import org.jboss.portal.portlet.container.managed.ManagedObjectStatus;
+
+import java.lang.reflect.UndeclaredThrowableException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class KernelObject implements ManagedObject, KernelControllerContextAware
+{
+
+ /** . */
+ private KernelControllerContext controllerContext;
+
+ public final void setKernelControllerContext(KernelControllerContext controllerContext) throws Exception
+ {
+ this.controllerContext = controllerContext;
+ }
+
+ public final void unsetKernelControllerContext(KernelControllerContext controllerContext) throws Exception
+ {
+ this.controllerContext = null;
+ }
+
+ public final ManagedObjectStatus getStatus()
+ {
+ ControllerState state = controllerContext.getState();
+
+ //
+ if (state == ControllerState.INSTALLED)
+ {
+ return ManagedObjectStatus.STARTED;
+ }
+ else if (state == ControllerState.ERROR)
+ {
+ return ManagedObjectStatus.FAILED;
+ }
+ else
+ {
+ return ManagedObjectStatus.STOPPED;
+ }
+ }
+
+ public final void managedStart() throws Exception
+ {
+ controllerStart();
+ }
+
+ public final void managedStop()
+ {
+ controllerStop();
+ }
+
+ protected final void controllerStart() throws Exception
+ {
+ if (controllerContext == null)
+ {
+ throw new IllegalStateException("No under the controller of the kernel");
+ }
+
+ //
+ try
+ {
+ controllerContext.getController().change(controllerContext, ControllerState.INSTALLED);
+ }
+ catch (Throwable throwable)
+ {
+ if (throwable instanceof Exception)
+ {
+ throw ((Exception)throwable);
+ }
+ if (throwable instanceof Error)
+ {
+ throw ((Error)throwable);
+ }
+ throw new UndeclaredThrowableException(throwable);
+ }
+ }
+
+ protected final void controllerStop()
+ {
+ if (controllerContext == null)
+ {
+ throw new IllegalStateException("No under the controller of the kernel");
+ }
+
+ //
+ try
+ {
+ controllerContext.getController().change(controllerContext, ControllerState.CREATE);
+ }
+ catch (Throwable throwable)
+ {
+ throwable.printStackTrace();
+ }
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java 2008-02-19 18:37:25 UTC (rev 10033)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletApplication.java 2008-02-19 21:16:51 UTC (rev 10034)
@@ -27,7 +27,6 @@
import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.web.WebApp;
-import org.jboss.portal.common.NotYetImplemented;
import javax.servlet.ServletContext;
import java.util.Map;
@@ -38,7 +37,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class KernelPortletApplication implements PortletApplicationContext, ManagedPortletApplication
+public class KernelPortletApplication extends KernelObject implements PortletApplicationContext, ManagedPortletApplication
{
/** . */
@@ -104,12 +103,12 @@
public void invokeStart() throws Exception
{
- throw new NotYetImplemented();
+ controllerStart();
}
public void invokeStop()
{
- throw new NotYetImplemented();
+ controllerStop();
}
//
@@ -119,16 +118,6 @@
return portletApplication.getId();
}
- public void managedStart() throws Exception
- {
- throw new NotYetImplemented();
- }
-
- public void managedStop()
- {
- throw new NotYetImplemented();
- }
-
public Collection<? extends ManagedPortletContainer> getManagedPortletContainers()
{
return kernelPortletContainers.values();
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java 2008-02-19 18:37:25 UTC (rev 10033)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/KernelPortletContainer.java 2008-02-19 21:16:51 UTC (rev 10034)
@@ -27,13 +27,12 @@
import org.jboss.portal.portlet.container.managed.ManagedPortletContainer;
import org.jboss.portal.portlet.container.managed.ManagedPortletApplication;
import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.common.NotYetImplemented;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class KernelPortletContainer implements PortletContainerContext, ManagedPortletContainer
+public class KernelPortletContainer extends KernelObject implements PortletContainerContext, ManagedPortletContainer
{
/** . */
@@ -74,12 +73,12 @@
public void invokeStart() throws Exception
{
- throw new NotYetImplemented();
+ controllerStart();
}
public void invokeStop()
{
- throw new NotYetImplemented();
+ controllerStop();
}
//
@@ -98,14 +97,4 @@
{
return portletContainer.getInfo();
}
-
- public void managedStart() throws Exception
- {
- throw new NotYetImplemented();
- }
-
- public void managedStop()
- {
- throw new NotYetImplemented();
- }
}
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-02-19 18:37:25 UTC (rev 10033)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-02-19 21:16:51 UTC (rev 10034)
@@ -721,7 +721,7 @@
<jar jarfile="${target}/portlet-test-lib.jar">
- <fileset dir="${target}/classes" excludes="org/jboss/portal/portlet/portal/**,org/jboss/portal/simple/**"/>
+ <fileset dir="${target}/classes" excludes="org/jboss/portal/portlet/portal/samples/**"/>
</jar>
<copy todir="${test.temp.dir}/simple-portal-war">
Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portlet.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portlet.xml (rev 0)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portlet.xml 2008-02-19 21:16:51 UTC (rev 10034)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2008, 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>
+ <description>Administration Portlet</description>
+ <portlet-name>AdminPortlet</portlet-name>
+ <display-name>Admin Portlet</display-name>
+ <portlet-class>org.jboss.portal.portlet.portal.admin.ui.AdminPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Admin Portlet</title>
+ <keywords>admin</keywords>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
+
Added: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/admin.jsp
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/admin.jsp (rev 0)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/admin.jsp 2008-02-19 21:16:51 UTC (rev 10034)
@@ -0,0 +1,14 @@
+<%@ page contentType="text/html" %>
+<%@ page language="java" %>
+<%@ taglib prefix="jbp" tagdir="/WEB-INF/tags/portal" %>
+<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
+<%@ page isELIgnored="false" %>
+
+<%@ include file="/layouts/header.jsp" %>
+
+<portal:page>
+
+ <jbp:portlet name="AdminPortlet" applicationName="simple-portal"/>
+
+</portal:page>
+<%@ include file="/layouts/footer.jsp" %>
\ No newline at end of file
16 years, 7 months