JBoss Portal SVN: r9929 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-10 18:55:18 -0500 (Sun, 10 Feb 2008)
New Revision: 9929
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
Log:
5.2.1.4. Application Descriptors
move paragraph, minor spelling corrections
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-10 23:26:50 UTC (rev 9928)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-10 23:55:18 UTC (rev 9929)
@@ -338,7 +338,13 @@
</variablelist>
</para>
<para>
- The following is an example of the <filename>HelloWorldPortlet/WEB-INF/portlet-instances.xml</filename> file:
+ <para>
+ The <filename>HelloWorldPortlet/WEB-INF/portlet-instances.xml</filename> file is a JBoss Portal specific descriptor, that allows you to create instances of portlets. The
+ <literal><portlet-ref></literal> value must match the <literal><portlet-name></literal> value
+ given in the <filename>HelloWorldPortlet/WEB-INF/portlet.xml</filename> file. The <literal><instance-id></literal>
+ value can be named anything, but it must match the <literal><instance-ref></literal> values given
+ in the <literal>*-object.xml</literal> files, which in this example, would be <filename>HelloWorldPortlet/WEB-INF/helloworld-object.xml</filename>.
+</para>The following is an example of the <filename>HelloWorldPortlet/WEB-INF/portlet-instances.xml</filename> file:
</para>
<para>
<screen><![CDATA[
@@ -357,16 +363,9 @@
</screen>
</para>
<para>
- This is a JBoss Portal specific descriptor, that allows you to create instances of portlets. The
- <literal><portlet-ref></literal> value must match the <literal><portlet-name></literal> value
- given in the <filename>HelloWorldPortlet/WEB-INF/portlet.xml</filename> file. The <literal><instance-id></literal>
- value can be named anything, but it must match the <literal>instance-ref</literal> values given
- in the <literal>*-object.xml</literal> files, which in this example, would be <filename>HelloWorldPortlet/WEB-INF/helloworld-object.xml</filename>, as shown below.
-</para>
-<para>
The <literal>*-object.xml</literal> files are JBoss Portal specific descriptors that allow users to
define the structure of their portal instances, as well as create and configure their windows and
- pages. In this example:
+ pages. In the following example:
</para>
<para>
<itemizedlist>
@@ -377,23 +376,23 @@
</listitem>
<listitem>
<para>
- it is specified that it will display the markup generated by the <literal>HelloWorldPortletInstance</literal> portlet instance.
+ specifies that it will display the markup generated by the <literal>HelloWorldPortletInstance</literal> portlet instance.
</para>
</listitem>
<listitem>
<para>
- the window is assinged to the <literal>default.default</literal> page.
+ the window is assigned to the <literal>default.default</literal> page.
</para>
</listitem>
<listitem>
<para>
- specify where the window will appear on the page, by the <computeroutput><region></computeroutput> element.
+ specifies where the window will appear on the page, by the <computeroutput><region></computeroutput> element.
</para>
</listitem>
</itemizedlist>
</para>
<para>
- The following is an example <filename>HelloWorldPortlet/WEB-INF</filename> file:
+ The following is an example <filename>HelloWorldPortlet/WEB-INF/helloworld-object.xml</filename> file:
</para>
<para>
<screen><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
16 years, 5 months
JBoss Portal SVN: r9928 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-10 18:26:50 -0500 (Sun, 10 Feb 2008)
New Revision: 9928
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
Log:
5.2.1.4. Application Descriptors
adding an itemizedlist to describe what the
example object.xml file does
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-10 23:14:25 UTC (rev 9927)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-10 23:26:50 UTC (rev 9928)
@@ -321,7 +321,7 @@
<literal><mime-type></literal> element, which is required for every portlet. The declared MIME types must match the capability of the portlet.
</para>
<para>
- 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 decared. Define which markup type your porlet supports, which in this examepl is <literal>text/html</literal>. This section tells the portal that it will only output text and HTML, and that it only supports the VIEW mode.
+ 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 <literal><mime-type></literal> to define which markup type your portlet supports, which in this example, is <literal>text/html</literal>. This section tells the portal that it will only output text and HTML, and that it only supports the VIEW mode.
</para>
</listitem>
</varlistentry>
@@ -357,16 +357,45 @@
</screen>
</para>
<para>
- This is a JBoss Portal specific descriptor that allows you to create instances of portlets. The
+ This is a JBoss Portal specific descriptor, that allows you to create instances of portlets. The
<literal><portlet-ref></literal> value must match the <literal><portlet-name></literal> value
given in the <filename>HelloWorldPortlet/WEB-INF/portlet.xml</filename> file. The <literal><instance-id></literal>
value can be named anything, but it must match the <literal>instance-ref</literal> values given
- in <literal>*-object.xml</literal> files as we shall below.
+ in the <literal>*-object.xml</literal> files, which in this example, would be <filename>HelloWorldPortlet/WEB-INF/helloworld-object.xml</filename>, as shown below.
</para>
<para>
- The following is an example <filename>helloworld-object.xml</filename> file:
+ The <literal>*-object.xml</literal> files are JBoss Portal specific descriptors that allow users to
+ define the structure of their portal instances, as well as create and configure their windows and
+ pages. In this example:
</para>
<para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ a portlet window is created.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ it is specified that it will display the markup generated by the <literal>HelloWorldPortletInstance</literal> portlet instance.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ the window is assinged to the <literal>default.default</literal> page.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ specify where the window will appear on the page, by the <computeroutput><region></computeroutput> element.
+ </para>
+ </listitem>
+ </itemizedlist>
+</para>
+<para>
+ The following is an example <filename>HelloWorldPortlet/WEB-INF</filename> file:
+</para>
+<para>
<screen><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE deployments PUBLIC
"-//JBoss Portal//DTD Portal Object 2.6//EN"
@@ -385,14 +414,8 @@
</deployments>]]>
</screen>
</para>
+
<para>
-<literal>*-object.xml</literal> files are JBoss Portal specific descriptors and allow users to
-define the structure of their portal instances as well as create/configure their windows and
-pages. In our example, we create a portlet window, specify that it will display the markup
-generated by the <literal>HelloWorldPortletInstance</literal> portlet instance, assign it to the
-<literal>default.default</literal> page, and specify where it should appear on that page.
-</para>
-<para>
<variablelist>
<varlistentry><term><screen><![CDATA[
<parent-ref>default.default</parent-ref>]]>
16 years, 5 months
JBoss Portal SVN: r9927 - in modules/portlet/trunk/test/src: test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-02-10 18:14:25 -0500 (Sun, 10 Feb 2008)
New Revision: 9927
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java
modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml
Log:
- Added interaction with preferences but doesn't work yet (preference value is not written)...
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java 2008-02-10 22:38:04 UTC (rev 9926)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java 2008-02-10 23:14:25 UTC (rev 9927)
@@ -23,6 +23,8 @@
public class RemoteControlResourcePortlet extends GenericPortlet
{
private static final String ZIPCODE = "zipcode";
+ private static int COLOR_INDEX = 0;
+ private static final String[] COLORS = {"000", "f00", "0f0", "00f", "ff0", "0ff", "f0f", "fff"};
@Override
protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException
@@ -30,11 +32,14 @@
renderResponse.setContentType("text/html");
PrintWriter printWriter = renderResponse.getWriter();
printWriter.print("<script type='text/javascript'>function openRemote(url){window.name='jbp_parent';" +
- "window.open(url, 'jbp_remote', 'width=400,height=200,scrollable=yes')}</script>");
+ "window.open(url, 'jbp_remote', 'width=400,height=300,scrollable=yes')}</script>");
printWriter.print("<p><a href='#' onclick=\"openRemote('");
ResourceURL resource = renderResponse.createResourceURL();
printWriter.print(resource);
printWriter.print("')\">Open remote control!</a></p>");
+ String color = renderRequest.getPreferences().getValue("color", "000");
+ printWriter.print("<p>Preferred color: <span style='border: 1px solid #aaa; background-color:#"
+ + color + ";'> </span></p>");
}
@Override
@@ -42,6 +47,7 @@
{
resourceResponse.setContentType("text/html");
PrintWriter writer = resourceResponse.getWriter();
+ resourceRequest.getPreferences().setValue("color", COLORS[COLOR_INDEX++ % 8]);
writer.print("<html><head><script type='text/javascript'>function openLinkInParent(url){window.open(url,'jbp_parent');}</script>" +
"<link rel=\"stylesheet\" href=\"/simple/css/master.css\" type=\"text/css\"/></head><body>");
PortletURL url = resourceResponse.createRenderURL();
Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml 2008-02-10 22:38:04 UTC (rev 9926)
+++ modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml 2008-02-10 23:14:25 UTC (rev 9927)
@@ -38,6 +38,13 @@
<title>Remote Control Portlet</title>
<keywords>sample,resource,remotecontrol</keywords>
</portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>color</name>
+ <value>ffe</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
<supported-public-render-parameter>zipcode</supported-public-render-parameter>
</portlet>
16 years, 5 months
JBoss Portal SVN: r9926 - modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-02-10 17:38:04 -0500 (Sun, 10 Feb 2008)
New Revision: 9926
Modified:
modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml
Log:
- Shortened title so that it doesn't mess the layout up :)
Modified: modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml 2008-02-10 22:38:01 UTC (rev 9925)
+++ modules/portlet/trunk/test/src/test/resources/portal/samples/remotecontrol-portlet-war/WEB-INF/portlet.xml 2008-02-10 22:38:04 UTC (rev 9926)
@@ -28,14 +28,14 @@
<portlet>
<description>Portlet controlling display of other portlets</description>
<portlet-name>RemoteControl</portlet-name>
- <display-name>Remote Control Resource Portlet</display-name>
+ <display-name>Remote Control Portlet</display-name>
<portlet-class>org.jboss.portal.portlet.portal.samples.RemoteControlResourcePortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
- <title>Remote Control Resource Portlet</title>
+ <title>Remote Control Portlet</title>
<keywords>sample,resource,remotecontrol</keywords>
</portlet-info>
<supported-public-render-parameter>zipcode</supported-public-render-parameter>
16 years, 5 months
JBoss Portal SVN: r9925 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: mmcallis
Date: 2008-02-10 17:38:01 -0500 (Sun, 10 Feb 2008)
New Revision: 9925
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
Log:
5.2.1.4. Application Descriptors
changing itemizedlist to variabelist
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-10 22:20:27 UTC (rev 9924)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-10 22:38:01 UTC (rev 9925)
@@ -393,49 +393,57 @@
<literal>default.default</literal> page, and specify where it should appear on that page.
</para>
<para>
-
- <itemizedlist>
- <listitem>
- <para>
- <programlisting><![CDATA[<parent-ref>default.default</parent-ref>]]></programlisting>
- Tells the portal where this portlet should appear. In this case,
- <literal>default.default</literal> specifies that this portlet should appear in the
- portal instance named <literal>default</literal> and the page named
- <literal>default</literal>.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<if-exists>overwrite</if-exists>]]></programlisting>
- Instructs the portal to overwrite or keep this object if it already exists.
- Possible values are <literal>overwrite</literal> or <literal>keep</literal>.
- <literal>overwrite</literal> will destroy the existing object and create a new one
- based on the content of the deployment. <literal>keep</literal> will maintain the
- existing object deployment or create a new one if it does not yet exist.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<window-name>HelloWorldPortletWindow</window-name>]]></programlisting>
- Can be named anything.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<instance-ref>HelloWorldPortletInstance</instance-ref>]]></programlisting>
- The value of <literal>instance-ref</literal> must match the value of one of the
+ <variablelist>
+ <varlistentry><term><screen><![CDATA[
+<parent-ref>default.default</parent-ref>]]>
+</screen></term>
+<listitem>
+ <para>
+ Tells the portal where this portlet should appear. In this case, <computeroutput>default.default</computeroutput> specifies that this portlet should appear in the portal instance named <literal>default</literal> and the page named
+ <literal>default</literal>.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<if-exists>overwrite</if-exists>]]>
+</screen></term>
+<listitem>
+ <para>
+ Instructs the portal to overwrite or keep this object if it already exists. Possible values are <literal>overwrite</literal> or <literal>keep</literal>. <literal>overwrite</literal> will destroy the existing object and create a new one based on the content of the deployment. <literal>keep</literal> will maintain the existing object deployment or create a new one if it does not yet exist.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<window-name>HelloWorldPortletWindow</window-name>]]>
+</screen></term>
+<listitem>
+ <para>
+ Can be named anything.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<instance-ref>HelloWorldPortletInstance</instance-ref>]]>
+</screen></term>
+<listitem>
+ <para>
+ The value of <literal>instance-ref</literal> must match the value of one of the
<literal>instance-id</literal> found in <literal>portlet-instances.xml</literal>.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<region>center</region>
-<height>1</height>]]></programlisting>
- Specify the layout region and order this window will be found on the portal page.
- </para>
- </listitem>
- </itemizedlist>
- </para>
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<region>center</region>
+<height>1</height>]]>
+</screen></term>
+<listitem>
+ <para>
+ Specify the layout region and order this window will be found on the portal page.
+ </para>
+</listitem>
+</varlistentry>
+</variablelist>
+</para>
<para>
To illustrate the relationship between the descriptors, we have provided this simple diagram
16 years, 5 months
JBoss Portal SVN: r9924 - modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-10 17:20:27 -0500 (Sun, 10 Feb 2008)
New Revision: 9924
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalPrepareResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalRenderResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalResponse.java
Log:
create better window ids in portal demo (request URI + sequence number)
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java 2008-02-10 20:44:21 UTC (rev 9923)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/ControllerFilter.java 2008-02-10 22:20:27 UTC (rev 9924)
@@ -88,7 +88,7 @@
PortletInvoker invoker = (PortletInvoker)getServletContext().getAttribute("ConsumerPortletInvoker");
//
- PortalPrepareResponse prepareResponse = new PortalPrepareResponse(resp);
+ PortalPrepareResponse prepareResponse = new PortalPrepareResponse(req, resp);
// Discover existing portlets on the page (introspection phase)
chain.doFilter(req, prepareResponse);
@@ -235,7 +235,7 @@
}
//
- PortalRenderResponse renderResponse = new PortalRenderResponse(resp, context, pageState, prepareResponse);
+ PortalRenderResponse renderResponse = new PortalRenderResponse(req, resp, context, pageState, prepareResponse);
//
chain.doFilter(req, renderResponse);
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalPrepareResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalPrepareResponse.java 2008-02-10 20:44:21 UTC (rev 9923)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalPrepareResponse.java 2008-02-10 22:20:27 UTC (rev 9924)
@@ -26,6 +26,7 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.ServletOutputStream;
import javax.xml.namespace.QName;
import java.io.IOException;
@@ -67,9 +68,9 @@
/** . */
private Map<QName, PageParameterDef> paramDefs;
- public PortalPrepareResponse(HttpServletResponse response) throws PortletInvokerException
+ public PortalPrepareResponse(HttpServletRequest request, HttpServletResponse response) throws PortletInvokerException
{
- super(response);
+ super(request, response);
//
this.windowDefs = new HashMap<String, WindowDef>();
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalRenderResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalRenderResponse.java 2008-02-10 20:44:21 UTC (rev 9923)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalRenderResponse.java 2008-02-10 22:20:27 UTC (rev 9924)
@@ -43,6 +43,7 @@
import org.jboss.portal.common.util.ParameterMap;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletRequest;
import javax.xml.namespace.QName;
import java.util.Map;
import java.util.HashMap;
@@ -65,12 +66,13 @@
private Map<String, WindowResult> windowResults;
public PortalRenderResponse(
+ HttpServletRequest request,
HttpServletResponse response,
PagePortletControllerContext portletControllerContext,
PageNavigationalState pageState,
PortalPrepareResponse prepareResponse) throws PortletInvokerException
{
- super(response);
+ super(request, response);
//
Set<QName> pageParameterNames = prepareResponse.getPageParameterNames();
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalResponse.java 2008-02-10 20:44:21 UTC (rev 9923)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalResponse.java 2008-02-10 22:20:27 UTC (rev 9924)
@@ -26,6 +26,7 @@
import javax.servlet.http.HttpServletResponseWrapper;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletRequest;
/**
* Expose stuff common to action and render response.
@@ -39,9 +40,19 @@
/** . */
private int count = 0;
- public PortalResponse(HttpServletResponse response) throws PortletInvokerException
+ /** . */
+ private final String pageId;
+
+ public PortalResponse(HttpServletRequest request, HttpServletResponse response) throws PortletInvokerException
{
super(response);
+
+ // We don't keep a ref to the request since this will be used mainly during in a dispatch to a JSP
+ // and the info returned by a request after a dispatch are not the same than before (like the path info).
+ String pageId = request.getRequestURI();
+
+ //
+ this.pageId = pageId;
}
/**
@@ -50,6 +61,6 @@
*/
public String nextId()
{
- return "" + count++;
+ return pageId + "/" + count++;
}
}
16 years, 5 months
JBoss Portal SVN: r9923 - modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-10 15:44:21 -0500 (Sun, 10 Feb 2008)
New Revision: 9923
Modified:
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/home.jsp
Log:
home page did not have the right portlet ref
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/home.jsp
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/home.jsp 2008-02-10 17:51:37 UTC (rev 9922)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/home.jsp 2008-02-10 20:44:21 UTC (rev 9923)
@@ -9,7 +9,7 @@
<portal:page>
<div class="home-content full-width">
<div class="third-width float-right">
- <jbp:portlet name="GoogleMap" applicationName="google-map-portlet" />
+ <jbp:portlet name="GoogleMap" applicationName="samples-google-map-portlet" />
</div>
<h2 class="title">Demo Page Title</h2>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
16 years, 5 months
JBoss Portal SVN: r9922 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/spi and 4 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-10 12:51:37 -0500 (Sun, 10 Feb 2008)
New Revision: 9922
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ServerInfoTestCase.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractPortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java
Log:
- make javascript serveable from a resource
- fix a bug in the portal side that was not sending the correct window id during the different life cycle phase and so the getNamespace() value was not correct in render/resource
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java 2008-02-10 15:10:14 UTC (rev 9921)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java 2008-02-10 17:51:37 UTC (rev 9922)
@@ -28,9 +28,12 @@
import org.jboss.portal.portlet.invocation.response.RevalidateMarkupResponse;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.CacheInfo;
+import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.portlet.cache.CacheScope;
import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.Mode;
import javax.portlet.MimeResponse;
import javax.portlet.PortletURL;
@@ -41,6 +44,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.util.Locale;
+import java.util.Set;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -119,17 +123,36 @@
MediaType requestedMediaType = MediaType.parseMimeType(contentType);
// Get the response media type
- ContentInfo info = invocation.getContext().getMarkupInfo();
- MediaType responseMediaType = info.getContentType();
+// ContentInfo info = invocation.getContext().getMarkupInfo();
+// MediaType responseMediaType = info.getContentType();
// Check if the requested media type is allowed as a subtype of the main response
- if (!responseMediaType.isAllowedSubType(requestedMediaType))
+// if (!responseMediaType.isAllowedSubType(requestedMediaType))
+// {
+// throw new IllegalArgumentException("Content type not accepted");
+// }
+
+ //
+ Mode currentMode = preq.invocation.getMode();
+
+ PortletInfo info = preq.container.getInfo();
+ CapabilitiesInfo capabilities = info.getCapabilities();
+ Set<ModeInfo> compatibleModes = capabilities.getModes(contentType);
+ for (ModeInfo modeInfo : compatibleModes)
{
- throw new IllegalArgumentException("Content type not accepted");
+ if (currentMode.equals(modeInfo.getMode()))
+ {
+ // Set the content type
+ fragment.setContentType(contentType);
+
+ //
+ return;
+ }
}
- // Set the content type
- fragment.setContentType(contentType);
+ //
+ throw new IllegalArgumentException("Mime type " + contentType + " not accepted as content type");
+
}
catch (MimeTypeParseException e)
{
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2008-02-10 15:10:14 UTC (rev 9921)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2008-02-10 17:51:37 UTC (rev 9922)
@@ -40,6 +40,8 @@
{
/**
+ * todo : move me to client content // see if it is still needed with CC/PP
+ *
* Return information about the underlying http wire this invocation is performed.
*
* @return the stream info
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ServerInfoTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ServerInfoTestCase.java 2008-02-10 15:10:14 UTC (rev 9921)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/api/portletcontext/ServerInfoTestCase.java 2008-02-10 17:51:37 UTC (rev 9922)
@@ -46,7 +46,7 @@
{
/** . */
- private static final String VERSION_REGEX = "JBossPortal/[0-9]+\\.[0-9]+";
+ private static final String VERSION_REGEX = "JBossPortletContainer/[0-9]+\\.[0-9]+";
/** . */
private static final Pattern VERSION_PATTERN = Pattern.compile(VERSION_REGEX, Pattern.CASE_INSENSITIVE);
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java 2008-02-10 15:10:14 UTC (rev 9921)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java 2008-02-10 17:51:37 UTC (rev 9922)
@@ -50,14 +50,19 @@
elt.setAttribute("src", resourceURL.toString());
elt.appendChild(elt.getOwnerDocument().createTextNode(""));
resp.addProperty("script", elt);
+
+ //
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+ writer.print("<a href='javascript:" + resp.getNamespace() + "_handle()'>Click me to trigger script</a>");
}
public void serveResource(ResourceRequest req, ResourceResponse resp) throws PortletException, IOException
{
-// String namespace =resp.getNamespace();
+ String namespace =resp.getNamespace();
resp.setContentType("text/javascript");
PrintWriter writer = resp.getWriter();
- writer.print("alert('shouldwork');");
+ writer.print("function " + namespace + "_handle() { alert('Some alert'); }");
writer.close();
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractPortletControllerContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractPortletControllerContext.java 2008-02-10 15:10:14 UTC (rev 9921)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractPortletControllerContext.java 2008-02-10 17:51:37 UTC (rev 9922)
@@ -318,7 +318,7 @@
actionInvocation.setServerContext(new AbstractServerContext(req, resp));
actionInvocation.setInstanceContext(instanceContext);
actionInvocation.setUserContext(new AbstractUserContext(req));
- actionInvocation.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
+ actionInvocation.setWindowContext(new AbstractWindowContext(windowId));
actionInvocation.setPortalContext(new TestPortalContext());
actionInvocation.setSecurityContext(new AbstractSecurityContext(req));
actionInvocation.setRequestContext(new AbstractRequestContext(req));
@@ -355,7 +355,7 @@
resourceInvocation.setServerContext(new AbstractServerContext(req, resp));
resourceInvocation.setInstanceContext(instanceContext);
resourceInvocation.setUserContext(new AbstractUserContext(req));
- resourceInvocation.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
+ resourceInvocation.setWindowContext(new AbstractWindowContext(windowId));
resourceInvocation.setPortalContext(new TestPortalContext());
resourceInvocation.setSecurityContext(new AbstractSecurityContext(req));
resourceInvocation.setRequestContext(new AbstractRequestContext(req));
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java 2008-02-10 15:10:14 UTC (rev 9921)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java 2008-02-10 17:51:37 UTC (rev 9922)
@@ -73,7 +73,7 @@
}
else
{
- return false;
+ return true;
}
}
16 years, 5 months
JBoss Portal SVN: r9921 - in modules/portlet/trunk/test/src: test/resources/portal/samples/basic-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-10 10:10:14 -0500 (Sun, 10 Feb 2008)
New Revision: 9921
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortletResult.java
Modified:
modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/WEB-INF/portlet.xml
Log:
PortletResult should have been removed
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortletResult.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortletResult.java 2008-02-10 14:56:47 UTC (rev 9920)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortletResult.java 2008-02-10 15:10:14 UTC (rev 9921)
@@ -1,59 +0,0 @@
-/******************************************************************************
- * 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.jsp;
-
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.test.jsp.WindowDef;
-
-/**
- * Combines the invocation of a portlet and the info on the portlet JSP tag. It does
- * not need to be exposed out of this package.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletResult
-{
-
- /** . */
- private final WindowDef windowDef;
-
- /** . */
- private final PortletInvocationResponse response;
-
- public PortletResult(WindowDef windowDef, PortletInvocationResponse response)
- {
- this.windowDef = windowDef;
- this.response = response;
- }
-
- public WindowDef getWindowDef()
- {
- return windowDef;
- }
-
- public PortletInvocationResponse getResponse()
- {
- return response;
- }
-}
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-10 14:56:47 UTC (rev 9920)
+++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/WEB-INF/portlet.xml 2008-02-10 15:10:14 UTC (rev 9921)
@@ -22,10 +22,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+<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_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- version="1.0">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
<portlet>
<portlet-name>ExceptionPortlet</portlet-name>
@@ -43,8 +43,10 @@
<portlet-class>org.jboss.portal.portlet.portal.samples.basic.HeaderPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
- <mime-type>text/javascript</mime-type>
</supports>
+ <supports>
+ <mime-type>text/javascript</mime-type>
+ </supports>
<portlet-info>
<title>HeaderPortlet</title>
</portlet-info>
16 years, 5 months
JBoss Portal SVN: r9920 - in modules/portlet/trunk/test/src: main/java/org/jboss/portal/portlet/test/jsp and 5 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-10 09:56:47 -0500 (Sun, 10 Feb 2008)
New Revision: 9920
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/HeadersTag.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalRenderResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.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/WEB-INF/portal.tld
modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo3.jsp
modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/header.jsp
Log:
start to add support for headers, need to work on resource with a content type different from text/html
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/basic/HeaderPortlet.java 2008-02-10 14:56:47 UTC (rev 9920)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.samples.basic;
+
+import org.w3c.dom.Element;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceURL;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class HeaderPortlet extends GenericPortlet
+{
+ public void render(RenderRequest req, RenderResponse resp) throws PortletException, IOException
+ {
+ ResourceURL resourceURL = resp.createResourceURL();
+
+ //
+ Element elt = resp.createElement("script");
+ elt.setAttribute("type", "text/javascript");
+ elt.setAttribute("src", resourceURL.toString());
+ elt.appendChild(elt.getOwnerDocument().createTextNode(""));
+ resp.addProperty("script", elt);
+ }
+
+ public void serveResource(ResourceRequest req, ResourceResponse resp) throws PortletException, IOException
+ {
+// String namespace =resp.getNamespace();
+ resp.setContentType("text/javascript");
+ PrintWriter writer = resp.getWriter();
+ writer.print("alert('shouldwork');");
+ writer.close();
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalRenderResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalRenderResponse.java 2008-02-10 13:49:29 UTC (rev 9919)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/PortalRenderResponse.java 2008-02-10 14:56:47 UTC (rev 9920)
@@ -110,6 +110,11 @@
return pageState;
}
+ public Set<String> getWindowIds()
+ {
+ return windowResults.keySet();
+ }
+
public WindowResult getWindowResult(String windowId)
{
return windowResults.get(windowId);
@@ -211,6 +216,15 @@
}
}
+ public boolean isMaximizedWindow(String windowId)
+ {
+ if (windowId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return windowId.equals(getMaximizedWindowId());
+ }
+
public String getMaximizedWindowId()
{
if (pageState != null)
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/HeadersTag.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/HeadersTag.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/HeadersTag.java 2008-02-10 14:56:47 UTC (rev 9920)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * 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.jsp.taglib;
+
+import org.jboss.portal.portlet.test.jsp.PortalRenderResponse;
+import org.jboss.portal.portlet.test.jsp.WindowResult;
+import org.jboss.portal.portlet.test.jsp.PortalPrepareResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+import org.jboss.portal.common.xml.XMLTools;
+import org.w3c.dom.Element;
+
+import javax.servlet.jsp.JspException;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class HeadersTag extends PortalSimpleTagSupport
+{
+
+ public HeadersTag()
+ {
+ super(false);
+ }
+
+ public void doTag(PortalPrepareResponse prepareResponse) throws JspException, IOException
+ {
+ }
+
+ public void doTag(PortalRenderResponse renderResponse) throws JspException, IOException
+ {
+ String maxmizedWindowId = renderResponse.getMaximizedWindowId();
+
+ //
+ for (String windowId : renderResponse.getWindowIds())
+ {
+ if (maxmizedWindowId == null || maxmizedWindowId.equals(windowId))
+ {
+ WindowResult result = renderResponse.getWindowResult(windowId);
+
+ //
+ if (result != null)
+ {
+ PortletInvocationResponse response = result.getResponse();
+
+ //
+ if (response instanceof FragmentResponse)
+ {
+ FragmentResponse fragmentResponse = (FragmentResponse)response;
+
+ //
+ ResponseProperties properties = fragmentResponse.getProperties();
+
+ //
+ if (properties != null)
+ {
+ MultiValuedPropertyMap<Element> markupHeaders = properties.getMarkupHeaders();
+ for (String key : markupHeaders.keySet())
+ {
+ List<Element> headElement = markupHeaders.getValues(key);
+ for (Element headerValue : headElement)
+ {
+ try
+ {
+ String serializedElement = XMLTools.toString(headerValue);
+ getJspContext().getOut().print(serializedElement);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java 2008-02-10 13:49:29 UTC (rev 9919)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/jsp/taglib/PortalSimpleTagSupport.java 2008-02-10 14:56:47 UTC (rev 9920)
@@ -38,19 +38,49 @@
*/
public class PortalSimpleTagSupport extends SimpleTagSupport
{
+
+ private final boolean pageScoped;
+
+ public PortalSimpleTagSupport()
+ {
+ this(true);
+ }
+
+ public PortalSimpleTagSupport(boolean pageScoped)
+ {
+ this.pageScoped = pageScoped;
+ }
+
+ public boolean isPageScoped()
+ {
+ return pageScoped;
+ }
+
private PortalResponse getPortalResponse()
{
PageContext pageContext = (PageContext)getJspContext();
return (PortalResponse)pageContext.getResponse();
}
- public final void doTag() throws JspException, IOException
+ protected final boolean isActive()
{
- PageTag pageTag = (PageTag)findAncestorWithClass(this, PageTag.class);
+ if (pageScoped)
+ {
+ PageTag pageTag = (PageTag)findAncestorWithClass(this, PageTag.class);
- //
- if (pageTag != null && pageTag.status == PageTag.Status.ACTIVE)
+ //
+ return pageTag != null && pageTag.status == PageTag.Status.ACTIVE;
+ }
+ else
{
+ return false;
+ }
+ }
+
+ public final void doTag() throws JspException, IOException
+ {
+ if (isActive())
+ {
PortalResponse portalResponse = getPortalResponse();
//
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-10 13:49:29 UTC (rev 9919)
+++ modules/portlet/trunk/test/src/test/resources/portal/samples/basic-war/WEB-INF/portlet.xml 2008-02-10 14:56:47 UTC (rev 9920)
@@ -38,4 +38,16 @@
</portlet-info>
</portlet>
+ <portlet>
+ <portlet-name>HeaderPortlet</portlet-name>
+ <portlet-class>org.jboss.portal.portlet.portal.samples.basic.HeaderPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <mime-type>text/javascript</mime-type>
+ </supports>
+ <portlet-info>
+ <title>HeaderPortlet</title>
+ </portlet-info>
+ </portlet>
+
</portlet-app>
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portal.tld
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portal.tld 2008-02-10 13:49:29 UTC (rev 9919)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/WEB-INF/portal.tld 2008-02-10 14:56:47 UTC (rev 9920)
@@ -127,4 +127,10 @@
</attribute>
</tag>
+ <tag>
+ <name>headers</name>
+ <tag-class>org.jboss.portal.portlet.test.jsp.taglib.HeadersTag</tag-class>
+ <body-content>empty</body-content>
+ </tag>
+
</taglib>
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-10 13:49:29 UTC (rev 9919)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/demo/demo3.jsp 2008-02-10 14:56:47 UTC (rev 9920)
@@ -17,6 +17,7 @@
</jsp:attribute>
<jsp:attribute name="rightcol">
<jbp:portlet name="ExceptionPortlet" applicationName="samples-basic"/>
+ <jbp:portlet name="HeaderPortlet" applicationName="samples-basic"/>
</jsp:attribute>
</jbp:layout1>
</portal:page>
Modified: modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/header.jsp
===================================================================
--- modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/header.jsp 2008-02-10 13:49:29 UTC (rev 9919)
+++ modules/portlet/trunk/test/src/test/resources/simple-portal-war/layouts/header.jsp 2008-02-10 14:56:47 UTC (rev 9920)
@@ -1,3 +1,4 @@
+<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -6,6 +7,7 @@
<head>
<title>Portlet Container 2.0</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/master.css" type="text/css"/>
+<portal:headers/>
</head>
<body>
16 years, 5 months