From portal-commits at lists.jboss.org Wed Aug 29 06:18:40 2007 Content-Type: multipart/mixed; boundary="===============5361686419463904488==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r8092 - in docs/trunk/referenceGuide/en: modules and 1 other directory. Date: Wed, 29 Aug 2007 06:18:40 -0400 Message-ID: --===============5361686419463904488== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: thomas.heute(a)jboss.com Date: 2007-08-29 06:18:40 -0400 (Wed, 29 Aug 2007) New Revision: 8092 Removed: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package.gif Modified: docs/trunk/referenceGuide/en/modules/tutorials.xml Log: Updated reference documentation about JSF tutorials Deleted: docs/trunk/referenceGuide/en/images/tutorials/jsf_portlet/package.= gif =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (Binary files differ) Modified: docs/trunk/referenceGuide/en/modules/tutorials.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- docs/trunk/referenceGuide/en/modules/tutorials.xml 2007-08-29 08:41:42 = UTC (rev 8091) +++ docs/trunk/referenceGuide/en/modules/tutorials.xml 2007-08-29 10:18:40 = UTC (rev 8092) @@ -10,6 +10,11 @@ Laprun chris.laprun(a)jboss.com + + Thomas + Heute + thomas.heute(a)jboss.com + Portlet Primer @@ -706,14 +711,193 @@ = + + A simple Sun's JSF Reference Implementation (RI) portlet o= n JBoss AS 4.2.x + + Introduction + This section will introduce the reader to deploying a si= mple JSF portlet in JBoss Portal, using + Apache's MyFaces JSF implementation on JBoss AS 4.2.x. It r= equires you download the HelloWorldJSFSunRIPortlet + from PortletSwap.com, using this link: + http://anonsvn.jboss.org/= repos/portletswap/portlets/2_6/bundles/HelloWorldJSFSunRIPortlet.zip. + + = + + Package Content + + + + + + + Like a typical JSF application, we also package our faces-c= onfig.xml that defines our + managed-beans, converters, validators, navigation rules, et= c... + JBoss Application Server version 4.2.x bundles Sun's = JSF Reference Implementation (RI) in + JBOSS_HOME/server/default/deploy/jboss-web.depl= oyer/jsf-libs/. As a result, + you do not need to package Sun RI's libraries with your = portlet application. + + + For the sake of brevity, we only discuss the po= rtlet.xml and + faces-config.xml descriptors here. For d= iscussion on the other descriptors, please + view or the c= hapter on descriptors: + . + + + + + + + + portlet.xml + + + + HelloWorldJSFPortlet + com.sun.faces.portlet.FacesPortlet + + com.sun.faces.portlet.INIT_VIEW + /WEB-INF/jsp/index.jsp + + + text/html + VIEW + + + HelloWorld JSF Portlet + + +]]> + This file must adhere to its definition in the Por= tlet Specification. You may define more than + one portlet application in this file. Now let's lo= ok at the portions that deal with our use of + JSF: + + + + c= om.sun.faces.portlet.FacesPortlet]]> + Here we specify that com.sun.faces.portle= t.FacesPortlet will handle all requests/responses from our + users. This class is part of jsf-portlet.= jar as explained later. + + + + + We need to initialize the portlet with a = default view page for it to render, much like + a welcome page: + + com.sun.faces.portlet.INIT_VIEW + /WEB-INF/jsp/index.jsp +]]> + + + + + + + faces-config.xml + + + + + Basic UserBean + user + org.jboss.portlet.hello.bean.User + session + + + + done + /WEB-INF/jsp/result.jsp + + +]]> + There is nothing special about the faces-= config.xml file included here. This + application would work just as well outside of a p= ortlet as it would inside a portlet container. + In the above lines, we define a basic Use= r Bean and a navigation rule to + handle the submittal of the original form on index.jsp. + + + + web.xml + + + + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + + + + Faces Servlet + *.jsf + + +]]> + For the Sun RI, this definition is mandatory to as= sociate jsf extension with the faces servlet. + + + + jsf-portlet.jar This library= that can be downloaded here: https://jsfportletbridge.dev.java.net/= servlets/ProjectDocumentList = + contains the classes for the JSF-Portlet bridge. Sinc= e they are not included with the JSF + implementation (unlike myfaces) neither in JBoss AS, = it is required to have this library available + in the package. + + + + + + + Building and deploying your portlet + If you have downloaded the sample, you can execute the b= uild.xml with ant or inside your IDE. + Executing ant will compile all source fi= les and produce a + helloworldjspportlet.war file in a way s= imilar to what we saw in + . + + + + Deploying the portlet is as easy as copying/moving the helloworldjspportlet.war file + to the server deploy directory. We can t= hen see our portlet on the Portal default + page (http://l= ocalhost:8080/portal/): + + + + + + + = + - A Simple MyFaces JSF Portlet on JBoss AS 4.0.x + A simple MyFaces JSF Portlet on JBoss AS 4.0.5+ Introduction This section will introduce the reader to deploying a si= mple JSF portlet in JBoss Portal, using - Apache's MyFaces JSF implementation on JBoss AS 4.0.x. It r= equires you download the HelloWorldJSFPortlet - from PortletSwap.com, using this - link. + Apache's MyFaces JSF implementation on JBoss AS 4.0.5+. It = requires you download the HelloWorldJSFMyFacesPortlet + from PortletSwap.com, using this link: + http://anonsvn.jboss.or= g/repos/portletswap/portlets/2_6/bundles/HelloWorldJSFMyFacesPortlet.zip. = @@ -721,7 +905,7 @@ - + Like a typical JSF application, we also package our faces-c= onfig.xml that defines our @@ -737,7 +921,7 @@ . - + @@ -821,17 +1005,20 @@ + Building and deploying your portlet If you have downloaded the sample, you can execute the b= uild.xml with ant or inside your IDE. - Executing the deploy target will compile= all source files and produce a - helloworldjspportlet.war file in a way s= imilar to what we saw in + Executing ant will compile all source fi= les and produce a + helloworldjsfportlet.war file in a way s= imilar to what we saw in . + Deploying the portlet is as easy as copying/moving the helloworldjspportlet.war file to the server deploy directory. We can t= hen see our portlet on the Portal default @@ -883,9 +1071,5 @@ - - JSF Portlet using Sun's JSF Reference Implementation (RI)<= /title> - <para>TODO</para> - </sect2> </sect1> </chapter> \ No newline at end of file --===============5361686419463904488==--