Developing Portlets

You are viewing an old version (v. 3) of this page.
The latest version is v. 7, last edited on Apr 18, 2018 (view differences | )
<< View previous version | view page history | view next version >>

Developing Your Own Portlets

portlet.xml

ICEfaces makes use of the PortletFaces Bridge to handle the mapping of the portlet lifecycle onto the JSF lifecycle. This has many advantages like enabling proper resource handling and cleaner integration with the portal container. To define your portlet, take a look at the portlet definition of the chat portlet example:

    <portlet>
        <portlet-name>chat-ice2-portlet</portlet-name>
        <display-name>Chat</display-name>
        <portlet-class>org.portletfaces.bridge.GenericFacesPortlet</portlet-class>
        <init-param>
            <name>javax.portlet.faces.defaultViewId.view</name>
            <value>/chat.xhtml</value>
        </init-param>
        <supports>
            <mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>
        </supports>
        <portlet-info>
            <title>ICEfaces 2 Chat</title>
            <short-title>ICEfaces 2 Chat</short-title>
            <keywords>icefaces portlet chat icepush</keywords>
        </portlet-info>
    </portlet>

The important parts are:
* The *portlet-class*, which needs to be defined as *org.portletfaces.bridge.GenericFacesPortlet*.
* The *javax.portlet.faces.defaultViewId.view* which should identify the page that is the initial view of the portlet.

web.xml

To prevent the processing of portlet resource URLs to avoid caching of things like bridge.js, the following parameter should be set to false.

<context-param>
    <param-name>org.icefaces.uniqueResourceURLs</param-name>
    <param-value>false</param-value>
</context-param>

Library Dependencies

The ICEfaces distribution includes a tested release version of the PortletFaces Bridge and is located in:

[icefaces.install.dir]/icefaces/lib/portlets

* portletfaces-bridge-*.jar

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2017 ICEsoft Technologies Canada Corp.