[jboss-svn-commits] JBoss PortletSwap SVN: r155 - in portlets/src/framework/JSFRIPortlet: src and 50 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Nov 12 21:15:52 EST 2007
Author: wesleyhales
Date: 2007-11-12 21:15:51 -0500 (Mon, 12 Nov 2007)
New Revision: 155
Added:
portlets/src/framework/JSFRIPortlet/pom.xml
portlets/src/framework/JSFRIPortlet/src/
portlets/src/framework/JSFRIPortlet/src/main/
portlets/src/framework/JSFRIPortlet/src/main/java/
portlets/src/framework/JSFRIPortlet/src/main/java/com/
portlets/src/framework/JSFRIPortlet/src/main/java/com/sun/
portlets/src/framework/JSFRIPortlet/src/main/java/com/sun/facelets/
portlets/src/framework/JSFRIPortlet/src/main/java/com/sun/facelets/FaceletPortletViewHandler.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DataFilterSliderDao.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DataFilterSliderDaoImpl.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DemoInventoryItem.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/DemoInventoryList.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/MyBean.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScroller.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScrollerRenderer.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScrollerTag.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/action/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/action/MyShowListener.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/action/ShowOneDeckBean.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/ProShowOneDeck.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/ShowSource.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/UIShowItem.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/UIShowOne.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowAdapter.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowEvent.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowListener.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/handler/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/handler/ShowListenerTagHandler.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/handler/ShowOneDeckTagHandler.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/html/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/html/HtmlRenderer.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/html/basic/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/html/basic/HtmlShowOneDeckRenderer.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ProShowOneDeckTag.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ShowItemTag.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ShowListenerTag.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/UIComponentTagSupport.java
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/util/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/listener/
portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/listener/DemoListener.java
portlets/src/framework/JSFRIPortlet/src/main/java/portal/
portlets/src/framework/JSFRIPortlet/src/main/java/portal/Bean.java
portlets/src/framework/JSFRIPortlet/src/main/java/portal/TestPortlet.java
portlets/src/framework/JSFRIPortlet/src/main/resources/
portlets/src/framework/JSFRIPortlet/src/main/resources/META-INF/
portlets/src/framework/JSFRIPortlet/src/main/resources/META-INF/2_6_DR_ss1.gif
portlets/src/framework/JSFRIPortlet/src/main/resources/faces-config.xml
portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/
portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/commons-logging.properties
portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/log4j.dtd
portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/log4j.xml
portlets/src/framework/JSFRIPortlet/src/main/resources/tags/
portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/
portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/ac.taglib.xml
portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/deck.taglib.xml
portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/xhtml/
portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/xhtml/nav.xhtml
portlets/src/framework/JSFRIPortlet/src/main/resources/tags/jsp/
portlets/src/framework/JSFRIPortlet/src/main/resources/tags/jsp/ac.tld
portlets/src/framework/JSFRIPortlet/src/main/resources/tags/jsp/deckTag.tld
portlets/src/framework/JSFRIPortlet/src/main/resources/webdefault.xml
portlets/src/framework/JSFRIPortlet/src/main/webapp/
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/classes/
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/classes/META-INF/
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/classes/META-INF/css/
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/classes/META-INF/images/
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/classes/META-INF/images/DC_Advertising.jpg
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/classes/META-INF/js/
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss-app.xml
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss_portal.tld
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/lib/
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/lib/jsf-facelets.jar
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portal.taglib.xml
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet.tld
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet.xml
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/riportlet-object.xml
portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/web.xml
portlets/src/framework/JSFRIPortlet/src/main/webapp/css/
portlets/src/framework/JSFRIPortlet/src/main/webapp/css/master.css
portlets/src/framework/JSFRIPortlet/src/main/webapp/css/showOneDeck.css
portlets/src/framework/JSFRIPortlet/src/main/webapp/deck/
portlets/src/framework/JSFRIPortlet/src/main/webapp/deck/deck.xhtml
portlets/src/framework/JSFRIPortlet/src/main/webapp/images/
portlets/src/framework/JSFRIPortlet/src/main/webapp/images/2_6_DR_ss1.gif
portlets/src/framework/JSFRIPortlet/src/main/webapp/index.html
portlets/src/framework/JSFRIPortlet/src/main/webapp/index.xhtml
portlets/src/framework/JSFRIPortlet/src/main/webapp/inventory/
portlets/src/framework/JSFRIPortlet/src/main/webapp/inventory/inventoryList.xhtml
portlets/src/framework/JSFRIPortlet/src/main/webapp/js/
portlets/src/framework/JSFRIPortlet/src/main/webapp/js/showOneDeck.js
portlets/src/framework/JSFRIPortlet/src/main/webapp/jsf/
portlets/src/framework/JSFRIPortlet/src/main/webapp/jsf/start.xhtml
portlets/src/framework/JSFRIPortlet/src/main/webapp/layouts/
portlets/src/framework/JSFRIPortlet/src/main/webapp/layouts/default.xhtml
portlets/src/framework/JSFRIPortlet/src/main/webapp/panelGrid/
portlets/src/framework/JSFRIPortlet/src/main/webapp/panelGrid/demo.xhtml
portlets/src/framework/JSFRIPortlet/src/main/webapp/phase/
portlets/src/framework/JSFRIPortlet/src/main/webapp/phase/listener.xhtml
portlets/src/framework/JSFRIPortlet/src/main/webapp/signup/
portlets/src/framework/JSFRIPortlet/src/main/webapp/signup/complete.xhtml
portlets/src/framework/JSFRIPortlet/src/main/webapp/signup/form.xhtml
portlets/src/framework/JSFRIPortlet/src/test/
portlets/src/framework/JSFRIPortlet/src/test/java/
portlets/src/framework/JSFRIPortlet/src/test/java/com/
Log:
initial import of 301 RI portlet
Added: portlets/src/framework/JSFRIPortlet/pom.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/pom.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/pom.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,233 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>root</artifactId>
+ <version>2.0.0.CR2</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.portal.example</groupId>
+ <artifactId>JSFRIdemo</artifactId>
+ <packaging>war</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>JSFRIdemo</name>
+
+ <description>
+ JSFRIdemo Website
+ </description>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <resources>
+
+ <resource>
+ <directory>src/main/resources</directory>
+ <targetPath>META-INF</targetPath>
+ <includes>
+ <include>tags/**</include>
+ </includes>
+ </resource>
+
+ <resource>
+ <directory>${basedir}/src/main/resources</directory>
+ <filtering>false</filtering>
+ <!--Maven defaults to copying any filtered resource to the target/classes directory-->
+ <targetPath>../${artifactId}/WEB-INF</targetPath>
+ <includes>
+ <include>faces-config.xml</include>
+ </includes>
+ </resource>
+
+ <resource>
+ <directory>src/main/resources/log4j</directory>
+ <targetPath/>
+ <includes>
+ <include>*.xml</include>
+ <include>*.dtd</include>
+ <include>tags/xhtml/**</include>
+ <include>*.properties</include>
+ </includes>
+ </resource>
+
+ </resources>
+ <finalName>JSFRIdemo</finalName>
+ <plugins>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.4</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
+ <connectors>
+ <connector
+ implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8080</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>http://snapshots.jboss.org/maven2</url>
+ </repository>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
+ <repository>
+ <releases/>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>maven-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>https://maven-repository.dev.java.net/nonav/repository</url>
+ <layout>legacy</layout>
+ </repository>
+ <!--repository>
+ <id>ibiblio</id>
+ <name>ibiblio-repo</name>
+ <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
+ <layout>legacy</layout>
+ </repository-->
+ <!--
+ <repository>
+ <id>m2-snapshot-repository</id>
+ <name>m2-snapshot-repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ </repository>-->
+ </repositories>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!--Trinidad Needs to be added to seam repo-->
+ <!--<dependency>
+ <groupId>seam.lib</groupId>
+ <artifactId>trinidad-api-1.0.2-SNAPSHOT</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>seam.lib</groupId>
+ <artifactId>trinidad-impl-1.0.2-SNAPSHOT</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>-->
+
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.1</version>
+ </dependency>
+
+
+ <!--#############################-Non seam-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ <scope>provided</scope>
+ </dependency>
+ <!--<dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>el-impl</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>1.0</version>
+ </dependency>-->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>apache-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4-jboss</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.portlet-bridge</groupId>
+ <artifactId>jsf-portlet-bridge-impl</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.portlet-bridge</groupId>
+ <artifactId>jsf-portlet-bridge-api</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+
+</project>
Added: portlets/src/framework/JSFRIPortlet/src/main/java/com/sun/facelets/FaceletPortletViewHandler.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/com/sun/facelets/FaceletPortletViewHandler.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/com/sun/facelets/FaceletPortletViewHandler.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,54 @@
+package com.sun.facelets;
+
+ import java.io.IOException;
+
+ import javax.faces.FacesException;
+ import javax.faces.application.ViewHandler;
+ import javax.faces.context.ExternalContext;
+ import javax.faces.context.FacesContext;
+ import javax.faces.context.ResponseWriter;
+ import javax.faces.render.RenderKit;
+ import javax.portlet.RenderRequest;
+ import javax.portlet.RenderResponse;
+
+ /**
+ * ViewHandler implementation for Facelets used in Portlets
+ *
+ */
+ public class FaceletPortletViewHandler extends FaceletViewHandler {
+
+ public FaceletPortletViewHandler(ViewHandler parent) {
+ super(parent);
+ }
+
+ protected ResponseWriter createResponseWriter(FacesContext context)
+ throws IOException, FacesException {
+ ExternalContext extContext = context.getExternalContext();
+ RenderKit renderKit = context.getRenderKit();
+
+ RenderRequest request = (RenderRequest) extContext.getRequest();
+ RenderResponse response = (RenderResponse) extContext.getResponse();
+
+ String contenttype = request.getResponseContentType();
+ if (contenttype == null) {
+ contenttype = "text/html";
+ }
+
+ String encoding = response.getCharacterEncoding();
+ if (encoding == null) {
+ encoding = "ISO-8859-1";
+ }
+
+ ResponseWriter writer = renderKit.createResponseWriter(NullWriter.Instance, contenttype, encoding);
+
+ contenttype = writer.getContentType();
+
+ // apply them to the response
+ response.setContentType(contenttype);
+
+ // Now, clone with the real writer
+ writer = writer.cloneWithWriter(response.getWriter());
+
+ return writer;
+ }
+ }
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DataFilterSliderDao.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DataFilterSliderDao.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DataFilterSliderDao.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,12 @@
+package org.jboss.portal.example.dao;
+
+import java.util.List;
+
+public interface DataFilterSliderDao {
+
+ public List getCarsById(String id);
+
+ public List getAllCarMakes();
+
+ public int genRand();
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DataFilterSliderDaoImpl.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DataFilterSliderDaoImpl.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DataFilterSliderDaoImpl.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,156 @@
+package org.jboss.portal.example.dao;
+
+import java.util.*;
+import java.math.BigDecimal;
+
+public class DataFilterSliderDaoImpl implements DataFilterSliderDao {
+
+ private Map itemKeyMap = new HashMap();
+ private static int DECIMALS = 1;
+ private static int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP;
+ private static DataFilterSliderDaoImpl ourInstance = new DataFilterSliderDaoImpl();
+
+ public static DataFilterSliderDaoImpl getInstance() {
+ return ourInstance;
+ }
+
+ private DataFilterSliderDaoImpl() {
+ loadCarList("0");
+ loadCarList("1");
+ loadCarList("2");
+ loadCarList("3");
+ loadCarList("4");
+ loadCarList("5");
+
+ }
+
+ public List getAllCarMakes(){
+ List retVal = new ArrayList();
+
+ retVal.add("Chevrolet");
+ retVal.add("Ford");
+ retVal.add("Nissan");
+ retVal.add("Toyota");
+ retVal.add("GMC");
+ retVal.add("Infiniti");
+
+ return retVal;
+ }
+
+ public List getCarsById(String id){
+ List retVal = new ArrayList();
+
+ retVal = (ArrayList)itemKeyMap.get( id );
+
+ return retVal;
+ }
+
+ public List loadCarList(String id) {
+
+ ArrayList retVal = new ArrayList();
+ if ( itemKeyMap.containsKey( id ) ){
+ retVal = (ArrayList)itemKeyMap.get( id );
+ //log.info("***************************YES we already have this one in cache: " + id);
+ }else{
+ try{
+
+ if (id.equals("0")){
+ retVal.addAll(createCar("Chevrolet","Corvette"));
+ retVal.addAll(createCar("Chevrolet","Malibu"));
+ retVal.addAll(createCar("Chevrolet","S-10"));
+ retVal.addAll(createCar("Chevrolet","Tahoe"));
+ }else if(id.equals("1")){
+ retVal.addAll(createCar("Ford","Taurus"));
+ retVal.addAll(createCar("Ford","Explorer"));
+ }else if(id.equals("2")){
+ retVal.addAll(createCar("Nissan","Maxima"));
+ }else if(id.equals("3")){
+ retVal.addAll(createCar("Toyota","4-Runner"));
+ retVal.addAll(createCar("Toyota","Camry"));
+ retVal.addAll(createCar("Toyota","Avalon"));
+ }else if(id.equals("4")){
+ retVal.addAll(createCar("GMC","Sierra"));
+ retVal.addAll(createCar("GMC","Yukon"));
+ }else if(id.equals("5")){
+ retVal.addAll(createCar("Infiniti","G35"));
+ }
+
+ }catch(Exception e){
+ System.out.println("!!!!!!loadAllCars Error: " + e.getMessage());
+ e.printStackTrace();
+ }
+
+ itemKeyMap.put(id,retVal);
+ }
+
+
+ return retVal;
+ }
+
+ public int genRand() {
+ return rand(1,10000);
+ }
+
+ public List createCar(String make, String model){
+
+ ArrayList iiList = null;
+
+ try{
+ int arrayCount = rand(5,20);
+
+ DemoInventoryItem[] demoInventoryItemArrays = new DemoInventoryItem[arrayCount];
+ System.out.println("******demoInventoryItemArrays: " + demoInventoryItemArrays.length);
+
+ for (int j = 0; j < demoInventoryItemArrays.length; j++){
+ DemoInventoryItem ii = new DemoInventoryItem();
+
+ ii.setMake(make);
+ ii.setModel(model);
+ ii.setStock(randomstring(6,7));
+ ii.setVin(randomstring(14,15));
+ ii.setMileage(new BigDecimal(rand(5000,80000)).setScale(DECIMALS, ROUNDING_MODE));
+ ii.setMileageMarket(new BigDecimal(rand(25000,45000)).setScale(DECIMALS, ROUNDING_MODE));
+ ii.setPrice(new Integer(rand(15000,55000)));
+ ii.setPriceMarket(new BigDecimal(rand(15000,55000)).setScale(DECIMALS, ROUNDING_MODE));
+ ii.setDaysLive(rand(1,90));
+ ii.setChangeSearches(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
+ ii.setChangePrice(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
+ ii.setExposure(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
+ ii.setActivity(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
+ ii.setPrinted(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
+ ii.setInquiries(new BigDecimal(rand(0,5)).setScale(DECIMALS, ROUNDING_MODE));
+ demoInventoryItemArrays[j] = ii;
+
+ }
+
+ iiList = new ArrayList(Arrays.asList(demoInventoryItemArrays));
+
+ }catch(Exception e){
+ System.out.println("!!!!!!createCategory Error: " + e.getMessage());
+ e.printStackTrace();
+ }
+ return iiList;
+ }
+
+ public static int rand(int lo, int hi)
+ {
+ Random rn2 = new Random();
+ //System.out.println("**" + lo);
+ //System.out.println("**" + hi);
+ int n = hi - lo + 1;
+ int i = rn2.nextInt() % n;
+ if (i < 0)
+ i = -i;
+ return lo + i;
+ }
+
+ public static String randomstring(int lo, int hi)
+ {
+ int n = rand(lo, hi);
+ byte b[] = new byte[n];
+ for (int i = 0; i < n; i++)
+ b[i] = (byte) rand('A', 'Z');
+ return new String(b, 0);
+ }
+
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DemoInventoryItem.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DemoInventoryItem.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/dao/DemoInventoryItem.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,147 @@
+package org.jboss.portal.example.dao;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+public class DemoInventoryItem implements Serializable {
+
+ String make;
+ String model;
+ String stock;
+ String vin;
+
+ BigDecimal mileage;
+ BigDecimal mileageMarket;
+ Integer price;
+ BigDecimal priceMarket;
+
+ int daysLive;
+ BigDecimal changeSearches;
+ BigDecimal changePrice;
+
+ BigDecimal exposure;
+ BigDecimal activity;
+ BigDecimal printed;
+ BigDecimal inquiries;
+
+
+ public String getMake() {
+ return make;
+ }
+
+ public void setMake(String make) {
+ this.make = make;
+ }
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public String getStock() {
+ return stock;
+ }
+
+ public void setStock(String stock) {
+ this.stock = stock;
+ }
+
+ public String getVin() {
+ return vin;
+ }
+
+ public void setVin(String vin) {
+ this.vin = vin;
+ }
+
+ public BigDecimal getMileage() {
+ return mileage;
+ }
+
+ public void setMileage(BigDecimal mileage) {
+ this.mileage = mileage;
+ }
+
+ public BigDecimal getMileageMarket() {
+ return mileageMarket;
+ }
+
+ public void setMileageMarket(BigDecimal mileageMarket) {
+ this.mileageMarket = mileageMarket;
+ }
+
+ public Integer getPrice() {
+ return price;
+ }
+
+ public void setPrice(Integer price) {
+ this.price = price;
+ }
+
+ public BigDecimal getPriceMarket() {
+ return priceMarket;
+ }
+
+ public void setPriceMarket(BigDecimal priceMarket) {
+ this.priceMarket = priceMarket;
+ }
+
+ public int getDaysLive() {
+ return daysLive;
+ }
+
+ public void setDaysLive(int daysLive) {
+ this.daysLive = daysLive;
+ }
+
+ public BigDecimal getChangeSearches() {
+ return changeSearches;
+ }
+
+ public void setChangeSearches(BigDecimal changeSearches) {
+ this.changeSearches = changeSearches;
+ }
+
+ public BigDecimal getChangePrice() {
+ return changePrice;
+ }
+
+ public void setChangePrice(BigDecimal changePrice) {
+ this.changePrice = changePrice;
+ }
+
+ public BigDecimal getExposure() {
+ return exposure;
+ }
+
+ public void setExposure(BigDecimal exposure) {
+ this.exposure = exposure;
+ }
+
+ public BigDecimal getActivity() {
+ return activity;
+ }
+
+ public void setActivity(BigDecimal activity) {
+ this.activity = activity;
+ }
+
+ public BigDecimal getPrinted() {
+ return printed;
+ }
+
+ public void setPrinted(BigDecimal printed) {
+ this.printed = printed;
+ }
+
+ public BigDecimal getInquiries() {
+ return inquiries;
+ }
+
+ public void setInquiries(BigDecimal inquiries) {
+ this.inquiries = inquiries;
+ }
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/DemoInventoryList.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/DemoInventoryList.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/DemoInventoryList.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,252 @@
+package org.jboss.portal.example.web;
+
+import javax.faces.event.ActionEvent;
+import javax.faces.component.UIData;
+import java.util.List;
+import java.util.ArrayList;
+
+import org.jboss.portal.example.dao.DataFilterSliderDao;
+import org.jboss.portal.example.dao.DataFilterSliderDaoImpl;
+
+public class DemoInventoryList {
+
+ DataFilterSliderDao dataFilterSliderDao = DataFilterSliderDaoImpl.getInstance();
+
+
+ public DemoInventoryList() {
+ loadCarMakeIndex();
+ }
+
+ private List headers;
+ private List members;
+
+ // dataTableColumn Names
+ private static final String mileageColumnName = "Mileage";
+ private static final String mileageMktAvgColumnName = "+/- Mkt Avg";
+ private static final String priceColumnName = "Price";
+ private static final String priceMktAvgColumnName = "+/- Mkt Avg";
+ private static final String daysLiveColumnName = "Days Live";
+ private static final String changeSearchesColumnName = "% Change Searches";
+ private static final String changePriceColumnName = "% Change Price";
+ private static final String exposureColumnName = "Exposure";
+ private static final String activityColumnName = "Activity";
+ private static final String printedColumnName = "Printed";
+ private static final String inquiriesColumnName = "Inquiries";
+
+ private void populateHeaderList(){
+ headers = new ArrayList();
+ //headers.add("");
+ headers.add(mileageColumnName);
+ headers.add(mileageMktAvgColumnName);
+ headers.add(priceColumnName);
+ headers.add(priceMktAvgColumnName);
+ headers.add(daysLiveColumnName);
+ headers.add(changeSearchesColumnName);
+ headers.add(changePriceColumnName);
+ headers.add(exposureColumnName);
+ headers.add(activityColumnName);
+ headers.add(printedColumnName);
+ headers.add(inquiriesColumnName);
+
+
+ }
+
+ private void populateMemberList(){
+ members = new ArrayList();
+ members.add("avgMileage");
+ members.add("avgMileageMarket");
+ members.add("avgPrice");
+ members.add("avgPriceMarket");
+ members.add("avgDaysLive");
+ members.add("avgChangeSearches");
+ members.add("avgChangePrice");
+ members.add("avgExposure");
+ members.add("avgActivity");
+ members.add("avgPrinted");
+ members.add("avgInquiries");
+ }
+
+
+
+ public String getMileageColumnName() {
+ return mileageColumnName;
+ }
+
+
+ public String getMileageMktAvgColumnName() {
+ return mileageMktAvgColumnName;
+ }
+
+ public String getPriceMktAvgColumnName() {
+ return priceMktAvgColumnName;
+ }
+
+ public String getPriceColumnName() {
+ return priceColumnName;
+ }
+
+ public String getDaysLiveColumnName() {
+ return daysLiveColumnName;
+ }
+
+ public String getChangeSearchesColumnName() {
+ return changeSearchesColumnName;
+ }
+
+ public String getChangePriceColumnName() {
+ return changePriceColumnName;
+ }
+
+ public String getExposureColumnName() {
+ return exposureColumnName;
+ }
+
+ public String getActivityColumnName() {
+ return activityColumnName;
+ }
+
+ public String getPrintedColumnName() {
+ return printedColumnName;
+ }
+
+ public String getInquiriesColumnName() {
+ return inquiriesColumnName;
+ }
+
+ private List carMakeIndex;
+
+
+ public List getCarMakeIndex() {
+ System.out.println("---------------------------------getCarMakeIndex()");
+ return carMakeIndex;
+ }
+
+ public void setCarMakeIndex(List carMakeIndex) {
+ this.carMakeIndex = carMakeIndex;
+ }
+
+ private UIData carMakeIndexUIData;
+
+
+ public UIData getCarMakeIndexUIData() {
+ return carMakeIndexUIData;
+ }
+
+ public void setCarMakeIndexUIData(UIData carMakeIndexUIData) {
+ this.carMakeIndexUIData = carMakeIndexUIData;
+ }
+
+ public Object getCarInventory() {
+
+ if (uiData == null){
+ loadCarTable("1");
+ }
+
+ return getUiData().getValue();
+
+ }
+
+ protected void loadCarMakeIndex() {
+ System.out.println("---------------------------------loadCarMakeIndex()");
+ carMakeIndex = dataFilterSliderDao.getAllCarMakes();
+ }
+
+ UIData uiData;
+
+
+ public UIData getUiData() {
+ if(uiData == null){
+ uiData = new UIData();
+ }
+ return uiData;
+ }
+
+ public void setUiData(UIData uiData) {
+ this.uiData = uiData;
+ }
+
+ public void loadCarTable(String id) {
+ try{
+
+ getUiData().setValue(dataFilterSliderDao.getCarsById(id));
+
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+ }
+
+
+ private static final String carMileageColumnName = "Mileage";
+ private static final String carMileageMktAvgColumnName = "MktAvg";
+ private static final String carPriceColumnName = "Price";
+
+
+ public String getCarMileageColumnName() {
+ return carMileageColumnName;
+ }
+
+ public String getCarMileageMktAvgColumnName() {
+ return carMileageMktAvgColumnName;
+ }
+
+ public String getCarPriceColumnName() {
+ return carPriceColumnName;
+ }
+
+ private String filterValue;
+ private String filterRule;
+
+
+ public String getFilterValue() {
+ return filterValue;
+ }
+
+ public void setFilterValue(String filterValue) {
+ this.filterValue = filterValue;
+ }
+
+
+ public String getFilterRule() {
+ return filterRule;
+ }
+
+ public void setFilterRule(String filterRule) {
+ this.filterRule = filterRule;
+
+
+ }//Other Functions---------------------------------------------------------------------------------------
+ public void populateTableFromMake(){
+ loadCarTable(filterValue);
+ }
+
+ public void filterCarList(ActionEvent event) {
+
+ try{
+ filterValue = String.valueOf(carMakeIndexUIData.getRowIndex());
+ filterRule = getAttribute(event, "filterRule");
+
+ if (filterRule.equals("showTable")){
+ loadCarTable(filterValue);
+ }
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+
+
+ }
+
+ private static String getAttribute(ActionEvent event, String name) {
+ return (String) event.getComponent().getAttributes().get(name);
+ }
+
+ public int genRandom;
+
+
+ public int getGenRandom() {
+ return dataFilterSliderDao.genRand();
+ }
+
+ public void setGenRandom(int genRandom) {
+ this.genRandom = genRandom;
+ }
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/MyBean.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/MyBean.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/MyBean.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,74 @@
+package org.jboss.portal.example.web;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Wesley
+ * Date: Feb 17, 2007
+ * Time: 2:28:05 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class MyBean {
+
+ private boolean showDebugFlag;
+ private Map monthList;
+ private String selectedMonth;
+ public String firstName;
+
+ public boolean isShowDebugFlag() {
+ return showDebugFlag;
+ }
+
+ public void setShowDebugFlag(boolean showDebugFlag) {
+ this.showDebugFlag = showDebugFlag;
+ }
+
+ public Map getMonthList() {
+ if (monthList == null){
+ monthList = new HashMap();
+ monthList.put("January","January");
+ monthList.put("February","February");
+ monthList.put("March","March");
+ }
+ return monthList;
+ }
+
+ public void setMonthList(Map monthList) {
+ this.monthList = monthList;
+ }
+
+ public String getSelectedMonth() {
+ return selectedMonth;
+ }
+
+ public void setSelectedMonth(String selectedMonth) {
+ this.selectedMonth = selectedMonth;
+ }
+
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+
+
+ public String userSignup(){
+ System.out.println("------------------------------");
+ FacesContext context = FacesContext.getCurrentInstance();
+ if (firstName == null){
+ context.addMessage(null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR,"first name cannot be empty","first name cannot be empty"));
+ return "signupError";
+ }
+
+ return "signupComplete";
+ }
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScroller.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScroller.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScroller.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,609 @@
+/**
+ *
+ */
+package org.jboss.portal.example.web.component.datascroller;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIData;
+import javax.faces.component.html.HtmlPanelGroup;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ * @author Adrian Mitev
+ */
+public class AjaxDataScroller extends HtmlPanelGroup {
+
+ protected static final String COMPONENT_TYPE = "com.ac.components.AjaxDataScroller";
+
+ protected static final String COMPONENT_FAMILY = "javax.faces.Panel";
+
+ protected static final String RENDERER_TYPE = "com.ac.components.AjaxDataScrollerRenderer";
+
+ protected static final String FIRST_FACET_NAME = "first";
+
+ protected static final String LAST_FACET_NAME = "last";
+
+ protected static final String NEXT_FACET_NAME = "next";
+
+ protected static final String PREVIOUS_FACET_NAME = "previous";
+
+ protected static final String FAST_FORWARD_FACET_NAME = "fastforward";
+
+ protected static final String FAST_REWIND_FACET_NAME = "fastrewind";
+
+ private String _for;
+
+ private String tableStyleClass;
+
+ private String tableStyle;
+
+ private String selectedStyleClass;
+
+ private String selectedStyle;
+
+ private String styleClass;
+
+ private String style;
+
+ private Integer maxPages;
+
+ private Boolean renderIfSinglePage;
+
+ private Integer fastStep;
+
+ private Boolean immediate;
+
+ private Boolean ignoreDupResponses;
+
+ private String eventsQueue;
+
+ private Integer requestDelay;
+
+ private Boolean ajaxSingle;
+
+ private Boolean renderCurrentAsText;
+
+// displayedRowsCountVar
+// actionListener
+// firstRowIndexVar
+// lastRowIndexVar
+// pageCountVar
+// pageIndexVar
+// rowsCountVar
+
+ private transient UIData _UIData;
+
+ public UIData getUIData() {
+ if (_UIData == null) {
+ _UIData = getDataTable();
+ }
+ return _UIData;
+ }
+
+ /**
+ * Finds the dataTable which id is mapped to the "for" property
+ *
+ * @return the dataTable component
+ */
+ protected UIData getDataTable() {
+ String forAttribute = getFor();
+ UIComponent forComp;
+ if (forAttribute == null) {
+ // DataScroller may be a child of uiData
+ forComp = getParent();
+ }
+ else {
+ forComp = findComponent(forAttribute);
+ }
+ if (forComp == null) {
+ throw new IllegalArgumentException("could not dataTable with id '"
+ + forAttribute + "'");
+ }
+ else if (!(forComp instanceof UIData)) {
+ throw new IllegalArgumentException("component with id '" + forAttribute
+ + "' must be of type " + UIData.class.getName() + ", not type "
+ + forComp.getClass().getName());
+ }
+
+ return (UIData) forComp;
+ }
+
+ /**
+ * Gets the index of the current page
+ *
+ * @return the page index
+ */
+ public int getPageIndex() {
+ //Get the datatable
+ UIData uiData = getUIData();
+
+ int rows = uiData.getRows();
+ if (0 == rows) {
+ throw new FacesException("Missing 'rows' attribute on component '"
+ + uiData.getId() + "'");
+ }
+
+ int pageIndex;
+ if (rows > 0) {
+ pageIndex = uiData.getFirst() / rows + 1;
+ }
+ else {
+ pageIndex = 0;
+ }
+ if (uiData.getFirst() % rows > 0) {
+ pageIndex++;
+ }
+ return pageIndex;
+ }
+
+ /**
+ * Sets the page number according to the parameter recived from the
+ * commandLink
+ *
+ * @param facetName
+ */
+ public void setPage(String facetName) {
+
+ UIData dataTable = getUIData();
+
+ // check if facet is selected
+ if (FIRST_FACET_NAME.equals(facetName)) {
+ dataTable.setFirst(0);
+ }
+ else if (PREVIOUS_FACET_NAME.equals(facetName)) {
+ int previous = dataTable.getFirst() - dataTable.getRows();
+ if (previous >= 0) dataTable.setFirst(previous);
+ }
+ else if (NEXT_FACET_NAME.equals(facetName)) {
+ int next = dataTable.getFirst() + dataTable.getRows();
+ if (next < dataTable.getRowCount()) dataTable.setFirst(next);
+ }
+ else if (FAST_FORWARD_FACET_NAME.equals(facetName)) {
+ int fastStep = getFastStep().intValue();
+ if (fastStep <= 0) fastStep = 1;
+ int next = dataTable.getFirst() + dataTable.getRows() * fastStep;
+ int rowcount = dataTable.getRowCount();
+ if (next > rowcount)
+ next = (rowcount - 1) - ((rowcount - 1) % dataTable.getRows());
+ dataTable.setFirst(next);
+ }
+ else if (FAST_REWIND_FACET_NAME.equals(facetName)) {
+ int fastStep = getFastStep().intValue();
+ if (fastStep <= 0) fastStep = 1;
+ int previous = dataTable.getFirst() - dataTable.getRows() * fastStep;
+ if (previous < 0) previous = 0;
+ dataTable.setFirst(previous);
+ }
+ else if (LAST_FACET_NAME.equals(facetName)) {
+ int rowcount = dataTable.getRowCount();
+ int rows = dataTable.getRows();
+ int delta = rowcount % rows;
+ int first = delta > 0 && delta < rows ? rowcount - delta : rowcount
+ - rows;
+ if (first >= 0) {
+ dataTable.setFirst(first);
+ }
+ else {
+ dataTable.setFirst(0);
+ }
+ }
+ // the paginator is selected
+ else {
+ int pageindex = Integer.parseInt(facetName);
+ int pageCount = getPageCount();
+ if (pageindex > pageCount) {
+ pageindex = pageCount;
+ }
+ else if (pageindex <= 0) {
+ pageindex = 1;
+ }
+ dataTable.setFirst(dataTable.getRows() * (pageindex - 1));
+ }
+
+ }
+
+ /**
+ * Sets the page index
+ *
+ * @param page number
+ */
+ public void setPageIndex(int page) {
+ UIData uiData = getUIData();
+ int rows = uiData.getRows();
+ if (0 == rows) {
+ throw new FacesException("Missing 'rows' attribute on component '"
+ + uiData.getId() + "'");
+ }
+ uiData.setFirst(page * rows);
+ }
+
+ /**
+ * @return the page count of the uidata
+ */
+ public int getPageCount() {
+ UIData uiData = getUIData();
+ int rows = uiData.getRows();
+ int pageCount;
+ if (rows > 0) {
+ pageCount = rows <= 0 ? 1 : uiData.getRowCount() / rows;
+ if (uiData.getRowCount() % rows > 0) {
+ pageCount++;
+ }
+ }
+ else {
+ rows = 1;
+ pageCount = 1;
+ }
+ return pageCount;
+ }
+
+ /**
+ * @return int
+ */
+ public int getRowCount() {
+ return getUIData().getRowCount();
+ }
+
+ /**
+ * @return int
+ */
+ public int getRows() {
+ return getUIData().getRows();
+ }
+
+ // facet getter methods
+ public UIComponent getFirst() {
+ return (UIComponent) getFacet(FIRST_FACET_NAME);
+ }
+
+ public UIComponent getLast() {
+ return (UIComponent) getFacet(LAST_FACET_NAME);
+ }
+
+ public UIComponent getNext() {
+ return (UIComponent) getFacet(NEXT_FACET_NAME);
+ }
+
+ public UIComponent getFastForward() {
+ return (UIComponent) getFacet(FAST_FORWARD_FACET_NAME);
+ }
+
+ public UIComponent getFastRewind() {
+ return (UIComponent) getFacet(FAST_REWIND_FACET_NAME);
+ }
+
+ public UIComponent getPrevious() {
+ return (UIComponent) getFacet(PREVIOUS_FACET_NAME);
+ }
+
+ /**
+ * @return int
+ */
+ public int getFirstRow() {
+ return getUIData().getFirst();
+ }
+
+ public Boolean getRenderIfSinglePage() {
+ if (renderIfSinglePage == null) {
+ renderIfSinglePage = getBooleanValue(AjaxDataScrollerTag.RENDERED_IF_SINGLE_PAGE_ATTR);
+ if (renderIfSinglePage == null) {
+ renderIfSinglePage = new Boolean(true);
+ }
+ }
+ return renderIfSinglePage;
+ }
+
+ public Integer getFastStep() {
+ if (fastStep == null) {
+ fastStep = getIntegerValue(AjaxDataScrollerTag.FAST_STEP_ATTR);
+ if (fastStep == null) {
+ fastStep = new Integer(10);
+ }
+ }
+ return fastStep;
+ }
+
+ public Integer getMaxPages() {
+ if (maxPages == null) {
+ maxPages = getIntegerValue(AjaxDataScrollerTag.MAX_PAGES_ATTR);
+ if (maxPages == null) {
+ maxPages = new Integer(10);
+ }
+ }
+ return maxPages;
+ }
+
+ public Integer getRequestDelay() {
+ if (requestDelay == null) {
+ requestDelay = getIntegerValue(AjaxDataScrollerTag.REQUEST_DELAY_ATTR);
+ if (requestDelay == null) {
+ requestDelay = new Integer(0);
+ }
+ }
+ return requestDelay;
+ }
+
+ public String getFor() {
+ if (_for == null) {
+ _for = getStringValue(AjaxDataScrollerTag.FOR_ATTR);
+ }
+ return _for;
+ }
+
+ public String getTableStyleClass() {
+ if (tableStyleClass == null) {
+ tableStyleClass = getStringValue(AjaxDataScrollerTag.TABLE_STYLE_CLASS_ATTR);
+ }
+ return tableStyleClass;
+ }
+
+ public String getTableStyle() {
+ if (tableStyle == null) {
+ tableStyle = getStringValue(AjaxDataScrollerTag.TABLE_STYLE_ATTR);
+ }
+ return tableStyle;
+ }
+
+ public String getSelectedStyleClass() {
+ if (selectedStyleClass == null) {
+ selectedStyleClass = getStringValue(AjaxDataScrollerTag.SELECTED_STYLE_CLASS_ATTR);
+ }
+ return selectedStyleClass;
+ }
+
+ public String getSelectedStyle() {
+ if (selectedStyle == null) {
+ selectedStyle = getStringValue(AjaxDataScrollerTag.SELECTED_STYLE_ATTR);
+ }
+ return selectedStyle;
+ }
+
+ public String getStyleClass() {
+ if (styleClass == null) {
+ styleClass = getStringValue(AjaxDataScrollerTag.STYLE_CLASS_ATTR);
+ }
+ return styleClass;
+ }
+
+ public String getStyle() {
+ if (style == null) {
+ style = getStringValue(AjaxDataScrollerTag.STYLE_ATTR);
+ }
+ return style;
+ }
+
+ public String getEventsQueue() {
+ if (eventsQueue == null) {
+ eventsQueue = getStringValue(AjaxDataScrollerTag.EVENTS_QUEUE_ATTR);
+ }
+ return eventsQueue;
+ }
+
+ /**
+ * @return Returns the immediate.
+ */
+ public Boolean getImmediate() {
+ if (immediate == null) {
+ immediate = getBooleanValue(AjaxDataScrollerTag.IMMEDIATE_ATTR);
+ if (immediate == null) {
+ immediate = new Boolean(true);
+ }
+ }
+ return immediate;
+ }
+
+ public Boolean getAjaxSingle() {
+ if (ajaxSingle == null) {
+ ajaxSingle = getBooleanValue(AjaxDataScrollerTag.AJAX_SINGLE_ATTR);
+ if (ajaxSingle == null) {
+ ajaxSingle = new Boolean(true);
+ }
+ }
+ return ajaxSingle;
+ }
+
+ public Boolean getIgnoreDupResponses() {
+ if (ignoreDupResponses == null) {
+ ignoreDupResponses = getBooleanValue(AjaxDataScrollerTag.IGNORE_DUP_RESPONSES_ATTR);
+ if (ignoreDupResponses == null) {
+ ignoreDupResponses = new Boolean(true);
+ }
+ }
+ return ignoreDupResponses;
+ }
+
+ public Boolean getRenderCurrentAsText() {
+ if (renderCurrentAsText == null) {
+ renderCurrentAsText = getBooleanValue(AjaxDataScrollerTag.RENDER_CURRENT_AS_TEXT_ATTR);
+ if (renderCurrentAsText == null) {
+ renderCurrentAsText = new Boolean(true);
+ }
+ }
+ return renderCurrentAsText;
+ }
+
+ public Object saveState(FacesContext context) {
+ Object values[] = new Object[17];
+ values[0] = super.saveState(context);
+ values[1] = _for;
+ values[2] = tableStyleClass;
+ values[3] = tableStyle;
+ values[4] = selectedStyleClass;
+ values[5] = selectedStyle;
+ values[6] = styleClass;
+ values[7] = style;
+ values[8] = maxPages;
+ values[9] = renderIfSinglePage;
+ values[10] = fastStep;
+ values[11] = immediate;
+ values[12] = ignoreDupResponses;
+ values[13] = eventsQueue;
+ values[14] = requestDelay;
+ values[15] = ajaxSingle;
+ values[16] = renderCurrentAsText;
+ return values;
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ Object values[] = (Object[]) state;
+ super.restoreState(context, values[0]);
+ _for = (String) values[1];
+ tableStyleClass = (String) values[2];
+ tableStyle = (String) values[3];
+ selectedStyleClass = (String) values[4];
+ selectedStyle = (String) values[5];
+ styleClass = (String) values[6];
+ style = (String) values[7];
+ maxPages = (Integer) values[8];
+ renderIfSinglePage = (Boolean) values[9];
+ fastStep = (Integer) values[10];
+ immediate = (Boolean) values[11];
+ ignoreDupResponses = (Boolean) values[12];
+ eventsQueue = (String) values[13];
+ requestDelay = (Integer) values[14];
+ ajaxSingle = (Boolean) values[15];
+ renderCurrentAsText = (Boolean) values[16];
+ }
+
+ private String getStringValue(String attributeName) {
+ ValueBinding vb = getValueBinding(attributeName);
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ private Boolean getBooleanValue(String attributeName) {
+ ValueBinding vb = getValueBinding(attributeName);
+ return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ }
+
+ private Integer getIntegerValue(String attributeName) {
+ ValueBinding vb = getValueBinding(attributeName);
+ return (vb != null) ? (Integer) vb.getValue(getFacesContext()) : null;
+ }
+
+ protected FacesContext getFacesContext() {
+ return FacesContext.getCurrentInstance();
+ }
+
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public String getRendererType() {
+ return RENDERER_TYPE;
+ }
+
+ /**
+ * @param _for The _for to set.
+ */
+ public void setFor(String _for) {
+ this._for = _for;
+ }
+
+ /**
+ * @param fastStep The fastStep to set.
+ */
+ public void setFastStep(Integer fastStep) {
+ this.fastStep = fastStep;
+ }
+
+ /**
+ * @param maxPages The maxPages to set.
+ */
+ public void setMaxPages(Integer maxPages) {
+ this.maxPages = maxPages;
+ }
+
+ /**
+ * @param renderIfSinglePage The renderIfSinglePage to set.
+ */
+ public void setRenderIfSinglePage(Boolean renderIfSinglePage) {
+ this.renderIfSinglePage = renderIfSinglePage;
+ }
+
+ /**
+ * @param selectedStyle The selectedStyle to set.
+ */
+ public void setSelectedStyle(String selectedStyle) {
+ this.selectedStyle = selectedStyle;
+ }
+
+ /**
+ * @param selectedStyleClass The selectedStyleClass to set.
+ */
+ public void setSelectedStyleClass(String selectedStyleClass) {
+ this.selectedStyleClass = selectedStyleClass;
+ }
+
+ /**
+ * @param style The style to set.
+ */
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ /**
+ * @param styleClass The styleClass to set.
+ */
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ /**
+ * @param tableStyle The tableStyle to set.
+ */
+ public void setTableStyle(String tableStyle) {
+ this.tableStyle = tableStyle;
+ }
+
+ /**
+ * @param tableStyleClass The tableStyleClass to set.
+ */
+ public void setTableStyleClass(String tableStyleClass) {
+ this.tableStyleClass = tableStyleClass;
+ }
+
+ /**
+ * @param immediate The immediate to set.
+ */
+ public void setImmediate(Boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ /**
+ * @param ajaxSingle The ajaxSingle to set.
+ */
+ public void setAjaxSingle(Boolean ajaxSingle) {
+ this.ajaxSingle = ajaxSingle;
+ }
+
+ /**
+ * @param eventsQueue The eventsQueue to set.
+ */
+ public void setEventsQueue(String eventsQueue) {
+ this.eventsQueue = eventsQueue;
+ }
+
+ /**
+ * @param ignoreDupResponses The ignoreDupResponses to set.
+ */
+ public void setIgnoreDupResponses(Boolean ignoreDupResponses) {
+ this.ignoreDupResponses = ignoreDupResponses;
+ }
+
+ /**
+ * @param requestDelay The requestDelay to set.
+ */
+ public void setRequestDelay(Integer requestDelay) {
+ this.requestDelay = requestDelay;
+ }
+
+ /**
+ * @param renderCurrentAsText The renderCurrentAsText to set.
+ */
+ public void setRenderCurrentAsText(Boolean renderCurrentAsText) {
+ this.renderCurrentAsText = renderCurrentAsText;
+ }
+
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScrollerRenderer.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScrollerRenderer.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScrollerRenderer.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,276 @@
+/**
+ *
+ */
+package org.jboss.portal.example.web.component.datascroller;
+
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIForm;
+import javax.faces.component.UIParameter;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.html.HtmlCommandLink;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.component.html.HtmlPanelGrid;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.Renderer;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.Map;
+
+/**
+ * @author Adrian Mitev
+ */
+public class AjaxDataScrollerRenderer extends Renderer {
+
+ public static final String RENDERER_TYPE = AjaxDataScroller.RENDERER_TYPE;
+
+ private static final String PARAM_SUFFIX = "_parameter";
+
+ public void encodeBegin(FacesContext context, UIComponent component)
+ throws IOException {
+
+ // check if the paginator is inside UIForm
+ UIComponent form = component;
+ while (!(form instanceof UIForm) && !(form instanceof UIViewRoot))
+ form = form.getParent();
+ if (form instanceof UIViewRoot) {
+ throw new FacesException("AjaxDataScroller must be inside UIForm");
+ }
+
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement("div", null);
+ writer.writeAttribute("id", component.getClientId(context), null);
+
+ AjaxDataScroller scroller = (AjaxDataScroller) component;
+
+ // if there is a single page and renderIfSinglePage is false then return
+ if (!scroller.getRenderIfSinglePage().booleanValue()
+ && scroller.getPageCount() <= 1) return;
+
+ scroller.getChildren().clear();
+
+ HtmlPanelGrid grid = new HtmlPanelGrid();
+ grid.setId(scroller.getId() + "_table");
+
+ renderPrevFacets(context, scroller, grid);
+
+ renderPager(context, scroller, grid);
+
+ renderNextFacets(context, scroller, grid);
+
+ grid.setColumns(grid.getChildren().size());
+ scroller.getChildren().add(grid);
+ }
+
+ public void encodeEnd(FacesContext context, UIComponent component)
+ throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ writer.endElement("div");
+ }
+
+ public void decode(FacesContext context, UIComponent component) {
+
+ String param = (String) getParamMap(context).get(
+ component.getClientId(context) + PARAM_SUFFIX);
+
+ if (param != null) {
+ AjaxDataScroller scroller = (AjaxDataScroller) component;
+ scroller.setPage(param);
+ }
+
+ }
+
+ /**
+ * Renders the pager
+ *
+ * @param context
+ * @param scroller
+ * @param grid
+ */
+ private void renderPager(FacesContext context, AjaxDataScroller scroller,
+ HtmlPanelGrid grid) {
+
+ int currentPage = scroller.getPageIndex();
+
+ int maxPages = scroller.getMaxPages().intValue();
+ if (maxPages <= 1) {
+ maxPages = 2;
+ }
+ int pageCount = scroller.getPageCount();
+ if (pageCount <= 1) {
+ return;
+ }
+ int pageIndex = scroller.getPageIndex();
+ int delta = maxPages / 2;
+
+ int pages;
+ int start;
+ if (pageCount > maxPages && pageIndex > delta) {
+ pages = maxPages;
+ start = pageIndex - pages / 2 - 1;
+ if (start + pages > pageCount) {
+ start = pageCount - pages;
+ }
+ }
+ else {
+ pages = pageCount < maxPages ? pageCount : maxPages;
+ start = 0;
+ }
+ // render the pager links
+ for (int i = start, size = start + pages, j = 1; i < size; i++, j++) {
+ UIComponent link = null;
+ String styleClass;
+ String style;
+
+ boolean isCurrentPage = (i + 1 == currentPage);
+
+ if (isCurrentPage && scroller.getRenderCurrentAsText().booleanValue()) {
+ link = context.getApplication().createComponent(
+ HtmlOutputText.COMPONENT_TYPE);
+ }
+ else {
+ link = createCommandLink(context, scroller, Integer.toString(j),
+ Integer.toString(i + 1));
+ }
+
+ if (isCurrentPage) {
+ styleClass = scroller.getSelectedStyleClass();
+ style = scroller.getSelectedStyle();
+ }
+ else {
+ styleClass = scroller.getStyleClass();
+ style = scroller.getStyle();
+ }
+
+ setProperty(link, "setStyleClass", styleClass, String.class);
+ setProperty(link, "setStyle", style, String.class);
+ setProperty(link, "setValue", Integer.toString(i + 1), Object.class);
+ grid.getChildren().add(link);
+ }
+
+ }
+
+ /**
+ * Renderes the facets before tha pager
+ *
+ * @param context
+ * @param scroller
+ * @param grid
+ */
+ private void renderPrevFacets(FacesContext context,
+ AjaxDataScroller scroller, HtmlPanelGrid grid) {
+
+ resolveFacet(context, scroller, scroller.getFirst(), grid,
+ AjaxDataScroller.FIRST_FACET_NAME);
+
+ resolveFacet(context, scroller, scroller.getFastRewind(), grid,
+ AjaxDataScroller.FAST_REWIND_FACET_NAME);
+
+ resolveFacet(context, scroller, scroller.getPrevious(), grid,
+ AjaxDataScroller.PREVIOUS_FACET_NAME);
+ }
+
+ /**
+ * Renders the facets after the pager
+ *
+ * @param context
+ * @param scroller
+ * @param grid
+ */
+ private void renderNextFacets(FacesContext context,
+ AjaxDataScroller scroller, HtmlPanelGrid grid) {
+
+ resolveFacet(context, scroller, scroller.getNext(), grid,
+ AjaxDataScroller.NEXT_FACET_NAME);
+
+ resolveFacet(context, scroller, scroller.getFastForward(), grid,
+ AjaxDataScroller.FAST_FORWARD_FACET_NAME);
+
+ resolveFacet(context, scroller, scroller.getLast(), grid,
+ AjaxDataScroller.LAST_FACET_NAME);
+ }
+
+ /**
+ * Creates HtmlAjaxCommandLink and put the facet component as child.
+ *
+ * @param context
+ * @param scroller
+ * @param facet
+ * @param grid
+ * @param facetName
+ */
+ private void resolveFacet(FacesContext context, AjaxDataScroller scroller,
+ UIComponent facet, HtmlPanelGrid grid, String facetName) {
+ if (facet != null) {
+ HtmlCommandLink link = createCommandLink(context, scroller,
+ facetName, facetName);
+ facet.setId(scroller.getId() + "_facet_" + facetName);
+ facet.setParent(null);
+ link.getChildren().add(facet);
+ grid.getChildren().add(link);
+ scroller.getFacets().remove(facetName);
+ }
+ }
+
+ /**
+ * Returns request parameters map
+ *
+ * @param context FacesContext
+ * @return Parameters Map
+ */
+ private Map getParamMap(FacesContext context) {
+ return context.getExternalContext().getRequestParameterMap();
+ }
+
+ /**
+ * Creates HtmlAjaxCommandLink and sets its properties.
+ *
+ * @param context
+ * @param scroller
+ * @param id
+ * @param pageNum
+ * @return
+ */
+ private HtmlCommandLink createCommandLink(FacesContext context,
+ AjaxDataScroller scroller, String id, String pageNum) {
+ HtmlCommandLink link = (HtmlCommandLink) context.getApplication()
+ .createComponent(HtmlCommandLink.COMPONENT_TYPE);
+ link.setId(scroller.getId() + "_link_" + id);
+ link.setImmediate(scroller.getImmediate().booleanValue());
+ UIParameter param = (UIParameter) context.getApplication().createComponent(
+ UIParameter.COMPONENT_TYPE);
+ param.setId(link.getId() + PARAM_SUFFIX);
+ param.setName(scroller.getClientId(context) + PARAM_SUFFIX);
+ param.setValue(pageNum);
+ link.getChildren().add(param);
+ return link;
+ }
+
+ /**
+ * Sets invokes setter method for component property.
+ *
+ * @param component
+ * @param value
+ */
+ private void setProperty(UIComponent component, String methodName,
+ String value, Class paramType) {
+ try {
+ Method method;
+ method = component.getClass().getMethod(methodName,
+ new Class[] { paramType });
+ method.invoke(component, new Object[] { value });
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Creates HtmlAjaxCommandLink sets its id, value and reRender and UIParameter
+ */
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScrollerTag.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScrollerTag.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/datascroller/AjaxDataScrollerTag.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,440 @@
+/**
+ *
+ */
+package org.jboss.portal.example.web.component.datascroller;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.webapp.UIComponentTag;
+
+/**
+ * @author Adrian Mitev
+ */
+public class AjaxDataScrollerTag extends UIComponentTag {
+
+ protected static final String FOR_ATTR = "for";
+
+ protected static final String TABLE_STYLE_CLASS_ATTR = "tableStyleClass";
+
+ protected static final String TABLE_STYLE_ATTR = "tableStyle";
+
+ protected static final String SELECTED_STYLE_CLASS_ATTR = "selectedStyleClass";
+
+ protected static final String SELECTED_STYLE_ATTR = "selectedStyle";
+
+ protected static final String STYLE_CLASS_ATTR = "styleClass";
+
+ protected static final String STYLE_ATTR = "style";
+
+ protected static final String MAX_PAGES_ATTR = "maxPages";
+
+ protected static final String RENDERED_IF_SINGLE_PAGE_ATTR = "renderIfSinglePage";
+
+ protected static final String FAST_STEP_ATTR = "fastStep";
+
+ protected static final String IMMEDIATE_ATTR = "immediate";
+
+ protected static final String IGNORE_DUP_RESPONSES_ATTR = "ignoreDupResponses";
+
+ protected static final String EVENTS_QUEUE_ATTR = "eventsQueue";
+
+ protected static final String REQUEST_DELAY_ATTR = "requestDelay";
+
+ protected static final String AJAX_SINGLE_ATTR = "ajaxSingle";
+
+ protected static final String RENDER_CURRENT_AS_TEXT_ATTR = "renderCurrentAsText";
+
+ protected static final String ACTION_LISTENER_ATTR = "actionListener";
+
+ private String _for;
+
+ private String tableStyleClass;
+
+ private String tableStyle;
+
+ private String selectedStyleClass;
+
+ private String selectedStyle;
+
+ private String styleClass;
+
+ private String style;
+
+ private String maxPages;
+
+ private String renderIfSinglePage;
+
+ private String fastStep;
+
+ private String immediate;
+
+ private String ignoreDupResponses;
+
+ private String eventsQueue;
+
+ private String requestDelay;
+
+ private String ajaxSingle;
+
+ private String renderCurrentAsText;
+
+ private String actionListener;
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+ setStringProperty(component, FOR_ATTR, _for);
+ setStringProperty(component, TABLE_STYLE_CLASS_ATTR, tableStyleClass);
+ setStringProperty(component, TABLE_STYLE_ATTR, tableStyle);
+ setStringProperty(component, SELECTED_STYLE_CLASS_ATTR, selectedStyleClass);
+ setStringProperty(component, SELECTED_STYLE_ATTR, selectedStyle);
+ setStringProperty(component, STYLE_CLASS_ATTR, styleClass);
+ setStringProperty(component, STYLE_ATTR, style);
+ setIntegerProperty(component, MAX_PAGES_ATTR, maxPages);
+ setIntegerProperty(component, FAST_STEP_ATTR, fastStep);
+ setBooleanProperty(component, RENDERED_IF_SINGLE_PAGE_ATTR,
+ renderIfSinglePage);
+ setBooleanProperty(component, IMMEDIATE_ATTR, immediate);
+ setBooleanProperty(component, IGNORE_DUP_RESPONSES_ATTR, ignoreDupResponses);
+ setStringProperty(component, EVENTS_QUEUE_ATTR, eventsQueue);
+ setIntegerProperty(component, REQUEST_DELAY_ATTR, requestDelay);
+ setBooleanProperty(component, AJAX_SINGLE_ATTR, ajaxSingle);
+ setBooleanProperty(component, RENDER_CURRENT_AS_TEXT_ATTR,
+ renderCurrentAsText);
+ }
+
+ public void release() {
+ super.release();
+ _for = null;
+ tableStyleClass = null;
+ tableStyle = null;
+ selectedStyleClass = null;
+ selectedStyle = null;
+ styleClass = null;
+ style = null;
+ maxPages = null;
+ renderIfSinglePage = null;
+ fastStep = null;
+ immediate = null;
+ ignoreDupResponses = null;
+ eventsQueue = null;
+ requestDelay = null;
+ ajaxSingle = null;
+ renderCurrentAsText = null;
+ }
+
+ protected void setStringProperty(UIComponent component, String attributeName,
+ String attributeValue) {
+ if (attributeValue != null) {
+ if (isValueReference(attributeValue)) {
+ component.setValueBinding(attributeName,
+ getValueBinging(attributeValue));
+ }
+ else {
+ component.getAttributes().put(attributeName, attributeValue);
+ }
+ }
+ }
+
+ protected void setIntegerProperty(UIComponent component,
+ String attributeName, String attributeValue) {
+ if (attributeValue != null) {
+ if (isValueReference(attributeValue)) {
+ component.setValueBinding(attributeName,
+ getValueBinging(attributeValue));
+ }
+ else {
+ component.getAttributes().put(attributeName,
+ Integer.valueOf(attributeValue));
+ }
+ }
+ }
+
+ protected void setBooleanProperty(UIComponent component,
+ String attributeName, String attributeValue) {
+ if (attributeValue != null) {
+ if (isValueReference(attributeValue)) {
+ component.setValueBinding(attributeName,
+ getValueBinging(attributeValue));
+ }
+ else {
+ component.getAttributes().put(attributeName,
+ Boolean.valueOf(attributeValue));
+ }
+ }
+ }
+
+ /**
+ * Gets value binding for given expression
+ *
+ * @param expression The expression
+ * @return ValueBinging object
+ */
+ protected ValueBinding getValueBinging(String expression) {
+ return FacesContext.getCurrentInstance().getApplication()
+ .createValueBinding(expression);
+ }
+
+ public String getComponentType() {
+ return AjaxDataScroller.COMPONENT_TYPE;
+ }
+
+ public String getRendererType() {
+ return AjaxDataScroller.RENDERER_TYPE;
+ }
+
+ /**
+ * @return Returns the _for.
+ */
+ public String getFor() {
+ return _for;
+ }
+
+ /**
+ * @param _for The _for to set.
+ */
+ public void setFor(String _for) {
+ this._for = _for;
+ }
+
+ /**
+ * @return Returns the _for.
+ */
+ public String get_for() {
+ return _for;
+ }
+
+ /**
+ * @param _for The _for to set.
+ */
+ public void set_for(String _for) {
+ this._for = _for;
+ }
+
+ /**
+ * @return Returns the fastStep.
+ */
+ public String getFastStep() {
+ return fastStep;
+ }
+
+ /**
+ * @param fastStep The fastStep to set.
+ */
+ public void setFastStep(String fastStep) {
+ this.fastStep = fastStep;
+ }
+
+ /**
+ * @return Returns the maxPages.
+ */
+ public String getMaxPages() {
+ return maxPages;
+ }
+
+ /**
+ * @param maxPages The maxPages to set.
+ */
+ public void setMaxPages(String maxPages) {
+ this.maxPages = maxPages;
+ }
+
+ /**
+ * @return Returns the renderIfSinglePage.
+ */
+ public String getRenderIfSinglePage() {
+ return renderIfSinglePage;
+ }
+
+ /**
+ * @param renderIfSinglePage The renderIfSinglePage to set.
+ */
+ public void setRenderIfSinglePage(String renderIfSinglePage) {
+ this.renderIfSinglePage = renderIfSinglePage;
+ }
+
+ /**
+ * @return Returns the selectedStyle.
+ */
+ public String getSelectedStyle() {
+ return selectedStyle;
+ }
+
+ /**
+ * @param selectedStyle The selectedStyle to set.
+ */
+ public void setSelectedStyle(String selectedStyle) {
+ this.selectedStyle = selectedStyle;
+ }
+
+ /**
+ * @return Returns the selectedStyleClass.
+ */
+ public String getSelectedStyleClass() {
+ return selectedStyleClass;
+ }
+
+ /**
+ * @param selectedStyleClass The selectedStyleClass to set.
+ */
+ public void setSelectedStyleClass(String selectedStyleClass) {
+ this.selectedStyleClass = selectedStyleClass;
+ }
+
+ /**
+ * @return Returns the style.
+ */
+ public String getStyle() {
+ return style;
+ }
+
+ /**
+ * @param style The style to set.
+ */
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ /**
+ * @return Returns the styleClass.
+ */
+ public String getStyleClass() {
+ return styleClass;
+ }
+
+ /**
+ * @param styleClass The styleClass to set.
+ */
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ /**
+ * @return Returns the tableStyle.
+ */
+ public String getTableStyle() {
+ return tableStyle;
+ }
+
+ /**
+ * @param tableStyle The tableStyle to set.
+ */
+ public void setTableStyle(String tableStyle) {
+ this.tableStyle = tableStyle;
+ }
+
+ /**
+ * @return Returns the tableStyleClass.
+ */
+ public String getTableStyleClass() {
+ return tableStyleClass;
+ }
+
+ /**
+ * @param tableStyleClass The tableStyleClass to set.
+ */
+ public void setTableStyleClass(String tableStyleClass) {
+ this.tableStyleClass = tableStyleClass;
+ }
+
+ /**
+ * @return Returns the immediate.
+ */
+ public String getImmediate() {
+ return immediate;
+ }
+
+ /**
+ * @param immediate The immediate to set.
+ */
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ /**
+ * @return Returns the ajaxSingle.
+ */
+ public String getAjaxSingle() {
+ return ajaxSingle;
+ }
+
+ /**
+ * @param ajaxSingle The ajaxSingle to set.
+ */
+ public void setAjaxSingle(String ajaxSingle) {
+ this.ajaxSingle = ajaxSingle;
+ }
+
+ /**
+ * @return Returns the eventsQueue.
+ */
+ public String getEventsQueue() {
+ return eventsQueue;
+ }
+
+ /**
+ * @param eventsQueue The eventsQueue to set.
+ */
+ public void setEventsQueue(String eventsQueue) {
+ this.eventsQueue = eventsQueue;
+ }
+
+ /**
+ * @return Returns the ignoreDupResponses.
+ */
+ public String getIgnoreDupResponses() {
+ return ignoreDupResponses;
+ }
+
+ /**
+ * @param ignoreDupResponses The ignoreDupResponses to set.
+ */
+ public void setIgnoreDupResponses(String ignoreDupResponses) {
+ this.ignoreDupResponses = ignoreDupResponses;
+ }
+
+ /**
+ * @return Returns the requestDelay.
+ */
+ public String getRequestDelay() {
+ return requestDelay;
+ }
+
+ /**
+ * @param requestDelay The requestDelay to set.
+ */
+ public void setRequestDelay(String requestDelay) {
+ this.requestDelay = requestDelay;
+ }
+
+ /**
+ * @return Returns the renderCurrentAsText.
+ */
+ public String getRenderCurrentAsText() {
+ return renderCurrentAsText;
+ }
+
+ /**
+ * @param renderCurrentAsText The renderCurrentAsText to set.
+ */
+ public void setRenderCurrentAsText(String renderCurrentAsText) {
+ this.renderCurrentAsText = renderCurrentAsText;
+ }
+
+
+ /**
+ * @return Returns the actionListener.
+ */
+ public String getActionListener() {
+ return actionListener;
+ }
+
+
+ /**
+ * @param actionListener The actionListener to set.
+ */
+ public void setActionListener(String actionListener) {
+ this.actionListener = actionListener;
+ }
+
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/action/MyShowListener.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/action/MyShowListener.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/action/MyShowListener.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,16 @@
+package org.jboss.portal.example.web.component.deck.action;
+
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowEvent;
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowListener;
+
+
+public class MyShowListener implements ShowListener {
+ public void processShow(
+ ShowEvent event)
+ {
+ String oldShowItemId = event.getOldShowItemId();
+ String newShowItemId = event.getNewShowItemId();
+ System.out.println("MyShowListener [oldShowItemId=" + oldShowItemId + "," +
+ "newShowItemId=" + newShowItemId + "]");
+ }
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/action/ShowOneDeckBean.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/action/ShowOneDeckBean.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/action/ShowOneDeckBean.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,30 @@
+package org.jboss.portal.example.web.component.deck.action;
+
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowEvent;
+
+
+/**
+ * ShowOneDeckBean is a backing bean for showOneDeck.jspx document.
+ */
+public class ShowOneDeckBean
+{
+ /**
+ * The ShowListener method binding.
+ *
+ * @param event the show event
+ */
+ public void doShow(ShowEvent event)
+ {
+ try{
+
+ String oldShowItemId = event.getOldShowItemId();
+ String newShowItemId = event.getNewShowItemId();
+ System.out.println("BackingBean [oldShowItemId=" + oldShowItemId + "," +
+ "newShowItemId=" + newShowItemId + "]");
+
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+
+ }
+}
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/ProShowOneDeck.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/ProShowOneDeck.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/ProShowOneDeck.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,220 @@
+package org.jboss.portal.example.web.component.deck.jsf.component;
+
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowAdapter;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.el.MethodBinding;
+
+/**
+ * The ProShowOneDeck renderer-specific component.
+ */
+public class ProShowOneDeck extends UIShowOne
+{
+ /**
+ * The component type for this component.
+ */
+ public static final String COMPONENT_TYPE = "org.jboss.portal.example.ProShowOneDeck";
+
+ /**
+ * The renderer type for this component.
+ */
+ public static final String RENDERER_TYPE = "org.jboss.portal.example.Deck";
+
+ /**
+ * Creates a new ProShowOneDeck.
+ */
+ public ProShowOneDeck()
+ {
+ setRendererType(RENDERER_TYPE);
+ }
+
+
+ public void setShowListener(MethodBinding binding) {
+ this.showListener = showListener;
+ addShowListener(new ShowAdapter(binding));
+ }
+
+ /**
+ * Sets the CSS style class.
+ *
+ * @param styleClass the new style class
+ */
+ public void setStyleClass(
+ String styleClass)
+ {
+ _styleClass = styleClass;
+ }
+
+ /**
+ * Returns the CSS style class.
+ *
+ * @return the style class
+ */
+ public String getStyleClass()
+ {
+ if (_styleClass != null)
+ return _styleClass;
+
+ ValueBinding binding = getValueBinding("styleClass");
+ if (binding != null)
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ return (String)binding.getValue(context);
+ }
+
+ return null;
+ }
+
+ /**
+ * Sets the CSS item style class.
+ *
+ * @param itemStyleClass the new item style class
+ */
+ public void setItemStyleClass(
+ String itemStyleClass)
+ {
+ _itemStyleClass = itemStyleClass;
+ }
+
+ /**
+ * Returns the CSS item style class.
+ *
+ * @return the item style class
+ */
+ public String getItemStyleClass()
+ {
+ if (_itemStyleClass != null)
+ return _itemStyleClass;
+
+ ValueBinding binding = getValueBinding("itemStyleClass");
+ if (binding != null)
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ return (String)binding.getValue(context);
+ }
+
+ return null;
+ }
+
+ /**
+ * Sets the CSS style class for the item header facet.
+ *
+ * @param itemHeaderStyleClass the new style class for the item header facet
+ */
+ public void setItemHeaderStyleClass(
+ String itemHeaderStyleClass)
+ {
+ _itemHeaderStyleClass = itemHeaderStyleClass;
+ }
+
+ /**
+ * Returns the CSS style class for the header facet.
+ *
+ * @return the style class for the header facet
+ */
+ public String getItemHeaderStyleClass()
+ {
+ if (_itemHeaderStyleClass != null)
+ return _itemHeaderStyleClass;
+
+ ValueBinding binding = getValueBinding("itemHeaderStyleClass");
+ if (binding != null)
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ return (String)binding.getValue(context);
+ }
+
+ return null;
+ }
+
+ /**
+ * Sets the CSS style class for the item content.
+ *
+ * @param itemContentStyleClass the new style class for the item content
+ */
+ public void setItemContentStyleClass(
+ String itemContentStyleClass)
+ {
+ _itemContentStyleClass = itemContentStyleClass;
+ }
+
+ /**
+ * Returns the CSS style class for the item content.
+ *
+ * @return the style class for the item content
+ */
+ public String getItemContentStyleClass()
+ {
+ if (_itemContentStyleClass != null)
+ return _itemContentStyleClass;
+
+ ValueBinding binding = getValueBinding("contentStyleClass");
+ if (binding != null)
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ return (String)binding.getValue(context);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the saved state for this component.
+ *
+ * @param context the Faces context
+ */
+ public Object saveState(
+ FacesContext context)
+ {
+ Object values[] = new Object[5];
+ values[0] = super.saveState(context);
+ values[1] = _styleClass;
+ values[2] = _itemStyleClass;
+ values[3] = _itemHeaderStyleClass;
+ values[4] = _itemContentStyleClass;
+
+ return values;
+ }
+
+ /**
+ * Restores the state of this component.
+ *
+ * @param context the Faces context
+ * @param state the saved state
+ */
+ public void restoreState(
+ FacesContext context,
+ Object state)
+ {
+ Object values[] = (Object[])state;
+ super.restoreState(context, values[0]);
+ _styleClass = (String)values[1];
+ _itemStyleClass = (String)values[2];
+ _itemHeaderStyleClass = (String)values[3];
+ _itemContentStyleClass = (String)values[4];
+ //sliderListener = (MethodBinding) values[10];
+ }
+
+ /**
+ * The styleClass attribute value.
+ */
+ private String _styleClass;
+
+ /**
+ * The itemStyleClass attribute value.
+ */
+ private String _itemStyleClass;
+
+ /**
+ * The itemHeaderStyleClass attribute value.
+ */
+ private String _itemHeaderStyleClass;
+
+ /**
+ * The itemContentStyleClass attribute value.
+ */
+ private String _itemContentStyleClass;
+
+ private MethodBinding showListener;
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/ShowSource.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/ShowSource.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/ShowSource.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,32 @@
+package org.jboss.portal.example.web.component.deck.jsf.component;
+
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowListener;
+
+/**
+ * A ShowSource is the source of ShowEvents.
+ */
+public interface ShowSource
+{
+ /**
+ * Adds a ShowListener to this ShowSource.
+ *
+ * @param listener the show listener to be added
+ */
+ public void addShowListener(
+ ShowListener listener);
+
+ /**
+ * Removes a ShowListener from this ShowSource.
+ *
+ * @param listener the show listener to be removed
+ */
+ public void removeShowListener(
+ ShowListener listener);
+
+ /**
+ * Returns all ShowListeners for this ShowSource.
+ *
+ * @return the show listener array
+ */
+ public org.jboss.portal.example.web.component.deck.jsf.event.ShowListener[] getShowListeners();
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/UIShowItem.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/UIShowItem.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/UIShowItem.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,59 @@
+package org.jboss.portal.example.web.component.deck.jsf.component;
+
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+
+/**
+ * The UIShowItem component.
+ */
+public class UIShowItem extends UIComponentBase
+{
+ /**
+ * The component type for this component.
+ */
+ public static final String COMPONENT_TYPE = "org.jboss.portal.example.ShowItem";
+
+ /**
+ * The component family for this component.
+ */
+ public static final String COMPONENT_FAMILY = "org.jboss.portal.example.ShowItem";
+
+ /**
+ * Creates a new UIShowItem.
+ */
+ public UIShowItem()
+ {
+ }
+
+ /**
+ * Returns the component family for this component.
+ *
+ * @return the component family
+ */
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+
+ /**
+ * Returns the header facet.
+ *
+ * @return the header facet
+ */
+ public UIComponent getHeader()
+ {
+ return getFacet("header");
+ }
+
+ /**
+ * Sets a new header facet.
+ *
+ * @param header the new header facet
+ */
+ public void setHeader(
+ UIComponent header)
+ {
+ getFacets().put("header", header);
+ }
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/UIShowOne.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/UIShowOne.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/component/UIShowOne.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,164 @@
+package org.jboss.portal.example.web.component.deck.jsf.component;
+
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowListener;
+
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import java.util.Iterator;
+import java.util.List;
+
+
+/**
+ * The UIShowOne behavioral component.
+ */
+public class UIShowOne extends UIComponentBase
+ implements ShowSource, NamingContainer
+{
+ /**
+ * The component type for this component.
+ */
+ public static final String COMPONENT_TYPE = "org.jboss.portal.example.ShowOne";
+
+ /**
+ * The component family for this component.
+ */
+ public static final String COMPONENT_FAMILY = "org.jboss.portal.example.ShowOne";
+
+ /**
+ * Creates a new UIShowOne.
+ */
+ public UIShowOne()
+ {
+ }
+
+ /**
+ * Returns the component family for this component.
+ *
+ * @return the component family
+ */
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+
+ /**
+ * Sets the show item child id to show.
+ *
+ * @param showItemId the new show item child id to show.
+ */
+ public void setShowItemId(
+ String showItemId)
+ {
+ _showItemId = showItemId;
+ }
+
+ /**
+ * Returns the show item child id to show.
+ *
+ * @return the show item child id to show
+ */
+ public String getShowItemId()
+ {
+ if (_showItemId != null)
+ return _showItemId;
+
+ ValueBinding binding = getValueBinding("showItemId");
+ if (binding != null)
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ return (String)binding.getValue(context);
+ }
+
+ return null;
+ }
+
+ /**
+ * Adds a ShowListener to this UIShowOne component.
+ *
+ * @param listener the show listener to be added
+ */
+ public void addShowListener(
+ ShowListener listener)
+ {
+ addFacesListener(listener);
+ }
+
+ /**
+ * Removes a ShowListener to this UIShowOne component.
+ *
+ * @param listener the show listener to be removed
+ */
+ public void removeShowListener(
+ ShowListener listener)
+ {
+ removeFacesListener(listener);
+ }
+
+ /**
+ * Returns all ShowListeners for this UIShowOne component.
+ *
+ * @return the show listener array
+ */
+ public ShowListener[] getShowListeners()
+ {
+ return (ShowListener[])getFacesListeners(ShowListener.class);
+ }
+
+ /**
+ * Returns the saved state for this component.
+ *
+ * @param context the Faces context
+ */
+ public Object saveState(
+ FacesContext context)
+ {
+ Object values[] = new Object[2];
+ values[0] = super.saveState(context);
+ values[1] = _showItemId;
+ return values;
+ }
+
+ /**
+ * Restores the state of this component.
+ *
+ * @param context the Faces context
+ * @param state the saved state
+ */
+ public void restoreState(
+ FacesContext context,
+ Object state)
+ {
+ Object values[] = (Object[])state;
+ super.restoreState(context, values[0]);
+ _showItemId = (String)values[1];
+ }
+
+ public void processDecodes(
+ FacesContext context)
+ {
+ if (context == null)
+ throw new NullPointerException();
+
+ if (!isRendered())
+ return;
+ System.out.println("------------------------processDecodes");
+ String showItemId = getShowItemId();
+ if (showItemId != null && getChildCount() > 0)
+ {
+ List children = getChildren();
+ for (Iterator iter = children.iterator(); iter.hasNext();)
+ {
+ UIShowItem showItem = (UIShowItem)iter.next();
+ if (showItemId.equals(showItem.getId()))
+ showItem.processDecodes(context);
+ }
+ }
+
+ // decode the showOne component last
+ decode(context);
+ }
+
+ private String _showItemId;
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowAdapter.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowAdapter.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowAdapter.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,96 @@
+package org.jboss.portal.example.web.component.deck.jsf.event;
+
+import javax.faces.component.StateHolder;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+
+/**
+ * The ShowAdapter calls a MethodBinding with the same signature
+ * as the <code>processShow</code> method.
+ */
+public class ShowAdapter implements ShowListener,
+ StateHolder
+{
+ public static Class[] SIGNATURE = new Class[] { ShowEvent.class };
+
+ /**
+ * Creates a new ShowAdapter.
+ *
+ * @param showMethod the MethodBinding to adapt
+ */
+ public ShowAdapter(
+ MethodBinding showMethod)
+ {
+ _showMethod = showMethod;
+ }
+
+
+ public ShowAdapter(){
+
+ }
+ /**
+ * Processes a ShowEvent.
+ *
+ * @param event the show event
+ */
+ public void processShow(
+ ShowEvent event)
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ _showMethod.invoke(context, new Object[]{event});
+ }
+
+ /**
+ * Saves the internal state of this ShowAdapter.
+ *
+ * @param context the Faces context
+ *
+ * @return the saved state
+ */
+ public Object saveState(
+ FacesContext context)
+ {
+ return UIComponentBase.saveAttachedState(context, _showMethod);
+ }
+
+ /**
+ * Restores the internal state of this ShowAdapter.
+ *
+ * @param context the Faces context
+ * @param object the state to restore
+ */
+ public void restoreState(
+ FacesContext context,
+ Object object)
+ {
+ _showMethod = (MethodBinding)
+ UIComponentBase.restoreAttachedState(context, object);
+ }
+
+ /**
+ * Returns true if this ShowAdapter is transient and should
+ * not be state saved, otherwise false.
+ *
+ * @return the value of transient
+ */
+ public boolean isTransient()
+ {
+ return _transient;
+ }
+
+ /**
+ * Indicates whether or not this ShowAdapter is transient and should
+ * not be state saved.
+ *
+ * @param isTransient the new value for transient
+ */
+ public void setTransient(
+ boolean isTransient)
+ {
+ _transient = isTransient;
+ }
+
+ private MethodBinding _showMethod;
+ private boolean _transient;
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowEvent.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowEvent.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowEvent.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,72 @@
+package org.jboss.portal.example.web.component.deck.jsf.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+import javax.faces.event.PhaseId;
+
+/**
+ * The ShowEvent event.
+ */
+public class ShowEvent extends FacesEvent {
+ /**
+ * Creates a new ShowEvent.
+ *
+ * @param source the source of the event
+ * @param oldShowItemId the previously showing item identifier
+ * @param newShowItemId the currently showing item identifier
+ */
+ public ShowEvent(
+ UIComponent source,
+ String oldShowItemId,
+ String newShowItemId)
+ {
+ super(source);
+ setPhaseId(PhaseId.INVOKE_APPLICATION);
+ _oldShowItemId = oldShowItemId;
+ _newShowItemId = newShowItemId;
+ }
+
+ /**
+ * Returns the previously showing item id.
+ *
+ * @return the old show item id
+ */
+ public String getOldShowItemId()
+ {
+ return _oldShowItemId;
+ }
+
+ /**
+ * Returns the newly showing item id.
+ *
+ * @return the new show item id
+ */
+ public String getNewShowItemId()
+ {
+ return _newShowItemId;
+ }
+
+ /**
+ * Returns true if the listener is a ShowListener.
+ *
+ * @param listener the listener to check
+ */
+ public boolean isAppropriateListener(FacesListener listener)
+ {
+ return (listener instanceof ShowListener);
+ }
+
+ /**
+ * Delivers this event to the ShowListener.
+ *
+ * @param listener the show listener
+ */
+ public void processListener(FacesListener listener)
+ {
+ ((ShowListener) listener).processShow(this);
+ }
+
+ private String _oldShowItemId;
+ private String _newShowItemId;
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowListener.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowListener.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/event/ShowListener.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,18 @@
+package org.jboss.portal.example.web.component.deck.jsf.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * The ShowListener listener.
+ */
+public interface ShowListener extends FacesListener
+{
+ /**
+ * Processes a ShowEvent.
+ *
+ * @param event the show event
+ */
+ public void processShow(
+ ShowEvent event);
+}
+
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/handler/ShowListenerTagHandler.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/handler/ShowListenerTagHandler.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/handler/ShowListenerTagHandler.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,71 @@
+package org.jboss.portal.example.web.component.deck.jsf.handler;
+
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.FaceletContext;
+import org.jboss.portal.example.web.component.deck.jsf.component.ShowSource;
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowListener;
+
+import javax.faces.component.UIComponent;
+import javax.faces.FacesException;
+import javax.el.ELException;
+import java.util.Map;
+import java.util.HashMap;
+import java.io.IOException;
+
+/**
+ * @author Wesley Hales
+ */
+public class ShowListenerTagHandler extends TagHandler {
+
+
+ private final TagAttribute type;
+
+ private Map addedMap = new HashMap();
+
+ /**
+ * @param config
+ */
+ public ShowListenerTagHandler(TagConfig config) {
+ super(config);
+
+ this.type = this.getRequiredAttribute("type");
+
+ }
+
+ /**
+ * Threadsafe Method for controlling evaluation of
+ * its child tags, represented by "nextHandler"
+ */
+ public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, ELException {
+
+ boolean b = this.type.getBoolean(ctx);
+
+ if (!addedMap.containsKey(type.getValue())){
+ ShowSource showSource = (ShowSource)parent;
+ ShowListener listener = createShowListener(type.getValue());
+ addedMap.put(type.getValue(),true);
+ showSource.addShowListener(listener);
+ }
+
+ if (b) {
+ this.nextHandler.apply(ctx, parent);
+ }
+ }
+
+ protected ShowListener createShowListener(
+ String className) {
+ Class clazz = null;
+ try {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ clazz = loader.loadClass(className);
+ return ((ShowListener) clazz.newInstance());
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+
+ }
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/handler/ShowOneDeckTagHandler.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/handler/ShowOneDeckTagHandler.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/handler/ShowOneDeckTagHandler.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,50 @@
+package org.jboss.portal.example.web.component.deck.jsf.handler;
+
+import com.sun.facelets.tag.jsf.html.HtmlComponentHandler;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.MethodRule;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.el.LegacyMethodBinding;
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowEvent;
+import org.jboss.portal.example.web.component.deck.jsf.component.ProShowOneDeck;
+
+
+import javax.faces.el.MethodBinding;
+
+/**
+ * @author Wesley Hales
+ */
+
+public class ShowOneDeckTagHandler extends HtmlComponentHandler {
+
+ protected final static Class[] ACTION_METHOD_SIG = new Class[0];
+ protected final static MethodRule typeTagRule
+ = new MethodRule("showListener", String.class, ACTION_METHOD_SIG);
+ static final Class[] METHOD_BINDING_SIGNATURE = {ShowEvent.class};
+
+ static final String METHOD_BINDING_ATTR_NAME = "showListener";
+
+ public ShowOneDeckTagHandler(ComponentConfig tagConfig)
+ {
+ super(tagConfig);
+ }
+
+ protected void setAttributes(FaceletContext ctx, Object instance) {
+ super.setAttributes(ctx, instance);
+ try {
+ final ProShowOneDeck component = (ProShowOneDeck) instance;
+ final TagAttribute tagAttribute = ShowOneDeckTagHandler.this.getAttribute(METHOD_BINDING_ATTR_NAME);
+ if (null != tagAttribute) {
+ final MethodBinding methodBinding = new LegacyMethodBinding(tagAttribute.getMethodExpression(ctx, null, METHOD_BINDING_SIGNATURE));
+ component.setShowListener(methodBinding);
+ }
+ } catch (Exception e) {
+ throw new TagException(ShowOneDeckTagHandler.this.tag, e);
+ }
+
+
+ }
+
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/html/HtmlRenderer.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/html/HtmlRenderer.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/html/HtmlRenderer.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,200 @@
+package org.jboss.portal.example.web.component.deck.jsf.render.html;
+
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.Renderer;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * HtmlRenderer is a base class for all Renderers that output HTML markup.
+ */
+public class HtmlRenderer extends Renderer
+{
+ /**
+ * Begins the encoded output for this component.
+ *
+ * @param context the Faces context
+ * @param component the Faces component
+ *
+ * @throws IOException if an I/O error occurs during rendering
+ */
+ public void encodeBegin(
+ FacesContext context,
+ UIComponent component) throws IOException
+ {
+ // write out resources
+ encodeResources(context, component);
+ }
+
+ /**
+ * Override hook for subclasses to write out their resources.
+ *
+ * @param context the Faces context
+ * @param component the Faces component
+ */
+ protected void encodeResources(
+ FacesContext context,
+ UIComponent component) throws IOException
+ {
+ // empty hook for subclasses to override as needed
+ }
+
+ /**
+ * Writes a script library resource at-most-once within a single
+ * RenderResponse phase.
+ *
+ * @param context the Faces context
+ * @param resourcePath the script library resource path
+ *
+ * @throws IOException if an error occurs during rendering
+ */
+ protected void writeScriptResource(
+ FacesContext context,
+ String resourcePath) throws IOException
+ {
+ Set scriptResources = _getScriptResourcesAlreadyWritten(context);
+
+ // Set.add() returns true only if item was added to the set
+ // and returns false if item was already present in the set
+ if (scriptResources.add(resourcePath))
+ {
+ ViewHandler handler = context.getApplication().getViewHandler();
+ String resourceURL = handler.getResourceURL(context, resourcePath);
+ ResponseWriter out = context.getResponseWriter();
+ out.startElement("script", null);
+ out.writeAttribute("type", "text/javascript", null);
+ out.writeAttribute("src", resourceURL, null);
+ out.endElement("script");
+ }
+ }
+
+ /**
+ * Writes an inline script at-most-once within a single
+ * RenderResponse phase.
+ *
+ * @param context the Faces context
+ * @param inlineScript the inline script code
+ *
+ * @throws IOException if an error occurs during rendering
+ */
+ protected void writeScriptInline(
+ FacesContext context,
+ String inlineScript) throws IOException
+ {
+ Set scriptResources = _getScriptResourcesAlreadyWritten(context);
+
+ // Set.add() returns true only if item was added to the set
+ // and returns false if item was already present in the set
+ if (scriptResources.add(inlineScript))
+ {
+ ResponseWriter out = context.getResponseWriter();
+ out.startElement("script", null);
+ out.writeAttribute("type", "text/javascript", null);
+ out.writeText(inlineScript, null);
+ out.endElement("script");
+ }
+ }
+
+ /**
+ * Writes a stylesheet resource at-most-once within a single
+ * RenderResponse phase.
+ *
+ * @param context the Faces context
+ * @param resourcePath the stylesheet resource path
+ *
+ * @throws IOException if an error occurs during rendering
+ */
+ protected void writeStyleResource(
+ FacesContext context,
+ String resourcePath) throws IOException
+ {
+ Set styleResources = _getStyleResourcesAlreadyWritten(context);
+
+ // Set.add() returns true only if item was added to the set
+ // and returns false if item was already present in the set
+ if (styleResources.add(resourcePath))
+ {
+ ViewHandler handler = context.getApplication().getViewHandler();
+ String resourceURL = handler.getResourceURL(context, resourcePath);
+ ResponseWriter out = context.getResponseWriter();
+ out.startElement("style", null);
+ out.writeAttribute("type", "text/css", null);
+ out.writeText("@import url(" + resourceURL + ");", null);
+ out.endElement("style");
+ }
+ }
+
+ /**
+ * Writes an inline style at-most-once within a single
+ * RenderResponse phase.
+ *
+ * @param context the Faces context
+ * @param inlineStyle the inline style classes
+ *
+ * @throws IOException if an error occurs during rendering
+ */
+ protected void writeStyleInline(
+ FacesContext context,
+ String inlineStyle) throws IOException
+ {
+ Set styleResources = _getStyleResourcesAlreadyWritten(context);
+
+ // Set.add() returns true only if item was added to the set
+ // and returns false if item was already present in the set
+ if (styleResources.add(inlineStyle))
+ {
+ ResponseWriter out = context.getResponseWriter();
+ out.startElement("style", null);
+ out.writeAttribute("type", "text/css", null);
+ out.writeText(inlineStyle, null);
+ out.endElement("style");
+ }
+ }
+
+ // Implements at-most-once semantics for each script resource on
+ // the currently rendering page
+ private Set _getScriptResourcesAlreadyWritten(
+ FacesContext context)
+ {
+ ExternalContext external = context.getExternalContext();
+ Map requestScope = external.getRequestMap();
+ Set written = (Set)requestScope.get(_SCRIPT_RESOURCES_KEY);
+
+ if (written == null)
+ {
+ written = new HashSet();
+ requestScope.put(_SCRIPT_RESOURCES_KEY, written);
+ }
+
+ return written;
+ }
+
+ // Implements at-most-once semantics for each style resource on
+ // the currently rendering page
+ private Set _getStyleResourcesAlreadyWritten(
+ FacesContext context)
+ {
+ ExternalContext external = context.getExternalContext();
+ Map requestScope = external.getRequestMap();
+ Set written = (Set)requestScope.get(_STYLE_RESOURCES_KEY);
+
+ if (written == null)
+ {
+ written = new HashSet();
+ requestScope.put(_STYLE_RESOURCES_KEY, written);
+ }
+
+ return written;
+ }
+
+ static private final String _STYLE_RESOURCES_KEY =
+ HtmlRenderer.class.getName() + ".STYLES_WRITTEN";
+ static private final String _SCRIPT_RESOURCES_KEY =
+ HtmlRenderer.class.getName() + ".SCRIPTS_WRITTEN";
+}
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/html/basic/HtmlShowOneDeckRenderer.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/html/basic/HtmlShowOneDeckRenderer.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/jsf/render/html/basic/HtmlShowOneDeckRenderer.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,282 @@
+package org.jboss.portal.example.web.component.deck.jsf.render.html.basic;
+
+import org.jboss.portal.example.web.component.deck.jsf.component.UIShowItem;
+import org.jboss.portal.example.web.component.deck.jsf.component.UIShowOne;
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowEvent;
+import org.jboss.portal.example.web.component.deck.jsf.render.html.HtmlRenderer;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIForm;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Renders the UIShowOne component as a deck.
+ */
+public class HtmlShowOneDeckRenderer extends HtmlRenderer {
+ /**
+ * The styleClass attribute.
+ */
+ public static String STYLE_CLASS_ATTR = "styleClass";
+
+ /**
+ * The itemStyleClass attribute.
+ */
+ public static String ITEM_STYLE_CLASS_ATTR = "itemStyleClass";
+
+ /**
+ * The itemHeaderStyleClass attribute.
+ */
+ public static String ITEM_HEADER_STYLE_CLASS_ATTR = "itemHeaderStyleClass";
+
+ /**
+ * The itemContentStyleClass attribute.
+ */
+ public static String ITEM_CONTENT_STYLE_CLASS_ATTR = "itemContentStyleClass";
+
+ /**
+ * Begins the encoded output for this component.
+ *
+ * @param context the Faces context
+ * @param component the Faces component
+ *
+ * @throws IOException if an I/O error occurs during rendering
+ */
+ public void encodeBegin(
+ FacesContext context,
+ UIComponent component) throws IOException
+ {
+ // first write out resources
+ super.encodeBegin(context, component);
+ System.out.println("------------------------encodeBegin");
+ ResponseWriter out = context.getResponseWriter();
+ out.startElement("div", component);
+ Map attrs = component.getAttributes();
+ String styleClass = (String)attrs.get(STYLE_CLASS_ATTR);
+ if (styleClass != null)
+ out.writeAttribute("class", styleClass, STYLE_CLASS_ATTR);
+ }
+
+ /**
+ * Encodes the UIShowItem children of this UIShowOne component.
+ *
+ * @param context the Faces context
+ * @param component the Faces component
+ *
+ * @throws IOException if an I/O error occurs during rendering
+ */
+ public void encodeChildren(
+ FacesContext context,
+ UIComponent component) throws IOException
+ {
+ if (component.getChildCount() > 0)
+ {
+ UIShowOne showOne = (UIShowOne)component;
+ String showItemId = showOne.getShowItemId();
+
+ // the renderer-specific attributes
+ Map attrs = showOne.getAttributes();
+ String itemStyleClass = (String)attrs.get(ITEM_STYLE_CLASS_ATTR);
+ if (itemStyleClass == null)
+ itemStyleClass = "ProShowItem";
+ String itemHeaderStyleClass = (String)
+ attrs.get(ITEM_HEADER_STYLE_CLASS_ATTR);
+ if (itemHeaderStyleClass == null)
+ itemHeaderStyleClass = "ProShowItemHeader";
+ String itemContentStyleClass = (String)
+ attrs.get(ITEM_CONTENT_STYLE_CLASS_ATTR);
+ if (itemContentStyleClass == null)
+ itemContentStyleClass = "ProShowItemContent";
+
+ String formClientId = _findFormClientId(context, component);
+ String showOneClientId = component.getClientId(context);
+ List children = component.getChildren();
+ for (Iterator iter = children.iterator(); iter.hasNext();)
+ {
+ UIComponent child = (UIComponent) iter.next();
+ if (child instanceof UIShowItem)
+ {
+ UIShowItem showItem = (UIShowItem)child;
+ String id = showItem.getId();
+
+ boolean isActive = id.equals(showItemId);
+ ResponseWriter out = context.getResponseWriter();
+ out.startElement("div", showItem);
+ out.writeAttribute("class", itemStyleClass,
+ ITEM_STYLE_CLASS_ATTR);
+
+ out.startElement("div", null);
+ out.writeAttribute("class", itemHeaderStyleClass,
+ ITEM_HEADER_STYLE_CLASS_ATTR);
+
+ if (formClientId != null)
+ {
+ out.writeAttribute("onclick",
+ "_showOneDeck_click('" + formClientId + "'," +
+ "'" + showOneClientId + "'," +
+ "'" + id + "')",
+ null);
+ }
+
+ // Default the header text
+ UIComponent header = showItem.getHeader();
+ if (header != null)
+ {
+ _encodeAll(context, header);
+ }
+ else
+ {
+ out.writeText("Header", null);
+ }
+
+ out.endElement("div");
+
+ if (isActive)
+ {
+ out.startElement("div", null);
+ out.writeAttribute("class", itemContentStyleClass,
+ ITEM_CONTENT_STYLE_CLASS_ATTR);
+ List kids = showItem.getChildren();
+ Iterator it = kids.iterator();
+ while (it.hasNext())
+ {
+ UIComponent kid = (UIComponent)it.next();
+ _encodeAll(context, kid);
+ }
+ out.endElement("div");
+ }
+
+ out.endElement("div");
+ }
+ }
+ }
+ }
+
+ /**
+ * Completes the encoded output for this component.
+ *
+ * @param context the Faces context
+ * @param component the Faces component
+ *
+ * @throws IOException if an I/O error occurs during rendering
+ */
+ public void encodeEnd(
+ FacesContext context,
+ UIComponent component) throws IOException
+ {
+ ResponseWriter out = context.getResponseWriter();
+ out.endElement("div");
+ }
+
+ /**
+ * Indicates that this Renderer is responsible for rendering any
+ * child components.
+ */
+ public boolean getRendersChildren()
+ {
+ return true;
+ }
+
+ /**
+ * Write out the HtmlShowOneDeck resources.
+ *
+ * @param context the Faces context
+ * @param component the Faces component
+ */
+ protected void encodeResources(
+ FacesContext context,
+ UIComponent component) throws IOException
+ {
+ writeScriptResource(context, "/js/showOneDeck.js");
+ writeStyleResource(context, "/css/showOneDeck.css");
+ }
+
+ /**
+ * Decodes the incoming request to detect the ShowEvent.
+ *
+ * @param context the Faces context
+ * @param component the Faces component
+ */
+ public void decode(
+ FacesContext context,
+ UIComponent component)
+ {
+ System.out.println("------------------------decode");
+ ExternalContext external = context.getExternalContext();
+ Map requestParams = external.getRequestParameterMap();
+ String clientId = component.getClientId(context);
+ String newShowItemId = (String)requestParams.get(clientId);
+ if (newShowItemId != null && newShowItemId.length() > 0)
+ {
+ UIShowOne showOne = (UIShowOne)component;
+ String oldShowItemId = showOne.getShowItemId();
+ if (!newShowItemId.equals(oldShowItemId))
+ {
+ showOne.setShowItemId(newShowItemId);
+ ShowEvent event = new ShowEvent(showOne, oldShowItemId, newShowItemId);
+ event.queue();
+ }
+ }
+ }
+
+ /**
+ * Encodes a component and all of it's children.
+ *
+ * Note: a new method, UIComponent._encodeAll(FacesContext) has been added
+ * to JSF 1.2 and implements equivalent functionality to this method.
+ *
+ * @param context the Faces context
+ * @param component the Faces component
+ *
+ * @throws IOException if an I/O error occurs during rendering
+ */
+ private void _encodeAll(
+ FacesContext context,
+ UIComponent component) throws IOException
+ {
+ component.encodeBegin(context);
+ if (component.getRendersChildren())
+ {
+ component.encodeChildren(context);
+ }
+ else
+ {
+ List kids = component.getChildren();
+ Iterator it = kids.iterator();
+ while (it.hasNext())
+ {
+ UIComponent kid = (UIComponent)it.next();
+ _encodeAll(context, kid);
+ }
+ }
+ component.encodeEnd(context);
+ }
+
+ /**
+ * Finds the parent UIForm component client identifier.
+ *
+ * @param context the Faces context
+ * @param component the Faces component
+ *
+ * @return the parent UIForm client identifier, if present, otherwise null
+ */
+ private String _findFormClientId(
+ FacesContext context,
+ UIComponent component)
+ {
+ while (component != null &&
+ !(component instanceof UIForm))
+ {
+ component = component.getParent();
+ }
+
+ return (component != null) ? component.getClientId(context) : null;
+ }
+
+}
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ProShowOneDeckTag.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ProShowOneDeckTag.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ProShowOneDeckTag.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,154 @@
+package org.jboss.portal.example.web.component.deck.taglib;
+
+import org.jboss.portal.example.web.component.deck.jsf.component.ProShowOneDeck;
+import org.jboss.portal.example.web.component.deck.jsf.component.UIShowOne;
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowAdapter;
+
+import javax.faces.component.UIComponent;
+import javax.faces.el.MethodBinding;
+
+
+/**
+ * ProShowOneDeckTag component tag handler.
+ */
+public class ProShowOneDeckTag extends UIComponentTagSupport
+{
+ /**
+ * Returns the component type.
+ *
+ * @return the component type
+ */
+ public String getComponentType()
+ {
+ return ProShowOneDeck.COMPONENT_TYPE;
+ }
+
+ /**
+ * Returns the renderer type.
+ *
+ * @return the renderer type
+ */
+ public String getRendererType()
+ {
+ return ProShowOneDeck.RENDERER_TYPE;
+ }
+
+ /**
+ * Sets the showItemId attribute value.
+ *
+ * @param showItemId the currently showing item identifer
+ */
+ public void setShowItemId(
+ String showItemId)
+ {
+ _showItemId = showItemId;
+ }
+
+ /**
+ * Sets the showListener attribute value.
+ *
+ * @param showListener the showListener attribute value
+ */
+ public void setShowListener(
+ String showListener)
+ {
+ System.out.println("-----------------------------3");
+ _showListener = showListener;
+ }
+
+ /**
+ * Sets the CSS style class.
+ *
+ * @param styleClass the new style class
+ */
+ public void setStyleClass(String styleClass)
+ {
+ _styleClass = styleClass;
+ }
+
+ /**
+ * Sets the item CSS style class.
+ *
+ * @param itemStyleClass the new item style class
+ */
+ public void setItemStyleClass(
+ String itemStyleClass)
+ {
+ _itemStyleClass = itemStyleClass;
+ }
+
+ /**
+ * Sets the CSS style class for the item header facet.
+ *
+ * @param itemHeaderStyleClass the new style class for the item header facet
+ */
+ public void setItemHeaderStyleClass(
+ String itemHeaderStyleClass)
+ {
+ _itemHeaderStyleClass = itemHeaderStyleClass;
+ }
+
+ /**
+ * Sets the CSS style class for the item content.
+ *
+ * @param itemContentStyleClass the new style class for the item content
+ */
+ public void setItemContentStyleClass(
+ String itemContentStyleClass)
+ {
+ _itemContentStyleClass = itemContentStyleClass;
+ }
+
+ /**
+ * Releases the internal state used by the tag.
+ */
+ public void release()
+ {
+ _showItemId = null;
+ System.out.println("-----------------------------4");
+ _showListener = null;
+ _styleClass = null;
+ _itemStyleClass = null;
+ _itemHeaderStyleClass = null;
+ _itemContentStyleClass = null;
+ }
+
+ /**
+ * Transfers the property values from this tag to the component.
+ *
+ * @param component the target component
+ */
+ protected void setProperties(
+ UIComponent component)
+ {
+ super.setProperties(component);
+
+ // Behavioral properties
+ setStringProperty(component, "showItemId", _showItemId);
+ System.out.println("-----------------------------1");
+ // Behavioral listeners
+ if (_showListener != null)
+ {
+ UIShowOne showOne = (UIShowOne) component;
+ MethodBinding showMethod = createMethodBinding(_showListener,
+ ShowAdapter.SIGNATURE);
+ System.out.println("----------------------------2");
+ showOne.addShowListener(new ShowAdapter(showMethod));
+
+ }
+
+ // Renderer-specific attributes
+ setStringProperty(component, "styleClass", _styleClass);
+ setStringProperty(component, "itemStyleClass", _itemStyleClass);
+ setStringProperty(component, "itemHeaderStyleClass", _itemHeaderStyleClass);
+ setStringProperty(component, "itemContentStyleClass", _itemContentStyleClass);
+
+ }
+
+ private String _showItemId;
+ private String _showListener;
+ private String _styleClass;
+ private String _itemStyleClass;
+ private String _itemHeaderStyleClass;
+ private String _itemContentStyleClass;
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ShowItemTag.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ShowItemTag.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ShowItemTag.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,30 @@
+package org.jboss.portal.example.web.component.deck.taglib;
+
+import org.jboss.portal.example.web.component.deck.jsf.component.UIShowItem;
+
+
+/**
+ * ShowItemTag is the UIShowItem component tag handler.
+ */
+public class ShowItemTag extends UIComponentTagSupport
+{
+ /**
+ * Returns the component type.
+ *
+ * @return the component type
+ */
+ public String getComponentType()
+ {
+ return UIShowItem.COMPONENT_TYPE;
+ }
+
+ /**
+ * Returns the renderer type.
+ *
+ * @return the renderer type
+ */
+ public String getRendererType()
+ {
+ return null;
+ }
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ShowListenerTag.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ShowListenerTag.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/ShowListenerTag.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,109 @@
+package org.jboss.portal.example.web.component.deck.taglib;
+
+
+import org.jboss.portal.example.web.component.deck.jsf.component.ShowSource;
+import org.jboss.portal.example.web.component.deck.jsf.event.ShowListener;
+
+import javax.faces.application.Application;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.webapp.UIComponentTag;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+
+/**
+ * ShowListenerTag listener tag handler.
+ */
+public class ShowListenerTag extends TagSupport
+{
+ /**
+ * Sets the fully qualified class name of the
+ * {@link org.jboss.portal.example.web.component.deck.jsf.event.ShowListener} instance to be created.
+ *
+ * @param type the class name
+ */
+ public void setType(
+ String type)
+ {
+ _type = type;
+ }
+
+
+ /**
+ * Attaches a {@link org.jboss.portal.example.web.component.deck.jsf.event.ShowListener} to the surrounding {@link UIComponent}.
+ *
+ * @return SKIP_BODY, always
+ *
+ * @throws JspException if an error condition occurs
+ */
+ public int doStartTag() throws JspException
+ {
+ UIComponentTag tag = UIComponentTag.getParentUIComponentTag(pageContext);
+ if (tag == null)
+ throw new JspException("Not inside UIComponentTag");
+
+ if (tag.getCreated())
+ {
+ UIComponent component = tag.getComponentInstance();
+ if (component == null)
+ throw new JspException("Component instance is null");
+ if (!(component instanceof ShowSource))
+ throw new JspException("Component is not a ShowSource");
+
+ ShowSource showSource = (ShowSource)component;
+ String className = _type;
+
+ if (UIComponentTag.isValueReference(_type))
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ Application application = context.getApplication();
+ ValueBinding vb = application.createValueBinding(_type);
+ className = (String)vb.getValue(context);
+ }
+
+ ShowListener listener = createShowListener(className);
+ showSource.addShowListener(listener);
+ }
+
+ return (SKIP_BODY);
+ }
+
+ /**
+ * Release resources.
+ */
+ public void release()
+ {
+ _type = null;
+ }
+
+ /**
+ * Create and return a new {@link ShowListener} to be registered
+ * on the surrounding {@link UIComponent}.
+ *
+ * @throws JspException if a new listener instance cannot be created
+ */
+ protected ShowListener createShowListener(
+ String className) throws JspException
+ {
+ try
+ {
+
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class clazz = loader.loadClass(className);
+ return ((ShowListener) clazz.newInstance());
+ }
+ catch (Exception e)
+ {
+ throw new JspException(e);
+ }
+ }
+
+ /**
+ * The fully qualified class name of the {@link ShowListener}
+ * instance to be created.
+ */
+ private String _type;
+}
+
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/UIComponentTagSupport.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/UIComponentTagSupport.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/component/deck/taglib/UIComponentTagSupport.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,137 @@
+package org.jboss.portal.example.web.component.deck.taglib;
+
+import javax.faces.application.Application;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.ValueBinding;
+import javax.faces.webapp.UIComponentTag;
+import java.util.Map;
+
+/**
+ * UIComponentTagSupport provides common helper methods for
+ * JavaServer Faces UIComponent tag handlers.
+ */
+abstract public class UIComponentTagSupport extends UIComponentTag
+{
+ /**
+ * Sets a component string property as a value binding, or string literal.
+ *
+ * @param component the Faces component
+ * @param attrName the attribute name
+ * @param value the attribute value
+ */
+ protected void setStringProperty(
+ UIComponent component,
+ String attrName,
+ String value)
+ {
+ if (value == null)
+ return;
+
+ if (isValueReference(value))
+ {
+ component.setValueBinding(attrName, createValueBinding(value));
+ }
+ else
+ {
+ component.getAttributes().put(attrName, value);
+ }
+ }
+
+ /**
+ * Sets a component boolean property as a value binding, or boolean literal.
+ *
+ * @param component the Faces component
+ * @param attrName the attribute name
+ * @param value the attribute value
+ */
+ protected void setBooleanProperty(
+ UIComponent component,
+ String attrName,
+ String value)
+ {
+ if (value == null)
+ return;
+
+ if (isValueReference(value))
+ {
+ component.setValueBinding(attrName, createValueBinding(value));
+ }
+ else
+ {
+ component.getAttributes().put(attrName, Boolean.valueOf(value));
+ }
+ }
+
+ /**
+ * Sets a component property as a value binding.
+ *
+ * @param component the Faces component
+ * @param attrName the attribute name
+ * @param value the attribute value
+ */
+ protected void setValueBindingProperty(
+ UIComponent component,
+ String attrName,
+ String value)
+ {
+ if (value == null)
+ return;
+
+ component.setValueBinding(attrName, createValueBinding(value));
+ }
+
+ /**
+ * Sets a component property as a method binding.
+ *
+ * @param component the Faces component
+ * @param attrName the attribute name
+ * @param value the attribute value
+ * @param signature the method signature
+ */
+ protected void setMethodBindingProperty(
+ UIComponent component,
+ String attrName,
+ String value,
+ Class[] signature)
+ {
+ if (value == null)
+ return;
+
+ Map attrs = component.getAttributes();
+ attrs.put(attrName, createMethodBinding(value, signature));
+ }
+
+ /**
+ * Returns a ValueBinding for the string value.
+ *
+ * @param value the attribute string value
+ *
+ * @return a parsed ValueBinding
+ */
+ protected ValueBinding createValueBinding(
+ String value)
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ Application application = context.getApplication();
+ return application.createValueBinding(value);
+ }
+
+ /**
+ * Returns a MethodBinding for the string value.
+ *
+ * @param value the attribute string value
+ * @param signature the method binding signature
+ *
+ * @return a parsed MethodBinding
+ */
+ protected MethodBinding createMethodBinding(
+ String value,
+ Class[] signature)
+ {
+ FacesContext context = FacesContext.getCurrentInstance();
+ Application application = context.getApplication();
+ return application.createMethodBinding(value, signature);
+ }
+}
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/listener/DemoListener.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/listener/DemoListener.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/org/jboss/portal/example/web/listener/DemoListener.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,115 @@
+package org.jboss.portal.example.web.listener;
+
+import javax.faces.event.PhaseListener;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseEvent;
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletOutputStream;
+import java.io.InputStream;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.Map;
+import java.net.URL;
+
+public class DemoListener implements PhaseListener {
+
+ private static final String RESOURCE_LOADER_VIEW_ID = ".resource";
+
+ private static final String RESOURCE_FOLDER = "/META-INF";
+
+ public void beforePhase(PhaseEvent event) {
+ //No-op
+ }
+
+ public PhaseId getPhaseId() {
+ return PhaseId.RESTORE_VIEW;
+ }
+
+ public void afterPhase(PhaseEvent event) {
+ FacesContext facesContext = event.getFacesContext();
+ String viewRootId = facesContext.getViewRoot().getViewId();
+ System.out.println("--------------------------------viewRootId.indexOf(RESOURCE_LOADER_VIEW_ID) != -1 " + (viewRootId.indexOf(RESOURCE_LOADER_VIEW_ID) != -1));
+ if (viewRootId.indexOf(RESOURCE_LOADER_VIEW_ID) != -1) {
+ serveResource(facesContext);
+ }
+ }
+
+ private void serveResource(FacesContext facesContext) {
+ Map requestMap = facesContext.getExternalContext().getRequestParameterMap();
+
+
+ String resourceName = getResourceName(requestMap);
+ String resourceType = getResourceType(resourceName);
+ String contentType = getContentType(resourceType);
+
+ int indice, tempIndice;
+ byte tempArr[];
+ byte mainArr[] = new byte[0];
+ byte byteArr[] = new byte[65535];
+
+ HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
+
+ try {
+ String resourcePath = RESOURCE_FOLDER + "/" + resourceName;
+ System.out.println("--------------------------------resourcePath" + resourcePath);
+ InputStream inputStream = DemoListener.class.getResourceAsStream(resourcePath);
+ URL url = DemoListener.class.getResource(resourcePath);
+ if (url == null) {
+ // resource not found
+ facesContext.responseComplete();
+
+ return;
+ }
+
+ InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
+ BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
+
+ response.setContentType(contentType);
+ response.setStatus(200);
+ ServletOutputStream outputStream = response.getOutputStream();
+
+ for(indice = 0; (indice = inputStream.read(byteArr)) > 0;) {
+ tempIndice = mainArr.length + indice;
+ tempArr = new byte[tempIndice];
+ System.arraycopy(mainArr, 0, tempArr, 0, mainArr.length);
+ System.arraycopy(byteArr, 0, tempArr, mainArr.length, indice);
+ mainArr = tempArr;
+ }
+
+ outputStream.write(mainArr);
+ outputStream.flush();
+ outputStream.close();
+
+ facesContext.responseComplete();
+ }
+ catch (Exception exception) {
+ exception.printStackTrace();
+ }
+ }
+
+ public static String getResourceName(Map requestMap) {
+ String resourceName = (String) requestMap.get("name");
+ System.out.println("--------------------------------resourceName" + resourceName);
+ return resourceName;
+ }
+
+ public static String getResourceType(String resourceName) {
+ String resourceType = resourceName.substring(resourceName.lastIndexOf('.') + 1, resourceName.length());
+ return resourceType;
+ }
+
+ public static String getContentType(String resourceType) {
+ String contentType = null;
+ if(resourceType.equals("js"))
+ contentType = "text/javascript";
+ else if(resourceType.equals("css"))
+ contentType = "text/css";
+ else if(resourceType.equals("jpg"))
+ contentType = "image/jpeg";
+ else if (resourceType.equals("gif"))
+ contentType = "image/gif";
+
+ return contentType;
+ }
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/portal/Bean.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/portal/Bean.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/portal/Bean.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,57 @@
+/**
+ *
+ */
+package portal;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class Bean {
+ private int counter=0;
+
+ private String text ="";
+
+ public Bean() {
+ text="start";
+ counter=1;
+ }
+ /**
+ * @return the counter
+ */
+ public int getCounter() {
+ return counter;
+ }
+
+ /**
+ * @param counter the counter to set
+ */
+ public void setCounter(int counter) {
+ this.counter = counter;
+ }
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String click(){
+ counter++;
+ return null;
+ }
+
+ public String getNamespace(){
+ return FacesContext.getCurrentInstance().getExternalContext().encodeNamespace("");
+ }
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/java/portal/TestPortlet.java
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/java/portal/TestPortlet.java (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/java/portal/TestPortlet.java 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package portal;
+
+import javax.portlet.faces.GenericFacesPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSession;
+import javax.faces.context.FacesContext;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:whales at redhat.com">Wesley Hales</a>
+ * @version $Revision: 630 $
+ */
+public class TestPortlet extends GenericFacesPortlet {
+
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/META-INF/2_6_DR_ss1.gif
===================================================================
(Binary files differ)
Property changes on: portlets/src/framework/JSFRIPortlet/src/main/resources/META-INF/2_6_DR_ss1.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/faces-config.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/resources/faces-config.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/resources/faces-config.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,289 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+
+<faces-config>
+
+ <application>
+ <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
+ </application>
+
+
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>portal.Bean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>deckBean</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.example.web.component.deck.action.ShowOneDeckBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>inventoryList</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.example.web.DemoInventoryList</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>myBean</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.example.web.MyBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <lifecycle>
+ <phase-listener>org.jboss.portal.example.web.listener.DemoListener</phase-listener>
+ </lifecycle>
+
+ <navigation-rule>
+ <navigation-case>
+ <from-action>inventoryList</from-action>
+ <to-view-id>/inventory/inventoryList.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-action>home</from-action>
+ <to-view-id>/deck/deck.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-action>panelGrid</from-action>
+ <to-view-id>/panelGrid/demo.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-action>phaseListener</from-action>
+ <to-view-id>/phase/listener.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-action>signupForm</from-action>
+ <to-view-id>/signup/form.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <!--####################Deck Component########################-->
+ <component>
+ <component-type>
+ org.jboss.portal.example.ProShowOneDeck
+ </component-type>
+ <component-class>
+ org.jboss.portal.example.web.component.deck.jsf.component.ProShowOneDeck
+ </component-class>
+
+ <!-- UIComponent attributes -->
+ <attribute>
+ <description>
+ The component identifier for this component. This value must be
+ unique within the closest parent component that is a naming
+ container.
+ </description>
+ <attribute-name>id</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+ <attribute>
+ <description>
+ Flag indicating whether or not this component should be rendered
+ (during Render Response Phase), or processed on any subsequent
+ form submit.
+ </description>
+ <attribute-name>rendered</attribute-name>
+ <attribute-class>java.lang.Boolean</attribute-class>
+ <default-value>true</default-value>
+ </attribute>
+ <attribute>
+ <description>
+ The value binding expression linking this component to a
+ property in a backing bean.
+ </description>
+ <attribute-name>binding</attribute-name>
+ <attribute-class>javax.faces.el.ValueBinding</attribute-class>
+ </attribute>
+
+ <!-- UIShowOne attributes -->
+ <attribute>
+ <description>
+ The currently active showItem identifier.
+ </description>
+ <attribute-name>showItemId</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+
+ <!-- ProShowOneDeck attributes -->
+ <attribute>
+ <description>
+ The styleClass for this ProShowOneDeck component.
+ </description>
+ <attribute-name>styleClass</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+
+ <attribute>
+ <description>
+ The itemStyleClass for the UIShowItems.
+ </description>
+ <attribute-name>itemStyleClass</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+ <attribute>
+ <description>
+ The itemHeaderStyleClass for the UIShowItems.
+ </description>
+ <attribute-name>itemHeaderStyleClass</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+ <attribute>
+ <description>
+ The itemContentStyleClass for the UIShowItems.
+ </description>
+ <attribute-name>itemContentStyleClass</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+
+ </component>
+
+ <component>
+ <component-type>
+ org.jboss.portal.example.ShowOne
+ </component-type>
+ <component-class>
+ org.jboss.portal.example.web.component.deck.jsf.component.UIShowOne
+ </component-class>
+
+ <!-- UIComponent attributes -->
+ <attribute>
+ <description>
+ The component identifier for this component. This value must be
+ unique within the closest parent component that is a naming
+ container.
+ </description>
+ <attribute-name>id</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+ <attribute>
+ <description>
+ Flag indicating whether or not this component should be rendered
+ (during Render Response Phase), or processed on any subsequent
+ form submit.
+ </description>
+ <attribute-name>rendered</attribute-name>
+ <attribute-class>java.lang.Boolean</attribute-class>
+ <default-value>true</default-value>
+ </attribute>
+ <attribute>
+ <description>
+ The value binding expression linking this component to a
+ property in a backing bean.
+ </description>
+ <attribute-name>binding</attribute-name>
+ <attribute-class>javax.faces.el.ValueBinding</attribute-class>
+ </attribute>
+
+ <!-- UIShowOne attributes -->
+ <attribute>
+ <description>
+ The currently active showItem identifier.
+ </description>
+ <attribute-name>showItemId</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+
+ </component>
+
+ <component>
+ <component-type>
+ org.jboss.portal.example.ShowItem
+ </component-type>
+ <component-class>
+ org.jboss.portal.example.web.component.deck.jsf.component.UIShowItem
+ </component-class>
+
+ <!-- UIShowItem facets -->
+ <!--<facet>-->
+ <!--<description>The header of the showItem component.</description>-->
+ <!--<display-name>header</display-name>-->
+ <!--<facet-name>header</facet-name>-->
+ <!--<facet-extension>-->
+ <!--<facet-metadata>-->
+ <!--<preferred-children>h:outputText h:graphicImage</preferred-children>-->
+ <!--</facet-metadata>-->
+ <!--</facet-extension>-->
+ <!--</facet>-->
+
+ <!-- UIComponent attributes -->
+ <attribute>
+ <description>
+ The component identifier for this component. This value must be
+ unique within the closest parent component that is a naming
+ container.
+ </description>
+ <attribute-name>id</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+ <attribute>
+ <description>
+ Flag indicating whether or not this component should be rendered
+ (during Render Response Phase), or processed on any subsequent
+ form submit.
+ </description>
+ <attribute-name>rendered</attribute-name>
+ <attribute-class>java.lang.Boolean</attribute-class>
+ <default-value>true</default-value>
+ </attribute>
+ <attribute>
+ <description>
+ The value binding expression linking this component to a
+ property in a backing bean.
+ </description>
+ <attribute-name>binding</attribute-name>
+ <attribute-class>javax.faces.el.ValueBinding</attribute-class>
+ </attribute>
+
+ <!-- UIShowItem attributes (none) -->
+
+ </component>
+
+ <!--a4j datascroller-->
+ <component>
+ <component-type>
+ com.ac.components.AjaxDataScroller
+ </component-type>
+ <component-class>
+ org.jboss.portal.example.web.component.datascroller.AjaxDataScroller
+ </component-class>
+ </component>
+
+
+ <!--a4j datascroller-->
+
+ <render-kit>
+ <!-- no renderkit-id, so these renderers are added to
+ the default renderkit -->
+ <renderer>
+ <component-family>org.jboss.portal.example.ShowOne</component-family>
+ <renderer-type>org.jboss.portal.example.Deck</renderer-type>
+ <renderer-class>org.jboss.portal.example.web.component.deck.jsf.render.html.basic.HtmlShowOneDeckRenderer
+ </renderer-class>
+ </renderer>
+
+ <!--<renderer>
+ <description>Replacement renderer for h:panelGrid that uses lists instead of tables</description>
+ <component-family>javax.faces.Panel</component-family>
+ <renderer-type>javax.faces.Grid</renderer-type>
+ <renderer-class>org.jboss.portal.example.custom.renderer.PanelGridRenderer</renderer-class>
+ </renderer>-->
+
+ <renderer>
+ <component-family>javax.faces.Panel</component-family>
+ <renderer-type>
+ com.ac.components.AjaxDataScrollerRenderer
+ </renderer-type>
+ <renderer-class>
+ org.jboss.portal.example.web.component.datascroller.AjaxDataScrollerRenderer
+ </renderer-class>
+ </renderer>
+
+ </render-kit>
+
+
+</faces-config>
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/commons-logging.properties
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/commons-logging.properties (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/commons-logging.properties 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1 @@
+org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/log4j.dtd
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/log4j.dtd (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/log4j.dtd 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!-- Authors: Chris Taylor, Ceki Gulcu. -->
+
+<!-- Version: 1.2 -->
+
+<!-- A configuration element consists of optional renderer
+elements,appender elements, categories and an optional root
+element. -->
+
+<!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?,
+ categoryFactory?)>
+
+<!-- The "threshold" attribute takes a level value such that all -->
+<!-- logging statements with a level equal or below this value are -->
+<!-- disabled. -->
+
+<!-- Setting the "debug" enable the printing of internal log4j logging -->
+<!-- statements. -->
+
+<!-- By default, debug attribute is "null", meaning that we not do touch -->
+<!-- internal log4j logging settings. The "null" value for the threshold -->
+<!-- attribute can be misleading. The threshold field of a repository -->
+<!-- cannot be set to null. The "null" value for the threshold attribute -->
+<!-- simply means don't touch the threshold field, the threshold field -->
+<!-- keeps its old value. -->
+
+<!ATTLIST log4j:configuration
+ xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/"
+ threshold (all|debug|info|warn|error|fatal|off|null) "null"
+ debug (true|false|null) "null"
+>
+
+<!-- renderer elements allow the user to customize the conversion of -->
+<!-- message objects to String. -->
+
+<!ELEMENT renderer EMPTY>
+<!ATTLIST renderer
+ renderedClass CDATA #REQUIRED
+ renderingClass CDATA #REQUIRED
+>
+
+<!-- Appenders must have a name and a class. -->
+<!-- Appenders may contain an error handler, a layout, optional parameters -->
+<!-- and filters. They may also reference (or include) other appenders. -->
+<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)>
+<!ATTLIST appender
+ name ID #REQUIRED
+ class CDATA #REQUIRED
+>
+
+<!ELEMENT layout (param*)>
+<!ATTLIST layout
+ class CDATA #REQUIRED
+>
+
+<!ELEMENT filter (param*)>
+<!ATTLIST filter
+ class CDATA #REQUIRED
+>
+
+<!-- ErrorHandlers can be of any class. They can admit any number of -->
+<!-- parameters. -->
+
+<!ELEMENT errorHandler (param*, root-ref?, logger-ref*, appender-ref?)>
+<!ATTLIST errorHandler
+ class CDATA #REQUIRED
+>
+
+<!ELEMENT root-ref EMPTY>
+
+<!ELEMENT logger-ref EMPTY>
+<!ATTLIST logger-ref
+ ref IDREF #REQUIRED
+>
+
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+ name CDATA #REQUIRED
+ value CDATA #REQUIRED
+>
+
+
+<!-- The priority class is org.apache.log4j.Level by default -->
+<!ELEMENT priority (param*)>
+<!ATTLIST priority
+ class CDATA #IMPLIED
+ value CDATA #REQUIRED
+>
+
+<!-- The level class is org.apache.log4j.Level by default -->
+<!ELEMENT level (param*)>
+<!ATTLIST level
+ class CDATA #IMPLIED
+ value CDATA #REQUIRED
+>
+
+
+<!-- If no level element is specified, then the configurator MUST not -->
+<!-- touch the level of the named category. -->
+<!ELEMENT category (param*,(priority|level)?,appender-ref*)>
+<!ATTLIST category
+ class CDATA #IMPLIED
+ name CDATA #REQUIRED
+ additivity (true|false) "true"
+>
+
+<!-- If no level element is specified, then the configurator MUST not -->
+<!-- touch the level of the named logger. -->
+<!ELEMENT logger (level?,appender-ref*)>
+<!ATTLIST logger
+ name ID #REQUIRED
+ additivity (true|false) "true"
+>
+
+
+<!ELEMENT categoryFactory (param*)>
+<!ATTLIST categoryFactory
+ class CDATA #REQUIRED>
+
+<!ELEMENT appender-ref EMPTY>
+<!ATTLIST appender-ref
+ ref IDREF #REQUIRED
+>
+
+<!-- If no priority element is specified, then the configurator MUST not -->
+<!-- touch the priority of root. -->
+<!-- The root category always exists and cannot be subclassed. -->
+<!ELEMENT root (param*, (priority|level)?, appender-ref*)>
+
+
+<!-- ==================================================================== -->
+<!-- A logging event -->
+<!-- ==================================================================== -->
+<!ELEMENT log4j:eventSet (log4j:event*)>
+<!ATTLIST log4j:eventSet
+ xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/"
+ version (1.1|1.2) "1.2"
+ includesLocationInfo (true|false) "true"
+>
+
+
+
+<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?,
+ log4j:locationInfo?) >
+
+<!-- The timestamp format is application dependent. -->
+<!ATTLIST log4j:event
+ logger CDATA #REQUIRED
+ level CDATA #REQUIRED
+ thread CDATA #REQUIRED
+ timestamp CDATA #REQUIRED
+>
+
+<!ELEMENT log4j:message (#PCDATA)>
+<!ELEMENT log4j:NDC (#PCDATA)>
+
+<!ELEMENT log4j:throwable (#PCDATA)>
+
+<!ELEMENT log4j:locationInfo EMPTY>
+<!ATTLIST log4j:locationInfo
+ class CDATA #REQUIRED
+ method CDATA #REQUIRED
+ file CDATA #REQUIRED
+ line CDATA #REQUIRED
+>
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/log4j.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/log4j.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/resources/log4j/log4j.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration debug="false" >
+
+ <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <!--<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %-5x %-26c{1} - %m%n"/>-->
+ <param name="ConversionPattern" value="%-5p %c{1} - %m%n"/>
+ </layout>
+ </appender>
+ <appender name="LOG" class="org.apache.log4j.FileAppender">
+ <param name="File" value="JSFTrainingSandbox.log"/>
+ <param name="Append" value="false"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!--<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %-5x %-26c{1} - %m%n"/>-->
+ <param name="ConversionPattern" value="%d %p [%c] - %m%n"/>
+ </layout>
+ </appender>
+ <!--<appender name="FACESTRACE"
+ class="net.sf.facestrace.logging.FacesTraceAppender">
+ </appender>-->
+
+ <category name="java">
+ <priority value="fatal"/>
+ </category>
+ <category name="javax">
+ <priority value="error"/>
+ </category>
+ <category name="javax.faces">
+ <priority value="all"/>
+ </category>
+ <category name="org">
+ <priority value="error"/>
+ </category>
+ <category name="com">
+ <priority value="all"/>
+ </category>
+ <category name="org.apache.myfaces">
+ <priority value="all"/>
+ </category>
+ <category name="com.sun.facelets">
+ <priority value="all"/>
+ </category>
+ <category name="com.sun.faces">
+ <priority value="all"/>
+ </category>
+
+ <root>
+ <priority value="ERROR"/>
+ <appender-ref ref="STDOUT"/>
+ <appender-ref ref="LOG"/>
+ <!--<appender-ref ref="FACESTRACE" />-->
+ </root>
+
+</log4j:configuration>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/ac.taglib.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/ac.taglib.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/ac.taglib.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
+
+<facelet-taglib>
+ <namespace>http://ac</namespace>
+
+ <tag>
+ <tag-name>ajaxDataScroller</tag-name>
+ <component>
+ <component-type>
+ com.ac.components.AjaxDataScroller
+ </component-type>
+ <renderer-type>
+ com.ac.components.AjaxDataScrollerRenderer
+ </renderer-type>
+ </component>
+ </tag>
+
+
+</facelet-taglib>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/deck.taglib.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/deck.taglib.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/deck.taglib.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
+
+<facelet-taglib>
+ <namespace>http://www.jbossportal.com/jsf</namespace>
+ <tag>
+ <tag-name>showOneDeck</tag-name>
+ <component>
+ <component-type>org.jboss.portal.example.ProShowOneDeck</component-type>
+ <renderer-type>org.jboss.portal.example.Deck</renderer-type>
+ <handler-class>org.jboss.portal.example.web.component.deck.jsf.handler.ShowOneDeckTagHandler</handler-class>
+ </component>
+ </tag>
+ <tag>
+ <tag-name>showItem</tag-name>
+ <component>
+ <component-type>org.jboss.portal.example.ShowItem</component-type>
+ </component>
+ </tag>
+ <tag>
+ <tag-name>showListener</tag-name>
+ <handler-class>org.jboss.portal.example.web.component.deck.jsf.handler.ShowListenerTagHandler</handler-class>
+ </tag>
+</facelet-taglib>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/tags/facelets/xhtml/nav.xhtml
===================================================================
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/tags/jsp/ac.tld
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/resources/tags/jsp/ac.tld (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/resources/tags/jsp/ac.tld 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+<taglib xmlns="http://java.sun.com/JSP/TagLibraryDescriptor">
+ <tlib-version>1.3</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>t</short-name>
+ <uri>http://ac</uri>
+
+ <!-- ajaxDataScroller -->
+ <tag>
+ <name>ajaxDataScroller</name>
+ <tag-class>
+ org.jboss.portal.example.custom.datascroller.AjaxDataScrollerTag
+ </tag-class>
+ <body-content>JSP</body-content>
+
+ <!-- UIComponent attributes -->
+ <attribute>
+ <name>id</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>binding</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>rendered</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>for</name>
+ <required>true</required>
+ </attribute>
+
+ <attribute>
+ <name>selectedStyle</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>selectedStyleClass</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>tableStyleClass</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>tableStyle</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>styleClass</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>style</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>maxPages</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>renderIfSinglePage</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>fastStep</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>immediate</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>ignoreDupResponses</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>eventsQueue</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>requestDelay</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>ajaxSingle</name>
+ <required>false</required>
+ </attribute>
+
+ <attribute>
+ <name>renderCurrentAsText</name>
+ <required>false</required>
+ </attribute>
+
+ </tag>
+
+</taglib>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/tags/jsp/deckTag.tld
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/resources/tags/jsp/deckTag.tld (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/resources/tags/jsp/deckTag.tld 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE taglib
+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+ "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd" >
+<taglib>
+
+ <tlib-version>1.0</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>pro</short-name>
+ <uri>http://www.jbossportal.com/jsf</uri>
+ <description>
+ This tag library contains JavaServer Faces component tags for the
+ ProJSF ShowOne Deck Renderer, and ShowOne Listener.
+ </description>
+
+ <tag>
+ <name>showOneDeck</name>
+ <tag-class>org.jboss.portal.example.web.component.deck.taglib.ProShowOneDeckTag</tag-class>
+ <body-content>JSP</body-content>
+ <description>
+ The ProShowOneDeck component tag handler.
+ </description>
+
+ <!-- UIComponent attributes -->
+ <attribute>
+ <name>id</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The component identifier for this component. This value must be
+ unique within the closest parent component that is a naming
+ container.
+ </description>
+ </attribute>
+ <attribute>
+ <name>rendered</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ Flag indicating whether or not this component should be rendered
+ (during Render Response Phase), or processed on any subsequent
+ form submit.
+ </description>
+ </attribute>
+ <attribute>
+ <name>binding</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The value binding expression linking this component to a
+ property in a backing bean.
+ </description>
+ </attribute>
+
+ <!-- UIShowOne attributes -->
+ <attribute>
+ <name>showItemId</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The initial item to show.
+ </description>
+ </attribute>
+ <attribute>
+ <name>showListener</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The backing bean method binding for ShowEvents.
+ </description>
+ </attribute>
+
+ <!-- ProShowOneDeck attributes -->
+ <attribute>
+ <name>styleClass</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The CSS style class for the ProShowOneDeck component.
+ </description>
+ </attribute>
+
+ <attribute>
+ <name>itemStyleClass</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The CSS style class for the UIShowItems.
+ </description>
+ </attribute>
+
+ <attribute>
+ <name>itemHeaderStyleClass</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The CSS style class for the header facet of the UIShowItems.
+ </description>
+ </attribute>
+
+ <attribute>
+ <name>itemContentStyleClass</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The CSS style class for the content of the UIShowItems.
+ </description>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>showItem</name>
+ <tag-class>org.jboss.portal.example.web.component.deck.taglib.ShowItemTag</tag-class>
+ <body-content>JSP</body-content>
+ <description>
+ The UIShowItem component tag handler.
+ </description>
+
+ <!-- UIComponent attributes -->
+ <attribute>
+ <name>id</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The component identifier for this component. This value must be
+ unique within the closest parent component that is a naming
+ container.
+ </description>
+ </attribute>
+ <attribute>
+ <name>rendered</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ Flag indicating whether or not this component should be rendered
+ (during Render Response Phase), or processed on any subsequent
+ form submit.
+ </description>
+ </attribute>
+ <attribute>
+ <name>binding</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The value binding expression linking this component to a
+ property in a backing bean.
+ </description>
+ </attribute>
+
+ <!-- UIShowItem attributes (none) -->
+ </tag>
+
+ <tag>
+ <name>showListener</name>
+ <tag-class>org.jboss.portal.example.web.component.deck.taglib.ShowListenerTag</tag-class>
+ <body-content>JSP</body-content>
+ <description>
+ The ShowListener tag handler.
+ </description>
+
+ <attribute>
+ <name>type</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ The fully qualified class name for the show listener.
+ </description>
+ </attribute>
+ </tag>
+</taglib>
Added: portlets/src/framework/JSFRIPortlet/src/main/resources/webdefault.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/resources/webdefault.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/resources/webdefault.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,404 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!-- ===================================================================== -->
+<!-- This file contains the default descriptor for web applications. -->
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<!-- The intent of this descriptor is to include jetty specific or common -->
+<!-- configuration for all webapps. If a context has a webdefault.xml -->
+<!-- descriptor, it is applied before the contexts own web.xml file -->
+<!-- -->
+<!-- A context may be assigned a default descriptor by: -->
+<!-- + Calling WebApplicationContext.setDefaultsDescriptor -->
+<!-- + Passed an arg to addWebApplications -->
+<!-- -->
+<!-- This file is used both as the resource within the jetty.jar (which is -->
+<!-- used as the default if no explicit defaults descriptor is set) and it -->
+<!-- is copied to the etc directory of the Jetty distro and explicitly -->
+<!-- by the jetty.xml file. -->
+<!-- -->
+<!-- ===================================================================== -->
+<web-app
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ metadata-complete="true"
+ version="2.5">
+
+ <description>
+ Default web.xml file.
+ This file is applied to a Web application before it's own WEB_INF/web.xml file
+ </description>
+
+
+ <!-- ==================================================================== -->
+ <!-- Context params to control Session Cookies -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- UNCOMMENT TO ACTIVATE
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.SessionDomain</param-name>
+ <param-value>127.0.0.1</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
+ <param-value>/</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.MaxAge</param-name>
+ <param-value>-1</param-value>
+ </context-param>
+ -->
+
+ <context-param>
+ <param-name>org.mortbay.jetty.webapp.NoTLDJarPattern</param-name>
+ <param-value>start.jar|ant-.*\.jar|dojo-.*\.jar|jetty-.*\.jar|jsp-api-.*\.jar|junit-.*\.jar|servlet-api-.*\.jar|dnsns\.jar|rt\.jar|jsse\.jar|tools\.jar|sunpkcs11\.jar|sunjce_provider\.jar|xerces.*\.jar</param-value>
+ </context-param>
+
+
+
+ <!-- ==================================================================== -->
+ <!-- The default servlet. -->
+ <!-- This servlet, normally mapped to /, provides the handling for static -->
+ <!-- content, OPTIONS and TRACE methods for the context. -->
+ <!-- The following initParameters are supported: -->
+ <!-- -->
+ <!-- acceptRanges If true, range requests and responses are -->
+ <!-- supported -->
+ <!-- -->
+ <!-- dirAllowed If true, directory listings are returned if no -->
+ <!-- welcome file is found. Else 403 Forbidden. -->
+ <!-- -->
+ <!-- redirectWelcome If true, redirect welcome file requests -->
+ <!-- else use request dispatcher forwards -->
+ <!-- -->
+ <!-- gzip If set to true, then static content will be served-->
+ <!-- as gzip content encoded if a matching resource is -->
+ <!-- found ending with ".gz" -->
+ <!-- -->
+ <!-- resoureBase Can be set to replace the context resource base -->
+ <!-- -->
+ <!-- relativeResourceBase -->
+ <!-- Set with a pathname relative to the base of the -->
+ <!-- servlet context root. Useful for only serving -->
+ <!-- static content from only specific subdirectories. -->
+ <!-- -->
+ <!-- useFileMappedBuffer -->
+ <!-- If set to true (the default), a memory mapped -->
+ <!-- file buffer will be used to serve static content -->
+ <!-- when using an NIO connector. Setting this value -->
+ <!-- to false means that a direct buffer will be used -->
+ <!-- instead. If you are having trouble with Windows -->
+ <!-- file locking, set this to false. -->
+ <!-- -->
+ <!-- cacheControl If set, all static content will have this value -->
+ <!-- set as the cache-control header. -->
+ <!-- -->
+ <!-- maxCacheSize Maximum size of the static resource cache -->
+ <!-- -->
+ <!-- maxCachedFileSize Maximum size of any single file in the cache -->
+ <!-- -->
+ <!-- maxCachedFiles Maximum number of files in the cache -->
+ <!-- -->
+ <!-- cacheType "nio", "bio" or "both" to determine the type(s) -->
+ <!-- of resource cache. A bio cached buffer may be used-->
+ <!-- by nio but is not as efficient as a nio buffer. -->
+ <!-- An nio cached buffer may not be used by bio. -->
+ <!-- -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <servlet>
+ <servlet-name>default</servlet-name>
+ <servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
+ <init-param>
+ <param-name>acceptRanges</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>dirAllowed</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>redirectWelcome</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxCacheSize</param-name>
+ <param-value>4000000</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxCachedFileSize</param-name>
+ <param-value>254000</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxCachedFiles</param-name>
+ <param-value>1000</param-value>
+ </init-param>
+ <init-param>
+ <param-name>cacheType</param-name>
+ <param-value>both</param-value>
+ </init-param>
+ <init-param>
+ <param-name>gzip</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>useFileMappedBuffer</param-name>
+ <param-value>false</param-value>
+ </init-param>
+
+ <!--
+ <init-param>
+ <param-name>cacheControl</param-name>
+ <param-value>max-age=3600,public</param-value>
+ </init-param>
+ -->
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
+
+
+ <!-- ==================================================================== -->
+ <!-- JSP Servlet -->
+ <!-- This is the jasper JSP servlet from the jakarta project -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- The JSP page compiler and execution servlet, which is the mechanism -->
+ <!-- used by Glassfish to support JSP pages. Traditionally, this servlet -->
+ <!-- is mapped to URL patterh "*.jsp". This servlet supports the -->
+ <!-- following initialization parameters (default values are in square -->
+ <!-- brackets): -->
+ <!-- -->
+ <!-- checkInterval If development is false and reloading is true, -->
+ <!-- background compiles are enabled. checkInterval -->
+ <!-- is the time in seconds between checks to see -->
+ <!-- if a JSP page needs to be recompiled. [300] -->
+ <!-- -->
+ <!-- compiler Which compiler Ant should use to compile JSP -->
+ <!-- pages. See the Ant documenation for more -->
+ <!-- information. [javac] -->
+ <!-- -->
+ <!-- classdebuginfo Should the class file be compiled with -->
+ <!-- debugging information? [true] -->
+ <!-- -->
+ <!-- classpath What class path should I use while compiling -->
+ <!-- generated servlets? [Created dynamically -->
+ <!-- based on the current web application] -->
+ <!-- Set to ? to make the container explicitly set -->
+ <!-- this parameter. -->
+ <!-- -->
+ <!-- development Is Jasper used in development mode (will check -->
+ <!-- for JSP modification on every access)? [true] -->
+ <!-- -->
+ <!-- enablePooling Determines whether tag handler pooling is -->
+ <!-- enabled [true] -->
+ <!-- -->
+ <!-- fork Tell Ant to fork compiles of JSP pages so that -->
+ <!-- a separate JVM is used for JSP page compiles -->
+ <!-- from the one Tomcat is running in. [true] -->
+ <!-- -->
+ <!-- ieClassId The class-id value to be sent to Internet -->
+ <!-- Explorer when using <jsp:plugin> tags. -->
+ <!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
+ <!-- -->
+ <!-- javaEncoding Java file encoding to use for generating java -->
+ <!-- source files. [UTF-8] -->
+ <!-- -->
+ <!-- keepgenerated Should we keep the generated Java source code -->
+ <!-- for each page instead of deleting it? [true] -->
+ <!-- -->
+ <!-- logVerbosityLevel The level of detailed messages to be produced -->
+ <!-- by this servlet. Increasing levels cause the -->
+ <!-- generation of more messages. Valid values are -->
+ <!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
+ <!-- [WARNING] -->
+ <!-- -->
+ <!-- mappedfile Should we generate static content with one -->
+ <!-- print statement per input line, to ease -->
+ <!-- debugging? [false] -->
+ <!-- -->
+ <!-- -->
+ <!-- reloading Should Jasper check for modified JSPs? [true] -->
+ <!-- -->
+ <!-- suppressSmap Should the generation of SMAP info for JSR45 -->
+ <!-- debugging be suppressed? [false] -->
+ <!-- -->
+ <!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
+ <!-- dumped to a file? [false] -->
+ <!-- False if suppressSmap is true -->
+ <!-- -->
+ <!-- scratchdir What scratch directory should we use when -->
+ <!-- compiling JSP pages? [default work directory -->
+ <!-- for the current web application] -->
+ <!-- -->
+ <!-- tagpoolMaxSize The maximum tag handler pool size [5] -->
+ <!-- -->
+ <!-- xpoweredBy Determines whether X-Powered-By response -->
+ <!-- header is added by generated servlet [false] -->
+ <!-- -->
+ <!-- If you wish to use Jikes to compile JSP pages: -->
+ <!-- Set the init parameter "compiler" to "jikes". Define -->
+ <!-- the property "-Dbuild.compiler.emacs=true" when starting Jetty -->
+ <!-- to cause Jikes to emit error messages in a format compatible with -->
+ <!-- Jasper. -->
+ <!-- If you get an error reporting that jikes can't use UTF-8 encoding, -->
+ <!-- try setting the init parameter "javaEncoding" to "ISO-8859-1". -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <servlet id="jsp">
+ <servlet-name>jsp</servlet-name>
+ <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
+ <init-param>
+ <param-name>logVerbosityLevel</param-name>
+ <param-value>DEBUG</param-value>
+ </init-param>
+ <init-param>
+ <param-name>fork</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>xpoweredBy</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <!--
+ <init-param>
+ <param-name>classpath</param-name>
+ <param-value>?</param-value>
+ </init-param>
+ -->
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>jsp</servlet-name>
+ <url-pattern>*.jsp</url-pattern>
+ <url-pattern>*.jspf</url-pattern>
+ <url-pattern>*.jspx</url-pattern>
+ <url-pattern>*.xsp</url-pattern>
+ <url-pattern>*.JSP</url-pattern>
+ <url-pattern>*.JSPF</url-pattern>
+ <url-pattern>*.JSPX</url-pattern>
+ <url-pattern>*.XSP</url-pattern>
+ </servlet-mapping>
+
+ <!-- ==================================================================== -->
+ <!-- Dynamic Servlet Invoker. -->
+ <!-- This servlet invokes anonymous servlets that have not been defined -->
+ <!-- in the web.xml or by other means. The first element of the pathInfo -->
+ <!-- of a request passed to the envoker is treated as a servlet name for -->
+ <!-- an existing servlet, or as a class name of a new servlet. -->
+ <!-- This servlet is normally mapped to /servlet/* -->
+ <!-- This servlet support the following initParams: -->
+ <!-- -->
+ <!-- nonContextServlets If false, the invoker can only load -->
+ <!-- servlets from the contexts classloader. -->
+ <!-- This is false by default and setting this -->
+ <!-- to true may have security implications. -->
+ <!-- -->
+ <!-- verbose If true, log dynamic loads -->
+ <!-- -->
+ <!-- * All other parameters are copied to the -->
+ <!-- each dynamic servlet as init parameters -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- Uncomment for dynamic invocation
+ <servlet>
+ <servlet-name>invoker</servlet-name>
+ <servlet-class>org.mortbay.jetty.servlet.Invoker</servlet-class>
+ <init-param>
+ <param-name>verbose</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>nonContextServlets</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>dynamicParam</param-name>
+ <param-value>anyValue</param-value>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping> <servlet-name>invoker</servlet-name> <url-pattern>/servlet/*</url-pattern> </servlet-mapping>
+ -->
+
+
+
+ <!-- ==================================================================== -->
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+
+ <!-- ==================================================================== -->
+ <!-- Default MIME mappings -->
+ <!-- The default MIME mappings are provided by the mime.properties -->
+ <!-- resource in the org.mortbay.jetty.jar file. Additional or modified -->
+ <!-- mappings may be specified here -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- UNCOMMENT TO ACTIVATE
+ <mime-mapping>
+ <extension>mysuffix</extension>
+ <mime-type>mymime/type</mime-type>
+ </mime-mapping>
+ -->
+
+ <!-- ==================================================================== -->
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <!-- ==================================================================== -->
+ <locale-encoding-mapping-list>
+ <locale-encoding-mapping><locale>ar</locale><encoding>ISO-8859-6</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>be</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>bg</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ca</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>cs</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>da</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>de</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>el</locale><encoding>ISO-8859-7</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>en</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>es</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>et</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>fi</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>fr</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>hr</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>hu</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>is</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>it</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>iw</locale><encoding>ISO-8859-8</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ja</locale><encoding>Shift_JIS</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ko</locale><encoding>EUC-KR</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>lt</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>lv</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>mk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>nl</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>no</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>pl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>pt</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ro</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ru</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sh</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sk</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sq</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sr</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sv</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>tr</locale><encoding>ISO-8859-9</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>uk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>zh</locale><encoding>GB2312</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>zh_TW</locale><encoding>Big5</encoding></locale-encoding-mapping>
+ </locale-encoding-mapping-list>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Disable TRACE</web-resource-name>
+ <url-pattern>/</url-pattern>
+ <http-method>TRACE</http-method>
+ </web-resource-collection>
+ <auth-constraint/>
+ </security-constraint>
+
+</web-app>
+
+
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/classes/META-INF/images/DC_Advertising.jpg
===================================================================
(Binary files differ)
Property changes on: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/classes/META-INF/images/DC_Advertising.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss-app.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss-app.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss-app.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,3 @@
+<jboss-app>
+ <app-name>riPortletApp</app-name>
+</jboss-app>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd"><portlet-app>
+ <portlet>
+ <portlet-name>riPortlet</portlet-name>
+ </portlet>
+</portlet-app>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss_portal.tld
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss_portal.tld (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/jboss_portal.tld 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,26 @@
+<!DOCTYPE taglib
+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+ "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+<taglib>
+<tlib-version>0.01</tlib-version>
+<jsp-version>1.2</jsp-version>
+<short-name>scroller</short-name>
+<uri>http://www.jboss.com/portal</uri>
+<description>This tag library contains the scroller tag.</description>
+
+<tag>
+ <name>scroller</name>
+ <tag-class>org.jboss.portal.faces.scroller.ScrollerTag</tag-class>
+
+ <attribute>
+ <name>for</name>
+ <required>true</required>
+ </attribute>
+
+ <attribute>
+ <name>styleClass</name>
+ </attribute>
+
+</tag>
+
+</taglib>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/lib/jsf-facelets.jar
===================================================================
(Binary files differ)
Property changes on: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/lib/jsf-facelets.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portal.taglib.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portal.taglib.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portal.taglib.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "facelet-taglib_1_0.dtd">
+<facelet-taglib>
+ <namespace>http://www.jboss.com/portal</namespace>
+ <tag>
+ <tag-name>scroller</tag-name>
+ <component>
+ <component-type>com.jboss.portal.Scroller</component-type>
+ <renderer-type>default</renderer-type>
+ </component>
+ </tag>
+</facelet-taglib>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet-instances.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet-instances.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>RIPortletInstance</instance-id>
+ <portlet-ref>riPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>RIPortletSecondInstance</instance-id>
+ <portlet-ref>riPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet.tld
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet.tld (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet.tld 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+<taglib>
+
+ <tlib-version>1.0</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>portlet</short-name>
+
+ <uri>http://java.sun.com/portlet</uri>
+
+ <tag>
+
+ <name>param</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.URLParameterTag</tag-class>
+ <body-content>empty</body-content>
+
+ <attribute>
+ <name>name</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>value</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>renderURL</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.RenderURLTag</tag-class>
+ <tei-class>org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTagTEI</tei-class>
+ <body-content>JSP</body-content>
+
+ <attribute>
+ <name>portletMode</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>secure</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>windowState</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>defineObjects</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjectsTag</tag-class>
+ <tei-class>org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjectsTagTEI</tei-class>
+ <body-content>empty</body-content>
+
+ </tag>
+ <tag>
+
+ <name>actionURL</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.ActionURLTag</tag-class>
+ <tei-class>org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTagTEI</tei-class>
+ <body-content>JSP</body-content>
+
+ <attribute>
+ <name>portletMode</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>secure</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>windowState</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>namespace</name>
+ <tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.NamespaceTag</tag-class>
+ <body-content>empty</body-content>
+
+ </tag>
+
+</taglib>
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/portlet.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,38 @@
+<portlet-app version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet"
+ xmlns="http://java.sun.com/xml/ns/portlet">
+ <portlet>
+ <portlet-name>riPortlet</portlet-name>
+ <portlet-class>
+ javax.portlet.faces.GenericFacesPortlet
+ </portlet-class>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.view</name>
+ <value>/deck/deck.xhtml</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.edit</name>
+ <value>/deck/deck.xhtml</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.help</name>
+ <value>/deck/deck.xhtml</value>
+ </init-param>
+
+
+
+ <expiration-cache>-0</expiration-cache>
+ <portlet-info>
+ <title>JSF RI Portlet</title>
+ </portlet-info>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ </portlet>
+</portlet-app>
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/riportlet-object.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/riportlet-object.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/riportlet-object.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <instance>
+ <instance-name>RIPortletInstance</instance-name>
+ <component-ref>riPortletApp.riPortlet</component-ref>
+ </instance>
+ </deployment>
+ <!--
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <page>
+ <page-name>ajaxPortlet</page-name>
+ <window>
+ <window-name>ajaxportletWindow</window-name>
+ <instance-ref>AjaxPortletInstance</instance-ref>
+ <default>true</default>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>ajaxportletSecondWindow</window-name>
+ <instance-ref>AjaxPortletSecondInstance</instance-ref>
+ <default>true</default>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ </deployment>
+ -->
+ <deployment>
+ <if-exists>overwrite</if-exists>
+ <parent-ref>default.default</parent-ref>
+ <window>
+ <window-name>otherRIportletWindow</window-name>
+ <instance-ref>RIPortletInstance</instance-ref>
+ <default>true</default>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </deployment><!--
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <instance>
+ <instance-name>AjaxPortletSecondInstance</instance-name>
+ <component-ref>ajaxPortletApp.ajaxPortlet</component-ref>
+ </instance>
+ </deployment>
+--></deployments>
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/WEB-INF/web.xml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <description>JSFRIdemo</description>
+
+ <context-param>
+ <param-name>javax.portlet.faces.BridgeImplClass</param-name>
+ <param-value>org.apache.myfaces.portlet.faces.bridge.BridgeImpl</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.VIEW_MAPPINGS</param-name>
+ <param-value>*.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.LIBRARIES</param-name>
+ <param-value>/WEB-INF/portal.taglib.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <!--
+ <listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+ -->
+
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>FacesServlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>FacesServlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/css/master.css
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/css/master.css (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/css/master.css 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,28 @@
+ body{
+ font: normal 12px tahoma, sans-serif;
+ }
+
+ ul {
+ margin: 0;
+ padding: 0;
+ display: block;
+ list-style: none;
+ width:100%;
+ }
+
+ ul li{
+ margin: 0;
+ padding: 0;
+ }
+
+ table.menuGrid{
+ margin: 0;
+ padding: 0;
+ }
+
+ table.menuGrid tr td{
+ margin: 0;
+ padding: 5px;
+ border:1px solid #e6e6e6;
+ font: normal 12px tahoma, sans-serif;
+ }
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/css/showOneDeck.css
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/css/showOneDeck.css (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/css/showOneDeck.css 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,23 @@
+.ProShowItem
+{
+ border-style: ridge;
+}
+
+.ProShowItemHeader
+{
+ background-color: InactiveCaption;
+ color: InactiveCaptionText;
+ cursor: pointer;
+ vertical-align: top;
+ margin: 0px;
+ padding: 2px;
+ padding-left: 5px;
+}
+
+.ProShowItemContent
+{
+ border-top-style: ridge;
+ margin: 0px;
+ padding: 2px;
+ padding-left: 5px;
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/deck/deck.xhtml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/deck/deck.xhtml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/deck/deck.xhtml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,53 @@
+<ui:composition template="/layouts/default.xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+
+ xmlns:hc="http://www.jbossportal.com/jsf">
+
+ <ui:define name="body">
+ <h:form id="form" >
+
+
+ <hc:showOneDeck showItemId="first" showListener="#{deckBean.doShow}">
+ <hc:showItem id="first" >
+ <f:facet name="header" >
+ <h:panelGroup>
+ <h:graphicImage url="/resources/java_small.jpg" alt="The Duke"
+ style="margin-right: 8px; vertical-align:bottom;" />
+ <h:outputText value="Java" />
+ </h:panelGroup>
+ </f:facet>
+ <h:panelGrid columns="1" >
+ <h:outputLink value="http://apress.com/book/bookDisplay.html?bID=10044" >
+ <h:outputText value="hc JSF: Building Rich Internet Components" />
+ </h:outputLink>
+ <h:outputText value="hc EJB 3" />
+ <h:outputText value="hc Apache Maven" />
+ </h:panelGrid>
+ </hc:showItem>
+ <hc:showItem id="second" >
+ <f:facet name="header" >
+ <h:outputText value="Open Source" />
+ </f:facet>
+ <h:panelGrid columns="1" >
+ <h:outputText value="Foundations of AJAX" />
+ <h:outputText value="hc Apache Ant" />
+ <h:outputText value="hc PHP Security" />
+ </h:panelGrid>
+ </hc:showItem>
+ <hc:showItem id="third" >
+ <f:facet name="header" >
+ <h:outputText value=".NET" />
+ </f:facet>
+ <h:panelGrid columns="1" >
+ <h:outputText value="hc .NET Extreme hcgramming" />
+ <h:outputText value=".NET for Delphi hcgrammers" />
+ </h:panelGrid>
+ </hc:showItem>
+ <hc:showListener type="org.jboss.portal.example.web.component.deck.action.MyShowListener" />
+ </hc:showOneDeck>
+
+ </h:form>
+ </ui:define>
+ </ui:composition>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/images/2_6_DR_ss1.gif
===================================================================
(Binary files differ)
Property changes on: portlets/src/framework/JSFRIPortlet/src/main/webapp/images/2_6_DR_ss1.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/index.html
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/index.html (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/index.html 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<meta http-equiv="refresh" content="0; url=./index.jsf" />
+<title>Untitled Document</title>
+</head>
+<a href="/jsf-sandbox/deck/deck.jsf">Deck Component</a><br/>
+<a href="/jsf-sandbox/datatable/datatable.jsf">Datatable A4J</a><br/>
+<a href="/jsf-sandbox/datatable/vehicleListings.jsf">Datatable AjaxAnywhere</a><br/>
+<a href="/jsf-sandbox/chart/chart1.jsf">Chart Creator</a><br/>
+<a href="/jsf-sandbox/slider/slider.jsf">Slider Component</a><br/>
+<a href="/jsf-sandbox/slider/sliderWithTable.jsf">Slider With Table</a><br/>
+<a href="/jsf-sandbox/vehicles/tabbedPanel.jsf">Tabbed Panel Tomahawk</a>
+<body>
+</body>
+</html>
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/index.xhtml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/index.xhtml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/index.xhtml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,16 @@
+<ui:composition template="/layouts/default.xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:a4j="http://richfaces.org/a4j">
+
+
+ <ui:define name="title">JSF Training Sandbox</ui:define>
+
+ <ui:define name="body">
+
+ </ui:define>
+
+</ui:composition>
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/inventory/inventoryList.xhtml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/inventory/inventoryList.xhtml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/inventory/inventoryList.xhtml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,135 @@
+<ui:composition template="/layouts/default.xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:ac="http://ac"
+
+ xmlns:tr="http://www.jbossportal.com/training">
+
+ <ui:define name="headerExtras">
+
+ <style type="text/css">
+
+
+
+ .column{
+ width:75px;
+ font: normal 11px tahoma, sans-serif;
+ text-align:center;
+ }
+
+ .column-index{
+ width:75px;
+ font: normal 11px tahoma, sans-serif;
+ text-align:left;
+ }
+
+ .list-row3{
+ background-color:#ececec;
+ }
+
+ .list-row1{
+ background-color:#f1f6fd;
+ }
+
+ .list-row2{
+ background-color:#fff;
+ }
+
+ .list-header{
+ font: bold 11px tahoma, sans-serif;
+ text-align:center;
+ }
+
+ .list-table1{
+ border:1px solid #bed6f8;
+ }
+
+ .list-table2{
+ border:1px solid #bed6f8;
+ }
+ </style>
+
+ </ui:define>
+
+
+ <ui:define name="body">
+ <h:form>
+
+
+ <h:dataTable id="carIndex"
+ rendered="#{inventoryList.carMakeIndex != null}"
+ rows="10"
+ binding="#{inventoryList.carMakeIndexUIData}"
+ value="#{inventoryList.carMakeIndex}"
+ var="category"
+ styleClass="list-table1"
+ columnClasses="column-index"
+ rowClasses="list-row3">
+
+ <h:column>
+ <h:commandLink actionListener="#{inventoryList.filterCarList}">
+ <h:outputText value="#{category}"/>
+ <f:attribute name="filterRule" value="showTable"/>
+ </h:commandLink>
+ </h:column>
+
+ </h:dataTable>
+
+ <h:dataTable id="carList"
+ rows="10"
+ value="#{inventoryList.carInventory}"
+ var="category"
+ rowClasses="list-row1, list-row2"
+ columnClasses="column"
+ headerClass="list-header"
+ styleClass="list-table2">
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Make"/>
+ </f:facet>
+ <h:outputText value="#{category.make}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Model"/>
+ </f:facet>
+ <h:outputText value="#{category.model}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="#{inventoryList.priceColumnName}"/>
+ </f:facet>
+ <h:outputText value="#{category.price}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="#{inventoryList.mileageColumnName}"/>
+ </f:facet>
+ <h:outputText value="#{category.mileage}"/>
+ </h:column>
+
+ </h:dataTable>
+
+ <ac:ajaxDataScroller id="scroll_1"
+ for="carList"
+ tableStyleClass="list-table1"
+ style="list-table1"
+ maxPages="9">
+ </ac:ajaxDataScroller>
+
+
+
+
+ </h:form>
+ </ui:define>
+
+
+</ui:composition>
+
+
+
+
+
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/js/showOneDeck.js
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/js/showOneDeck.js (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/js/showOneDeck.js 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,24 @@
+/**
+ * The onclick handler for HtmlShowOneDeckRenderer.
+ *
+ * @param formClientId the clientId of the enclosing UIForm component
+ * @param clientId the clientId of the ProShowOneDeck component
+ * @param itemId the id of the UIShowItem that was clicked
+ */
+function _showOneDeck_click(
+ formClientId,
+ clientId,
+ itemId)
+{
+ var form = document.forms[formClientId];
+ var input = form[clientId];
+ if (!input)
+ {
+ input = document.createElement("input");
+ input.type = 'hidden';
+ input.name = clientId;
+ form.appendChild(input);
+ }
+ input.value = itemId;
+ form.submit();
+}
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/jsf/start.xhtml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/jsf/start.xhtml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/jsf/start.xhtml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,77 @@
+<a4j:portlet
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form id="portlet_form">
+ <ui:remove>
+ <h:panelGrid columns="2">
+ <h:inputText value="#{bean.text}" id="repeaterText">
+ <f:validateLength maximum="5" />
+ <a4j:support event="onkeyup" reRender="text"/>
+ </h:inputText>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText id="text" value="#{bean.text}"/>
+ <h:message for="repeaterText"/>
+ </a4j:outputPanel>
+ <a4j:commandLink value="Increment counter" action="#{bean.click}" reRender="counter"/>
+ <h:outputText id="counter" value="#{bean.counter}"/>
+ <h:outputText value="Portlet namespace:"/>
+ <h:outputText value="#{bean.namespace}"/>
+ <h:commandButton action="repeater" value="Switch to repeater page" />
+ <a4j:commandButton action="repeater" value="Ajax Switch to repeater page" />
+ </h:panelGrid>
+ </ui:remove>
+
+
+ <rich:panelMenu style="width:200px" styleClass="align-center-margin" mode="ajax"
+ iconExpandedGroup="disc" iconCollapsedGroup="disc"
+ iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
+ iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right" itemClass="white" hoveredItemClass="blue">
+
+ <rich:panelMenuGroup label="Team" expanded="true">
+ <rich:panelMenuItem label="Member1">
+ <f:param name="current" value="Member1"/>
+
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Member2">
+ <f:param name="current" value="Member2"/>
+
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Member3">
+ <f:param name="current" value="Member3"/>
+
+ </rich:panelMenuItem>
+
+ </rich:panelMenuGroup>
+
+ <rich:panelMenuGroup label="Company" >
+ <rich:panelMenuItem label="Company1">
+ <f:param name="current" value="Company1"/>
+
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Company2">
+ <f:param name="current" value="Company2"/>
+ </rich:panelMenuItem>
+
+ </rich:panelMenuGroup>
+
+
+ </rich:panelMenu>
+
+ <rich:panel>
+
+ <a4j:outputPanel ajaxRendered="true">
+
+ #{param.current eq 'Member1' ? '-------------Member 1' : ''}
+ #{param.current eq 'Member2' ? '-------------Member 2' : ''}
+
+ </a4j:outputPanel>
+
+ </rich:panel>
+ </h:form>
+
+</a4j:portlet>
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/layouts/default.xhtml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/layouts/default.xhtml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/layouts/default.xhtml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,33 @@
+
+<f:view contentType="text/html" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:tr="http://www.jbossportal.com/training">
+<html
+ >
+
+ <head>
+ <c:set var="context" value="${facesContext.externalContext.requestContextPath}" />
+ <link rel="stylesheet" href="${context}/css/master.css" type="text/css" />
+ <ui:insert name="headerExtras"/>
+
+ <title><ui:insert name="title" /></title>
+ </head>
+ <body>
+ <h:form>
+ <h:panelGrid columns="5" styleClass="menuGrid">
+ <h:commandLink action="home">Deck Component</h:commandLink>
+ <h:commandLink action="inventoryList">Table Component</h:commandLink>
+ <h:commandLink action="panelGrid">PanelGrid Component</h:commandLink>
+ <h:commandLink action="signupForm">Signup Form</h:commandLink>
+ <h:commandLink action="phaseListener">Phase Listener Demo</h:commandLink>
+ </h:panelGrid>
+ </h:form>
+ <hr/>
+ <ui:insert name="body"/>
+
+ </body>
+</html>
+ </f:view>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/panelGrid/demo.xhtml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/panelGrid/demo.xhtml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/panelGrid/demo.xhtml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,32 @@
+<ui:composition template="/layouts/default.xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:hc="http://www.jbossportal.com/jsf">
+
+ <ui:define name="headerExtras">
+
+ <style type="text/css">
+
+ body {
+ font: normal 14px tahoma, sans-serif;
+ }
+ panelGridList.ul li:hover{
+ background-color:#ececec;
+ }
+
+
+ </style>
+
+ </ui:define>
+ <ui:define name="body">
+ <h:panelGrid columns="5" cellpadding="0" cellspacing="0" border="1" styleClass="panelGridList">
+ <h:outputText value="testCol1"/>
+ <h:outputText value="testCol2"/>
+ <h:outputText value="testCol3"/>
+ <h:outputText value="testCol4"/>
+ <h:outputText value="testCol5"/>
+ </h:panelGrid>
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/phase/listener.xhtml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/phase/listener.xhtml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/phase/listener.xhtml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,26 @@
+<ui:composition template="/layouts/default.xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:hc="http://www.jbossportal.com/jsf">
+
+ <ui:define name="headerExtras">
+
+ <style type="text/css">
+
+
+
+ </style>
+
+ <SCRIPT src=".resource?name=myscript.js" />
+
+ </ui:define>
+ <ui:define name="body">
+
+ <img src=".resource.jsf?name=images/2_6_DR_ss1.gif" width="400px"/>
+ <img src="/JSFRIDemo/.resource.jsf?name=images/2_6_DR_ss1.gif" width="400px"/>
+ <img src="/JSFRIDemo/.resource.jsf?name=2_6_DR_ss1.gif" width="400px"/>
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/signup/complete.xhtml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/signup/complete.xhtml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/signup/complete.xhtml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,29 @@
+<ui:composition template="/layouts/default.xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:ac="http://ac"
+ >
+
+ <ui:define name="headerExtras">
+
+ <style type="text/css">
+
+ </style>
+
+ </ui:define>
+
+ <ui:define name="body">
+
+ Welcome #{myBean.firstName}!
+ </ui:define>
+
+
+</ui:composition>
+
+
+
+
+
Added: portlets/src/framework/JSFRIPortlet/src/main/webapp/signup/form.xhtml
===================================================================
--- portlets/src/framework/JSFRIPortlet/src/main/webapp/signup/form.xhtml (rev 0)
+++ portlets/src/framework/JSFRIPortlet/src/main/webapp/signup/form.xhtml 2007-11-13 02:15:51 UTC (rev 155)
@@ -0,0 +1,46 @@
+<ui:composition template="/layouts/default.xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jstl/core"
+ xmlns:ac="http://ac"
+ xmlns:tr="http://www.jbossportal.com/training">
+
+ <ui:define name="headerExtras">
+
+ <style type="text/css">
+
+ </style>
+
+ </ui:define>
+
+ <ui:define name="body">
+ <h:form >
+
+ <h:messages/>
+
+ <h:selectOneMenu value="#{myBean.selectedMonth}">
+ <f:selectItems value="#{myBean.monthList}"/>
+
+ </h:selectOneMenu>
+ #{myBean.selectedMonth}
+
+ <h:outputText value="First Name:"/>
+ <h:inputText value="#{myBean.firstName}" required="true"/>
+
+ <h:commandButton action="signupError"/>
+ <ui:remove>
+
+ </ui:remove>
+
+
+ </h:form>
+ </ui:define>
+
+
+</ui:composition>
+
+
+
+
+
More information about the jboss-svn-commits
mailing list