Portal"

From Documentation
m ((via JWB))
m ((via JWB))
Line 5: Line 5:
  
 
== WEB-INF/portlet.xml ==
 
== WEB-INF/portlet.xml ==
To use it, you first have to add the following portlet definition for <javadoc>org.zkoss.zk.ui.http.DHtmlLayoutPortlet</javadoc> into <tt>WEB-INF/portlet.xml</tt>. Notice that <tt>expiration-cache</tt> must be set to zero to prevent portals from caching the result.
+
To use it, you first have to add the following portlet definition for <javadoc>org.zkoss.zk.ui.http.DHtmlLayoutPortlet</javadoc> into <code>WEB-INF/portlet.xml</code>. Notice that <code>expiration-cache</code> must be set to zero to prevent portals from caching the result.
  
 
<source lang="xml" >
 
<source lang="xml" >
Line 33: Line 33:
  
 
== WEB-INF/web.xml ==
 
== WEB-INF/web.xml ==
ZK portlet loader actually delegates the loading of ZUML documents to ZK Loader (<javadoc>org.zkoss.zk.ui.http.DHtmlLayoutServlet</javadoc>). Thus, you have to configure <tt>WEB-INF/web.xml</tt> as specified in [[ZK Installation Guide]], even if you want to use only portlets.
+
ZK portlet loader actually delegates the loading of ZUML documents to ZK Loader (<javadoc>org.zkoss.zk.ui.http.DHtmlLayoutServlet</javadoc>). Thus, you have to configure <code>WEB-INF/web.xml</code> as specified in [[ZK Installation Guide]], even if you want to use only portlets.
  
 
=Use ZK Portlet=
 
=Use ZK Portlet=
 
== The zk_page and zk_richlet Parameter and Attribute ==
 
== The zk_page and zk_richlet Parameter and Attribute ==
ZK portlet loader is a generic loader. To load a particular ZUML page, you have to specify either a request parameter, a portlet attribute or a portlet preference called <tt>zk_page</tt>, if you want to load a ZUML page, or <tt>zk_richlet</tt>, if you want to load a richlet.
+
ZK portlet loader is a generic loader. To load a particular ZUML page, you have to specify either a request parameter, a portlet attribute or a portlet preference called <code>zk_page</code>, if you want to load a ZUML page, or <code>zk_richlet</code>, if you want to load a richlet.
  
 
More precisely, ZK portlet loader first checks the following locations for the path of the ZUML page or the richlet. The lower the number, the higher the priority.
 
More precisely, ZK portlet loader first checks the following locations for the path of the ZUML page or the richlet. The lower the number, the higher the priority.
  
# The request parameter (<tt>RenderRequest</tt>'s <tt>getParameter</tt>) called <tt>zk_page</tt>. If found, it is the path of the ZUML page.
+
# The request parameter (<code>RenderRequest</code>'s <code>getParameter</code>) called <code>zk_page</code>. If found, it is the path of the ZUML page.
# The request attribute (<tt>RenderRequest</tt>'s <tt>getAttribute</tt>) called <tt>zk_page</tt>. If found, it is the path of the ZUML page.
+
# The request attribute (<code>RenderRequest</code>'s <code>getAttribute</code>) called <code>zk_page</code>. If found, it is the path of the ZUML page.
# The request preference (<tt>RenderRequest</tt>'s <tt>getPortletPreferences</tt>'s <tt>getValue</tt>) called <tt>zk_page</tt>. If found, it is the path of the ZUML page.
+
# The request preference (<code>RenderRequest</code>'s <code>getPortletPreferences</code>'s <code>getValue</code>) called <code>zk_page</code>. If found, it is the path of the ZUML page.
# The request parameter (<tt>RenderRequest</tt>'s <tt>getParameter</tt>) called <tt>zk_richlet</tt>. If found, it is the path of the richlet.
+
# The request parameter (<code>RenderRequest</code>'s <code>getParameter</code>) called <code>zk_richlet</code>. If found, it is the path of the richlet.
# The request attribute (<tt>RenderRequest</tt>'s <tt>getAttribute</tt>) called <tt>zk_richlet</tt>. If found, it is the path of the richlet.
+
# The request attribute (<code>RenderRequest</code>'s <code>getAttribute</code>) called <code>zk_richlet</code>. If found, it is the path of the richlet.
# The request preference (<tt>RenderRequest</tt>'s <tt>getPortletPreferences</tt>'s <tt>getValue</tt>) called <tt>zk_richlet</tt>. If found, it is the path of the richlet.
+
# The request preference (<code>RenderRequest</code>'s <code>getPortletPreferences</code>'s <code>getValue</code>) called <code>zk_richlet</code>. If found, it is the path of the richlet.
# The initial parameter (<tt>PortletConfig</tt>'s <tt>getInitParameter</tt>) called <tt>zk_page</tt>. If found, it is the path of the ZUML page.
+
# The initial parameter (<code>PortletConfig</code>'s <code>getInitParameter</code>) called <code>zk_page</code>. If found, it is the path of the ZUML page.
  
 
== Examples ==
 
== Examples ==

Revision as of 14:11, 12 January 2022

Configuration

Here we describe the standard configuration. Depending on the portal server, you might have more than one configuration to set. For more information, please refer to ZK Installation Guide.

WEB-INF/portlet.xml

To use it, you first have to add the following portlet definition for DHtmlLayoutPortlet into WEB-INF/portlet.xml. Notice that expiration-cache must be set to zero to prevent portals from caching the result.

 <portlet>
     <description>ZK loader for ZUML pages</description>
     <portlet-name>zkPortletLoader</portlet-name>
     <display-name>ZK Portlet Loader</display-name>

     <portlet-class>org.zkoss.zk.ui.http.DHtmlLayoutPortlet</portlet-class>

     <expiration-cache>0</expiration-cache>

     <supports>
         <mime-type>text/html</mime-type>
         <portlet-mode>VIEW</portlet-mode>
     </supports>

     <supported-locale>en</supported-locale>

     <portlet-info>
         <title>ZK</title>
         <short-title>ZK</short-title>
         <keywords>ZK,ZUML</keywords>
     </portlet-info>
 </portlet>

WEB-INF/web.xml

ZK portlet loader actually delegates the loading of ZUML documents to ZK Loader (DHtmlLayoutServlet). Thus, you have to configure WEB-INF/web.xml as specified in ZK Installation Guide, even if you want to use only portlets.

Use ZK Portlet

The zk_page and zk_richlet Parameter and Attribute

ZK portlet loader is a generic loader. To load a particular ZUML page, you have to specify either a request parameter, a portlet attribute or a portlet preference called zk_page, if you want to load a ZUML page, or zk_richlet, if you want to load a richlet.

More precisely, ZK portlet loader first checks the following locations for the path of the ZUML page or the richlet. The lower the number, the higher the priority.

  1. The request parameter (RenderRequest's getParameter) called zk_page. If found, it is the path of the ZUML page.
  2. The request attribute (RenderRequest's getAttribute) called zk_page. If found, it is the path of the ZUML page.
  3. The request preference (RenderRequest's getPortletPreferences's getValue) called zk_page. If found, it is the path of the ZUML page.
  4. The request parameter (RenderRequest's getParameter) called zk_richlet. If found, it is the path of the richlet.
  5. The request attribute (RenderRequest's getAttribute) called zk_richlet. If found, it is the path of the richlet.
  6. The request preference (RenderRequest's getPortletPreferences's getValue) called zk_richlet. If found, it is the path of the richlet.
  7. The initial parameter (PortletConfig's getInitParameter) called zk_page. If found, it is the path of the ZUML page.

Examples

How to pass a request parameter or attribute to a portlet depends on the portal. You have to consult the user's guide of your favorite portal for details, or refer to ZK Installation Guide.

Version History

Last Update : 2022/01/12


Version Date Content
     



Last Update : 2022/01/12

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.