JBoss Portal SVN: r7878 - branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/el.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-09 04:59:14 -0400 (Thu, 09 Aug 2007)
New Revision: 7878
Modified:
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java
Log:
The delegating property resolver should also check on the super-classes to find attributes
Modified: branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java 2007-08-08 16:35:23 UTC (rev 7877)
+++ branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/el/DelegatingPropertyResolver.java 2007-08-09 08:59:14 UTC (rev 7878)
@@ -378,6 +378,15 @@
return true;
}
}
+ Class superClass = clazz.getSuperclass();
+ if (superClass != null)
+ {
+ if (resolveAction(superClass, action))
+ {
+ return true;
+ }
+ }
+
return false;
}
16 years, 9 months
JBoss Portal SVN: r7877 - in docs/trunk/referenceGuide/en: images/tutorials/jsp_portlet and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-08-08 12:35:23 -0400 (Wed, 08 Aug 2007)
New Revision: 7877
Added:
docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package_42x.png
Removed:
docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/buildexplode.gif
docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/building.gif
docs/trunk/referenceGuide/en/images/tutorials/jsp_portlet/buildexplode.gif
docs/trunk/referenceGuide/en/images/tutorials/jsp_portlet/building.gif
Modified:
docs/trunk/referenceGuide/en/modules/tutorials.xml
Log:
- More tutorial improvements in particular with respect to JSF portlets.
Deleted: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/buildexplode.gif
===================================================================
(Binary files differ)
Deleted: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/building.gif
===================================================================
(Binary files differ)
Added: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package_42x.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package_42x.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: docs/trunk/referenceGuide/en/images/tutorials/jsp_portlet/buildexplode.gif
===================================================================
(Binary files differ)
Deleted: docs/trunk/referenceGuide/en/images/tutorials/jsp_portlet/building.gif
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/modules/tutorials.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/tutorials.xml 2007-08-08 16:11:13 UTC (rev 7876)
+++ docs/trunk/referenceGuide/en/modules/tutorials.xml 2007-08-08 16:35:23 UTC (rev 7877)
@@ -5,6 +5,11 @@
<surname>Russo</surname>
<email>roy(a)jboss.org</email>
</author>
+ <author>
+ <firstname>Chris</firstname>
+ <surname>Laprun</surname>
+ <email>chris.laprun(a)jboss.com</email>
+ </author>
</chapterinfo>
<title>Portlet Primer</title>
<sect1 id="portlet_primer">
@@ -68,11 +73,9 @@
<para>
The tutorials contained in this chapter are targetted toward portlet developers. Although they are a good
starting and reference point, we do heavily recommend that portlet developers read and understand the
- <ulink url="http://www.jcp.org/en/jsr/detail?id=168">Portlet
- Specification (JSR-168)</ulink>
- . We also recommend, using our
- <ulink url="http://jboss.org/index.html?module=bb&op=viewforum&f=215">JBoss Portal User Forums</ulink>
- for user-to-user help, when needed.
+ <ulink url="http://www.jcp.org/en/jsr/detail?id=168">Portlet Specification (JSR-168)</ulink>. We also recommend
+ using our <ulink url="http://jboss.org/index.html?module=bb&op=viewforum&f=215">JBoss Portal User
+ Forums</ulink> for user-to-user help, when needed.
</para>
<sect2>
<title>Deploying your first portlet</title>
@@ -81,18 +84,15 @@
<para>This section will introduce the reader to deploying his first portlet in JBoss Portal. It requires you
download the HelloWorldPortlet from PortletSwap.com, using this
<ulink
- url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">
- link</ulink>
- .
+ url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">link</ulink>.
</para>
</sect3>
<sect3>
<title>Package Structure</title>
<para>
- Portlets are packaged in war files, just like other JEE applications. A typical portlet war file can also
- include servlets, resource bundles, images, html, jsps, and other static or dynamic files you would
- commonly
- include.
+ Portlets are packaged in WAR files, just like other JEE applications. A typical portlet WAR file can also
+ include servlets, resource bundles, images, HTML, JSPs, and other static or dynamic files you would
+ commonly include.
</para>
<para>
<mediaobject>
@@ -103,15 +103,13 @@
</para>
</sect3>
<sect3>
- <title>The Portlet Class</title>
+ <title>Portlet Class</title>
<para>
Included in the
- <ulink
- url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">
- download bundle</ulink>
- you should have one java source file:
- <emphasis>HelloWorldPortlet\src\main\org\jboss\portlet\hello\HelloWorldPortlet.java</emphasis>
- , and it should contain the following:
+ <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">
+ download bundle</ulink> you should have one java source file:
+ <literal>HelloWorldPortlet\src\main\org\jboss\portlet\hello\HelloWorldPortlet.java</literal>, and it
+ should contain the following:
<programlisting><![CDATA[package org.jboss.portlet.hello;
import javax.portlet.GenericPortlet;
@@ -134,7 +132,7 @@
}
}]]>
</programlisting>
- Now lets dissect our simplest of portlets:
+ Now let's dissect our simplest of portlets:
<itemizedlist>
<listitem>
<para>
@@ -154,9 +152,9 @@
<programlisting>protected void doView(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException, UnavailableException</programlisting>
As we extend from <literal>GenericPortlet</literal> and we are only interested in supported the
- <emphasis>VIEW</emphasis> mode, we only need to implement the <literal>doView</literal> method,
+ <literal>VIEW</literal> mode, we only need to implement the <literal>doView</literal> method,
and <literal>GenericPortlet</literal>'s <literal>render</literal> implementation will call our
- implementation when the <emphasis>VIEW</emphasis> mode is requested.
+ implementation when the <literal>VIEW</literal> mode is requested.
</para>
</listitem>
<listitem>
@@ -174,7 +172,7 @@
writer.write("Hello World!");
writer.close();]]></programlisting>
Here we output the text
- <emphasis>Hello World!</emphasis>
+ <literal>Hello World!</literal>
in our portlet window.
<note>
Portlets are responsible for generating markup fragments, as they are included on a page and
@@ -187,21 +185,20 @@
</para>
</sect3>
<sect3 id="first_portlet_descriptors">
- <title>The Application Descriptors</title>
+ <title>Application Descriptors</title>
<para>
- JBoss Portal requires certain descriptors be included in your portlet war, for different reasons. Some of
- these descriptors are defined by the Portlet Specification, and some are specific to JBoss Portal.
+ JBoss Portal requires certain descriptors be included in your portlet WAR, for different reasons. Some of
+ these descriptors are defined by the Portlet Specification, some are specific to JBoss Portal.
<mediaobject>
<imageobject>
<imagedata align="center" fileref="images/tutorials/first_portlet/package.gif" valign="middle"/>
</imageobject>
</mediaobject>
- Now lets explain what each of these does:
+ Now let's explain what each of these does:
<itemizedlist>
<listitem>
- <para>
- portlet.xml
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+ <para><literal>portlet.xml</literal>
+<programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
@@ -231,7 +228,7 @@
<listitem>
<para>
<programlisting><![CDATA[<portlet-class>org.jboss.portlet.hello.HelloWorldPortlet</portlet-class>]]></programlisting>
- The FQN of your portlet class must be declared here.
+ The Fully Qualified Name (FQN) of your portlet class must be declared here.
</para>
</listitem>
<listitem>
@@ -267,8 +264,8 @@
</para>
</listitem>
<listitem>
- <para>portlet-instances.xml
- <programlisting><![CDATA[<?xml version="1.0" standalone="yes"?>
+ <para><literal>portlet-instances.xml</literal>
+<programlisting><![CDATA[<?xml version="1.0" standalone="yes"?>
<!DOCTYPE deployments PUBLIC
"-//JBoss Portal//DTD Portlet Instances 2.6//EN"
"http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
@@ -288,8 +285,8 @@
</para>
</listitem>
<listitem>
- <para>helloworld-object.xml
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+ <para><literal>helloworld-object.xml</literal>
+<programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE deployments PUBLIC
"-//JBoss Portal//DTD Portal Object 2.6//EN"
"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
@@ -317,30 +314,19 @@
<para>
<programlisting><![CDATA[<parent-ref>default.default</parent-ref>]]></programlisting>
Tells the portal where this portlet should appear. In this case,
- <emphasis>default.default</emphasis>
- specifies that this portlet should appear in the portal instance named
- <emphasis>default</emphasis>
- and the
- page named
- <emphasis>default</emphasis>
- .
+ <literal>default.default</literal> specifies that this portlet should appear in the
+ portal instance named <literal>default</literal> and the page named
+ <literal>default</literal>.
</para>
</listitem>
<listitem>
<para>
<programlisting><![CDATA[<if-exists>overwrite</if-exists>]]></programlisting>
Instructs the portal to overwrite or keep this object if it already exists.
- Possible values are
- <emphasis>overwrite</emphasis>
- or
- <emphasis>keep</emphasis>
- .
- <emphasis>Overwrite</emphasis>
- will destroy the existing object and create a new one
- based on the content of the deployment.
- <emphasis>Keep</emphasis>
- will maintain the
- existing objct deployment or create a new one if it does not yet exist.
+ Possible values are <literal>overwrite</literal> or <literal>keep</literal>.
+ <literal>overwrite</literal> will destroy the existing object and create a new one
+ based on the content of the deployment. <literal>keep</literal> will maintain the
+ existing object deployment or create a new one if it does not yet exist.
</para>
</listitem>
<listitem>
@@ -352,13 +338,8 @@
<listitem>
<para>
<programlisting><![CDATA[<instance-ref>HelloWorldPortletInstance</instance-ref>]]></programlisting>
- The value of
- <emphasis>instance-ref</emphasis>
- must match the value of
- <emphasis>instance-id</emphasis>
- found in the
- <emphasis>portlet-instances.xml</emphasis>
- .
+ The value of <literal>instance-ref</literal> must match the value of
+ <literal>instance-id</literal> found in the <literal>portlet-instances.xml</literal>.
</para>
</listitem>
<listitem>
@@ -374,8 +355,7 @@
</itemizedlist>
</para>
<para>
- To illustrate the relationship between the descriptors
- , we have provided this simple diagram
+ To illustrate the relationship between the descriptors, we have provided this simple diagram
<mediaobject>
<imageobject>
<imagedata align="center" fileref="images/tutorials/first_portlet/desc_relationship.gif"
@@ -387,7 +367,8 @@
<para>
Portal 2.6 introduces the notion of <emphasis>content type</emphasis>, which is a generic mechanism to
specify which content will be displayed by a given portlet window. The <literal>window</literal> section
- of the previous example can be re-written as follows to take advantage of the new content framework:
+ of the previous example can be re-written to take advantage of the new content framework, resulting in
+ the following deployment descriptor:
<programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE deployments PUBLIC
"-//JBoss Portal//DTD Portal Object 2.6//EN"
@@ -416,15 +397,12 @@
pluggable and it is possible to plug virtually any kind of content.
</para>
</sect3>
- <sect3>
+ <sect3 id="first_portlet_build">
<title>Building your portlet</title>
- <para>If you have downloaded the sample, you can execute the build.xml with ANT or inside your IDE.
- Executing the
- <emphasis>deploy</emphasis>
- target
- will compile all src files and produce a helloworldportlet.war under
- <emphasis>HelloWorldPortlet\helloworldportlet.war.</emphasis>
-
+ <para>If you have downloaded the sample, you can execute the build.xml with ant or inside your IDE.
+ Executing the <literal>deploy</literal> target will compile all the source files and produce a
+ <literal>helloworldportlet.war</literal> file under
+ <literal>HelloWorldPortlet\helloworldportlet.war.</literal>
</para>
<para>
<mediaobject>
@@ -434,10 +412,8 @@
</mediaobject>
</para>
<para>
- If you want to create an expanded war directory, after executing the above deploy target, you should
- execute the
- <emphasis>explode</emphasis>
- target.
+ If you want to create an expanded WAR directory, after executing the above deploy target, you should
+ execute the <literal>explode</literal> target.
<mediaobject>
<imageobject>
<imagedata align="center" fileref="images/tutorials/first_portlet/buildexplode.gif"
@@ -452,33 +428,25 @@
<imagedata align="center" fileref="images/tutorials/first_portlet/exploded.gif" valign="middle"/>
</imageobject>
</mediaobject>
- This will deflate the helloworldportlet.war, and allow you to deploy it as an expanded directory. It will
- work just the same, with some additional benefits noted below:
- </para>
- <para>
- The advantage to expanded war deployments is that you can modify xml descriptors, resource files
- jsp/jsf pages easily during development. Simply
- <emphasis>touch</emphasis>
- the web.xml to have JBoss Application Server hot-deploy the web appllication on a live-running server
- instance
- </para>
+ This will deflate <literal>helloworldportlet.war</literal>, and allow you to deploy it as an
+ expanded directory. It will work just the same but is easier to work with during development as you can
+ easily modify the XML descriptors, resources files, JSF/JSP pages. A simple <literal>touch</literal>
+ operation (or equivalent) on the <literal>web.xml</literal> file will let any live JBoss Application
+ Server instance know that it needs to hot-redeploy your web application.
+ </para>
</sect3>
<sect3>
<title>Deploying your portlet</title>
<para>
- Deploying a portlet is as simple as copying/moving the
- <emphasis>helloworldportlet.war</emphasis>
- in to the server deploy directory. Doing this on a running instance of the portal and application server,
- will trigger a
- <emphasis>hot-deploy</emphasis>
- :
+ Deploying a portlet is as simple as copying/moving <literal>helloworldportlet.war</literal>
+ to your server <literal>deploy</literal> directory. Doing this on a running instance of JBoss Portal and
+ application server, will trigger a <emphasis>hot-deploy</emphasis> of your portlet:
<programlisting><![CDATA[18:25:56,366 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build:
CVSTag=JBoss_4_0_5_GA date=2006000000)] Started in 1m:3s:688ms
18:26:21,147 INFO [TomcatDeployer] deploy, ctxPath=/helloworldportlet,
warUrl=.../tmp/deploy/tmp35219helloworldportlet-exp.war/]]></programlisting>
- Pointing your browser to
- <ulink url="http://localhost:8080/portal/">http://localhost:8080/portal/</ulink>
- , should yield a view of our HelloWorldPortlet:
+ Pointing your browser to <ulink url="http://localhost:8080/portal/">http://localhost:8080/portal/</ulink>,
+ should yield a view of our HelloWorldPortlet, added to the default page of Portal:
<mediaobject>
<imageobject>
<imagedata align="center" fileref="images/tutorials/first_portlet/output.png" valign="middle"/>
@@ -492,12 +460,9 @@
<sect3>
<title>Introduction</title>
<para>This section will introduce the reader to deploying a simple JSP portlet in JBoss Portal. It requires
- you
- download the HelloWorldJSPPortlet from PortletSwap.com, using this
- <ulink
- url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">
- link</ulink>
- .
+ you download the HelloWorldJSPPortlet from PortletSwap.com, using this
+ <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">
+ link</ulink>.
</para>
<para>
This portlet will introduce you to using JSPs for view rendering and the portlet taglib for generating
@@ -505,31 +470,28 @@
</para>
</sect3>
<sect3>
- <title>Package Structure</title>
+ <title>Package content</title>
<para>
- Portlets are packaged in war files, just like other JEE applications. A typical portlet war file can also
- include servlets, resource bundles, images, html, jsps, and other static or dynamic files you would
- commonly
- include.
- </para>
- <para>
+ The application descriptors for this portlet are similar to the ones we saw in
+ <xref linkend="first_portlet_descriptors"/>. See the <xref linkend="descriptors_portlet"/> chapter on
+ descriptors for more details.
<mediaobject>
<imageobject>
<imagedata align="center" fileref="images/tutorials/jsp_portlet/package.gif" valign="middle"/>
</imageobject>
</mediaobject>
+ As you can see in the figure above, the package content is what you'd expect from a traditional web
+ application augmented with the portlet- and JBoss Portal-specific application descriptors.
</para>
</sect3>
<sect3>
- <title>The Portlet Class</title>
+ <title>Portlet Class</title>
<para>
- Included in the
- <ulink
- url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">
- download bundle</ulink>
- you should have one java source file:
- <emphasis>HelloWorldPortlet\src\main\org\jboss\portlet\hello\HelloWorldJSPPortlet.java</emphasis>
- , and it should contain the following:
+ Included in the <ulink
+ url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">
+ download bundle</ulink> you should have one java source file:
+ <literal>HelloWorldJSPPortlet\src\main\org\jboss\portlet\hello\HelloWorldJSPPortlet.java</literal>,
+ containing the following:
<programlisting><![CDATA[package org.jboss.portlet.hello;
import javax.portlet.ActionRequest;
@@ -594,7 +556,7 @@
prd.include(rRequest, rResponse);
}
}]]></programlisting>
- Now lets look at some of our methods:
+ Now let's look at some of our methods:
<itemizedlist>
<listitem>
<para>
@@ -619,16 +581,17 @@
aResponse.setRenderParameter("yourname", sYourname);
}]]></programlisting>
- This method will be triggered upon clicking on an ActionURL from our view.jsp. It will retrieve
- <emphasis>yourname</emphasis>
- from the HTML form, and pass it along as a renderParameter to the doView().
+ This method will be triggered upon clicking on an <literal>ActionURL</literal> from our
+ <literal>view.jsp</literal>. It will retrieve <literal>yourname</literal> from the HTML form,
+ and pass it along as a <literal>renderParameter</literal> to the <literal>doView()</literal>
+ method.
</para>
</listitem>
<listitem>
<para>
<programlisting>rResponse.setContentType("text/html");</programlisting>
- Just like in the servlet-world, you must declare what content-type the portlet will be
- responding in.
+ Just like in the servlet world, you must declare which kind of MIME type of the content the
+ portlet will be generating.
</para>
</listitem>
<listitem>
@@ -636,100 +599,29 @@
<programlisting><![CDATA[protected void doView(RenderRequest rRequest, RenderResponse rResponse)
throws PortletException, IOException, UnavailableException
]]></programlisting>
- In this case, our doView, is responsible for dispatching to the appropriate jsp
- <emphasis>view.jsp</emphasis>
- or
- <emphasis>view2.jsp</emphasis>
- , depending on the existence of the
- <emphasis>yourname</emphasis>
- parameter passed in from the
- <emphasis>processAction</emphasis>
- .
+ In this case, our <literal>doView</literal> implementation is responsible for dispatching to
+ the appropriate JSP <literal>view.jsp</literal> or <literal>view2.jsp</literal>, depending on
+ the existence of the <literal>yourname</literal> parameter passed in from
+ <literal>processAction</literal>.
</para>
</listitem>
</itemizedlist>
</para>
- </sect3>
+ </sect3>
<sect3>
- <title>The Application Descriptors</title>
- <para>
- JBoss Portal requires certain descriptors be included in your portlet war, for different reasons. Some of
- these descriptors are defined by the Portlet Specification, and some are specific to JBoss Portal. For
- brevity, we only discuss the
- <emphasis>portlet.xml</emphasis>
- descriptor here. For discussion on the other descriptors, please view
- <xref linkend="first_portlet_descriptors"/>
- or the
- chapter on descriptors:
- <xref linkend="descriptors_portlet"/>
- .
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/jsp_portlet/package.gif" valign="middle"/>
- </imageobject>
- </mediaobject>
- <itemizedlist>
- <listitem>
- <para>
- portlet.xml
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
- http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- version="1.0">
- <portlet>
- <portlet-name>HelloWorldJSPPortlet</portlet-name>
- <portlet-class>org.jboss.portlet.hello.HelloWorldJSPPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
- <portlet-info>
- <title>HelloWorld JSP Portlet</title>
- </portlet-info>
- </portlet>
-</portlet-app>]]></programlisting>
- This file must adhere to its definition in the Portlet Specification. You may define more than
- one portlet application in this file.
- <note>
- This sample portlet supports 3 view modes: VIEW, EDIT, and HELP. The supported modes must be
- declared in the
- <emphasis>portlet.xml</emphasis>
- using the
- <emphasis>portlet-mode</emphasis>
- tag.
- .
- </note>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect3>
- <sect3>
<title>JSP files and the portlet taglib</title>
<para>
- Of importance in this tutorial are the two view jsps. The first, allows the user to input his name, which
- is then posted to the
- <emphasis>processAction</emphasis>
- method in our portlet class, set as a
- <emphasis>renderParameter</emphasis>
- , then the render method is invoked (in our case its the
- <emphasis>doView</emphasis>
- , which then dispatches to our
- <emphasis>view2.jsp</emphasis>
- .
+ Of importance in this tutorial are the two view JSPs. The first, <literal>view.jsp</literal>, allows the
+ user to input his name, which is then posted to the <literal>processAction</literal> method in our
+ portlet class, set as a <literal>renderParameter</literal>, then the <literal>render</literal> method is
+ invoked (in our case, <literal>doView</literal>, which then dispatches to our
+ <literal>view2.jsp</literal>).
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/tutorials/jsp_portlet/process.gif"
- valign="middle"/>
+ <imagedata align="center" fileref="images/tutorials/jsp_portlet/process.gif" valign="middle"/>
</imageobject>
</mediaobject>
- Now lets have a look at our
- <emphasis>view.jsp</emphasis>
- :
+ Now let's have a look at our <literal>view.jsp</literal>:
</para>
<para>
<programlisting><![CDATA[<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
@@ -755,42 +647,32 @@
<listitem>
<para>
<programlisting><![CDATA[<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>]]></programlisting>
- Define the portlet taglib. You do not need to bundle the portlet taglib, JBoss Portal will
- handle that for you.
+ Define the portlet taglib. You do <emphasis>NOT</emphasis> need to bundle the portlet taglib,
+ JBoss Portal will handle that for you.
</para>
</listitem>
<listitem>
<para>
<programlisting><![CDATA[<portlet:defineObjects/>]]></programlisting>
- Calling
- <emphasis>defineObjects</emphasis>
- creates implicit objects in this jsp, that you can access, like:
- <emphasis>renderRequest, actionRequest, portletConfig</emphasis>
- .
+ Calling <literal>defineObjects</literal> makes available implicit objects, such as
+ <literal>renderRequest, actionRequest, portletConfig</literal>, in this JSP.
</para>
</listitem>
<listitem>
<para>
<programlisting><![CDATA[<form action="<portlet:actionURL><portlet:param name="page" value="mainview"/>
</portlet:actionURL>" method="POST">]]></programlisting>
- We create an HTML form, but generate the URL it will post to, using the portlet tag library. In
- this case, notice how we are creating an
- <emphasis>actionURL</emphasis>
- , which will activate out
- <emphasis>processAction</emphasis>
- method, passing in any input parameters in the form.
+ We create an HTML form, but generate the URL it will post to using the portlet tag library. In
+ this case, notice how we are creating an <literal>actionURL</literal>, which will activate our
+ <literal>processAction</literal> method, passing in any input parameters in the form.
</para>
</listitem>
<listitem>
<para>
<programlisting><![CDATA[<a href="<portlet:renderURL><portlet:param name="yourname" value="Roy Russo">
</portlet:param></portlet:renderURL>">]]></programlisting>
- Likewise, we are able to create a link to our
- <emphasis>doView</emphasis>
- , by simply creating it with a
- <emphasis>renderURL</emphasis>
- , that passes in our
- <emphasis>yourname</emphasis>
+ Likewise, we are able to create a link to our <literal>doView</literal> method, by simply
+ creating it with a <literal>renderURL</literal>, that passes in our <literal>yourname</literal>
parameter.
</para>
</listitem>
@@ -798,103 +680,45 @@
</para>
</sect3>
<sect3>
- <title>Building your portlet</title>
- <para>If you have downloaded the sample, you can execute the build.xml with ANT or inside your IDE.
- Executing the
- <emphasis>deploy</emphasis>
- target
- will compile all src files and produce a helloworldportlet.war under
- <emphasis>HelloWorldPortlet\helloworldjspportlet.war.</emphasis>
-
+ <title>Building and deploying your portlet</title>
+ <para>If you have downloaded the sample, you can execute the build.xml with ant or inside your IDE.
+ Executing the <literal>deploy</literal> target will compile all source files and produce a
+ <literal>helloworldjspportlet.war</literal> file in a way similar to what we saw in
+ <xref linkend="first_portlet_build"/>.
</para>
<para>
+ The <literal>explode</literal> target will produce the following:
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/tutorials/jsp_portlet/building.gif" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- If you want to create an expanded war directory, after executing the above deploy target, you should
- execute the
- <emphasis>explode</emphasis>
- target.
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/jsp_portlet/buildexplode.gif"
- valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- The above target will produce the following:
- <mediaobject>
- <imageobject>
<imagedata align="center" fileref="images/tutorials/jsp_portlet/exploded.gif" valign="middle"/>
</imageobject>
</mediaobject>
- This will deflate the helloworldjspportlet.war, and allow you to deploy it as an expanded directory. It
- will
- work just the same, with some additional benefits noted below:
</para>
<para>
- The advantage to expanded war deployments is that you can modify xml descriptors, resource files
- jsp/jsf pages easily during development. Simply
- <emphasis>touch</emphasis>
- the web.xml to have JBoss Application Server hot-deploy the web appllication on a live-running server
- instance
- </para>
- </sect3>
- <sect3>
- <title>Deploying your portlet</title>
- <para>
- Deploying a portlet is as simple as copying/moving the
- <emphasis>helloworldjspportlet.war</emphasis>
- in to the server deploy directory. Doing this on a running instance of the portal and application server,
- will trigger a
- <emphasis>hot-deploy</emphasis>
- :
- <programlisting><![CDATA[15:54:34,234 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build:
- CVSTag=JBoss_4_0_5_GA date=2006000000)]
- Started in 1m:9s:766ms
-15:55:04,062 INFO [TomcatDeployer] deploy, ctxPath=/helloworldjspportlet,
- warUrl=.../tmp/deploy/tmp57782helloworldjspportlet-exp.war/]]></programlisting>
- Pointing your browser to
- <ulink url="http://localhost:8080/portal/">http://localhost:8080/portal/</ulink>
- , should yield a view of our HelloWorldPortlet:
+ Deploying the portlet is as easy as copying/moving the <literal>helloworldjspportlet.war</literal> file
+ to the server <literal>deploy</literal> directory. We can then see our portlet on the Portal default
+ page (<ulink url="http://localhost:8080/portal/">http://localhost:8080/portal/</ulink>):
<mediaobject>
<imageobject>
<imagedata align="center" fileref="images/tutorials/jsp_portlet/output.png" valign="middle"/>
</imageobject>
</mediaobject>
</para>
- </sect3>
+ </sect3>
</sect2>
- <sect2>
- <title>A Simple JSF Portlet</title>
+ <sect2 id="myfaces_40x">
+ <title>A Simple MyFaces JSF Portlet on JBoss AS 4.0.x</title>
<sect3>
<title>Introduction</title>
- <para>This section will introduce the reader to deploying a simple JSF portlet in JBoss Portal. It requires
- you
- download the HelloWorldJSFPortlet from PortletSwap.com, using this
- <ulink
- url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">
- link</ulink>
- .
+ <para>This section will introduce the reader to deploying a simple JSF portlet in JBoss Portal, using
+ Apache's MyFaces JSF implementation on JBoss AS 4.0.x. It requires you download the HelloWorldJSFPortlet
+ from PortletSwap.com, using this
+ <ulink url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">link</ulink>.
</para>
- <para>
- This portlet will introduce you to leveraging the JSF framework in portlet development.
- </para>
- </sect3>
+ </sect3>
<sect3>
- <title>Package Structure</title>
+ <title>Package Content</title>
<para>
- Portlets are packaged in war files, just like other JEE applications. A typical portlet war file can also
- include servlets, resource bundles, images, html, jsps, and other static or dynamic files you would
- commonly
- include.
- </para>
- <para>
<mediaobject>
<imageobject>
<imagedata align="center" fileref="images/tutorials/jsf_portlet/package.gif" valign="middle"/>
@@ -902,29 +726,15 @@
</mediaobject>
Like a typical JSF application, we also package our faces-config.xml that defines our
managed-beans, converters, validators, navigation rules, etc...
- </para>
- <para>
- <note>When deploying on JBoss Application Seever, you do not need to package the myfaces libraries with
- your portlet application. JBoss AS already bundles these libraries by default under
- <emphasis>JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/jsf-libs/</emphasis>
+ <note>JBoss Application Server version 4.0.x bundles Apache's MyFaces JSF implementation in
+ <literal>JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/jsf-libs/</literal>. As a result,
+ you do not need to package MyFaces' libraries with your portlet application.
</note>
</para>
- </sect3>
- <sect3>
- <title>The Application Descriptors</title>
- <para>
- JBoss Portal requires certain descriptors be included in your portlet war, for different reasons. Some of
- these descriptors are defined by the Portlet Specification, and some are specific to JBoss Portal. For
- brevity, we only discuss the
- <emphasis>portlet.xml</emphasis>
- and
- <emphasis>faces-config.xml</emphasis>
- descriptors here. For discussion on the other descriptors, please view
- <xref linkend="first_portlet_descriptors"/>
- or the
- chapter on descriptors:
- <xref linkend="descriptors_portlet"/>
- .
+ <para>For the sake of brevity, we only discuss the <literal>portlet.xml</literal> and
+ <literal>faces-config.xml</literal> descriptors here. For discussion on the other descriptors, please
+ view <xref linkend="first_portlet_descriptors"/> or the chapter on descriptors:
+ <xref linkend="descriptors_portlet"/>.
<mediaobject>
<imageobject>
<imagedata align="center" fileref="images/tutorials/jsf_portlet/package.gif" valign="middle"/>
@@ -932,9 +742,8 @@
</mediaobject>
<itemizedlist>
<listitem>
- <para>
- portlet.xml
- <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+ <para><literal>portlet.xml</literal>
+<programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
@@ -957,15 +766,15 @@
</portlet>
</portlet-app>]]></programlisting>
This file must adhere to its definition in the Portlet Specification. You may define more than
- one portlet application in this file. Now lets look at the portions that deal with our use of
+ one portlet application in this file. Now let's look at the portions that deal with our use of
JSF:
<itemizedlist>
<listitem>
<para>
- Here we define our portlet class, as we normally would. However, note the use of the
- MyFacesGenericPortlet. In this case, we will allow the MyFacesGenericPortlet to handle
- all requests/responses from our users:
<programlisting><![CDATA[<portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>]]></programlisting>
+ Here we specify that MyFacesGenericPortlet will handle all requests/responses from our
+ users. There is therefore no need to develop a specific portlet class, MyFaces
+ providing a generic implementation bridging the JSF and portlet worlds.
<note>If you wanted to add more functionality to your JSF portlet, not included in the
MyFacesGenericPortlet, you could sublass it and create your own Class.</note>
</para>
@@ -984,8 +793,8 @@
</para>
</listitem>
<listitem>
- <para>faces-config.xml
- <programlisting><![CDATA[<?xml version="1.0"?>
+ <para><literal>faces-config.xml</literal>
+<programlisting><![CDATA[<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
@@ -1003,101 +812,80 @@
</navigation-case>
</navigation-rule>
</faces-config>]]></programlisting>
- There is nothing special about the faces-config.xml included here. This application would work
- just as well outside of a portlet as it would inside a portlet container. In the above lines, we
- define a basic User Bean and a navigation rule to handle the submittal of the original form on
- the index.jsp.
+ There is nothing special about the <literal>faces-config.xml</literal> file included here. This
+ application would work just as well outside of a portlet as it would inside a portlet container.
+ In the above lines, we define a basic <literal>User</literal> Bean and a navigation rule to
+ handle the submittal of the original form on <literal>index.jsp</literal>.
</para>
</listitem>
</itemizedlist>
</para>
</sect3>
<sect3>
- <title>The JSP files</title>
+ <title>JSP files</title>
+ <para>TODO!!</para>
</sect3>
<sect3>
- <title>Building your portlet</title>
- <para>If you have downloaded the sample, you can execute the build.xml with ANT or inside your IDE.
- Executing the
- <emphasis>deploy</emphasis>
- target
- will compile all src files and produce a helloworldjsfportlet.war under
- <emphasis>HelloWorldJSFPortlet\helloworldjsfportlet.war.</emphasis>
-
+ <title>Building and deploying your portlet</title>
+ <para>If you have downloaded the sample, you can execute the build.xml with ant or inside your IDE.
+ Executing the <literal>deploy</literal> target will compile all source files and produce a
+ <literal>helloworldjspportlet.war</literal> file in a way similar to what we saw in
+ <xref linkend="first_portlet_build"/>.
</para>
<para>
+ The <literal>explode</literal> target will produce the following:
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/tutorials/jsf_portlet/building.gif" valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- If you want to create an expanded war directory, after executing the above deploy target, you should
- execute the
- <emphasis>explode</emphasis>
- target.
- <mediaobject>
- <imageobject>
- <imagedata align="center" fileref="images/tutorials/jsf_portlet/buildexplode.gif"
- valign="middle"/>
- </imageobject>
- </mediaobject>
- </para>
- <para>
- The above target will produce the following:
- <mediaobject>
- <imageobject>
<imagedata align="center" fileref="images/tutorials/jsf_portlet/exploded.gif" valign="middle"/>
</imageobject>
</mediaobject>
- This will deflate the helloworldjsfportlet.war, and allow you to deploy it as an expanded directory. It
- will
- work just the same, with some additional benefits noted below:
</para>
<para>
- The advantage to expanded war deployments is that you can modify xml descriptors, resource files
- jsp/jsf pages easily during development. Simply
- <emphasis>touch</emphasis>
- the web.xml to have JBoss Application Server hot-deploy the web application on a live-running server
- instance
- </para>
- </sect3>
- <sect3>
- <title>Deploying your portlet</title>
- <para>
- Deploying a portlet is as simple as copying/moving the
- <emphasis>helloworldjsfportlet.war</emphasis>
- in to the server deploy directory. Doing this on a running instance of the portal and application server,
- will trigger a
- <emphasis>hot-deploy</emphasis>
- :
- <programlisting><![CDATA[22:30:03,093 INFO [TomcatDeployer] deploy, ctxPath=/helloworldjsfportlet,
- warUrl=.../tmp/deploy/tmp5571helloworldjsfportlet-exp.war/
-22:30:03,312 INFO [FacesConfigurator] Reading standard config
- org/apache/myfaces/resource/standard-faces-config.xml
-22:30:03,390 INFO [FacesConfigurator] Reading config
- jar:file:/C:/jboss-4.0.5.GA/server/default/tmp/deploy/
- tmp5504jboss-portal.sar-contents/lib/jsf-facelets.jar!/
- META-INF/faces-config.xml
-22:30:03,406 INFO [FacesConfigurator] Reading config jar:file:/C:/jboss-4.0.5.GA/
- server/default/tmp/deploy/tmp5504jboss-portal.sar-contents/
- lib/tomahawk.jar!/META-INF/faces-config.xml
-22:30:03,468 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
-22:30:03,484 ERROR [LocaleUtils] Locale name null or empty, ignoring
-22:30:03,640 INFO [MyFacesGenericPortlet] PortletContext 'C:\jboss-4.0.5.GA\server\
- default\.\tmp\deploy\tmp5571helloworldjsfportlet-exp.war\'
- initialized.]]></programlisting>
- Pointing your browser to
- <ulink url="http://localhost:8080/portal/">http://localhost:8080/portal/</ulink>
- , should yield a view of our HelloWorldJSFPortlet:
+ Deploying the portlet is as easy as copying/moving the <literal>helloworldjspportlet.war</literal> file
+ to the server <literal>deploy</literal> directory. We can then see our portlet on the Portal default
+ page (<ulink url="http://localhost:8080/portal/">http://localhost:8080/portal/</ulink>):
<mediaobject>
<imageobject>
<imagedata align="center" fileref="images/tutorials/jsf_portlet/output.png" valign="middle"/>
</imageobject>
</mediaobject>
</para>
- </sect3>
+ </sect3>
</sect2>
+ <sect2>
+ <title>Adapting MyFaces JSF Portlet to work on JBoss AS 4.2.x</title>
+ <para>We saw in <xref linkend="myfaces_40x"/> how to create a JSF-based portlet using Apache's MyFaces
+ JSF implementation on JBoss Application Server 4.0.x. Starting with version 4.2.0 of JBoss Application
+ Server, the default bundled JSF implementation is Sun's Reference Implementation (RI). We thus need to
+ adapt our MyFaces portlet sightly so that it works in this new environment.
+ </para>
+ <para>The first step is to provide access to MyFaces as it's not bundled anymore in JBoss AS. This is
+ accomplished by adding <literal>myfaces-api.jar</literal> and <literal>myfaces-impl.jar</literal> in
+ our portlet <literal>WEB-INF/lib</literal> directory. This can be done automatically via a modification of
+ the ant script and is left as an exercise to the reader.
+ </para>
+ <para>
+ We also need to need to tell JBoss AS not to use its bundled JSF implementation for our portlet. This
+ is accomplished by adding the following to our portlet's <literal>web.xml</literal>:
+ <programlisting><![CDATA[<context-param>
+ <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
+ <param-value>true</param-value>
+</context-param>]]></programlisting>
+ More details on this procedure can be found at <ulink
+ url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossFaces">http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossFaces</ulink>.
+ </para>
+ <para>
+ We should get the following package content for our portlet:
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/tutorials/jsf_portlet/package_42x.png" valign="middle"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </sect2>
+ <sect2>
+ <title>JSF Portlet using Sun's JSF Reference Implementation (RI)</title>
+ <para>TODO</para>
+ </sect2>
</sect1>
</chapter>
\ No newline at end of file
16 years, 10 months
JBoss Portal SVN: r7876 - trunk/core-identity.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-08-08 12:11:13 -0400 (Wed, 08 Aug 2007)
New Revision: 7876
Modified:
trunk/core-identity/
Log:
ignore output
Property changes on: trunk/core-identity
___________________________________________________________________
Name: svn:ignore
+ output
16 years, 10 months
JBoss Portal SVN: r7875 - in trunk/core-identity: src and 23 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-08-08 12:09:16 -0400 (Wed, 08 Aug 2007)
New Revision: 7875
Added:
trunk/core-identity/.classpath
trunk/core-identity/.project
trunk/core-identity/build.bat
trunk/core-identity/build.sh
trunk/core-identity/build.xml
trunk/core-identity/src/
trunk/core-identity/src/bin/
trunk/core-identity/src/bin/portal-identity-war/
trunk/core-identity/src/bin/portal-identity-war/style.css
trunk/core-identity/src/etc/
trunk/core-identity/src/etc/sun-jsf/
trunk/core-identity/src/etc/sun-jsf/jsf-example.jar
trunk/core-identity/src/main/
trunk/core-identity/src/main/org/
trunk/core-identity/src/main/org/jboss/
trunk/core-identity/src/main/org/jboss/portal/
trunk/core-identity/src/main/org/jboss/portal/core/
trunk/core-identity/src/main/org/jboss/portal/core/identity/
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/UserRegisterBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/ProfileBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java
trunk/core-identity/src/resources/
trunk/core-identity/src/resources/portal-identity-sar/
trunk/core-identity/src/resources/portal-identity-sar/META-INF/
trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml
trunk/core-identity/src/resources/portal-identity-war/
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/confirm.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portal.taglib.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet-instances.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml
Log:
Added: trunk/core-identity/.classpath
===================================================================
--- trunk/core-identity/.classpath (rev 0)
+++ trunk/core-identity/.classpath 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/api"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/faces"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/format"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jems"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/portlet"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/security"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/server"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/workflow"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/core-admin"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/commons-beanutils.jar"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/commons-digester.jar"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/commons-el.jar"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/el-api.jar"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/el-ri.jar"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/jsf-example.jar"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/jsf-facelets.jar"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/jstl.jar"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/myfaces-api.jar"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/myfaces-impl.jar"/>
+ <classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/portal-faces-lib.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/core-identity/.project
===================================================================
--- trunk/core-identity/.project (rev 0)
+++ trunk/core-identity/.project 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>core-identity</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/core-identity/build.bat
===================================================================
--- trunk/core-identity/build.bat (rev 0)
+++ trunk/core-identity/build.bat 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 1015 2005-11-04 20:15:13Z mholzner $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: trunk/core-identity/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-identity/build.sh
===================================================================
--- trunk/core-identity/build.sh (rev 0)
+++ trunk/core-identity/build.sh 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 1015 2005-11-04 20:15:13Z mholzner $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: trunk/core-identity/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-identity/build.xml
===================================================================
--- trunk/core-identity/build.xml (rev 0)
+++ trunk/core-identity/build.xml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,294 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM "../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and |-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable" depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+
+ <path id="library.classpath">
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="jboss.cache.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="hibernate.hibernate.classpath"/>
+ <path refid="apache.myfaces.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ <path refid="facelets.facelets.classpath"/>
+ <path refid="el.el.classpath"/>
+ <pathelement location="${source.etc}/sun-jsf/jsf-example.jar"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-format.classpath"/>
+ <path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-faces.classpath"/>
+ <path refid="jboss.portal-bridge.classpath"/>
+ <path refid="jboss.portal-server.classpath"/>
+ <path refid="jboss.portal-registration.classpath"/>
+ <path refid="jboss.portal-portlet.classpath"/>
+ <path refid="jboss.portal-jems.classpath"/>
+ <path refid="jboss.portal-portlet-federation.classpath"/>
+ <path refid="jboss.portal-identity.classpath"/>
+ <path refid="jboss.portlet-api.classpath"/>
+ <path refid="jboss.portal-theme.classpath"/>
+ <path refid="jboss.portal-security.classpath"/>
+ <path refid="jboss.portal-test.classpath"/>
+ <path refid="jboss.portal-core.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+ <call target="configure-explode"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ <taskdef name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ <taskdef name="implode"
+ classname="org.jboss.portal.common.ant.Implode"
+ classpathref="explode.task.classpath"/>
+
+ </target>
+
+ <target name="configure-explode">
+ <path id="explode.task.classpath">
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <path refid="apache.ant.classpath"/>
+ </path>
+ <taskdef
+ name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="artifacts"
+ description="Generate all target output."
+ depends="compile">
+
+ <mkdir dir="${build.lib}"/>
+
+ <!-- portal-core-identity-lib.jar -->
+ <jar jarfile="${build.lib}/portal-core-identity-lib.jar">
+ <fileset dir="${build.classes}"/>
+ </jar>
+
+ <!-- portal-identity.war -->
+ <copy todir="${build.resources}/portal-identity-war/WEB-INF/lib2">
+ <fileset dir="${apache.myfaces.lib}" includes="myfaces-api.jar,myfaces-impl.jar,jstl.jar"/>
+ <fileset dir="${build.lib}" includes="portal-core-identity-lib.jar"/>
+ <fileset dir="${jboss.portal-faces.root}/lib" includes="portal-faces-lib.jar"/>
+ <fileset dir="../core-admin/src/etc/sun-jsf" includes="jsf-example.jar"/>
+ <fileset dir="${facelets.facelets.lib}" includes="jsf-facelets.jar"/>
+ <fileset dir="${el.el.lib}" includes="el-api.jar,el-ri.jar"/>
+ <fileset dir="${commons.el.lib}" includes="commons-el.jar"/>
+ <fileset dir="${apache.beanutils.lib}" includes="commons-beanutils.jar"/>
+ <fileset dir="${apache.digester.lib}" includes="commons-digester.jar"/>
+ </copy>
+ <copy todir="${build.resources}/portal-identity-war">
+ <fileset dir="${source.bin}/portal-identity-war"/>
+ </copy>
+ <!-- portal-identity.sar -->
+ <copy todir="${build.resources}/portal-identity.sar">
+ <fileset dir="${build.resources}/portal-identity-sar"/>
+ </copy>
+ <copy todir="${build.resources}/portal-identity.sar/lib">
+ <fileset dir="${jboss.portal-faces.root}/lib" includes="portal-faces-loader-lib.jar"/>
+ </copy>
+
+ <copy todir="${build.resources}/portal-identity.sar/portal-identity.war">
+ <fileset dir="${build.resources}/portal-identity-war"/>
+ </copy>
+
+ </target>
+
+ <target name="output" depends="artifacts">
+
+ <implode
+ dir="${build.resources}/portal-identity.sar"
+ tofile="${build.lib}/portal-identity.sar"/>
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Deploy the application
+ -->
+
+ <target name="deploy"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/portal-identity.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ </target>
+
+ <!--
+ | Undeploy the application
+ -->
+ <target name="undeploy"
+ description="Undeploy."
+ depends="init">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-identity.sar"/>
+ </target>
+
+ <target name="package-tests"/>
+
+
+ <!--
+ Some convenience build targets to help deployment during development
+ -->
+ <target name="deploy-ha"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal-ha.deploy.dir}"/>
+ <copy file="${build.lib}/portal-identity.sar" todir="${jboss.home}/server/${portal-ha.deploy.dir}" overwrite="true"/>
+ </target>
+</project>
Property changes on: trunk/core-identity/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-identity/src/bin/portal-identity-war/style.css
===================================================================
--- trunk/core-identity/src/bin/portal-identity-war/style.css (rev 0)
+++ trunk/core-identity/src/bin/portal-identity-war/style.css 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,235 @@
+/* Redefine spacing for tables. */
+
+.identity-ui table {
+ border: 0;
+}
+
+.identity-ui th {
+ text-align: left;
+ border: 0;
+ border-bottom: 1px solid;
+ padding-bottom: 2px;
+ padding-top: 2px;
+ font-size: 11px;
+}
+
+.identity-ui td {
+ padding-bottom: 2px;
+ padding-top: 2px;
+}
+
+/* Pagination. */
+
+.identity-ui ul.pagination {
+ margin: 0;
+ padding: .2em;
+}
+
+.identity-ui ul.pagination li {
+ text-align: center;
+ list-style-type: none;
+ display: inline;
+ margin-right: 2px;
+ border: 1px solid;
+}
+
+.identity-ui ul.pagination li.selected {
+ font-weight: bold;
+ background-color: #eef;
+ border: 1px solid black;
+ border-bottom: 3px solid black;
+}
+
+.pagination a, .pagination a:visited, .pagination a:hover {
+ text-decoration: none;
+}
+
+/* Top nav. */
+
+.identity-ui ul.topnav {
+ margin-left: 0;
+ padding: 4px 0px 3px;
+ border-bottom: 1px solid #dfe8ed;
+}
+
+.identity-ui ul.topnav li {
+ list-style-type: none;
+ display: inline;
+ margin: 0;
+ padding: 3px 0.5em;
+ margin-left: 5px;
+ border: 1px solid #dfe8ed;
+ border-bottom: none;
+ background-color: #f2f4f5;
+}
+
+.identity-ui ul.topnav li:hover {
+ background-color: #fff;
+}
+
+.identity-ui ul.topnav li#currentTab {
+ background-color: white;
+ border-bottom: 1px solid white;
+}
+
+.identity-ui ul.topnav li#currentTab a:hover {
+}
+
+/* Object path. */
+
+.identity-ui ul.objectpath {
+ margin: 0;
+ padding: 5px 0px 5px 0px;
+}
+
+.identity-ui ul.objectpath li {
+ list-style-type: none;
+ display: inline;
+ margin-right: 3px;
+}
+
+.identity-ui ul.objectpath li.selected {
+ font-weight: bold;
+}
+
+/* Resize combo lists */
+.identity-ui select {
+ padding: 2px 4px 2px 1px;
+}
+
+.identity-ui select.contentType {
+ width: 8em;
+}
+
+.identity-ui select.instanceList {
+ width: 11em;
+}
+
+.identity-ui select.windowList {
+ width: 95%;
+ overflow: auto;
+}
+
+/* Style a table for form layout */
+.identity-ui table form {
+ margin: 0;
+}
+
+.identity-ui table form td.label {
+ text-align: right;
+ vertical-align: top;
+ padding-top: 0.4em;
+}
+
+.identity-ui table form td.widget {
+ text-align: left;
+}
+
+/* Area header. */
+
+.identity-ui .portlet-area-header {
+ border: 1px solid #54708c;
+ font-weight: bold;
+ color: #fff;
+ font-size: 11px;
+ background-color: #5986b3;
+ padding: 2px;
+ padding-left: 4px;
+ margin: 0;
+}
+
+.identity-ui .portlet-area-body {
+ border: 1px solid #d5d5d5;
+ border-top: 0;
+ background-color: #fff;
+ padding: 4px;
+ margin: 0;
+}
+
+/* Styles updated and enhanced from the main portal css */
+
+.identity-ui th.portlet-section-title {
+ font-weight: bold;
+ color: #656565;
+ font-size: 11px;
+ border: 1px solid #999;
+ background-color: #ebf2f5;
+ padding-left: 6px;
+}
+
+.identity-ui .portlet-content-center {
+ padding: 0;
+ margin: 0;
+}
+
+.identity-ui .portlet-body {
+ padding: 0;
+ margin: 0;
+}
+
+.identity-ui .portlet-content-right {
+ padding: 0;
+ margin: 0;
+}
+
+.identity-ui .portlet-footer-left {
+ padding: 0;
+ margin: 0;
+}
+
+.identity-ui .portlet-table-header {
+ background-color: #eef;
+}
+
+.identity-ui .portlet-section-buttonrow {
+ margin-top: 6px;
+ margin-bottom: 6px;
+ float: right;
+}
+
+/* Change dashed line to solid. */
+
+.identity-ui hr {
+ border-top-style: solid;
+}
+
+.identity-ui .wizardStepBox {
+ display: inline;
+ float: left;
+ border: 1px solid #98B7C6;
+ height: 7em;
+ width: 9em;
+ background-color: #DFE8ED;
+ margin: .5em;
+}
+
+.identity-ui .wizardButtonBox {
+ margin: 1em;
+}
+
+.identity-ui .wizardContent {
+ clear: both;
+}
+
+.identity-ui #selected.wizardStepBox {
+ background-color: #C8DCC4;
+ border: 1px solid black;
+ border-bottom: 5px solid black;
+}
+
+.identity-ui .stepNumber {
+ font-size: 2em;
+ text-align: center;
+ margin-top: 5px;
+ margin-bottom: 0;
+}
+
+.identity-ui .stepText {
+ text-align: center;
+}
+
+.identity-ui .layout-button {
+ width: 50px;
+ margin: 2px;
+ padding: 2px;
+}
Property changes on: trunk/core-identity/src/bin/portal-identity-war/style.css
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-identity/src/etc/sun-jsf/jsf-example.jar
===================================================================
(Binary files differ)
Property changes on: trunk/core-identity/src/etc/sun-jsf/jsf-example.jar
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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.core.identity.ui;
+
+import java.util.HashMap;
+
+import org.jboss.portal.faces.el.PropertyValue;
+import org.jboss.portal.faces.el.dynamic.DynamicBean;
+
+public class DynamicUserAttribute implements DynamicBean
+{
+ HashMap map = new HashMap();
+
+ public Class getType(Object propertyName) throws IllegalArgumentException
+ {
+ return String.class;
+ }
+
+ public PropertyValue getValue(Object propertyName) throws IllegalArgumentException
+ {
+ return new PropertyValue((String) map.get((String) propertyName));
+ }
+
+ public boolean setValue(Object propertyName, Object value) throws IllegalArgumentException
+ {
+ map.put((String) propertyName, (String) value);
+ return true;
+ }
+
+ public HashMap getProfileAttributes() {
+ return map;
+ }
+}
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.core.identity.ui;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.portal.faces.el.PropertyValue;
+import org.jboss.portal.faces.el.dynamic.AbstractDynamicBean;
+import org.jboss.portal.faces.el.dynamic.DynamicBean;
+import org.jboss.portal.identity.User;
+
+public class IdentityUIUser
+{
+
+ private String username;
+ private String password;
+ private DynamicUserAttribute attribute = new DynamicUserAttribute();
+
+ public String getUsername()
+ {
+ return username;
+ }
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+ public String getPassword()
+ {
+ return password;
+ }
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+ public DynamicUserAttribute getAttribute()
+ {
+ return attribute;
+ }
+}
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * 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.core.identity.ui;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class UIAttribute
+{
+ private String identifier;
+ private String name;
+ private String validator;
+ private String converter;
+ private boolean required;
+
+ public String getIdentifier()
+ {
+ return identifier;
+ }
+ public void setIdentifier(String identifier)
+ {
+ this.identifier = identifier;
+ }
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+ public String getValidator()
+ {
+ return validator;
+ }
+ public void setValidator(String validator)
+ {
+ this.validator = validator;
+ }
+ public boolean isRequired()
+ {
+ return required;
+ }
+ public void setRequired(boolean required)
+ {
+ this.required = required;
+ }
+ public String getConverter()
+ {
+ return converter;
+ }
+ public void setConverter(String converter)
+ {
+ this.converter = converter;
+ }
+}
+
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordBean.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordBean.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.core.identity.ui.actions;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class LostPasswordBean
+{
+ private String username;
+ private String email;
+ public String getUsername()
+ {
+ return username;
+ }
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+ public String getEmail()
+ {
+ return email;
+ }
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+ public void doomed()
+ {
+
+ }
+
+
+
+}
+
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/UserRegisterBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/UserRegisterBean.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/UserRegisterBean.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,101 @@
+/******************************************************************************
+ * 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.core.identity.ui.actions;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.ui.IdentityUIUser;
+import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.User;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class UserRegisterBean
+{
+
+ private IdentityUIUser uiUser = new IdentityUIUser();
+ private IdentityUserBean identityUserBean;
+
+ private static final Logger log = Logger.getLogger(UserRegisterBean.class);
+
+ // Basic getter and setter
+ public IdentityUIUser getUiUser()
+ {
+ return uiUser;
+ }
+
+ public void setUiUser(IdentityUIUser uiUser)
+ {
+ this.uiUser = uiUser;
+ }
+
+ public IdentityUserBean getIdentityUserBean()
+ {
+ return identityUserBean;
+ }
+
+ public void setIdentityUserBean(IdentityUserBean identityUserBean)
+ {
+ this.identityUserBean = identityUserBean;
+ }
+
+ public String register()
+ {
+ if (uiUser.getUsername() != null && uiUser.getPassword() != null)
+ {
+ log.debug("Creating user account: " + uiUser.getUsername());
+
+ try
+ {
+ User user;
+ // Create user && assign roles
+ user = identityUserBean.createUser(uiUser.getUsername(), uiUser.getPassword(), null);
+ // Adding dynamically set properties
+ identityUserBean.updateProfile(user, uiUser.getAttribute().getProfileAttributes());
+ }
+ catch (RuntimeException e)
+ {
+ e.printStackTrace();
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("RuntimeException"));
+ }
+ catch (IdentityException e)
+ {
+ e.printStackTrace();
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("IdentityExeption"));
+ }
+
+ }
+ else
+ {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Missing required Values."));
+ }
+
+ return "success";
+ }
+
+}
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,192 @@
+/******************************************************************************
+ * 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.core.identity.ui.common;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.faces.context.FacesContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.ui.UIAttribute;
+import org.jboss.portal.core.identity.ui.actions.UserRegisterBean;
+import org.jboss.portal.core.ui.portlet.user.UserPortletConstants;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.UserProfileModule;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class IdentityUserBean
+{
+ private String defaultRole;
+
+ private UserModule userModule;
+ private RoleModule roleModule;
+ private MembershipModule membershipModule;
+ private UserProfileModule userProfileModule;
+
+ private MetaDataServiceBean metaDataService;
+
+ private static final Logger log = Logger.getLogger(UserRegisterBean.class);
+
+ public UserModule getUserModule()
+ {
+ return userModule;
+ }
+
+ public void setUserModule(UserModule userModule)
+ {
+ this.userModule = userModule;
+ }
+
+ public String getDefaultRole()
+ {
+ return defaultRole;
+ }
+
+ public void setDefaultRole(String defaultRole)
+ {
+ this.defaultRole = defaultRole;
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public void setRoleModule(RoleModule roleModule)
+ {
+ this.roleModule = roleModule;
+ }
+
+ public MembershipModule getMembershipModule()
+ {
+ return membershipModule;
+ }
+
+ public void setMembershipModule(MembershipModule membershipModule)
+ {
+ this.membershipModule = membershipModule;
+ }
+
+ public UserProfileModule getUserProfileModule()
+ {
+ return userProfileModule;
+ }
+
+ public void setUserProfileModule(UserProfileModule userProfileModule)
+ {
+ this.userProfileModule = userProfileModule;
+ }
+
+ public MetaDataServiceBean getMetaDataService()
+ {
+ return metaDataService;
+ }
+
+ public void setMetaDataService(MetaDataServiceBean metaDataService)
+ {
+ this.metaDataService = metaDataService;
+ }
+
+ public User createUser(String username, String password, Set roles) throws RuntimeException, IdentityException
+ {
+ // Checking roles
+ Set roleSet = new HashSet();
+ roleSet = this.checkRoles(roles);
+
+ // Create User
+ User user = userModule.createUser(username, password);
+
+ // Set Membership
+ membershipModule.assignRoles(user, roleSet);
+ return user;
+ }
+
+ public void updateProfile(User user, HashMap profileMap) throws IdentityException
+ {
+ Set profileSet = profileMap.keySet();
+ Iterator i = profileSet.iterator();
+
+ while (i.hasNext())
+ {
+ String key = (String) i.next();
+ String value = (String) profileMap.get(key);
+ UIAttribute uiAttribute = (UIAttribute) this.metaDataService.getValue(key).getObject();
+ userProfileModule.setProperty(user, uiAttribute.getIdentifier(), value);
+ }
+
+ }
+
+ private Set checkRoles(Set roles) throws IllegalArgumentException, IdentityException
+ {
+
+ if (roles != null)
+ { // Checking existing roles
+ Iterator i = roles.iterator();
+
+ while (i.hasNext())
+ {
+ String roleName = (String) i.next();
+
+ Role role = roleModule.findRoleByName(roleName);
+
+ if (role == null)
+ {
+ // Create new role ?
+ }
+ else
+ {
+ roles.add(role);
+ }
+ }
+ return roles;
+
+ }
+ else
+ {
+ roles = new HashSet();
+ Role role = roleModule.findRoleByName(defaultRole);
+
+ if (role != null)
+ {
+ roles.add(role);
+ }
+ else
+ {
+ throw new IllegalArgumentException();
+ }
+
+ return roles;
+ }
+ }
+}
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * 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.core.identity.ui.common;
+
+import java.util.HashMap;
+
+import org.jboss.portal.core.identity.ui.UIAttribute;
+import org.jboss.portal.faces.el.PropertyValue;
+import org.jboss.portal.faces.el.dynamic.DynamicBean;
+import org.jboss.portal.identity.User;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class MetaDataServiceBean implements DynamicBean
+{
+ HashMap map = new HashMap();
+
+ public MetaDataServiceBean() {
+ UIAttribute uiAttribute = new UIAttribute();
+ uiAttribute.setIdentifier(User.INFO_USER_EMAIL_REAL);
+ uiAttribute.setName("email");
+ uiAttribute.setValidator("EmailValidator");
+ uiAttribute.setRequired(true);
+
+ map.put("email", uiAttribute);
+ }
+
+ public Class getType(Object propertyName) throws IllegalArgumentException
+ {
+ return UIAttribute.class;
+ }
+
+ public PropertyValue getValue(Object propertyName) throws IllegalArgumentException
+ {
+ UIAttribute uiAttribute = (UIAttribute) map.get((String) propertyName);
+ return uiAttribute != null ? new PropertyValue(uiAttribute) : null;
+ }
+
+ public boolean setValue(Object propertyName, Object value) throws IllegalArgumentException
+ {
+ return false;
+ }
+
+}
+
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/ProfileBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/ProfileBean.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/ProfileBean.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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.core.identity.ui.common;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.NoSuchUserException;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portlet.JBossRenderRequest;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ProfileBean
+{
+
+ private User user = null;
+ private UserModule userModule;
+
+ public ProfileBean()
+ {
+ JBossRenderRequest request = (JBossRenderRequest) FacesContext.getCurrentInstance().getExternalContext()
+ .getRequest();
+ this.user =request.getUser();
+ }
+
+
+ public User getUser()
+ {
+ return user;
+ }
+
+ public void setUser(User user)
+ {
+ this.user = user;
+ }
+
+ public UserModule getUserModule()
+ {
+ return userModule;
+ }
+
+ public void setUserModule(UserModule userModule)
+ {
+ this.userModule = userModule;
+ }
+
+}
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * 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.core.identity.ui.validators;
+
+import java.util.regex.Pattern;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class EmailValidator implements Validator
+{
+ private static final String EMAIL_VALIDATION = "^([a-zA-Z0-9]+(([\\.\\-\\_]?[a-zA-Z0-9]+)+)?)\\(a)(([a-zA-Z0-9]+[\\.\\-\\_])+[a-zA-Z]{2,4})$";
+
+ public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
+ {
+ if(value != null)
+ {
+ if (!(value instanceof String)) {
+ throw new IllegalArgumentException("The value must be a String");
+ }
+
+ if (! Pattern.matches(this.EMAIL_VALIDATION, (String) value))
+ {
+ throw new ValidatorException( new FacesMessage("Invalid EMail Address"));
+ }
+
+ }
+
+ }
+}
+
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/PasswordValidator.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.core.identity.ui.validators;
+
+import java.util.regex.Pattern;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.component.html.HtmlInputSecret;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PasswordValidator implements Validator
+{
+ public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
+ {
+ UIComponent passwordComponent = component.findComponent("password");
+ if (passwordComponent != null && passwordComponent instanceof HtmlInputSecret)
+ {
+ String password = (String) ((HtmlInputSecret) passwordComponent).getValue();
+
+ if (! password.equals((String) value))
+ {
+ throw new ValidatorException( new FacesMessage("The passwords don't match."));
+ }
+
+ } else {
+ throw new ValidatorException( new FacesMessage("Passwords cannot be checked."));
+ }
+ }
+}
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * 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.core.identity.ui.validators;
+
+import java.util.regex.Pattern;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import javax.portlet.PortletContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.ui.actions.UserRegisterBean;
+import org.jboss.portal.core.ui.portlet.user.UserPortletConstants;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.NoSuchUserException;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserModule;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+public class UsernameValidator implements Validator
+{
+ private static final String NICKNAME_VALIDATION = "^[a-zA-Z]([a-zA-Z0-9]+(([\\.\\-\\_]?[a-zA-Z0-9]+)+)?)";
+ private UserModule userModule;
+
+ private static final Logger log = Logger.getLogger(UserRegisterBean.class);
+
+ public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
+ {
+ User u = null;
+ String username = (String) value;
+ PortletContext portletContext = (PortletContext) context.getExternalContext().getContext();
+ userModule = (UserModule) portletContext.getAttribute("UserModule");
+
+ if (username.length() >= 5 && (Pattern.matches(NICKNAME_VALIDATION, username)))
+ {
+ try
+ {
+ u = userModule.findUserByUserName(username);
+ throw new ValidatorException(new FacesMessage("This username is already in use."));
+ }
+ catch (NoSuchUserException e)
+ {
+ // No user found - proceed
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ValidatorException(new FacesMessage("Error while checking username (IllegalArgumentException)."));
+ }
+ catch (IdentityException e)
+ {
+ throw new ValidatorException(new FacesMessage("Error while checking username (IdentityException)."));
+ }
+
+ } else {
+ throw new ValidatorException(new FacesMessage("Invalid Username."));
+ }
+ }
+}
Added: trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,26 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+
+</server>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,164 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+
+<faces-config>
+ <application>
+ <property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver>
+ <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
+ <locale-config>
+ <default-locale>en</default-locale>
+ <supported-locale>fr</supported-locale>
+ </locale-config>
+ <message-bundle>
+
+ </message-bundle>
+ </application>
+
+ <managed-bean>
+ <managed-bean-name>metadataservice</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.common.MetaDataServiceBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>identityusermgr</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.common.IdentityUserBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>defaultRole</property-name>
+ <value>User</value>
+ </managed-property>
+ <managed-property>
+ <property-name>userModule</property-name>
+ <value>#{applicationScope.UserModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>roleModule</property-name>
+ <value>#{applicationScope.RoleModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>membershipModule</property-name>
+ <value>#{applicationScope.MembershipModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>userProfileModule</property-name>
+ <value>#{applicationScope.UserProfileModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>metaDataService</property-name>
+ <value>#{metadataservice}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>userregistermgr</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.actions.UserRegisterBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>identityUserBean</property-name>
+ <value>#{identityusermgr}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>profilebean</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.common.ProfileBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>userModule</property-name>
+ <value>#{applicationScope.UserModule}</value>
+ </managed-property>
+ </managed-bean>
+
+ <validator>
+ <validator-id>EmailValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.EmailValidator</validator-class>
+ </validator>
+ <validator>
+ <validator-id>UsernameValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.UsernameValidator</validator-class>
+ </validator>
+ <validator>
+ <validator-id>PasswordValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.PasswordValidator</validator-class>
+ </validator>
+
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>start</from-outcome>
+ <to-view-id>/WEB-INF/jsf/index.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>lostPassword</from-outcome>
+ <to-view-id>/WEB-INF/jsf/lostPassword/lost.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/WEB-INF/jsf/register/register.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/register/register.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/WEB-INF/jsf/register/confirm.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/register/confirm.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>revise</from-outcome>
+ <to-view-id>/WEB-INF/jsf/register/register.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/WEB-INF/jsf/register/success.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>changePassword</from-outcome>
+ <to-view-id>/WEB-INF/jsf/profile/changePassword.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>changeEmail</from-outcome>
+ <to-view-id>/WEB-INF/jsf/profile/changeEmail.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>editProfile</from-outcome>
+ <to-view-id>/WEB-INF/jsf/profile/editProfile.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+
+</faces-config>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,68 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+
+<portlet-app>
+ <portlet>
+ <portlet-name>CoreIdentityUserPortlet</portlet-name>
+ <ajax>
+ <partial-refresh>false</partial-refresh>
+ </ajax>
+ <transaction>
+ <trans-attribute>Required</trans-attribute>
+ </transaction>
+ <header-content>
+ <link rel="stylesheet" type="text/css" href="/style.css" media="screen"/>
+ </header-content>
+ </portlet>
+
+ <!-- Injecting of required services into the portlet context. -->
+ <service>
+ <service-name>UserModule</service-name>
+ <service-class>org.jboss.portal.identity.UserModule</service-class>
+ <service-ref>:service=Module,type=User</service-ref>
+ </service>
+ <service>
+ <service-name>RoleModule</service-name>
+ <service-class>org.jboss.portal.identity.RoleModule</service-class>
+ <service-ref>:service=Module,type=Role</service-ref>
+ </service>
+ <service>
+ <service-name>UserProfileModule</service-name>
+ <service-class>org.jboss.portal.identity.UserProfileModule</service-class>
+ <service-ref>:service=Module,type=UserProfile</service-ref>
+ </service>
+ <service>
+ <service-name>MembershipModule</service-name>
+ <service-class>org.jboss.portal.identity.MembershipModule</service-class>
+ <service-ref>:service=Module,type=Membership</service-ref>
+ </service>
+ <service>
+ <service-name>MailModule</service-name>
+ <service-class>org.jboss.portal.core.modules.MailModule</service-class>
+ <service-ref>:service=Module,type=Mail</service-ref>
+ </service>
+</portlet-app>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/index.xhtml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,17 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core">
+
+ <c:choose>
+ <c:when test="#{facesContext.externalContext.remoteUser != null}">
+ <ui:include src="/WEB-INF/jsf/profile/viewProfile.xhtml"/>
+ </c:when>
+ <c:otherwise>
+ <ui:include src="/WEB-INF/jsf/register/overview.xhtml"/>
+ </c:otherwise>
+ </c:choose>
+ <h:messages />
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,30 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink value="Welcome" action="start"/>
+ </li>
+ <li>
+ <h:commandLink value="Register" action="register"/>
+ </li>
+ <li id="currentTab">Lost Password</li>
+ </ul>
+ </h:form>
+
+<h:form>
+<h4>Forgot your login data?</h4>
+<p>Please enter your username or the email address.</p>
+Username: <h:inputText />
+or E-Mail address: <h:inputText />
+<hr/>
+<h:commandButton value="Submit" styleClass="portlet-form-button"/>
+</h:form>
+
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,31 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink value="View profile" action="start"/>
+ </li>
+ <li>
+ <h:commandLink value="Edit profile" action="editProfile"/>
+ </li>
+ <li>
+ <h:commandLink value="Change password" action="changePassword"/>
+ </li>
+ <li id="currentTab">Change email</li>
+ </ul>
+ </h:form>
+
+ <h:form>
+ <h4>Change your email address</h4>
+ Current password: <h:inputSecret /><br/>
+ New email address: <h:inputText />
+ <hr/>
+ <h:commandButton value="Submit" styleClass="portlet-form-button"/>
+ </h:form>
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,33 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink value="View profile" action="start"/>
+ </li>
+ <li>
+ <h:commandLink value="Edit profile" action="editProfile"/>
+ </li>
+ <li id="currentTab">Change password</li>
+ <li>
+ <h:commandLink value="Change email" action="changeEmail"/>
+ </li>
+ </ul>
+ </h:form>
+
+ <h:form>
+ <h4>Change your password</h4>
+ Current password: <h:inputSecret /><br/>
+ New password: <h:inputText /><br/>
+ Retype password: <h:inputText />
+ <hr/>
+ <h:commandButton value="Submit" styleClass="portlet-form-button"/>
+ </h:form>
+
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,53 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink value="View profile" action="start"/>
+ </li>
+ <li id="currentTab">Edit profile</li>
+ <li>
+ <h:commandLink value="Change password" action="changePassword"/>
+ </li>
+ <li>
+ <h:commandLink value="Change email" action="changeEmail"/>
+ </li>
+ </ul>
+ </h:form>
+
+ <h:form>
+ <h4>Change your profile</h4>
+
+ <h:outputText for="username">Username</h:outputText>
+ <h:outputText value="#{profilebean.user.userName}"/>
+ <br/>
+
+ <ul class="topnav">
+ <li id="currentTab">Personal Information</li>
+ </ul>
+ <br/>
+
+ <h:outputText for="firstname">Firstname</h:outputText>
+ <h:inputText id="firstname" />
+ <h:message for="firstname"/>
+ <br/>
+ <h:outputText for="lastname">Lastname</h:outputText>
+ <h:inputText id="lastname" />
+ <h:message for="lastname"/>
+ <br/>
+ <ul class="topnav">
+ <li id="currentTab">Contact Information</li>
+ </ul>
+ <br/>
+ ....
+
+ <hr/>
+ <h:commandButton value="Submit" styleClass="portlet-form-button"/>
+ </h:form>
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,27 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <h:form>
+ <ul class="topnav">
+ <li id="currentTab">View profile</li>
+ <li>
+ <h:commandLink value="Edit profile" action="editProfile"/>
+ </li>
+ <li>
+ <h:commandLink value="Change password" action="changePassword"/>
+ </li>
+ <li>
+ <h:commandLink value="Change email" action="changeEmail"/>
+ </li>
+ </ul>
+ </h:form>
+
+ <h4>User profile</h4>
+ Username: #{profilebean.user.userName}
+
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/confirm.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/confirm.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/confirm.xhtml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,39 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink value="Welcome" action="start"/>
+ </li>
+ <li id="currentTab">Register</li>
+ <li>
+ <h:commandLink value="Lost Password" action="lostPassword"/>
+ </li>
+ </ul>
+ </h:form>
+
+<h:form>
+ <h4>Confirmation</h4>
+ <h:panelGrid columns="2">
+ <h:outputText for="username">Username</h:outputText>
+ <h:outputText id="username" value="#{userregistermgr.uiUser.username}"/>
+
+ <h:outputText for="email">EMail</h:outputText>
+ <h:outputText id="email" value="#{userregistermgr.uiUser.attribute.email}"/>
+
+ <h:outputText for="password">Password</h:outputText>
+ <h:outputText id="password">secret</h:outputText>
+ </h:panelGrid>
+
+ <h:messages />
+ <hr/>
+ <h:commandButton value="Edit" action="revise" styleClass="portlet-form-button"/>
+ <h:commandButton value="Confirm" action="#{userregistermgr.register}" styleClass="portlet-form-button"/>
+</h:form>
+
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,23 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <h:form>
+ <ul class="topnav">
+ <li id="currentTab">Welcome</li>
+ <li>
+ <h:commandLink value="Register" action="register"/>
+ </li>
+ <li>
+ <h:commandLink value="Lost Password" action="lostPassword"/>
+ </li>
+ </ul>
+ </h:form>
+
+ <h4>You are currently not logged in.</h4>
+ <h:commandLink action="register">You can create an account.</h:commandLink>
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,53 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink value="Welcome" action="start"/>
+ </li>
+ <li id="currentTab">Register</li>
+ <li>
+ <h:commandLink value="Lost Password" action="lostPassword"/>
+ </li>
+ </ul>
+ </h:form>
+
+ <h:form>
+ <h4>Basic user Information</h4>
+ <h:panelGrid columns="3">
+
+ <h:outputText for="username">Username</h:outputText>
+ <h:inputText id="username" value="#{userregistermgr.uiUser.username}" required="true">
+ <f:validator validatorId="UsernameValidator"/>
+ </h:inputText>
+ <h:message for="username"/>
+
+ <h:outputText for="#{metadataservice.email.name}">E-Mail</h:outputText>
+ <h:inputText id="#{metadataservice.email.name}" value="#{userregistermgr.uiUser.attribute.email}" required="#{metadataservice.email.required}">
+ <f:validator validatorId="#{metadataservice.email.validator}"/>
+ </h:inputText>
+ <h:message for="#{metadataservice.email.name}"/>
+
+ <h:outputText for="password">Password</h:outputText>
+ <h:inputSecret id="password" value="#{userregistermgr.uiUser.password}" required="true">
+ <f:validateLength minimum="6"/>
+ </h:inputSecret>
+ <h:message for="password"/>
+
+ <h:outputText for="passwordCheck">Confirm Password</h:outputText>
+ <h:inputSecret id="passwordCheck" required="true">
+ <f:validator validatorId="PasswordValidator"/>
+ </h:inputSecret>
+ <h:message for="passwordCheck"/>
+ </h:panelGrid>
+ <hr/>
+ <h:commandButton id="submit" action="register" value="Register" styleClass="portlet-form-button"/>
+ </h:form>
+
+</div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,11 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core">
+
+ <p>Thank you for registering!</p>
+ you may now proceed to the login...
+
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portal.taglib.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portal.taglib.xml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portal.taglib.xml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "facelet-taglib_1_0.dtd">
+<facelet-taglib>
+ <namespace>http://www.jboss.org/portal</namespace>
+ <tag>
+ <tag-name>scroller</tag-name>
+ <component>
+ <component-type>org.jboss.portal.Scroller</component-type>
+ <renderer-type>default</renderer-type>
+ </component>
+ </tag>
+ <tag>
+ <tag-name>portlet</tag-name>
+ <component>
+ <component-type>org.jboss.portal.Portlet</component-type>
+ <renderer-type>default</renderer-type>
+ <handler-class>org.jboss.portal.faces.component.portlet.PortletHandler</handler-class>
+ </component>
+ </tag>
+</facelet-taglib>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet-instances.xml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet-instances.xml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,36 @@
+<?xml version="1.0" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>CoreIdentityUserPortletInstance</instance-id>
+ <portlet-ref>CoreIdentityUserPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+
+ <portlet>
+ <description>Core Identity User Portlet</description>
+ <portlet-name>CoreIdentityUserPortlet</portlet-name>
+ <display-name>Core Identity User Portlet</display-name>
+ <portlet-class>org.jboss.portal.faces.loader.FacesPortlet</portlet-class>
+ <init-param>
+ <name>default-view</name>
+ <value>/WEB-INF/jsf/index.xhtml</value>
+ </init-param>
+<!-- defaultRole - specified in faces-config.xml -->
+<!-- <init-param>
+ <description>Default role of registered users</description>
+ <name>defaultRole</name>
+ <value>User</value>
+ </init-param>
+-->
+ <expiration-cache>-1</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Core Identity User Portlet</title>
+ <keywords>management,user</keywords>
+ </portlet-info>
+ </portlet>
+</portlet-app>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/web.xml 2007-08-08 16:09:16 UTC (rev 7875)
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app
+ 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"
+ version="2.4">
+
+ <!-- MyFaces specific configuration -->
+ <context-param>
+ <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- Facelet configuration -->
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.LIBRARIES</param-name>
+ <param-value>/WEB-INF/portal.taglib.xml</param-value>
+ </context-param>
+
+ <!-- JSF configuration -->
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <!-- The JSF servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>org.jboss.portal.faces.loader.FacesLoaderServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+</web-app>
16 years, 10 months
JBoss Portal SVN: r7874 - trunk.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-08-08 12:07:35 -0400 (Wed, 08 Aug 2007)
New Revision: 7874
Added:
trunk/core-identity/
Log:
Initial import.
16 years, 10 months
JBoss Portal SVN: r7873 - in docs/trunk/referenceGuide/en: images and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-07 16:06:17 -0400 (Tue, 07 Aug 2007)
New Revision: 7873
Added:
docs/trunk/referenceGuide/en/images/portletmodes/
docs/trunk/referenceGuide/en/images/portletmodes/editor.png
docs/trunk/referenceGuide/en/modules/portletmodes.xml
Removed:
docs/trunk/referenceGuide/en/images/portletmodes/editor.png
Modified:
docs/trunk/referenceGuide/en/master.xml
Log:
JBPORTAL-1622:Implement 'admin' portlet mode
Copied: docs/trunk/referenceGuide/en/images/portletmodes (from rev 7870, docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/portletmodes)
Deleted: docs/trunk/referenceGuide/en/images/portletmodes/editor.png
===================================================================
(Binary files differ)
Copied: docs/trunk/referenceGuide/en/images/portletmodes/editor.png (from rev 7870, docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/portletmodes/editor.png)
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/master.xml
===================================================================
--- docs/trunk/referenceGuide/en/master.xml 2007-08-07 20:04:32 UTC (rev 7872)
+++ docs/trunk/referenceGuide/en/master.xml 2007-08-07 20:06:17 UTC (rev 7873)
@@ -28,6 +28,7 @@
<!ENTITY contentintegration SYSTEM "modules/contentintegration.xml">
<!ENTITY portalapi SYSTEM "modules/portalapi.xml">
<!ENTITY errorhandling SYSTEM "modules/errorhandling.xml">
+ <!ENTITY portletmodes SYSTEM "modules/portletmodes.xml">
]>
<book lang="en">
<bookinfo>
@@ -75,6 +76,7 @@
<!-- Understanding urls --> &urls;
<!-- Error handling --> &errorhandling;
<!-- Content integration --> &contentintegration;
+ <!-- Portlet modes --> &portletmodes;
<!-- Portal API --> &portalapi;
<!-- Clustering configuration --> &clustering;
<!-- WSRP --> &wsrp;
Copied: docs/trunk/referenceGuide/en/modules/portletmodes.xml (from rev 7870, docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/portletmodes.xml)
===================================================================
--- docs/trunk/referenceGuide/en/modules/portletmodes.xml (rev 0)
+++ docs/trunk/referenceGuide/en/modules/portletmodes.xml 2007-08-07 20:06:17 UTC (rev 7873)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="portletmodes">
+ <chapterinfo>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ <email>julien.viet(a)jboss.com</email>
+ </author>
+ </chapterinfo>
+ <title>Portlet Modes</title>
+ <para>JBoss Portal suppors the standard portlets modes mandated by the JSR-168 specification which are <emphasis>view</emphasis>,
+ <emphasis>edit</emphasis> and <emphasis>help</emphasis>. In addition of that it also supports the <emphasis>admin</emphasis>
+ portlet mode.
+ </para>
+ <sect1>
+ <title>Admin Portlet Mode</title>
+ <para>The admin mode defines a mode for the portlet which allow administration of the portlet. Its access
+ is only granted to users having an appropriate role. In order to grant admin access to a portlet, the user must have a role which
+ grants him the <emphasis>admin</emphasis> action permission on the portlet instance. This can be done in the
+ instance deployment descriptor or using the administation portlet of the portal. </para>
+ <sect2>
+ <title>Portlet configuration</title>
+ <para>In order to be able to use the admin mode, the portlet must declares it in the portlet deployment descriptor.</para>
+ <programlisting><![CDATA[
+<portlet-app>
+ ...
+ <portlet>
+ ...
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>admin</portlet-mode>
+ </supports>
+ ...
+ </portlet>
+ ...
+ <custom-portlet-mode>
+ <name>admin</name>
+ </custom-portlet-mode>
+ ...
+</portlet-app>
+]]></programlisting>
+ </sect2>
+ <sect2>
+ <title>Declarative instance security configuration</title>
+ <para>The following example shows the configuration of a portlet instance that grants the admin action permission
+ to the <emphasis>Admin</emphasis> security role. It also grant the view action permission to all users.
+ </para>
+<programlisting><![CDATA[
+...
+<instance>
+ <instance-id>ModePortletInstance</instance-id>
+ <portlet-ref>ModePortlet</portlet-ref>
+ <security-constraint>
+ <policy-permission>
+ <action-name>admin</action-name>
+ <role-name>Admin</role-name>
+ </policy-permission>
+ <policy-permission>
+ <action-name>view</action-name>
+ <unchecked/>
+ </policy-permission>
+ </security-constraint>
+</instance>
+...
+]]></programlisting>
+ </sect2>
+ <sect2>
+ <title>Instance security configuration with the administration portlet</title>
+ <para>At runtime the security configuration section of the administration portlet can be used to grant or revoke
+ the admin access. It can be done by clicking the security action of the portlet instance and then use the
+ security editor.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portletmodes/editor.png" format="png"/>
+ </imageobject>
+ <caption>
+ <para>Edit the security instance configuration</para>
+ </caption>
+ </mediaobject>
+ </sect2>
+ </sect1>
+</chapter>
\ No newline at end of file
16 years, 10 months
JBoss Portal SVN: r7872 - in trunk: core/src/bin/portal-core-war/themes/renaissance and 14 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-07 16:04:32 -0400 (Tue, 07 Aug 2007)
New Revision: 7872
Added:
trunk/core-samples/src/main/org/jboss/portal/core/samples/basic/ModePortlet.java
Modified:
trunk/api/src/main/org/jboss/portal/Mode.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/AbstractInstance.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/AbstractInstanceDefinition.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerContext.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContextImpl.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceContainerContext.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceCustomization.java
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalMetaData.java
trunk/core/src/main/org/jboss/portal/core/theme/WindowContextFactory.java
trunk/core/src/main/org/jboss/portlet/JBossPortlet.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/page/WindowResult.java
Log:
JBPORTAL-1622:Implement 'admin' portlet mode
Modified: trunk/api/src/main/org/jboss/portal/Mode.java
===================================================================
--- trunk/api/src/main/org/jboss/portal/Mode.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/api/src/main/org/jboss/portal/Mode.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -48,6 +48,9 @@
public static final Mode EDIT_DEFAULTS = new Mode("edit_defaults");
/** . */
+ public static final Mode ADMIN = new Mode("admin");
+
+ /** . */
private String name;
public Mode(String name)
@@ -143,9 +146,13 @@
{
return Mode.HELP;
}
+ else if (Mode.ADMIN.name.equals(name))
+ {
+ return Mode.ADMIN;
+ }
else if (Mode.EDIT_DEFAULTS.name.equals(name))
{
- return Mode.VIEW;
+ return Mode.EDIT_DEFAULTS;
}
else
{
Modified: trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css
===================================================================
--- trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css 2007-08-07 20:04:32 UTC (rev 7872)
@@ -672,6 +672,21 @@
text-decoration: none;
}
+.portlet-mode-admin {
+ background-image: url( images/ico_edit.gif );
+ background-repeat: no-repeat;
+ width: 28px;
+ height: 16px;
+ float: left;
+ display: inline;
+ cursor: pointer;
+ padding-left: 3px;
+}
+
+.portlet-mode-admin:hover {
+ text-decoration: none;
+}
+
.portlet-mode-remove {
background-image: url( images/ico_16_remove.gif );
background-repeat: no-repeat;
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -25,6 +25,8 @@
import org.jboss.logging.Logger;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
import org.jboss.portal.core.aspects.portlet.AjaxInterceptor;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.ControllerResponse;
@@ -35,6 +37,8 @@
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.content.spi.ContentProvider;
import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.instance.InstanceCustomization;
+import org.jboss.portal.core.model.instance.InstancePermission;
import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.Window;
@@ -84,11 +88,24 @@
private String contentType;
/** . */
+ private PortalAuthorizationManagerFactory pamf;
+
+ /** . */
ContentType registeredContentType;
/** . */
ContentProvider contentProvider;
+ public PortalAuthorizationManagerFactory getPortalAuthorizationManagerFactory()
+ {
+ return pamf;
+ }
+
+ public void setPortalAuthorizationManagerFactory(PortalAuthorizationManagerFactory portalAuthorizationManagerFactory)
+ {
+ this.pamf = portalAuthorizationManagerFactory;
+ }
+
public String getContentType()
{
return contentType;
@@ -237,6 +254,16 @@
}
//
+ InstancePermission perm = new InstancePermission(instance.getId(), InstancePermission.ADMIN_ACTION);
+ PortalAuthorizationManager pam = pamf.getManager();
+ boolean authorized = pam.checkPermission(perm);
+ if (!authorized)
+ {
+ // Remove the modes that we know only admin are authorized to use
+ supportedModes.remove(Mode.ADMIN);
+ }
+
+ //
response = instance.invoke(invocation);
}
catch (PortletInvokerException e)
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/instance/AbstractInstance.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/instance/AbstractInstance.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/AbstractInstance.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -27,6 +27,7 @@
import org.jboss.portal.core.model.instance.InstanceCustomization;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.core.model.instance.InstanceDefinition;
+import org.jboss.portal.core.model.instance.InstancePermission;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
@@ -37,6 +38,8 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.DestroyCloneFailure;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+import org.jboss.portal.Mode;
import java.util.Arrays;
import java.util.Set;
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/instance/AbstractInstanceDefinition.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/instance/AbstractInstanceDefinition.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/AbstractInstanceDefinition.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -48,15 +48,6 @@
protected final AccessMode getAccessMode()
{
-/*
- if (Mode.EDIT_DEFAULTS.equals(ctxabc.getMode()))
- {
- // Implement it by using the shared portlet id, but a security check should be made on using this
- // mode first
- // Another idea is to shove that in the security interceptor
- throw new UnsupportedOperationException("Implement me");
- }
-*/
return AccessMode.READ_ONLY;
}
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerContext.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerContext.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContainerContext.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -23,6 +23,7 @@
package org.jboss.portal.core.impl.model.instance;
import org.jboss.portal.core.model.instance.DuplicateInstanceException;
+import org.jboss.portal.core.model.instance.InstancePermission;
import org.jboss.portal.portlet.PortletContext;
import java.util.Collection;
@@ -57,4 +58,6 @@
void updateInstanceDefinition(AbstractInstanceDefinition def, Set securityBindings);
+ boolean checkPermission(InstancePermission perm);
+
}
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContextImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContextImpl.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceContextImpl.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -41,7 +41,7 @@
protected final Instance instance;
/** . */
- protected final AccessMode accessMode;
+ protected AccessMode accessMode;
/** . */
protected PortletContext clonedContext;
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceContainerContext.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceContainerContext.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceContainerContext.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -28,6 +28,7 @@
import org.hibernate.exception.ConstraintViolationException;
import org.jboss.portal.jems.hibernate.ObjectContextualizer;
import org.jboss.portal.core.model.instance.DuplicateInstanceException;
+import org.jboss.portal.core.model.instance.InstancePermission;
import org.jboss.portal.core.impl.model.instance.AbstractInstance;
import org.jboss.portal.core.impl.model.instance.AbstractInstanceDefinition;
import org.jboss.portal.core.impl.model.instance.AbstractInstanceCustomization;
@@ -36,6 +37,10 @@
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.security.RoleSecurityBinding;
+import org.jboss.portal.security.PortalSecurityException;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+import org.apache.log4j.Logger;
import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
import javax.naming.InitialContext;
@@ -51,6 +56,9 @@
{
/** . */
+ private static final Logger log = Logger.getLogger(PersistentInstanceContainerContext.class);
+
+ /** . */
private static final String BY_INSTANCE_ID_QUERY = "from " + Tools.getShortNameOf(PersistentInstanceDefinition.class) + " where instanceId=:instanceId";
/** . */
@@ -343,4 +351,27 @@
//
session.flush();
}
+
+ public boolean checkPermission(InstancePermission perm)
+ {
+ if (container.getPerformSecurityChecks())
+ {
+ boolean result = false;
+ try
+ {
+ PortalAuthorizationManagerFactory pamf = container.getPortalAuthorizationManagerFactory();
+ PortalAuthorizationManager manager = pamf.getManager();
+ result = manager.checkPermission(perm);
+ }
+ catch (PortalSecurityException e)
+ {
+ log.error("Cannot check instance permission", e);
+ }
+ return result;
+ }
+ else
+ {
+ return true;
+ }
+ }
}
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceCustomization.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceCustomization.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/persistent/PersistentInstanceCustomization.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -90,7 +90,7 @@
public String getId()
{
- return customizationId;
+ return owner.getInstanceId();
}
public String getCustomizationId()
Modified: trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -30,6 +30,7 @@
import org.jboss.portal.security.PortalSecurityException;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
+import org.jboss.portal.Mode;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -61,10 +62,22 @@
{
try
{
+ // Compute the security mask
+ int mask = InstancePermission.VIEW_MASK;
+ Mode mode = invocation.getPortletContext().getMode();
+ if (Mode.ADMIN.equals(mode))
+ {
+ mask |= InstancePermission.ADMIN_MASK;
+ }
+
+ //
String instanceid = (String)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, Instance.INSTANCE_ID_ATTRIBUTE);
PortalAuthorizationManager pam = pamf.getManager();
- InstancePermission perm = new InstancePermission(instanceid, InstancePermission.VIEW_MASK);
+ InstancePermission perm = new InstancePermission(instanceid, mask);
boolean authorized = pam.checkPermission(perm);
+
+ //
+ //
if (trace)
{
log.trace("Access granted=" + authorized + " for instance " + instanceid);
@@ -83,5 +96,4 @@
throw new InvocationException(e);
}
}
-
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalMetaData.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalMetaData.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalMetaData.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -52,6 +52,7 @@
modes.add("edit");
modes.add("view");
modes.add("help");
+ modes.add("admin");
windowStates = new WindowStatesMetaData();
windowStates.add("maximized");
windowStates.add("minimized");
Modified: trunk/core/src/main/org/jboss/portal/core/theme/WindowContextFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/theme/WindowContextFactory.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portal/core/theme/WindowContextFactory.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -102,7 +102,7 @@
WindowState windowState = (WindowState)j.next();
String url = createUpdateNavigationalStateURL(window, null, windowState);
boolean disabled = windowState.equals(currentWindowState);
- WindowResult.Action action = new WindowResult.Action(windowState.toString(), url, !disabled);
+ WindowResult.Action action = new WindowResult.Action(windowState.toString(), "window_state", url, !disabled);
windowStates.add(action);
}
actionMap.put(ActionRendererContext.WINDOWSTATES_KEY, windowStates);
@@ -120,7 +120,7 @@
Mode mode = (Mode)j.next();
String url = createUpdateNavigationalStateURL(window, mode, null);
boolean disabled = mode.equals(currentMode);
- WindowResult.Action action = new WindowResult.Action(mode.toString(), url, !disabled);
+ WindowResult.Action action = new WindowResult.Action(mode.toString(), "mode", url, !disabled);
modes.add(action);
}
actionMap.put(ActionRendererContext.MODES_KEY, modes);
Modified: trunk/core/src/main/org/jboss/portlet/JBossPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portlet/JBossPortlet.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/main/org/jboss/portlet/JBossPortlet.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -57,9 +57,13 @@
public class JBossPortlet implements Portlet
{
+ /** . */
private static final Class[] ACTION_LOOKUP = new Class[]{JBossActionRequest.class, JBossActionResponse.class};
/** . */
+ private static final PortletMode ADMIN = new PortletMode("admin");
+
+ /** . */
private PortletConfig config;
public JBossPortlet()
@@ -133,6 +137,10 @@
{
processEdit(req, resp);
}
+ else if (ADMIN.equals(portletMode))
+ {
+ processAdmin(req, resp);
+ }
}
/** Default doEdit method that works in coordination with doEdit(JBossRenderRequest,JBossRenderResponse). */
@@ -164,6 +172,14 @@
/**
*
*/
+ public void processAdmin(JBossActionRequest req, JBossActionResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ throw new PortletException();
+ }
+
+ /**
+ *
+ */
public void processView(JBossActionRequest req, JBossActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
// Try to locate specific operation
@@ -249,6 +265,10 @@
{
doEdit(request, response);
}
+ else if (ADMIN.equals(portletMode))
+ {
+ doAdmin(request, response);
+ }
}
}
@@ -272,7 +292,6 @@
//
PortletURL url = response.createActionURL();
- url.setPortletMode(PortletMode.EDIT);
//
writer.print("<table> " +
@@ -327,6 +346,12 @@
"</form></table>");
}
+ /** Throw a <code>PortletException</code>. */
+ protected void doAdmin(JBossRenderRequest request, JBossRenderResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ throw new PortletException();
+ }
+
public ResourceBundle getResourceBundle(Locale locale)
{
return getPortletConfig().getResourceBundle(locale);
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-08-07 20:04:32 UTC (rev 7872)
@@ -683,6 +683,9 @@
<depends
optional-attribute-name="InstanceContainer"
proxy-type="attribute">portal:container=Instance</depends>
+ <depends
+ optional-attribute-name="PortalAuthorizationManagerFactory"
+ proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
</mbean>
<!-- Integrate identity -->
Modified: trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-08-07 20:04:32 UTC (rev 7872)
@@ -320,6 +320,7 @@
<mode>view</mode>
<mode>edit</mode>
<mode>help</mode>
+ <mode>admin</mode>
</supported-modes>
<supported-window-states>
<window-state>normal</window-state>
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -478,7 +478,7 @@
public SelectItem[] getAvailableActions()
{
- return new SelectItem[]{ new SelectItem("view", "View") };
+ return new SelectItem[]{ new SelectItem("view", "View"), new SelectItem("admin", "Admin")};
}
}
}
Copied: trunk/core-samples/src/main/org/jboss/portal/core/samples/basic/ModePortlet.java (from rev 7871, branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/basic/ModePortlet.java)
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/samples/basic/ModePortlet.java (rev 0)
+++ trunk/core-samples/src/main/org/jboss/portal/core/samples/basic/ModePortlet.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.core.samples.basic;
+
+import org.jboss.portlet.JBossPortlet;
+import org.jboss.portlet.JBossRenderRequest;
+import org.jboss.portlet.JBossRenderResponse;
+
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ModePortlet extends JBossPortlet
+{
+
+ protected void doView(JBossRenderRequest request, JBossRenderResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.print("View");
+ writer.close();
+ }
+
+ protected void doAdmin(JBossRenderRequest request, JBossRenderResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.print("Admin");
+ writer.close();
+ }
+}
Modified: trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml
===================================================================
--- trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml 2007-08-07 20:04:32 UTC (rev 7872)
@@ -289,6 +289,21 @@
<height>0</height>
</window>
</page>
+ <page>
+ <page-name>mode test</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>ModePortletWindow</window-name>
+ <instance-ref>ModePortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
</page>
</deployment>
<deployment>
@@ -557,6 +572,21 @@
<height>0</height>
</window>
</page>
+ <page>
+ <page-name>mode test</page-name>
+ <window>
+ <window-name>CatalogPortletWindow</window-name>
+ <instance-ref>CatalogPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>ModePortletWindow</window-name>
+ <instance-ref>ModePortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
</page>
</deployment>
</deployments>
Modified: trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml 2007-08-07 20:04:32 UTC (rev 7872)
@@ -29,6 +29,22 @@
<deployments>
<deployment>
<instance>
+ <instance-id>ModePortletInstance</instance-id>
+ <portlet-ref>ModePortlet</portlet-ref>
+ <security-constraint>
+ <policy-permission>
+ <action-name>admin</action-name>
+ <role-name>Admin</role-name>
+ </policy-permission>
+ <policy-permission>
+ <action-name>view</action-name>
+ <unchecked/>
+ </policy-permission>
+ </security-constraint>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
<instance-id>EventPortletInstance</instance-id>
<portlet-ref>EventPortlet</portlet-ref>
</instance>
Modified: trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2007-08-07 20:04:32 UTC (rev 7872)
@@ -28,6 +28,36 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0">
<portlet>
+ <description>Mode Portlet</description>
+ <portlet-name>ModePortlet</portlet-name>
+ <display-name>Mode Portlet</display-name>
+ <portlet-class>org.jboss.portal.core.samples.basic.ModePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>ADMIN</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Mode Portlet</title>
+ <keywords>sample,test</keywords>
+ </portlet-info>
+ </portlet>
+ <portlet>
+ <description>Portlet to test modification of head content</description>
+ <portlet-name>HeaderContentPortlet</portlet-name>
+ <display-name>Header Content Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.core.samples.basic.HeaderContentPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Header Content portlet</title>
+ <keywords>sample,test</keywords>
+ </portlet-info>
+ </portlet>
+ <portlet>
<description>Event Portlet</description>
<portlet-name>EventPortlet</portlet-name>
<display-name>Event Portlet</display-name>
@@ -38,7 +68,7 @@
</supports>
<portlet-info>
<title>Portal Node Event Listener</title>
- <keywords>event, sample,test</keywords>
+ <keywords>sample,test</keywords>
</portlet-info>
</portlet>
<portlet>
@@ -309,6 +339,9 @@
<keywords>sample,test</keywords>
</portlet-info>
</portlet>
+ <custom-portlet-mode>
+ <name>ADMIN</name>
+ </custom-portlet-mode>
<user-attribute>
<name>user.name.nickName</name>
</user-attribute>
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -117,6 +117,7 @@
modeOrState2Index.put(Mode.EDIT, new Integer(98));
modeOrState2Index.put(Mode.HELP, new Integer(99));
modeOrState2Index.put(Mode.VIEW, new Integer(100));
+ modeOrState2Index.put(Mode.ADMIN, new Integer(101));
modeOrState2Index.put(WindowState.MINIMIZED, new Integer(198));
modeOrState2Index.put(WindowState.NORMAL, new Integer(199));
modeOrState2Index.put(WindowState.MAXIMIZED, new Integer(200));
Modified: trunk/theme/src/main/org/jboss/portal/theme/page/WindowResult.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/WindowResult.java 2007-08-07 19:55:22 UTC (rev 7871)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/WindowResult.java 2007-08-07 20:04:32 UTC (rev 7872)
@@ -136,6 +136,9 @@
public static class Action implements ActionRendererContext
{
/** The origin of the action. */
+ private final String name;
+
+ /** The origin of the action. */
private final String family;
/** The action url. */
@@ -144,8 +147,9 @@
/** Enabled or not. */
private final boolean enabled;
- public Action(String family, String url, boolean enabled)
+ public Action(String name, String family, String url, boolean enabled)
{
+ this.name = name;
this.family = family;
this.url = url;
this.enabled = enabled;
@@ -153,7 +157,7 @@
public String getName()
{
- return family;
+ return name;
}
public String getFamily()
16 years, 10 months
JBoss Portal SVN: r7871 - branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/basic.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-07 15:55:22 -0400 (Tue, 07 Aug 2007)
New Revision: 7871
Added:
branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/basic/ModePortlet.java
Log:
forgot to add the ModePortlet :-)
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/basic/ModePortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/basic/ModePortlet.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/basic/ModePortlet.java 2007-08-07 19:55:22 UTC (rev 7871)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.core.samples.basic;
+
+import org.jboss.portlet.JBossPortlet;
+import org.jboss.portlet.JBossRenderRequest;
+import org.jboss.portlet.JBossRenderResponse;
+
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ModePortlet extends JBossPortlet
+{
+
+ protected void doView(JBossRenderRequest request, JBossRenderResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.print("View");
+ writer.close();
+ }
+
+ protected void doAdmin(JBossRenderRequest request, JBossRenderResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.print("Admin");
+ writer.close();
+ }
+}
16 years, 10 months
JBoss Portal SVN: r7870 - in docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-07 14:18:10 -0400 (Tue, 07 Aug 2007)
New Revision: 7870
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/portletmodes/editor.png
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/portletmodes.xml
Log:
update the documentation for portlet admin mode
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/images/portletmodes/editor.png
===================================================================
(Binary files differ)
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/portletmodes.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/portletmodes.xml 2007-08-07 18:17:19 UTC (rev 7869)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/portletmodes.xml 2007-08-07 18:18:10 UTC (rev 7870)
@@ -43,7 +43,7 @@
<sect2>
<title>Declarative instance security configuration</title>
<para>The following example shows the configuration of a portlet instance that grants the admin action permission
- to the <emphasis>Admin</emphasis> security role.
+ to the <emphasis>Admin</emphasis> security role. It also grant the view action permission to all users.
</para>
<programlisting><![CDATA[
...
@@ -52,9 +52,13 @@
<portlet-ref>ModePortlet</portlet-ref>
<security-constraint>
<policy-permission>
+ <action-name>admin</action-name>
<role-name>Admin</role-name>
- <action-name>admin</action-name>
</policy-permission>
+ <policy-permission>
+ <action-name>view</action-name>
+ <unchecked/>
+ </policy-permission>
</security-constraint>
</instance>
...
16 years, 10 months
JBoss Portal SVN: r7869 - in branches/JBoss_Portal_Branch_2_6: core-samples/src/resources/portal-basic-samples-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-07 14:17:19 -0400 (Tue, 07 Aug 2007)
New Revision: 7869
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
Log:
minor updates to the new admin portlet mode
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-08-07 16:49:21 UTC (rev 7868)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-08-07 18:17:19 UTC (rev 7869)
@@ -478,7 +478,7 @@
public SelectItem[] getAvailableActions()
{
- return new SelectItem[]{ new SelectItem("view", "View") };
+ return new SelectItem[]{ new SelectItem("view", "View"), new SelectItem("admin", "Admin")};
}
}
}
Modified: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml 2007-08-07 16:49:21 UTC (rev 7868)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml 2007-08-07 18:17:19 UTC (rev 7869)
@@ -33,9 +33,13 @@
<portlet-ref>ModePortlet</portlet-ref>
<security-constraint>
<policy-permission>
+ <action-name>admin</action-name>
<role-name>Admin</role-name>
- <action-name>admin</action-name>
</policy-permission>
+ <policy-permission>
+ <action-name>view</action-name>
+ <unchecked/>
+ </policy-permission>
</security-constraint>
</instance>
</deployment>
Modified: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2007-08-07 16:49:21 UTC (rev 7868)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2007-08-07 18:17:19 UTC (rev 7869)
@@ -42,12 +42,6 @@
<title>Mode Portlet</title>
<keywords>sample,test</keywords>
</portlet-info>
- <portlet-preferences>
- <preference>
- <name>foo</name>
- <value>bar</value>
- </preference>
- </portlet-preferences>
</portlet>
<portlet>
<description>Portlet to test modification of head content</description>
@@ -346,7 +340,7 @@
</portlet-info>
</portlet>
<custom-portlet-mode>
- <name>admin</name>
+ <name>ADMIN</name>
</custom-portlet-mode>
<user-attribute>
<name>user.name.nickName</name>
16 years, 10 months