ICEfaces
  1. ICEfaces
  2. ICE-5943

Port the portlet version of Component Showcase to run on ICEfaces 2 and the new PortletFaces bridge.

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Beta1
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Labels:
      None
    • Environment:
      ICEfaces 2 portals portlets

      Description

      Our goal for Beta2 is to include our first support of portlets using the PortletFaces bridge. In order to enhance testing and provide a comprehensive demonstration of compatible components running as portlets, we should port the Component Showcase as a .war showing each demo as portlet, much like what we have in ICEfaces 1.8.x

        Activity

        Hide
        Deryk Sinotte added a comment -

        The intial commits have been done. I've added the libraries for the bridge and portlet support to a subdirectory:

        icefaces/lib/portlets

        to keep them separate from the more generic libraries and show that basic ICEfaces doesn't require them.

        Under compat/samples/component-showcase I've added a portlets directory. This contains the portlet specific content and the required .xml files (portlet.xml, liferay*.xml).

        There is now a new build target called portletize.war that currently only builds a Tomcat 6 compatible .war. So from the component-showcase directory you can type:

        ant clean portletize.war

        This will build the normal tomcat6.0 .war and then:

        • unzip the .war file under portlets/build/exploded
        • add all the portlet stuff to the exploded directory
        • re-zip the directory as portlets/build/component-showcase-portlet.war

        You should copy this war to:

        liferay-portal-6.0.2/deploy

        This should allow you to add the ICEfaces portlets to a portal page. Currently there are only two portlets defined but I've set it up so that there is only a single view.xhtml page for all the portlets. All we need to do to add more portlets is add a <portlet> entry in the portlet.xml file. Simply copy and paste an existing entry and change the values. The important one is the org.icefaces.demo.viewPath parameter that points to the content to include for that particular portlet:

        <portlet>
        <portlet-name>textFields</portlet-name>
        <display-name>ICEfaces 2: Text Fields</display-name>
        <portlet-class>org.portletfaces.bridge.GenericFacesPortlet</portlet-class>
        <init-param>
        <name>javax.portlet.faces.defaultViewId.view</name>
        <value>/view.xhtml</value>
        </init-param>
        <init-param>
        <name>org.icefaces.demo.viewPath</name>
        <value>/WEB-INF/includes/examples/standard/textFields.xhtml</value>
        </init-param>
        <supports>
        <mime-type>text/html</mime-type>
        <portlet-mode>view</portlet-mode>
        </supports>
        <portlet-info>
        <title>ICEfaces 2: Text Fields</title>
        <short-title>Buttons and Links</short-title>
        <keywords>ICEfaces Component Showcase Buttons Links</keywords>
        </portlet-info>
        </portlet>

        Then add an entry to the liferay-portlet.xml file. Again, copy and paste an existing entry and just change the portlet-name to match the entry in the portlet.xml file:

        <portlet>
        <portlet-name>textFields</portlet-name>
        <instanceable>true</instanceable>
        <ajaxable>false</ajaxable>
        </portlet>

        Lastly, add a line to liferay-display.xml so that the portlet will show up in the menu for adding applications. Again, id must match the portlet-name:

        <category name="ICEfaces 2">
        <portlet id="buttonsAndLinks"/>
        <portlet id="textFields"/>
        </category>

        Show
        Deryk Sinotte added a comment - The intial commits have been done. I've added the libraries for the bridge and portlet support to a subdirectory: icefaces/lib/portlets to keep them separate from the more generic libraries and show that basic ICEfaces doesn't require them. Under compat/samples/component-showcase I've added a portlets directory. This contains the portlet specific content and the required .xml files (portlet.xml, liferay*.xml). There is now a new build target called portletize.war that currently only builds a Tomcat 6 compatible .war. So from the component-showcase directory you can type: ant clean portletize.war This will build the normal tomcat6.0 .war and then: unzip the .war file under portlets/build/exploded add all the portlet stuff to the exploded directory re-zip the directory as portlets/build/component-showcase-portlet.war You should copy this war to: liferay-portal-6.0.2/deploy This should allow you to add the ICEfaces portlets to a portal page. Currently there are only two portlets defined but I've set it up so that there is only a single view.xhtml page for all the portlets. All we need to do to add more portlets is add a <portlet> entry in the portlet.xml file. Simply copy and paste an existing entry and change the values. The important one is the org.icefaces.demo.viewPath parameter that points to the content to include for that particular portlet: <portlet> <portlet-name>textFields</portlet-name> <display-name>ICEfaces 2: Text Fields</display-name> <portlet-class>org.portletfaces.bridge.GenericFacesPortlet</portlet-class> <init-param> <name>javax.portlet.faces.defaultViewId.view</name> <value>/view.xhtml</value> </init-param> <init-param> <name>org.icefaces.demo.viewPath</name> <value>/WEB-INF/includes/examples/standard/textFields.xhtml</value> </init-param> <supports> <mime-type>text/html</mime-type> <portlet-mode>view</portlet-mode> </supports> <portlet-info> <title>ICEfaces 2: Text Fields</title> <short-title>Buttons and Links</short-title> <keywords>ICEfaces Component Showcase Buttons Links</keywords> </portlet-info> </portlet> Then add an entry to the liferay-portlet.xml file. Again, copy and paste an existing entry and just change the portlet-name to match the entry in the portlet.xml file: <portlet> <portlet-name>textFields</portlet-name> <instanceable>true</instanceable> <ajaxable>false</ajaxable> </portlet> Lastly, add a line to liferay-display.xml so that the portlet will show up in the menu for adding applications. Again, id must match the portlet-name: <category name="ICEfaces 2"> <portlet id="buttonsAndLinks"/> <portlet id="textFields"/> </category>
        Hide
        Ted Goddard added a comment -

        Rough perl script for generating portlet metadata. Perl script includes list of portlets and produces output suitable for copying and pasting into the various files.

        Show
        Ted Goddard added a comment - Rough perl script for generating portlet metadata. Perl script includes list of portlets and produces output suitable for copying and pasting into the various files.
        Hide
        Ted Goddard added a comment -

        updated perl script.

        Show
        Ted Goddard added a comment - updated perl script.
        Hide
        Deryk Sinotte added a comment -

        Required files and build target have been added to the Component Showcase example to run as a set of portlets using the new PortletFaces bridge.

        Show
        Deryk Sinotte added a comment - Required files and build target have been added to the Component Showcase example to run as a set of portlets using the new PortletFaces bridge.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: