Sample Portlet Applications
Portlet BridgesICEfaces supports two different portlet bridges for running ICEfaces portlets. Be sure to review the section on the supported bridges in the Portlet Bridges section. Sample PortletsThe following sample portlets are included in the ICEfaces distribution. The examples are useful for getting a quick start on how to build a portlet using ICEfaces and the PortletFaces Bridge. This includes what the markup should look like, what files need to be included, and how they should be configured. For each portlet example, there is a corresponding non-portlet example. Looking under the [icefaces.dir]/samples, you'll find: Showcase The Showcase portlets are examples based on the ICEfaces Showcase example configured to run in a portal. It uses the same markup and code as the non-portlet demo, but with each component example delivered as an individual portlet. The sample is located under: [icefaces.install.dir]/icefaces/samples/showcase/showcase-portlet Chat The Chat example is a demonstration portlet that uses only stock JSF components and ICEpush. You can drop multiple instances on a single portal page and chat between the instances as well as between different browsers. The sample code is located under: [icefaces.install.dir]/icefaces/samples/core/chat-portlet BuildingEach portlet example is built by using the content from the corresponding non-portlet parent project and adding in the portlet-specific files required. To build a portlet .war file for Liferay 6 running on Tomcat 6.0, follow the instructions for your appropriate build tool (Ant or Maven): Building with AntFrom your terminal or console, navigate to the example you wish to build and then execute the appropriate command. For example, to build the showcase, navigate to the showcase-portlet directory and type: [icefaces.install.dir]/icefaces/samples/showcase/showcase-portlet > ant clean liferay6.servlet-profile Because of licensing restrictions, the LiferayFaces Bridge libraries are not shipped with ICEfaces so you need to:
To do a build with Ant and include the PortletFaces Bridge, you use the same command but set the appropriate property:
[icefaces.install.dir]/icefaces/samples/core/chat-portlet > ant -Dportletfaces="true" clean liferay6.servlet-profile
In both cases, the resulting .war file is located under the build/dist directory: [icefaces.install.dir]/samples/showcase/showcase-portlet/build/dist/showcase-portlet.war Building with MavenFrom your terminal or console, navigate to the example you wish to build and then execute the appropriate command. For example, to build the showcase, navigate to the showcase-portlet directory and type:
[icefaces.install.dir]/icefaces/samples/showcase/showcase-portlet > mvn clean package
The default Maven profile builds the war using the latest LiferayFaces Bridge. The latest version is specified in the top-level pom of the icefaces distrubution: [icefaces.install.dir]/icefaces/pom.xml If you need a version other than the one specified in that file, change the following property to the version you require: <liferayfaces.version>3.1.2-ga3-SNAPSHOT</liferayfaces.version> To do a build with Maven and include the PortletFaces Bridge, you will need to specify the appropriate profile:
[icefaces.install.dir]/icefaces/samples/showcase/showcase-portlet > mvn clean package -Pportletfaces
The resulting .war file is located under the relative target directory: [icefaces.install.dir]/samples/showcase/showcase-portlet/target/showcase-portlet.war DeployingThe resulting .war file from either build can be deployed directly to the Liferay deploy directory. Once deployed, it will show up in the list of available portlets under the ICEfaces category. Mojarra vs MyFacesAll of the ICEfaces portlet sample applications default to using Mojarra as the JSF implementation. You can choose MyFaces by using the appropriate property or profile depending on which build system you use: Ant: Turn on the MyFaces property when building:
[icefaces.install.dir]/icefaces/samples/core/chat-portlet > ant -Dmyfaces="true" clean liferay6.servlet-profile
Maven: Use the MyFaces servlet profile:
[icefaces.install.dir]/icefaces/samples/showcase/showcase-portlet > mvn clean package -P servlet-myfaces
|
Sample Portlet Applications
© Copyright 2021 ICEsoft Technologies Canada Corp.