JBoss Portal SVN: r10187 - in modules/portlet/trunk/portal/src/main/resources/simple-portal-war: WEB-INF/tags/portal and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-03-03 20:21:56 -0500 (Mon, 03 Mar 2008)
New Revision: 10187
Modified:
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jsp/error.jsp
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo3.jsp
Log:
- Minor improvements and error fixes.
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jsp/error.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jsp/error.jsp 2008-03-04 01:21:10 UTC (rev 10186)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jsp/error.jsp 2008-03-04 01:21:56 UTC (rev 10187)
@@ -1,6 +1,5 @@
<%@ page import="org.jboss.portal.common.util.Exceptions" %>
-<%@ page import="java.io.PrintWriter" %>
-<%@ page language="java" %>
+<%@ page language="java" %>
<div class="portlet">
<div class="portlet-frame">
@@ -8,38 +7,45 @@
<div class="header-layer full-width">
<div class="title two-third-width float-left">
<h2>
- ${requestScope['org.jboss.portal.portlet.portal.error.portlet_name']} ${requestScope['org.jboss.portal.portlet.portal.error.status'] == 'not_found' ? ' not found' : ''}
+ ${requestScope['org.jboss.portal.portlet.portal.error.portlet_name']} ${requestScope['org.jboss.portal.portlet.portal.error.status'] == 'not_found' ? ' not found' : ''}
</h2>
</div>
</div>
</div>
<h3 class="error-header">Portlet was not rendered</h3>
+
<div class="error-container">
- <ul>
- <li>
- <span>Error status:</span> ${requestScope['org.jboss.portal.portlet.portal.error.status']}
- </li>
- <li>
- <span>Portlet name:</span> ${requestScope['org.jboss.portal.portlet.portal.error.portlet_name']}
- </li>
- <li>
- <span>Portlet application name:</span> ${requestScope['org.jboss.portal.portlet.portal.error.application_name']}
- </li>
- <li>
- <span>Exception:</span> ${!empty requestScope['org.jboss.portal.portlet.portal.error.cause'] ? requestScope['org.jboss.portal.portlet.portal.error.cause'] : 'Error cause unavailable'}
- <%if (request.getAttribute("org.jboss.portal.portlet.portal.error.cause") != null){%>
- <a class="option" href="#exception-stack-trace" title="${requestScope['org.jboss.portal.portlet.portal.error.cause']}" rel="shadowbox;width=900;height=400">${!empty requestScope['org.jboss.portal.portlet.portal.error.cause'] ? 'View Stack Trace' : ''}</a>
+ <ul>
+ <li>
+ <span>Error status:</span> ${requestScope['org.jboss.portal.portlet.portal.error.status']}
+ </li>
+ <li>
+ <span>Portlet name:</span> ${requestScope['org.jboss.portal.portlet.portal.error.portlet_name']}
+ </li>
+ <li>
+ <span>Portlet application name:</span> ${requestScope['org.jboss.portal.portlet.portal.error.application_name']}
+ </li>
+ <li>
+ <span>Exception:</span> ${!empty requestScope['org.jboss.portal.portlet.portal.error.cause'] ? requestScope['org.jboss.portal.portlet.portal.error.cause'] : 'Error cause unavailable'}
+ <%
+ if (request.getAttribute("org.jboss.portal.portlet.portal.error.cause") != null)
+ {
+ %>
+ <a class="option" href="#exception-stack-trace"
+ title="${requestScope['org.jboss.portal.portlet.portal.error.cause']}"
+ rel="shadowbox;width=900;height=400">${!empty requestScope['org.jboss.portal.portlet.portal.error.cause'] ? 'View Stack Trace' : ''}</a>
+
<div id="exception-stack-trace" class="hidden">
<div class="exception">
- <%=Exceptions.toHTML((Throwable)request.getAttribute("org.jboss.portal.portlet.portal.error.cause"))%>
+ <%=Exceptions.toHTML((Throwable)request.getAttribute("org.jboss.portal.portlet.portal.error.cause"))%>
</div>
</div>
- <%}%>
- </li>
- <li>
- <span>Window id:</span> ${requestScope['org.jboss.portal.portlet.portal.error.window_id']}
- </li>
- </ul>
- </div>
+ <%}%>
+ </li>
+ <li>
+ <span>Window id:</span> ${requestScope['org.jboss.portal.portlet.portal.error.window_id']}
+ </li>
+ </ul>
+ </div>
</div>
</div>
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag 2008-03-04 01:21:10 UTC (rev 10186)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag 2008-03-04 01:21:56 UTC (rev 10187)
@@ -12,7 +12,7 @@
<div class="header full-width">
<div class="header-layer full-width">
<div class="title two-third-width float-left"><h2><portal:portlettitle/></h2></div>
- <div class="controls third-width float-right"> <
+ <div class="controls third-width float-right">
<span class="mode-button">
<a href="<portal:portleturl windowState='maximized'/>"><img
src="${pageContext.request.contextPath}/images/icon-maximize.gif" alt=""/></a>
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo3.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo3.jsp 2008-03-04 01:21:10 UTC (rev 10186)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo3.jsp 2008-03-04 01:21:56 UTC (rev 10187)
@@ -5,10 +5,10 @@
<%@ page isELIgnored="false" %>
<%@ include file="/layouts/header.jsp" %>
-
+
<portal:page>
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google" localName="zipcode" value="80201"/>
-
+
<xportal:2columns>
<jsp:attribute name="leftcol">
<xportal:portlet name="Foo" applicationName="bar"/>
@@ -17,8 +17,8 @@
<xportal:portlet name="ExceptionPortlet" applicationName="samples-basic-portlet"/>
<xportal:portlet name="HeaderPortlet" applicationName="samples-basic-portlet" id="header-portlet"/>
- <xportal:portlet name="FailDuringInitPortlet" applicationName="samples-basic-portlet" id="header-portlet"/>
-
+ <xportal:portlet name="FailDuringInitPortlet" applicationName="samples-basic-portlet"/>
+ <xportal:portlet name="ExceptionPortlet" applicationName="samples-basic-portlet"/>
</jsp:attribute>
</xportal:2columns>
16 years, 2 months
JBoss Portal SVN: r10186 - modules/portlet/trunk/docs/user-guide/en/modules.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-03-03 20:21:10 -0500 (Mon, 03 Mar 2008)
New Revision: 10186
Modified:
modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml
Log:
- Improved documentation with better tags where appropriate
Modified: modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml
===================================================================
--- modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml 2008-03-03 22:32:07 UTC (rev 10185)
+++ modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml 2008-03-04 01:21:10 UTC (rev 10186)
@@ -15,71 +15,98 @@
<title>Simple Portal</title>
<sect1>
<title>Motivation</title>
- <para>The JBoss Portlet Container product has developed a portal called <emphasis>Simple Portal</emphasis>. The
- goal of the simple portal is to provide an easy to use portal for small sized sites that do require only
- aggregation of portlets in portal pages. In particular the following features are not addressed by the
- simple portal product</para>
+ <para>A spin-off of the JBoss Portlet Container product is a portal called<emphasis>Simple Portal</emphasis>. As
+ its name implies, Simple Portal provides an easy to use portal for small-sized sites that only require
+ aggregation of portlets in portal pages, without the extra features of a full-fledged portal. In particular the
+ following features are not addressed by Simple Portal:
+ </para>
+ <informaltable frame='none'>
+ <tgroup cols='2'>
+ <tbody>
+ <row>
+ <entry>Security</entry>
+ <entry>
+ Simple Portal relies on the servlet container authentication and does not provide any kind of
+ security enforcement
+ </entry>
+ </row>
+ <row>
+ <entry>Dynamic page creation</entry>
+ <entry>Simple Portal relies on JSP pages to create portal pages</entry>
+ </row>
+ <row>
+ <entry>Identity integration</entry>
+ <entry>Integration with identity systems is not provided, in particular access to the user's identity
+ and profile
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ <para>On the other hand, Simple Portal is much simpler than a traditionnal portal server because it just consist
+ in a few modules that only handles the basic protal concerns: the aggregation of portlet components in a web
+ page.
+ </para>
+ <para>The targeted use for Simple Portal are therefore restricted to:</para>
<itemizedlist>
- <listitem>Security: the simple portal relies on the servlet container authentication and does not provide
- any kind of security enforcement.</listitem>
- <listitem>Dynamic page creation: the simple portal relies on JSP pages to create portal pages.</listitem>
- <listitem>Identity integration: integration with identity system is not provided, in particular
- access to the user's identity and profile.</listitem>
- </itemizedlist>
- <para>On the other hand the simple portal is much simpler than a traditionnal portal server because it just
- consist in a few modules that handles the basic concerns of portal which is the aggregation of portlet components
- in a web page.</para>
- <para>Therefore the goals of this product are restricted to</para>
- <itemizedlist>
<listitem>Portlet development</listitem>
<listitem>Static portals build on top of the JSR286 specification</listitem>
</itemizedlist>
</sect1>
<sect1>
<title>Development</title>
-
- <para></para>
-
<sect2>
<title>Portlet deployment</title>
- <para>The simple portal integrates with a few web containers in order to provide handling of portlet
- deployment and runtime. This feature is provided by a component of the JBoss Portal project called
- the <emphasis>Web SPI</emphasis> which provides a Service Provider Interface that the JBoss Portal
- products can rely on. In particular the JBoss Portlet Container uses the Web SPI in order to be
- aware of the deployment life cycle of war files that contains portlet components. The SPI defines
- two levels of integrations.</para>
- <para>The SPI implementation level 1 works with any web container and relies on the fact that the portlet
- developer needs to insert a specific servlet in the <filename>web.xml</filename> file of its portlet application.</para>
- <para>The SPI implementation level 2 is based on more advanced integration with specific web containers
- and provides a transparent integration which means that any portlet application can be deployed without
- requiring any proprietary modification of the war file, keeping your application vendor agnostic. A few
- containers are supported:</para>
+ <para>Simple Portal integrates with a few web containers in order to provide handling of portlet deployment and
+ runtime. This feature leverages JBoss Portal's Web Service Provider Interface (SPI). In particular, JBoss
+ Portlet Container uses the Web SPI in order to transparently react to the life cycle of WAR files that
+ contains portlet components as they are deployed or undeployed on the target servlet container. The SPI
+ defines two levels of integrations.
+ </para>
+ <para>SPI implementation level 1 works with any web container but relies on portlet developers to insert a
+ specific servlet in the
+ <filename>web.xml</filename>
+ descriptor of their portlet applications.
+ </para>
+ <para>SPI implementation level 2 is based on more advanced integration with specific web containers and
+ provides transparent deployment of portlet applications without requiring any proprietary modification of
+ the war file, keeping your application vendor agnostic. A few containers are supported:
+ </para>
<itemizedlist>
<listitem>Tomcat 6.0.x</listitem>
<listitem>JBoss Application Server 4.2.x</listitem>
</itemizedlist>
</sect2>
<sect2>
- <title>The portal tag library</title>
- <para>The simple portal relies on the JSP technology to build pages for several good reasons:</para>
+ <title>Simple Portal tag library</title>
+ <para>Simple Portal relies on the JSP technology to build pages for several good reasons:</para>
<itemizedlist>
- <listitem>JSP is a good enough technology for building simple portal pages. Obviously this does not mean that
- a portlet applications is required to use JSP, as usual portlet applications are developed using your
- favorite web framework.</listitem>
- <listitem>Every java web developer knows JSPs.</listitem>
- <listitem>It is easy and straightforward to create a portal JSP page and there is no need for advanced
- tooling.</listitem>
- <listitem>A lot of various frameworks are compatible with JSP and it is possible to leverage them.
- For instance if you are familliar with Sitemesh for skinning an application then you can mix it with the
- portal tag library.</listitem>
+ <listitem>JSPs provide an adequate technology for building portal pages. This does not mean that portlet
+ applications are required to use JSP, just that Simple Portal uses JSPs to organize portlets as pages.
+ Portlets themselves are independent of the technology used for pages and can be developed using whichever
+ technology or web framework you prefer/require.
+ </listitem>
+ <listitem>Java web developers are familiar with JSP technology.</listitem>
+ <listitem>JSP makes it is easy and straightforward to create portal pages without requiring advanced tooling
+ and, in most instances, can leverage IDEs support for JSPs.
+ </listitem>
+ <listitem>Several web frameworks are compatible with JSP and it is possible to leverage them. For example,
+ it is possible to use Sitemesh for application skinning and still leverage Simple Portal's JSP tag
+ library.
+ </listitem>
</itemizedlist>
- <para>If you need a more advanced page creation system then you should rather consider to use a more advanced
- portal product such as JBoss Portal which will answer your needs.</para>
+ <page>If you need more advanced page creation capabilities, you should consider using a more advanced portal
+ product such as JBoss Portal.
+ </page>
<sect3>
<title>Page creation</title>
- <para>Any JSP page can contain portlets, the only requirement to make this possible is to have
- the page located in the simple portal war file and to use the portal tag library.</para>
- <programlisting><![CDATA[
+ <para>Any JSP page can contain portlets, the only requirement to make this possible is to have the page
+ located in Simple Portal's WAR file and to use the portal tag library.
+ </para>
+ <para>Let's look at a minimal portal page using the portal tag library:</para>
+ <example>
+ <title>Minimal portal page</title>
+ <programlisting><![CDATA[
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
<?xml version="1.0" encoding="UTF-8"?>
@@ -98,154 +125,342 @@
</portal:page>
</body>
</html>]]></programlisting>
- <para>The example shows a portal page that is very minimal. Among the HTML markup and the mandatory JSP
- instructions you can find the different elements that will tell the simple portal how to integrate portlets
- in the page.</para>
+ </example>
+
<para>The portal tag library declaration enables the JSP compiler to know about the existence of the simple
- portal. It is declared by the JSP declaration <emphasis><%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %></emphasis>
- and it binds the portal tag library to the <literal>portal</literal> namespace.</para>
- <para>The first tag that uses the <literal>portal</literal> namespace is the <literal>page</literal> tag which
- defines a logical scope which have several impacts on the page.</para>
+ portal. It is declared by the JSP declaration
+ <code><%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %></code>
+ and it binds the portal tag library to the
+ <sgmltag class="namespace">portal</sgmltag>
+ namespace.
+ </para>
+ <para>The interesting part of the markup is the
+ <sgmltag class="element">portal:page</sgmltag>
+ element and its children. The
+ <sgmltag class="element">page</sgmltag>
+ tag defines a logical scope that is used by Simple Portal to generate markup:
+ </para>
<itemizedlist>
<listitem>It defines a container for a set of portlets.</listitem>
- <listitem>When a portlet is maximized it defines the zone in the page that will be replaced by the maxmized
- portlet markup.</listitem>
+ <listitem>It defines the page area that will be replaced entirely by a maximized portlet markup (when the
+ maximized window state is requested).
+ </listitem>
<listitem>It defines a scope for the coordination features.</listitem>
</itemizedlist>
- <para>One page can be specified per JSP page but in the future we should offer the capability to have
- several pages in a single JSP page.
+ <para>Currently, only one portal page can be specified per JSP file but this should be extended to several
+ portal pages per JSP file in future versions of JBoss Portlet Container.
</para>
- <para>Inside the portal page tag is declared a reference to a portlet using the <literal>portlet</literal>
- tag. The mandatory attributes for this tag are <literal>name</literal> and <literal>applicationName</literal> that
- are used to locate the deployed portlet. The <literal>applicationName</literal> refers to the name of the war
- file containing your portlet without the extension <filename>.war</filename> and the <literal>name</literal>
- attribute is the portlet name declared in the <filename>portlet.xml</filename> file of the application. Likewise
- the page tag the portlet tag does not produce any markup, it is just a declaration to a portlet to instruct
- the simple portal where it can find the portlet and how it is going to use it.</para>
- <para>Finally the <literal>portletmarkup</literal> tag is the first tag to produce markup. It simply inserts
- the markup created by the referenced portlet when the page is rendered.</para>
+ <para>Access to portlet information within a portal page is done by defining a reference to the portlet
+ using the
+ <sgmltag class="element">portlet</sgmltag>
+ tag. The mandatory attributes for this tag are
+ <sgmltag class="attribute">name</sgmltag>
+ and
+ <sgmltag class="attribute">applicationName</sgmltag>
+ that are used to locate the deployed portlet. The
+ <sgmltag class="attribute">applicationName</sgmltag>
+ refers to the name of the WAR file containing your portlet application without the extension
+ <filename>.war</filename>
+ and the
+ <sgmltag class="element">name</sgmltag>
+ attribute refers to the portlet name as declared by the
+ <sgmltag class="element">portlet-name</sgmltag>
+ element in the
+ <filename>portlet.xml</filename>
+ file of your portlet application WAR file. Similarly to the
+ <sgmltag class="element">page</sgmltag>
+ tag, the
+ <sgmltag class="element">portlet</sgmltag>
+ tag does not produce any markup but rather makes your portlet available to Simple Portal.
+ </para>
+ <para>The portlet markup is output using the
+ <sgmltag class="element">portletmarkup</sgmltag>
+ tag. This tag is replaced by the referenced portlet markup (without any decoration) when the page is
+ rendered.
+ </para>
</sect3>
<sect3>
<title>Portlet title</title>
- <para>We have seen in the previous example how to place a portlet in a JSP page but for the sake of simplicity
- we have not yet explained how to create a complete portlet representation. The tag <literal>portlettitle</literal>
- is used to insert the portlet title that the portlet produced during the render phase.</para>
- <programlisting><![CDATA[
+ <para>The previous example only output the portlet markup. Let's examine how to output a complete portlet
+ representation. The
+ <sgmltag class="title">portlettitle</sgmltag>
+ tag is used to insert the render phase generated title of the portlet referenced by the enclosing
+ <sgmltag class="element">portlet</sgmltag>
+ element:
+ </para>
+ <example>
+ <title>Portlet title</title>
+ <programlisting><![CDATA[
<portal:portlet name="JSPPortlet" applicationName="samples-jsp-portlet">
...
<portal:portlettitle/>
...
</portal:portlet>]]></programlisting>
+ </example>
+
</sect3>
<sect3>
<title>Portlet urls</title>
- <para>The capability to create urls for a portlet is very powerful and can be used to create controls
- such as a button that will maximize the portlet or change its mode to another mode. The <literal>portleturl</literal>
- creates such urls and insert them in the page.</para>
- <programlisting><![CDATA[
+ <para>It is also possible to output URLs targeting a given portlet. This can be used to create controls to
+ change the mode or window state of the portlet. The
+ <sgmltag class="element">portleturl</sgmltag>
+ tag outputs such URLs and insert them in the page.
+ </para>
+ <example>
+ <title>Portlet URL</title>
+ <programlisting><![CDATA[
<portal:portlet name="JSPPortlet" applicationName="samples-jsp-portlet">
...
<portal:portleturl windowState="maximized" mode="edit"/>
...
</portal:portlet>]]></programlisting>
- <para>The portlet url tag has two optional attributes. The <literal>windowState</literal> attribute allows
- to change the window state in the url and the <literal>mode</literal> attribute controls the mode in
- the url.</para>
+ </example>
+
+ <para>The
+ <sgmltag class="element">portleturl</sgmltag>
+ tag has two optional attributes. The
+ <sgmltag class="attribute">windowState</sgmltag>
+ attribute allows to change the window state of the associated portlet while the
+ <sgmltag class="attribute">mode</sgmltag>
+ attribute controls the portlet mode.
+ </para>
</sect3>
<sect3>
<title>Page headers</title>
- <para>The Portlet 2 specification allows portlet to participate to the headers of the page. If you want
- to allow the portlets on the page to add header to your page then you need to insert a <literal>headers</literal>
- tag in the head section of the page, as shown in the following example.</para>
- <programlisting><![CDATA[
+ <para>The Portlet 2 specification allows portlet to participate to the headers of the page. If you want to
+ allow portlets on the page to add header information to your page then you need to insert a
+ <sgmltag class="element">headers</sgmltag>
+ tag in the
+ <sgmltag class="element">head</sgmltag>
+ section of the page, as shown in the following example:
+ </para>
+ <example>
+ <title>Adding portlets header contribution</title>
+ <programlisting><![CDATA[
<head>
<portal:headers/>
...
</head>
]]></programlisting>
- <para>This instruct the simple portal to insert the header contributed by the portlet present on the page
- at the place you specified.</para>
+ </example>
+
+ <para>This instructs Simple Portal to insert header information contributed by portlets present on the page
+ at the specified spot.
+ </para>
</sect3>
<sect3>
<title>Portlet events</title>
<para>Portlet events provides a powerful way to decouple portlets. After the process action phase, an
- optional event phase is executed by the portal and it can involve several portlet containers that will
- produce and consume events. You can read the portlet specification if you want to learn more about it.</para>
- <para>The page defines the scope of the coordination, which means that when an event
- is produced by a portlet on a page, the simple portal will locate the portlets on the same page that
- can consume this event. The matching is done using the the even qualified name.</para>
+ optional event phase is executed by the portal to process any events generated and produced by portlets.
+ We recommend that you read the portlet specification to learn more about portlet events.
+ </para>
+ <para>Coordination of portlets via events is scoped by pages. When an event is produced by a portlet on a
+ page, Simple Portal will locate all portlets on that very same page that can consume the produced event.
+ Produced events and consumer portlets are matched using the event's qualified name as specified in
+ <filename>portlet.xml</filename>.
+ </para>
</sect3>
<sect3>
<title>Public render parameters</title>
<para>Public render parameters allows several portlets on the same page to share render parameters.
- Likewise the portlet event feature, the page is the natural scope for sharing render parameters. The simple
- portal tag library allows to define initial values for such parameters allowing the developper to make
- different pages to be initialized with different values for the same parameter. </para>
- <programlisting><![CDATA[
+ Similarly to how portlet events are handled by Simple Portal, pages are natural scopes for shared render
+ parameters. Simple Portal's tag library provides for the definition of initial values for such parameters
+ allowing developpers to configure different pages initialized with different values of the same
+ parameter. This is accomplished via the
+ <sgmltag class="element">pageparam</sgmltag>
+ tag.
+ </para>
+ <example>
+ <title>Defining a shared render parameter</title>
+ <programlisting><![CDATA[
<portal:page>
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google" localName="zipcode" value="80201"/>
...
</portal:page>
]]></programlisting>
- <para>In the example the page parameter <literal>zipcode</literal> having the namespace
- <literal>urn:jboss:portal:simple:google</literal> will be initialized with the value
- <literal>80201</literal> the first time the page is rendered. The value can change
- if a portlet updates it during an interaction triggered by the end user. However it is possible
- to make this parameter unmodifiable by adding a <literal>frozen</literal> attributes with
- the value <literal>true</literal>, in that particular case the page parameter value will never change
- when a portlet tries to update it.</para>
+ </example>
+
+ <para>In the above example, we specify that the shared render parameter (or page parameter) identified by
+ the attribute pair
+ <sgmltag class="attribute">localName</sgmltag>
+ (
+ <literal>zipcode</literal>
+ in the example) and
+ <sgmltag class="attribute">namespaceURI</sgmltag>
+ (
+ <literal>urn:jboss:portal:simple:google</literal>
+ in the example) will be initialized with the value
+ <literal>80201</literal>
+ the first time the page is rendered. This value can change if any portlet supporting this shared
+ parameter updates it during an interaction triggered by the end user. However it is possible to make this
+ parameter unmodifiable (i.e. the parameter value will not change even if a portlet tries to update it) by
+ setting the optional
+ <sgmltag class="attribute">frozen</sgmltag>
+ attribute to the
+ <literal>true</literal>
+ value.
+ </para>
</sect3>
<sect3>
<title>Error handling</title>
- <para>Error handling happens at two places, the first is during page rendering and the second place
- can be triggered by a portlet url. The simple portal categorizes errors into
- several kinds and associate them with a string constant that can be used to programmatically
- handle the error.
+ <para>Errors can be handled either during page rendering or when a portlet is interacted with. Simple Portal
+ categorizes errors and associates each error type with a category name (string) that can be used to for
+ programatic handling. The error categories are as follows:
</para>
- <itemizedlist>
- <listitem><literal>not_found</literal> used when the portlet cannot be located</listitem>
- <listitem><literal>portlet_error</literal> used when the portlet throws an exception</listitem>
- <listitem><literal>internal_error</literal> used when the portlet throws an exception but that
- is recognized as an internal error</listitem>
- <listitem><literal>unavailable</literal> used when the portlet is located but is not in service</listitem>
- </itemizedlist>
+ <table frame='all' id='error_categories'>
+ <title>Error Categories</title>
+ <tgroup cols='2' align='left' colsep='1' rowsep='1'>
+ <thead>
+ <row>
+ <entry>Category name</entry>
+ <entry>Use case</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <literal>not_found</literal>
+ </entry>
+ <entry>The portlet that triggered the error cannot be located</entry>
+ </row>
+ <row>
+ <entry>
+ <literal>portlet_error</literal>
+ </entry>
+ <entry>The portlet triggered an exception</entry>
+ </row>
+ <row>
+ <entry>
+ <literal>internal_error</literal>
+ </entry>
+ <entry>The portlet triggered an unexpected exception recognized as an internal error</entry>
+ </row>
+ <row>
+ <entry>
+ <literal>unavailable</literal>
+ </entry>
+ <entry>The portlet is located but has been put out of service</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
<sect4>
<title>Error handling during render</title>
- <para>On a portlet failure during the render phase, it is possible to instruct the simple portal
- to use an alternative page in a very similar fashion that JSP defines error pages. The only difference
- is that it is not a JSP error page.</para>
- <para>During the execution of the error JSP page, several request attributes are set by the portal
- that will allow you to customize the markup.</para>
- <itemizedlist>
- <listitem><literal>org.jboss.portal.portlet.portal.error.status</literal> is a string that is the type of
- the error and the value is among the error categorization explained earler.</listitem>
- <listitem><literal>org.jboss.portal.portlet.portal.error.cause</literal> is an optional throwable object
- that is the cause of the error. For instance it could be a portlet exception.</listitem>
- <listitem><literal>org.jboss.portal.portlet.portal.error.message</literal> is a string that is the error message</listitem>
- <listitem><literal>org.jboss.portal.portlet.portal.error.portlet_name</literal> is the name of the portlet
- that produced the error.</listitem>
- <listitem><literal>org.jboss.portal.portlet.portal.error.application_name</literal> is the name of the application
- that contained the portlet that produced the error.</listitem>
- <listitem><literal>org.jboss.portal.portlet.portal.error.window_id</literal> is the id of the window that produced
- the error, it is useful when several portlet window with the same portlets are on the same page.</listitem>
- </itemizedlist>
- <para>Error page declaration is done on the portlet tag using the <literal>errorPage</literal> attribute. The value
- of that attribute is the path of the error page relative to the root of the war file. Note that it could be a
- or a plan file.</para>
- <programlisting><![CDATA[
+ <para>Simple Portal can display the content of an alternative page if, for some reason, a portlet fails
+ during the render phase. This is similar to JSP error pages.
+ </para>
+ <para>Several request attributes are set by Simple Portal so that the markup of the error page can be
+ customized appropriately. The following table sums up these request attributes and their meaning.
+ </para>
+ <table frame='all'>
+ <title>Request Attributes for Error Pages</title>
+ <tgroup cols='2' align='left' colsep='1' rowsep='1'>
+ <thead>
+ <row>
+ <entry>Attribute name</entry>
+ <entry>Meaning</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <parameter>org.jboss.portal.portlet.portal.error.status</parameter>
+ </entry>
+ <entry>A
+ <className>String</className>
+ containing the error category as detailed in
+ <xref linkend='error_categories'/>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <parameter>org.jboss.portal.portlet.portal.error.cause</parameter>
+ </entry>
+ <entry>A (possibly<literal>null</literal>)
+ <className>Throwable</className>
+ representing the cause of the error, for example, a portlet exception
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <parameter>org.jboss.portal.portlet.portal.error.message</parameter>
+ </entry>
+ <entry>A
+ <className>String</className>
+ containing the error message, if any
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <parameter>org.jboss.portal.portlet.portal.error.portlet_name</parameter>
+ </entry>
+ <entry>A
+ <className>String</className>
+ containing the name of the portlet that generated the error, as defined on the associated
+ <sgmltag class='element'>portlet</sgmltag>
+ tag
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <parameter>org.jboss.portal.portlet.portal.error.application_name</parameter>
+ </entry>
+ <entry>A
+ <className>String</className>
+ containing the name of the portlet application that generated the error, as defined on the
+ associated
+ <sgmltag class='element'>portlet</sgmltag>
+ tag
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <parameter>org.jboss.portal.portlet.portal.error.window_id</parameter>
+ </entry>
+ <entry>A
+ <className>String</className>
+ containing the identifier of the window associated with the portlet that generated the
+ error, especially useful when several portlet windows reference the same portlet
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>The
+ <sgmltag class="attribute">errorPage</sgmltag>
+ attribute of the
+ <sgmltag class="element">portlet</sgmltag>
+ tag is used to specify which error page to use for this specific portlet. The value of the attribute
+ should be the path to the error page relative to the root of the WAR file for that portlet. Note that
+ it could be a JSP or a plain file.
+ </para>
+ <example>
+ <title>Defining an error page</title>
+ <programlisting><![CDATA[
<portal:portlet name="JSPPortlet" applicationName="samples-jsp-portlet" errorPage="/WEB-INF/jsp/error.jsp">
...
</portal:portlet>
]]></programlisting>
+ </example>
+
</sect4>
<sect4>
<title>Error handling during action</title>
- <para>On a failure during an interaction triggered by a portlet, the simple portal will throw a servlet
- exception with a message value among the error categorization explained earlier.</para>
- <para>By default there is a servlet filter that catches the messages and translates them into HTTP errors.
- This filter is called <literal>ErrorHandlingFilter</literal> and is declared in the <filename>web.xml</filename>
- file of the simple portal war. If you want to handle error differently you should replace it.</para>
- <programlisting><![CDATA[
+ <para>If a a failure occurs during an interaction with a portlet, Simple Portal will throw a servlet
+ exception with a message set to one of the category names as specified in
+ <xref linkend="error_categories"/>
+ </para>
+ <para>The default error handling strategy is handled by a servlet filter that catches error messages and
+ translates them into HTTP errors. This filter is called
+ <className>ErrorHandlingFilter</className>
+ and is declared in the
+ <filename>web.xml</filename>
+ file of Simple Portal WAR file. This allows developers to change the error handling behavior if
+ desired.
+ </para>
+ <example>
+ <title>Error handling servlet filter definition</title>
+ <programlisting><![CDATA[
<web-app>
...
<filter-mapping>
@@ -254,20 +469,29 @@
</filter-mapping>
...
</web-app>]]></programlisting>
+ </example>
+
</sect4>
</sect3>
</sect2>
<sect2>
<title>Extended tag library</title>
- <para>This chapter talks about an extension of the simple portal tag library that allows the display of portlets
- pretty much as they are in classic portals. The extension is built on top the simple portal tag library
- and uses a feature of JSP 2.0 which is the tag library extension written using JSP. There is a good article
- to read about it <ulink url="http://www.onjava.com/pub/a/onjava/2004/05/12/jsp2part4.html">here</ulink>.</para>
+ <para>So far, we have examined the basic building blocks provided by Simple Portal's tag library. We will now
+ examine an extension provided to allow the display of portlets pretty much as they are rendered in classic
+ portals, that is with decorations. This extension is built on top of Simple Portal's tag library and uses
+ the JSP 2.0 tag library extension feature. A pretty good overview of this feature can be found at<ulink
+ url="http://www.onjava.com/pub/a/onjava/2004/05/12/jsp2part4.html">
+ http://www.onjava.com/pub/a/onjava/2004/05/12/jsp2part4.html</ulink>.
+ </para>
<sect3>
<title>The extended portlet tag</title>
- <para>The extended portlet is a JSP tag file located in the folder <filename>/WEB-INF/tags/portal</filename>
- of the simple portal war file.</para>
- <programlisting><![CDATA[
+ <para>The extended portlet consists of a JSP tag file located in the folder
+ <filename>/WEB-INF/tags/portal</filename>
+ of Simple Portal's WAR file.
+ </para>
+ <example>
+ <title>Example use of the extended portlet tag</title>
+ <programlisting><![CDATA[
<%@ page contentType="text/html" %>
<%@ page language="java" %>
<%@ taglib prefix="xportal" tagdir="/WEB-INF/tags/portal" %>
@@ -275,8 +499,11 @@
<xportal:portlet name="GoogleMap" applicationName="samples-google-portlet"/>
...
]]></programlisting>
- <para>You can consider this extension pretty much like a JSP include except that it is more powerful. The
- main interest is that this file can be edited and tweaked for your needs.</para>
+ </example>
+
+ <para>You can consider this extension pretty much like a JSP include, just more powerful. More specifically,
+ the JSP tag file can be edited and tweaked to your needs.
+ </para>
</sect3>
</sect2>
</sect1>
16 years, 2 months
JBoss Portal SVN: r10185 - in modules/portlet/trunk: portal/src/main/resources/simple-portal-war/demo and 8 other directories.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-03-03 17:32:07 -0500 (Mon, 03 Mar 2008)
New Revision: 10185
Added:
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/eventdebug.jsp
modules/portlet/trunk/samples/src/assemble/samples-eventdebug-portlet.xml
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml
modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/web.xml
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventA.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventB.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventC.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletA.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletB.java
modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletC.java
Modified:
modules/portlet/trunk/portal/src/build.xml
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp
modules/portlet/trunk/samples/pom.xml
Log:
initial event debugger demo
Modified: modules/portlet/trunk/portal/src/build.xml
===================================================================
--- modules/portlet/trunk/portal/src/build.xml 2008-03-03 21:23:00 UTC (rev 10184)
+++ modules/portlet/trunk/portal/src/build.xml 2008-03-03 22:32:07 UTC (rev 10185)
@@ -1009,6 +1009,7 @@
<fileset dir="${samples.tmp.dir}/samples-basic-war"/>
</jar>
+
</target>
</project>
\ No newline at end of file
Added: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/eventdebug.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/eventdebug.jsp (rev 0)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/eventdebug.jsp 2008-03-03 22:32:07 UTC (rev 10185)
@@ -0,0 +1,23 @@
+<%@ page contentType="text/html" %>
+<%@ page language="java" %>
+<%@ taglib prefix="jbp" tagdir="/WEB-INF/tags/portal" %>
+<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
+<%@ page isELIgnored="false" %>
+
+<%@ include file="/layouts/header.jsp" %>
+
+<portal:page>
+
+
+ <jbp:layout1>
+ <jsp:attribute name="leftcol">
+ <jbp:portlet name="portletA" applicationName="samples-eventdebug-portlet" id="portlet-A"/>
+ </jsp:attribute>
+ <jsp:attribute name="rightcol">
+ <jbp:portlet name="portletB" applicationName="samples-eventdebug-portlet" id="portlet-B"/>
+ <jbp:portlet name="portletC" applicationName="samples-eventdebug-portlet" id="portlet-C"/>
+ </jsp:attribute>
+
+ </jbp:layout1>
+</portal:page>
+<%@ include file="/layouts/footer.jsp" %>
\ No newline at end of file
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp 2008-03-03 21:23:00 UTC (rev 10184)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/layouts/nav/main.jsp 2008-03-03 22:32:07 UTC (rev 10185)
@@ -31,6 +31,9 @@
<li>
<a href="${pageContext.request.contextPath}/demo/demo3.jsp" class="${fn:substringAfter(pageContext.request.servletPath, 'demo/') == 'demo3.jsp' ? 'selected' : ''}">Demo3</a>
</li>
+ <li>
+ <a href="${pageContext.request.contextPath}/demo/eventdebug.jsp" class="${fn:substringAfter(pageContext.request.servletPath, 'demo/') == 'eventdebug.jsp' ? 'selected' : ''}">Event Debug</a>
+ </li>
</ul>
<br class="clear"/>
</div>
Modified: modules/portlet/trunk/samples/pom.xml
===================================================================
--- modules/portlet/trunk/samples/pom.xml 2008-03-03 21:23:00 UTC (rev 10184)
+++ modules/portlet/trunk/samples/pom.xml 2008-03-03 22:32:07 UTC (rev 10185)
@@ -34,6 +34,7 @@
<descriptor>src/assemble/samples-google-portlet.xml</descriptor>
<descriptor>src/assemble/samples-remotecontroller-portlet.xml</descriptor>
<descriptor>src/assemble/samples-jsp-portlet.xml</descriptor>
+ <descriptor>src/assemble/samples-eventdebug-portlet.xml</descriptor>
</descriptors>
</configuration>
</plugin>
Added: modules/portlet/trunk/samples/src/assemble/samples-eventdebug-portlet.xml
===================================================================
--- modules/portlet/trunk/samples/src/assemble/samples-eventdebug-portlet.xml (rev 0)
+++ modules/portlet/trunk/samples/src/assemble/samples-eventdebug-portlet.xml 2008-03-03 22:32:07 UTC (rev 10185)
@@ -0,0 +1,22 @@
+<assembly>
+ <id>eventdebug-portlet</id>
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>src/main/artifacts/eventdebug-portlet-war</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>target/classes</directory>
+ <outputDirectory>WEB-INF/classes</outputDirectory>
+ <includes>
+ <include>org/jboss/portal/portlet/samples/eventdebug/**</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+</assembly>
\ No newline at end of file
Added: modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml
===================================================================
--- modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml (rev 0)
+++ modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/portlet.xml 2008-03-03 22:32:07 UTC (rev 10185)
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2008, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <description>Event Portlet A</description>
+ <portlet-name>portletA</portlet-name>
+ <display-name>Debug Portlet A</display-name>
+ <portlet-class>org.jboss.portal.portlet.samples.eventdebug.EventPortletA</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Debug Event A</title>
+ <keywords>sample,event</keywords>
+ </portlet-info>
+ <supported-publishing-event>
+ <qname xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-publishing-event>
+ <supported-processing-event>
+ <qname xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-processing-event>
+ <supported-processing-event>
+ <qname xmlns:jbp='urn:jboss:portal:samples:eventa'>jbp:EventA</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <portlet>
+ <description>Event Portlet B</description>
+ <portlet-name>portletB</portlet-name>
+ <display-name>Debug Portlet B</display-name>
+ <portlet-class>org.jboss.portal.portlet.samples.eventdebug.EventPortletB</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Debug Event B</title>
+ <keywords>sample,event</keywords>
+ </portlet-info>
+ <supported-publishing-event>
+ <qname xmlns:jbp='urn:jboss:portal:samples:eventa'>jbp:EventA</qname>
+ </supported-publishing-event>
+ <supported-processing-event>
+ <qname xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <portlet>
+ <description>Event Portlet C</description>
+ <portlet-name>portletC</portlet-name>
+ <display-name>Debug Portlet C</display-name>
+ <portlet-class>org.jboss.portal.portlet.samples.eventdebug.EventPortletC</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Debug Event C</title>
+ <keywords>sample,event</keywords>
+ </portlet-info>
+ <supported-publishing-event>
+ <qname xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-publishing-event>
+ <supported-processing-event>
+ <qname xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <event-definition>
+ <qname xmlns:jbp='urn:jboss:portal:samples:eventa'>jbp:EventA</qname>
+ <value-type>org.jboss.portal.portlet.samples.eventdebug.EventA</value-type>
+ </event-definition>
+ <event-definition>
+ <qname xmlns:jbp='urn:jboss:portal:samples:eventb'>jbp:EventB</qname>
+ <value-type>org.jboss.portal.portlet.samples.eventdebug.EventB</value-type>
+ </event-definition>
+ <event-definition>
+ <qname xmlns:jbp='urn:jboss:portal:samples:eventc'>jbp:EventC</qname>
+ <value-type>org.jboss.portal.portlet.samples.eventdebug.EventC</value-type>
+ </event-definition>
+</portlet-app>
+
Added: modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/web.xml (rev 0)
+++ modules/portlet/trunk/samples/src/main/artifacts/eventdebug-portlet-war/WEB-INF/web.xml 2008-03-03 22:32:07 UTC (rev 10185)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+</web-app>
Added: modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventA.java
===================================================================
--- modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventA.java (rev 0)
+++ modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventA.java 2008-03-03 22:32:07 UTC (rev 10185)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.samples.eventdebug;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+@XmlRootElement
+public class EventA implements Serializable
+{
+ private String id;
+
+ public static final QName QNAME = new QName("urn:jboss:portal:samples:eventa", "EventA");
+
+ public EventA(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added: modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventB.java
===================================================================
--- modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventB.java (rev 0)
+++ modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventB.java 2008-03-03 22:32:07 UTC (rev 10185)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.samples.eventdebug;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+@XmlRootElement
+public class EventB implements Serializable
+{
+ private String id;
+
+ public static final QName QNAME = new QName("urn:jboss:portal:samples:eventb", "EventB");
+
+ public EventB(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added: modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventC.java
===================================================================
--- modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventC.java (rev 0)
+++ modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventC.java 2008-03-03 22:32:07 UTC (rev 10185)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.samples.eventdebug;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+@XmlRootElement
+public class EventC implements Serializable
+{
+ private String id;
+
+ public static final QName QNAME = new QName("urn:jboss:portal:samples:eventc", "EventC");
+
+ public EventC(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added: modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletA.java
===================================================================
--- modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletA.java (rev 0)
+++ modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletA.java 2008-03-03 22:32:07 UTC (rev 10185)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.samples.eventdebug;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Event;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.portlet.ResourceURL;
+import javax.xml.namespace.QName;
+import java.util.List;
+import java.util.ArrayList;
+import java.io.IOException;
+import java.io.Writer;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+public class EventPortletA extends GenericPortlet
+{
+
+ @Override
+ protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException
+ {
+ renderResponse.setContentType("text/html");
+ Writer writer = renderResponse.getWriter();
+ PortletURL addURL = renderResponse.createActionURL();
+ addURL.setParameter("id", "B");
+
+ writer.append("<a href='").append(addURL.toString()).append("'\">Dispatch Event B</a></td></tr>");
+
+ }
+
+ @Override
+ public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, IOException
+ {
+ String value = actionRequest.getParameter("id");
+ if (value != null){
+ actionResponse.setEvent(EventB.QNAME, new EventB(value));
+ }
+
+ }
+
+
+ @Override
+ public void processEvent(EventRequest eventRequest, EventResponse eventResponse) throws PortletException, IOException
+ {
+ Event event = eventRequest.getEvent();
+ System.out.println("------------a----" + event.getName());
+ if (event.getName().equals("EventA"))
+ {
+ EventA eventA = (EventA)event.getValue();
+ System.out.println("------------a---eventA-" + eventA);
+ //eventA.getId();
+ }
+ if (event.getName().equals("EventB"))
+ {
+ EventB eventB = (EventB)event.getValue();
+ System.out.println("-------------a--eventB-" + eventB);
+ //eventB.getId();
+ }
+ if (event.getName().equals("EventC"))
+ {
+ EventC eventC = (EventC)event.getValue();
+ //eventC.getId();
+ }
+ }
+
+ public void render(RenderRequest req, RenderResponse resp) throws PortletException, IOException
+ {
+ ResourceURL resourceURL = resp.createResourceURL();
+ PortletURL actionURL = resp.createActionURL();
+
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+ writer.print("");
+ resourceURL.setParameter("prodId","1");
+ writer.print("<a href=\"javascript: browse(\'" + resourceURL + "\');\">Product 1</a><br/>");
+
+
+ }
+}
Added: modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletB.java
===================================================================
--- modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletB.java (rev 0)
+++ modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletB.java 2008-03-03 22:32:07 UTC (rev 10185)
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.samples.eventdebug;
+
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Event;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import javax.xml.namespace.QName;
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+public class EventPortletB extends GenericPortlet
+{
+
+ @Override
+ protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException
+ {
+ renderResponse.setContentType("text/html");
+ Writer writer = renderResponse.getWriter();
+ PortletURL addURL = renderResponse.createActionURL();
+ addURL.setParameter("id", "A");
+
+ writer.append("<a href='").append(addURL.toString()).append("'\">Dispatch Event A</a></td></tr>");
+
+ }
+
+ @Override
+ public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, IOException
+ {
+ String value = actionRequest.getParameter("id");
+ if (value != null){
+ actionResponse.setEvent(EventA.QNAME, new EventA(value));
+ }
+
+ }
+
+ @Override
+ public void processEvent(EventRequest eventRequest, EventResponse eventResponse) throws PortletException, IOException
+ {
+ Event event = eventRequest.getEvent();
+ System.out.println("------------b----" + event.getName());
+ if (event.getName().equals("EventA"))
+ {
+ EventA eventA = (EventA)event.getValue();
+ System.out.println("------------b---eventA-" + eventA);
+ //eventA.getId();
+ }
+ if (event.getName().equals("EventB"))
+ {
+ EventB eventB = (EventB)event.getValue();
+ System.out.println("------------b---eventB-" + eventB);
+ //eventB.getId();
+ }
+ if (event.getName().equals("EventC"))
+ {
+ EventC eventC = (EventC)event.getValue();
+ //eventC.getId();
+ }
+ }
+}
Added: modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletC.java
===================================================================
--- modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletC.java (rev 0)
+++ modules/portlet/trunk/samples/src/main/java/org/jboss/portal/portlet/samples/eventdebug/EventPortletC.java 2008-03-03 22:32:07 UTC (rev 10185)
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.samples.eventdebug;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.Event;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventPortlet;
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+public class EventPortletC extends GenericPortlet
+{
+
+ @Override
+ protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException
+ {
+ renderResponse.setContentType("text/html");
+ Writer writer = renderResponse.getWriter();
+ PortletURL addURL = renderResponse.createActionURL();
+ addURL.setParameter("id", "B");
+
+ writer.append("<a href='").append(addURL.toString()).append("'\">Dispatch Event B</a></td></tr>");
+
+ }
+
+ @Override
+ public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, IOException
+ {
+ String value = actionRequest.getParameter("id");
+ if (value != null){
+ actionResponse.setEvent(EventB.QNAME, new EventB(value));
+ }
+
+ }
+
+
+ @Override
+ public void processEvent(EventRequest eventRequest, EventResponse eventResponse) throws PortletException, IOException
+ {
+ Event event = eventRequest.getEvent();
+ System.out.println("------------c----" + event.getName());
+ if (event.getName().equals("EventA"))
+ {
+ EventA eventA = (EventA)event.getValue();
+ System.out.println("-------------c--eventA-" + eventA);
+ //eventA.getId();
+ }
+ if (event.getName().equals("EventB"))
+ {
+ EventB eventB = (EventB)event.getValue();
+ System.out.println("-------------c--eventB-" + eventB);
+ //eventB.getId();
+ }
+ if (event.getName().equals("EventC"))
+ {
+ EventC eventC = (EventC)event.getValue();
+ //eventC.getId();
+ }
+ }
+}
16 years, 2 months
JBoss Portal SVN: r10184 - in modules/portlet/trunk: portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-03-03 16:23:00 -0500 (Mon, 03 Mar 2008)
New Revision: 10184
Added:
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/2columns.tag
Removed:
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/layout1.tag
Modified:
modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/admin.jsp
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo.jsp
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo1.jsp
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo2.jsp
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo3.jsp
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp
Log:
updates
Modified: modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml
===================================================================
--- modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml 2008-03-03 15:41:53 UTC (rev 10183)
+++ modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml 2008-03-03 21:23:00 UTC (rev 10184)
@@ -148,7 +148,7 @@
<portal:portleturl windowState="maximized" mode="edit"/>
...
</portal:portlet>]]></programlisting>
- <para>The portlet url tag has two optional attributes. The <literal>windowState</literal> attribute allow
+ <para>The portlet url tag has two optional attributes. The <literal>windowState</literal> attribute allows
to change the window state in the url and the <literal>mode</literal> attribute controls the mode in
the url.</para>
</sect3>
@@ -259,17 +259,33 @@
</sect2>
<sect2>
<title>Extended tag library</title>
- <para>todo</para>
+ <para>This chapter talks about an extension of the simple portal tag library that allows the display of portlets
+ pretty much as they are in classic portals. The extension is built on top the simple portal tag library
+ and uses a feature of JSP 2.0 which is the tag library extension written using JSP. There is a good article
+ to read about it <ulink url="http://www.onjava.com/pub/a/onjava/2004/05/12/jsp2part4.html">here</ulink>.</para>
+ <sect3>
+ <title>The extended portlet tag</title>
+ <para>The extended portlet is a JSP tag file located in the folder <filename>/WEB-INF/tags/portal</filename>
+ of the simple portal war file.</para>
+ <programlisting><![CDATA[
+<%@ page contentType="text/html" %>
+<%@ page language="java" %>
+<%@ taglib prefix="xportal" tagdir="/WEB-INF/tags/portal" %>
+...
+ <xportal:portlet name="GoogleMap" applicationName="samples-google-portlet"/>
+...
+]]></programlisting>
+ <para>You can consider this extension pretty much like a JSP include except that it is more powerful. The
+ main interest is that this file can be edited and tweaked for your needs.</para>
+ </sect3>
</sect2>
</sect1>
<sect1>
<title>Portlet debugging</title>
+ <para>todo</para>
</sect1>
<sect1>
<title>Administration</title>
+ <para>todo</para>
</sect1>
- <sect1>
- <title>Extensions</title>
- <para>Talk about mixing JSP with templating framework or other taglib</para>
- </sect1>
</chapter>
Copied: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/2columns.tag (from rev 10175, modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/layout1.tag)
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/2columns.tag (rev 0)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/2columns.tag 2008-03-03 21:23:00 UTC (rev 10184)
@@ -0,0 +1,17 @@
+<%@ tag body-content="scriptless" %>
+<%@ attribute name="leftcol" fragment="true" required="false" %>
+<%@ attribute name="rightcol" fragment="true" required="false" %>
+
+<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
+
+ <div class="third-width float-left">
+ <jsp:invoke fragment="leftcol"/>
+ </div>
+ <div class="two-third-width float-left">
+ <jsp:invoke fragment="rightcol"/>
+ </div>
+
+
+
+
+
Deleted: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/layout1.tag
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/layout1.tag 2008-03-03 15:41:53 UTC (rev 10183)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/layout1.tag 2008-03-03 21:23:00 UTC (rev 10184)
@@ -1,17 +0,0 @@
-<%@ tag body-content="scriptless" %>
-<%@ attribute name="leftcol" fragment="true" required="false" %>
-<%@ attribute name="rightcol" fragment="true" required="false" %>
-
-<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
-
- <div class="third-width float-left">
- <jsp:invoke fragment="leftcol"/>
- </div>
- <div class="two-third-width float-left">
- <jsp:invoke fragment="rightcol"/>
- </div>
-
-
-
-
-
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/admin.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/admin.jsp 2008-03-03 15:41:53 UTC (rev 10183)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/admin.jsp 2008-03-03 21:23:00 UTC (rev 10184)
@@ -1,6 +1,6 @@
<%@ page contentType="text/html" %>
<%@ page language="java" %>
-<%@ taglib prefix="jbp" tagdir="/WEB-INF/tags/portal" %>
+<%@ taglib prefix="xportal" tagdir="/WEB-INF/tags/portal" %>
<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
<%@ page isELIgnored="false" %>
@@ -8,7 +8,7 @@
<portal:page>
- <jbp:portlet name="AdminPortlet" applicationName="simple-portal"/>
+ <xportal:portlet name="AdminPortlet" applicationName="simple-portal"/>
</portal:page>
<%@ include file="/layouts/footer.jsp" %>
\ No newline at end of file
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo.jsp 2008-03-03 15:41:53 UTC (rev 10183)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo.jsp 2008-03-03 21:23:00 UTC (rev 10184)
@@ -1,6 +1,6 @@
<%@ page contentType="text/html" %>
<%@ page language="java" %>
-<%@ taglib prefix="jbp" tagdir="/WEB-INF/tags/portal" %>
+<%@ taglib prefix="xportal" tagdir="/WEB-INF/tags/portal" %>
<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
<%@ page isELIgnored="false" %>
@@ -8,20 +8,20 @@
<portal:page>
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google" localName="zipcode" value="80201"/>
- <jbp:layout1>
+ <xportal:2columns>
<jsp:attribute name="leftcol">
- <jbp:portlet name="RemoteControl" applicationName="samples-remotecontroller-portlet"/>
- <jbp:portlet name="Foo" applicationName="bar"/>
- <jbp:portlet name="ExceptionPortlet" applicationName="samples-basic-portlet"/>
- <jbp:portlet name="Cart" applicationName="samples-shoppingcart-portlet"/>
+ <xportal:portlet name="RemoteControl" applicationName="samples-remotecontroller-portlet"/>
+ <xportal:portlet name="Foo" applicationName="bar"/>
+ <xportal:portlet name="ExceptionPortlet" applicationName="samples-basic-portlet"/>
+ <xportal:portlet name="Cart" applicationName="samples-shoppingcart-portlet"/>
</jsp:attribute>
<jsp:attribute name="rightcol">
- <jbp:portlet name="GoogleMap" applicationName="samples-google-portlet"/>
- <jbp:portlet name="GoogleWeather" applicationName="samples-google-portlet"/>
- <jbp:portlet name="Catalog" applicationName="samples-shoppincart-portlet"/>
- <jbp:portlet name="JSPPortlet" applicationName="samples-jsp-portlet"/>
+ <xportal:portlet name="GoogleMap" applicationName="samples-google-portlet"/>
+ <xportal:portlet name="GoogleWeather" applicationName="samples-google-portlet"/>
+ <xportal:portlet name="Catalog" applicationName="samples-shoppincart-portlet"/>
+ <xportal:portlet name="JSPPortlet" applicationName="samples-jsp-portlet"/>
</jsp:attribute>
- </jbp:layout1>
+ </xportal:2columns>
</portal:page>
<%@ include file="/layouts/footer.jsp" %>
\ No newline at end of file
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo1.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo1.jsp 2008-03-03 15:41:53 UTC (rev 10183)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo1.jsp 2008-03-03 21:23:00 UTC (rev 10184)
@@ -1,6 +1,6 @@
<%@ page contentType="text/html" %>
<%@ page language="java" %>
-<%@ taglib prefix="jbp" tagdir="/WEB-INF/tags/portal" %>
+<%@ taglib prefix="xportal" tagdir="/WEB-INF/tags/portal" %>
<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
<%@ page isELIgnored="false" %>
@@ -8,14 +8,14 @@
<portal:page>
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google" localName="zipcode" value="80201"/>
- <jbp:layout1>
+ <xportal:2columns>
<jsp:attribute name="leftcol">
- <jbp:portlet name="Cart" applicationName="samples-shoppingcart-portlet" id="cart-portlet"/>
+ <xportal:portlet name="Cart" applicationName="samples-shoppingcart-portlet" id="cart-portlet"/>
</jsp:attribute>
<jsp:attribute name="rightcol">
- <jbp:portlet name="Catalog" applicationName="samples-shoppingcart-portlet"/>
+ <xportal:portlet name="Catalog" applicationName="samples-shoppingcart-portlet"/>
</jsp:attribute>
- </jbp:layout1>
+ </xportal:2columns>
</portal:page>
<%@ include file="/layouts/footer.jsp" %>
\ No newline at end of file
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo2.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo2.jsp 2008-03-03 15:41:53 UTC (rev 10183)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo2.jsp 2008-03-03 21:23:00 UTC (rev 10184)
@@ -1,6 +1,6 @@
<%@ page contentType="text/html" %>
<%@ page language="java" %>
-<%@ taglib prefix="jbp" tagdir="/WEB-INF/tags/portal" %>
+<%@ taglib prefix="xportal" tagdir="/WEB-INF/tags/portal" %>
<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
<%@ page isELIgnored="false" %>
@@ -8,18 +8,18 @@
<portal:page>
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google" localName="zipcode" value="80201"/>
- <jbp:layout1>
+ <xportal:2columns>
<jsp:attribute name="leftcol">
- <jbp:portlet name="RemoteControl" applicationName="samples-remotecontroller-portlet"/>
+ <xportal:portlet name="RemoteControl" applicationName="samples-remotecontroller-portlet"/>
</jsp:attribute>
<jsp:attribute name="rightcol">
- <jbp:portlet name="GoogleMap" applicationName="samples-google-portlet"/>
- <jbp:portlet name="GoogleWeather" applicationName="samples-google-portlet"/>
+ <xportal:portlet name="GoogleMap" applicationName="samples-google-portlet"/>
+ <xportal:portlet name="GoogleWeather" applicationName="samples-google-portlet"/>
</jsp:attribute>
- </jbp:layout1>
+ </xportal:2columns>
</portal:page>
<%@ include file="/layouts/footer.jsp" %>
\ No newline at end of file
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo3.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo3.jsp 2008-03-03 15:41:53 UTC (rev 10183)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/demo3.jsp 2008-03-03 21:23:00 UTC (rev 10184)
@@ -1,6 +1,6 @@
<%@ page contentType="text/html" %>
<%@ page language="java" %>
-<%@ taglib prefix="jbp" tagdir="/WEB-INF/tags/portal" %>
+<%@ taglib prefix="xportal" tagdir="/WEB-INF/tags/portal" %>
<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
<%@ page isELIgnored="false" %>
@@ -9,18 +9,18 @@
<portal:page>
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google" localName="zipcode" value="80201"/>
- <jbp:layout1>
+ <xportal:2columns>
<jsp:attribute name="leftcol">
- <jbp:portlet name="Foo" applicationName="bar"/>
+ <xportal:portlet name="Foo" applicationName="bar"/>
</jsp:attribute>
<jsp:attribute name="rightcol">
- <jbp:portlet name="ExceptionPortlet" applicationName="samples-basic-portlet"/>
- <jbp:portlet name="HeaderPortlet" applicationName="samples-basic-portlet" id="header-portlet"/>
- <jbp:portlet name="FailDuringInitPortlet" applicationName="samples-basic-portlet" id="header-portlet"/>
+ <xportal:portlet name="ExceptionPortlet" applicationName="samples-basic-portlet"/>
+ <xportal:portlet name="HeaderPortlet" applicationName="samples-basic-portlet" id="header-portlet"/>
+ <xportal:portlet name="FailDuringInitPortlet" applicationName="samples-basic-portlet" id="header-portlet"/>
</jsp:attribute>
- </jbp:layout1>
+ </xportal:2columns>
</portal:page>
<%@ include file="/layouts/footer.jsp" %>
\ No newline at end of file
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp 2008-03-03 15:41:53 UTC (rev 10183)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/demo/wikipedia.jsp 2008-03-03 21:23:00 UTC (rev 10184)
@@ -1,6 +1,6 @@
<%@ page contentType="text/html" pageEncoding="UTF-8" %>
<%@ page language="java" %>
-<%@ taglib prefix="jbp" tagdir="/WEB-INF/tags/portal" %>
+<%@ taglib prefix="xportal" tagdir="/WEB-INF/tags/portal" %>
<%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
<%@ page isELIgnored="false" %>
@@ -10,7 +10,7 @@
<portal:pageparam namespaceURI="urn:jboss:portal:simple:google" localName="zipcode" value="32080"/>
<div class="wiki-content full-width">
<div class="third-width float-right">
- <jbp:portlet name="GoogleMap" applicationName="samples-google-portlet"/>
+ <xportal:portlet name="GoogleMap" applicationName="samples-google-portlet"/>
</div>
<h2 class="title">St. Augustine, Florida</h2>
16 years, 2 months
JBoss Portal SVN: r10183 - modules/portlet/trunk/docs/user-guide/en/modules.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-03-03 10:41:53 -0500 (Mon, 03 Mar 2008)
New Revision: 10183
Modified:
modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml
Log:
perform error handling in a error handling filter instead of the controller filter
Modified: modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml
===================================================================
--- modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml 2008-03-03 15:40:18 UTC (rev 10182)
+++ modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml 2008-03-03 15:41:53 UTC (rev 10183)
@@ -245,6 +245,15 @@
<para>By default there is a servlet filter that catches the messages and translates them into HTTP errors.
This filter is called <literal>ErrorHandlingFilter</literal> and is declared in the <filename>web.xml</filename>
file of the simple portal war. If you want to handle error differently you should replace it.</para>
+ <programlisting><![CDATA[
+<web-app>
+ ...
+ <filter-mapping>
+ <filter-name>ErrorHandlingFilter</filter-name>
+ <url-pattern>*.jsp</url-pattern>
+ </filter-mapping>
+ ...
+</web-app>]]></programlisting>
</sect4>
</sect3>
</sect2>
16 years, 2 months
JBoss Portal SVN: r10182 - in modules/portlet/trunk/portal/src/main: java/org/jboss/portal/portlet/portal/jsp and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-03-03 10:40:18 -0500 (Mon, 03 Mar 2008)
New Revision: 10182
Added:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/ErrorHandlingFilter.java
Modified:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/ControllerFilter.java
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/PortletTag.java
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/web.xml
Log:
perform error handling in a error handling filter instead of the controller filter
Added: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/ErrorHandlingFilter.java
===================================================================
--- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/ErrorHandlingFilter.java (rev 0)
+++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/ErrorHandlingFilter.java 2008-03-03 15:40:18 UTC (rev 10182)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * 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;
+
+import org.apache.log4j.Logger;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.FilterChain;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ErrorHandlingFilter implements Filter
+{
+
+ /** . */
+ private final Logger log = Logger.getLogger(ErrorHandlingFilter.class);
+
+ public void init(FilterConfig config) throws ServletException
+ {
+ }
+
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
+ {
+ doFilter((HttpServletRequest)request, (HttpServletResponse)response, chain);
+ }
+
+ public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException
+ {
+
+ try
+ {
+ chain.doFilter(request, response);
+ }
+ catch (ServletException e)
+ {
+ log.error("Error during portal processing: " + e.getMessage(), e.getCause());
+
+ //
+ if (Constants.PORTLET_ERROR.equals(e.getMessage()))
+ {
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
+ else if (Constants.UNAVAILABLE.equals(e.getMessage()))
+ {
+ response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
+ }
+ else if (Constants.INTERNAL_ERROR.equals(e.getMessage()))
+ {
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
+ else if (Constants.NOT_FOUND.equals(e.getMessage()))
+ {
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
+ }
+ else
+ {
+ throw e;
+ }
+ }
+
+ }
+
+ public void destroy()
+ {
+ }
+}
Modified: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/ControllerFilter.java
===================================================================
--- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/ControllerFilter.java 2008-03-03 15:34:52 UTC (rev 10181)
+++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/ControllerFilter.java 2008-03-03 15:40:18 UTC (rev 10182)
@@ -27,9 +27,11 @@
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.URLFormat;
+import org.jboss.portal.portlet.portal.Constants;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.ContentResponse;
+import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
import org.jboss.portal.portlet.controller.PortletController;
import org.jboss.portal.portlet.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.controller.impl.request.ControllerRequestFactory;
@@ -228,13 +230,17 @@
//
if (errorResponse.getCause() != null)
{
- throw new ServletException(errorResponse.getMessage(), errorResponse.getCause());
+ throw new ServletException(Constants.PORTLET_ERROR, errorResponse.getCause());
}
else
{
- throw new ServletException(errorResponse.getMessage());
+ throw new ServletException(Constants.PORTLET_ERROR);
}
}
+ else if (pir instanceof UnavailableResponse)
+ {
+ throw new ServletException(Constants.UNAVAILABLE);
+ }
else
{
// todo
Modified: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/PortletTag.java
===================================================================
--- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/PortletTag.java 2008-03-03 15:34:52 UTC (rev 10181)
+++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/PortletTag.java 2008-03-03 15:40:18 UTC (rev 10182)
@@ -27,6 +27,7 @@
import org.jboss.portal.portlet.portal.jsp.PortalResponse;
import org.jboss.portal.portlet.portal.jsp.WindowDef;
import org.jboss.portal.portlet.portal.jsp.WindowResult;
+import org.jboss.portal.portlet.portal.Constants;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/web.xml 2008-03-03 15:34:52 UTC (rev 10181)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/web.xml 2008-03-03 15:40:18 UTC (rev 10182)
@@ -27,10 +27,18 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<filter>
+ <filter-name>ErrorHandlingFilter</filter-name>
+ <filter-class>org.jboss.portal.portlet.portal.ErrorHandlingFilter</filter-class>
+ </filter>
+ <filter>
<filter-name>ControllerFilter</filter-name>
<filter-class>org.jboss.portal.portlet.portal.jsp.ControllerFilter</filter-class>
</filter>
<filter-mapping>
+ <filter-name>ErrorHandlingFilter</filter-name>
+ <url-pattern>*.jsp</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
<filter-name>ControllerFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
16 years, 2 months
JBoss Portal SVN: r10181 - in modules/portlet/trunk: portal/src/main/java/org/jboss/portal/portlet/portal and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-03-03 10:34:52 -0500 (Mon, 03 Mar 2008)
New Revision: 10181
Added:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/Constants.java
Removed:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/Constants.java
Modified:
modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml
Log:
more documentation
Modified: modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml
===================================================================
--- modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml 2008-03-03 11:43:50 UTC (rev 10180)
+++ modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml 2008-03-03 15:34:52 UTC (rev 10181)
@@ -80,8 +80,24 @@
<para>Any JSP page can contain portlets, the only requirement to make this possible is to have
the page located in the simple portal war file and to use the portal tag library.</para>
<programlisting><![CDATA[
-todo
-]]></programlisting>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ 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"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>Simple portal page</title>
+ </head>
+ <body>
+ <portal:page>
+ <portal:portlet name="JSPPortlet" applicationName="samples-jsp-portlet">
+ <portal:portletmarkup/>
+ </portal:portlet>
+ </portal:page>
+ </body>
+</html>]]></programlisting>
<para>The example shows a portal page that is very minimal. Among the HTML markup and the mandatory JSP
instructions you can find the different elements that will tell the simple portal how to integrate portlets
in the page.</para>
@@ -89,14 +105,14 @@
portal. It is declared by the JSP declaration <emphasis><%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %></emphasis>
and it binds the portal tag library to the <literal>portal</literal> namespace.</para>
<para>The first tag that uses the <literal>portal</literal> namespace is the <literal>page</literal> tag which
- defines a logical scope which have several impacts on the page.
- <itemizedlist>
- <listitem>It defines a container for a set of portlets.</listitem>
- <listitem>When a portlet is maximized it defines the zone in the page that will be replaced by the maxmized
- portlet markup.</listitem>
- <listitem>It defines a scope for the coordination features.</listitem>
- </itemizedlist>
- One page can be specified per JSP page but in the future we will likely have the feature to have
+ defines a logical scope which have several impacts on the page.</para>
+ <itemizedlist>
+ <listitem>It defines a container for a set of portlets.</listitem>
+ <listitem>When a portlet is maximized it defines the zone in the page that will be replaced by the maxmized
+ portlet markup.</listitem>
+ <listitem>It defines a scope for the coordination features.</listitem>
+ </itemizedlist>
+ <para>One page can be specified per JSP page but in the future we should offer the capability to have
several pages in a single JSP page.
</para>
<para>Inside the portal page tag is declared a reference to a portlet using the <literal>portlet</literal>
@@ -110,16 +126,45 @@
the markup created by the referenced portlet when the page is rendered.</para>
</sect3>
<sect3>
- <title>Page headers</title>
- <para>todo</para>
+ <title>Portlet title</title>
+ <para>We have seen in the previous example how to place a portlet in a JSP page but for the sake of simplicity
+ we have not yet explained how to create a complete portlet representation. The tag <literal>portlettitle</literal>
+ is used to insert the portlet title that the portlet produced during the render phase.</para>
+ <programlisting><![CDATA[
+<portal:portlet name="JSPPortlet" applicationName="samples-jsp-portlet">
+ ...
+ <portal:portlettitle/>
+ ...
+</portal:portlet>]]></programlisting>
</sect3>
<sect3>
- <title>Portlet title</title>
- <para>todo</para>
+ <title>Portlet urls</title>
+ <para>The capability to create urls for a portlet is very powerful and can be used to create controls
+ such as a button that will maximize the portlet or change its mode to another mode. The <literal>portleturl</literal>
+ creates such urls and insert them in the page.</para>
+ <programlisting><![CDATA[
+<portal:portlet name="JSPPortlet" applicationName="samples-jsp-portlet">
+ ...
+ <portal:portleturl windowState="maximized" mode="edit"/>
+ ...
+</portal:portlet>]]></programlisting>
+ <para>The portlet url tag has two optional attributes. The <literal>windowState</literal> attribute allow
+ to change the window state in the url and the <literal>mode</literal> attribute controls the mode in
+ the url.</para>
</sect3>
<sect3>
- <title>Portlet controls</title>
- <para>todo</para>
+ <title>Page headers</title>
+ <para>The Portlet 2 specification allows portlet to participate to the headers of the page. If you want
+ to allow the portlets on the page to add header to your page then you need to insert a <literal>headers</literal>
+ tag in the head section of the page, as shown in the following example.</para>
+ <programlisting><![CDATA[
+<head>
+ <portal:headers/>
+ ...
+</head>
+]]></programlisting>
+ <para>This instruct the simple portal to insert the header contributed by the portlet present on the page
+ at the place you specified.</para>
</sect3>
<sect3>
<title>Portlet events</title>
@@ -132,8 +177,76 @@
</sect3>
<sect3>
<title>Public render parameters</title>
- <para>todo</para>
+ <para>Public render parameters allows several portlets on the same page to share render parameters.
+ Likewise the portlet event feature, the page is the natural scope for sharing render parameters. The simple
+ portal tag library allows to define initial values for such parameters allowing the developper to make
+ different pages to be initialized with different values for the same parameter. </para>
+ <programlisting><![CDATA[
+<portal:page>
+ <portal:pageparam namespaceURI="urn:jboss:portal:simple:google" localName="zipcode" value="80201"/>
+ ...
+</portal:page>
+]]></programlisting>
+ <para>In the example the page parameter <literal>zipcode</literal> having the namespace
+ <literal>urn:jboss:portal:simple:google</literal> will be initialized with the value
+ <literal>80201</literal> the first time the page is rendered. The value can change
+ if a portlet updates it during an interaction triggered by the end user. However it is possible
+ to make this parameter unmodifiable by adding a <literal>frozen</literal> attributes with
+ the value <literal>true</literal>, in that particular case the page parameter value will never change
+ when a portlet tries to update it.</para>
</sect3>
+ <sect3>
+ <title>Error handling</title>
+ <para>Error handling happens at two places, the first is during page rendering and the second place
+ can be triggered by a portlet url. The simple portal categorizes errors into
+ several kinds and associate them with a string constant that can be used to programmatically
+ handle the error.
+ </para>
+ <itemizedlist>
+ <listitem><literal>not_found</literal> used when the portlet cannot be located</listitem>
+ <listitem><literal>portlet_error</literal> used when the portlet throws an exception</listitem>
+ <listitem><literal>internal_error</literal> used when the portlet throws an exception but that
+ is recognized as an internal error</listitem>
+ <listitem><literal>unavailable</literal> used when the portlet is located but is not in service</listitem>
+ </itemizedlist>
+ <sect4>
+ <title>Error handling during render</title>
+ <para>On a portlet failure during the render phase, it is possible to instruct the simple portal
+ to use an alternative page in a very similar fashion that JSP defines error pages. The only difference
+ is that it is not a JSP error page.</para>
+ <para>During the execution of the error JSP page, several request attributes are set by the portal
+ that will allow you to customize the markup.</para>
+ <itemizedlist>
+ <listitem><literal>org.jboss.portal.portlet.portal.error.status</literal> is a string that is the type of
+ the error and the value is among the error categorization explained earler.</listitem>
+ <listitem><literal>org.jboss.portal.portlet.portal.error.cause</literal> is an optional throwable object
+ that is the cause of the error. For instance it could be a portlet exception.</listitem>
+ <listitem><literal>org.jboss.portal.portlet.portal.error.message</literal> is a string that is the error message</listitem>
+ <listitem><literal>org.jboss.portal.portlet.portal.error.portlet_name</literal> is the name of the portlet
+ that produced the error.</listitem>
+ <listitem><literal>org.jboss.portal.portlet.portal.error.application_name</literal> is the name of the application
+ that contained the portlet that produced the error.</listitem>
+ <listitem><literal>org.jboss.portal.portlet.portal.error.window_id</literal> is the id of the window that produced
+ the error, it is useful when several portlet window with the same portlets are on the same page.</listitem>
+ </itemizedlist>
+ <para>Error page declaration is done on the portlet tag using the <literal>errorPage</literal> attribute. The value
+ of that attribute is the path of the error page relative to the root of the war file. Note that it could be a
+ or a plan file.</para>
+ <programlisting><![CDATA[
+<portal:portlet name="JSPPortlet" applicationName="samples-jsp-portlet" errorPage="/WEB-INF/jsp/error.jsp">
+ ...
+</portal:portlet>
+]]></programlisting>
+ </sect4>
+ <sect4>
+ <title>Error handling during action</title>
+ <para>On a failure during an interaction triggered by a portlet, the simple portal will throw a servlet
+ exception with a message value among the error categorization explained earlier.</para>
+ <para>By default there is a servlet filter that catches the messages and translates them into HTTP errors.
+ This filter is called <literal>ErrorHandlingFilter</literal> and is declared in the <filename>web.xml</filename>
+ file of the simple portal war. If you want to handle error differently you should replace it.</para>
+ </sect4>
+ </sect3>
</sect2>
<sect2>
<title>Extended tag library</title>
Copied: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/Constants.java (from rev 10175, modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/Constants.java)
===================================================================
--- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/Constants.java (rev 0)
+++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/Constants.java 2008-03-03 15:34:52 UTC (rev 10181)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public final class Constants
+{
+
+ private Constants()
+ {
+ }
+
+ /** . */
+ public static final String ERROR_STATUS = "org.jboss.portal.portlet.portal.error.status";
+
+ /** . */
+ public static final String ERROR_CAUSE = "org.jboss.portal.portlet.portal.error.cause";
+
+ /** . */
+ public static final String ERROR_MESSAGE = "org.jboss.portal.portlet.portal.error.message";
+
+ /** . */
+ public static final String ERROR_PORTLET_NAME = "org.jboss.portal.portlet.portal.error.portlet_name";
+
+ /** . */
+ public static final String ERROR_APPLICATION_NAME = "org.jboss.portal.portlet.portal.error.application_name";
+
+ /** . */
+ public static final String ERROR_WINDOW_ID = "org.jboss.portal.portlet.portal.error.window_id";
+
+ /** . */
+ public static final String NOT_FOUND = "not_found";
+
+ /** . */
+ public static final String PORTLET_ERROR = "portlet_error";
+
+ /** . */
+ public static final String INTERNAL_ERROR = "internal_error";
+
+ /** . */
+ public static final String UNAVAILABLE = "unavailable";
+}
Deleted: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/Constants.java
===================================================================
--- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/Constants.java 2008-03-03 11:43:50 UTC (rev 10180)
+++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/taglib/Constants.java 2008-03-03 15:34:52 UTC (rev 10181)
@@ -1,65 +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.portal.jsp.taglib;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-final class Constants
-{
-
- private Constants()
- {
- }
-
- /** . */
- public static final String ERROR_STATUS = "org.jboss.portal.portlet.portal.error.status";
-
- /** . */
- public static final String ERROR_CAUSE = "org.jboss.portal.portlet.portal.error.cause";
-
- /** . */
- public static final String ERROR_MESSAGE = "org.jboss.portal.portlet.portal.error.message";
-
- /** . */
- public static final String ERROR_PORTLET_NAME = "org.jboss.portal.portlet.portal.error.portlet_name";
-
- /** . */
- public static final String ERROR_APPLICATION_NAME = "org.jboss.portal.portlet.portal.error.application_name";
-
- /** . */
- public static final String ERROR_WINDOW_ID = "org.jboss.portal.portlet.portal.error.window_id";
-
- /** . */
- public static final String NOT_FOUND = "not_found";
-
- /** . */
- public static final String PORTLET_ERROR = "portlet_error";
-
- /** . */
- public static final String INTERNAL_ERROR = "internal_error";
-
- /** . */
- public static final String UNAVAILABLE = "unavailable";
-}
16 years, 2 months
JBoss Portal SVN: r10180 - in modules/portlet/trunk: docs/user-guide/en/modules and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-03-03 06:43:50 -0500 (Mon, 03 Mar 2008)
New Revision: 10180
Modified:
modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml
modules/portlet/trunk/pom.xml
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag
Log:
more work on the documentation
Modified: modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml
===================================================================
--- modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml 2008-03-03 10:26:54 UTC (rev 10179)
+++ modules/portlet/trunk/docs/user-guide/en/modules/simpleportal.xml 2008-03-03 11:43:50 UTC (rev 10180)
@@ -6,6 +6,11 @@
<surname>Viet</surname>
<email>julien(a)jboss.org</email>
</author>
+ <author>
+ <firstname>Chris</firstname>
+ <surname>Laprun</surname>
+ <email>chris.laprun(a)jboss.com</email>
+ </author>
</chapterinfo>
<title>Simple Portal</title>
<sect1>
@@ -44,7 +49,7 @@
aware of the deployment life cycle of war files that contains portlet components. The SPI defines
two levels of integrations.</para>
<para>The SPI implementation level 1 works with any web container and relies on the fact that the portlet
- developer needs to insert a specific servlet in the <file>web.xml</file> file of its portlet application.</para>
+ developer needs to insert a specific servlet in the <filename>web.xml</filename> file of its portlet application.</para>
<para>The SPI implementation level 2 is based on more advanced integration with specific web containers
and provides a transparent integration which means that any portlet application can be deployed without
requiring any proprietary modification of the war file, keeping your application vendor agnostic. A few
@@ -55,35 +60,94 @@
</itemizedlist>
</sect2>
<sect2>
- <title>Page creation</title>
+ <title>The portal tag library</title>
<para>The simple portal relies on the JSP technology to build pages for several good reasons:</para>
<itemizedlist>
- <listitem>JSPs are good enough technology for building portal pages. If you think about what
- a portal page is, you'll realize that JSP is sufficient. Obviously this does not mean that
+ <listitem>JSP is a good enough technology for building simple portal pages. Obviously this does not mean that
a portlet applications is required to use JSP, as usual portlet applications are developed using your
favorite web framework.</listitem>
- <listitem>Every java web developer knows JSP.</listitem>
+ <listitem>Every java web developer knows JSPs.</listitem>
<listitem>It is easy and straightforward to create a portal JSP page and there is no need for advanced
tooling.</listitem>
<listitem>A lot of various frameworks are compatible with JSP and it is possible to leverage them.
For instance if you are familliar with Sitemesh for skinning an application then you can mix it with the
portal tag library.</listitem>
</itemizedlist>
- <page>If you need a more advanced page creation system then you should rather consider to use a more advanced
- portal product such as JBoss Portal which will fullfill your needs.</page>
+ <para>If you need a more advanced page creation system then you should rather consider to use a more advanced
+ portal product such as JBoss Portal which will answer your needs.</para>
+ <sect3>
+ <title>Page creation</title>
+ <para>Any JSP page can contain portlets, the only requirement to make this possible is to have
+ the page located in the simple portal war file and to use the portal tag library.</para>
+ <programlisting><![CDATA[
+todo
+]]></programlisting>
+ <para>The example shows a portal page that is very minimal. Among the HTML markup and the mandatory JSP
+ instructions you can find the different elements that will tell the simple portal how to integrate portlets
+ in the page.</para>
+ <para>The portal tag library declaration enables the JSP compiler to know about the existence of the simple
+ portal. It is declared by the JSP declaration <emphasis><%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %></emphasis>
+ and it binds the portal tag library to the <literal>portal</literal> namespace.</para>
+ <para>The first tag that uses the <literal>portal</literal> namespace is the <literal>page</literal> tag which
+ defines a logical scope which have several impacts on the page.
+ <itemizedlist>
+ <listitem>It defines a container for a set of portlets.</listitem>
+ <listitem>When a portlet is maximized it defines the zone in the page that will be replaced by the maxmized
+ portlet markup.</listitem>
+ <listitem>It defines a scope for the coordination features.</listitem>
+ </itemizedlist>
+ One page can be specified per JSP page but in the future we will likely have the feature to have
+ several pages in a single JSP page.
+ </para>
+ <para>Inside the portal page tag is declared a reference to a portlet using the <literal>portlet</literal>
+ tag. The mandatory attributes for this tag are <literal>name</literal> and <literal>applicationName</literal> that
+ are used to locate the deployed portlet. The <literal>applicationName</literal> refers to the name of the war
+ file containing your portlet without the extension <filename>.war</filename> and the <literal>name</literal>
+ attribute is the portlet name declared in the <filename>portlet.xml</filename> file of the application. Likewise
+ the page tag the portlet tag does not produce any markup, it is just a declaration to a portlet to instruct
+ the simple portal where it can find the portlet and how it is going to use it.</para>
+ <para>Finally the <literal>portletmarkup</literal> tag is the first tag to produce markup. It simply inserts
+ the markup created by the referenced portlet when the page is rendered.</para>
+ </sect3>
+ <sect3>
+ <title>Page headers</title>
+ <para>todo</para>
+ </sect3>
+ <sect3>
+ <title>Portlet title</title>
+ <para>todo</para>
+ </sect3>
+ <sect3>
+ <title>Portlet controls</title>
+ <para>todo</para>
+ </sect3>
+ <sect3>
+ <title>Portlet events</title>
+ <para>Portlet events provides a powerful way to decouple portlets. After the process action phase, an
+ optional event phase is executed by the portal and it can involve several portlet containers that will
+ produce and consume events. You can read the portlet specification if you want to learn more about it.</para>
+ <para>The page defines the scope of the coordination, which means that when an event
+ is produced by a portlet on a page, the simple portal will locate the portlets on the same page that
+ can consume this event. The matching is done using the the even qualified name.</para>
+ </sect3>
+ <sect3>
+ <title>Public render parameters</title>
+ <para>todo</para>
+ </sect3>
</sect2>
<sect2>
- <title>Portlet coordination</title>
+ <title>Extended tag library</title>
+ <para>todo</para>
</sect2>
</sect1>
<sect1>
- <title>Debugging</title>
+ <title>Portlet debugging</title>
</sect1>
<sect1>
<title>Administration</title>
</sect1>
<sect1>
- <title>Extension</title>
+ <title>Extensions</title>
<para>Talk about mixing JSP with templating framework or other taglib</para>
</sect1>
</chapter>
Modified: modules/portlet/trunk/pom.xml
===================================================================
--- modules/portlet/trunk/pom.xml 2008-03-03 10:26:54 UTC (rev 10179)
+++ modules/portlet/trunk/pom.xml 2008-03-03 11:43:50 UTC (rev 10180)
@@ -40,6 +40,7 @@
<module>test</module>
<module>portal</module>
<module>samples</module>
+ <module>docs</module>
</modules>
<activation>
<activeByDefault>true</activeByDefault>
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag 2008-03-03 10:26:54 UTC (rev 10179)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/tags/portal/portlet.tag 2008-03-03 11:43:50 UTC (rev 10180)
@@ -12,7 +12,7 @@
<div class="header full-width">
<div class="header-layer full-width">
<div class="title two-third-width float-left"><h2><portal:portlettitle/></h2></div>
- <div class="controls third-width float-right">
+ <div class="controls third-width float-right"> <
<span class="mode-button">
<a href="<portal:portleturl windowState='maximized'/>"><img
src="${pageContext.request.contextPath}/images/icon-maximize.gif" alt=""/></a>
16 years, 2 months
JBoss Portal SVN: r10179 - modules/portlet/trunk.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-03-03 05:26:54 -0500 (Mon, 03 Mar 2008)
New Revision: 10179
Modified:
modules/portlet/trunk/pom.xml
Log:
fix wrong profile declaration
Modified: modules/portlet/trunk/pom.xml
===================================================================
--- modules/portlet/trunk/pom.xml 2008-03-03 10:17:14 UTC (rev 10178)
+++ modules/portlet/trunk/pom.xml 2008-03-03 10:26:54 UTC (rev 10179)
@@ -27,6 +27,25 @@
<profiles>
<profile>
+ <id>default</id>
+ <modules>
+ <module>build</module>
+ <module>jsr168api</module>
+ <module>portlet</module>
+ <module>controller</module>
+ <module>bridge</module>
+ <module>federation</module>
+ <module>management</module>
+ <module>mc</module>
+ <module>test</module>
+ <module>portal</module>
+ <module>samples</module>
+ </modules>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ </profile>
+ <profile>
<id>docs</id>
<modules>
<module>docs</module>
@@ -68,17 +87,6 @@
</profiles>
<modules>
- <module>build</module>
- <module>jsr168api</module>
- <module>portlet</module>
- <module>controller</module>
- <module>bridge</module>
- <module>federation</module>
- <module>management</module>
- <module>mc</module>
- <module>test</module>
- <module>portal</module>
- <module>samples</module>
</modules>
</project>
16 years, 2 months
JBoss Portal SVN: r10178 - in modules/portlet/trunk: samples and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-03-03 05:17:14 -0500 (Mon, 03 Mar 2008)
New Revision: 10178
Modified:
modules/portlet/trunk/build/distrib/distrib.xml
modules/portlet/trunk/samples/pom.xml
modules/portlet/trunk/samples/src/assemble/samples-basic-portlet.xml
modules/portlet/trunk/samples/src/assemble/samples-google-portlet.xml
modules/portlet/trunk/samples/src/assemble/samples-jsp-portlet.xml
modules/portlet/trunk/samples/src/assemble/samples-remotecontroller-portlet.xml
modules/portlet/trunk/samples/src/assemble/samples-shoppingcart-portlet.xml
Log:
better use of assembly plugin
Modified: modules/portlet/trunk/build/distrib/distrib.xml
===================================================================
--- modules/portlet/trunk/build/distrib/distrib.xml 2008-03-03 09:51:51 UTC (rev 10177)
+++ modules/portlet/trunk/build/distrib/distrib.xml 2008-03-03 10:17:14 UTC (rev 10178)
@@ -135,19 +135,15 @@
<copy todir="${bin.dir}/lib" flatten="true">
<fileset dir="${source.dir}" includes="**/target/*.jar" excludes="**/*sources.jar"/>
</copy>
- <copy file="${source.dir}/samples/target/portlet-samples-${maven.version}-samples-basic-portlet.war" tofile="${bin.dir}/samples/samples-basic-portlet.war"/>
- <copy file="${source.dir}/samples/target/portlet-samples-${maven.version}-samples-google-portlet.war" tofile="${bin.dir}/samples/samples-google-portlet.war"/>
- <copy file="${source.dir}/samples/target/portlet-samples-${maven.version}-samples-remotecontroller-portlet.war" tofile="${bin.dir}/samples/samples-remotecontroller-portlet.war"/>
- <copy file="${source.dir}/samples/target/portlet-samples-${maven.version}-samples-shoppingcart-portlet.war" tofile="${bin.dir}/samples/samples-shoppingcart-portlet.war"/>
- <copy file="${source.dir}/samples/target/portlet-samples-${maven.version}-samples-jsp-portlet.war" tofile="${bin.dir}/samples/samples-jsp-portlet.war"/>
+ <copy todir="${bin.dir}/samples">
+ <fileset dir="${source.dir}/samples/target" includes="*.war"/>
+ </copy>
</target>
<target name="__package-bundled-binary" unless="bin-alone">
- <copy file="${source.dir}/samples/target/portlet-samples-${maven.version}-samples-basic-portlet.war" tofile="${deploy.dir}/samples-basic-portlet.war"/>
- <copy file="${source.dir}/samples/target/portlet-samples-${maven.version}-samples-google-portlet.war" tofile="${deploy.dir}/samples-google-portlet.war"/>
- <copy file="${source.dir}/samples/target/portlet-samples-${maven.version}-samples-remotecontroller-portlet.war" tofile="${deploy.dir}/samples-remotecontroller-portlet.war"/>
- <copy file="${source.dir}/samples/target/portlet-samples-${maven.version}-samples-shoppingcart-portlet.war" tofile="${deploy.dir}/samples-shoppingcart-portlet.war"/>
- <copy file="${source.dir}/samples/target/portlet-samples-${maven.version}-samples-jsp-portlet.war" tofile="${deploy.dir}/samples-jsp-portlet.war"/>
+ <copy todir="${bin.dir}/samples">
+ <fileset dir="${source.dir}/samples/target" includes="*.war"/>
+ </copy>
</target>
<target name="__package-distrib">
Modified: modules/portlet/trunk/samples/pom.xml
===================================================================
--- modules/portlet/trunk/samples/pom.xml 2008-03-03 09:51:51 UTC (rev 10177)
+++ modules/portlet/trunk/samples/pom.xml 2008-03-03 10:17:14 UTC (rev 10178)
@@ -27,6 +27,7 @@
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
+ <finalName>samples</finalName>
<descriptors>
<descriptor>src/assemble/samples-basic-portlet.xml</descriptor>
<descriptor>src/assemble/samples-shoppingcart-portlet.xml</descriptor>
Modified: modules/portlet/trunk/samples/src/assemble/samples-basic-portlet.xml
===================================================================
--- modules/portlet/trunk/samples/src/assemble/samples-basic-portlet.xml 2008-03-03 09:51:51 UTC (rev 10177)
+++ modules/portlet/trunk/samples/src/assemble/samples-basic-portlet.xml 2008-03-03 10:17:14 UTC (rev 10178)
@@ -1,5 +1,5 @@
<assembly>
- <id>samples-basic-portlet</id>
+ <id>basic-portlet</id>
<formats>
<format>war</format>
</formats>
Modified: modules/portlet/trunk/samples/src/assemble/samples-google-portlet.xml
===================================================================
--- modules/portlet/trunk/samples/src/assemble/samples-google-portlet.xml 2008-03-03 09:51:51 UTC (rev 10177)
+++ modules/portlet/trunk/samples/src/assemble/samples-google-portlet.xml 2008-03-03 10:17:14 UTC (rev 10178)
@@ -1,5 +1,5 @@
<assembly>
- <id>samples-google-portlet</id>
+ <id>google-portlet</id>
<formats>
<format>war</format>
</formats>
Modified: modules/portlet/trunk/samples/src/assemble/samples-jsp-portlet.xml
===================================================================
--- modules/portlet/trunk/samples/src/assemble/samples-jsp-portlet.xml 2008-03-03 09:51:51 UTC (rev 10177)
+++ modules/portlet/trunk/samples/src/assemble/samples-jsp-portlet.xml 2008-03-03 10:17:14 UTC (rev 10178)
@@ -1,5 +1,5 @@
<assembly>
- <id>samples-jsp-portlet</id>
+ <id>jsp-portlet</id>
<formats>
<format>war</format>
</formats>
Modified: modules/portlet/trunk/samples/src/assemble/samples-remotecontroller-portlet.xml
===================================================================
--- modules/portlet/trunk/samples/src/assemble/samples-remotecontroller-portlet.xml 2008-03-03 09:51:51 UTC (rev 10177)
+++ modules/portlet/trunk/samples/src/assemble/samples-remotecontroller-portlet.xml 2008-03-03 10:17:14 UTC (rev 10178)
@@ -1,5 +1,5 @@
<assembly>
- <id>samples-remotecontroller-portlet</id>
+ <id>remotecontroller-portlet</id>
<formats>
<format>war</format>
</formats>
Modified: modules/portlet/trunk/samples/src/assemble/samples-shoppingcart-portlet.xml
===================================================================
--- modules/portlet/trunk/samples/src/assemble/samples-shoppingcart-portlet.xml 2008-03-03 09:51:51 UTC (rev 10177)
+++ modules/portlet/trunk/samples/src/assemble/samples-shoppingcart-portlet.xml 2008-03-03 10:17:14 UTC (rev 10178)
@@ -1,5 +1,5 @@
<assembly>
- <id>samples-shoppingcart-portlet</id>
+ <id>shoppingcart-portlet</id>
<formats>
<format>war</format>
</formats>
16 years, 2 months