JBoss Portal SVN: r10133 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-27 01:45:24 -0500 (Wed, 27 Feb 2008)
New Revision: 10133
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
6.1.3. The JBoss Portal Object DTD
minor revisions...
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-27 05:51:19 UTC (rev 10132)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-27 06:45:24 UTC (rev 10133)
@@ -86,7 +86,7 @@
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 <computeroutput>false</computeroutput>. 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.
+ You can configure specific settings of 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>
@@ -96,7 +96,7 @@
</screen></term>
<listitem>
<para>
- Additional configuration for the 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.
+ Additional configuration of the 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 <computeroutput>false</computeroutput>.
@@ -613,7 +613,7 @@
</screen></term>
<listitem>
<para>
- The context type of the portal object. A context type represent a node in a tree, which does not have a visual representation, and only exists under root. A context can only have children with the <emphasis>portal</emphasis> type.
+ The context type of the portal object. A context type represent a node in a tree, which does not have a visual representation, and only exists under the root. A context can only have children that use the <emphasis>portal</emphasis> type.
</para>
<para>
<screen><![CDATA[
@@ -621,7 +621,7 @@
</screen>
</para>
<para>
- The context name value.
+ The context name.
</para>
</listitem>
</varlistentry>
@@ -631,7 +631,7 @@
</screen></term>
<listitem>
<para>
- A portal object with the type <emphasis>portal</emphasis>. A portal type represents a virtual portal, and can only have children that use the type <emphasis>page</emphasis>. In addition to the common portal object elements, it also supports the declaration of the modes and the window states that it supports. If there are no declarations of modes or window states, the default value will be <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, <computeroutput>help</computeroutput>, and <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, <computeroutput>maximized</computeroutput> respectively.
+ A portal object that uses the <emphasis>portal</emphasis> type. A portal type represents a virtual portal, and can only have children that use the <emphasis>page</emphasis> type. In addition to the common portal object elements, it also allows you to declare modes and window states that are supported.
</para>
<para>
<screen><![CDATA[
@@ -647,10 +647,10 @@
</screen>
</para>
<para>
- The supported modes of the portal. Accepted values are <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, and <computeroutput>help</computeroutput>.
+ The <computeroutput><supported-modes></computeroutput> elements defines the supported modes of the portal. Accepted values are <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, and <computeroutput>help</computeroutput>.
</para>
<para>
- The following is an example of the <computeroutput><supported-mode></computeroutput> element:
+ The following is an example of the <computeroutput><supported-mode></computeroutput> and <computeroutput><mode></computeroutput> elements:
</para>
<para>
<screen><![CDATA[
@@ -668,7 +668,7 @@
</screen></term>
<listitem>
<para>
- The portlet mode value.
+ The portlet mode value. If there are no declarations of modes or window states, the default values will be <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, <computeroutput>help</computeroutput>, and <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, <computeroutput>maximized</computeroutput> respectively.
</para>
</listitem>
</varlistentry>
@@ -677,7 +677,7 @@
</screen></term>
<listitem>
<para>
- Use the <computeroutput><supported-window-states></computeroutput> element to define the supported window states for the portal. Accepted values are <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, and <computeroutput>maximized</computeroutput>. The following is an example of the <computeroutput><supported-window-states></computeroutput> and <computeroutput><window-state></computeroutput> elements:
+ Use the <computeroutput><supported-window-states></computeroutput> element to define the supported window states of the portal. The following is an example of the <computeroutput><supported-window-states></computeroutput> and <computeroutput><window-state></computeroutput> elements:
</para>
<para>
<screen><![CDATA[
@@ -694,7 +694,7 @@
</screen>
</para>
<para>
- Use the <computeroutput><window-state></computeroutput> element to define a window state.
+ Use the <computeroutput><window-state></computeroutput> element to define a window states. Accepted values are <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, and <computeroutput>maximized</computeroutput>.
</para>
</listitem>
</varlistentry>
@@ -704,7 +704,7 @@
</screen></term>
<listitem>
<para>
- A portal object with the type <emphasis>page</emphasis>. A page type represents a page, and can only have children that use the type <emphasis>page</emphasis> and <emphasis>window</emphasis>. The children windows are the windows of the page, and the children pages are the subpages of this page.
+ A portal object with the type <emphasis>page</emphasis>. A page type represents a page, and can only have children that use the types <emphasis>page</emphasis> and <emphasis>window</emphasis>. The children windows are the windows of the page, and the children pages are the subpages of this page.
</para>
<para>
<screen><![CDATA[
@@ -712,7 +712,7 @@
</screen>
</para>
<para>
- The page name value.
+ The page name.
</para>
</listitem>
</varlistentry>
@@ -722,15 +722,12 @@
</screen></term>
<listitem>
<para>
- A portal object with the type <emphasis>window</emphasis>. A window type represents a window. Beside the common properties, a window has content and belongs to a region on the page.
+ A portal object with the type <emphasis>window</emphasis>. A window type represents a window. Besides the common properties, a window has content and belongs to a region on the page.
</para>
<para>
- The <computeroutput><instance-ref></computeroutput> and <computeroutput><content></computeroutput> elements are used to define the content of the window. The <computeroutput><content></computeroutput> element is generic, and is used to describe any kind of content. The <computeroutput><instance-ref></computeroutput> element is a shortcut to define the content-type of portlet which points to a portlet instance.
+ The <computeroutput><instance-ref></computeroutput> and <computeroutput><content></computeroutput> elements are used to define the content of the window. The <computeroutput><content></computeroutput> element is generic, and is used to describe any kind of content. The <computeroutput><instance-ref></computeroutput> element is a shortcut to define the content-type of the portlet, which points to a portlet instance. The <computeroutput><instance-ref></computeroutput> value must much an <computeroutput><instance-id></computeroutput> value in the <filename>WEB-INF/portlet-instances.xml</filename> file.
</para>
<para>
- The region and height defines how the window is placed in the page.
- </para>
- <para>
<screen><![CDATA[
<!ELEMENT window-name (#PCDATA)>]]>
</screen>
16 years, 2 months
JBoss Portal SVN: r10132 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-27 00:51:19 -0500 (Wed, 27 Feb 2008)
New Revision: 10132
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
6.1.3. The JBoss Portal Object DTD
minor revisions/periodic backup
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-27 04:03:42 UTC (rev 10131)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-27 05:51:19 UTC (rev 10132)
@@ -528,7 +528,7 @@
</screen></term>
<listitem>
<para>
- The <computeroutput><deployment></computeroutput> element is a generic container for portal object elements. The <computeroutput><parent-ref></computeroutput> child element gives the name of the parent object that the current object will use as parent. The optional <computeroutput><if-exists></computeroutput> element defines the behavior when a portal object with an identical name is already a child of the parent element. The default behavior of the <computeroutput><if-exists></computeroutput> element is to keep the existing object, and not to create a new object. The last element is the portal object itself.
+ The <computeroutput><deployment></computeroutput> element is a generic container for portal object elements. The <computeroutput><parent-ref></computeroutput> child element gives the name of the parent object that the current object will use as parent. The optional <computeroutput><if-exists></computeroutput> element is used to define the action to take if an instance with the same name already exists. The default behavior of the <computeroutput><if-exists></computeroutput> element is to keep the existing object, and not to create a new object.
</para>
<para>
The following is an example of the <computeroutput><deployment></computeroutput> and <computeroutput><parent-ref></computeroutput> elements:
@@ -555,12 +555,12 @@
</listitem>
<listitem>
<para>
- properties: a set of generic properties owned by the portal object. Certain properties drive the behavior of the object.
+ properties: a set of generic properties owned by the portal object. Certain properties drive the behavior of the portal object.
</para>
</listitem>
<listitem>
<para>
- security-constraint: defines the security configuration of the portal object.
+ security-constraint: defines the security configuration for the portal object.
</para>
</listitem>
</itemizedlist>
@@ -571,7 +571,7 @@
</screen>
</para>
<para>
- Contains a reference to the parent object. The naming convention for naming object is to concatenate the names of the path to the object, and separate the names by a period. If the path is empty, then the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet should appear.
+ The <computeroutput><parent-ref></computeroutput> element contains a reference to the parent object. The naming convention for naming objects is to concatenate the names of the path to the object, and separate the names by a period. If the path is empty, then the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet should appear. The syntax for the <computeroutput><parent-ref></computeroutput> element is <computeroutput><replaceable>portal-instance</replaceable>.<replaceable>portal-page</replaceable></computeroutput>.
</para>
<para>
The following is an example of the root having an empty path:
@@ -613,7 +613,7 @@
</screen></term>
<listitem>
<para>
- The context type of a portal object. A context type represent a node in a tree, which does not have a visual representation. It only exists under root. A context can only have children with the portal type.
+ The context type of the portal object. A context type represent a node in a tree, which does not have a visual representation, and only exists under root. A context can only have children with the <emphasis>portal</emphasis> type.
</para>
<para>
<screen><![CDATA[
@@ -677,7 +677,7 @@
</screen></term>
<listitem>
<para>
- Use the <computeroutput><supported-window-states></computeroutput> element to define the supported window states for the portal. Accepted values are <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, and <computeroutput>maximized</computeroutput>. The following is an example of the <computeroutput><supported-window-states></computeroutput> element:
+ Use the <computeroutput><supported-window-states></computeroutput> element to define the supported window states for the portal. Accepted values are <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, and <computeroutput>maximized</computeroutput>. The following is an example of the <computeroutput><supported-window-states></computeroutput> and <computeroutput><window-state></computeroutput> elements:
</para>
<para>
<screen><![CDATA[
@@ -704,7 +704,7 @@
</screen></term>
<listitem>
<para>
- A portal object with the type <emphasis>page</emphasis>. A page type represents a page, and can only have children that use the type <emphasis>page</emphasis> and <emphasis>window</emphasis>. The children windows are the windows of the page, and the children pages are the sub-pages of this page.
+ A portal object with the type <emphasis>page</emphasis>. A page type represents a page, and can only have children that use the type <emphasis>page</emphasis> and <emphasis>window</emphasis>. The children windows are the windows of the page, and the children pages are the subpages of this page.
</para>
<para>
<screen><![CDATA[
@@ -744,7 +744,7 @@
</screen>
</para>
<para>
- Define the content of the window as a reference to a portlet instance. The value is the id of the instance.
+ Define the content of the window as a reference to a portlet instance. The value is the ID of the instance.
</para>
<para>
The following is an example of the <computeroutput><instance-ref></computeroutput> element:
16 years, 2 months
JBoss Portal SVN: r10131 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-26 23:03:42 -0500 (Tue, 26 Feb 2008)
New Revision: 10131
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
- revising 6.1.3. The JBoss Portal Object DTD
- 5. Portlet Primer making modes consistent,
eg s/VIEW/view
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-27 02:01:47 UTC (rev 10130)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-27 04:03:42 UTC (rev 10131)
@@ -47,17 +47,17 @@
<itemizedlist>
<listitem>
<para>
- VIEW - generates markup reflecting the current state of the portlet.
+ <computeroutput>view</computeroutput> - generates markup reflecting the current state of the portlet.
</para>
</listitem>
<listitem>
<para>
- EDIT - allows a user to customize the behavior of the portlet.
+ <computeroutput>edit</computeroutput> - allows a user to customize the behavior of the portlet.
</para>
</listitem>
<listitem>
<para>
- HELP - provides information to the user as to how to use the portlet.
+ <computeroutput>help</computeroutput> - provides information to the user as to how to use the portlet.
</para>
</listitem>
</itemizedlist>
@@ -73,17 +73,17 @@
<itemizedlist>
<listitem>
<para>
- NORMAL - a portlet shares this page with other portlets.
+ <computeroutput>normal</computeroutput> - a portlet shares this page with other portlets.
</para>
</listitem>
<listitem>
<para>
- MINIMIZED -a portlet may show very little information, or none at all.
+ <computeroutput>minimized</computeroutput> -a portlet may show very little information, or none at all.
</para>
</listitem>
<listitem>
<para>
- MAXIMIZED - a portlet may be the only portlet displayed on this page.
+ <computeroutput>maximized</computeroutput> - a portlet may be the only portlet displayed on this page.
</para>
</listitem>
</itemizedlist>
@@ -215,7 +215,7 @@
throws PortletException, IOException, UnavailableException</screen></term>
<listitem>
<para>
- As we extend from <literal>GenericPortlet</literal>, and are only interested in supporting the <literal>VIEW</literal> mode, only the <literal>doView</literal> method needs to be implemented, and the <literal>GenericPortlet</literal> <literal>render</literal> implemention calls our implementation when the <literal>VIEW</literal> mode is requested.
+ As we extend from <literal>GenericPortlet</literal>, and are only interested in supporting the <literal>view</literal> mode, only the <literal>doView</literal> method needs to be implemented, and the <literal>GenericPortlet</literal> <literal>render</literal> implemention calls our implementation when the <literal>view</literal> mode is requested.
</para>
</listitem>
</varlistentry>
@@ -282,7 +282,7 @@
<portlet-class>org.jboss.portlet.hello.HelloWorldPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
<title>HelloWorld Portlet</title>
@@ -312,12 +312,12 @@
<varlistentry><term><screen><![CDATA[
<supports>
<mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>view</portlet-mode>
</supports>]]></screen></term>
<listitem>
<para>
The <computeroutput><supports></computeroutput> element allows you to declare all of the markup types that your portlet supports in the <literal>render</literal> method. This is accomplished via the
- <computeroutput><mime-type></computeroutput> element, which is required for every portlet. The declared MIME types must match the capability of the portlet. As well, it allows you to pair which modes and window states are supported for each markup type. All portlets must support the VIEW portlet mode, so this does not have to be declared. Use the <computeroutput><mime-type></computeroutput> element to define which markup type your portlet supports, which in this example, is <computeroutput>text/html</computeroutput>. This section tells the portal that it will only output text and HTML, and that it only supports the <computeroutput>VIEW</computeroutput> mode.
+ <computeroutput><mime-type></computeroutput> element, which is required for every portlet. The declared MIME types must match the capability of the portlet. As well, it allows you to pair which modes and window states are supported for each markup type. All portlets must support the <computeroutput>view</computeroutput> portlet mode, so this does not have to be declared. Use the <computeroutput><mime-type></computeroutput> element to define which markup type your portlet supports, which in this example, is <computeroutput>text/html</computeroutput>. This section tells the portal that it will only output text and HTML, and that it only supports the <computeroutput>view</computeroutput> mode.
</para>
</listitem>
</varlistentry>
@@ -475,7 +475,7 @@
</para>
<para>
- JBoss Portal 2.6 introduces the notion of <emphasis>content type</emphasis>, which is a generic mechanism to
+ JBoss Portal 2.6 introduces the notion of <emphasis>content-type</emphasis>, which is a generic mechanism to
specify what content will be displayed by a given portlet window. The <computeroutput>window</computeroutput> section
of the previous example, <filename>HelloWorldPortlet/WEB-INF/helloworld-object.xml</filename>, can be re-written to take advantage of the new content framework. The following is an example deployment descriptor that uses the new content framework:
</para>
@@ -1052,7 +1052,7 @@
</init-param>
<supports>
<mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
<title>HelloWorld JSF Portlet</title>
@@ -1087,12 +1087,12 @@
<varlistentry><term><screen><![CDATA[
<supports>
<mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>view</portlet-mode>
</supports>]]></screen></term>
<listitem>
<para>
The <computeroutput><supports></computeroutput> element allows you to declare all of the markup types that your portlet supports in the <literal>render</literal> method. This is accomplished via the
- <computeroutput><mime-type></computeroutput> element, which is required for every portlet. The declared MIME types must match the capability of the portlet. As well, it allows you to pair which modes and window states are supported for each markup type. All portlets must support the VIEW portlet mode, so this does not have to be declared. Use the <computeroutput><mime-type></computeroutput> element to define which markup type your portlet supports, which in this example, is <computeroutput>text/html</computeroutput>. This section tells the portal that it will only output text and HTML, and that it only supports the <computeroutput>VIEW</computeroutput> mode.
+ <computeroutput><mime-type></computeroutput> element, which is required for every portlet. The declared MIME types must match the capability of the portlet. As well, it allows you to pair which modes and window states are supported for each markup type. All portlets must support the <computeroutput>view</computeroutput> portlet mode, so this does not have to be declared. Use the <computeroutput><mime-type></computeroutput> element to define which markup type your portlet supports, which in this example, is <computeroutput>text/html</computeroutput>. This section tells the portal that it will only output text and HTML, and that it only supports the <computeroutput>view</computeroutput> mode.
</para>
</listitem>
</varlistentry>
@@ -1374,7 +1374,7 @@
</init-param>
<supports>
<mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
<title>HelloWorld JSF Portlet</title>
@@ -1409,12 +1409,12 @@
<varlistentry><term><screen><![CDATA[
<supports>
<mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>view</portlet-mode>
</supports>]]></screen></term>
<listitem>
<para>
The <computeroutput><supports></computeroutput> element allows you to declare all of the markup types that your portlet supports in the <literal>render</literal> method. This is accomplished via the
- <computeroutput><mime-type></computeroutput> element, which is required for every portlet. The declared MIME types must match the capability of the portlet. As well, it allows you to pair which modes and window states are supported for each markup type. All portlets must support the VIEW portlet mode, so this does not have to be declared. Use the <computeroutput><mime-type></computeroutput> element to define which markup type your portlet supports, which in this example, is <computeroutput>text/html</computeroutput>. This section tells the portal that it will only output text and HTML, and that it only supports the <computeroutput>VIEW</computeroutput> mode.
+ <computeroutput><mime-type></computeroutput> element, which is required for every portlet. The declared MIME types must match the capability of the portlet. As well, it allows you to pair which modes and window states are supported for each markup type. All portlets must support the <computeroutput>view</computeroutput> portlet mode, so this does not have to be declared. Use the <computeroutput><mime-type></computeroutput> element to define which markup type your portlet supports, which in this example, is <computeroutput>text/html</computeroutput>. This section tells the portal that it will only output text and HTML, and that it only supports the <computeroutput>view</computeroutput> mode.
</para>
</listitem>
</varlistentry>
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-27 02:01:47 UTC (rev 10130)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-27 04:03:42 UTC (rev 10131)
@@ -528,7 +528,7 @@
</screen></term>
<listitem>
<para>
- The <computeroutput><deployment></computeroutput> element is a generic container for portal object elements. The <computeroutput><parent-ref></computeroutput> child gives the name of the parent object that the current object will use as parent. The optional <computeroutput><if-exists></computeroutput> element defines the behavior when a portal object which an identical name is already child of the parent element. The default behavior of the <computeroutput><if-exists></computeroutput> element is to keep the existing object and not create a new object. The last element is the portal object itself.
+ The <computeroutput><deployment></computeroutput> element is a generic container for portal object elements. The <computeroutput><parent-ref></computeroutput> child element gives the name of the parent object that the current object will use as parent. The optional <computeroutput><if-exists></computeroutput> element defines the behavior when a portal object with an identical name is already a child of the parent element. The default behavior of the <computeroutput><if-exists></computeroutput> element is to keep the existing object, and not to create a new object. The last element is the portal object itself.
</para>
<para>
The following is an example of the <computeroutput><deployment></computeroutput> and <computeroutput><parent-ref></computeroutput> elements:
@@ -550,15 +550,17 @@
<itemizedlist>
<listitem>
<para>
- a listener: specifies the id of a listener is the listener registry. A listener object is able to listen portal events which apply to the portal node hierarchy.
+ a listener: specifies the ID of a listener in the listener registry. A listener object is able to listen to portal events, which apply to the portal node hierarchy.
</para>
</listitem>
<listitem>
- <para> properties : a set of generic properties owned by the portal object. Some properties can drive the behavior of the object.
+ <para>
+ properties: a set of generic properties owned by the portal object. Certain properties drive the behavior of the object.
</para>
</listitem>
<listitem>
- <para> security-constraint : defines security configuration of the portal object.
+ <para>
+ security-constraint: defines the security configuration of the portal object.
</para>
</listitem>
</itemizedlist>
@@ -569,7 +571,7 @@
</screen>
</para>
<para>
- Contains a reference to the parent object. The naming convention for naming object is to concatenate the names of the path to the object and separate the names by a dot. If the path is empty then the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet should appear.
+ Contains a reference to the parent object. The naming convention for naming object is to concatenate the names of the path to the object, and separate the names by a period. If the path is empty, then the empty string must be used. The <computeroutput><parent-ref></computeroutput> element tells the portal where the portlet should appear.
</para>
<para>
The following is an example of the root having an empty path:
@@ -580,7 +582,7 @@
</screen>
</para>
<para>
- The following specifies that the portlet will appear on the <computeroutput>default</computeroutput> page:
+ The following specifies that the portlet will appear in the portal instance named <computeroutput>default</computeroutput>:
</para>
<para>
<screen>
@@ -611,7 +613,7 @@
</screen></term>
<listitem>
<para>
- A portal object of type context. A context type represent a node in the tree which does not have a visual representation. It can exist only under the root. A context can only have children with the portal type.
+ The context type of a portal object. A context type represent a node in a tree, which does not have a visual representation. It only exists under root. A context can only have children with the portal type.
</para>
<para>
<screen><![CDATA[
@@ -628,8 +630,8 @@
security-constraint?,page*, (display-name* | (resource-bundle, supported-locale+)))>]]>
</screen></term>
<listitem>
- <para>
- A portal object of type portal. A portal type represents a virtual portal and can have children of type page. In addition of the common portal object elements it support also the declaration of the modes and the window states it supports. If no declaration of modes or window states is done then the default value will be respectively (view,edit,help) and (normal,minimized,maximized).
+ <para>
+ A portal object with the type <emphasis>portal</emphasis>. A portal type represents a virtual portal, and can only have children that use the type <emphasis>page</emphasis>. In addition to the common portal object elements, it also supports the declaration of the modes and the window states that it supports. If there are no declarations of modes or window states, the default value will be <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, <computeroutput>help</computeroutput>, and <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, <computeroutput>maximized</computeroutput> respectively.
</para>
<para>
<screen><![CDATA[
@@ -637,7 +639,7 @@
</screen>
</para>
<para>
- The portal name value.
+ The portal name.
</para>
<para>
<screen><![CDATA[
@@ -645,7 +647,7 @@
</screen>
</para>
<para>
- The supported modes of a portal.
+ The supported modes of the portal. Accepted values are <computeroutput>view</computeroutput>, <computeroutput>edit</computeroutput>, and <computeroutput>help</computeroutput>.
</para>
<para>
The following is an example of the <computeroutput><supported-mode></computeroutput> element:
@@ -666,7 +668,7 @@
</screen></term>
<listitem>
<para>
- A portlet mode value.
+ The portlet mode value.
</para>
</listitem>
</varlistentry>
@@ -675,7 +677,7 @@
</screen></term>
<listitem>
<para>
- The supported window states of a portal. The following is an example of the <computeroutput><supported-window-states></computeroutput> element:
+ Use the <computeroutput><supported-window-states></computeroutput> element to define the supported window states for the portal. Accepted values are <computeroutput>normal</computeroutput>, <computeroutput>minimized</computeroutput>, and <computeroutput>maximized</computeroutput>. The following is an example of the <computeroutput><supported-window-states></computeroutput> element:
</para>
<para>
<screen><![CDATA[
@@ -692,7 +694,7 @@
</screen>
</para>
<para>
- A window state value.
+ Use the <computeroutput><window-state></computeroutput> element to define a window state.
</para>
</listitem>
</varlistentry>
@@ -702,7 +704,7 @@
</screen></term>
<listitem>
<para>
- A portal object of type page. A page type represents a page which can have children of type page and window. The children windows are the windows of the page and the children pages are the subpages of this page.
+ A portal object with the type <emphasis>page</emphasis>. A page type represents a page, and can only have children that use the type <emphasis>page</emphasis> and <emphasis>window</emphasis>. The children windows are the windows of the page, and the children pages are the sub-pages of this page.
</para>
<para>
<screen><![CDATA[
@@ -720,10 +722,10 @@
</screen></term>
<listitem>
<para>
- A portal object of type window. A window type represents a window. Beside the common properties a window has a content and belong to a region on the page.
+ A portal object with the type <emphasis>window</emphasis>. A window type represents a window. Beside the common properties, a window has content and belongs to a region on the page.
</para>
<para>
- The instance-ref or content tags are used to define the content of the window. The usage of the content tag is generic and can be used to describe any kind of content. The instance-ref is a shortcut to define a content type of portlet which points to a portlet instance.
+ The <computeroutput><instance-ref></computeroutput> and <computeroutput><content></computeroutput> elements are used to define the content of the window. The <computeroutput><content></computeroutput> element is generic, and is used to describe any kind of content. The <computeroutput><instance-ref></computeroutput> element is a shortcut to define the content-type of portlet which points to a portlet instance.
</para>
<para>
The region and height defines how the window is placed in the page.
16 years, 2 months
JBoss Portal SVN: r10130 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-26 21:01:47 -0500 (Tue, 26 Feb 2008)
New Revision: 10130
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
6.1.3. The JBoss Portal Object DTD
revising elements names to make them consistent
with portal-object_2_6.dtd
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-27 01:49:30 UTC (rev 10129)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-02-27 02:01:47 UTC (rev 10130)
@@ -524,7 +524,7 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-<!ELEMENT deployment (parent-ref,if-exists?,(context | portal | page | window))>]]>
+<!ELEMENT deployment (parent-ref?,if-exists?,(context|portal|page|window))>]]>
</screen></term>
<listitem>
<para>
@@ -606,7 +606,8 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*)>]]>
+<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*,
+(display-name* | (resource-bundle, supported-locale+)))>]]>
</screen></term>
<listitem>
<para>
@@ -620,13 +621,14 @@
<para>
The context name value.
</para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,listener?,
+security-constraint?,page*, (display-name* | (resource-bundle, supported-locale+)))>]]>
+</screen></term>
+<listitem>
<para>
-<screen><![CDATA[
-<!ELEMENT portal (portal-name,supported-modes,supported-window-states?,properties?,
-listener?,security-constraint?,page*)>]]>
-</screen>
- </para>
- <para>
A portal object of type portal. A portal type represents a virtual portal and can have children of type page. In addition of the common portal object elements it support also the declaration of the modes and the window states it supports. If no declaration of modes or window states is done then the default value will be respectively (view,edit,help) and (normal,minimized,maximized).
</para>
<para>
@@ -695,7 +697,8 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page | window)*)>]]>
+<!ELEMENT page (page-name,properties?,listener?,security-constraint?,(page | window)*,
+(display-name* | (resource-bundle, supported-locale+)))>]]>
</screen></term>
<listitem>
<para>
@@ -712,7 +715,8 @@
</listitem>
</varlistentry>
<varlistentry><term><screen><![CDATA[
-<!ELEMENT window (window-name,(instance-ref | content),region,height,properties?,listener?)>]]>
+<!ELEMENT window (window-name,(instance-ref|content),region,height,initial-window-state?,
+initial-mode?,properties?,listener?, (display-name* | (resource-bundle, supported-locale+)))>]]>
</screen></term>
<listitem>
<para>
@@ -884,40 +888,37 @@
</screen></term>
<listitem>
<para>
- The <computeroutput><policy-permission></computeroutput> element is used to secure a specific portal page based on a user's role.
+ The <computeroutput><policy-permission></computeroutput> element is used to secure a specific portlet instance based on a user's role.
</para>
<para>
<screen><![CDATA[
<!ELEMENT action-name (#PCDATA)>]]>
</screen>
- </para>
- <para>
- The <computeroutput><role-name></computeroutput> element is used to define a role that this security constraint will apply to.
- </para>
- <para>
- Example>:Access to this portal page is limited to the defined role.
- </para>
- <para>
-<screen>
-<role-name>SOMEROLE</role-name>
-</screen>
- </para>
- <para>
+ </para>
+ <para>
+ The <computeroutput><action-name></computeroutput> element is used to define the access rights given to the role defined. The accepted value is <computeroutput>view</computeroutput>, which allows users to view the page.
+ </para>
+ <para>
<screen><![CDATA[
<!ELEMENT unchecked EMPTY>]]>
</screen>
- </para>
- <para>
- The unchecked element is used to define (if present) that anyone can view this portal page.
- </para>
- <para>
+ </para>
+ <para>
+ If present, the <computeroutput><unchecked></computeroutput> element is used to define that anyone can view this instance.
+ </para>
+ <para>
<screen><![CDATA[
<!ELEMENT role-name (#PCDATA)>]]>
</screen>
- </para>
- <para>
- The action-name element is used to define the access rights given to the role defined. Possible value is: view - Users can view the page.
- </para>
+ </para>
+ <para>
+ The <computeroutput><role-name></computeroutput> element is used to define a role that the security constraint will apply to. The following example only allows users that are part of the <computeroutput>EXAMPLEROLE</computeroutput> role to access this instance:
+ </para>
+ <para>
+<screen><![CDATA[
+<role-name>EXAMPLEROLE</role-name>]]>
+</screen>
+ </para>
</listitem>
</varlistentry>
</variablelist>
16 years, 2 months
JBoss Portal SVN: r10129 - in modules/portlet/trunk: test/src/main/java/org/jboss/portal/portlet/test and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-26 20:49:30 -0500 (Tue, 26 Feb 2008)
New Revision: 10129
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKServlet.java
Log:
- added configuration of the renderer for accomodating portal servlet and TCK servlet
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java 2008-02-27 01:12:26 UTC (rev 10128)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java 2008-02-27 01:49:30 UTC (rev 10129)
@@ -80,7 +80,7 @@
{
protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
{
- assertEquals(PortletRequest.RENDER_PHASE, request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
+ assertEquals(PortletRequest.EVENT_PHASE, request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
}
});
seq.bindAction(1, UTP6.RENDER_JOIN_POINT, new PortletRenderTestAction()
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-27 01:12:26 UTC (rev 10128)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-27 01:49:30 UTC (rev 10129)
@@ -92,9 +92,16 @@
ControllerResponse response = controller.process(context, request);
//
- Renderer renderer = ControllerResponseRendererFactory.getRenderer(response);
+ ControllerResponseRendererFactory rendererFactory = new ControllerResponseRendererFactory(
+ true,
+ true,
+ context.getStateControllerContext(),
+ request.getPageState());
//
+ Renderer renderer = rendererFactory.getRenderer(response);
+
+ //
renderer.render(new RendererContextImpl(context));
}
else
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.java 2008-02-27 01:12:26 UTC (rev 10128)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractMarkupRenderer.java 2008-02-27 01:49:30 UTC (rev 10129)
@@ -24,7 +24,6 @@
package org.jboss.portal.portlet.test.controller;
import org.jboss.portal.common.util.MultiValuedPropertyMap;
-import org.jboss.portal.portlet.controller.PortletControllerContext;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import javax.servlet.http.Cookie;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java 2008-02-27 01:12:26 UTC (rev 10128)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponseRendererFactory.java 2008-02-27 01:49:30 UTC (rev 10129)
@@ -27,10 +27,13 @@
import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
import org.jboss.portal.portlet.controller.response.PortletResponse;
import org.jboss.portal.portlet.controller.response.ResourceResponse;
+import org.jboss.portal.portlet.controller.state.PageNavigationalState;
+import org.jboss.portal.portlet.controller.state.StateControllerContext;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -38,8 +41,33 @@
*/
public class ControllerResponseRendererFactory
{
- public static Renderer getRenderer(ControllerResponse response)
+
+ /** . */
+ private boolean sendNoContentResponseOnEmptyResource;
+
+ /** . */
+ private boolean sendErrorOnProcessActionError;
+
+ /** The page navigational state if there is one in the request. */
+ private PageNavigationalState requestPageState;
+
+ /** . */
+ private StateControllerContext stateControllerContext;
+
+ public ControllerResponseRendererFactory(
+ boolean sendNoContentResponseOnEmptyResource,
+ boolean sendErrorOnProcessActionError,
+ StateControllerContext stateControllerContext,
+ PageNavigationalState requestPageState)
{
+ this.sendNoContentResponseOnEmptyResource = sendNoContentResponseOnEmptyResource;
+ this.sendErrorOnProcessActionError = sendErrorOnProcessActionError;
+ this.stateControllerContext = stateControllerContext;
+ this.requestPageState = requestPageState;
+ }
+
+ public Renderer getRenderer(ControllerResponse response)
+ {
if (response instanceof PageUpdateResponse)
{
PageUpdateResponse pageUpdate = (PageUpdateResponse)response;
@@ -58,7 +86,7 @@
//
if (resourceResponse.response instanceof FragmentResponse)
{
- return new ResourceRenderer((FragmentResponse)resourceResponse.response);
+ return new ResourceRenderer((FragmentResponse)resourceResponse.response, sendNoContentResponseOnEmptyResource);
}
else
{
@@ -70,7 +98,7 @@
throw new IllegalArgumentException("Unknown response type: " + response);
}
- private static Renderer getRenderer(PortletInvocationResponse response)
+ private Renderer getRenderer(PortletInvocationResponse response)
{
if (response instanceof HTTPRedirectionResponse)
{
@@ -78,7 +106,14 @@
}
else if (response instanceof ErrorResponse)
{
- return new ErrorResponseRenderer((ErrorResponse)response);
+ if (sendErrorOnProcessActionError)
+ {
+ return new ErrorResponseRenderer((ErrorResponse)response);
+ }
+ else
+ {
+ return new PageRenderer(new ResponseProperties(), requestPageState != null ? requestPageState : stateControllerContext.createPageState(false));
+ }
}
//
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java 2008-02-27 01:12:26 UTC (rev 10128)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java 2008-02-27 01:49:30 UTC (rev 10129)
@@ -41,38 +41,55 @@
/** . */
private FragmentResponse fragment;
- public ResourceRenderer(FragmentResponse response)
+ /** . */
+ private boolean sendNoContentResponseOnEmptyResource;
+
+ public ResourceRenderer(FragmentResponse response, boolean sendNoContentResponseOnEmptyResource)
{
super(response.getProperties());
//
+ this.sendNoContentResponseOnEmptyResource = sendNoContentResponseOnEmptyResource;
this.fragment = response;
}
protected void renderContent(HttpServletResponse resp) throws IOException
{
- String contentType = fragment.getContentType();
- if (contentType != null)
- {
- resp.setContentType(contentType);
- }
-
- //
if (fragment.getType() == FragmentResponse.TYPE_EMPTY)
{
-// resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
- ServletOutputStream out = null;
- try
+ if (sendNoContentResponseOnEmptyResource)
{
- out = resp.getOutputStream();
+ resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
}
- finally
+ else
{
- IOTools.safeClose(out);
+ String contentType = fragment.getContentType();
+ if (contentType != null)
+ {
+ resp.setContentType(contentType);
+ }
+
+ //
+ ServletOutputStream out = null;
+ try
+ {
+ out = resp.getOutputStream();
+ }
+ finally
+ {
+ IOTools.safeClose(out);
+ }
}
}
else
{
+ String contentType = fragment.getContentType();
+ if (contentType != null)
+ {
+ resp.setContentType(contentType);
+ }
+
+ //
if (fragment.getType() == FragmentResponse.TYPE_BYTES)
{
ServletOutputStream out = null;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKServlet.java 2008-02-27 01:12:26 UTC (rev 10128)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKServlet.java 2008-02-27 01:49:30 UTC (rev 10129)
@@ -25,7 +25,6 @@
import org.jboss.portal.portlet.test.controller.Renderer;
import org.jboss.portal.portlet.test.controller.ControllerResponseRendererFactory;
import org.jboss.portal.portlet.test.controller.PageRenderer;
-import org.jboss.portal.portlet.test.controller.AbstractRendererContext;
import org.jboss.portal.portlet.test.URLParameterConstants;
import org.jboss.portal.portlet.controller.PortletController;
import org.jboss.portal.portlet.controller.response.ControllerResponse;
@@ -51,6 +50,7 @@
public class TCKServlet extends HttpServlet
{
+ /** . */
public static String TCK_PORTLET_NAME = "portletName";
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
@@ -101,9 +101,16 @@
ControllerResponse response = controller.process(context, request);
//
- Renderer renderer = ControllerResponseRendererFactory.getRenderer(response);
+ ControllerResponseRendererFactory rendererFactory = new ControllerResponseRendererFactory(
+ false,
+ false,
+ context.getStateControllerContext(),
+ request.getPageState());
//
+ Renderer renderer = rendererFactory.getRenderer(response);
+
+ //
renderer.render(new TCKRendererContext(context, tckPageState));
}
else
16 years, 2 months
JBoss Portal SVN: r10128 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-26 20:12:26 -0500 (Tue, 26 Feb 2008)
New Revision: 10128
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java
Log:
if no page state exist then the list of portlets is empty
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java 2008-02-27 00:53:35 UTC (rev 10127)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java 2008-02-27 01:12:26 UTC (rev 10128)
@@ -47,10 +47,15 @@
//
Collection<Portlet> involvedPortlets = new ArrayList<Portlet>();
- for (String involvedPortletId : pageState.getInvolvedPortlets())
+
+ // Page state could be null for some requests
+ if (pageState != null)
{
- Portlet involvedPortlet = portletControllerContext.getPortlet(involvedPortletId);
- involvedPortlets.add(involvedPortlet);
+ for (String involvedPortletId : pageState.getInvolvedPortlets())
+ {
+ Portlet involvedPortlet = portletControllerContext.getPortlet(involvedPortletId);
+ involvedPortlets.add(involvedPortlet);
+ }
}
//
16 years, 2 months
JBoss Portal SVN: r10127 - in modules/portlet/trunk/portlet/src: test/java/org/jboss/portal/test/portlet/jsr286/tck/portletrequests and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-26 19:53:35 -0500 (Tue, 26 Feb 2008)
New Revision: 10127
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java
Log:
fix wrong resource serving life cycle phase request attribute and update test case accordingly
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-26 23:53:20 UTC (rev 10126)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2008-02-27 00:53:35 UTC (rev 10127)
@@ -72,6 +72,7 @@
import javax.portlet.RenderResponse;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
+import javax.portlet.PortletRequest;
import javax.portlet.filter.PortletFilter;
import javax.portlet.filter.ActionFilter;
import javax.portlet.filter.EventFilter;
@@ -462,28 +463,28 @@
{
req = new ActionRequestImpl(this, (ActionInvocation)invocation);
resp = new ActionResponseImpl((ActionInvocation)invocation, req);
- phase = "ACTION_PHASE";
+ phase = PortletRequest.ACTION_PHASE;
chain = new FilterChainImpl<ActionFilter>(actionFilterList, ActionFilter.class);
}
else if (invocation instanceof RenderInvocation)
{
req = new RenderRequestImpl(this, (RenderInvocation)invocation);
resp = new RenderResponseImpl((RenderInvocation)invocation, req);
- phase = "RENDER_PHASE";
+ phase = PortletRequest.RENDER_PHASE;
chain = new FilterChainImpl<RenderFilter>(renderFilterList, RenderFilter.class);
}
else if (invocation instanceof EventInvocation)
{
req = new EventRequestImpl(this, (EventInvocation)invocation);
resp = new EventResponseImpl((EventInvocation)invocation, req);
- phase = "EVENT_PHASE";
+ phase = PortletRequest.EVENT_PHASE;
chain = new FilterChainImpl<EventFilter>(eventFilterList, EventFilter.class);
}
else if (invocation instanceof ResourceInvocation)
{
req = new ResourceRequestImpl(this, (ResourceInvocation)invocation);
resp = new ResourceResponseImpl((ResourceInvocation)invocation, req);
- phase = "RESOURCE_SERVING_PHASE";
+ phase = PortletRequest.RESOURCE_PHASE;
chain = new FilterChainImpl<ResourceFilter>(resourceFilterList, ResourceFilter.class);
}
else
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java 2008-02-26 23:53:20 UTC (rev 10126)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/tck/portletrequests/LifeCyclePhaseRequestAttributeTestCase.java 2008-02-27 00:53:35 UTC (rev 10127)
@@ -70,7 +70,7 @@
{
protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
{
- assertEquals("ACTION_PHASE", request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
+ assertEquals(PortletRequest.ACTION_PHASE, request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
//
response.setEvent("Event", null);
@@ -80,14 +80,14 @@
{
protected void run(Portlet portlet, EventRequest request, EventResponse response, PortletTestContext context) throws PortletException, IOException
{
- assertEquals("EVENT_PHASE", request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
+ assertEquals(PortletRequest.RENDER_PHASE, request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
}
});
seq.bindAction(1, UTP6.RENDER_JOIN_POINT, new PortletRenderTestAction()
{
protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
{
- assertEquals("RENDER_PHASE", request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
+ assertEquals(PortletRequest.RENDER_PHASE, request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
//
return new InvokeGetResponse(response.createResourceURL().toString());
@@ -97,7 +97,7 @@
{
protected DriverResponse run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
{
- assertEquals("RESOURCE_SERVING_PHASE", request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
+ assertEquals(PortletRequest.RESOURCE_PHASE, request.getAttribute(PortletRequest.LIFECYCLE_PHASE));
//
return new EndTestResponse();
16 years, 2 months
JBoss Portal SVN: r10126 - in modules/portlet/trunk/portlet/src: test/java/org/jboss/portal/unit and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-26 18:53:20 -0500 (Tue, 26 Feb 2008)
New Revision: 10126
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestContants.java
Log:
update major version returned by PortletContext and update test case accordingly
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java 2008-02-26 23:46:38 UTC (rev 10125)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java 2008-02-26 23:53:20 UTC (rev 10126)
@@ -106,7 +106,7 @@
public int getMajorVersion()
{
- return 1;
+ return 2;
}
public int getMinorVersion()
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestContants.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestContants.java 2008-02-26 23:46:38 UTC (rev 10125)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/unit/TestContants.java 2008-02-26 23:53:20 UTC (rev 10126)
@@ -38,6 +38,6 @@
public static final int MINOR_VERSION = 0;
/** int for <code>PortletContext.getMajorVersion()</code/>. */
- public static final int MAJOR_VERSION = 1;
+ public static final int MAJOR_VERSION = 2;
}
16 years, 2 months
JBoss Portal SVN: r10125 - modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-26 18:46:38 -0500 (Tue, 26 Feb 2008)
New Revision: 10125
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java
Log:
extend file serving test case to resource phase
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java 2008-02-26 23:28:54 UTC (rev 10124)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java 2008-02-26 23:46:38 UTC (rev 10125)
@@ -27,6 +27,7 @@
import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
import org.jboss.portal.unit.annotations.TestCase;
import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.unit.actions.PortletResourceTestAction;
import org.jboss.portal.test.portlet.framework.UTP1;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.response.EndTestResponse;
@@ -38,6 +39,8 @@
import javax.portlet.RenderResponse;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
import java.io.IOException;
/**
@@ -70,6 +73,30 @@
assertTrue("Expected " + body + " to contain @DISPATCHED_MARKUP@ token", body.contains("@DISPATCHED_MARKUP@"));
//
+ return new InvokeGetResponse(response.createResourceURL().toString());
+ }
+ });
+ seq.bindAction(2, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ PortletRequestDispatcher dispatcher = assertNotNull(((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/file.html"));
+ dispatcher.include(request, response);
+
+ //
+ return new InvokeGetResponse(response.createResourceURL().toString());
+ }
+ });
+ seq.bindAction(3, UTP1.RESOURCE_JOIN_POINT, new PortletResourceTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, ResourceRequest request, ResourceResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ String body = new String(context.getResponseBody(), "UTF-8");
+
+ //
+ assertTrue("Expected " + body + " to contain @DISPATCHED_MARKUP@ token", body.contains("@DISPATCHED_MARKUP@"));
+
+ //
return new EndTestResponse();
}
});
16 years, 2 months
JBoss Portal SVN: r10124 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-26 18:28:54 -0500 (Tue, 26 Feb 2008)
New Revision: 10124
Added:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java
modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-war/file.html
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchtedRequestDispatcher.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/FiltersTestCase.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java
Log:
- reimplement request dispatching to use include (since it's the only way to get the proper required informations)
- added a test case for request dispatch to a file
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java 2008-02-26 23:13:42 UTC (rev 10123)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java 2008-02-26 23:28:54 UTC (rev 10124)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168;
-import org.jboss.portal.common.http.QueryStringParser;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.http.QueryStringParser;
import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl;
import javax.servlet.RequestDispatcher;
@@ -46,7 +46,6 @@
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
-import java.util.HashMap;
import java.util.LinkedList;
import java.util.Set;
import java.util.HashSet;
@@ -121,10 +120,10 @@
private final int sessionScope;
/** . */
- private final LinkedList<Map<String, String>> containerAttributesStack;
+ private final LinkedList<Dispatch> dispatches;
/** . */
- private final String[] infos;
+ private String[] infos;
/** . */
private final ServletContext servletContext;
@@ -154,15 +153,25 @@
this.preq = preq;
this.dreq = dreq;
this.servletContext = servletContext;
- this.containerAttributesStack = new LinkedList<Map<String, String>>();
+ this.dispatches = new LinkedList<Dispatch>();
this.sessionScope = sessionScope;
// Push dispatch
- this.infos = pushDispatch(dispatch);
+ /*this.infos =*/ pushDispatch(dispatch);
//
- String[] containerKeys = dispatchType == DispatchType.INCLUDE ? INCLUDE_KEYS : FORWARD_KEYS;
- String queryString = containerAttributesStack.getLast().get(containerKeys[QUERY_STRING]);
+ String queryString = null;
+ String path = dispatch.getPath();
+ if (path != null)
+ {
+ int index = path.indexOf('?');
+ if (index > -1)
+ {
+ queryString = path.substring(index + 1);
+ }
+ }
+
+ //
Map<String, String[]> parameters;
if (queryString != null && queryString.length() > 0)
{
@@ -178,6 +187,7 @@
//
this.parameters = parameters;
+ this.infos = null;
}
// Must return null
@@ -226,11 +236,6 @@
// Must return the path and query string information used to obtain the PortletRequestDispatcher object
- public final String getPathInfo()
- {
- return infos[PATH_INFO];
- }
-
public final String getPathTranslated()
{
String pathInfo = getPathInfo();
@@ -239,19 +244,52 @@
return pathInfo == null ? null : servletContext.getRealPath(pathInfo);
}
+ public final String getPathInfo()
+ {
+ if (infos != null)
+ {
+ return infos[PATH_INFO];
+ }
+ else
+ {
+ return (String)preq.getAttribute(INCLUDE_KEYS[PATH_INFO]);
+ }
+ }
+
public final String getQueryString()
{
- return infos[QUERY_STRING];
+ if (infos != null)
+ {
+ return infos[QUERY_STRING];
+ }
+ else
+ {
+ return (String)preq.getAttribute(INCLUDE_KEYS[QUERY_STRING]);
+ }
}
public final String getRequestURI()
{
- return infos[REQUEST_URI];
+ if (infos != null)
+ {
+ return infos[REQUEST_URI];
+ }
+ else
+ {
+ return (String)preq.getAttribute(INCLUDE_KEYS[REQUEST_URI]);
+ }
}
public final String getServletPath()
{
- return infos[SERVLET_PATH];
+ if (infos != null)
+ {
+ return infos[SERVLET_PATH];
+ }
+ else
+ {
+ return (String)preq.getAttribute(INCLUDE_KEYS[SERVLET_PATH]);
+ }
}
// Must be equivalent to the method of the PortletRequest
@@ -275,15 +313,55 @@
{
if (s != null)
{
- Map<String, String> containerAttributes = containerAttributesStack.getLast();
+// Map<String, String> containerAttributes = containerAttributesStack.getLast();
//
- if (containerAttributes.containsKey(s))
+// if (containerAttributes.containsKey(s))
+// {
+// return containerAttributes.get(s);
+// }
+
+ if (dispatches.getLast().getType() == DispatchType.INCLUDE)
{
- return containerAttributes.get(s);
+ for (String key : INCLUDE_KEYS)
+ {
+ if (key.equals(s))
+ {
+ return preq.getAttribute(key);
+ }
+ }
}
+ else
+ {
+ for (int i = 0;i < FORWARD_KEYS.length;i++)
+ {
+ if (FORWARD_KEYS[i].equals(s))
+ {
+ if (infos != null)
+ {
+ return infos[i];
+ }
+ else
+ {
+ return preq.getAttribute(INCLUDE_KEYS[i]);
+ }
+ }
+ }
+ }
//
+ String[] containerKeys = dispatches.getLast().getType() == DispatchType.FORWARD ? FORWARD_KEYS : INCLUDE_KEYS;
+
+ //
+ for (int i = 0;i < containerKeys.length;i++)
+ {
+ if (containerKeys[i].equals(s))
+ {
+ return preq.getAttribute(INCLUDE_KEYS[i]);
+ }
+ }
+
+ //
if (ALL_CONTAINER_ATTRIBUTES.contains(s))
{
return null;
@@ -306,9 +384,18 @@
names.removeAll(ALL_CONTAINER_ATTRIBUTES);
//
- names.addAll(containerAttributesStack.getLast().keySet());
+ String[] containerKeys = dispatches.getLast().getType() == DispatchType.FORWARD ? FORWARD_KEYS : INCLUDE_KEYS;
//
+ for (String containerKey : containerKeys)
+ {
+ if (getAttribute(containerKey) != null)
+ {
+ names.add(containerKey);
+ }
+ }
+
+ //
return Collections.enumeration(names);
}
@@ -521,150 +608,170 @@
dreq.setRequest(servletRequest);
}
- public final ServletRequest getRequest()
+ public ServletRequest getRequest()
{
// That's a trick
return dreq.getRequest();
}
- String[] pushDispatch(Dispatch dispatch)
+ void pushDispatch(Dispatch dispatch)
{
- String path = dispatch.getPath();
+ dispatches.addLast(dispatch);
- //
- String[] infos;
- if (path != null)
+ // We need to backup
+ if (dispatches.size() == 2)
{
- infos = build(path);
-
- //
- if (dispatch.getType() == DispatchType.INCLUDE)
+ String[] infos = new String[INCLUDE_KEYS.length];
+ for (int i = 0;i < INCLUDE_KEYS.length;i++)
{
- Map<String, String> containerAttributes = new HashMap<String, String>();
- for (int i = 0;i < infos.length;i++)
- {
- String value = infos[i];
- if (value != null)
- {
- containerAttributes.put(INCLUDE_KEYS[i], value);
- }
- }
- containerAttributesStack.addLast(containerAttributes);
+ infos[i] = (String)preq.getAttribute(INCLUDE_KEYS[i]);
}
- else
- {
- if (containerAttributesStack.size() == 0)
- {
- Map<String, String> containerAttributes = new HashMap<String, String>();
- for (int i = 0;i < infos.length;i++)
- {
- String value = infos[i];
- if (value != null)
- {
- containerAttributes.put(FORWARD_KEYS[i], value);
- }
- }
- containerAttributesStack.addLast(containerAttributes);
- }
- else
- {
- Map<String, String> containerAttributes = new HashMap<String, String>();
- for (int i = 0;i < this.infos.length;i++)
- {
- String value = this.infos[i];
- if (value != null)
- {
- containerAttributes.put(FORWARD_KEYS[i], value);
- }
- }
- containerAttributesStack.addLast(containerAttributes);
- }
- }
+ this.infos = infos;
}
- else
- {
- infos = new String[5];
- //
- Map<String, String> containerAttributes = Collections.emptyMap();
- containerAttributesStack.addLast(containerAttributes);
- }
- //
- return infos;
+// String path = dispatch.getPath();
+//
+// //
+// String[] infos;
+// if (path != null)
+// {
+// infos = build(path);
+//
+// //
+// if (dispatch.getType() == DispatchType.INCLUDE)
+// {
+// Map<String, String> containerAttributes = new HashMap<String, String>();
+// for (int i = 0;i < infos.length;i++)
+// {
+// String value = infos[i];
+// if (value != null)
+// {
+// containerAttributes.put(INCLUDE_KEYS[i], value);
+// }
+// }
+// containerAttributesStack.addLast(containerAttributes);
+// }
+// else
+// {
+// if (containerAttributesStack.size() == 0)
+// {
+// Map<String, String> containerAttributes = new HashMap<String, String>();
+// for (int i = 0;i < infos.length;i++)
+// {
+// String value = infos[i];
+// if (value != null)
+// {
+// containerAttributes.put(FORWARD_KEYS[i], value);
+// }
+// }
+// containerAttributesStack.addLast(containerAttributes);
+// }
+// else
+// {
+// Map<String, String> containerAttributes = new HashMap<String, String>();
+// for (int i = 0;i < this.infos.length;i++)
+// {
+// String value = this.infos[i];
+// if (value != null)
+// {
+// containerAttributes.put(FORWARD_KEYS[i], value);
+// }
+// }
+// containerAttributesStack.addLast(containerAttributes);
+// }
+// }
+// }
+// else
+// {
+// infos = new String[5];
+//
+// //
+// Map<String, String> containerAttributes = Collections.emptyMap();
+// containerAttributesStack.addLast(containerAttributes);
+// }
+//
+// //
+// return infos;
}
- private String[] build(String path)
+// private String[] build(String path)
+// {
+// if (path == null)
+// {
+// throw new IllegalArgumentException();
+// }
+//
+// //
+// String servletPath;
+// String pathInfo;
+// String queryString;
+// int endOfServletPath = path.indexOf('/', 1);
+// if (endOfServletPath == -1)
+// {
+// endOfServletPath = path.indexOf('?', 1);
+// if (endOfServletPath == -1)
+// {
+// servletPath = path;
+// pathInfo = "";
+// queryString = "";
+// }
+// else
+// {
+// servletPath = path.substring(0, endOfServletPath);
+// pathInfo = null;
+// queryString = path.substring(endOfServletPath + 1);
+// }
+// }
+// else
+// {
+// servletPath = path.substring(0, endOfServletPath);
+// int endOfPathInfo = path.indexOf('?', endOfServletPath + 1);
+// if (endOfPathInfo == -1)
+// {
+// pathInfo = path.substring(endOfServletPath);
+// queryString = "";
+// }
+// else
+// {
+// pathInfo = path.substring(endOfServletPath, endOfPathInfo);
+// queryString = path.substring(endOfPathInfo + 1);
+// }
+// }
+//
+// //
+// String[] infos = new String[5];
+//
+// //
+// StringBuffer requestURI = new StringBuffer(preq.getContextPath());
+// requestURI.append(servletPath);
+// if (pathInfo != null)
+// {
+// requestURI.append(pathInfo);
+// infos[PATH_INFO] = pathInfo;
+// }
+//
+// //
+// infos[SERVLET_PATH] = servletPath;
+// infos[QUERY_STRING] = queryString;
+// infos[REQUEST_URI] = requestURI.toString();
+// infos[CONTEXT_PATH] = preq.getContextPath();
+//
+// //
+// return infos;
+// }
+
+ void popDispatch()
{
- if (path == null)
+ if (dispatches.size() == 2)
{
- throw new IllegalArgumentException();
+ infos = null; // We could remove that as it's not going to change, but for now...
}
//
- String servletPath;
- String pathInfo;
- String queryString;
- int endOfServletPath = path.indexOf('/', 1);
- if (endOfServletPath == -1)
- {
- endOfServletPath = path.indexOf('?', 1);
- if (endOfServletPath == -1)
- {
- servletPath = path;
- pathInfo = "";
- queryString = "";
- }
- else
- {
- servletPath = path.substring(0, endOfServletPath);
- pathInfo = null;
- queryString = path.substring(endOfServletPath + 1);
- }
- }
- else
- {
- servletPath = path.substring(0, endOfServletPath);
- int endOfPathInfo = path.indexOf('?', endOfServletPath + 1);
- if (endOfPathInfo == -1)
- {
- pathInfo = path.substring(endOfServletPath);
- queryString = "";
- }
- else
- {
- pathInfo = path.substring(endOfServletPath, endOfPathInfo);
- queryString = path.substring(endOfPathInfo + 1);
- }
- }
-
- //
- String[] infos = new String[5];
-
- //
- StringBuffer requestURI = new StringBuffer(preq.getContextPath());
- requestURI.append(servletPath);
- if (pathInfo != null)
- {
- requestURI.append(pathInfo);
- infos[PATH_INFO] = pathInfo;
- }
-
- //
- infos[SERVLET_PATH] = servletPath;
- infos[QUERY_STRING] = queryString;
- infos[REQUEST_URI] = requestURI.toString();
- infos[CONTEXT_PATH] = preq.getContextPath();
-
- //
- return infos;
+ dispatches.removeLast();
}
- void popDispatch()
- {
- containerAttributesStack.removeLast();
- }
-
/**
* Returns the an implementation of <code>javax.servlet.http.HttpSession</code> that wraps this
* portlet session and use the specified scope for manipulating attributes. This session is used
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchtedRequestDispatcher.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchtedRequestDispatcher.java 2008-02-26 23:13:42 UTC (rev 10123)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/DispatchtedRequestDispatcher.java 2008-02-26 23:28:54 UTC (rev 10124)
@@ -75,7 +75,7 @@
dreq.pushDispatch(new Dispatch(DispatchType.FORWARD, path));
try
{
- realDispatcher.forward(req, resp);
+ realDispatcher.include(req, resp);
}
finally
{
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java 2008-02-26 23:13:42 UTC (rev 10123)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java 2008-02-26 23:28:54 UTC (rev 10124)
@@ -38,6 +38,7 @@
import javax.portlet.ActionRequest;
import javax.portlet.EventRequest;
import javax.portlet.ResourceRequest;
+import javax.portlet.MimeResponse;
import javax.portlet.filter.PortletRequestWrapper;
import javax.portlet.filter.PortletResponseWrapper;
import javax.servlet.RequestDispatcher;
@@ -140,7 +141,24 @@
dispatcher.include(direq, diresp);
break;
case FORWARD:
- dispatcher.forward(direq, diresp);
+
+ if (resp instanceof MimeResponse)
+ {
+ if (((MimeResponse)resp).isCommitted())
+ {
+ throw new IllegalStateException();
+ }
+ ((MimeResponse)resp).resetBuffer();
+ }
+
+ dispatcher.include(direq, diresp);
+
+ // For now here
+ if (resp instanceof MimeResponse)
+ {
+ ((MimeResponse)resp).flushBuffer();
+ }
+
break;
}
}
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/FiltersTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/FiltersTestCase.java 2008-02-26 23:13:42 UTC (rev 10123)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/FiltersTestCase.java 2008-02-26 23:28:54 UTC (rev 10124)
@@ -25,7 +25,6 @@
import org.jboss.portal.unit.PortletTestCase;
import org.jboss.portal.unit.PortletTestContext;
import org.jboss.portal.unit.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP2;
import org.jboss.portal.test.portlet.framework.UTP1;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.unit.annotations.TestCase;
@@ -88,7 +87,7 @@
assertNotNull(prd);
ServletFilter.ids.clear();
prd.forward(request, response);
- assertEquals(Tools.toSet("FORWARD_URL_PATTERN_FILTER", "FORWARD_NAMED_FILTER"), ServletFilter.ids);
+ assertEquals(Tools.toSet("INCLUDE_URL_PATTERN_FILTER", "INCLUDE_NAMED_FILTER"), ServletFilter.ids);
//
return new InvokeGetResponse(response.createRenderURL().toString());
@@ -102,7 +101,7 @@
assertNotNull(prd);
ServletFilter.ids.clear();
prd.forward(request, response);
- assertEquals(Collections.singleton("FORWARD_NAMED_FILTER"), ServletFilter.ids);
+ assertEquals(Collections.singleton("INCLUDE_NAMED_FILTER"), ServletFilter.ids);
//
return new EndTestResponse();
Added: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java (rev 0)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr286/ext/dispatcher/IncludeMarkupFileTestCase.java 2008-02-26 23:28:54 UTC (rev 10124)
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * 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.test.portlet.jsr286.ext.dispatcher;
+
+import org.jboss.portal.unit.PortletTestCase;
+import org.jboss.portal.unit.PortletTestContext;
+import org.jboss.portal.unit.base.AbstractUniversalTestPortlet;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.unit.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+@TestCase
+public class IncludeMarkupFileTestCase
+{
+ public IncludeMarkupFileTestCase(PortletTestCase seq)
+ {
+ seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ PortletRequestDispatcher dispatcher = assertNotNull(((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/file.html"));
+ dispatcher.include(request, response);
+
+ //
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+ seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ String body = new String(context.getResponseBody(), "UTF-8");
+
+ //
+ assertTrue("Expected " + body + " to contain @DISPATCHED_MARKUP@ token", body.contains("@DISPATCHED_MARKUP@"));
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java 2008-02-26 23:13:42 UTC (rev 10123)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderer.java 2008-02-26 23:28:54 UTC (rev 10124)
@@ -51,20 +51,28 @@
protected void renderContent(HttpServletResponse resp) throws IOException
{
+ String contentType = fragment.getContentType();
+ if (contentType != null)
+ {
+ resp.setContentType(contentType);
+ }
+
//
if (fragment.getType() == FragmentResponse.TYPE_EMPTY)
{
- resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
+// resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
+ ServletOutputStream out = null;
+ try
+ {
+ out = resp.getOutputStream();
+ }
+ finally
+ {
+ IOTools.safeClose(out);
+ }
}
else
{
- String contentType = fragment.getContentType();
- if (contentType != null)
- {
- resp.setContentType(contentType);
- }
-
- //
if (fragment.getType() == FragmentResponse.TYPE_BYTES)
{
ServletOutputStream out = null;
Added: modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-war/file.html
===================================================================
--- modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-war/file.html (rev 0)
+++ modules/portlet/trunk/test/src/test/resources/jsr286/ext/dispatcher-war/file.html 2008-02-26 23:28:54 UTC (rev 10124)
@@ -0,0 +1 @@
+@DISPATCHED_MARKUP@
\ No newline at end of file
16 years, 2 months