JBoss Rich Faces SVN: r18853 - in trunk/examples/richfaces-showcase: src/main and 19 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-08-20 11:54:52 -0400 (Fri, 20 Aug 2010)
New Revision: 18853
Added:
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/Color.java
trunk/examples/richfaces-showcase/src/main/resources/META-INF/jdoconfig.xml
trunk/examples/richfaces-showcase/src/main/resources/META-INF/persistence.xml
trunk/examples/richfaces-showcase/src/main/resources/ant-macros.xml
trunk/examples/richfaces-showcase/src/main/resources/log4j.properties
trunk/examples/richfaces-showcase/src/main/resources/logging.properties
trunk/examples/richfaces-showcase/src/main/webapp-gae/
trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/
trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/appengine-web.xml
trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml
trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/appengine-web.xml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/image/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/image/source.png
Removed:
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java
trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/
trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/appengine-web.xml
trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/image/source.png
Modified:
trunk/examples/richfaces-showcase/pom.xml
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaData.java
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/push/Choice.java
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/push/ChoicesBean.java
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/samples/imgUsage-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/push/samples/push-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/templates/main.xhtml
Log:
Merge from branch. GAE integration.
Modified: trunk/examples/richfaces-showcase/pom.xml
===================================================================
--- trunk/examples/richfaces-showcase/pom.xml 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/pom.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -1,295 +1,428 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>10-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-parent</artifactId>
+ <version>10-SNAPSHOT</version>
+ </parent>
- <groupId>org.richfaces.examples</groupId>
- <artifactId>richfaces-showcase</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <packaging>war</packaging>
- <name>Richfaces Examples: Richfaces Showcase Application</name>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-showcase</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <name>Richfaces Examples: Richfaces Showcase Application</name>
- <properties>
- <!-- FIXME these should be through the richfaces-parent -->
- <snapshotRepository>dav:https://repository.jboss.org/nexus/content/repositories/snapshots/</snapshotRepository>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <properties>
+ <!-- FIXME these should be through the richfaces-parent -->
+ <snapshotRepository>dav:https://repository.jboss.org/nexus/content/repositories/snapshots/</snapshotRepository>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <jetty.port>8080</jetty.port>
- <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
- <org.richfaces.bom.version>4.0.0-SNAPSHOT</org.richfaces.bom.version>
- </properties>
+ <jetty.port>8080</jetty.port>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
+ <org.richfaces.bom.version>4.0.0-SNAPSHOT</org.richfaces.bom.version>
+ </properties>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-bom</artifactId>
- <version>${org.richfaces.bom.version}</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
- </dependencyManagement>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-bom</artifactId>
+ <version>${org.richfaces.bom.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-components-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-components-ui</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ </dependency>
- <dependency>
- <groupId>net.sf.ehcache</groupId>
- <artifactId>ehcache</artifactId>
- </dependency>
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ </dependency>
- <!--
- simple logger binding: only messages of level INFO and higher are
- printed
- -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.8</version>
- </dependency>
+ <!-- simple logger binding: only messages of level INFO and higher
+ are printed -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.8</version>
+ </dependency>
- <!-- Log4J dependency used in examples -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
- </dependencies>
+ <!-- Log4J dependency used in examples -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ </dependencies>
- <build>
- <finalName>richfaces-showcase</finalName>
+ <build>
+ <finalName>richfaces-showcase</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>${jetty.port}</port>
- <maxIdleTime>60000</maxIdleTime>
- </connector>
- </connectors>
- <webResources>
- <resource>
- <directory>${basedir}/src/main/java</directory>
- <targetPath>/WEB-INF/src</targetPath>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webResources>
- <resource>
- <directory>${basedir}/src/main/java</directory>
- <targetPath>/WEB-INF/src</targetPath>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <connectors>
+ <connector
+ implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>${jetty.port}</port>
+ <maxIdleTime>60000</maxIdleTime>
+ </connector>
+ </connectors>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <profiles>
- <profile>
- <id>jdk5</id>
- <activation>
- <jdk>1.5</jdk>
- </activation>
- <dependencies>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.2</version>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <executions>
- <execution>
- <id>jee6</id>
- <phase>package</phase>
- <goals>
- <goal>war</goal>
- </goals>
- <configuration>
- <webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
- <classifier>jee6</classifier>
- <packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/jta-*,WEB-INF/lib/jstl-*</packagingExcludes>
- <warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/jta-*,WEB-INF/lib/jstl-*</warSourceExcludes>
- <webResources>
- <resource>
- <directory>${basedir}/src/main/java</directory>
- <targetPath>/WEB-INF/src</targetPath>
- </resource>
- </webResources>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <classifier>tomcat6</classifier>
- <webResources>
- <resource>
- <directory>${basedir}/src/main/java</directory>
- <targetPath>/WEB-INF/src</targetPath>
- </resource>
- </webResources>
- </configuration>
- </plugin>
+ <profiles>
+ <profile>
+ <id>gae</id>
+ <dependencies>
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>el-impl</groupId>
+ <artifactId>el-impl</artifactId>
+ <scope>runtime</scope>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ <version>1.1.1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_3.0_spec</artifactId>
+ <version>1.1.1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.1</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/main/java-gae-jsf-ri</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>src/main/webapp-gae</directory>
+ </resource>
+ <resource>
+ <directory>src/main/webapp</directory>
+ </resource>
+ <resource>
+ <directory>${project.build.directory}/generated-resources</directory>
+ <targetPath>static-resources</targetPath>
+ </resource>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <configuration>
+ </configuration>
+ <executions>
+ <execution>
+ <id>process</id>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ <configuration>
+ <outputDir>generated-resources</outputDir>
+ <skins>
+ <skin>blueSky</skin>
+ <skin>classic</skin>
+ <skin>deepMarine</skin>
+ <skin>emeraldTown</skin>
+ <skin>japanCherry</skin>
+ <skin>ruby</skin>
+ <skin>wine</skin>
+ </skins>
+ <includedContentTypes>
+ <include>application/javascript</include>
+ <include>text/css</include>
+ <include>image/.+</include>
+ </includedContentTypes>
+ <fileNameMappings>
+ <property>
+ <name>^\Qorg.richfaces.renderkit.html\E</name>
+ <value>org.richfaces/images</value>
+ </property>
+ <property>
+ <name>^\Qorg.richfaces.renderkit.html.images\E</name>
+ <value>org.richfaces/images</value>
+ </property>
+ <property>
+ <name>^css/</name>
+ <value>org.richfaces/css/</value>
+ </property>
+ </fileNameMappings>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>jdk5</id>
+ <activation>
+ <jdk>1.5</jdk>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jee6</id>
+ <phase>package</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+ <webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
+ <classifier>jee6</classifier>
+ <packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/jta-*,WEB-INF/lib/jstl-*</packagingExcludes>
+ <warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/jta-*,WEB-INF/lib/jstl-*</warSourceExcludes>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <classifier>tomcat6</classifier>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>group-sources</id>
- <goals>
- <goal>single</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <finalName>sources</finalName>
- <descriptor>assembler.xml</descriptor>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>jar</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <classesDirectory>${basedir}/target/sources/sources</classesDirectory>
- <classifier>sources</classifier>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>jee6</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
- <webResources>
- <resource>
- <directory>${basedir}/src/main/java</directory>
- <targetPath>/WEB-INF/src</targetPath>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>group-sources</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <finalName>sources</finalName>
+ <descriptor>assembler.xml</descriptor>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <classesDirectory>${basedir}/target/sources/sources</classesDirectory>
+ <classifier>sources</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>jee6</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <dependencies>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
- <repositories>
- <!-- FIXME - This should be set globally in parent -->
- <repository>
- <id>maven-repository2.dev.java.net</id>
- <name>Java.net Repository for Maven 2</name>
- <url>http://download.java.net/maven/2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
+ <repositories>
+ <!-- FIXME - This should be set globally in parent -->
+ <repository>
+ <id>maven-repository2.dev.java.net</id>
+ <name>Java.net Repository for Maven 2</name>
+ <url>http://download.java.net/maven/2</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/examples/richfaces...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/examples/richfaces-sh...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces</url>
- </scm>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/examples/richfaces...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/examples/richfaces-sh...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
</project>
Copied: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/Color.java (from rev 18841, branches/RF-7939-showcase/src/main/java/org/richfaces/demo/mediaOutput/Color.java)
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/Color.java (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/Color.java 2010-08-20 15:54:52 UTC (rev 18853)
@@ -0,0 +1,46 @@
+package org.richfaces.demo.mediaOutput;
+
+/**
+ * @author Ilya Shaikovsky Class created to hold rgb properties of the color. Used in order to avoid AWT dependencies as
+ * GAE not allows them
+ */
+public class Color {
+
+ private int red;
+ private int green;
+ private int blue;
+
+ public Color(int red, int green, int blue) {
+ this.red = red;
+ this.green = green;
+ this.blue = blue;
+ }
+
+ public int getRed() {
+ return red;
+ }
+
+ public void setRed(int red) {
+ this.red = red;
+ }
+
+ public int getGreen() {
+ return green;
+ }
+
+ public void setGreen(int green) {
+ this.green = green;
+ }
+
+ public int getBlue() {
+ return blue;
+ }
+
+ public void setBlue(int blue) {
+ this.blue = blue;
+ }
+ @Override
+ public String toString() {
+ return String.valueOf(getRed()) + String.valueOf(getGreen()) + String.valueOf(getBlue());
+ }
+}
Modified: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaBean.java 2010-08-20 15:54:52 UTC (rev 18853)
@@ -1,86 +1,477 @@
package org.richfaces.demo.mediaOutput;
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.Graphics2D;
-import java.awt.geom.AffineTransform;
-import java.awt.image.BufferedImage;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.IntBuffer;
+import java.nio.charset.Charset;
+import java.util.zip.CRC32;
+import java.util.zip.Deflater;
+import java.util.zip.DeflaterOutputStream;
+import java.util.zip.Inflater;
+import java.util.zip.InflaterInputStream;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
-import javax.imageio.ImageIO;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
@ManagedBean(name = "mediaBean")
@RequestScoped
public class MediaBean {
- public void paint(OutputStream out, Object data) throws IOException {
- if (data instanceof MediaData) {
- MediaData paintData = (MediaData) data;
- BufferedImage img = new BufferedImage(paintData.width, paintData.height, BufferedImage.TYPE_INT_RGB);
- Graphics2D g2d = img.createGraphics();
+ private static final String RICHFACES_MEDIA_OUTPUT_IMAGE_SOURCE = "/richfaces/mediaOutput/image/source.png";
+ private static final int BUFFER_SIZE = 8192;
- g2d.setColor(Color.WHITE);
- g2d.fillRect(0, 0, 300, 120);
+ private Color[] colors;
+ private boolean isIndexed = false;
- int testLenght = paintData.text.length();
- int fontSize = testLenght < 8 ? 40 : 40 - (testLenght - 8);
+ private Charset asciiCharset = Charset.forName("US-ASCII");
- if (fontSize < 12) {
- fontSize = 12;
+ private int sectionLength;
+
+ private int imageWidth;
+
+ private byte[] lengthBytes = new byte[4];
+
+ private byte[] chunkTypeBytes = new byte[4];
+
+ private class Section {
+
+ protected void writeHeaderSectionData(OutputStream outChannel) throws IOException {
+ outChannel.write(lengthBytes);
+ outChannel.write(chunkTypeBytes);
+ }
+
+ protected void writeInt(OutputStream outChannel, int value) throws IOException {
+ byte[] bs = new byte[4];
+ ByteBuffer.wrap(bs).order(ByteOrder.BIG_ENDIAN).asIntBuffer().put(value);
+ outChannel.write(bs);
+ }
+
+ protected void writeSectionData(InputStream inChannel, OutputStream outChannel) throws IOException {
+ byte[] bs = new byte[BUFFER_SIZE];
+ int read = 0;
+ int remaining = sectionLength;
+
+ while ((read = inChannel.read(bs, 0, Math.min(remaining, bs.length))) > 0) {
+ outChannel.write(bs, 0, read);
+ remaining -= read;
}
- Font font = new Font("Serif", Font.HANGING_BASELINE, fontSize);
+ if (remaining > 0) {
+ throw new IllegalArgumentException();
+ }
- g2d.setFont(font);
+ byte[] crc = new byte[4];
+ if (inChannel.read(crc) < crc.length) {
+ throw new IllegalArgumentException();
+ }
- int x = 10;
- int y = fontSize * 5 / 2;
+ outChannel.write(crc);
+ }
- g2d.translate(x, y);
+ public void write(InputStream inChannel, OutputStream outChannel) throws IOException {
+ writeHeaderSectionData(outChannel);
+ writeSectionData(inChannel, outChannel);
+ }
+ };
- Color color = new Color(paintData.color);
+ private class HeaderSection extends Section {
- g2d.setPaint(new Color(color.getRed(), color.getGreen(), color.getBlue(), 30));
+ @Override
+ protected void writeSectionData(InputStream inChannel, OutputStream outChannel) throws IOException {
+ // // Width 4 bytes
+ // // Height 4 bytes
+ // // Bit depth 1 byte
+ // // Colour type 1 byte
+ // // Compression method 1 byte
+ // // Filter method 1 byte
+ // // Interlace method 1 byte
- AffineTransform origTransform = g2d.getTransform();
+ byte[] headerBytes = new byte[sectionLength];
- g2d.shear(-0.5 * paintData.scale, 0);
- g2d.scale(1, paintData.scale);
- g2d.drawString(paintData.text, 0, 0);
- g2d.setTransform(origTransform);
- g2d.setPaint(color);
- g2d.drawString(paintData.text, 0, 0);
- ImageIO.write(img, "jpeg", out);
+ if (inChannel.read(headerBytes) < headerBytes.length) {
+ throw new IllegalArgumentException();
+ }
+
+ if (headerBytes[8] != 8) {
+ throw new IllegalStateException("Color depth is not 8");
+ }
+
+ if (headerBytes[9] != 2 && headerBytes[9] != 3) {
+ throw new IllegalStateException("Unsupported color type");
+ }
+
+ imageWidth = ByteBuffer.wrap(headerBytes, 0, 4).order(ByteOrder.BIG_ENDIAN).asIntBuffer().get();
+
+ isIndexed = (headerBytes[9] == 3);
+
+ outChannel.write(headerBytes);
+
+ byte[] crc = new byte[4];
+ if (inChannel.read(crc) < crc.length) {
+ throw new IllegalArgumentException();
+ }
+
+ outChannel.write(crc);
}
- }
- private void copy(InputStream in, OutputStream out) throws IOException {
- byte[] buffer = new byte[2048];
- int read;
+ };
- while ((read = in.read(buffer)) != -1) {
- out.write(buffer, 0, read);
+ private void transformColors(byte[] data, int offset, int length) {
+ float[] intensities = new float[3];
+
+ for (int i = offset; i < length + offset; i += 3) {
+ float weight = 0;
+ for (int j = 0; j < intensities.length; j++) {
+ intensities[j] = ((float) (data[i + j] & 0xFF)) / 255;
+ weight += intensities[j];
+ }
+
+ float r = 0;
+ float g = 0;
+ float b = 0;
+
+ for (int j = 0; j < intensities.length; j++) {
+ r += intensities[j] * colors[j].getRed();
+ g += intensities[j] * colors[j].getGreen();
+ b += intensities[j] * colors[j].getBlue();
+ }
+
+ data[i] = (byte) (r);
+ data[i + 1] = (byte) (g);
+ data[i + 2] = (byte) (b);
}
}
- public void paintFlash(OutputStream out, Object data) throws IOException {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ private class PaletteSection extends Section {
+ @Override
+ protected void writeSectionData(InputStream inChannel, OutputStream outChannel) throws IOException {
+ if (!isIndexed) {
+ super.writeSectionData(inChannel, outChannel);
+ } else {
+ byte[] data = new byte[2000 * 3];
+ int read;
+ int remaining = sectionLength;
- if (loader == null) {
- loader = getClass().getClassLoader();
+ assert (data.length < BUFFER_SIZE);
+
+ CRC32 crc32 = new CRC32();
+ crc32.update(chunkTypeBytes);
+
+ while ((read = (inChannel.read(data, 0, Math.min(remaining, data.length)))) > 0) {
+ remaining -= read;
+
+ transformColors(data, 0, read);
+
+ outChannel.write(data, 0, read);
+ crc32.update(data, 0, read);
+ }
+
+ if (remaining > 0) {
+ throw new IllegalArgumentException();
+ }
+
+ inChannel.skip(4);
+
+ writeInt(outChannel, (int) crc32.getValue());
+ }
}
+ };
- InputStream stream = loader.getResourceAsStream("org/richfaces/demo/mediaOutput/text.swf");
+ private class LimitedInputStream extends FilterInputStream {
- if (stream != null) {
- try {
- copy(stream, out);
- } finally {
- stream.close();
+ private int remaining;
+
+ protected LimitedInputStream(InputStream inChannel) {
+ super(inChannel);
+ this.remaining = sectionLength;
+ }
+
+ @Override
+ public int available() throws IOException {
+ return Math.min(super.available(), this.remaining);
+ }
+
+ @Override
+ public int read() throws IOException {
+ if (this.remaining > 0) {
+ int read = super.read();
+ if (read != -1) {
+ this.remaining--;
+ }
+
+ return read;
+ } else {
+ return -1;
}
}
+
+ @Override
+ public int read(byte[] b) throws IOException {
+ return read(b, 0, b.length);
+ }
+
+ @Override
+ public int read(byte[] b, int off, int len) throws IOException {
+ int read = super.read(b, 0, Math.min(len, this.remaining));
+ if (read > 0) {
+ this.remaining -= read;
+ }
+
+ return read;
+ }
+
+ @Override
+ public synchronized void mark(int readlimit) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean markSupported() {
+ return false;
+ }
+
+ @Override
+ public synchronized void reset() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public long skip(long n) throws IOException {
+ long toSkip = Math.min(this.remaining, n);
+ long skipped = super.skip(toSkip);
+
+ if (skipped > 0) {
+ this.remaining -= skipped;
+ }
+
+ return skipped;
+ }
+ };
+
+ private class DataSection extends Section {
+
+ private byte paeth(byte a, byte b, byte c) {
+ int p = (a & 0xFF) + (b & 0xFF) - (c & 0xFF);
+ int pa = Math.abs(p - a);
+ int pb = Math.abs(p - b);
+ int pc = Math.abs(p - c);
+
+ int pr;
+
+ if (pa <= pb && pa <= pc) {
+ pr = a;
+ } else if (pb <= pc) {
+ pr = b;
+ } else {
+ pr = c;
+ }
+
+ return (byte) pr;
+ };
+
+ private class Filter {
+ protected int idx;
+ byte a = 0;
+ byte b = 0;
+ byte c = 0;
+
+ byte oa = 0;
+ byte ob = 0;
+ byte oc = 0;
+
+ int step = 3;
+
+ byte[] bs;
+ byte[] ps;
+
+ public void setIdx(int idx) {
+ this.idx = idx;
+
+ oa = a;
+ ob = b;
+ oc = c;
+
+ b = ps[idx];
+ if (idx > step) {
+ a = bs[idx - step];
+ c = ps[idx - step];
+ }
+ }
+
+ public void next() {
+ idx = idx + step;
+ setIdx(idx);
+ }
+ };
+
+ private class SubFilter extends Filter {
+ @Override
+ public void next() {
+ bs[idx] = (byte) ((bs[idx] & 0xFF) + (a & 0xFF) - (oa & 0xFF));
+ setIdx(idx + step);
+ }
+ };
+
+ private class UpFilter extends Filter {
+ @Override
+ public void next() {
+ bs[idx] = (byte) ((bs[idx] & 0xFF) + (b & 0xFF) - (ob & 0xFF));
+ setIdx(idx + step);
+ }
+ };
+
+ private class PaethFilter extends Filter {
+ @Override
+ public void next() {
+ bs[idx] = (byte) (paeth(a, b, c) - paeth(oa, ob, oc) + (bs[idx] & 0xFF));
+ setIdx(idx + step);
+ }
+ }
+
+ private void reconstruct(byte[] bs, byte[] ps) {
+ Filter[] filters = new Filter[3];
+
+ for (int i = 0; i < filters.length; i++) {
+ switch (bs[0]) {
+ case 0:
+ filters[i] = new Filter();
+ break;
+ case 1:
+ filters[i] = new SubFilter();
+ break;
+ case 2:
+ filters[i] = new UpFilter();
+ break;
+ case 4:
+ filters[i] = new PaethFilter();
+ break;
+
+ default:
+ throw new IllegalArgumentException(Integer.toHexString(bs[0]));
+ }
+
+ filters[i].bs = bs;
+ filters[i].ps = ps;
+ filters[i].step = 3;
+
+ filters[i].setIdx(1 + i);
+ }
+
+ for (int i = 1; i < (bs.length - 1) / 3; i++) {
+ for (Filter filter : filters) {
+ filter.next();
+ }
+ }
+
+ bs[0] = 0;
+ }
+
+ @Override
+ public void write(InputStream inChannel, OutputStream outChannel) throws IOException {
+ if (isIndexed) {
+ super.write(inChannel, outChannel);
+ } else {
+ byte[] ps = new byte[imageWidth * 3 + 1];
+ byte[] bs = new byte[imageWidth * 3 + 1];
+
+ assert (bs.length < BUFFER_SIZE);
+
+ int read = 0;
+
+ InputStream inflaterInputStream = new BufferedInputStream(new InflaterInputStream(
+ new LimitedInputStream(inChannel), new Inflater(), 2048), BUFFER_SIZE);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(sectionLength);
+ DeflaterOutputStream deflaterOutputStream = new DeflaterOutputStream(baos, new Deflater(), 2048);
+
+ while ((read = (inflaterInputStream.read(bs))) > 0) {
+ reconstruct(bs, ps);
+ transformColors(bs, 1, read - 1);
+
+ deflaterOutputStream.write(bs, 0, read);
+
+ byte[] swapVar = bs;
+ bs = ps;
+ ps = swapVar;
+ }
+
+ deflaterOutputStream.finish();
+
+ byte[] compressedSectionBytes = baos.toByteArray();
+ writeInt(outChannel, compressedSectionBytes.length);
+
+ CRC32 crc32 = new CRC32();
+ outChannel.write(chunkTypeBytes);
+ crc32.update(chunkTypeBytes);
+
+ if (inChannel.skip(4) < 4) {
+ throw new IllegalArgumentException();
+ }
+
+ outChannel.write(compressedSectionBytes);
+
+ writeInt(outChannel, (int) crc32.getValue());
+ }
+ }
+
+ };
+
+ private Section readNextSection(InputStream inChannel) throws IOException {
+ int read = inChannel.read(lengthBytes);
+ if (read != -1) {
+ if (read < lengthBytes.length) {
+ throw new IllegalArgumentException();
+ }
+
+ if (inChannel.read(chunkTypeBytes) < chunkTypeBytes.length) {
+ throw new IllegalArgumentException();
+ }
+
+ IntBuffer lengthBuffer = ByteBuffer.wrap(lengthBytes).order(ByteOrder.BIG_ENDIAN).asIntBuffer();
+ sectionLength = lengthBuffer.get(0);
+ String chunkTypeString = new String(chunkTypeBytes, asciiCharset);
+
+ if ("IHDR".equals(chunkTypeString)) {
+ return new HeaderSection();
+ } else if ("PLTE".equals(chunkTypeString)) {
+ return new PaletteSection();
+ } else if ("IDAT".equals(chunkTypeString)) {
+ return new DataSection();
+ } else {
+ return new Section();
+ }
+ } else {
+ return null;
+ }
}
+
+ public void process(OutputStream outStream, Object data) throws Exception {
+ colors = ((MediaData) data).getNewColors();
+
+ ExternalContext extContext = FacesContext.getCurrentInstance().getExternalContext();
+ BufferedInputStream inStream = new BufferedInputStream(extContext
+ .getResourceAsStream(RICHFACES_MEDIA_OUTPUT_IMAGE_SOURCE), BUFFER_SIZE);
+ try {
+ // skip 8-bytes of header
+ byte[] bs = new byte[8];
+ if (inStream.read(bs) < bs.length) {
+ throw new IllegalArgumentException();
+ }
+ outStream.write(bs);
+
+ Section section = null;
+ while ((section = readNextSection(inStream)) != null) {
+ section.write(inStream, outStream);
+ }
+ } finally {
+ inStream.close();
+ outStream.close();
+ }
+ }
}
Modified: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaData.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaData.java 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/mediaOutput/MediaData.java 2010-08-20 15:54:52 UTC (rev 18853)
@@ -3,65 +3,44 @@
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.RequestScoped;
+import javax.faces.bean.ViewScoped;
-@ManagedBean(name = "mediaData")
-@RequestScoped
+@ManagedBean
+@ViewScoped
public class MediaData implements Serializable {
-
- /**
- *
- */
+ private static final Color[] COLORS = { new Color(255, 0, 0), new Color(0, 0, 255), new Color(0, 255, 0),
+ new Color(255, 255, 0), new Color(0, 255, 255) };
private static final long serialVersionUID = 1L;
- int height = 120;
- int width = 300;
- Integer color;
- float scale;
- String text;
+ private int colorIndex1 = 0;
+ private int colorIndex2 = 1;
+ private int colorIndex3 = 2;
- public MediaData() {
- setText("RichFaces 4.0");
- setColor(1000);
- setScale(2);
+ public Color[] getNewColors() {
+ return new Color[] { COLORS[colorIndex1], COLORS[colorIndex2], COLORS[colorIndex3], };
}
- public Integer getColor() {
- return color;
+ public int getColorIndex1() {
+ return colorIndex1;
}
- public void setColor(Integer color) {
- this.color = color;
+ public void setColorIndex1(int colorIndex1) {
+ this.colorIndex1 = colorIndex1;
}
- public float getScale() {
- return scale;
+ public int getColorIndex2() {
+ return colorIndex2;
}
- public void setScale(float scale) {
- this.scale = scale;
+ public void setColorIndex2(int colorIndex2) {
+ this.colorIndex2 = colorIndex2;
}
- public String getText() {
- return text;
+ public int getColorIndex3() {
+ return colorIndex3;
}
- public void setText(String text) {
- this.text = text;
+ public void setColorIndex3(int colorIndex3) {
+ this.colorIndex3 = colorIndex3;
}
- public int getWidth() {
- return width;
- }
-
- public void setWidth(int width) {
- this.width = width;
- }
-
- public int getHeight() {
- return height;
- }
-
- public void setHeight(int height) {
- this.height = height;
- }
-}
+}
\ No newline at end of file
Modified: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/push/Choice.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/push/Choice.java 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/push/Choice.java 2010-08-20 15:54:52 UTC (rev 18853)
@@ -1,6 +1,8 @@
package org.richfaces.demo.push;
-public class Choice {
+import java.io.Serializable;
+
+public class Choice implements Serializable{
private String label;
private int votesCount;
Modified: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/push/ChoicesBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/push/ChoicesBean.java 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/push/ChoicesBean.java 2010-08-20 15:54:52 UTC (rev 18853)
@@ -1,27 +1,26 @@
package org.richfaces.demo.push;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.EventListener;
import java.util.EventObject;
import java.util.List;
-import java.util.Random;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
+import javax.faces.bean.ViewScoped;
import org.ajax4jsf.event.PushEventListener;
+import org.richfaces.demo.common.data.RandomHelper;
@ManagedBean(name = "choicesBean")
-@SessionScoped
-public class ChoicesBean implements Runnable {
+@ViewScoped
+public class ChoicesBean implements Serializable{
PushEventListener listener;
-
- private boolean enabled = false;
+
+ private boolean enabled = true;
private List<Choice> choices;
private List<Choice> lastVotes;
- private Date startDate;
- private Thread thread;
private String updateInfo;
public ChoicesBean() {
@@ -39,6 +38,13 @@
lastVotes.add(new Choice("Apple"));
}
+ public void initiateEvent() {
+ for (Choice choice : lastVotes) {
+ choice.setVotesCount(RandomHelper.rand(0, 3));
+ }
+ listener.onEvent(new EventObject(this));
+ }
+
public List<Choice> getChoices() {
return choices;
}
@@ -58,56 +64,13 @@
}
public synchronized void start() {
- if (thread == null) {
- setStartDate(new Date());
- setEnabled(true);
- thread = new Thread(this);
- thread.setDaemon(true);
- thread.start();
- }
+ setEnabled(true);
}
public synchronized void stop() {
- if (thread != null) {
- setStartDate(null);
- setEnabled(false);
- thread = null;
- }
+ setEnabled(false);
}
- public static int rand(int lo, int hi) {
- Random rn2 = new Random();
- int n = hi - lo + 1;
- int i = rn2.nextInt() % n;
-
- if (i < 0) {
- i = -i;
- }
-
- return lo + i;
- }
-
- public void run() {
- while (thread != null) {
- try {
- if (((new Date()).getTime() - startDate.getTime()) >= 60000) {
- stop();
- }
-
- // changing votes count
- for (Choice choice : lastVotes) {
- choice.setVotesCount(rand(0, 3));
- }
-
- // System.out.println("New Event!");
- listener.onEvent(new EventObject(this));
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
public void processUpdates() {
for (Choice choice : lastVotes) {
if (choice.getVotesCount() > 0) {
@@ -116,26 +79,14 @@
choices.get(index).increment(choice.getVotesCount());
}
}
-
updateInfo = "[ ";
-
for (Choice choice : lastVotes) {
updateInfo += choice.getVotesCount() + " ";
}
-
updateInfo += "] ";
-
- // System.out.println("ChoicesBean.processUpdates()");
}
- public Thread getThread() {
- return thread;
- }
-
public boolean isEnabled() {
-
- // System.out.println("ChoicesBean.isEnabled()");
- // System.out.println(enabled);
return enabled;
}
@@ -143,14 +94,6 @@
this.enabled = enabled;
}
- public Date getStartDate() {
- return startDate;
- }
-
- public void setStartDate(Date startDate) {
- this.startDate = startDate;
- }
-
public String getUpdateInfo() {
return updateInfo;
}
Modified: trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/ExtTableSelectionBean.java 2010-08-20 15:54:52 UTC (rev 18853)
@@ -1,5 +1,6 @@
package org.richfaces.demo.tables;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -14,7 +15,7 @@
@ManagedBean
@SessionScoped
-public class ExtTableSelectionBean {
+public class ExtTableSelectionBean implements Serializable{
private Collection<Object> selection;
@ManagedProperty(value = "#{carsBean.allInventoryItems}")
private List<InventoryItem> inventoryItems;
Copied: trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri (from rev 18841, branches/RF-7939-showcase/src/main/java-gae-jsf-ri)
Copied: trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com (from rev 18841, branches/RF-7939-showcase/src/main/java-gae-jsf-ri/com)
Copied: trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun (from rev 18841, branches/RF-7939-showcase/src/main/java-gae-jsf-ri/com/sun)
Copied: trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces (from rev 18841, branches/RF-7939-showcase/src/main/java-gae-jsf-ri/com/sun/faces)
Copied: trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config (from rev 18841, branches/RF-7939-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config)
Deleted: trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java
===================================================================
--- branches/RF-7939-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java 2010-08-20 10:41:27 UTC (rev 18841)
+++ trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java 2010-08-20 15:54:52 UTC (rev 18853)
@@ -1,1109 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can obtain
- * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
- * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
- * Sun designates this particular file as subject to the "Classpath" exception
- * as provided by Sun in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the License
- * Header, with the fields enclosed by brackets [] replaced by your own
- * identifying information: "Portions Copyrighted [year]
- * [name of copyright owner]"
- *
- * Contributor(s):
- *
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.faces.config;
-
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.regex.Pattern;
-
-import javax.faces.application.ResourceHandler;
-import javax.faces.application.StateManager;
-import javax.faces.application.ViewHandler;
-import javax.faces.component.UIInput;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.BeanValidator;
-import javax.faces.view.facelets.ResourceResolver;
-import javax.servlet.ServletContext;
-
-import com.sun.faces.util.FacesLogger;
-import com.sun.faces.util.Util;
-
-/** Class Documentation */
-public class WebConfiguration
-{
-
- // Log instance for this class
- private static final Logger LOGGER = FacesLogger.CONFIG.getLogger();
-
- // A Simple regular expression of allowable boolean values
- private static final Pattern ALLOWABLE_BOOLEANS = Pattern
- .compile("true|false");
-
- // Key under which we store our WebConfiguration instance.
- private static final String WEB_CONFIG_KEY = "com.sun.faces.config.WebConfiguration";
-
- // Logging level. Defaults to FINE
- private Level loggingLevel = Level.FINE;
-
- private Map<BooleanWebContextInitParameter, Boolean> booleanContextParameters = new EnumMap<BooleanWebContextInitParameter, Boolean>(
- BooleanWebContextInitParameter.class);
-
- private Map<WebContextInitParameter, String> contextParameters = new EnumMap<WebContextInitParameter, String>(
- WebContextInitParameter.class);
-
- private Map<WebEnvironmentEntry, String> envEntries = new EnumMap<WebEnvironmentEntry, String>(
- WebEnvironmentEntry.class);
-
- private Map<WebContextInitParameter, String[]> cachedListParams;
-
- private List<String> setParams = new ArrayList<String>();
-
- private ServletContext servletContext;
-
- // ------------------------------------------------------------ Constructors
-
- private WebConfiguration(ServletContext servletContext)
- {
-
- this.servletContext = servletContext;
-
- String contextName = getServletContextName();
-
- initSetList(servletContext);
- processBooleanParameters(servletContext, contextName);
- processInitParameters(servletContext, contextName);
- if (canProcessJndiEntries())
- {
- processJndiEntries(contextName);
- }
-
- // build the cache of list type params
- cachedListParams = new HashMap<WebContextInitParameter, String[]>(3);
- getOptionValue(WebContextInitParameter.ResourceExcludes, " ");
- getOptionValue(WebContextInitParameter.DefaultSuffix, " ");
- getOptionValue(WebContextInitParameter.FaceletsViewMappings, ";");
-
- }
-
- // ---------------------------------------------------------- Public Methods
-
- /**
- * Return the WebConfiguration instance for this application passing the
- * result of FacesContext.getCurrentInstance().getExternalContext() to
- * {@link #getInstance(javax.faces.context.ExternalContext)}.
- *
- * @return the WebConfiguration for this application or <code>null</code> if
- * no FacesContext is available.
- */
- public static WebConfiguration getInstance()
- {
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- return getInstance(facesContext.getExternalContext());
-
- }
-
- /**
- * Return the WebConfiguration instance for this application.
- *
- * @param extContext
- * the ExternalContext for this request
- * @return the WebConfiguration for this application
- */
- public static WebConfiguration getInstance(ExternalContext extContext)
- {
-
- WebConfiguration config = (WebConfiguration) extContext
- .getApplicationMap().get(WEB_CONFIG_KEY);
- if (config == null)
- {
- return getInstance((ServletContext) extContext.getContext());
- }
- else
- {
- return config;
- }
-
- }
-
- /**
- * Return the WebConfiguration instance for this application.
- *
- * @param servletContext
- * the ServletContext
- * @return the WebConfiguration for this application or <code>null</code> if
- * no WebConfiguration could be located
- */
- public static WebConfiguration getInstance(ServletContext servletContext)
- {
-
- WebConfiguration webConfig = (WebConfiguration) servletContext
- .getAttribute(WEB_CONFIG_KEY);
-
- if (webConfig == null)
- {
- webConfig = new WebConfiguration(servletContext);
- servletContext.setAttribute(WEB_CONFIG_KEY, webConfig);
- }
- return webConfig;
-
- }
-
- /**
- * @return The <code>ServletContext</code> originally used to construct this
- * WebConfiguration instance
- */
- public ServletContext getServletContext()
- {
-
- return servletContext;
-
- }
-
- /**
- * Obtain the value of the specified boolean parameter
- *
- * @param param
- * the parameter of interest
- * @return the value of the specified boolean parameter
- */
- public boolean isOptionEnabled(BooleanWebContextInitParameter param)
- {
-
- if (booleanContextParameters.get(param) != null)
- {
- return booleanContextParameters.get(param);
- }
- else
- {
- return param.getDefaultValue();
- }
-
- }
-
- /**
- * Obtain the value of the specified parameter
- *
- * @param param
- * the parameter of interest
- * @return the value of the specified parameter
- */
- public String getOptionValue(WebContextInitParameter param)
- {
- String result = contextParameters.get(param);
-
- if (null == result)
- {
- WebContextInitParameter alternate = param.getAlternate();
- if (null != alternate)
- {
- result = contextParameters.get(alternate);
- }
- }
-
- return result;
-
- }
-
- public String[] getOptionValue(WebContextInitParameter param, String sep)
- {
- String[] result;
-
- assert (null != cachedListParams);
- if (null == (result = cachedListParams.get(param)))
- {
- String value = getOptionValue(param);
- if (null == value)
- {
- result = new String[0];
- }
- else
- {
- result = Util.split(value, sep);
- }
- cachedListParams.put(param, result);
- }
-
- return result;
- }
-
- /**
- * Obtain the value of the specified env-entry
- *
- * @param entry
- * the env-entry of interest
- * @return the value of the specified env-entry
- */
- public String getEnvironmentEntry(WebEnvironmentEntry entry)
- {
-
- return envEntries.get(entry);
-
- }
-
- /**
- * @param param
- * the init parameter of interest
- * @return <code>true</code> if the parameter was explicitly set, otherwise,
- * <code>false</code>
- */
- public boolean isSet(WebContextInitParameter param)
- {
-
- return isSet(param.getQualifiedName());
-
- }
-
- /**
- * @param param
- * the init parameter of interest
- * @return <code>true</code> if the parameter was explicitly set, otherwise,
- * <code>false</code>
- */
- public boolean isSet(BooleanWebContextInitParameter param)
- {
-
- return isSet(param.getQualifiedName());
-
- }
-
- /**
- * @return the name of this application
- */
- public String getServletContextName()
- {
-
- if (servletContext.getMajorVersion() == 2
- && servletContext.getMinorVersion() <= 4)
- {
- return servletContext.getServletContextName();
- }
- else
- {
- return servletContext.getContextPath();
- }
-
- }
-
- public void overrideContextInitParameter(
- BooleanWebContextInitParameter param, boolean value)
- {
-
- if (param == null) { return; }
- boolean oldVal = booleanContextParameters.put(param, value);
- if (LOGGER.isLoggable(Level.FINE) && oldVal != value)
- {
- LOGGER
- .log(
- Level.FINE,
- "Overriding init parameter {0}. Changing from {1} to {2}.",
- new Object[]
- {
- param.getQualifiedName(), oldVal, value
- });
- }
-
- }
-
- public void overrideContextInitParameter(WebContextInitParameter param,
- String value)
- {
-
- if (param == null || value == null || value.length() == 0) { return; }
- value = value.trim();
- String oldVal = contextParameters.put(param, value);
- cachedListParams.remove(param);
- if (oldVal != null)
- {
- if (LOGGER.isLoggable(Level.FINE) && !(oldVal.equals(value)))
- {
- LOGGER
- .log(
- Level.FINE,
- "Overriding init parameter {0}. Changing from {1} to {2}.",
- new Object[]
- {
- param.getQualifiedName(), oldVal, value
- });
- }
- }
-
- }
-
- // ------------------------------------------------- Package Private Methods
-
- static void clear(ServletContext servletContext)
- {
-
- servletContext.removeAttribute(WEB_CONFIG_KEY);
-
- }
-
- // --------------------------------------------------------- Private Methods
-
- /**
- * <p>
- * Is the configured value valid against the default boolean pattern.
- * </p>
- *
- * @param param
- * the boolean parameter
- * @param value
- * the configured value
- * @return <code>true</code> if the value is valid, otherwise
- * <code>false</code>
- */
- private boolean isValueValid(BooleanWebContextInitParameter param,
- String value)
- {
-
- if (!ALLOWABLE_BOOLEANS.matcher(value).matches())
- {
- if (LOGGER.isLoggable(Level.WARNING))
- {
- LOGGER.log(Level.WARNING,
- "jsf.config.webconfig.boolconfig.invalidvalue",
- new Object[]
- {
- value, param.getQualifiedName(), "true|false"
- });
- }
- return false;
- }
-
- return true;
-
- }
-
- /**
- * <p>
- * Process all boolean context initialization parameters.
- * </p>
- *
- * @param servletContext
- * the ServletContext of interest
- * @param contextName
- * the context name
- */
- private void processBooleanParameters(ServletContext servletContext,
- String contextName)
- {
-
- // process boolean contxt parameters
- for (BooleanWebContextInitParameter param : BooleanWebContextInitParameter
- .values())
- {
- String strValue = servletContext.getInitParameter(param
- .getQualifiedName());
- boolean value;
-
- if (strValue != null && strValue.length() > 0
- && param.isDeprecated())
- {
- BooleanWebContextInitParameter alternate = param.getAlternate();
- if (LOGGER.isLoggable(Level.WARNING))
- {
- if (alternate != null)
- {
- LOGGER.log(Level.WARNING,
- "jsf.config.webconfig.param.deprecated",
- new Object[]
- {
- contextName, param.getQualifiedName(),
- alternate.getQualifiedName()
- });
- }
- else
- {
- LOGGER
- .log(
- Level.WARNING,
- "jsf.config.webconfig.param.deprecated.no_replacement",
- new Object[]
- {
- contextName,
- param.getQualifiedName()
- });
- }
- }
-
- if (alternate != null)
- {
- if (isValueValid(param, strValue))
- {
- value = Boolean.valueOf(strValue);
- }
- else
- {
- value = param.getDefaultValue();
- }
-
- if (LOGGER.isLoggable(Level.INFO) && alternate != null)
- {
- LOGGER
- .log(
- Level.INFO,
- ((value) ? "jsf.config.webconfig.configinfo.reset.enabled"
- : "jsf.config.webconfig.configinfo.reset.disabled"),
- new Object[]
- {
- contextName,
- alternate.getQualifiedName()
- });
- }
-
- booleanContextParameters.put(alternate, value);
- }
- continue;
- }
-
- if (!param.isDeprecated())
- {
- if (strValue == null)
- {
- value = param.getDefaultValue();
- }
- else
- {
- if (isValueValid(param, strValue))
- {
- value = Boolean.valueOf(strValue);
- }
- else
- {
- value = param.getDefaultValue();
- }
- }
-
- // first param processed should be
- // com.sun.faces.displayConfiguration
- if (BooleanWebContextInitParameter.DisplayConfiguration
- .equals(param)
- && value)
- {
- loggingLevel = Level.INFO;
- }
-
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER
- .log(
- loggingLevel,
- ((value) ? "jsf.config.webconfig.boolconfiginfo.enabled"
- : "jsf.config.webconfig.boolconfiginfo.disabled"),
- new Object[]
- {
- contextName,
- param.getQualifiedName()
- });
- }
-
- booleanContextParameters.put(param, value);
- }
-
- }
-
- }
-
- /**
- * Adds all com.sun.faces init parameter names to a list. This allows
- * callers to determine if a parameter was explicitly set.
- *
- * @param servletContext
- * the ServletContext of interest
- */
- private void initSetList(ServletContext servletContext)
- {
-
- for (Enumeration e = servletContext.getInitParameterNames(); e
- .hasMoreElements();)
- {
- String name = e.nextElement().toString();
- if (name.startsWith("com.sun.faces"))
- {
- setParams.add(name);
- }
- }
-
- }
-
- /**
- * @param name
- * the param name
- * @return <code>true</code> if the name was explicitly specified
- */
- private boolean isSet(String name)
- {
-
- return setParams.contains(name);
-
- }
-
- /**
- * <p>
- * Process all non-boolean context initialization parameters.
- * </p>
- *
- * @param servletContext
- * the ServletContext of interest
- * @param contextName
- * the context name
- */
- private void processInitParameters(ServletContext servletContext,
- String contextName)
- {
-
- for (WebContextInitParameter param : WebContextInitParameter.values())
- {
- String value = servletContext.getInitParameter(param
- .getQualifiedName());
-
- if (value != null && value.length() > 0 && param.isDeprecated())
- {
- WebContextInitParameter alternate = param.getAlternate();
- if (LOGGER.isLoggable(Level.WARNING))
- {
- if (alternate != null)
- {
- LOGGER.log(Level.WARNING,
- "jsf.config.webconfig.param.deprecated",
- new Object[]
- {
- contextName, param.getQualifiedName(),
- alternate.getQualifiedName()
- });
- }
- else
- {
- LOGGER
- .log(
- Level.WARNING,
- "jsf.config.webconfig.param.deprecated.no_replacement",
- new Object[]
- {
- contextName,
- param.getQualifiedName()
- });
- }
- }
-
- if (alternate != null)
- {
- if (LOGGER.isLoggable(Level.INFO))
- {
- LOGGER.log(Level.INFO,
- "jsf.config.webconfig.configinfo.reset",
- new Object[]
- {
- contextName,
- alternate.getQualifiedName(), value
- });
- }
-
- contextParameters.put(alternate, value);
- }
- continue;
- }
-
- if ((value == null || value.length() == 0) && !param.isDeprecated())
- {
- value = param.getDefaultValue();
- }
- if (value == null || value.length() == 0)
- {
- continue;
- }
-
- if (value.length() > 0)
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER.log(loggingLevel, "jsf.config.webconfig.configinfo",
- new Object[]
- {
- contextName, param.getQualifiedName(),
- value
- });
-
- }
- contextParameters.put(param, value);
- }
- else
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER.log(loggingLevel,
- "jsf.config.webconfig.option.notconfigured",
- new Object[]
- {
- contextName, param.getQualifiedName()
- });
- }
- }
-
- }
-
- }
-
- /**
- * <p>
- * Process all JNDI entries.
- * </p>
- *
- * @param contextName
- * the context name
- */
- private void processJndiEntries(String contextName)
- {
-/*
- * This section has been disabled due to incompatibilities with Google App Engine 1.2.6.
- Context initialContext = null;
- try
- {
- initialContext = new InitialContext();
- }
- catch (NamingException ne)
- {
- if (LOGGER.isLoggable(Level.WARNING))
- {
- LOGGER.log(Level.WARNING, ne.toString(), ne);
- }
- }
-
- if (initialContext != null)
- {
- // process environment entries
- for (WebEnvironmentEntry entry : WebEnvironmentEntry.values())
- {
- String entryName = entry.getQualifiedName();
- String value = null;
-
- try
- {
- value = (String) initialContext.lookup(entryName);
- }
- catch (NamingException root)
- {
- if (LOGGER.isLoggable(Level.FINE))
- {
- LOGGER.fine(root.toString());
- }
- }
-
- if (value != null)
- {
- if (LOGGER.isLoggable(Level.INFO))
- {
- // special logic for ClientStateSavingPassword
- if (!entry
- .equals(WebEnvironmentEntry.ClientStateSavingPassword))
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER.log(loggingLevel,
- "jsf.config.webconfig.enventryinfo",
- new Object[]
- {
- contextName, entryName, value
- });
- }
- }
- else
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER
- .log(
- loggingLevel,
- "jsf.config.webconfig.enventry.clientencrypt",
- contextName);
- }
- }
- }
- envEntries.put(entry, value);
- }
- }
- }
-*/
- }
-
- private boolean canProcessJndiEntries()
- {
-
- /*
- * This section has been disabled due to incompatibilities with Google App Engine 1.2.6
- try
- {
- Util.getCurrentLoader(this)
- .loadClass("javax.naming.InitialContext");
- }
- catch (Exception e)
- {
- */
- if (LOGGER.isLoggable(Level.FINE))
- {
- LOGGER
- .fine("javax.naming is forced unavailable. JNDI entries related to Mojarra configuration will not be processed.");
- }
- return false;
- /*
- }
- return true;
- */
-
- }
-
- // ------------------------------------------------------------------- Enums
-
- /**
- * <p>
- * An <code>enum</code> of all non-boolean context initalization parameters
- * recognized by the implementation.
- * </p>
- */
- public enum WebContextInitParameter
- {
-
- // implementation note:
- // if a parameter is to be deprecated,
- // then the <name>Deprecated enum element
- // *must* appear after the one that is taking
- // its place. The reporting logic depends on this
-
- ManagedBeanFactoryDecorator(
- "com.sun.faces.managedBeanFactoryDecoratorClass", ""), StateSavingMethod(
- "javax.faces.STATE_SAVING_METHOD", "server"), FaceletsSuffix(
- ViewHandler.FACELETS_SUFFIX_PARAM_NAME,
- ViewHandler.DEFAULT_FACELETS_SUFFIX), DefaultSuffix(
- ViewHandler.DEFAULT_SUFFIX_PARAM_NAME,
- ViewHandler.DEFAULT_SUFFIX), JavaxFacesConfigFiles(
- "javax.faces.CONFIG_FILES", ""), JavaxFacesProjectStage(
- "javax.faces.PROJECT_STAGE", "Production"), AlternateLifecycleId(
- "javax.faces.LIFECYCLE_ID", ""), ResourceExcludes(
- ResourceHandler.RESOURCE_EXCLUDES_PARAM_NAME,
- ResourceHandler.RESOURCE_EXCLUDES_DEFAULT_VALUE + " .groovy"), NumberOfViews(
- "com.sun.faces.numberOfViewsInSession", "15"), NumberOfViewsDeprecated(
- "com.sun.faces.NUMBER_OF_VIEWS_IN_SESSION", "15", true,
- NumberOfViews), NumberOfLogicalViews(
- "com.sun.faces.numberOfLogicalViews", "15"), NumberOfLogicalViewsDeprecated(
- "com.sun.faces.NUMBER_OF_VIEWS_IN_LOGICAL_VIEW_IN_SESSION",
- "15", true, NumberOfLogicalViews), NumberOfConcurrentFlashUsers(
- "com.sun.faces.numberOfConcerrentFlashUsers", "5000"), NumberOfFlashesBetweenFlashReapings(
- "com.sun.faces.numberOfFlashesBetweenFlashReapings", "5000"), InjectionProviderClass(
- "com.sun.faces.injectionProvider", ""), SerializationProviderClass(
- "com.sun.faces.serializationProvider", ""), ResponseBufferSize(
- "com.sun.faces.responseBufferSize", "1024"), FaceletsBufferSize(
- "javax.faces.FACELETS_BUFFER_SIZE", "1024", true,
- ResponseBufferSize), FaceletsBufferSizeDeprecated(
- "facelets.BUFFER_SIZE", "1024", true, FaceletsBufferSize), ClientStateWriteBufferSize(
- "com.sun.faces.clientStateWriteBufferSize", "8192"), ResourceBufferSize(
- "com.sun.faces.resourceBufferSize", "2048"), ExpressionFactory(
- "com.sun.faces.expressionFactory",
- "com.sun.el.ExpressionFactoryImpl"), ClientStateTimeout(
- "com.sun.faces.clientStateTimeout", ""), DefaultResourceMaxAge(
- "com.sun.faces.defaultResourceMaxAge", "604800"), ResourceUpdateCheckPeriod(
- "com.sun.faces.resourceUpdateCheckPeriod", "5" // in minutes
- ), CompressableMimeTypes("com.sun.faces.compressableMimeTypes", ""), DisableUnicodeEscaping(
- "com.sun.faces.disableUnicodeEscaping", "auto"), FaceletsDefaultRefreshPeriod(
- "javax.faces.FACELETS_REFRESH_PERIOD", "2"), FaceletsDefaultRefreshPeriodDeprecated(
- "facelets.REFRESH_PERIOD", "2", true,
- FaceletsDefaultRefreshPeriod), FaceletsResourceResolver(
- ResourceResolver.FACELETS_RESOURCE_RESOLVER_PARAM_NAME, ""), FaceletsResourceResolverDeprecated(
- "facelets.RESOURCE_RESOLVER", "", true,
- FaceletsResourceResolver), FaceletsViewMappings(
- ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME, ""), FaceletsViewMappingsDeprecated(
- "facelets.VIEW_MAPPINGS", "", true, FaceletsViewMappings), FaceletsLibraries(
- "javax.faces.FACELETS_LIBRARIES", ""), FaceletsLibrariesDeprecated(
- "facelets.LIBRARIES", "", true, FaceletsLibraries), FaceletsDecorators(
- "javax.faces.FACELETS_DECORATORS", ""), FaceletsDecoratorsDeprecated(
- "facelets.DECORATORS", "", true, FaceletsDecorators), DuplicateJARPattern(
- "com.sun.faces.duplicateJARPattern", ""), ValidateEmptyFields(
- UIInput.VALIDATE_EMPTY_FIELDS_PARAM_NAME, "auto"), FullStateSavingViewIds(
- StateManager.FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME, ""), AnnotationScanPackages(
- "com.sun.faces.annotationScanPackages", ""), FaceletFactory(
- "com.sun.faces.faceletFactory", "");
-
- private String defaultValue;
- private String qualifiedName;
- private WebContextInitParameter alternate;
- private boolean deprecated;
-
- // ---------------------------------------------------------- Public
- // Methods
-
- public String getDefaultValue()
- {
-
- return defaultValue;
-
- }
-
- public String getQualifiedName()
- {
-
- return qualifiedName;
-
- }
-
- // ------------------------------------------------- Package Private
- // Methods
-
- WebContextInitParameter(String qualifiedName, String defaultValue)
- {
-
- this(qualifiedName, defaultValue, false, null);
-
- }
-
- WebContextInitParameter(String qualifiedName, String defaultValue,
- boolean deprecated, WebContextInitParameter alternate)
- {
-
- this.qualifiedName = qualifiedName;
- this.defaultValue = defaultValue;
- this.deprecated = deprecated;
- this.alternate = alternate;
-
- }
-
- // --------------------------------------------------------- Private
- // Methods
-
- private WebContextInitParameter getAlternate()
- {
-
- return alternate;
-
- }
-
- private boolean isDeprecated()
- {
-
- return deprecated;
-
- }
-
- }
-
- /**
- * <p>
- * An <code>enum</code> of all boolean context initalization parameters
- * recognized by the implementation.
- * </p>
- */
- public enum BooleanWebContextInitParameter
- {
-
- // implementation note:
- // if a parameter is to be deprecated,
- // then the <name>Deprecated enum element
- // *must* appear after the one that is taking
- // its place. The reporting logic depends on this
-
- DisplayConfiguration("com.sun.faces.displayConfiguration", false), ValidateFacesConfigFiles(
- "com.sun.faces.validateXml", false), VerifyFacesConfigObjects(
- "com.sun.faces.verifyObjects", false), ForceLoadFacesConfigFiles(
- "com.sun.faces.forceLoadConfiguration", false), DisableArtifactVersioning(
- "com.sun.faces.disableVersionTracking", false, true, null), EnableHtmlTagLibraryValidator(
- "com.sun.faces.enableHtmlTagLibValidator", false), EnableCoreTagLibraryValidator(
- "com.sun.faces.enableCoreTagLibValidator", false), PreferXHTMLContentType(
- "com.sun.faces.preferXHTML", false), PreferXHTMLContextTypeDeprecated(
- "com.sun.faces.PreferXHTML", false, true,
- PreferXHTMLContentType), CompressViewState(
- "com.sun.faces.compressViewState", true), CompressViewStateDeprecated(
- "com.sun.faces.COMPRESS_STATE", true, true, CompressViewState), CompressJavaScript(
- "com.sun.faces.compressJavaScript", true), ExternalizeJavaScriptDeprecated(
- "com.sun.faces.externalizeJavaScript", true, true, null), SendPoweredByHeader(
- "com.sun.faces.sendPoweredByHeader", true), EnableJSStyleHiding(
- "com.sun.faces.enableJSStyleHiding", false), EnableScriptInAttributeValue(
- "com.sun.faces.enableScriptsInAttributeValues", true), WriteStateAtFormEnd(
- "com.sun.faces.writeStateAtFormEnd", true), EnableLazyBeanValidation(
- "com.sun.faces.enableLazyBeanValidation", true), EnableLoadBundle11Compatibility(
- "com.sun.faces.enabledLoadBundle11Compatibility", false), EnableRestoreView11Compatibility(
- "com.sun.faces.enableRestoreView11Compatibility", false), SerializeServerState(
- "com.sun.faces.serializeServerState", false), EnableViewStateIdRendering(
- "com.sun.faces.enableViewStateIdRendering", true), RegisterConverterPropertyEditors(
- "com.sun.faces.registerConverterPropertyEditors", false), EnableGroovyScripting(
- "com.sun.faces.enableGroovyScripting", false), DisableFaceletJSFViewHandler(
- "javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER", false), DisableDefaultBeanValidator(
- BeanValidator.DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME, false), DateTimeConverterUsesSystemTimezone(
- "javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE",
- false), FaceletsSkipComments(
- "javax.faces.FACELETS_SKIP_COMMENTS", false), FaceletsSkipCommentsDeprecated(
- "facelets.SKIP_COMMENTS", false, true, FaceletsSkipComments), PartialStateSaving(
- StateManager.PARTIAL_STATE_SAVING_PARAM_NAME, true), GenerateUniqueServerStateIds(
- "com.sun.faces.generateUniqueServerStateIds", true), AutoCompleteOffOnViewState(
- "com.sun.faces.autoCompleteOffOnViewState", true), EnableThreading(
- "com.sun.faces.enableThreading", true), AllowTextChildren(
- "com.sun.faces.allowTextChildren", false);
-
- private BooleanWebContextInitParameter alternate;
-
- private String qualifiedName;
- private boolean defaultValue;
- private boolean deprecated;
-
- // ---------------------------------------------------------- Public
- // Methods
-
- public boolean getDefaultValue()
- {
-
- return defaultValue;
-
- }
-
- public String getQualifiedName()
- {
-
- return qualifiedName;
-
- }
-
- // ------------------------------------------------- Package Private
- // Methods
-
- BooleanWebContextInitParameter(String qualifiedName,
- boolean defaultValue)
- {
-
- this(qualifiedName, defaultValue, false, null);
-
- }
-
- BooleanWebContextInitParameter(String qualifiedName,
- boolean defaultValue, boolean deprecated,
- BooleanWebContextInitParameter alternate)
- {
-
- this.qualifiedName = qualifiedName;
- this.defaultValue = defaultValue;
- this.deprecated = deprecated;
- this.alternate = alternate;
-
- }
-
- // --------------------------------------------------------- Private
- // Methods
-
- private BooleanWebContextInitParameter getAlternate()
- {
-
- return alternate;
-
- }
-
- private boolean isDeprecated()
- {
-
- return deprecated;
-
- }
-
- }
-
- /**
- * <p>
- * An <code>enum</code> of all environment entries (specified in the
- * web.xml) recognized by the implemenetation.
- * </p>
- */
- public enum WebEnvironmentEntry
- {
-
- ClientStateSavingPassword("ClientStateSavingPassword"), ProjectStage(
- javax.faces.application.ProjectStage.PROJECT_STAGE_JNDI_NAME);
-
- private static final String JNDI_PREFIX = "java:comp/env/";
- private String qualifiedName;
-
- // ---------------------------------------------------------- Public
- // Methods
-
- public String getQualifiedName()
- {
-
- return qualifiedName;
-
- }
-
- // ------------------------------------------------- Package Private
- // Methods
-
- WebEnvironmentEntry(String qualifiedName)
- {
-
- if (qualifiedName.startsWith(JNDI_PREFIX))
- {
- this.qualifiedName = qualifiedName;
- }
- else
- {
- this.qualifiedName = JNDI_PREFIX + qualifiedName;
- }
-
- }
-
- }
-
- /**
- * <p>
- * An <code>enum</code> of all possible values for the
- * <code>disableUnicodeEscaping</code> configuration parameter.
- * </p>
- */
- public enum DisableUnicodeEscaping
- {
- True("true"), False("false"), Auto("auto");
-
- private final String value;
-
- DisableUnicodeEscaping(String value)
- {
- this.value = value;
- }
-
- public static DisableUnicodeEscaping getByValue(String value)
- {
- for (DisableUnicodeEscaping disableUnicodeEscaping : DisableUnicodeEscaping
- .values())
- {
- if (disableUnicodeEscaping.value.equals(value)) { return disableUnicodeEscaping; }
- }
-
- return null;
- }
- }
-
-} // END WebConfiguration
\ No newline at end of file
Copied: trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java (from rev 18841, branches/RF-7939-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java)
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java 2010-08-20 15:54:52 UTC (rev 18853)
@@ -0,0 +1,1109 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can obtain
+ * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.faces.config;
+
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Pattern;
+
+import javax.faces.application.ResourceHandler;
+import javax.faces.application.StateManager;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIInput;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.BeanValidator;
+import javax.faces.view.facelets.ResourceResolver;
+import javax.servlet.ServletContext;
+
+import com.sun.faces.util.FacesLogger;
+import com.sun.faces.util.Util;
+
+/** Class Documentation */
+public class WebConfiguration
+{
+
+ // Log instance for this class
+ private static final Logger LOGGER = FacesLogger.CONFIG.getLogger();
+
+ // A Simple regular expression of allowable boolean values
+ private static final Pattern ALLOWABLE_BOOLEANS = Pattern
+ .compile("true|false");
+
+ // Key under which we store our WebConfiguration instance.
+ private static final String WEB_CONFIG_KEY = "com.sun.faces.config.WebConfiguration";
+
+ // Logging level. Defaults to FINE
+ private Level loggingLevel = Level.FINE;
+
+ private Map<BooleanWebContextInitParameter, Boolean> booleanContextParameters = new EnumMap<BooleanWebContextInitParameter, Boolean>(
+ BooleanWebContextInitParameter.class);
+
+ private Map<WebContextInitParameter, String> contextParameters = new EnumMap<WebContextInitParameter, String>(
+ WebContextInitParameter.class);
+
+ private Map<WebEnvironmentEntry, String> envEntries = new EnumMap<WebEnvironmentEntry, String>(
+ WebEnvironmentEntry.class);
+
+ private Map<WebContextInitParameter, String[]> cachedListParams;
+
+ private List<String> setParams = new ArrayList<String>();
+
+ private ServletContext servletContext;
+
+ // ------------------------------------------------------------ Constructors
+
+ private WebConfiguration(ServletContext servletContext)
+ {
+
+ this.servletContext = servletContext;
+
+ String contextName = getServletContextName();
+
+ initSetList(servletContext);
+ processBooleanParameters(servletContext, contextName);
+ processInitParameters(servletContext, contextName);
+ if (canProcessJndiEntries())
+ {
+ processJndiEntries(contextName);
+ }
+
+ // build the cache of list type params
+ cachedListParams = new HashMap<WebContextInitParameter, String[]>(3);
+ getOptionValue(WebContextInitParameter.ResourceExcludes, " ");
+ getOptionValue(WebContextInitParameter.DefaultSuffix, " ");
+ getOptionValue(WebContextInitParameter.FaceletsViewMappings, ";");
+
+ }
+
+ // ---------------------------------------------------------- Public Methods
+
+ /**
+ * Return the WebConfiguration instance for this application passing the
+ * result of FacesContext.getCurrentInstance().getExternalContext() to
+ * {@link #getInstance(javax.faces.context.ExternalContext)}.
+ *
+ * @return the WebConfiguration for this application or <code>null</code> if
+ * no FacesContext is available.
+ */
+ public static WebConfiguration getInstance()
+ {
+
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ return getInstance(facesContext.getExternalContext());
+
+ }
+
+ /**
+ * Return the WebConfiguration instance for this application.
+ *
+ * @param extContext
+ * the ExternalContext for this request
+ * @return the WebConfiguration for this application
+ */
+ public static WebConfiguration getInstance(ExternalContext extContext)
+ {
+
+ WebConfiguration config = (WebConfiguration) extContext
+ .getApplicationMap().get(WEB_CONFIG_KEY);
+ if (config == null)
+ {
+ return getInstance((ServletContext) extContext.getContext());
+ }
+ else
+ {
+ return config;
+ }
+
+ }
+
+ /**
+ * Return the WebConfiguration instance for this application.
+ *
+ * @param servletContext
+ * the ServletContext
+ * @return the WebConfiguration for this application or <code>null</code> if
+ * no WebConfiguration could be located
+ */
+ public static WebConfiguration getInstance(ServletContext servletContext)
+ {
+
+ WebConfiguration webConfig = (WebConfiguration) servletContext
+ .getAttribute(WEB_CONFIG_KEY);
+
+ if (webConfig == null)
+ {
+ webConfig = new WebConfiguration(servletContext);
+ servletContext.setAttribute(WEB_CONFIG_KEY, webConfig);
+ }
+ return webConfig;
+
+ }
+
+ /**
+ * @return The <code>ServletContext</code> originally used to construct this
+ * WebConfiguration instance
+ */
+ public ServletContext getServletContext()
+ {
+
+ return servletContext;
+
+ }
+
+ /**
+ * Obtain the value of the specified boolean parameter
+ *
+ * @param param
+ * the parameter of interest
+ * @return the value of the specified boolean parameter
+ */
+ public boolean isOptionEnabled(BooleanWebContextInitParameter param)
+ {
+
+ if (booleanContextParameters.get(param) != null)
+ {
+ return booleanContextParameters.get(param);
+ }
+ else
+ {
+ return param.getDefaultValue();
+ }
+
+ }
+
+ /**
+ * Obtain the value of the specified parameter
+ *
+ * @param param
+ * the parameter of interest
+ * @return the value of the specified parameter
+ */
+ public String getOptionValue(WebContextInitParameter param)
+ {
+ String result = contextParameters.get(param);
+
+ if (null == result)
+ {
+ WebContextInitParameter alternate = param.getAlternate();
+ if (null != alternate)
+ {
+ result = contextParameters.get(alternate);
+ }
+ }
+
+ return result;
+
+ }
+
+ public String[] getOptionValue(WebContextInitParameter param, String sep)
+ {
+ String[] result;
+
+ assert (null != cachedListParams);
+ if (null == (result = cachedListParams.get(param)))
+ {
+ String value = getOptionValue(param);
+ if (null == value)
+ {
+ result = new String[0];
+ }
+ else
+ {
+ result = Util.split(value, sep);
+ }
+ cachedListParams.put(param, result);
+ }
+
+ return result;
+ }
+
+ /**
+ * Obtain the value of the specified env-entry
+ *
+ * @param entry
+ * the env-entry of interest
+ * @return the value of the specified env-entry
+ */
+ public String getEnvironmentEntry(WebEnvironmentEntry entry)
+ {
+
+ return envEntries.get(entry);
+
+ }
+
+ /**
+ * @param param
+ * the init parameter of interest
+ * @return <code>true</code> if the parameter was explicitly set, otherwise,
+ * <code>false</code>
+ */
+ public boolean isSet(WebContextInitParameter param)
+ {
+
+ return isSet(param.getQualifiedName());
+
+ }
+
+ /**
+ * @param param
+ * the init parameter of interest
+ * @return <code>true</code> if the parameter was explicitly set, otherwise,
+ * <code>false</code>
+ */
+ public boolean isSet(BooleanWebContextInitParameter param)
+ {
+
+ return isSet(param.getQualifiedName());
+
+ }
+
+ /**
+ * @return the name of this application
+ */
+ public String getServletContextName()
+ {
+
+ if (servletContext.getMajorVersion() == 2
+ && servletContext.getMinorVersion() <= 4)
+ {
+ return servletContext.getServletContextName();
+ }
+ else
+ {
+ return servletContext.getContextPath();
+ }
+
+ }
+
+ public void overrideContextInitParameter(
+ BooleanWebContextInitParameter param, boolean value)
+ {
+
+ if (param == null) { return; }
+ boolean oldVal = booleanContextParameters.put(param, value);
+ if (LOGGER.isLoggable(Level.FINE) && oldVal != value)
+ {
+ LOGGER
+ .log(
+ Level.FINE,
+ "Overriding init parameter {0}. Changing from {1} to {2}.",
+ new Object[]
+ {
+ param.getQualifiedName(), oldVal, value
+ });
+ }
+
+ }
+
+ public void overrideContextInitParameter(WebContextInitParameter param,
+ String value)
+ {
+
+ if (param == null || value == null || value.length() == 0) { return; }
+ value = value.trim();
+ String oldVal = contextParameters.put(param, value);
+ cachedListParams.remove(param);
+ if (oldVal != null)
+ {
+ if (LOGGER.isLoggable(Level.FINE) && !(oldVal.equals(value)))
+ {
+ LOGGER
+ .log(
+ Level.FINE,
+ "Overriding init parameter {0}. Changing from {1} to {2}.",
+ new Object[]
+ {
+ param.getQualifiedName(), oldVal, value
+ });
+ }
+ }
+
+ }
+
+ // ------------------------------------------------- Package Private Methods
+
+ static void clear(ServletContext servletContext)
+ {
+
+ servletContext.removeAttribute(WEB_CONFIG_KEY);
+
+ }
+
+ // --------------------------------------------------------- Private Methods
+
+ /**
+ * <p>
+ * Is the configured value valid against the default boolean pattern.
+ * </p>
+ *
+ * @param param
+ * the boolean parameter
+ * @param value
+ * the configured value
+ * @return <code>true</code> if the value is valid, otherwise
+ * <code>false</code>
+ */
+ private boolean isValueValid(BooleanWebContextInitParameter param,
+ String value)
+ {
+
+ if (!ALLOWABLE_BOOLEANS.matcher(value).matches())
+ {
+ if (LOGGER.isLoggable(Level.WARNING))
+ {
+ LOGGER.log(Level.WARNING,
+ "jsf.config.webconfig.boolconfig.invalidvalue",
+ new Object[]
+ {
+ value, param.getQualifiedName(), "true|false"
+ });
+ }
+ return false;
+ }
+
+ return true;
+
+ }
+
+ /**
+ * <p>
+ * Process all boolean context initialization parameters.
+ * </p>
+ *
+ * @param servletContext
+ * the ServletContext of interest
+ * @param contextName
+ * the context name
+ */
+ private void processBooleanParameters(ServletContext servletContext,
+ String contextName)
+ {
+
+ // process boolean contxt parameters
+ for (BooleanWebContextInitParameter param : BooleanWebContextInitParameter
+ .values())
+ {
+ String strValue = servletContext.getInitParameter(param
+ .getQualifiedName());
+ boolean value;
+
+ if (strValue != null && strValue.length() > 0
+ && param.isDeprecated())
+ {
+ BooleanWebContextInitParameter alternate = param.getAlternate();
+ if (LOGGER.isLoggable(Level.WARNING))
+ {
+ if (alternate != null)
+ {
+ LOGGER.log(Level.WARNING,
+ "jsf.config.webconfig.param.deprecated",
+ new Object[]
+ {
+ contextName, param.getQualifiedName(),
+ alternate.getQualifiedName()
+ });
+ }
+ else
+ {
+ LOGGER
+ .log(
+ Level.WARNING,
+ "jsf.config.webconfig.param.deprecated.no_replacement",
+ new Object[]
+ {
+ contextName,
+ param.getQualifiedName()
+ });
+ }
+ }
+
+ if (alternate != null)
+ {
+ if (isValueValid(param, strValue))
+ {
+ value = Boolean.valueOf(strValue);
+ }
+ else
+ {
+ value = param.getDefaultValue();
+ }
+
+ if (LOGGER.isLoggable(Level.INFO) && alternate != null)
+ {
+ LOGGER
+ .log(
+ Level.INFO,
+ ((value) ? "jsf.config.webconfig.configinfo.reset.enabled"
+ : "jsf.config.webconfig.configinfo.reset.disabled"),
+ new Object[]
+ {
+ contextName,
+ alternate.getQualifiedName()
+ });
+ }
+
+ booleanContextParameters.put(alternate, value);
+ }
+ continue;
+ }
+
+ if (!param.isDeprecated())
+ {
+ if (strValue == null)
+ {
+ value = param.getDefaultValue();
+ }
+ else
+ {
+ if (isValueValid(param, strValue))
+ {
+ value = Boolean.valueOf(strValue);
+ }
+ else
+ {
+ value = param.getDefaultValue();
+ }
+ }
+
+ // first param processed should be
+ // com.sun.faces.displayConfiguration
+ if (BooleanWebContextInitParameter.DisplayConfiguration
+ .equals(param)
+ && value)
+ {
+ loggingLevel = Level.INFO;
+ }
+
+ if (LOGGER.isLoggable(loggingLevel))
+ {
+ LOGGER
+ .log(
+ loggingLevel,
+ ((value) ? "jsf.config.webconfig.boolconfiginfo.enabled"
+ : "jsf.config.webconfig.boolconfiginfo.disabled"),
+ new Object[]
+ {
+ contextName,
+ param.getQualifiedName()
+ });
+ }
+
+ booleanContextParameters.put(param, value);
+ }
+
+ }
+
+ }
+
+ /**
+ * Adds all com.sun.faces init parameter names to a list. This allows
+ * callers to determine if a parameter was explicitly set.
+ *
+ * @param servletContext
+ * the ServletContext of interest
+ */
+ private void initSetList(ServletContext servletContext)
+ {
+
+ for (Enumeration e = servletContext.getInitParameterNames(); e
+ .hasMoreElements();)
+ {
+ String name = e.nextElement().toString();
+ if (name.startsWith("com.sun.faces"))
+ {
+ setParams.add(name);
+ }
+ }
+
+ }
+
+ /**
+ * @param name
+ * the param name
+ * @return <code>true</code> if the name was explicitly specified
+ */
+ private boolean isSet(String name)
+ {
+
+ return setParams.contains(name);
+
+ }
+
+ /**
+ * <p>
+ * Process all non-boolean context initialization parameters.
+ * </p>
+ *
+ * @param servletContext
+ * the ServletContext of interest
+ * @param contextName
+ * the context name
+ */
+ private void processInitParameters(ServletContext servletContext,
+ String contextName)
+ {
+
+ for (WebContextInitParameter param : WebContextInitParameter.values())
+ {
+ String value = servletContext.getInitParameter(param
+ .getQualifiedName());
+
+ if (value != null && value.length() > 0 && param.isDeprecated())
+ {
+ WebContextInitParameter alternate = param.getAlternate();
+ if (LOGGER.isLoggable(Level.WARNING))
+ {
+ if (alternate != null)
+ {
+ LOGGER.log(Level.WARNING,
+ "jsf.config.webconfig.param.deprecated",
+ new Object[]
+ {
+ contextName, param.getQualifiedName(),
+ alternate.getQualifiedName()
+ });
+ }
+ else
+ {
+ LOGGER
+ .log(
+ Level.WARNING,
+ "jsf.config.webconfig.param.deprecated.no_replacement",
+ new Object[]
+ {
+ contextName,
+ param.getQualifiedName()
+ });
+ }
+ }
+
+ if (alternate != null)
+ {
+ if (LOGGER.isLoggable(Level.INFO))
+ {
+ LOGGER.log(Level.INFO,
+ "jsf.config.webconfig.configinfo.reset",
+ new Object[]
+ {
+ contextName,
+ alternate.getQualifiedName(), value
+ });
+ }
+
+ contextParameters.put(alternate, value);
+ }
+ continue;
+ }
+
+ if ((value == null || value.length() == 0) && !param.isDeprecated())
+ {
+ value = param.getDefaultValue();
+ }
+ if (value == null || value.length() == 0)
+ {
+ continue;
+ }
+
+ if (value.length() > 0)
+ {
+ if (LOGGER.isLoggable(loggingLevel))
+ {
+ LOGGER.log(loggingLevel, "jsf.config.webconfig.configinfo",
+ new Object[]
+ {
+ contextName, param.getQualifiedName(),
+ value
+ });
+
+ }
+ contextParameters.put(param, value);
+ }
+ else
+ {
+ if (LOGGER.isLoggable(loggingLevel))
+ {
+ LOGGER.log(loggingLevel,
+ "jsf.config.webconfig.option.notconfigured",
+ new Object[]
+ {
+ contextName, param.getQualifiedName()
+ });
+ }
+ }
+
+ }
+
+ }
+
+ /**
+ * <p>
+ * Process all JNDI entries.
+ * </p>
+ *
+ * @param contextName
+ * the context name
+ */
+ private void processJndiEntries(String contextName)
+ {
+/*
+ * This section has been disabled due to incompatibilities with Google App Engine 1.2.6.
+ Context initialContext = null;
+ try
+ {
+ initialContext = new InitialContext();
+ }
+ catch (NamingException ne)
+ {
+ if (LOGGER.isLoggable(Level.WARNING))
+ {
+ LOGGER.log(Level.WARNING, ne.toString(), ne);
+ }
+ }
+
+ if (initialContext != null)
+ {
+ // process environment entries
+ for (WebEnvironmentEntry entry : WebEnvironmentEntry.values())
+ {
+ String entryName = entry.getQualifiedName();
+ String value = null;
+
+ try
+ {
+ value = (String) initialContext.lookup(entryName);
+ }
+ catch (NamingException root)
+ {
+ if (LOGGER.isLoggable(Level.FINE))
+ {
+ LOGGER.fine(root.toString());
+ }
+ }
+
+ if (value != null)
+ {
+ if (LOGGER.isLoggable(Level.INFO))
+ {
+ // special logic for ClientStateSavingPassword
+ if (!entry
+ .equals(WebEnvironmentEntry.ClientStateSavingPassword))
+ {
+ if (LOGGER.isLoggable(loggingLevel))
+ {
+ LOGGER.log(loggingLevel,
+ "jsf.config.webconfig.enventryinfo",
+ new Object[]
+ {
+ contextName, entryName, value
+ });
+ }
+ }
+ else
+ {
+ if (LOGGER.isLoggable(loggingLevel))
+ {
+ LOGGER
+ .log(
+ loggingLevel,
+ "jsf.config.webconfig.enventry.clientencrypt",
+ contextName);
+ }
+ }
+ }
+ envEntries.put(entry, value);
+ }
+ }
+ }
+*/
+ }
+
+ private boolean canProcessJndiEntries()
+ {
+
+ /*
+ * This section has been disabled due to incompatibilities with Google App Engine 1.2.6
+ try
+ {
+ Util.getCurrentLoader(this)
+ .loadClass("javax.naming.InitialContext");
+ }
+ catch (Exception e)
+ {
+ */
+ if (LOGGER.isLoggable(Level.FINE))
+ {
+ LOGGER
+ .fine("javax.naming is forced unavailable. JNDI entries related to Mojarra configuration will not be processed.");
+ }
+ return false;
+ /*
+ }
+ return true;
+ */
+
+ }
+
+ // ------------------------------------------------------------------- Enums
+
+ /**
+ * <p>
+ * An <code>enum</code> of all non-boolean context initalization parameters
+ * recognized by the implementation.
+ * </p>
+ */
+ public enum WebContextInitParameter
+ {
+
+ // implementation note:
+ // if a parameter is to be deprecated,
+ // then the <name>Deprecated enum element
+ // *must* appear after the one that is taking
+ // its place. The reporting logic depends on this
+
+ ManagedBeanFactoryDecorator(
+ "com.sun.faces.managedBeanFactoryDecoratorClass", ""), StateSavingMethod(
+ "javax.faces.STATE_SAVING_METHOD", "server"), FaceletsSuffix(
+ ViewHandler.FACELETS_SUFFIX_PARAM_NAME,
+ ViewHandler.DEFAULT_FACELETS_SUFFIX), DefaultSuffix(
+ ViewHandler.DEFAULT_SUFFIX_PARAM_NAME,
+ ViewHandler.DEFAULT_SUFFIX), JavaxFacesConfigFiles(
+ "javax.faces.CONFIG_FILES", ""), JavaxFacesProjectStage(
+ "javax.faces.PROJECT_STAGE", "Production"), AlternateLifecycleId(
+ "javax.faces.LIFECYCLE_ID", ""), ResourceExcludes(
+ ResourceHandler.RESOURCE_EXCLUDES_PARAM_NAME,
+ ResourceHandler.RESOURCE_EXCLUDES_DEFAULT_VALUE + " .groovy"), NumberOfViews(
+ "com.sun.faces.numberOfViewsInSession", "15"), NumberOfViewsDeprecated(
+ "com.sun.faces.NUMBER_OF_VIEWS_IN_SESSION", "15", true,
+ NumberOfViews), NumberOfLogicalViews(
+ "com.sun.faces.numberOfLogicalViews", "15"), NumberOfLogicalViewsDeprecated(
+ "com.sun.faces.NUMBER_OF_VIEWS_IN_LOGICAL_VIEW_IN_SESSION",
+ "15", true, NumberOfLogicalViews), NumberOfConcurrentFlashUsers(
+ "com.sun.faces.numberOfConcerrentFlashUsers", "5000"), NumberOfFlashesBetweenFlashReapings(
+ "com.sun.faces.numberOfFlashesBetweenFlashReapings", "5000"), InjectionProviderClass(
+ "com.sun.faces.injectionProvider", ""), SerializationProviderClass(
+ "com.sun.faces.serializationProvider", ""), ResponseBufferSize(
+ "com.sun.faces.responseBufferSize", "1024"), FaceletsBufferSize(
+ "javax.faces.FACELETS_BUFFER_SIZE", "1024", true,
+ ResponseBufferSize), FaceletsBufferSizeDeprecated(
+ "facelets.BUFFER_SIZE", "1024", true, FaceletsBufferSize), ClientStateWriteBufferSize(
+ "com.sun.faces.clientStateWriteBufferSize", "8192"), ResourceBufferSize(
+ "com.sun.faces.resourceBufferSize", "2048"), ExpressionFactory(
+ "com.sun.faces.expressionFactory",
+ "com.sun.el.ExpressionFactoryImpl"), ClientStateTimeout(
+ "com.sun.faces.clientStateTimeout", ""), DefaultResourceMaxAge(
+ "com.sun.faces.defaultResourceMaxAge", "604800"), ResourceUpdateCheckPeriod(
+ "com.sun.faces.resourceUpdateCheckPeriod", "5" // in minutes
+ ), CompressableMimeTypes("com.sun.faces.compressableMimeTypes", ""), DisableUnicodeEscaping(
+ "com.sun.faces.disableUnicodeEscaping", "auto"), FaceletsDefaultRefreshPeriod(
+ "javax.faces.FACELETS_REFRESH_PERIOD", "2"), FaceletsDefaultRefreshPeriodDeprecated(
+ "facelets.REFRESH_PERIOD", "2", true,
+ FaceletsDefaultRefreshPeriod), FaceletsResourceResolver(
+ ResourceResolver.FACELETS_RESOURCE_RESOLVER_PARAM_NAME, ""), FaceletsResourceResolverDeprecated(
+ "facelets.RESOURCE_RESOLVER", "", true,
+ FaceletsResourceResolver), FaceletsViewMappings(
+ ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME, ""), FaceletsViewMappingsDeprecated(
+ "facelets.VIEW_MAPPINGS", "", true, FaceletsViewMappings), FaceletsLibraries(
+ "javax.faces.FACELETS_LIBRARIES", ""), FaceletsLibrariesDeprecated(
+ "facelets.LIBRARIES", "", true, FaceletsLibraries), FaceletsDecorators(
+ "javax.faces.FACELETS_DECORATORS", ""), FaceletsDecoratorsDeprecated(
+ "facelets.DECORATORS", "", true, FaceletsDecorators), DuplicateJARPattern(
+ "com.sun.faces.duplicateJARPattern", ""), ValidateEmptyFields(
+ UIInput.VALIDATE_EMPTY_FIELDS_PARAM_NAME, "auto"), FullStateSavingViewIds(
+ StateManager.FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME, ""), AnnotationScanPackages(
+ "com.sun.faces.annotationScanPackages", ""), FaceletFactory(
+ "com.sun.faces.faceletFactory", "");
+
+ private String defaultValue;
+ private String qualifiedName;
+ private WebContextInitParameter alternate;
+ private boolean deprecated;
+
+ // ---------------------------------------------------------- Public
+ // Methods
+
+ public String getDefaultValue()
+ {
+
+ return defaultValue;
+
+ }
+
+ public String getQualifiedName()
+ {
+
+ return qualifiedName;
+
+ }
+
+ // ------------------------------------------------- Package Private
+ // Methods
+
+ WebContextInitParameter(String qualifiedName, String defaultValue)
+ {
+
+ this(qualifiedName, defaultValue, false, null);
+
+ }
+
+ WebContextInitParameter(String qualifiedName, String defaultValue,
+ boolean deprecated, WebContextInitParameter alternate)
+ {
+
+ this.qualifiedName = qualifiedName;
+ this.defaultValue = defaultValue;
+ this.deprecated = deprecated;
+ this.alternate = alternate;
+
+ }
+
+ // --------------------------------------------------------- Private
+ // Methods
+
+ private WebContextInitParameter getAlternate()
+ {
+
+ return alternate;
+
+ }
+
+ private boolean isDeprecated()
+ {
+
+ return deprecated;
+
+ }
+
+ }
+
+ /**
+ * <p>
+ * An <code>enum</code> of all boolean context initalization parameters
+ * recognized by the implementation.
+ * </p>
+ */
+ public enum BooleanWebContextInitParameter
+ {
+
+ // implementation note:
+ // if a parameter is to be deprecated,
+ // then the <name>Deprecated enum element
+ // *must* appear after the one that is taking
+ // its place. The reporting logic depends on this
+
+ DisplayConfiguration("com.sun.faces.displayConfiguration", false), ValidateFacesConfigFiles(
+ "com.sun.faces.validateXml", false), VerifyFacesConfigObjects(
+ "com.sun.faces.verifyObjects", false), ForceLoadFacesConfigFiles(
+ "com.sun.faces.forceLoadConfiguration", false), DisableArtifactVersioning(
+ "com.sun.faces.disableVersionTracking", false, true, null), EnableHtmlTagLibraryValidator(
+ "com.sun.faces.enableHtmlTagLibValidator", false), EnableCoreTagLibraryValidator(
+ "com.sun.faces.enableCoreTagLibValidator", false), PreferXHTMLContentType(
+ "com.sun.faces.preferXHTML", false), PreferXHTMLContextTypeDeprecated(
+ "com.sun.faces.PreferXHTML", false, true,
+ PreferXHTMLContentType), CompressViewState(
+ "com.sun.faces.compressViewState", true), CompressViewStateDeprecated(
+ "com.sun.faces.COMPRESS_STATE", true, true, CompressViewState), CompressJavaScript(
+ "com.sun.faces.compressJavaScript", true), ExternalizeJavaScriptDeprecated(
+ "com.sun.faces.externalizeJavaScript", true, true, null), SendPoweredByHeader(
+ "com.sun.faces.sendPoweredByHeader", true), EnableJSStyleHiding(
+ "com.sun.faces.enableJSStyleHiding", false), EnableScriptInAttributeValue(
+ "com.sun.faces.enableScriptsInAttributeValues", true), WriteStateAtFormEnd(
+ "com.sun.faces.writeStateAtFormEnd", true), EnableLazyBeanValidation(
+ "com.sun.faces.enableLazyBeanValidation", true), EnableLoadBundle11Compatibility(
+ "com.sun.faces.enabledLoadBundle11Compatibility", false), EnableRestoreView11Compatibility(
+ "com.sun.faces.enableRestoreView11Compatibility", false), SerializeServerState(
+ "com.sun.faces.serializeServerState", false), EnableViewStateIdRendering(
+ "com.sun.faces.enableViewStateIdRendering", true), RegisterConverterPropertyEditors(
+ "com.sun.faces.registerConverterPropertyEditors", false), EnableGroovyScripting(
+ "com.sun.faces.enableGroovyScripting", false), DisableFaceletJSFViewHandler(
+ "javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER", false), DisableDefaultBeanValidator(
+ BeanValidator.DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME, false), DateTimeConverterUsesSystemTimezone(
+ "javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE",
+ false), FaceletsSkipComments(
+ "javax.faces.FACELETS_SKIP_COMMENTS", false), FaceletsSkipCommentsDeprecated(
+ "facelets.SKIP_COMMENTS", false, true, FaceletsSkipComments), PartialStateSaving(
+ StateManager.PARTIAL_STATE_SAVING_PARAM_NAME, true), GenerateUniqueServerStateIds(
+ "com.sun.faces.generateUniqueServerStateIds", true), AutoCompleteOffOnViewState(
+ "com.sun.faces.autoCompleteOffOnViewState", true), EnableThreading(
+ "com.sun.faces.enableThreading", true), AllowTextChildren(
+ "com.sun.faces.allowTextChildren", false);
+
+ private BooleanWebContextInitParameter alternate;
+
+ private String qualifiedName;
+ private boolean defaultValue;
+ private boolean deprecated;
+
+ // ---------------------------------------------------------- Public
+ // Methods
+
+ public boolean getDefaultValue()
+ {
+
+ return defaultValue;
+
+ }
+
+ public String getQualifiedName()
+ {
+
+ return qualifiedName;
+
+ }
+
+ // ------------------------------------------------- Package Private
+ // Methods
+
+ BooleanWebContextInitParameter(String qualifiedName,
+ boolean defaultValue)
+ {
+
+ this(qualifiedName, defaultValue, false, null);
+
+ }
+
+ BooleanWebContextInitParameter(String qualifiedName,
+ boolean defaultValue, boolean deprecated,
+ BooleanWebContextInitParameter alternate)
+ {
+
+ this.qualifiedName = qualifiedName;
+ this.defaultValue = defaultValue;
+ this.deprecated = deprecated;
+ this.alternate = alternate;
+
+ }
+
+ // --------------------------------------------------------- Private
+ // Methods
+
+ private BooleanWebContextInitParameter getAlternate()
+ {
+
+ return alternate;
+
+ }
+
+ private boolean isDeprecated()
+ {
+
+ return deprecated;
+
+ }
+
+ }
+
+ /**
+ * <p>
+ * An <code>enum</code> of all environment entries (specified in the
+ * web.xml) recognized by the implemenetation.
+ * </p>
+ */
+ public enum WebEnvironmentEntry
+ {
+
+ ClientStateSavingPassword("ClientStateSavingPassword"), ProjectStage(
+ javax.faces.application.ProjectStage.PROJECT_STAGE_JNDI_NAME);
+
+ private static final String JNDI_PREFIX = "java:comp/env/";
+ private String qualifiedName;
+
+ // ---------------------------------------------------------- Public
+ // Methods
+
+ public String getQualifiedName()
+ {
+
+ return qualifiedName;
+
+ }
+
+ // ------------------------------------------------- Package Private
+ // Methods
+
+ WebEnvironmentEntry(String qualifiedName)
+ {
+
+ if (qualifiedName.startsWith(JNDI_PREFIX))
+ {
+ this.qualifiedName = qualifiedName;
+ }
+ else
+ {
+ this.qualifiedName = JNDI_PREFIX + qualifiedName;
+ }
+
+ }
+
+ }
+
+ /**
+ * <p>
+ * An <code>enum</code> of all possible values for the
+ * <code>disableUnicodeEscaping</code> configuration parameter.
+ * </p>
+ */
+ public enum DisableUnicodeEscaping
+ {
+ True("true"), False("false"), Auto("auto");
+
+ private final String value;
+
+ DisableUnicodeEscaping(String value)
+ {
+ this.value = value;
+ }
+
+ public static DisableUnicodeEscaping getByValue(String value)
+ {
+ for (DisableUnicodeEscaping disableUnicodeEscaping : DisableUnicodeEscaping
+ .values())
+ {
+ if (disableUnicodeEscaping.value.equals(value)) { return disableUnicodeEscaping; }
+ }
+
+ return null;
+ }
+ }
+
+} // END WebConfiguration
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/resources/META-INF/jdoconfig.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/META-INF/jdoconfig.xml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/resources/META-INF/jdoconfig.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+ <persistence-manager-factory name="transactions-optional">
+ <property name="javax.jdo.PersistenceManagerFactoryClass"
+ value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
+ <property name="javax.jdo.option.ConnectionURL" value="appengine"/>
+ <property name="javax.jdo.option.NontransactionalRead" value="true"/>
+ <property name="javax.jdo.option.NontransactionalWrite" value="true"/>
+ <property name="javax.jdo.option.RetainValues" value="true"/>
+ <property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
+ </persistence-manager-factory>
+</jdoconfig>
Added: trunk/examples/richfaces-showcase/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/META-INF/persistence.xml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/resources/META-INF/persistence.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+ <persistence-unit name="transactions-optional">
+ <provider>org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider</provider>
+ <properties>
+ <property name="datanucleus.NontransactionalRead" value="true"/>
+ <property name="datanucleus.NontransactionalWrite" value="true"/>
+ <property name="datanucleus.ConnectionURL" value="appengine"/>
+ </properties>
+ </persistence-unit>
+
+</persistence>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/resources/ant-macros.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/ant-macros.xml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/resources/ant-macros.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -0,0 +1,106 @@
+<!--
+ This file contains useful Ant definitions for users of App Engine.
+ To use these macrodefs and taskdefs, import the file into your own build.xml:
+
+ <property name="appengine.sdk.dir" location="/some_dir/appengine-java-sdk-trunk"/>
+ <import file="${appengine.sdk.dir}/config/user/ant-macros.xml"/>
+
+ For example uses of the macros, see the template project's build.xml.
+ -->
+<project name="appengine-ant-macros">
+
+ <property name="appengine.sdk.home" location="${ant.file.appengine-ant-macros}../../../.."/>
+ <property name="appengine.tools.classpath"
+ location="${appengine.sdk.home}/lib/appengine-tools-api.jar"/>
+
+ <!--
+ A macrodef for dev_appserver. Use like:
+
+ <dev_appserver war="${war}"/>
+ -->
+ <macrodef name="dev_appserver" description="Runs the App Engine Development App Server">
+ <attribute name="war" description="The exploded war directory containing the application"/>
+ <attribute name="port" default="8080" description="The port the server starts on"/>
+ <attribute name="address" default="localhost" description="The interface the server binds to"/>
+ <element name="options" optional="true" description="Additional options for dev_appserver"/>
+ <element name="args" optional="true" description="Additional arguments for the java task"/>
+
+ <sequential>
+ <java classname="com.google.appengine.tools.KickStart"
+ classpath="${appengine.tools.classpath}"
+ fork="true">
+ <arg value="com.google.appengine.tools.development.DevAppServerMain"/>
+ <arg value="--port=@{port}"/>
+ <arg value="--address=@{address}"/>
+ <options/>
+ <arg value="@{war}"/>
+ <args/>
+ </java>
+ </sequential>
+ </macrodef>
+
+ <!--
+ A macrodef for appcfg. Use like:
+
+ <appcfg action="update" war="${war}"/>
+
+ -->
+ <macrodef name="appcfg" description="Manages an application">
+ <attribute name="war" description="The exploded war directory containing the application"/>
+ <attribute name="action" description="One of (update, rollback, update_indexes, request_logs)"/>
+ <element name="options" optional="true" description="Options for appcfg (such as --server, --num_days, etc...)"/>
+ <element name="args" optional="true" description="Additional arguments for the java task"/>
+
+ <sequential>
+ <java classname="com.google.appengine.tools.admin.AppCfg"
+ classpath="${appengine.tools.classpath}"
+ fork="true">
+ <arg value="--disable_prompt"/>
+ <options/>
+ <arg value="@{action}"/>
+ <arg value="@{war}"/>
+ <args/>
+ </java>
+ </sequential>
+ </macrodef>
+
+ <!--
+ A taskdef for ORM enhancement. Use like:
+
+ <enhance failonerror="true">
+ <classpath>
+ <pathelement path="${appengine.tools.classpath}"/>
+ <pathelement path="@{war}/WEB-INF/classes"/>
+ <fileset dir="@{war}/WEB-INF/lib" includes="*.jar"/>
+ </classpath>
+ <fileset dir="@{war}/WEB-INF/classes" includes="**/*.class"/>
+ </enhance>
+
+ Alternatively, use the <enhance_war/> macrodef below.
+ -->
+ <taskdef name="enhance"
+ classpath="${appengine.tools.classpath}"
+ classname="com.google.appengine.tools.enhancer.EnhancerTask"/>
+
+ <!--
+ A macrodef for ORM enhancement for a war. Use like:
+
+ <enhance_war war="${war}"/>
+ -->
+ <macrodef name="enhance_war" description="Run the ORM enhancer on an exploded war">
+ <attribute name="war" description="The exploded war directory containing the application"/>
+ <element name="args" optional="true" description="Additional arguments to the enhancer"/>
+ <sequential>
+ <enhance failonerror="true">
+ <args/>
+ <classpath>
+ <pathelement path="${appengine.tools.classpath}"/>
+ <pathelement path="@{war}/WEB-INF/classes"/>
+ <fileset dir="@{war}/WEB-INF/lib" includes="*.jar"/>
+ </classpath>
+ <fileset dir="@{war}/WEB-INF/classes" includes="**/*.class"/>
+ </enhance>
+ </sequential>
+ </macrodef>
+
+</project>
Added: trunk/examples/richfaces-showcase/src/main/resources/log4j.properties
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/log4j.properties (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/resources/log4j.properties 2010-08-20 15:54:52 UTC (rev 18853)
@@ -0,0 +1,24 @@
+# A default log4j configuration for log4j users.
+#
+# To use this configuration, deploy it into your application's WEB-INF/classes
+# directory. You are also encouraged to edit it as you like.
+
+# Configure the console as our one appender
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
+
+# tighten logging on the DataNucleus Categories
+log4j.category.DataNucleus.JDO=WARN, A1
+log4j.category.DataNucleus.Persistence=WARN, A1
+log4j.category.DataNucleus.Cache=WARN, A1
+log4j.category.DataNucleus.MetaData=WARN, A1
+log4j.category.DataNucleus.General=WARN, A1
+log4j.category.DataNucleus.Utility=WARN, A1
+log4j.category.DataNucleus.Transaction=WARN, A1
+log4j.category.DataNucleus.Datastore=WARN, A1
+log4j.category.DataNucleus.ClassLoading=WARN, A1
+log4j.category.DataNucleus.Plugin=WARN, A1
+log4j.category.DataNucleus.ValueGeneration=WARN, A1
+log4j.category.DataNucleus.Enhancer=WARN, A1
+log4j.category.DataNucleus.SchemaTool=WARN, A1
Added: trunk/examples/richfaces-showcase/src/main/resources/logging.properties
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/logging.properties (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/resources/logging.properties 2010-08-20 15:54:52 UTC (rev 18853)
@@ -0,0 +1,28 @@
+# A default java.util.logging configuration.
+# (All App Engine logging is through java.util.logging by default).
+#
+# To use this configuration, copy it into your application's WEB-INF
+# folder and add the following to your appengine-web.xml:
+#
+# <system-properties>
+# <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
+# </system-properties>
+#
+
+# Set the default logging level for all loggers to WARNING
+.level = WARNING
+
+# Set the default logging level for ORM, specifically, to WARNING
+DataNucleus.JDO.level=WARNING
+DataNucleus.Persistence.level=WARNING
+DataNucleus.Cache.level=WARNING
+DataNucleus.MetaData.level=WARNING
+DataNucleus.General.level=WARNING
+DataNucleus.Utility.level=WARNING
+DataNucleus.Transaction.level=WARNING
+DataNucleus.Datastore.level=WARNING
+DataNucleus.ClassLoading.level=WARNING
+DataNucleus.Plugin.level=WARNING
+DataNucleus.ValueGeneration.level=WARNING
+DataNucleus.Enhancer.level=WARNING
+DataNucleus.SchemaTool.level=WARNING
Modified: trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -162,7 +162,7 @@
</sample>
</samples>
</demo>
- <demo>
+ <demo new="true">
<id>mediaOutput</id>
<name>a4j:mediaOutput</name>
<samples>
Added: trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/appengine-web.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/appengine-web.xml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/appengine-web.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
+ <application>richfaces-showcase-gae</application>
+ <version>8</version>
+ <sessions-enabled>true</sessions-enabled>
+
+ <system-properties>
+ <property name="java.util.logging.config.file" value="WEB-INF/classes/logging.properties"/>
+ </system-properties>
+
+</appengine-web-app>
Modified: trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -1,49 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="richfaces-showcase" version="2.5">
- <display-name>richfaces-showcase</display-name>
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- <welcome-file>index.htm</welcome-file>
- <welcome-file>index.jsp</welcome-file>
- <welcome-file>default.html</welcome-file>
- <welcome-file>default.htm</welcome-file>
- <welcome-file>default.jsp</welcome-file>
- </welcome-file-list>
- <context-param>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="richfaces-showcase" version="2.5">
+ <display-name>richfaces-showcase</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+ <context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/app-tags.taglib.xml</param-value>
</context-param>
- <context-param>
- <param-name>org.richfaces.enableControlSkinning</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.enableControlSkinningClasses</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.skin</param-name>
- <param-value>#{skinBean.skin}</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.PROJECT_STAGE</param-name>
- <param-value>Development</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>server</param-value>
- </context-param>
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
- </servlet-mapping>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinning</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinningClasses</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.skin</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
</web-app>
\ No newline at end of file
Copied: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/image (from rev 18841, branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/image)
Deleted: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/image/source.png
===================================================================
(Binary files differ)
Copied: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/image/source.png (from rev 18841, branches/RF-7939-showcase/src/main/webapp/richfaces/mediaOutput/image/source.png)
===================================================================
(Binary files differ)
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -9,9 +9,9 @@
other binary resources defined by a user on-the-fly.</p>
<p><b>createContent</b> attribute references to the method that
will be used for content creating. The method accepts two parameters.
- The first parameter has an OutputStream type. It is a reference to the
- steam that should be used for output. The second parameter is a
- reference to a 'value' attribute of the component.</p>
+ The first parameter has an <b>OutputStream </b>type. It is a reference
+ to the steam that should be used for output. The second parameter is a
+ reference to a '<b>value</b>' attribute of the component.</p>
<p><b>value</b> attribute references to data that can be used as
input data for a content creator method. The data should be
serializable because it is encoded to the URL of the resource.</p>
@@ -23,7 +23,10 @@
cached. If it is set to true, it will be cached and the serialized
value of 'value' attribute plays the role of a cache key.</p>
- <p>Dynamically generated JPEG file:</p>
+ <p>As <b>Google Application Engine restricts AWT classes usage</b> - in
+ this sample we <b>reading existent image and performing just re-indexing of the
+ palette</b> using colors you selected below. So try to change the color and
+ click process.</p>
<ui:include src="#{demoNavigator.sampleIncludeURI}" />
<ui:include src="/templates/includes/source-view.xhtml">
<ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/samples/imgUsage-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/samples/imgUsage-sample.xhtml 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/mediaOutput/samples/imgUsage-sample.xhtml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -5,8 +5,38 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
- <a4j:mediaOutput element="img" cacheable="false" session="true"
- createContent="#{mediaBean.paint}" value="#{mediaData}"
- mimeType="image/jpeg" />
-
+ <h:form>
+ <h:panelGrid columns="6">
+ <h:outputText value="Color 1" />
+ <h:selectOneMenu value="#{mediaData.colorIndex1}">
+ <f:selectItem itemLabel="Red" itemValue="0"/>
+ <f:selectItem itemLabel="Dark Blue" itemValue="1"/>
+ <f:selectItem itemLabel="Green" itemValue="2"/>
+ <f:selectItem itemLabel="Yellow" itemValue="3"/>
+ <f:selectItem itemLabel="Blue" itemValue="4"/>
+ </h:selectOneMenu>
+ <h:outputText value="Color 1" />
+ <h:selectOneMenu value="#{mediaData.colorIndex2}">
+ <f:selectItem itemLabel="Red" itemValue="0"/>
+ <f:selectItem itemLabel="Dark Blue" itemValue="1"/>
+ <f:selectItem itemLabel="Green" itemValue="2"/>
+ <f:selectItem itemLabel="Yellow" itemValue="3"/>
+ <f:selectItem itemLabel="Blue" itemValue="4"/>
+ </h:selectOneMenu>
+ <h:outputText value="Color 1" />
+ <h:selectOneMenu value="#{mediaData.colorIndex3}">
+ <f:selectItem itemLabel="Red" itemValue="0"/>
+ <f:selectItem itemLabel="Dark Blue" itemValue="1"/>
+ <f:selectItem itemLabel="Green" itemValue="2"/>
+ <f:selectItem itemLabel="Yellow" itemValue="3"/>
+ <f:selectItem itemLabel="Blue" itemValue="4"/>
+ </h:selectOneMenu>
+ <f:facet name="footer">
+ <a4j:commandButton value="Process the image" render="img" execute="@form"/>
+ </f:facet>
+ </h:panelGrid>
+ <a4j:mediaOutput element="img" cacheable="false" session="true" id="img"
+ createContent="#{mediaBean.process}" value="#{mediaData}"
+ mimeType="image/jpeg" />
+ </h:form>
</ui:composition>
\ No newline at end of file
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/push/samples/push-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/push/samples/push-sample.xhtml 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/push/samples/push-sample.xhtml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -25,27 +25,38 @@
</h:column>
</h:dataTable>
- <a4j:jsFunction name="startPush" action="#{choicesBean.start}"
- execute="@this" render="push, stop, start" />
- <a4j:jsFunction name="stopPush" action="#{choicesBean.stop}"
- execute="@this" render="push, stop, start" />
-
- <h:commandButton onclick="startPush()" value="Start" id="start"
- disabled="#{choicesBean.enabled}" type="button" />
-
- <h:commandButton onclick="stopPush()" type="button" value="Stop"
- id="stop" disabled="#{!choicesBean.enabled}" />
-
<a4j:outputPanel layout="block" id="tempResults">
<h:outputText
value="Latest update votes was: #{choicesBean.updateInfo} at #{choicesBean.timeStamp}"
rendered="#{choicesBean.enabled}" />
+ <h:outputText style="color:red"
+ value="The push has been disabled automatically after 3 minutes of working. Please refresh the page."
+ rendered="#{!choicesBean.enabled}" />
</a4j:outputPanel>
-
+
+ <fieldset>
+ <legend><b>Firing event</b></legend>
+ <a4j:commandLink style="font-weight:bold;"
+ value="Initiate server Event" id="initiate"
+ disabled="#{!choicesBean.enabled}" render="@none"
+ action="#{choicesBean.initiateEvent}" />
+ <p>Pay attention that this link has <b>@none value in render</b> so it's actually not performs any updates.
+ It's just <b>queues server side event</b> which will be <b>fetched by push</b> component and processed</p>
+ </fieldset>
+
<a4j:push enabled="#{choicesBean.enabled}" interval="1000"
eventProducer="#{choicesBean.addListener}" id="push"
- action="#{choicesBean.processUpdates}">
- <a4j:ajax render="choiceVotes push tempResults" />
- </a4j:push>
+ action="#{choicesBean.processUpdates}"
+ render="choiceVotes push tempResults" />
+
</h:form>
+
+ <h:form>
+ <!-- This poll used only to expire push after a minute of working. Done in order not
+ to flood the server with the requests from pages "forgotten" to be closed before
+ weekends :)-->
+ <a4j:poll interval="180000" action="#{choicesBean.stop}"
+ enabled="#{choicesBean.enabled}"
+ render="push start initiate poll tempResults" id="poll" />
+ </h:form>
</ui:composition>
\ No newline at end of file
Modified: trunk/examples/richfaces-showcase/src/main/webapp/templates/main.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/templates/main.xhtml 2010-08-20 15:10:07 UTC (rev 18852)
+++ trunk/examples/richfaces-showcase/src/main/webapp/templates/main.xhtml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -30,9 +30,9 @@
<h:outputText value=" | "/>
<h:outputLink value="http://community.jboss.org/community/richfaces">RichFaces Community Space</h:outputLink>
<h:outputText value=" | "/>
- <h:outputLink value="http://downloads.jboss.org/richfaces/milestones/4.0.X/4.0.0.ALPHA2/richfa...">Download</h:outputLink>
+ <h:outputLink value="http://jboss.org/richfaces/download/milestones.html">Download</h:outputLink>
<h:outputText value=" | "/>
- <h:outputLink value="http://anonsvn.jboss.org/repos/richfaces/root/examples/richfaces-showcase/">Sources</h:outputLink>
+ <h:outputLink value="http://anonsvn.jboss.org/repos/richfaces/trunk/examples/richfaces-showcase/">Sources</h:outputLink>
</td>
</tr>
<tr>
Copied: trunk/examples/richfaces-showcase/src/main/webapp-gae (from rev 18841, branches/RF-7939-showcase/src/main/webapp-gae)
Copied: trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF (from rev 18841, branches/RF-7939-showcase/src/main/webapp-gae/WEB-INF)
Deleted: trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/appengine-web.xml
===================================================================
--- branches/RF-7939-showcase/src/main/webapp-gae/WEB-INF/appengine-web.xml 2010-08-20 10:41:27 UTC (rev 18841)
+++ trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/appengine-web.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
- <application>richfaces-showcase-gae</application>
- <version>11</version>
- <sessions-enabled>true</sessions-enabled>
-
- <system-properties>
- <property name="java.util.logging.config.file" value="WEB-INF/classes/logging.properties"/>
- </system-properties>
-
-</appengine-web-app>
Copied: trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/appengine-web.xml (from rev 18841, branches/RF-7939-showcase/src/main/webapp-gae/WEB-INF/appengine-web.xml)
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/appengine-web.xml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/appengine-web.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
+ <application>richfaces-showcase-gae</application>
+ <version>11</version>
+ <sessions-enabled>true</sessions-enabled>
+
+ <system-properties>
+ <property name="java.util.logging.config.file" value="WEB-INF/classes/logging.properties"/>
+ </system-properties>
+
+</appengine-web-app>
Deleted: trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml
===================================================================
--- branches/RF-7939-showcase/src/main/webapp-gae/WEB-INF/web.xml 2010-08-20 10:41:27 UTC (rev 18841)
+++ trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- id="richfaces-showcase" version="2.5">
- <display-name>richfaces-showcase-gae</display-name>
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- <welcome-file>index.htm</welcome-file>
- <welcome-file>index.jsp</welcome-file>
- <welcome-file>default.html</welcome-file>
- <welcome-file>default.htm</welcome-file>
- <welcome-file>default.jsp</welcome-file>
- </welcome-file-list>
- <context-param>
- <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
- <param-value>/WEB-INF/app-tags.taglib.xml</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.enableControlSkinning</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.enableControlSkinningClasses</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.skin</param-name>
- <param-value>#{skinBean.skin}</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.PROJECT_STAGE</param-name>
- <param-value>Development</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>server</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.staticResourceLocation</param-name>
- <param-value>#{facesContext.externalContext.requestContextPath}/static-resources/#{resourceLocation}</param-value>
- </context-param>
-
- <context-param>
- <param-name>org.ajax4jsf.cache.CACHE_MANAGER_FACTORY_CLASS</param-name>
- <param-value>org.ajax4jsf.cache.lru.LRUMapCacheFactory</param-value>
- </context-param>
-
- <context-param>
- <description>
- Set this flag to true if you want the JavaServer Faces
- Reference Implementation to validate the XML in your
- faces-config.xml resources against the DTD. Default
- value is false.
- </description>
- <param-name>com.sun.faces.validateXml</param-name>
- <param-value>true</param-value>
- </context-param>
- <!-- ***** Accommodate Single-Threaded Requirement of Google AppEngine -->
- <context-param>
- <description>
- When enabled, the runtime initialization and default ResourceHandler
- implementation will use threads to perform their functions. Set this
- value to false if threads aren't desired (as in the case of running
- within the Google Application Engine).
-
- Note that when this option is disabled, the ResourceHandler will not
- pick up new versions of resources when ProjectStage is development.
- </description>
- <param-name>com.sun.faces.enableThreading</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>com.sun.faces.expressionFactory</param-name>
- <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.executeAWTInitializer</param-name>
- <param-value>false</param-value>
- </context-param>
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
- </servlet-mapping>
-</web-app>
\ No newline at end of file
Copied: trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml (from rev 18841, branches/RF-7939-showcase/src/main/webapp-gae/WEB-INF/web.xml)
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp-gae/WEB-INF/web.xml 2010-08-20 15:54:52 UTC (rev 18853)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="richfaces-showcase" version="2.5">
+ <display-name>richfaces-showcase-gae</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+ <context-param>
+ <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
+ <param-value>/WEB-INF/app-tags.taglib.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinning</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinningClasses</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.skin</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.staticResourceLocation</param-name>
+ <param-value>#{facesContext.externalContext.requestContextPath}/static-resources/#{resourceLocation}</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.ajax4jsf.cache.CACHE_MANAGER_FACTORY_CLASS</param-name>
+ <param-value>org.ajax4jsf.cache.lru.LRUMapCacheFactory</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to validate the XML in your
+ faces-config.xml resources against the DTD. Default
+ value is false.
+ </description>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <!-- ***** Accommodate Single-Threaded Requirement of Google AppEngine -->
+ <context-param>
+ <description>
+ When enabled, the runtime initialization and default ResourceHandler
+ implementation will use threads to perform their functions. Set this
+ value to false if threads aren't desired (as in the case of running
+ within the Google Application Engine).
+
+ Note that when this option is disabled, the ResourceHandler will not
+ pick up new versions of resources when ProjectStage is development.
+ </description>
+ <param-name>com.sun.faces.enableThreading</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.expressionFactory</param-name>
+ <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.executeAWTInitializer</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
15 years, 8 months
JBoss Rich Faces SVN: r18852 - trunk.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-20 11:10:07 -0400 (Fri, 20 Aug 2010)
New Revision: 18852
Modified:
trunk/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-18779" from
https://svn.jboss.org/repos/richfaces/branches/RF-9112
Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-9023:1-18690 /branches/RF-9040_build_updated_m2:1-18626
+ /branches/RF-9112:1-18779 /branches/RF-9023:1-18690 /branches/RF-9040_build_updated_m2:1-18626
15 years, 8 months
JBoss Rich Faces SVN: r18851 - in branches/RF-9112: ui/input/ui/src/main/resources/META-INF/resources/org.richfaces and 9 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-20 11:06:52 -0400 (Fri, 20 Aug 2010)
New Revision: 18851
Added:
branches/RF-9112/ui/input/ui/src/test/java/
branches/RF-9112/ui/input/ui/src/test/java/org/
branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/
branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/
branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java
branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
branches/RF-9112/ui/input/ui/src/test/resources/
branches/RF-9112/ui/input/ui/src/test/resources/org/
branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/
branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/
branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml
Removed:
branches/RF-9112/ui/input/ui/src/test/java/org/
branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/
branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/
branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java
branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
branches/RF-9112/ui/input/ui/src/test/resources/org/
branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/
branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/
branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml
Modified:
branches/RF-9112/
branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
Log:
Merged revisions 18848-18849 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r18848 | abelevich | 2010-08-20 10:13:52 -0400 (Fri, 20 Aug 2010) | 1 line
fix inplaceInput with showControls='true' scrip behavior
.......
r18849 | abelevich | 2010-08-20 10:14:43 -0400 (Fri, 20 Aug 2010) | 1 line
add test for the inplaceInput
.......
Property changes on: branches/RF-9112
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-18847 /branches/RF-9023:1-18690 /branches/RF-9040_build_updated_m2:1-18626
+ /trunk:1-18850 /branches/RF-9023:1-18690 /branches/RF-9040_build_updated_m2:1-18626
Modified: branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-08-20 14:17:25 UTC (rev 18850)
+++ branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-08-20 15:06:52 UTC (rev 18851)
@@ -16,10 +16,13 @@
this.initialValue = this.label.text();
this.element.bind(this.editEvent, $.proxy(this.__editHandler, this));
- this.input.bind("change", $.proxy(this.__saveHandler, this));
- this.input.bind("blur", $.proxy(this.__saveHandler, this));
this.input.bind("focus", $.proxy(this.__editHandler, this));
-
+
+ if(!this.showControls) {
+ this.input.bind("change", $.proxy(this.__saveHandler, this));
+ this.input.bind("blur", $.proxy(this.__saveHandler, this));
+ }
+
if(this.showControls) {
this.okbtn = $(document.getElementById(options.okbtn));
this.cancelbtn = $(document.getElementById(options.cancelbtn));
@@ -46,20 +49,21 @@
},
save: function() {
- var inputValue = this.input.val();
- if(inputValue.length > 0) {
- this.label.text(inputValue);
- }
-
- if(inputValue != this.initialValue) {
- this.element.addClass(this.changedCss);
- } else {
- this.element.removeClass(this.changedCss);
- }
-
- if(!this.showControls) {
- this.editContainer.addClass(this.noneCss);
- }
+
+ var inputValue = this.input.val();
+ if(inputValue.length > 0) {
+ this.label.text(inputValue);
+ }
+
+ if(inputValue != this.initialValue) {
+ this.element.addClass(this.changedCss);
+ } else {
+ this.element.removeClass(this.changedCss);
+ }
+
+ if(!this.showControls) {
+ this.editContainer.addClass(this.noneCss);
+ }
},
cancel: function() {
@@ -81,6 +85,7 @@
__saveBtnHandler: function(e) {
this.input.blur();
+ this.save();
this.editContainer.addClass(this.noneCss);
return false;
},
@@ -100,7 +105,6 @@
__saveHandler: function(e) {
this.save();
}
-
}
})());
Copied: branches/RF-9112/ui/input/ui/src/test/java (from rev 18849, trunk/ui/input/ui/src/test/java)
Copied: branches/RF-9112/ui/input/ui/src/test/java/org (from rev 18849, trunk/ui/input/ui/src/test/java/org)
Copied: branches/RF-9112/ui/input/ui/src/test/java/org/richfaces (from rev 18849, trunk/ui/input/ui/src/test/java/org/richfaces)
Copied: branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit (from rev 18849, trunk/ui/input/ui/src/test/java/org/richfaces/renderkit)
Deleted: branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java 2010-08-20 15:06:52 UTC (rev 18851)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * 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 org.richfaces.renderkit;
-
-
-public class DataBean {
-
- private String value = "Test String";
-
- public DataBean() {
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
-}
Copied: branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java (from rev 18849, trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java)
===================================================================
--- branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java (rev 0)
+++ branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java 2010-08-20 15:06:52 UTC (rev 18851)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * 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 org.richfaces.renderkit;
+
+
+public class DataBean {
+
+ private String value = "Test String";
+
+ public DataBean() {
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
Deleted: branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-08-20 15:06:52 UTC (rev 18851)
@@ -1,222 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * 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 org.richfaces.renderkit;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.File;
-import java.util.List;
-
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.gargoylesoftware.htmlunit.html.DomNode;
-import com.gargoylesoftware.htmlunit.html.DomText;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-/**
- * @author Anton Belevich
- *
- */
-public class InplaceInputRendererTest {
-
- private HtmlUnitEnvironment environment;
-
- @Before
- public void setUp() {
- environment = new HtmlUnitEnvironment();
-
- environment.withWebRoot(new File("src/test/resources"));
- environment.withResource("/WEB-INF/faces-config.xml", "org/richfaces/renderkit/faces-config.xml");
- environment.withResource("/test.xhtml", "org/richfaces/renderkit/rendererTest.xhtml");
- environment.start();
- }
-
- @Test
- public void testRenderDefaultState() throws Exception {
- HtmlPage page = environment.getPage("/test.jsf");
- List<?> nodes = page.getByXPath("//*[@id = 'form:input_default']");
- assertEquals(1, nodes.size());
- HtmlElement span = (HtmlElement) nodes.get(0);
- assertEquals("span", span.getNodeName());
- assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
-
- HtmlElement label = (HtmlElement)span.getFirstChild();
- assertEquals("span", label.getNodeName());
- assertEquals("rf-ii-lbl", label.getAttribute(HTML.CLASS_ATTRIBUTE));
- DomNode text = label.getFirstChild();
- assertEquals(DomNode.TEXT_NODE, text.getNodeType());
-
- HtmlElement edit = (HtmlElement)label.getNextSibling();
- assertEquals("span", edit.getNodeName());
- assertEquals("rf-ii-e-s rf-ii-none", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
-
- HtmlElement input = (HtmlElement)edit.getFirstChild();
- assertEquals("input", input.getNodeName());
- assertEquals("rf-ii-f", input.getAttribute(HTML.CLASS_ATTRIBUTE));
- assertEquals(text.getNodeValue(), input.getAttribute(HTML.VALUE_ATTRIBUTE));
-
- List<?> buttons = page.getByXPath("//*[@id = 'form:input_default:btn']");
- assertEquals(true, buttons.isEmpty());
- }
-
- @Test
- public void testRenderEditState() throws Exception {
-
- HtmlPage page = environment.getPage("/test.jsf");
-
- List<?> nodes = page.getByXPath("//*[@id = 'form:input_edit']");
- assertEquals(1, nodes.size());
- HtmlElement span = (HtmlElement) nodes.get(0);
- assertEquals("span", span.getNodeName());
- assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
-
- HtmlElement label = (HtmlElement)span.getFirstChild();
- assertEquals("span", label.getNodeName());
- assertEquals("rf-ii-lbl", label.getAttribute(HTML.CLASS_ATTRIBUTE));
- DomNode text = label.getFirstChild();
- assertEquals(DomNode.TEXT_NODE, text.getNodeType());
-
- HtmlElement edit = (HtmlElement)label.getNextSibling();
- assertEquals("span", edit.getNodeName());
- assertEquals("rf-ii-e-s", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
-
- HtmlElement input = (HtmlElement)edit.getFirstChild();
- assertEquals("input", input.getNodeName());
- assertEquals("rf-ii-f", input.getAttribute(HTML.CLASS_ATTRIBUTE));
- assertEquals(text.getNodeValue(), input.getAttribute(HTML.VALUE_ATTRIBUTE));
-
- List<?> buttonNodes = page.getByXPath("//*[@id = 'form:input_edit:btn']");
- assertEquals(1, buttonNodes.size());
-
- HtmlElement button = (HtmlElement) buttonNodes.get(0);
- assertEquals("span", button.getNodeName());
-
- List<?> okButtonNodes = page.getByXPath("//*[@id = 'form:input_edit:okbtn']");
- assertEquals(1, okButtonNodes.size());
-
- HtmlElement okButton = (HtmlElement) okButtonNodes.get(0);
- assertEquals("input", okButton.getNodeName());
- assertEquals("rf-ii-btn", okButton.getAttribute(HTML.CLASS_ATTRIBUTE));
- assertEquals("image", okButton.getAttribute(HTML.TYPE_ATTR));
-
- List<?> cancelButtonNodes = page.getByXPath("//*[@id = 'form:input_edit:cancelbtn']");
- assertEquals(1, cancelButtonNodes.size());
-
- HtmlElement cancelButton = (HtmlElement) cancelButtonNodes.get(0);
- assertEquals("input", cancelButton.getNodeName());
- assertEquals("rf-ii-btn", cancelButton.getAttribute(HTML.CLASS_ATTRIBUTE));
- assertEquals("image", cancelButton.getAttribute(HTML.TYPE_ATTR));
-
- }
-
- @Test
- public void testEdit() throws Exception {
- HtmlPage page = environment.getPage("/test.jsf");
- edit(page, "input_default");
- List<?> labelNodes = page.getByXPath("//*[@id = 'form:input_default:label']/text()");
- assertEquals(1, labelNodes.size());
- DomText text = (DomText) labelNodes.get(0);
- assertEquals("Another Test String", text.getTextContent());
-
- List<?>nodes = page.getByXPath("//*[@id = 'form:input_default']");
- assertEquals(1, nodes.size());
- HtmlElement span = (HtmlElement) nodes.get(0);
- assertEquals("rf-ii-d-s rf-ii-c-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
-
- }
-
- private void edit(HtmlPage page, String inplaceInputId) throws Exception {
- List<?> nodes = page.getByXPath("//*[@id = 'form:" + inplaceInputId + "']");
- assertEquals(1, nodes.size());
- HtmlElement span = (HtmlElement) nodes.get(0);
- span.click();
-
- List<?> editNodes = page.getByXPath("//*[@id = 'form:" + inplaceInputId + ":edit']");
- assertEquals(1, editNodes.size());
- HtmlElement edit = (HtmlElement) editNodes.get(0);
- assertEquals("rf-ii-e-s", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
-
- List<?> inputNodes = page.getByXPath("//*[@id = 'form:" + inplaceInputId + ":input']");
- assertEquals(1, inputNodes.size());
- HtmlElement input = (HtmlElement) inputNodes.get(0);
- input.setAttribute(HTML.VALUE_ATTRIBUTE, "");
- input.type("Another Test String");
-
- List<?> panelNodes = page.getByXPath("//*[@id = 'form:panel']");
- assertEquals(1, panelNodes.size());
- HtmlElement panel = (HtmlElement) panelNodes.get(0);
- panel.click();
- }
-
- @Test
- public void testEditWithControls() throws Exception {
- HtmlPage page = environment.getPage("/test.jsf");
-
- edit(page, "input_controls");
-
- List<?> cancelNodes = page.getByXPath("//*[@id = 'form:input_controls:cancelbtn']");
- assertEquals(1, cancelNodes.size());
- HtmlElement cancel = (HtmlElement) cancelNodes.get(0);
-
- cancel.mouseDown();
-
- List<?> labelNodes = page.getByXPath("//*[@id = 'form:input_controls:label']/text()");
- assertEquals(1, labelNodes.size());
- DomText text = (DomText) labelNodes.get(0);
- assertEquals("Test String", text.getTextContent());
-
- List<?> nodes = page.getByXPath("//*[@id = 'form:input_controls']");
- assertEquals(1, nodes.size());
- HtmlElement span = (HtmlElement) nodes.get(0);
- assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
-
- edit(page, "input_controls");
-
- List<?> okNodes = page.getByXPath("//*[@id = 'form:input_controls:okbtn']");
- assertEquals(1, okNodes.size());
- HtmlElement ok = (HtmlElement) okNodes.get(0);
-
- ok.mouseDown();
-
- labelNodes = page.getByXPath("//*[@id = 'form:input_controls:label']/text()");
- assertEquals(1, labelNodes.size());
- text = (DomText) labelNodes.get(0);
- assertEquals("Another Test String", text.getTextContent());
-
- nodes = page.getByXPath("//*[@id = 'form:input_controls']");
- assertEquals(1, nodes.size());
- span = (HtmlElement) nodes.get(0);
- assertEquals("rf-ii-d-s rf-ii-c-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
- }
-
- @After
- public void tearDown() {
- environment.release();
- environment = null;
- }
-}
Copied: branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java (from rev 18849, trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java)
===================================================================
--- branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java (rev 0)
+++ branches/RF-9112/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-08-20 15:06:52 UTC (rev 18851)
@@ -0,0 +1,222 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * 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 org.richfaces.renderkit;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.util.List;
+
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.html.DomNode;
+import com.gargoylesoftware.htmlunit.html.DomText;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class InplaceInputRendererTest {
+
+ private HtmlUnitEnvironment environment;
+
+ @Before
+ public void setUp() {
+ environment = new HtmlUnitEnvironment();
+
+ environment.withWebRoot(new File("src/test/resources"));
+ environment.withResource("/WEB-INF/faces-config.xml", "org/richfaces/renderkit/faces-config.xml");
+ environment.withResource("/test.xhtml", "org/richfaces/renderkit/rendererTest.xhtml");
+ environment.start();
+ }
+
+ @Test
+ public void testRenderDefaultState() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+ List<?> nodes = page.getByXPath("//*[@id = 'form:input_default']");
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ assertEquals("span", span.getNodeName());
+ assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ HtmlElement label = (HtmlElement)span.getFirstChild();
+ assertEquals("span", label.getNodeName());
+ assertEquals("rf-ii-lbl", label.getAttribute(HTML.CLASS_ATTRIBUTE));
+ DomNode text = label.getFirstChild();
+ assertEquals(DomNode.TEXT_NODE, text.getNodeType());
+
+ HtmlElement edit = (HtmlElement)label.getNextSibling();
+ assertEquals("span", edit.getNodeName());
+ assertEquals("rf-ii-e-s rf-ii-none", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ HtmlElement input = (HtmlElement)edit.getFirstChild();
+ assertEquals("input", input.getNodeName());
+ assertEquals("rf-ii-f", input.getAttribute(HTML.CLASS_ATTRIBUTE));
+ assertEquals(text.getNodeValue(), input.getAttribute(HTML.VALUE_ATTRIBUTE));
+
+ List<?> buttons = page.getByXPath("//*[@id = 'form:input_default:btn']");
+ assertEquals(true, buttons.isEmpty());
+ }
+
+ @Test
+ public void testRenderEditState() throws Exception {
+
+ HtmlPage page = environment.getPage("/test.jsf");
+
+ List<?> nodes = page.getByXPath("//*[@id = 'form:input_edit']");
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ assertEquals("span", span.getNodeName());
+ assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ HtmlElement label = (HtmlElement)span.getFirstChild();
+ assertEquals("span", label.getNodeName());
+ assertEquals("rf-ii-lbl", label.getAttribute(HTML.CLASS_ATTRIBUTE));
+ DomNode text = label.getFirstChild();
+ assertEquals(DomNode.TEXT_NODE, text.getNodeType());
+
+ HtmlElement edit = (HtmlElement)label.getNextSibling();
+ assertEquals("span", edit.getNodeName());
+ assertEquals("rf-ii-e-s", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ HtmlElement input = (HtmlElement)edit.getFirstChild();
+ assertEquals("input", input.getNodeName());
+ assertEquals("rf-ii-f", input.getAttribute(HTML.CLASS_ATTRIBUTE));
+ assertEquals(text.getNodeValue(), input.getAttribute(HTML.VALUE_ATTRIBUTE));
+
+ List<?> buttonNodes = page.getByXPath("//*[@id = 'form:input_edit:btn']");
+ assertEquals(1, buttonNodes.size());
+
+ HtmlElement button = (HtmlElement) buttonNodes.get(0);
+ assertEquals("span", button.getNodeName());
+
+ List<?> okButtonNodes = page.getByXPath("//*[@id = 'form:input_edit:okbtn']");
+ assertEquals(1, okButtonNodes.size());
+
+ HtmlElement okButton = (HtmlElement) okButtonNodes.get(0);
+ assertEquals("input", okButton.getNodeName());
+ assertEquals("rf-ii-btn", okButton.getAttribute(HTML.CLASS_ATTRIBUTE));
+ assertEquals("image", okButton.getAttribute(HTML.TYPE_ATTR));
+
+ List<?> cancelButtonNodes = page.getByXPath("//*[@id = 'form:input_edit:cancelbtn']");
+ assertEquals(1, cancelButtonNodes.size());
+
+ HtmlElement cancelButton = (HtmlElement) cancelButtonNodes.get(0);
+ assertEquals("input", cancelButton.getNodeName());
+ assertEquals("rf-ii-btn", cancelButton.getAttribute(HTML.CLASS_ATTRIBUTE));
+ assertEquals("image", cancelButton.getAttribute(HTML.TYPE_ATTR));
+
+ }
+
+ @Test
+ public void testEdit() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+ edit(page, "input_default");
+ List<?> labelNodes = page.getByXPath("//*[@id = 'form:input_default:label']/text()");
+ assertEquals(1, labelNodes.size());
+ DomText text = (DomText) labelNodes.get(0);
+ assertEquals("Another Test String", text.getTextContent());
+
+ List<?>nodes = page.getByXPath("//*[@id = 'form:input_default']");
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ assertEquals("rf-ii-d-s rf-ii-c-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ }
+
+ private void edit(HtmlPage page, String inplaceInputId) throws Exception {
+ List<?> nodes = page.getByXPath("//*[@id = 'form:" + inplaceInputId + "']");
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ span.click();
+
+ List<?> editNodes = page.getByXPath("//*[@id = 'form:" + inplaceInputId + ":edit']");
+ assertEquals(1, editNodes.size());
+ HtmlElement edit = (HtmlElement) editNodes.get(0);
+ assertEquals("rf-ii-e-s", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ List<?> inputNodes = page.getByXPath("//*[@id = 'form:" + inplaceInputId + ":input']");
+ assertEquals(1, inputNodes.size());
+ HtmlElement input = (HtmlElement) inputNodes.get(0);
+ input.setAttribute(HTML.VALUE_ATTRIBUTE, "");
+ input.type("Another Test String");
+
+ List<?> panelNodes = page.getByXPath("//*[@id = 'form:panel']");
+ assertEquals(1, panelNodes.size());
+ HtmlElement panel = (HtmlElement) panelNodes.get(0);
+ panel.click();
+ }
+
+ @Test
+ public void testEditWithControls() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+
+ edit(page, "input_controls");
+
+ List<?> cancelNodes = page.getByXPath("//*[@id = 'form:input_controls:cancelbtn']");
+ assertEquals(1, cancelNodes.size());
+ HtmlElement cancel = (HtmlElement) cancelNodes.get(0);
+
+ cancel.mouseDown();
+
+ List<?> labelNodes = page.getByXPath("//*[@id = 'form:input_controls:label']/text()");
+ assertEquals(1, labelNodes.size());
+ DomText text = (DomText) labelNodes.get(0);
+ assertEquals("Test String", text.getTextContent());
+
+ List<?> nodes = page.getByXPath("//*[@id = 'form:input_controls']");
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ edit(page, "input_controls");
+
+ List<?> okNodes = page.getByXPath("//*[@id = 'form:input_controls:okbtn']");
+ assertEquals(1, okNodes.size());
+ HtmlElement ok = (HtmlElement) okNodes.get(0);
+
+ ok.mouseDown();
+
+ labelNodes = page.getByXPath("//*[@id = 'form:input_controls:label']/text()");
+ assertEquals(1, labelNodes.size());
+ text = (DomText) labelNodes.get(0);
+ assertEquals("Another Test String", text.getTextContent());
+
+ nodes = page.getByXPath("//*[@id = 'form:input_controls']");
+ assertEquals(1, nodes.size());
+ span = (HtmlElement) nodes.get(0);
+ assertEquals("rf-ii-d-s rf-ii-c-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
+ }
+
+ @After
+ public void tearDown() {
+ environment.release();
+ environment = null;
+ }
+}
Copied: branches/RF-9112/ui/input/ui/src/test/resources (from rev 18849, trunk/ui/input/ui/src/test/resources)
Copied: branches/RF-9112/ui/input/ui/src/test/resources/org (from rev 18849, trunk/ui/input/ui/src/test/resources/org)
Copied: branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces (from rev 18849, trunk/ui/input/ui/src/test/resources/org/richfaces)
Copied: branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit (from rev 18849, trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit)
Deleted: branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml 2010-08-20 15:06:52 UTC (rev 18851)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<faces-config 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-facesconfig_2_0.xsd"
- version="2.0">
-
- <managed-bean>
- <managed-bean-name>dataBean</managed-bean-name>
- <managed-bean-class>org.richfaces.renderkit.DataBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
-
-</faces-config>
\ No newline at end of file
Copied: branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml (from rev 18849, trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml)
===================================================================
--- branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml (rev 0)
+++ branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml 2010-08-20 15:06:52 UTC (rev 18851)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config 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-facesconfig_2_0.xsd"
+ version="2.0">
+
+ <managed-bean>
+ <managed-bean-name>dataBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.renderkit.DataBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file
Deleted: branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml 2010-08-20 15:06:52 UTC (rev 18851)
@@ -1,26 +0,0 @@
-<!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"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:in="http://richfaces.org/input">
-<f:view contentType="text/html" />
-
-<h:head>
- <title>Richfaces InplaceInput</title>
-</h:head>
-
-<h:body>
- <h:form id="form">
- <in:inplaceInput id="input_default" value="#{dataBean.value}"/>
-
- <in:inplaceInput id="input_controls" showControls="true" value="#{dataBean.value}"/>
-
- <in:inplaceInput id="input_edit" state="edit" showControls="true" value="#{dataBean.value}"/>
-
- <h:panelGroup id="panel">
- <!-- click here for blur -->
- </h:panelGroup>
- </h:form>
-</h:body>
-</html>
Copied: branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml (from rev 18849, trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml)
===================================================================
--- branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml (rev 0)
+++ branches/RF-9112/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml 2010-08-20 15:06:52 UTC (rev 18851)
@@ -0,0 +1,26 @@
+<!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"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:in="http://richfaces.org/input">
+<f:view contentType="text/html" />
+
+<h:head>
+ <title>Richfaces InplaceInput</title>
+</h:head>
+
+<h:body>
+ <h:form id="form">
+ <in:inplaceInput id="input_default" value="#{dataBean.value}"/>
+
+ <in:inplaceInput id="input_controls" showControls="true" value="#{dataBean.value}"/>
+
+ <in:inplaceInput id="input_edit" state="edit" showControls="true" value="#{dataBean.value}"/>
+
+ <h:panelGroup id="panel">
+ <!-- click here for blur -->
+ </h:panelGroup>
+ </h:form>
+</h:body>
+</html>
15 years, 8 months
JBoss Rich Faces SVN: r18850 - in branches/RF-9112: core/api/src/main/java/org/richfaces/resource and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-20 10:17:25 -0400 (Fri, 20 Aug 2010)
New Revision: 18850
Removed:
branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java
Modified:
branches/RF-9112/
branches/RF-9112/core/api/src/main/java/org/richfaces/resource/ImageType.java
branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java
branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java
branches/RF-9112/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java
branches/RF-9112/examples/output-demo/src/main/webapp/examples/accordion.xhtml
branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss
branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordion.java
branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java
branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
branches/RF-9112/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
branches/RF-9112/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem.js
branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.ecss
Log:
Merged revisions 18838,18842,18845-18846 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r18838 | nbelaevski | 2010-08-20 05:20:08 -0400 (Fri, 20 Aug 2010) | 1 line
Updated skinning for inputNumberSlider
.......
r18842 | Alex.Kolonitsky | 2010-08-20 06:54:21 -0400 (Fri, 20 Aug 2010) | 1 line
Accordion width and height attributes
.......
r18845 | nbelaevski | 2010-08-20 10:02:27 -0400 (Fri, 20 Aug 2010) | 1 line
https://jira.jboss.org/browse/RF-9119
.......
r18846 | nbelaevski | 2010-08-20 10:03:25 -0400 (Fri, 20 Aug 2010) | 1 line
https://jira.jboss.org/browse/RF-8936
.......
Property changes on: branches/RF-9112
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-18827 /branches/RF-9023:1-18690 /branches/RF-9040_build_updated_m2:1-18626
+ /trunk:1-18847 /branches/RF-9023:1-18690 /branches/RF-9040_build_updated_m2:1-18626
Modified: branches/RF-9112/core/api/src/main/java/org/richfaces/resource/ImageType.java
===================================================================
--- branches/RF-9112/core/api/src/main/java/org/richfaces/resource/ImageType.java 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/core/api/src/main/java/org/richfaces/resource/ImageType.java 2010-08-20 14:17:25 UTC (rev 18850)
@@ -21,14 +21,20 @@
*/
package org.richfaces.resource;
+import java.awt.Transparency;
+import java.awt.color.ColorSpace;
import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.ComponentColorModel;
+import java.awt.image.DataBuffer;
import java.awt.image.IndexColorModel;
+import java.awt.image.WritableRaster;
public enum ImageType {
GIF("gif") {
@Override
public BufferedImage createImage(int width, int height) {
- return createARGBImage(width, height);
+ return createBitmaskImage(width, height);
}
},
PNG("png") {
@@ -98,6 +104,15 @@
return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
}
+ private static BufferedImage createBitmaskImage(int width, int height) {
+ ColorModel colorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), true, false,
+ Transparency.BITMASK, DataBuffer.TYPE_BYTE);
+
+ WritableRaster raster = colorModel.createCompatibleWritableRaster(width, height);
+
+ return new BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), null);
+ }
+
public abstract BufferedImage createImage(int width, int height);
public String getFormatName() {
Deleted: branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java
===================================================================
--- branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java 2010-08-20 14:17:25 UTC (rev 18850)
@@ -1,126 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.renderkit.html.images;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.util.HtmlColor;
-import org.richfaces.resource.DynamicResource;
-import org.richfaces.resource.ImageType;
-
-/**
- * implementation of the default CANCEL icon renderer
- *
- * @author Anton Belevich
- * @since 3.2.0
- */
-@DynamicResource
-public class CancelControlIcon extends Java2Dresource {
-
- protected static final String ALTERNATE_COLOR = "#ED6161";
-
- private static final Dimension DIMENSIONS = new Dimension(11, 11);
-
- protected Integer iconColor;
- protected Integer iconBorderColor;
-
- public CancelControlIcon() {
- super(ImageType.GIF);
- }
-
- @Override
- public Dimension getDimension() {
- return DIMENSIONS;
- }
-
- @Override
- public void readState(FacesContext context, DataInput stream) throws IOException {
- super.readState(context, stream);
-
- this.iconColor = stream.readInt();
- this.iconBorderColor = stream.readInt();
- }
-
- public void writeState(FacesContext context, DataOutput stream) throws IOException {
- super.writeState(context, stream);
-
- stream.writeInt(this.iconColor);
- stream.writeInt(this.iconBorderColor);
- }
-
- @Override
- protected void paint(Graphics2D g2d, Dimension dimension) {
-
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
-// g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
-// g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_DEFAULT);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_DEFAULT);
- Color iconColour = new Color(iconColor);
- Color iconBorder = new Color(iconBorderColor);
- g2d.setColor(iconColour);
-
- Color altenateColor = HtmlColor.decode(ALTERNATE_COLOR);
- GradientPaint gradient = new GradientPaint(2, 3, altenateColor, 3, 9, iconColour);
- g2d.setPaint(gradient);
-
- // draw cross
- g2d.drawLine(2, 3, 7, 8);
- g2d.drawLine(3, 3, 7, 7);
- g2d.drawLine(3, 2, 8, 7);
-
- g2d.drawLine(2, 7, 7, 2);
- g2d.drawLine(3, 7, 7, 3);
- g2d.drawLine(3, 8, 8, 3);
-
- //draw border
- g2d.setColor(iconBorder);
- g2d.drawLine(1, 3, 3, 5);
- g2d.drawLine(3, 5, 1, 7);
- g2d.drawLine(1, 7, 3, 9);
- g2d.drawLine(3, 9, 5, 7);
- g2d.drawLine(5, 7, 7, 9);
- g2d.drawLine(7, 9, 9, 7);
- g2d.drawLine(9, 7, 7, 5);
- g2d.drawLine(7, 5, 9, 3);
- g2d.drawLine(9, 3, 7, 1);
- g2d.drawLine(7, 1, 5, 3);
- g2d.drawLine(5, 3, 3, 1);
- g2d.drawLine(3, 1, 1, 3);
-
-
- }
-}
-
Modified: branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java
===================================================================
--- branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java 2010-08-20 14:17:25 UTC (rev 18850)
@@ -20,30 +20,27 @@
*/
package org.richfaces.renderkit.html.images;
-import org.ajax4jsf.resource.ResourceContext;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
-import java.awt.*;
-
public class InputErrorIcon extends OneColorBasedResource {
+ private static final Dimension DIMENSION = new Dimension(6, 11);
+
public InputErrorIcon() {
- super(6, 11, "warningColor");
+ super("warningColor");
}
- /**
- * @see org.ajax4jsf.resource.Java2Dresource#paint(ResourceContext, Graphics2D)
- */
- protected void paint(ResourceContext context, Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+ @Override
+ public Dimension getDimension() {
+ return DIMENSION;
+ }
+
+ @Override
+ public void paint(Graphics2D g2d, Dimension dimension) {
g2d.setColor(getBasicColor());
g2d.fillRect(3, 2, 2, 6);
g2d.fillRect(3, 9, 2, 2);
}
- @Override
- public Dimension getDimension() {
- // TODO Auto-generated method stub
- return null;
- }
-
}
Modified: branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java
===================================================================
--- branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/core/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java 2010-08-20 14:17:25 UTC (rev 18850)
@@ -23,40 +23,84 @@
import java.awt.Color;
import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Map;
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.resource.ResourceContext;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.resource.CacheableResource;
import org.richfaces.resource.DynamicResource;
import org.richfaces.resource.ImageType;
+import org.richfaces.resource.Java2DUserResource;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
@DynamicResource
-public abstract class OneColorBasedResource extends Java2Dresource {
+public abstract class OneColorBasedResource implements Java2DUserResource, CacheableResource, StateHolderResource {
- private Dimension dimension;
-
private String basicColorParamName;
private Color basicColor;
- public OneColorBasedResource(int width, int height, final String basicColorParamName) {
- super(ImageType.GIF);
+ public OneColorBasedResource(final String basicColorParamName) {
this.basicColorParamName = basicColorParamName;
- this.dimension = new Dimension(width, height);
-
}
/**
- * @see Java2Dresource#isCacheable(ResourceContext)
- */
- public boolean isCacheable(ResourceContext ctx) {
- return true;
- }
-
- /**
* Gets value of basicColor field.
* @return value of basicColor field
*/
- public Color getBasicColor() {
+ protected Color getBasicColor() {
return basicColor;
}
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws IOException {
+ Skin skin = SkinFactory.getInstance(context).getSkin(context);
+ dataOutput.writeInt(skin.getColorParameter(context, basicColorParamName));
+ }
+
+ public void readState(FacesContext context, DataInput dataInput) throws IOException {
+ basicColor = new Color(dataInput.readInt());
+ }
+
+ public boolean isCacheable(FacesContext context) {
+ return true;
+ }
+
+ public Date getExpires(FacesContext context) {
+ return null;
+ }
+
+ public int getTimeToLive(FacesContext context) {
+ return 0;
+ }
+
+ public String getEntityTag(FacesContext context) {
+ return null;
+ }
+
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+
+ public Date getLastModified() {
+ return null;
+ }
+
+ public ImageType getImageType() {
+ return ImageType.GIF;
+ }
+
+ public abstract Dimension getDimension();
+
+ public abstract void paint(Graphics2D graphics2d, Dimension dimension);
}
Modified: branches/RF-9112/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java
===================================================================
--- branches/RF-9112/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java 2010-08-20 14:17:25 UTC (rev 18850)
@@ -29,7 +29,6 @@
}
public String getValue() {
- System.out.println("value = " + value);
return value;
}
Modified: branches/RF-9112/examples/output-demo/src/main/webapp/examples/accordion.xhtml
===================================================================
--- branches/RF-9112/examples/output-demo/src/main/webapp/examples/accordion.xhtml 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/examples/output-demo/src/main/webapp/examples/accordion.xhtml 2010-08-20 14:17:25 UTC (rev 18850)
@@ -15,7 +15,7 @@
<p>Page</p>
<h:form id="f" style="border:blue solid thin;">
- <pn:accordion>
+ <pn:accordion width="500px" height="300px">
<pn:accordionItem header="label 1">Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here.</pn:accordionItem>
<pn:accordionItem header="label 2">content 2</pn:accordionItem>
<pn:accordionItem header="label 3">content 3</pn:accordionItem>
Modified: branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss
===================================================================
--- branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.ecss 2010-08-20 14:17:25 UTC (rev 18850)
@@ -33,9 +33,9 @@
}
.rf-ins-mn, .rf-ins-mx, input.rf-ins-i, .rf-ins-tt {
- font-size: 11px;
- font-family: arial;
- color: #000000;
+ font-size: '#{richSkin.generalSizeFont}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ color: '#{richSkin.generalTextColor}';
}
.rf-ins-mn, .rf-ins-mx {
@@ -44,13 +44,17 @@
}
.rf-ins-mn {
- border-left: 1px solid #c0c0c0;
+ border-left-width: 1px;
+ border-left-style: solid;
+ border-left-color: '#{richSkin.panelBorderColor}';
padding-left: 3px;
float: left;
}
.rf-ins-mx {
- border-right: 1px solid #c0c0c0;
+ border-right-width: 1px;
+ border-right-style: solid;
+ border-right-color: '#{richSkin.panelBorderColor}';
padding-right: 3px;
float: right;
text-align: right;
@@ -62,8 +66,11 @@
}
input.rf-ins-i {
- background: url("#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']}") top repeat-x #fff;
- border: 1px inset #C0C0C0;
+ background: url("#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']}") top repeat-x;
+ background-color: '#{richSkin.controlBackgroundColor}';
+ border-width: 1px;
+ border-style: inset;
+ border-color: '#{richSkin.panelBorderColor}';
margin: 0px 10px 0px 10px;
vertical-align: bottom;
}
@@ -77,8 +84,11 @@
}
.rf-ins-t {
- background: url("#{resource['org.richfaces.renderkit.html.images.SliderTrackGradient']}") 1px 1px repeat-x #FFFFFF;
- border: 1px solid #C0C0C0;
+ background: url("#{resource['org.richfaces.renderkit.html.images.SliderTrackGradient']}") 1px 1px repeat-x;
+ background-color: '#{richSkin.controlBackgroundColor}';
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.panelBorderColor}';
display: block;
height: 6px;
clear: both;
Modified: branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordion.java
===================================================================
--- branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordion.java 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordion.java 2010-08-20 14:17:25 UTC (rev 18850)
@@ -70,6 +70,8 @@
onmousedown,
onmousemove,
onmouseout,
+ width,
+ height,
onmouseover,
onmouseup
}
@@ -83,6 +85,22 @@
return COMPONENT_FAMILY;
}
+ public String getWidth() {
+ return (String) getStateHelper().eval(PropertyKeys.width);
+ }
+
+ public void setWidth(String width) {
+ getStateHelper().put(PropertyKeys.width, width);
+ }
+
+ public String getHeight() {
+ return (String) getStateHelper().eval(PropertyKeys.height);
+ }
+
+ public void setHeight(String height) {
+ getStateHelper().put(PropertyKeys.height, height);
+ }
+
public String getItemHeaderClassActive() {
return (String) getStateHelper().eval(PropertyKeys.itemHeaderClassActive);
}
Modified: branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java
===================================================================
--- branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionRenderer.java 2010-08-20 14:17:25 UTC (rev 18850)
@@ -25,6 +25,7 @@
import org.ajax4jsf.javascript.JSObject;
import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.AbstractAccordion;
+import org.richfaces.component.util.HtmlUtil;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
@@ -34,6 +35,8 @@
import java.io.IOException;
import java.util.Map;
+import static org.richfaces.component.html.HtmlAccordion.PropertyKeys.*;
+
/**
* @author akolonitsky
* @since 2010-08-05
@@ -56,6 +59,15 @@
}
@Override
+ protected String getStyle(UIComponent component) {
+ return HtmlUtil.concatStyles(
+ attributeAsStyle(component, height),
+ attributeAsStyle(component, width),
+
+ super.getStyle(component));
+ }
+
+ @Override
protected String getStyleClass(UIComponent component) {
return "rf-ac " + attributeAsString(component, "styleClass");
}
@@ -79,6 +91,7 @@
@Override
protected Map<String, Object> getScriptObjectOptions(FacesContext context, UIComponent component) {
Map<String, Object> options = super.getScriptObjectOptions(context, component);
+ options.put("isKeepHeight", !attributeAsString(component, height).isEmpty());
options.remove("items");
return options;
Modified: branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
===================================================================
--- branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2010-08-20 14:17:25 UTC (rev 18850)
@@ -43,7 +43,7 @@
*/
public class DivPanelRenderer extends RendererBase {
- private static final RenderKitUtils.Attributes PASS_THROUGH_ATTRIBUTES0 = attributes(
+ private static final RenderKitUtils.Attributes PASS_THROUGH_ATTRIBUTES = attributes(
lang,
onclick,
ondblclick,
@@ -53,10 +53,21 @@
onmouseover,
onmouseup,
title,
- style,
dir
);
+ protected static String attributeAsStyle(UIComponent comp, Enum attr) {
+ String value = attributeAsString(comp, attr.toString());
+ if (value.isEmpty()) {
+ return "";
+ }
+
+ return new StringBuilder()
+ .append(attr).append(':').append(value).toString();
+ }
+ protected static String attributeAsString(UIComponent comp, Enum attr) {
+ return attributeAsString(comp, attr.toString());
+ }
protected static String attributeAsString(UIComponent comp, String attr) {
Object o = comp.getAttributes().get(attr);
return o == null ? "" : o.toString();
@@ -80,9 +91,18 @@
writer.startElement(HTML.DIV_ELEM, component);
writer.writeAttribute("id", component.getClientId(context), "clientId");
writer.writeAttribute("class", getStyleClass(component), null);
- renderPassThroughAttributes(context, component, PASS_THROUGH_ATTRIBUTES0);
+ writer.writeAttribute(HTML.STYLE_ATTRIBUTE, getStyle(component), null);
+ renderPassThroughAttributes(context, component, getPassThroughAttributes());
}
+ protected String getStyle(UIComponent component) {
+ return attributeAsString(component, "style");
+ }
+
+ protected RenderKitUtils.Attributes getPassThroughAttributes() {
+ return PASS_THROUGH_ATTRIBUTES;
+ }
+
protected String getStyleClass(UIComponent component) {
return attributeAsString(component, "styleClass");
}
Modified: branches/RF-9112/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
--- branches/RF-9112/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-08-20 14:17:25 UTC (rev 18850)
@@ -25,6 +25,16 @@
</property>
<property>
<description></description>
+ <property-name>height</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>width</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
<property-name>bypassUpdates</property-name>
<property-class>boolean</property-class>
</property>
Modified: branches/RF-9112/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- branches/RF-9112/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-08-20 14:17:25 UTC (rev 18850)
@@ -338,6 +338,16 @@
</attribute>
<attribute>
<description></description>
+ <name>height</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>width</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
<name>bypassUpdates</name>
<type>boolean</type>
</attribute>
Modified: branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem.js
===================================================================
--- branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem.js 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem.js 2010-08-20 14:17:25 UTC (rev 18850)
@@ -69,7 +69,10 @@
* @return {jQuery Object}
* */
__content : function () {
- return $(rf.getDomElement(this.id + ":content"));
+ if (!this.__content_) {
+ this.__content_ = $(rf.getDomElement(this.id + ":content"));
+ }
+ return this.__content_;
},
/**
@@ -80,14 +83,15 @@
__enter : function () {
var parentPanel = this.getTogglePanel();
if (parentPanel.isKeepHeight) {
+ this.__content().hide();
var h = parentPanel.getInnerHeight();
var items = parentPanel.getItems();
for (var i = 0; i < items.length; i++) {
- h -= items[i].getHeight();
+ h -= items[i].__header().outerHeight();
}
- this.__content().height(h);
+ this.__content().height(h - 20); // 20 it is padding top and bottom
}
this.__content().show();
Modified: branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.ecss
===================================================================
--- branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.ecss 2010-08-20 14:14:43 UTC (rev 18849)
+++ branches/RF-9112/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/accordion.ecss 2010-08-20 14:17:25 UTC (rev 18850)
@@ -1,5 +1,5 @@
.rf-ac {
- width: 300px; /*visible width*/
+ /*width: 300px;*/ /*visible width*/
border-width: 1px;
border-style: solid;
border-color: '#{richSkin.panelBorderColor}';
@@ -28,7 +28,7 @@
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: '#{richSkin.panelBorderColor}';
- height: 100px /*visible modal panel height minus header height*/;
+ /*height: 100px*/ /*visible modal panel height minus header height*/;
position: relative;
overflow: auto;
overflow-x: hidden;
15 years, 8 months
JBoss Rich Faces SVN: r18849 - in trunk/ui/input/ui/src/test: java and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-08-20 10:14:43 -0400 (Fri, 20 Aug 2010)
New Revision: 18849
Added:
trunk/ui/input/ui/src/test/java/
trunk/ui/input/ui/src/test/java/org/
trunk/ui/input/ui/src/test/java/org/richfaces/
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
trunk/ui/input/ui/src/test/resources/
trunk/ui/input/ui/src/test/resources/org/
trunk/ui/input/ui/src/test/resources/org/richfaces/
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml
Log:
add test for the inplaceInput
Added: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java (rev 0)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/DataBean.java 2010-08-20 14:14:43 UTC (rev 18849)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * 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 org.richfaces.renderkit;
+
+
+public class DataBean {
+
+ private String value = "Test String";
+
+ public DataBean() {
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
Added: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java (rev 0)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-08-20 14:14:43 UTC (rev 18849)
@@ -0,0 +1,222 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * 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 org.richfaces.renderkit;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.util.List;
+
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.html.DomNode;
+import com.gargoylesoftware.htmlunit.html.DomText;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class InplaceInputRendererTest {
+
+ private HtmlUnitEnvironment environment;
+
+ @Before
+ public void setUp() {
+ environment = new HtmlUnitEnvironment();
+
+ environment.withWebRoot(new File("src/test/resources"));
+ environment.withResource("/WEB-INF/faces-config.xml", "org/richfaces/renderkit/faces-config.xml");
+ environment.withResource("/test.xhtml", "org/richfaces/renderkit/rendererTest.xhtml");
+ environment.start();
+ }
+
+ @Test
+ public void testRenderDefaultState() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+ List<?> nodes = page.getByXPath("//*[@id = 'form:input_default']");
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ assertEquals("span", span.getNodeName());
+ assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ HtmlElement label = (HtmlElement)span.getFirstChild();
+ assertEquals("span", label.getNodeName());
+ assertEquals("rf-ii-lbl", label.getAttribute(HTML.CLASS_ATTRIBUTE));
+ DomNode text = label.getFirstChild();
+ assertEquals(DomNode.TEXT_NODE, text.getNodeType());
+
+ HtmlElement edit = (HtmlElement)label.getNextSibling();
+ assertEquals("span", edit.getNodeName());
+ assertEquals("rf-ii-e-s rf-ii-none", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ HtmlElement input = (HtmlElement)edit.getFirstChild();
+ assertEquals("input", input.getNodeName());
+ assertEquals("rf-ii-f", input.getAttribute(HTML.CLASS_ATTRIBUTE));
+ assertEquals(text.getNodeValue(), input.getAttribute(HTML.VALUE_ATTRIBUTE));
+
+ List<?> buttons = page.getByXPath("//*[@id = 'form:input_default:btn']");
+ assertEquals(true, buttons.isEmpty());
+ }
+
+ @Test
+ public void testRenderEditState() throws Exception {
+
+ HtmlPage page = environment.getPage("/test.jsf");
+
+ List<?> nodes = page.getByXPath("//*[@id = 'form:input_edit']");
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ assertEquals("span", span.getNodeName());
+ assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ HtmlElement label = (HtmlElement)span.getFirstChild();
+ assertEquals("span", label.getNodeName());
+ assertEquals("rf-ii-lbl", label.getAttribute(HTML.CLASS_ATTRIBUTE));
+ DomNode text = label.getFirstChild();
+ assertEquals(DomNode.TEXT_NODE, text.getNodeType());
+
+ HtmlElement edit = (HtmlElement)label.getNextSibling();
+ assertEquals("span", edit.getNodeName());
+ assertEquals("rf-ii-e-s", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ HtmlElement input = (HtmlElement)edit.getFirstChild();
+ assertEquals("input", input.getNodeName());
+ assertEquals("rf-ii-f", input.getAttribute(HTML.CLASS_ATTRIBUTE));
+ assertEquals(text.getNodeValue(), input.getAttribute(HTML.VALUE_ATTRIBUTE));
+
+ List<?> buttonNodes = page.getByXPath("//*[@id = 'form:input_edit:btn']");
+ assertEquals(1, buttonNodes.size());
+
+ HtmlElement button = (HtmlElement) buttonNodes.get(0);
+ assertEquals("span", button.getNodeName());
+
+ List<?> okButtonNodes = page.getByXPath("//*[@id = 'form:input_edit:okbtn']");
+ assertEquals(1, okButtonNodes.size());
+
+ HtmlElement okButton = (HtmlElement) okButtonNodes.get(0);
+ assertEquals("input", okButton.getNodeName());
+ assertEquals("rf-ii-btn", okButton.getAttribute(HTML.CLASS_ATTRIBUTE));
+ assertEquals("image", okButton.getAttribute(HTML.TYPE_ATTR));
+
+ List<?> cancelButtonNodes = page.getByXPath("//*[@id = 'form:input_edit:cancelbtn']");
+ assertEquals(1, cancelButtonNodes.size());
+
+ HtmlElement cancelButton = (HtmlElement) cancelButtonNodes.get(0);
+ assertEquals("input", cancelButton.getNodeName());
+ assertEquals("rf-ii-btn", cancelButton.getAttribute(HTML.CLASS_ATTRIBUTE));
+ assertEquals("image", cancelButton.getAttribute(HTML.TYPE_ATTR));
+
+ }
+
+ @Test
+ public void testEdit() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+ edit(page, "input_default");
+ List<?> labelNodes = page.getByXPath("//*[@id = 'form:input_default:label']/text()");
+ assertEquals(1, labelNodes.size());
+ DomText text = (DomText) labelNodes.get(0);
+ assertEquals("Another Test String", text.getTextContent());
+
+ List<?>nodes = page.getByXPath("//*[@id = 'form:input_default']");
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ assertEquals("rf-ii-d-s rf-ii-c-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ }
+
+ private void edit(HtmlPage page, String inplaceInputId) throws Exception {
+ List<?> nodes = page.getByXPath("//*[@id = 'form:" + inplaceInputId + "']");
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ span.click();
+
+ List<?> editNodes = page.getByXPath("//*[@id = 'form:" + inplaceInputId + ":edit']");
+ assertEquals(1, editNodes.size());
+ HtmlElement edit = (HtmlElement) editNodes.get(0);
+ assertEquals("rf-ii-e-s", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ List<?> inputNodes = page.getByXPath("//*[@id = 'form:" + inplaceInputId + ":input']");
+ assertEquals(1, inputNodes.size());
+ HtmlElement input = (HtmlElement) inputNodes.get(0);
+ input.setAttribute(HTML.VALUE_ATTRIBUTE, "");
+ input.type("Another Test String");
+
+ List<?> panelNodes = page.getByXPath("//*[@id = 'form:panel']");
+ assertEquals(1, panelNodes.size());
+ HtmlElement panel = (HtmlElement) panelNodes.get(0);
+ panel.click();
+ }
+
+ @Test
+ public void testEditWithControls() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+
+ edit(page, "input_controls");
+
+ List<?> cancelNodes = page.getByXPath("//*[@id = 'form:input_controls:cancelbtn']");
+ assertEquals(1, cancelNodes.size());
+ HtmlElement cancel = (HtmlElement) cancelNodes.get(0);
+
+ cancel.mouseDown();
+
+ List<?> labelNodes = page.getByXPath("//*[@id = 'form:input_controls:label']/text()");
+ assertEquals(1, labelNodes.size());
+ DomText text = (DomText) labelNodes.get(0);
+ assertEquals("Test String", text.getTextContent());
+
+ List<?> nodes = page.getByXPath("//*[@id = 'form:input_controls']");
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
+
+ edit(page, "input_controls");
+
+ List<?> okNodes = page.getByXPath("//*[@id = 'form:input_controls:okbtn']");
+ assertEquals(1, okNodes.size());
+ HtmlElement ok = (HtmlElement) okNodes.get(0);
+
+ ok.mouseDown();
+
+ labelNodes = page.getByXPath("//*[@id = 'form:input_controls:label']/text()");
+ assertEquals(1, labelNodes.size());
+ text = (DomText) labelNodes.get(0);
+ assertEquals("Another Test String", text.getTextContent());
+
+ nodes = page.getByXPath("//*[@id = 'form:input_controls']");
+ assertEquals(1, nodes.size());
+ span = (HtmlElement) nodes.get(0);
+ assertEquals("rf-ii-d-s rf-ii-c-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
+ }
+
+ @After
+ public void tearDown() {
+ environment.release();
+ environment = null;
+ }
+}
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml (rev 0)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml 2010-08-20 14:14:43 UTC (rev 18849)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config 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-facesconfig_2_0.xsd"
+ version="2.0">
+
+ <managed-bean>
+ <managed-bean-name>dataBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.renderkit.DataBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml (rev 0)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml 2010-08-20 14:14:43 UTC (rev 18849)
@@ -0,0 +1,26 @@
+<!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"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:in="http://richfaces.org/input">
+<f:view contentType="text/html" />
+
+<h:head>
+ <title>Richfaces InplaceInput</title>
+</h:head>
+
+<h:body>
+ <h:form id="form">
+ <in:inplaceInput id="input_default" value="#{dataBean.value}"/>
+
+ <in:inplaceInput id="input_controls" showControls="true" value="#{dataBean.value}"/>
+
+ <in:inplaceInput id="input_edit" state="edit" showControls="true" value="#{dataBean.value}"/>
+
+ <h:panelGroup id="panel">
+ <!-- click here for blur -->
+ </h:panelGroup>
+ </h:form>
+</h:body>
+</html>
15 years, 8 months
JBoss Rich Faces SVN: r18848 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-08-20 10:13:52 -0400 (Fri, 20 Aug 2010)
New Revision: 18848
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
Log:
fix inplaceInput with showControls='true' scrip behavior
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-08-20 14:03:56 UTC (rev 18847)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-08-20 14:13:52 UTC (rev 18848)
@@ -16,10 +16,13 @@
this.initialValue = this.label.text();
this.element.bind(this.editEvent, $.proxy(this.__editHandler, this));
- this.input.bind("change", $.proxy(this.__saveHandler, this));
- this.input.bind("blur", $.proxy(this.__saveHandler, this));
this.input.bind("focus", $.proxy(this.__editHandler, this));
-
+
+ if(!this.showControls) {
+ this.input.bind("change", $.proxy(this.__saveHandler, this));
+ this.input.bind("blur", $.proxy(this.__saveHandler, this));
+ }
+
if(this.showControls) {
this.okbtn = $(document.getElementById(options.okbtn));
this.cancelbtn = $(document.getElementById(options.cancelbtn));
@@ -46,20 +49,21 @@
},
save: function() {
- var inputValue = this.input.val();
- if(inputValue.length > 0) {
- this.label.text(inputValue);
- }
-
- if(inputValue != this.initialValue) {
- this.element.addClass(this.changedCss);
- } else {
- this.element.removeClass(this.changedCss);
- }
-
- if(!this.showControls) {
- this.editContainer.addClass(this.noneCss);
- }
+
+ var inputValue = this.input.val();
+ if(inputValue.length > 0) {
+ this.label.text(inputValue);
+ }
+
+ if(inputValue != this.initialValue) {
+ this.element.addClass(this.changedCss);
+ } else {
+ this.element.removeClass(this.changedCss);
+ }
+
+ if(!this.showControls) {
+ this.editContainer.addClass(this.noneCss);
+ }
},
cancel: function() {
@@ -81,6 +85,7 @@
__saveBtnHandler: function(e) {
this.input.blur();
+ this.save();
this.editContainer.addClass(this.noneCss);
return false;
},
@@ -100,7 +105,6 @@
__saveHandler: function(e) {
this.save();
}
-
}
})());
15 years, 8 months
JBoss Rich Faces SVN: r18847 - in branches/RF-9112: parent and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-20 10:03:56 -0400 (Fri, 20 Aug 2010)
New Revision: 18847
Modified:
branches/RF-9112/core/parent/pom.xml
branches/RF-9112/parent/pom.xml
Log:
RF-9112 removed htmlunit override so that tests don't error
Modified: branches/RF-9112/core/parent/pom.xml
===================================================================
--- branches/RF-9112/core/parent/pom.xml 2010-08-20 14:03:25 UTC (rev 18846)
+++ branches/RF-9112/core/parent/pom.xml 2010-08-20 14:03:56 UTC (rev 18847)
@@ -42,33 +42,6 @@
<dependencyManagement>
<dependencies>
- <!-- Test Dependencies -->
- <!--
- These dependencies are usually provided by
- org.jboss.test-jsf:htmlunit-client, but the latest 2.7
- HtmlUnit version has problems with jQuery, so we are
- overriding version back to 2.5.
- -->
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.5</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit-core-js</artifactId>
- <version>2.5</version>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>2.5.2</version>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymockclassextension</artifactId>
- <version>2.5.2</version>
- </dependency>
</dependencies>
</dependencyManagement>
Modified: branches/RF-9112/parent/pom.xml
===================================================================
--- branches/RF-9112/parent/pom.xml 2010-08-20 14:03:25 UTC (rev 18846)
+++ branches/RF-9112/parent/pom.xml 2010-08-20 14:03:56 UTC (rev 18847)
@@ -88,17 +88,17 @@
HtmlUnit version has problems with jQuery, so we are
overriding version back to 2.5.
-->
+<!-- <dependency>-->
+<!-- <groupId>net.sourceforge.htmlunit</groupId>-->
+<!-- <artifactId>htmlunit</artifactId>-->
+<!-- <version>2.8</version>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>net.sourceforge.htmlunit</groupId>-->
+<!-- <artifactId>htmlunit-core-js</artifactId>-->
+<!-- <version>2.8</version>-->
+<!-- </dependency>-->
<dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.5</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit-core-js</artifactId>
- <version>2.5</version>
- </dependency>
- <dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>2.5.2</version>
15 years, 8 months
JBoss Rich Faces SVN: r18846 - trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-20 10:03:25 -0400 (Fri, 20 Aug 2010)
New Revision: 18846
Removed:
trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java
Modified:
trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java
trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java
Log:
https://jira.jboss.org/browse/RF-8936
Deleted: trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java 2010-08-20 14:02:27 UTC (rev 18845)
+++ trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java 2010-08-20 14:03:25 UTC (rev 18846)
@@ -1,126 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.renderkit.html.images;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.util.HtmlColor;
-import org.richfaces.resource.DynamicResource;
-import org.richfaces.resource.ImageType;
-
-/**
- * implementation of the default CANCEL icon renderer
- *
- * @author Anton Belevich
- * @since 3.2.0
- */
-@DynamicResource
-public class CancelControlIcon extends Java2Dresource {
-
- protected static final String ALTERNATE_COLOR = "#ED6161";
-
- private static final Dimension DIMENSIONS = new Dimension(11, 11);
-
- protected Integer iconColor;
- protected Integer iconBorderColor;
-
- public CancelControlIcon() {
- super(ImageType.GIF);
- }
-
- @Override
- public Dimension getDimension() {
- return DIMENSIONS;
- }
-
- @Override
- public void readState(FacesContext context, DataInput stream) throws IOException {
- super.readState(context, stream);
-
- this.iconColor = stream.readInt();
- this.iconBorderColor = stream.readInt();
- }
-
- public void writeState(FacesContext context, DataOutput stream) throws IOException {
- super.writeState(context, stream);
-
- stream.writeInt(this.iconColor);
- stream.writeInt(this.iconBorderColor);
- }
-
- @Override
- protected void paint(Graphics2D g2d, Dimension dimension) {
-
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
-// g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
-// g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_DEFAULT);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_DEFAULT);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_DEFAULT);
- Color iconColour = new Color(iconColor);
- Color iconBorder = new Color(iconBorderColor);
- g2d.setColor(iconColour);
-
- Color altenateColor = HtmlColor.decode(ALTERNATE_COLOR);
- GradientPaint gradient = new GradientPaint(2, 3, altenateColor, 3, 9, iconColour);
- g2d.setPaint(gradient);
-
- // draw cross
- g2d.drawLine(2, 3, 7, 8);
- g2d.drawLine(3, 3, 7, 7);
- g2d.drawLine(3, 2, 8, 7);
-
- g2d.drawLine(2, 7, 7, 2);
- g2d.drawLine(3, 7, 7, 3);
- g2d.drawLine(3, 8, 8, 3);
-
- //draw border
- g2d.setColor(iconBorder);
- g2d.drawLine(1, 3, 3, 5);
- g2d.drawLine(3, 5, 1, 7);
- g2d.drawLine(1, 7, 3, 9);
- g2d.drawLine(3, 9, 5, 7);
- g2d.drawLine(5, 7, 7, 9);
- g2d.drawLine(7, 9, 9, 7);
- g2d.drawLine(9, 7, 7, 5);
- g2d.drawLine(7, 5, 9, 3);
- g2d.drawLine(9, 3, 7, 1);
- g2d.drawLine(7, 1, 5, 3);
- g2d.drawLine(5, 3, 3, 1);
- g2d.drawLine(3, 1, 1, 3);
-
-
- }
-}
-
Modified: trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java 2010-08-20 14:02:27 UTC (rev 18845)
+++ trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/InputErrorIcon.java 2010-08-20 14:03:25 UTC (rev 18846)
@@ -20,30 +20,27 @@
*/
package org.richfaces.renderkit.html.images;
-import org.ajax4jsf.resource.ResourceContext;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
-import java.awt.*;
-
public class InputErrorIcon extends OneColorBasedResource {
+ private static final Dimension DIMENSION = new Dimension(6, 11);
+
public InputErrorIcon() {
- super(6, 11, "warningColor");
+ super("warningColor");
}
- /**
- * @see org.ajax4jsf.resource.Java2Dresource#paint(ResourceContext, Graphics2D)
- */
- protected void paint(ResourceContext context, Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+ @Override
+ public Dimension getDimension() {
+ return DIMENSION;
+ }
+
+ @Override
+ public void paint(Graphics2D g2d, Dimension dimension) {
g2d.setColor(getBasicColor());
g2d.fillRect(3, 2, 2, 6);
g2d.fillRect(3, 9, 2, 2);
}
- @Override
- public Dimension getDimension() {
- // TODO Auto-generated method stub
- return null;
- }
-
}
Modified: trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java 2010-08-20 14:02:27 UTC (rev 18845)
+++ trunk/core/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java 2010-08-20 14:03:25 UTC (rev 18846)
@@ -23,40 +23,84 @@
import java.awt.Color;
import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Map;
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.resource.ResourceContext;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.resource.CacheableResource;
import org.richfaces.resource.DynamicResource;
import org.richfaces.resource.ImageType;
+import org.richfaces.resource.Java2DUserResource;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
@DynamicResource
-public abstract class OneColorBasedResource extends Java2Dresource {
+public abstract class OneColorBasedResource implements Java2DUserResource, CacheableResource, StateHolderResource {
- private Dimension dimension;
-
private String basicColorParamName;
private Color basicColor;
- public OneColorBasedResource(int width, int height, final String basicColorParamName) {
- super(ImageType.GIF);
+ public OneColorBasedResource(final String basicColorParamName) {
this.basicColorParamName = basicColorParamName;
- this.dimension = new Dimension(width, height);
-
}
/**
- * @see Java2Dresource#isCacheable(ResourceContext)
- */
- public boolean isCacheable(ResourceContext ctx) {
- return true;
- }
-
- /**
* Gets value of basicColor field.
* @return value of basicColor field
*/
- public Color getBasicColor() {
+ protected Color getBasicColor() {
return basicColor;
}
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws IOException {
+ Skin skin = SkinFactory.getInstance(context).getSkin(context);
+ dataOutput.writeInt(skin.getColorParameter(context, basicColorParamName));
+ }
+
+ public void readState(FacesContext context, DataInput dataInput) throws IOException {
+ basicColor = new Color(dataInput.readInt());
+ }
+
+ public boolean isCacheable(FacesContext context) {
+ return true;
+ }
+
+ public Date getExpires(FacesContext context) {
+ return null;
+ }
+
+ public int getTimeToLive(FacesContext context) {
+ return 0;
+ }
+
+ public String getEntityTag(FacesContext context) {
+ return null;
+ }
+
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+
+ public Date getLastModified() {
+ return null;
+ }
+
+ public ImageType getImageType() {
+ return ImageType.GIF;
+ }
+
+ public abstract Dimension getDimension();
+
+ public abstract void paint(Graphics2D graphics2d, Dimension dimension);
}
15 years, 8 months
JBoss Rich Faces SVN: r18845 - trunk/core/api/src/main/java/org/richfaces/resource.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-20 10:02:27 -0400 (Fri, 20 Aug 2010)
New Revision: 18845
Modified:
trunk/core/api/src/main/java/org/richfaces/resource/ImageType.java
Log:
https://jira.jboss.org/browse/RF-9119
Modified: trunk/core/api/src/main/java/org/richfaces/resource/ImageType.java
===================================================================
--- trunk/core/api/src/main/java/org/richfaces/resource/ImageType.java 2010-08-20 12:06:11 UTC (rev 18844)
+++ trunk/core/api/src/main/java/org/richfaces/resource/ImageType.java 2010-08-20 14:02:27 UTC (rev 18845)
@@ -21,14 +21,20 @@
*/
package org.richfaces.resource;
+import java.awt.Transparency;
+import java.awt.color.ColorSpace;
import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.ComponentColorModel;
+import java.awt.image.DataBuffer;
import java.awt.image.IndexColorModel;
+import java.awt.image.WritableRaster;
public enum ImageType {
GIF("gif") {
@Override
public BufferedImage createImage(int width, int height) {
- return createARGBImage(width, height);
+ return createBitmaskImage(width, height);
}
},
PNG("png") {
@@ -98,6 +104,15 @@
return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
}
+ private static BufferedImage createBitmaskImage(int width, int height) {
+ ColorModel colorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), true, false,
+ Transparency.BITMASK, DataBuffer.TYPE_BYTE);
+
+ WritableRaster raster = colorModel.createCompatibleWritableRaster(width, height);
+
+ return new BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), null);
+ }
+
public abstract BufferedImage createImage(int width, int height);
public String getFormatName() {
15 years, 8 months
JBoss Rich Faces SVN: r18844 - in modules/tests/metamer/trunk/application/src/main: webapp/components and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-08-20 08:06:11 -0400 (Fri, 20 Aug 2010)
New Revision: 18844
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnGroupBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumnGroup/
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumnGroup/header.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richColumnGroup/list.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
https://jira.jboss.org/browse/RFPL-730
* added one page for rich:columnGroup
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-08-20 10:58:54 UTC (rev 18843)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-08-20 12:06:11 UTC (rev 18844)
@@ -111,6 +111,7 @@
components.put("richAccordion", "Rich Accordion");
components.put("richAccordionItem", "Rich Accordion Item");
components.put("richColumn", "Rich Column");
+ components.put("richColumnGroup", "Rich Column Group");
components.put("richComponentControl", "Rich Component Control");
components.put("richDataGrid", "Rich Data Grid");
components.put("richDataScroller", "Rich Data Scroller");
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnGroupBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnGroupBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnGroupBean.java 2010-08-20 12:06:11 UTC (rev 18844)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * 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 org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+import javax.annotation.PostConstruct;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import org.richfaces.component.UIColumnGroup;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:columnGroup.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richColumnGroupBean")
+@SessionScoped
+public class RichColumnGroupBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private int page = 1;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UIColumnGroup.class, getClass());
+
+ attributes.setAttribute("rendered", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public int getPage() {
+ return page;
+ }
+
+ public void setPage(int page) {
+ this.page = page;
+ }
+}
Property changes on: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnGroupBean.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richColumnGroup/header.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richColumnGroup/header.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richColumnGroup/header.xhtml 2010-08-20 12:06:11 UTC (rev 18844)
@@ -0,0 +1,104 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+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.
+-->
+
+<!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" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable" rows="10" value="#{model.employees}" var="record">
+
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup"
+ breakBefore="#{richColumnGroupBean.attributes['breakBefore'].value}"
+ rendered="#{richColumnGroupBean.attributes['rendered'].value}">
+ <rich:column id="colHeaderName" rowspan="2">
+ <h:outputText id="colHeaderNameText" value="Name" />
+ </rich:column>
+ <rich:column id="colHeaderInfo" colspan="4">
+ <h:outputText id="colHeaderInfoText" value="Information" />
+ </rich:column>
+ <rich:column id="colHeaderTitle" breakRowBefore="true">
+ <h:outputText id="colHeaderTitleText" value="Title" />
+ </rich:column>
+ <rich:column id="colHeaderSmoker">
+ <h:outputText id="colHeaderSmokerText" value="Smoker" />
+ </rich:column>
+ <rich:column id="colHeaderColor">
+ <h:outputText id="colHeaderColorText" value="Favorite Color" />
+ </rich:column>
+ <rich:column id="colHeaderNumberOfKids">
+ <h:outputText id="colHeaderNumberOfKidsText" value="Number of Kids" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:column id="columnName">
+ <h:outputText value="#{record.name}" />
+ </rich:column>
+
+ <rich:column id="columnTitle">
+ <h:outputText value="#{record.title}" />
+ </rich:column>
+
+ <rich:column id="columnSmoker">
+ <h:selectBooleanCheckbox value="#{record.smoker}">
+
+ </h:selectBooleanCheckbox>
+ </rich:column>
+
+ <rich:column id="columnFavoriteColor">
+ <h:outputText value="#{record.favoriteColor}" />
+ </rich:column>
+
+ <rich:column id="columnNumberOfKids">
+ <h:outputText value="#{record.numberOfKids}" />
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2" for="richDataTable" page="#{richColumnGroupBean.page}" maxPages="7" render="richDataTable" />
+ </f:facet>
+
+ </rich:dataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richColumnGroupBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richColumnGroup/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richColumnGroup/list.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richColumnGroup/list.xhtml 2010-08-20 12:06:11 UTC (rev 18844)
@@ -0,0 +1,41 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+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.
+-->
+
+<!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" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Column Group</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="header" outcome="header" value="Header">
+ Simple page that contains a table using <b>rich:columnGroup</b> and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
15 years, 8 months