From portal-commits at lists.jboss.org Fri Feb 8 01:09:28 2008 Content-Type: multipart/mixed; boundary="===============5306256485523365341==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9862 - docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules. Date: Fri, 08 Feb 2008 01:09:20 -0500 Message-ID: --===============5306256485523365341== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mmcallis Date: 2008-02-08 01:09:19 -0500 (Fri, 08 Feb 2008) New Revision: 9862 Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorial= s.xml Log: revising 5.2.1.4. Application Descriptors changing itemizedlists to variablelists Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/t= utorials.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/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-08 05:23:36 UTC (rev 9861) +++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutoria= ls.xml 2008-02-08 06:09:19 UTC (rev 9862) @@ -148,8 +148,7 @@ Package Structure - Like other Java EE applications, portlets are packaged in W= AR files. A typical portlet WAR file can also - include servlets, resource bundles, images, HTML, JSPs, and= other static or dynamic files. The following is an example of the director= y structure of the HelloWorldPortlet portlet: + Like other Java EE applications, portlets are packaged in W= AR files. A typical portlet WAR file can include servlets, resource bundles= , images, HTML, JSPs, and other static or dynamic files. The following is a= n example of the directory structure of the HelloWorldPortlet portlet: @@ -160,7 +159,7 @@ - Portlet Class + Portlet Classes The following is the HelloWorldPortlet/src/main/org/jboss/= portlet/hello/HelloWorldPortlet.java java source file, which com= es bundled with the HelloWorldPortlet: @@ -254,18 +253,22 @@ Application Descriptors - JBoss Portal requires certain descriptors be included in yo= ur portlet WAR, for different reasons. Some of - these descriptors are defined by the Portlet Specification,= some are specific to JBoss Portal. + JBoss Portal requires certain descriptors to be included in= a portlet WAR file. Some of + these descriptors are defined by the JSR-168 Portlet Specification= , and others are specific to JBoss Portal. The following is an example of t= he directory structure of the HelloWorldPortlet portlet: + + - Now let's explain what each of these does: - - - portlet.xml - + + + The following is an example of the HelloWorldPortlet/WEB-IN= F/portlet.xml file. Note: in order to create the WEB-I= NF and META-INF directories, extract the helloworldportlet.war file: + + + HelloWorld Portlet -]]> - This file must adhere to its definition in the Por= tlet Specification. You may define more than - one portlet application in this file. - - - - He= lloWorldPortlet]]> - Define your portlet name. It does not hav= e to be the Class name. - - - - - o= rg.jboss.portlet.hello.HelloWorldPortlet]]> - The Fully Qualified Name (FQN) of your po= rtlet class must be declared here. - - - - - - text/html - VIEW -]]> - The supports element a= llows you to declare all the markup types your - portlet supports in the render method. This is accomplish via the - mime-type element, whi= ch is required for every - portlet. Of course, the declared MIME typ= es must match the capability of the portlet. - - It also allows you to pair - which modes and window states are support= ed for each markup type. In out case, as all - portlets must support the VIEW portlet mo= de, we didn't have to declare it. We did need - to declare that our portlet supports the = text/html markup type. - Hence, we are letting the portal know tha= t it will be outputting text/html and - only support a VIEW mode. - - - - - - HelloWorld Portlet - -]]> - The portlet's title will be displayed as = the header in the portlet window, when - rendered, unless it is overridden program= matically. - - - - - - - portlet-instances.xml - +]]> + + + + This file must adhere to its definition in the JSR-168 Portlet Specifica= tion. You may define more than one portlet application in this file. + + + + HelloWorldPortlet]]> + + + Define the portlet name. It does not have to be the Class name. + + + +org.jboss.portlet.hello.HelloWorldPortlet]]= > + + + The Fully Qualified Name (FQN) of your portlet class must be declared he= re. + + + + + text/html + VIEW +]]> + + + The <supports> element allows you to declare al= l the markup types your + portlet supports in the render method. This is accomp= lished via the + <mime-type> element, which is required for ever= y portlet. The declared MIME types must match the capability of the portlet. + + + As well, it allows you to pair which modes and window states are support= ed for each markup type. All portlets must support the VIEW portlet mode, s= o this does not have to be decared. Define which markup type your porlet su= pports, which in this examepl is text/html. This section= tells the portal that it will only output text and HTML, and that it only = supports the VIEW mode. + + + + + HelloWorld Portlet +]]> + + + When rendered, the portlet's title will be displayed as the header in th= e portlet window, unless it is overridden programmatically. In this example= , the title would be HelloWorld Portlet. + + + + + + + The following is an example of the HelloWorldPortlet/WEB-INF/po= rtlet-instances.xml file: + + + @@ -343,17 +353,21 @@ HelloWorldPortlet -]]> - This is a JBoss Portal specific descriptor that al= lows you to create instances of portlets. The - portlet-ref value must match th= e portlet-name value - given in the packaged portlet.xml. The instance-id - value can be named anything, but it must match instance-ref values given - in *-object.xml files as we sha= ll below. - - - - helloworld-object.xml - +]]> + + + + This is a JBoss Portal specific descriptor that allows you to create inst= ances of portlets. The + <portlet-ref> value must match the <= portlet-name> value + given in the HelloWorldPortlet/WEB-INF/portlet.xml f= ile. The <instance-id> + value can be named anything, but it must match the instance-ref<= /literal> values given + in *-object.xml files as we shall below. + + + The following is an example helloworld-object.xml fi= le: + + + @@ -368,14 +382,18 @@ 1 -]]> +]]> + + + +*-object.xml files are JBoss Portal specific descriptor= s and allow users to +define the structure of their portal instances as well as create/configure= their windows and +pages. In our example, we create a portlet window, specify that it will di= splay the markup +generated by the HelloWorldPortletInstance portlet inst= ance, assign it to the +default.default page, and specify where it should appea= r on that page. + + = - *-object.xml files are JBoss Po= rtal specific descriptors and allow users to - define the structure of their portal instances as = well as create/configure their windows and - pages. In our example, we create a portlet window,= specify that it will display the markup - generated by the HelloWorldPortletInstanc= e portlet instance, assign it to the - default.default page, and speci= fy where it should appear on that page. - @@ -418,9 +436,7 @@ - - - + To illustrate the relationship between the descriptors, we = have provided this simple diagram @@ -455,6 +471,8 @@ ]]> + + = This declaration is equivalent to the previous example. We = specify that the content being displayed by the HelloWorldPortletWindow is a portlet content. The content URI @@ -462,7 +480,7 @@ It is possible to declare windows with a cms content type and use directly the path to the file in the CMS to make the window show the content of = the associated file. That behavior is pluggable and it is possible to plug virtually any kind of = content. - + = Building your portlet --===============5306256485523365341==--