JBoss Rich Faces SVN: r16876 - in branches/community/3.3.X: cdk/maven-archetype-seam-app/src/main/resources/archetype-resources and 20 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-05-03 14:32:44 -0400 (Mon, 03 May 2010)
New Revision: 16876
Modified:
branches/community/3.3.X/cdk/maven-archetype-seam-app/src/main/resources/archetype-resources/pom.xml
branches/community/3.3.X/docs/cdkguide/pom.xml
branches/community/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/pom.xml
branches/community/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/src/main/resources/archetype-resources/pom.xml
branches/community/3.3.X/docs/faq/pom.xml
branches/community/3.3.X/docs/migrationguide/pom.xml
branches/community/3.3.X/docs/photo_album_app_guide/pom.xml
branches/community/3.3.X/docs/pom.xml
branches/community/3.3.X/docs/userguide/pom.xml
branches/community/3.3.X/examples/photoalbum/source/pom.xml
branches/community/3.3.X/pom.xml
branches/community/3.3.X/samples/richfaces-demo/functional-test/pom.xml
branches/community/3.3.X/samples/richfaces-demo/pom.xml
branches/community/3.3.X/samples/seamEAR/pom.xml
branches/community/3.3.X/test-applications/pom.xml
branches/community/3.3.X/test-applications/regression-test/pom.xml
branches/community/3.3.X/test-applications/regressionArea/pom.xml
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/pom.xml
branches/community/3.3.X/test-applications/richfaces-docs/pom.xml
branches/community/3.3.X/test-applications/seamApp/pom.xml
branches/community/3.3.X/test-applications/selenium-testing-lib/pom.xml
branches/community/3.3.X/test-applications/seleniumTest/richfaces/pom.xml
Log:
Update poms
Modified: branches/community/3.3.X/cdk/maven-archetype-seam-app/src/main/resources/archetype-resources/pom.xml
===================================================================
--- branches/community/3.3.X/cdk/maven-archetype-seam-app/src/main/resources/archetype-resources/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/cdk/maven-archetype-seam-app/src/main/resources/archetype-resources/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -18,7 +18,7 @@
</properties>
<repositories>
<repository>
- <id>repository.jboss.com</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
Modified: branches/community/3.3.X/docs/cdkguide/pom.xml
===================================================================
--- branches/community/3.3.X/docs/cdkguide/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/docs/cdkguide/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -20,9 +20,9 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/community/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/pom.xml
===================================================================
--- branches/community/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -34,12 +34,12 @@
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
- <url>dav:https://snapshots.jboss.org/maven2</url>
+ <id>jboss-snapshots-repository</id>
+ <url>${snapshotRepository}</url>
</snapshotRepository>
<downloadUrl>http://labs.jboss.com/portal/jbossrichfaces/downloads</downloadUrl>
</distributionManagement>
Modified: branches/community/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/src/main/resources/archetype-resources/pom.xml
===================================================================
--- branches/community/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/src/main/resources/archetype-resources/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/src/main/resources/archetype-resources/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -20,9 +20,9 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/community/3.3.X/docs/faq/pom.xml
===================================================================
--- branches/community/3.3.X/docs/faq/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/docs/faq/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -20,9 +20,9 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/community/3.3.X/docs/migrationguide/pom.xml
===================================================================
--- branches/community/3.3.X/docs/migrationguide/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/docs/migrationguide/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -20,9 +20,9 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/community/3.3.X/docs/photo_album_app_guide/pom.xml
===================================================================
--- branches/community/3.3.X/docs/photo_album_app_guide/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/docs/photo_album_app_guide/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -22,9 +22,9 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/community/3.3.X/docs/pom.xml
===================================================================
--- branches/community/3.3.X/docs/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/docs/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -20,9 +20,9 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</repository>
</repositories>
@@ -35,9 +35,9 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/community/3.3.X/docs/userguide/pom.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/docs/userguide/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -20,9 +20,9 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/community/3.3.X/examples/photoalbum/source/pom.xml
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/examples/photoalbum/source/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -15,12 +15,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
@@ -42,7 +42,7 @@
</properties>
<repositories>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
Modified: branches/community/3.3.X/pom.xml
===================================================================
--- branches/community/3.3.X/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -104,7 +104,7 @@
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
@@ -119,12 +119,12 @@
http://www.jboss.org/richfaces/download
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/pom.xml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -9,25 +9,10 @@
<url>http://maven.apache.org</url>
<repositories>
<repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <url>http://snapshots.jboss.org/maven2</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
</repositories>
<properties>
<demo.artifactId.suffix />
Modified: branches/community/3.3.X/samples/richfaces-demo/pom.xml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/samples/richfaces-demo/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -22,11 +22,9 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>
- https://repository.jboss.org/nexus/content/groups/public/
- </url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<build>
Modified: branches/community/3.3.X/samples/seamEAR/pom.xml
===================================================================
--- branches/community/3.3.X/samples/seamEAR/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/samples/seamEAR/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -42,23 +42,11 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>snapshots.jboss.org</id>
- <name>Jboss Snapshot Repository for Maven</name>
- <url>http://snapshots.jboss.org/maven2/</url>
- <layout>default</layout>
- </repository>
</repositories>
<dependencyManagement>
<dependencies>
Modified: branches/community/3.3.X/test-applications/pom.xml
===================================================================
--- branches/community/3.3.X/test-applications/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/test-applications/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -12,7 +12,7 @@
<enabled>true</enabled>
</releases>
- <id>jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>JBoss repository</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
Modified: branches/community/3.3.X/test-applications/regression-test/pom.xml
===================================================================
--- branches/community/3.3.X/test-applications/regression-test/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/test-applications/regression-test/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -34,8 +34,9 @@
<repositories>
<repository>
- <id>richfaces</id>
- <url>http://repository.jboss.org/maven2</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
Modified: branches/community/3.3.X/test-applications/regressionArea/pom.xml
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/test-applications/regressionArea/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -18,7 +18,7 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
Modified: branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/pom.xml
===================================================================
--- branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -146,17 +146,4 @@
</plugin>
</plugins>
</build>
-
- <!--pluginRepositories>
- <pluginRepository>
- <id>exadel-repository</id>
- <name>Exadel Maven Repository Manager</name>
- <url>http://maven.eltegra.by:8099/repository</url>
- </pluginRepository>
- <pluginRepository>
- <id>eltegra-maven-proxy</id>
- <name>Exadel Maven Repository Manager</name>
- <url>http://maven.eltegra.by:8099/repository</url>
- </pluginRepository>
- </pluginRepositories-->
</project>
Modified: branches/community/3.3.X/test-applications/richfaces-docs/pom.xml
===================================================================
--- branches/community/3.3.X/test-applications/richfaces-docs/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/test-applications/richfaces-docs/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -29,7 +29,7 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
@@ -44,7 +44,7 @@
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
Modified: branches/community/3.3.X/test-applications/seamApp/pom.xml
===================================================================
--- branches/community/3.3.X/test-applications/seamApp/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/test-applications/seamApp/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -18,15 +18,10 @@
</properties>
<repositories>
<repository>
- <id>repository.jboss.com</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
- <repository>
- <id>repository.exadel.com</id>
- <name>Exadel Maven 2 Repository</name>
- <url>http://repository.exadel.com/</url>
- </repository>
</repositories>
<modules>
Modified: branches/community/3.3.X/test-applications/selenium-testing-lib/pom.xml
===================================================================
--- branches/community/3.3.X/test-applications/selenium-testing-lib/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/test-applications/selenium-testing-lib/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -16,7 +16,7 @@
<distributionManagement>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<name>JBoss Snapshot Repository</name>
<url>dav:https://snapshots.jboss.org/maven2</url>
</snapshotRepository>
Modified: branches/community/3.3.X/test-applications/seleniumTest/richfaces/pom.xml
===================================================================
--- branches/community/3.3.X/test-applications/seleniumTest/richfaces/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
+++ branches/community/3.3.X/test-applications/seleniumTest/richfaces/pom.xml 2010-05-03 18:32:44 UTC (rev 16876)
@@ -168,23 +168,9 @@
</dependencies>
<repositories>
<repository>
- <releases/>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>snapshots.jboss.org</id>
- <url>http://snapshots.jboss.org/maven2</url>
- </repository>
</repositories>
</project>
14 years, 8 months
JBoss Rich Faces SVN: r16875 - in branches/enterprise/3.3.X: cdk/maven-archetype-seam-app/src/main/resources/archetype-resources and 16 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-05-03 14:32:43 -0400 (Mon, 03 May 2010)
New Revision: 16875
Modified:
branches/enterprise/3.3.X/cdk/maven-archetype-seam-app/src/main/resources/archetype-resources/pom.xml
branches/enterprise/3.3.X/docs/cdkguide/pom.xml
branches/enterprise/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/pom.xml
branches/enterprise/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/src/main/resources/archetype-resources/pom.xml
branches/enterprise/3.3.X/docs/faq/pom.xml
branches/enterprise/3.3.X/docs/migrationguide/pom.xml
branches/enterprise/3.3.X/docs/photo_album_app_guide/pom.xml
branches/enterprise/3.3.X/docs/pom.xml
branches/enterprise/3.3.X/docs/userguide/pom.xml
branches/enterprise/3.3.X/examples/photoalbum/source/pom.xml
branches/enterprise/3.3.X/pom.xml
branches/enterprise/3.3.X/samples/richfaces-demo/pom.xml
branches/enterprise/3.3.X/samples/seamEAR/pom.xml
branches/enterprise/3.3.X/test-applications/pom.xml
branches/enterprise/3.3.X/test-applications/regressionArea/pom.xml
branches/enterprise/3.3.X/test-applications/richfaces-docs/pom.xml
branches/enterprise/3.3.X/test-applications/seamApp/pom.xml
branches/enterprise/3.3.X/test-applications/seleniumTest/richfaces/pom.xml
Log:
Update poms
Modified: branches/enterprise/3.3.X/cdk/maven-archetype-seam-app/src/main/resources/archetype-resources/pom.xml
===================================================================
--- branches/enterprise/3.3.X/cdk/maven-archetype-seam-app/src/main/resources/archetype-resources/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/cdk/maven-archetype-seam-app/src/main/resources/archetype-resources/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -18,7 +18,7 @@
</properties>
<repositories>
<repository>
- <id>repository.jboss.com</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
Modified: branches/enterprise/3.3.X/docs/cdkguide/pom.xml
===================================================================
--- branches/enterprise/3.3.X/docs/cdkguide/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/docs/cdkguide/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -13,16 +13,9 @@
<description>Richfaces CDK Developer Guide</description>
<pluginRepositories>
<pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/enterprise/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/pom.xml
===================================================================
--- branches/enterprise/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -33,14 +33,15 @@
</build>
<distributionManagement>
<repository>
- <uniqueVersion>false</uniqueVersion>
- <id>repository.jboss.org</id>
- <url>${releaseRepository}</url>
- </repository>
- <snapshotRepository>
- <id>snapshots.jboss.org</id>
- <url>dav:https://snapshots.jboss.org/maven2</url>
- </snapshotRepository>
+ <id>jboss-releases-repository</id>
+ <uniqueVersion>false</uniqueVersion>
+ <url>${releaseRepository}</url>
+ </repository>
+ <snapshotRepository>
+ <id>jboss-snapshots-repository</id>
+ <uniqueVersion>true</uniqueVersion>
+ <url>${snapshotRepository}</url>
+ </snapshotRepository>
<downloadUrl>http://labs.jboss.com/portal/jbossrichfaces/downloads</downloadUrl>
</distributionManagement>
</project>
\ No newline at end of file
Modified: branches/enterprise/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/src/main/resources/archetype-resources/pom.xml
===================================================================
--- branches/enterprise/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/src/main/resources/archetype-resources/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/docs/common-resources/en/src/main/archetypes/richfaces_archetype/src/main/resources/archetype-resources/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -13,16 +13,9 @@
<description>Richfaces Guide Template</description>
<pluginRepositories>
<pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/enterprise/3.3.X/docs/faq/pom.xml
===================================================================
--- branches/enterprise/3.3.X/docs/faq/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/docs/faq/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -13,16 +13,9 @@
<description>Frequently asked questions</description>
<pluginRepositories>
<pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/enterprise/3.3.X/docs/migrationguide/pom.xml
===================================================================
--- branches/enterprise/3.3.X/docs/migrationguide/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/docs/migrationguide/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -13,16 +13,9 @@
<description>RichFaces Migration Guide from 3.1.* to 3.2.0 version</description>
<pluginRepositories>
<pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/enterprise/3.3.X/docs/photo_album_app_guide/pom.xml
===================================================================
--- branches/enterprise/3.3.X/docs/photo_album_app_guide/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/docs/photo_album_app_guide/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -15,16 +15,9 @@
<description>RichFaces Photo Album Application Guide</description>
<pluginRepositories>
<pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/enterprise/3.3.X/docs/pom.xml
===================================================================
--- branches/enterprise/3.3.X/docs/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/docs/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -13,32 +13,18 @@
<!-- setup repositories, to build documentation separate from Java projects -->
<repositories>
<repository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/enterprise/3.3.X/docs/userguide/pom.xml
===================================================================
--- branches/enterprise/3.3.X/docs/userguide/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/docs/userguide/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -20,9 +20,9 @@
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
Modified: branches/enterprise/3.3.X/examples/photoalbum/source/pom.xml
===================================================================
--- branches/enterprise/3.3.X/examples/photoalbum/source/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/examples/photoalbum/source/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -15,12 +15,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
@@ -40,9 +40,9 @@
</properties>
<repositories>
<repository>
- <id>repository.jboss.org</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<modules>
Modified: branches/enterprise/3.3.X/pom.xml
===================================================================
--- branches/enterprise/3.3.X/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -99,13 +99,9 @@
<repositories>
<repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.org</id>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<distributionManagement>
@@ -113,12 +109,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
Modified: branches/enterprise/3.3.X/samples/richfaces-demo/pom.xml
===================================================================
--- branches/enterprise/3.3.X/samples/richfaces-demo/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/samples/richfaces-demo/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -20,9 +20,9 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
Modified: branches/enterprise/3.3.X/samples/seamEAR/pom.xml
===================================================================
--- branches/enterprise/3.3.X/samples/seamEAR/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/samples/seamEAR/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -35,30 +35,11 @@
</build>
<repositories>
<repository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>snapshots.jboss.org</id>
- <name>Jboss Snapshot Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
- <layout>default</layout>
- </repository>
</repositories>
<dependencyManagement>
<dependencies>
Modified: branches/enterprise/3.3.X/test-applications/pom.xml
===================================================================
--- branches/enterprise/3.3.X/test-applications/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/test-applications/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -9,13 +9,9 @@
<repositories>
<repository>
- <releases>
- <enabled>true</enabled>
- </releases>
-
- <id>jboss.org</id>
- <name>JBoss repository</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
</repository>
</repositories>
Modified: branches/enterprise/3.3.X/test-applications/regressionArea/pom.xml
===================================================================
--- branches/enterprise/3.3.X/test-applications/regressionArea/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/test-applications/regressionArea/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -14,13 +14,9 @@
<repositories>
<repository>
- <releases/>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.org</id>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<properties>
Modified: branches/enterprise/3.3.X/test-applications/richfaces-docs/pom.xml
===================================================================
--- branches/enterprise/3.3.X/test-applications/richfaces-docs/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/test-applications/richfaces-docs/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -19,9 +19,9 @@
<repository>
- <id>repository.jboss.com</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
- <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
Modified: branches/enterprise/3.3.X/test-applications/seamApp/pom.xml
===================================================================
--- branches/enterprise/3.3.X/test-applications/seamApp/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/test-applications/seamApp/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -18,7 +18,7 @@
</properties>
<repositories>
<repository>
- <id>repository.jboss.com</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
Modified: branches/enterprise/3.3.X/test-applications/seleniumTest/richfaces/pom.xml
===================================================================
--- branches/enterprise/3.3.X/test-applications/seleniumTest/richfaces/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
+++ branches/enterprise/3.3.X/test-applications/seleniumTest/richfaces/pom.xml 2010-05-03 18:32:43 UTC (rev 16875)
@@ -165,23 +165,9 @@
</dependencies>
<repositories>
<repository>
- <releases/>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
+ <id>jboss-public-repository-group</id>
+ <name>Jboss Repository for Maven</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>snapshots.jboss.org</id>
- <url>http://snapshots.jboss.org/maven2</url>
- </repository>
</repositories>
</project>
\ No newline at end of file
14 years, 8 months
JBoss Rich Faces SVN: r16874 - in root: cdk/trunk and 13 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-05-03 14:00:42 -0400 (Mon, 03 May 2010)
New Revision: 16874
Modified:
root/cdk/trunk/pom.xml
root/cdk/trunk/root/pom.xml
root/checkstyle/pom.xml
root/docs/trunk/Component_Development_Kit_Guide/pom.xml
root/docs/trunk/Component_Reference/pom.xml
root/docs/trunk/Developer_Guide/pom.xml
root/docs/trunk/Migration_Guide/pom.xml
root/examples-sandbox/trunk/components/tables/pom.xml
root/examples-sandbox/trunk/pom.xml
root/examples/trunk/components/core-demo/pom.xml
root/examples/trunk/pom.xml
root/examples/trunk/richfaces-demo/pom.xml
root/framework/trunk/version-matrix/pom.xml
root/pom.xml
root/ui/trunk/version-matrix/pom.xml
Log:
RFPL-533
Modified: root/cdk/trunk/pom.xml
===================================================================
--- root/cdk/trunk/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/cdk/trunk/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -32,12 +32,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
Modified: root/cdk/trunk/root/pom.xml
===================================================================
--- root/cdk/trunk/root/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/cdk/trunk/root/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -36,12 +36,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
@@ -64,14 +64,14 @@
</repository>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
Modified: root/checkstyle/pom.xml
===================================================================
--- root/checkstyle/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/checkstyle/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -19,12 +19,12 @@
<distributionManagement>
<downloadUrl>http://labs.jboss.com/portal/jbossrichfaces/downloads</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
Modified: root/docs/trunk/Component_Development_Kit_Guide/pom.xml
===================================================================
--- root/docs/trunk/Component_Development_Kit_Guide/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/docs/trunk/Component_Development_Kit_Guide/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -23,7 +23,7 @@
<repositories>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>JBoss Repository</name>
<layout>default</layout>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
@@ -35,7 +35,7 @@
<pluginRepositories>
<pluginRepository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>JBoss Repository</name>
<layout>default</layout>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
Modified: root/docs/trunk/Component_Reference/pom.xml
===================================================================
--- root/docs/trunk/Component_Reference/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/docs/trunk/Component_Reference/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -23,7 +23,7 @@
<repositories>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>JBoss Repository</name>
<layout>default</layout>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
@@ -35,7 +35,7 @@
<pluginRepositories>
<pluginRepository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>JBoss Repository</name>
<layout>default</layout>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
Modified: root/docs/trunk/Developer_Guide/pom.xml
===================================================================
--- root/docs/trunk/Developer_Guide/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/docs/trunk/Developer_Guide/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -23,7 +23,7 @@
<repositories>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>JBoss Repository</name>
<layout>default</layout>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
@@ -35,7 +35,7 @@
<pluginRepositories>
<pluginRepository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>JBoss Repository</name>
<layout>default</layout>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
Modified: root/docs/trunk/Migration_Guide/pom.xml
===================================================================
--- root/docs/trunk/Migration_Guide/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/docs/trunk/Migration_Guide/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -23,7 +23,7 @@
<repositories>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>JBoss Repository</name>
<layout>default</layout>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
@@ -35,7 +35,7 @@
<pluginRepositories>
<pluginRepository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>JBoss Repository</name>
<layout>default</layout>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
Modified: root/examples/trunk/components/core-demo/pom.xml
===================================================================
--- root/examples/trunk/components/core-demo/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/examples/trunk/components/core-demo/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -16,7 +16,7 @@
<repositories>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</repository>
Modified: root/examples/trunk/pom.xml
===================================================================
--- root/examples/trunk/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/examples/trunk/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -16,12 +16,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
Modified: root/examples/trunk/richfaces-demo/pom.xml
===================================================================
--- root/examples/trunk/richfaces-demo/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/examples/trunk/richfaces-demo/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -18,7 +18,7 @@
<repositories>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</repository>
Modified: root/examples-sandbox/trunk/components/tables/pom.xml
===================================================================
--- root/examples-sandbox/trunk/components/tables/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/examples-sandbox/trunk/components/tables/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -16,7 +16,7 @@
<repositories>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>Jboss Repository for Maven</name>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</repository>
Modified: root/examples-sandbox/trunk/pom.xml
===================================================================
--- root/examples-sandbox/trunk/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/examples-sandbox/trunk/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -16,12 +16,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
Modified: root/framework/trunk/version-matrix/pom.xml
===================================================================
--- root/framework/trunk/version-matrix/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/framework/trunk/version-matrix/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -22,12 +22,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
@@ -48,14 +48,14 @@
</repository>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
Modified: root/pom.xml
===================================================================
--- root/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -16,12 +16,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
Modified: root/ui/trunk/version-matrix/pom.xml
===================================================================
--- root/ui/trunk/version-matrix/pom.xml 2010-05-03 16:45:09 UTC (rev 16873)
+++ root/ui/trunk/version-matrix/pom.xml 2010-05-03 18:00:42 UTC (rev 16874)
@@ -21,12 +21,12 @@
http://labs.jboss.com/portal/jbossrichfaces/downloads
</downloadUrl>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-releases-repository</id>
<uniqueVersion>false</uniqueVersion>
<url>${releaseRepository}</url>
</repository>
<snapshotRepository>
- <id>snapshots.jboss.org</id>
+ <id>jboss-snapshots-repository</id>
<uniqueVersion>true</uniqueVersion>
<url>${snapshotRepository}</url>
</snapshotRepository>
@@ -36,14 +36,14 @@
</distributionManagement>
<repositories>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
14 years, 8 months
JBoss Rich Faces SVN: r16873 - root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-03 12:45:09 -0400 (Mon, 03 May 2010)
New Revision: 16873
Added:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
Log:
add class whilch hold filtering/sorting process logic
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2010-05-03 14:56:30 UTC (rev 16872)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2010-05-03 16:45:09 UTC (rev 16873)
@@ -38,7 +38,7 @@
*
*/
public abstract class AbstractRowsRenderer extends RendererBase implements DataVisitor {
-
+
public DataVisitResult process(FacesContext context, Object rowKey, Object argument) {
RowHolderBase holder = (RowHolderBase) argument;
Row row = holder.getRow();
@@ -55,22 +55,14 @@
protected void encodeRows(RowHolderBase rowHolder) throws IOException {
rowHolder.getRow().walk(rowHolder.getContext(), this, rowHolder);
}
-
- public void encodeRowsBegin(ResponseWriter writer, FacesContext context, RowHolderBase holder) throws IOException {
- }
-
- public void encodeRowsEnd(ResponseWriter writer, FacesContext context, RowHolderBase holder) throws IOException {
- }
-
+
public abstract void encodeRow(RowHolderBase rowHolder) throws IOException;
@Override
protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component)
throws IOException {
RowHolderBase rowHolder = createRowHolder(context, component);
- encodeRowsBegin(writer, context, rowHolder);
encodeRows(rowHolder);
- encodeRowsEnd(writer, context, rowHolder);
}
public abstract RowHolderBase createRowHolder(FacesContext context, UIComponent component);
@@ -83,5 +75,4 @@
public boolean getRendersChildren() {
return true;
}
-
}
Added: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2010-05-03 16:45:09 UTC (rev 16873)
@@ -0,0 +1,274 @@
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.component.Row;
+import org.richfaces.component.UIDataTableBase;
+
+
+public abstract class AbstractTableBaseRenderer extends DataTableRowsRenderer {
+
+ public static final String ROW_CLASS_KEY = "rowClass";
+
+ public static final String FIRST_ROW_CLASS_KEY = "firstRowClass";
+
+ public static final String CELL_CLASS_KEY = "cellClass";
+
+ public static final String CELL_ELEMENT_KEY = "cellElement";
+
+
+ public RowHolder encodeColumn(FacesContext context, UIColumn component, ResponseWriter writer, RowHolder holder) throws IOException {
+
+ String parentId = holder.getDataTableId();
+
+ if (component instanceof org.richfaces.component.UIColumn) {
+ Map<String, Object> attributes = component.getAttributes();
+ if (Boolean.TRUE.equals(attributes.get("breakBefore")) && holder.getProcessCell() != 0) {
+ encodeRowEnd(writer, context, component);
+ holder.nextRow();
+ holder.setRowStart(true);
+ }
+ }
+
+ if (holder.isRowStart()) {
+ if (holder.getCurrentRow() == 0) {
+ encodeFirstRowStart(writer, context, parentId, component);
+ } else {
+ encodeRowStart(writer, context, parentId, component);
+ }
+
+ holder.setRowStart(false);
+ }
+
+ encodeColumnStart(writer, context, parentId, component);
+ renderChildren(context, component);
+ encodeColumnEnd(writer, context, parentId, component);
+
+ if (holder.isLastColumn()) {
+ if (holder.getCurrentRow() == 0) {
+ encodeFirstRowEnd(writer, context, component);
+ } else {
+ encodeRowEnd(writer, context, component);
+ }
+ }
+ holder.nextCell();
+
+ return holder;
+ }
+
+ public void encodeColumnStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
+ writer.startElement(getCellElement(context, parentId), component);
+ String cellClass = getCellClass(context, parentId);
+ encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, cellClass);
+
+ if (component instanceof org.richfaces.component.UIColumn) {
+ Map<String, Object> attributes = component.getAttributes();
+
+ int rowspan = (Integer) attributes.get("rowspan");
+ if (rowspan != Integer.MIN_VALUE) {
+ writer.writeAttribute("rowspan", Integer.valueOf(rowspan), null);
+ }
+
+ int colspan = (Integer) attributes.get("colspan");
+ if (colspan != Integer.MIN_VALUE) {
+ writer.writeAttribute("colspan", Integer.valueOf(colspan), null);
+ }
+ }
+ }
+
+ @Override
+ protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+
+ if(component instanceof UIDataTableBase) {
+ UIDataTableBase dataTable = (UIDataTableBase)component;
+ int rowCount = dataTable.getRowCount();
+ if(rowCount > 0) {
+ super.doEncodeChildren(writer, context, component);
+ } else {
+ int columns = getColumnsCount(dataTable.columns());
+
+ writer.startElement(HTML.TR_ELEMENT, dataTable);
+ writer.startElement(HTML.TD_ELEM, dataTable);
+ writer.writeAttribute("colspan", columns, null);
+
+ String styleClass = (String)dataTable.getAttributes().get("noDataStyleClass");
+ styleClass = styleClass != null ? "rich-nodata-cell " + styleClass : "rich-nodata-cell";
+
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, styleClass, null);
+
+ UIComponent noDataFacet = dataTable.getNoData();
+ if(noDataFacet != null && noDataFacet.isRendered() ) {
+ noDataFacet.encodeAll(context);
+ } else {
+ String noDataLabel = dataTable.getNoDataLabel();
+ if(noDataLabel != null) {
+ writer.writeText(noDataLabel, "noDataLabel");
+ }
+ }
+
+ writer.endElement(HTML.TD_ELEM);
+ writer.endElement(HTML.TR_ELEMENT);
+ }
+ }
+
+ }
+
+ public void encodeColumnEnd(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
+ writer.endElement(getCellElement(context, parentId));
+ }
+
+ public void encodeFirstRowStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
+ writer.startElement(HTML.TR_ELEMENT, component);
+ getUtils().encodeId(context, component);
+ String styleClass = getFirstRowClass(context, parentId);
+ encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, styleClass);
+ }
+
+ public void encodeFirstRowEnd(ResponseWriter writer, FacesContext context, UIComponent component)throws IOException {
+ writer.endElement(HTML.TR_ELEMENT);
+ }
+
+ public void encodeRowStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
+ writer.startElement(HTML.TR_ELEMENT, component);
+ getUtils().encodeId(context, component);
+ String styleClass = getRowClass(context, parentId);
+ encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, styleClass);
+ }
+
+ public void encodeRowEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ writer.endElement(HTML.TR_ELEMENT);
+ }
+
+
+ protected String getFirstRowClass(FacesContext context, String id) {
+ return get(context, id + FIRST_ROW_CLASS_KEY);
+ }
+
+ protected String getRowClass(FacesContext context, String id) {
+ return get(context, id + ROW_CLASS_KEY);
+ }
+
+ protected String getCellClass(FacesContext context, String id) {
+ return get(context, id + CELL_CLASS_KEY);
+ }
+
+ protected String getCellElement(FacesContext context, String id) {
+ return get(context, id + CELL_ELEMENT_KEY);
+ }
+
+ private String get(FacesContext context, String key) {
+ return (String)context.getAttributes().get(key);
+ }
+
+ protected void put(FacesContext context, String id, String key, String value) {
+ context.getAttributes().put(id + key, value);
+ }
+
+ //TODO nick - nested tables will not work correct
+ protected void saveRowStyles(FacesContext context, String id, String firstRowClass, String rowClass, String cellClass) {
+ put(context, id, FIRST_ROW_CLASS_KEY, firstRowClass);
+ put(context, id, ROW_CLASS_KEY, rowClass);
+ put(context, id, CELL_CLASS_KEY, cellClass);
+ }
+
+ public void encodeStyleClass(ResponseWriter writer, FacesContext context, UIComponent component,
+ String styleClassAttribute, String styleClass) throws IOException {
+
+ boolean isEmpty = isEmptyAttr(component, styleClassAttribute);
+ if (isEmpty && !(styleClass != null && styleClass.trim().length() != 0)) {
+ return;
+ }
+
+ String componentStyleClass = isEmpty ? styleClass : styleClass + " "
+ + component.getAttributes().get(styleClassAttribute);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, componentStyleClass, null);
+ }
+
+ protected boolean isEmptyAttr(UIComponent component, String attribute) {
+ if (attribute == null) {
+ return true;
+ }
+
+ String value = (String) component.getAttributes().get(attribute);
+ return !(value != null && value.trim().length() != 0);
+ }
+
+ protected void encodeStyle(ResponseWriter writer, FacesContext context, UIComponent component,
+ String predefinedStyles) throws IOException {
+
+ StringBuffer toEncode = new StringBuffer();
+
+ if (!isEmptyAttr(component, HTML.STYLE_ATTRIBUTE)) {
+ String style = ((String) component.getAttributes().get(HTML.STYLE_ATTRIBUTE)).trim();
+ style = style.endsWith(";") ? style : style + ";";
+ toEncode.append(style);
+ }
+
+ if (!isEmpty(predefinedStyles)) {
+ String style = predefinedStyles.endsWith(";") ? predefinedStyles : predefinedStyles + ";";
+ toEncode.append(style);
+ }
+
+ if (toEncode.length() > 0) {
+ writer.writeAttribute(HTML.STYLE_ATTRIBUTE, toEncode.toString(), null);
+ }
+ }
+
+ protected int getColumnsCount(Iterator<UIComponent> col) {
+ int count = 0;
+ int currentLength = 0;
+ while (col.hasNext()) {
+ UIComponent component = (UIComponent) col.next();
+ if (component.isRendered()) {
+ if (component instanceof Row) {
+ // Store max calculated value of previsous rows.
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ // Calculate number of columns in row.
+ currentLength = getColumnsCount(((Row) component).columns());
+ // Store max calculated value
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ currentLength = 0;
+ } else if (component instanceof org.richfaces.component.UIColumn) {
+ // For new row, save length of previsous.
+ Map<String, Object> attributes = component.getAttributes();
+ if (Boolean.TRUE.equals(attributes.get("breakBefore"))) {
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ currentLength = 0;
+ }
+ Integer colspan = (Integer) attributes.get("colspan");
+ // Append colspan of this column
+ if (null != colspan && colspan.intValue() != Integer.MIN_VALUE) {
+ currentLength += colspan.intValue();
+ } else {
+ currentLength++;
+ }
+ } else if (component instanceof UIColumn) {
+ // UIColumn always have colspan == 1.
+ currentLength++;
+ }
+ }
+ }
+
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ return count;
+ }
+
+
+
+}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-05-03 14:56:30 UTC (rev 16872)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-05-03 16:45:09 UTC (rev 16873)
@@ -16,7 +16,7 @@
@ResourceDependencies(value = { @ResourceDependency(library = "javax.faces", name = "jsf.js"),
@ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "richfaces.js"), @ResourceDependency(name = "richfaces-event.js")})
-public abstract class AbstractTableRenderer extends DataTableRowsRenderer {
+public abstract class AbstractTableRenderer extends AbstractTableBaseRenderer {
public static final String ROW_CLASS = "rowClass";
@@ -26,6 +26,11 @@
public static final String SORTING = "sorting";
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ decodeSortingFiltering(context, component);
+ }
/**
* Returns true if specified attribute (when present on the column) should generate header even if it is not
* specified on the table
@@ -60,9 +65,8 @@
: getColumnsCount(table.columns());
return count;
}
-
-
+ //TODO: anton - remove?
public void encodeTableStructure(ResponseWriter writer, FacesContext context, UIDataTableBase dataTable) throws IOException {
}
@@ -354,4 +358,37 @@
public abstract HeaderEncodeStrategy getHeaderEncodeStrategy(UIComponent column, String tableFacetName);
public abstract boolean containsThead();
+
+ public abstract String getTableSkinClass();
+
+ public abstract String getFirstRowSkinClass();
+
+ public abstract String getRowSkinClass();
+
+ public abstract String getHeaderCellSkinClass();
+
+ public abstract String getHeaderSkinClass();
+
+ public abstract String getHeaderFirstSkinClass();
+
+ public abstract String getColumnHeaderCellSkinClass();
+
+ public abstract String getColumnHeaderSkinClass();
+
+ public abstract String getColumnHeaderFirstSkinClass();
+
+ public abstract String getFooterCellSkinClass();
+
+ public abstract String getFooterSkinClass();
+
+ public abstract String getFooterFirstSkinClass();
+
+ public abstract String getColumnFooterCellSkinClass();
+
+ public abstract String getColumnFooterSkinClass();
+
+ public abstract String getColumnFooterFirstSkinClass();
+
+ public abstract String getCellSkinClass();
+
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java 2010-05-03 14:56:30 UTC (rev 16872)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java 2010-05-03 16:45:09 UTC (rev 16873)
@@ -12,7 +12,7 @@
import org.richfaces.component.UIColumnGroup;
import org.richfaces.component.UIDataTableBase;
-public class ColumnGroupRenderer extends DataTableRowsRenderer {
+public class ColumnGroupRenderer extends AbstractTableBaseRenderer {
@Override
public void encodeRow(RowHolderBase holder) throws IOException {
@@ -34,7 +34,6 @@
@Override
public RowHolderBase createRowHolder(FacesContext context, UIComponent component) {
-
UIComponent parent = component.getParent();
while(parent != null && !(parent instanceof UIDataTableBase)) {
parent = parent.getParent();
@@ -46,86 +45,4 @@
return new RowHolder(context, parent.getClientId(context),(UIColumnGroup)component);
}
-
- // ColumnGroup component doesn't have css styles
- @Override
- public String getCellSkinClass() {
- return null;
- }
-
- @Override
- public String getColumnFooterCellSkinClass() {
- return null;
- }
-
- @Override
- public String getColumnFooterFirstSkinClass() {
- return null;
- }
-
- @Override
- public String getColumnFooterSkinClass() {
- return null;
- }
-
- @Override
- public String getColumnHeaderCellSkinClass() {
- return null;
- }
-
- @Override
- public String getColumnHeaderFirstSkinClass() {
- return null;
- }
-
- @Override
- public String getColumnHeaderSkinClass() {
- return null;
- }
-
- @Override
- public String getFirstRowSkinClass() {
- return null;
- }
-
- @Override
- public String getFooterCellSkinClass() {
- return null;
- }
-
- @Override
- public String getFooterFirstSkinClass() {
- return null;
- }
-
- @Override
- public String getFooterSkinClass() {
- return null;
- }
-
- @Override
- public String getHeaderCellSkinClass() {
- return null;
- }
-
- @Override
- public String getHeaderFirstSkinClass() {
- return null;
- }
-
- @Override
- public String getHeaderSkinClass() {
- return null;
- }
-
- @Override
- public String getRowSkinClass() {
- return null;
- }
-
- @Override
- public String getTableSkinClass() {
- return null;
- }
-
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java 2010-05-03 14:56:30 UTC (rev 16872)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java 2010-05-03 16:45:09 UTC (rev 16873)
@@ -1,305 +1,120 @@
package org.richfaces.renderkit;
-import java.io.IOException;
+import java.util.Collection;
import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
-import javax.faces.component.UIColumn;
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
+import javax.swing.SortOrder;
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.richfaces.component.Row;
import org.richfaces.component.UIDataTableBase;
+import org.richfaces.model.SortMode;
-
public abstract class DataTableRowsRenderer extends AbstractRowsRenderer {
-
- public static final String ROW_CLASS_KEY = "rowClass";
- public static final String FIRST_ROW_CLASS_KEY = "firstRowClass";
+ private static final String FILTERING_STRING = "rich:filterString";
- public static final String CELL_CLASS_KEY = "cellClass";
+ private static final String SORTING_STRING = "rich:sortString";
- public static final String CELL_ELEMENT_KEY = "cellElement";
-
-
- public RowHolder encodeColumn(FacesContext context, UIColumn component, ResponseWriter writer, RowHolder holder) throws IOException {
-
- String parentId = holder.getDataTableId();
-
- if (component instanceof org.richfaces.component.UIColumn) {
- Map<String, Object> attributes = component.getAttributes();
- if (Boolean.TRUE.equals(attributes.get("breakBefore")) && holder.getProcessCell() != 0) {
- encodeRowEnd(writer, context, component);
- holder.nextRow();
- holder.setRowStart(true);
- }
- }
+ private static final String SEPARATOR = ":";
- if (holder.isRowStart()) {
- if (holder.getCurrentRow() == 0) {
- encodeFirstRowStart(writer, context, parentId, component);
- } else {
- encodeRowStart(writer, context, parentId, component);
+ protected void decodeSortingFiltering(FacesContext context, UIComponent component) {
+ if(component instanceof UIDataTableBase) {
+ UIDataTableBase dataTableBase = (UIDataTableBase)component;
+ Map<String, String> requestMap = context.getExternalContext().getRequestParameterMap();
+ String clientId = dataTableBase.getClientId(context);
+
+ String filtering = requestMap.get(clientId + FILTERING_STRING);
+ if(filtering != null && filtering.trim().length() > 0) {
+ decodeFiltering(context, dataTableBase, filtering);
}
-
- holder.setRowStart(false);
- }
-
- encodeColumnStart(writer, context, parentId, component);
- renderChildren(context, component);
- encodeColumnEnd(writer, context, parentId, component);
-
- if (holder.isLastColumn()) {
- if (holder.getCurrentRow() == 0) {
- encodeFirstRowEnd(writer, context, component);
- } else {
- encodeRowEnd(writer, context, component);
+
+ String sorting = requestMap.get(clientId + SORTING_STRING);
+ if(sorting != null && sorting.trim().length() > 0) {
+ decodeSorting(context, dataTableBase, sorting);
}
}
- holder.nextCell();
-
- return holder;
}
- public void encodeColumnStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
- writer.startElement(getCellElement(context, parentId), component);
- String cellClass = getCellClass(context, parentId);
- encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, cellClass);
-
- if (component instanceof org.richfaces.component.UIColumn) {
- Map<String, Object> attributes = component.getAttributes();
-
- int rowspan = (Integer) attributes.get("rowspan");
- if (rowspan != Integer.MIN_VALUE) {
- writer.writeAttribute("rowspan", Integer.valueOf(rowspan), null);
+ protected void decodeFiltering(FacesContext context, UIDataTableBase dataTableBase, String value) {
+ String[] values = value.split(SEPARATOR);
+ if (Boolean.parseBoolean(values[2])) {
+ for (Iterator<UIComponent> iterator = dataTableBase.columns(); iterator.hasNext();) {
+ UIComponent column = iterator.next();
+ if (values[0].equals(column.getId())) {
+ updateAttribute(context, column, "filterValue", values[1]);
+ } else {
+ updateAttribute(context, column, "filterValue", null);
+ }
}
-
- int colspan = (Integer) attributes.get("colspan");
- if (colspan != Integer.MIN_VALUE) {
- writer.writeAttribute("colspan", Integer.valueOf(colspan), null);
- }
+ } else {
+ updateAttribute(context, dataTableBase.findComponent(values[0]), "filterValue", values[1]);
}
+ context.getPartialViewContext().getRenderIds().add(dataTableBase.getClientId(context)); // TODO Use partial re-rendering here.
}
- @Override
- protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
-
- if(component instanceof UIDataTableBase) {
- UIDataTableBase dataTable = (UIDataTableBase)component;
- int rowCount = dataTable.getRowCount();
- if(rowCount > 0) {
- super.doEncodeChildren(writer, context, component);
- } else {
- int columns = getColumnsCount(dataTable.columns());
-
- writer.startElement(HTML.TR_ELEMENT, dataTable);
- writer.startElement(HTML.TD_ELEM, dataTable);
- writer.writeAttribute("colspan", columns, null);
-
- String styleClass = (String)dataTable.getAttributes().get("noDataStyleClass");
- styleClass = styleClass != null ? "rich-nodata-cell " + styleClass : "rich-nodata-cell";
-
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, styleClass, null);
-
- UIComponent noDataFacet = dataTable.getNoData();
- if(noDataFacet != null && noDataFacet.isRendered() ) {
- noDataFacet.encodeAll(context);
+ protected void decodeSorting(FacesContext context, UIDataTableBase dataTableBase, String value) {
+ List<Object> sortPriority = new LinkedList<Object>();
+ String[] values = value.split(SEPARATOR);
+ if (Boolean.parseBoolean(values[2]) || SortMode.single.equals(dataTableBase.getSortMode())) {
+ for (Iterator<UIComponent> iterator = dataTableBase.columns(); iterator.hasNext();) {
+ UIComponent column = iterator.next();
+ if (values[0].equals(column.getId())) {
+ updateSortOrder(context, column, values[1]);
+ sortPriority.add(values[0]);
} else {
- String noDataLabel = dataTable.getNoDataLabel();
- if(noDataLabel != null) {
- writer.writeText(noDataLabel, "noDataLabel");
- }
+ updateAttribute(context, column, "sortOrder", SortOrder.UNSORTED);
}
-
- writer.endElement(HTML.TD_ELEM);
- writer.endElement(HTML.TR_ELEMENT);
}
+ } else {
+ updateSortOrder(context, dataTableBase.findComponent(values[0]), values[1]);
+ Collection<?> priority = dataTableBase.getSortPriority();
+ if (priority != null) {
+ priority.remove(values[0]);
+ sortPriority.addAll(priority);
+ }
+ sortPriority.add(values[0]);
}
-
+ updateAttribute(context, dataTableBase, "sortPriority", sortPriority);
+ context.getPartialViewContext().getRenderIds().add(dataTableBase.getClientId(context)); // TODO Use partial re-rendering here.
}
-
- public void encodeColumnEnd(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
- writer.endElement(getCellElement(context, parentId));
- }
- public void encodeFirstRowStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
- writer.startElement(HTML.TR_ELEMENT, component);
- getUtils().encodeId(context, component);
- String styleClass = getFirstRowClass(context, parentId);
- encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, styleClass);
- }
-
- public void encodeFirstRowEnd(ResponseWriter writer, FacesContext context, UIComponent component)throws IOException {
- writer.endElement(HTML.TR_ELEMENT);
- }
-
- public void encodeRowStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
- writer.startElement(HTML.TR_ELEMENT, component);
- getUtils().encodeId(context, component);
- String styleClass = getRowClass(context, parentId);
- encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, styleClass);
- }
-
- public void encodeRowEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
- writer.endElement(HTML.TR_ELEMENT);
- }
-
-
- protected String getFirstRowClass(FacesContext context, String id) {
- return get(context, id + FIRST_ROW_CLASS_KEY);
- }
-
- protected String getRowClass(FacesContext context, String id) {
- return get(context, id + ROW_CLASS_KEY);
- }
-
- protected String getCellClass(FacesContext context, String id) {
- return get(context, id + CELL_CLASS_KEY);
- }
-
- protected String getCellElement(FacesContext context, String id) {
- return get(context, id + CELL_ELEMENT_KEY);
- }
-
- private String get(FacesContext context, String key) {
- return (String)context.getAttributes().get(key);
- }
-
- protected void put(FacesContext context, String id, String key, String value) {
- context.getAttributes().put(id + key, value);
- }
-
- //TODO nick - nested tables will not work correct
- protected void saveRowStyles(FacesContext context, String id, String firstRowClass, String rowClass, String cellClass) {
- put(context, id, FIRST_ROW_CLASS_KEY, firstRowClass);
- put(context, id, ROW_CLASS_KEY, rowClass);
- put(context, id, CELL_CLASS_KEY, cellClass);
- }
-
- public void encodeStyleClass(ResponseWriter writer, FacesContext context, UIComponent component,
- String styleClassAttribute, String styleClass) throws IOException {
-
- boolean isEmpty = isEmptyAttr(component, styleClassAttribute);
- if (isEmpty && !(styleClass != null && styleClass.trim().length() != 0)) {
- return;
+ private void updateSortOrder(FacesContext context, UIComponent component, String value) {
+ SortOrder sortOrder = SortOrder.ASCENDING;
+ try {
+ sortOrder = SortOrder.valueOf(value);
+ } catch (IllegalArgumentException e) {
+ // If value isn't name of enum constant of SortOrder, toggle sortOrder of column.
+ if (SortOrder.ASCENDING.equals(component.getAttributes().get("sortOrder"))) {
+ sortOrder = SortOrder.DESCENDING;
}
-
- String componentStyleClass = isEmpty ? styleClass : styleClass + " "
- + component.getAttributes().get(styleClassAttribute);
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, componentStyleClass, null);
- }
-
- protected boolean isEmptyAttr(UIComponent component, String attribute) {
- if (attribute == null) {
- return true;
}
-
- String value = (String) component.getAttributes().get(attribute);
- return !(value != null && value.trim().length() != 0);
+ updateAttribute(context, component, "sortOrder", sortOrder);
}
-
- protected void encodeStyle(ResponseWriter writer, FacesContext context, UIComponent component,
- String predefinedStyles) throws IOException {
-
- StringBuffer toEncode = new StringBuffer();
-
- if (!isEmptyAttr(component, HTML.STYLE_ATTRIBUTE)) {
- String style = ((String) component.getAttributes().get(HTML.STYLE_ATTRIBUTE)).trim();
- style = style.endsWith(";") ? style : style + ";";
- toEncode.append(style);
- }
-
- if (!isEmpty(predefinedStyles)) {
- String style = predefinedStyles.endsWith(";") ? predefinedStyles : predefinedStyles + ";";
- toEncode.append(style);
- }
-
- if (toEncode.length() > 0) {
- writer.writeAttribute(HTML.STYLE_ATTRIBUTE, toEncode.toString(), null);
- }
- }
- protected int getColumnsCount(Iterator<UIComponent> col) {
- int count = 0;
- int currentLength = 0;
- while (col.hasNext()) {
- UIComponent component = (UIComponent) col.next();
- if (component.isRendered()) {
- if (component instanceof Row) {
- // Store max calculated value of previsous rows.
- if (currentLength > count) {
- count = currentLength;
- }
- // Calculate number of columns in row.
- currentLength = getColumnsCount(((Row) component).columns());
- // Store max calculated value
- if (currentLength > count) {
- count = currentLength;
- }
- currentLength = 0;
- } else if (component instanceof org.richfaces.component.UIColumn) {
- // For new row, save length of previsous.
- Map<String, Object> attributes = component.getAttributes();
- if (Boolean.TRUE.equals(attributes.get("breakBefore"))) {
- if (currentLength > count) {
- count = currentLength;
- }
- currentLength = 0;
- }
- Integer colspan = (Integer) attributes.get("colspan");
- // Append colspan of this column
- if (null != colspan && colspan.intValue() != Integer.MIN_VALUE) {
- currentLength += colspan.intValue();
- } else {
- currentLength++;
- }
- } else if (component instanceof UIColumn) {
- // UIColumn always have colspan == 1.
- currentLength++;
+ protected void updateAttribute(FacesContext context, UIComponent component, String attribute, Object value) {
+ Object oldValue = component.getAttributes().get(attribute);
+ if ((oldValue != null && !oldValue.equals(value)) || (oldValue == null && value != null)) {
+ ELContext elContext = context.getELContext();
+ ValueExpression ve = component.getValueExpression(attribute);
+ if (ve != null && !ve.isReadOnly(elContext)) {
+ component.getAttributes().put(attribute, null);
+ try {
+ ve.setValue(elContext, value);
+ } catch (ELException e) {
+ throw new FacesException(e);
}
+ } else {
+ component.getAttributes().put(attribute, value);
}
}
-
- if (currentLength > count) {
- count = currentLength;
- }
- return count;
}
-
-
- public abstract String getTableSkinClass();
-
- public abstract String getFirstRowSkinClass();
-
- public abstract String getRowSkinClass();
-
- public abstract String getHeaderCellSkinClass();
-
- public abstract String getHeaderSkinClass();
-
- public abstract String getHeaderFirstSkinClass();
-
- public abstract String getColumnHeaderCellSkinClass();
-
- public abstract String getColumnHeaderSkinClass();
-
- public abstract String getColumnHeaderFirstSkinClass();
-
- public abstract String getFooterCellSkinClass();
-
- public abstract String getFooterSkinClass();
-
- public abstract String getFooterFirstSkinClass();
-
- public abstract String getColumnFooterCellSkinClass();
-
- public abstract String getColumnFooterSkinClass();
-
- public abstract String getColumnFooterFirstSkinClass();
-
- public abstract String getCellSkinClass();
-
+
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-05-03 14:56:30 UTC (rev 16872)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-05-03 16:45:09 UTC (rev 16873)
@@ -27,7 +27,6 @@
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -35,9 +34,6 @@
import java.util.List;
import java.util.Map;
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
@@ -45,7 +41,6 @@
import javax.faces.context.FacesContext;
import javax.faces.context.PartialResponseWriter;
import javax.faces.context.ResponseWriter;
-import javax.swing.SortOrder;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSReference;
@@ -59,13 +54,12 @@
import org.richfaces.component.UIExtendedDataTable;
import org.richfaces.component.util.HtmlUtil;
import org.richfaces.context.ExtendedVisitContext;
-import org.richfaces.model.SortMode;
@ResourceDependencies({ @ResourceDependency(library = "javax.faces", name = "jsf-uncompressed.js"),
@ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "jquery.position.js"),
@ResourceDependency(name = "richfaces.js"), @ResourceDependency(name = "extendedDataTable.js"),
@ResourceDependency(name = "extendedDataTable.css") })
-public class ExtendedDataTableRenderer extends AbstractRowsRenderer implements MetaComponentRenderer {
+public class ExtendedDataTableRenderer extends DataTableRowsRenderer implements MetaComponentRenderer {
private static enum PartName {
frozen, normal
@@ -574,14 +568,18 @@
if (map.get(component.getClientId(context)) != null) {
updateClientFirst(context, component, map.get("rich:clientFirst"));
}
+
+ decodeSortingFiltering(context, component);
+
+ /*
if (map.get(component.getClientId(context)) != null) {
decodeFiltering(context, component, map.get("rich:filterString"));
}
if (map.get(component.getClientId(context)) != null) {
decodeSorting(context, component, map.get("rich:sortString"));
- }
+ } */
}
-
+ /*
private void updateAttribute(FacesContext context, UIComponent component, String attribute, Object value) {
Object oldValue = component.getAttributes().get(attribute);
if ((oldValue != null && !oldValue.equals(value)) || (oldValue == null && value != null)) {
@@ -611,7 +609,7 @@
}
}
updateAttribute(context, component, "sortOrder", sortOrder);
- }
+ }*/
private void updateWidthOfColumns(FacesContext context, UIComponent component, String widthString) {
if (widthString != null && widthString.length() > 0) {
@@ -644,6 +642,7 @@
}
}
+ /*
private void decodeFiltering(FacesContext context, UIComponent component, String value) {
if (value != null && value.length() > 0) {
String[] values = value.split(":");
@@ -663,7 +662,7 @@
context.getPartialViewContext().getRenderIds().add(component.getClientId(context)); // TODO Use partial re-rendering here.
}
}
-
+ *
private void decodeSorting(FacesContext context, UIComponent component, String value) {
if (value != null && value.length() > 0) {
UIDataTableBase table = (UIDataTableBase) component;
@@ -691,7 +690,7 @@
updateAttribute(context, component, "sortPriority", sortPriority);
context.getPartialViewContext().getRenderIds().add(component.getClientId(context)); // TODO Use partial re-rendering here.
}
- }
+ } */
/**
* @deprecated
14 years, 8 months
JBoss Rich Faces SVN: r16872 - in root/framework/trunk/impl/src: test/resources/javascript and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-05-03 10:56:30 -0400 (Mon, 03 May 2010)
New Revision: 16872
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-event.js
root/framework/trunk/impl/src/test/resources/javascript/richfaces-base-component-qunit.js
Log:
bug fix
Modified: root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-05-03 14:29:16 UTC (rev 16871)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-05-03 14:56:30 UTC (rev 16872)
@@ -132,7 +132,7 @@
},
/**
- * Method returns element's id as jQuery selector for event handlers binding.
+ * Method returns element's id for event handlers binding.
* Event API calls this method when binding by component object as selector was used.
*
* @function
@@ -141,7 +141,7 @@
* @return {String}
* */
getEventElement: function() {
- return "#"+this.id;
+ return this.id;
}
};
})(params));
Modified: root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-event.js
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-event.js 2010-05-03 14:29:16 UTC (rev 16871)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-event.js 2010-05-03 14:56:30 UTC (rev 16872)
@@ -19,9 +19,9 @@
}
var element;
if (RichFaces.BaseComponent && selector instanceof RichFaces.BaseComponent) {
- element = jQuery(selector.getEventElement());
+ element = $(richfaces.getDomElement(selector.getEventElement()));
} else {
- element = jQuery(selector);
+ element = $(selector);
}
return element;
Modified: root/framework/trunk/impl/src/test/resources/javascript/richfaces-base-component-qunit.js
===================================================================
--- root/framework/trunk/impl/src/test/resources/javascript/richfaces-base-component-qunit.js 2010-05-03 14:29:16 UTC (rev 16871)
+++ root/framework/trunk/impl/src/test/resources/javascript/richfaces-base-component-qunit.js 2010-05-03 14:56:30 UTC (rev 16872)
@@ -25,7 +25,7 @@
equals(c.name, "BaseComponent", "name");
equals(c.id, "myId", "id");
equals(c.toString(), "BaseComponent", "toString");
- equals(c.getEventElement(), "#myId", "getEventElement");
+ equals(c.getEventElement(), "myId", "getEventElement");
});
// BaseComponent inheritance
@@ -39,7 +39,7 @@
equals(c.name, "MyComponent", "name");
equals(c.id, "myId", "id");
equals(c.toString(), "BaseComponent, MyComponent", "toString");
- equals(c.getEventElement(), "#myId", "getEventElement");
+ equals(c.getEventElement(), "myId", "getEventElement");
(function (richfaces) {
MyComponent2 = function(componentId) {
@@ -63,7 +63,7 @@
equals(c.name, "MyComponent2", "name");
equals(c.id, "myId", "id");
equals(c.toString(), "BaseComponent, MyComponent, MyComponent2", "toString");
- equals(c.getEventElement(), "#myId", "getEventElement");
+ equals(c.getEventElement(), "myId", "getEventElement");
(function (richfaces) {
MyComponent3 = function(componentId) {
@@ -89,7 +89,7 @@
equals(c.name, "MyComponent3", "name");
equals(c.id, "myId", "id");
equals(c.toString(), "BaseComponent, MyComponent, MyComponent2, MyComponent3", "toString");
- equals(c.getEventElement(), "#myId", "getEventElement");
+ equals(c.getEventElement(), "myId", "getEventElement");
})(RichFaces);
});
14 years, 8 months
JBoss Rich Faces SVN: r16871 - management/design-4x/dataScroller.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-03 10:29:16 -0400 (Mon, 03 May 2010)
New Revision: 16871
Modified:
management/design-4x/dataScroller/dataScroller.html
Log:
Committed updated dataScroller markup
Modified: management/design-4x/dataScroller/dataScroller.html
===================================================================
--- management/design-4x/dataScroller/dataScroller.html 2010-05-03 13:08:13 UTC (rev 16870)
+++ management/design-4x/dataScroller/dataScroller.html 2010-05-03 14:29:16 UTC (rev 16871)
@@ -7,10 +7,10 @@
.ds_container{ white-space : nowrap; display : inline-block; font-size : 11px/*generalSizeFont*/; padding : 1px; font-family : verdana/*generalFamilyFont*/; background : #ffffff/*background-color - tableBackgroundColor*/;}
.ds_container_decor{ border : 1px solid #A6A6A6/*tableBorderColor*/;}
-.ds_button{ cursor : pointer; padding : 2px 10px 3px 10px; border : 1px solid #A6A6A6/*tableBorderColor*/; display : inline-block; background : url(images/bg_btn.png) top left repeat-x #C0D1E7/*gradient - from headerGradientColor to headerBackgroundColor, background-color - headerBackgroundColor*/; font-size : 11px/*generalSizeFont*/; font-family : verdana/*generalFamilyFont*/; color : #000000/*generalTextColor*/;}
+.ds_button{ text-decoration : none; cursor : pointer; padding : 2px 10px 3px 10px; border : 1px solid #A6A6A6/*tableBorderColor*/; display : inline-block; background : url(images/bg_btn.png) top left repeat-x #C0D1E7/*gradient - from headerGradientColor to headerBackgroundColor, background-color - headerBackgroundColor*/; font-size : 11px/*generalSizeFont*/; font-family : verdana/*generalFamilyFont*/; color : #000000/*generalTextColor*/;}
.ds_left{ margin-right : 1px;}
.ds_right{ margin-left : 1px;}
-.ds_digital{ cursor : pointer; width : 2em; text-align : center; margin-left : 1px; margin-right : 1px; padding : 2px 2px 3px 2px; border : 1px solid transparent; border-top : 1px solid #A6A6A6/*tableBorderColor*/; background : url(images/bg_field.png) top left repeat-x/*gradient - from additionalBackgroundColor to tableBackgroundColor, background-color - tableBackgroundColor*/; display : inline-block; font-size : 11px/*generalSizeFont*/; font-family : verdana/*generalFamilyFont*/; color : #000000/*generalTextColor*/;}
+.ds_digital{ text-decoration : none; cursor : pointer; width : 2em; text-align : center; margin-left : 1px; margin-right : 1px; padding : 2px 2px 3px 2px; border : 1px solid transparent; border-top : 1px solid #A6A6A6/*tableBorderColor*/; background : url(images/bg_field.png) top left repeat-x/*gradient - from additionalBackgroundColor to tableBackgroundColor, background-color - tableBackgroundColor*/; display : inline-block; font-size : 11px/*generalSizeFont*/; font-family : verdana/*generalFamilyFont*/; color : #000000/*generalTextColor*/;}
.ds_over{ border : 1px solid #A6A6A6/*tableBorderColor*/; background : url(images/bg_field.png) top left repeat-x #FFFFFF; /*gradient - from additionalBackgroundColor to tableBackgroundColor, background-color - tableBackgroundColor*/;}
.ds_press{ border : 1px solid #A6A6A6/*tableBorderColor*/; background : #ECF3FA; /*background-color - additionalBackgroundColor*/;}
.ds_current{ cursor : default; font-weight : bold; border : 1px solid transparent; border-bottom : 1px solid #A6A6A6/*tableBorderColor*/; background : none;}
@@ -23,48 +23,48 @@
<span class="ds_container !ds_container_decor"><!-- Now decor is disabled !!! -->
- <span class="ds_button ds_left ds_disabled">
+ <a !href="#" class="ds_button ds_left ds_disabled">
««
- </span><span
+ </a><a !href="#"
class="ds_button ds_left ds_disabled">
«
- </span><span
+ </a><a href="#"
class="ds_digital" onmouseover="this.className='ds_digital ds_over'" onmouseout="this.className='ds_digital'" onmouseup="this.className='ds_digital ds_over'" onmousedown="this.className='ds_digital ds_press'">
1
- </span><span
+ </a><a href="#"
class="ds_digital" onmouseover="this.className='ds_digital ds_over'" onmouseout="this.className='ds_digital'" onmouseup="this.className='ds_digital ds_over'" onmousedown="this.className='ds_digital ds_press'">
2
- </span><span
+ </a><a href="#"
class="ds_digital" onmouseover="this.className='ds_digital ds_over'" onmouseout="this.className='ds_digital'" onmouseup="this.className='ds_digital ds_over'" onmousedown="this.className='ds_digital ds_press'">
3
- </span><span
+ </a><a href="#"
class="ds_digital" onmouseover="this.className='ds_digital ds_over'" onmouseout="this.className='ds_digital'" onmouseup="this.className='ds_digital ds_over'" onmousedown="this.className='ds_digital ds_press'">
4
- </span><span
+ </a><a !href="#"
class="ds_digital ds_current">
5
- </span><span
+ </a><a href="#"
class="ds_digital" onmouseover="this.className='ds_digital ds_over'" onmouseout="this.className='ds_digital'" onmouseup="this.className='ds_digital ds_over'" onmousedown="this.className='ds_digital ds_press'">
6
- </span><span
+ </a><a href="#"
class="ds_digital" onmouseover="this.className='ds_digital ds_over'" onmouseout="this.className='ds_digital'" onmouseup="this.className='ds_digital ds_over'" onmousedown="this.className='ds_digital ds_press'">
7
- </span><span
+ </a><a href="#"
class="ds_digital" onmouseover="this.className='ds_digital ds_over'" onmouseout="this.className='ds_digital'" onmouseup="this.className='ds_digital ds_over'" onmousedown="this.className='ds_digital ds_press'">
8
- </span><span
+ </a><a !href="#"
class="ds_digital ds_disabled">
9
- </span><span
+ </a><a !href="#"
class="ds_digital ds_disabled">
10
- </span><span
+ </a><a href="#"
class="ds_button ds_right" onmousedown="this.className='ds_button ds_right ds_over'" onmouseup="this.className='ds_button ds_right'" onmouseout="this.className='ds_button ds_right'">
»
- </span><span
+ </a><a href="#"
class="ds_button ds_right" onmousedown="this.className='ds_button ds_right ds_over'" onmouseup="this.className='ds_button ds_right'" onmouseout="this.className='ds_button ds_right'">
»»
- </span>
+ </a>
</span>
14 years, 8 months
JBoss Rich Faces SVN: r16870 - root/cdk/trunk/plugins/maven-cdk-plugin/src/it/renderer-template-test.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-05-03 09:08:13 -0400 (Mon, 03 May 2010)
New Revision: 16870
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/renderer-template-test/pom.xml
Log:
RFPL-533
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/renderer-template-test/pom.xml
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/renderer-template-test/pom.xml 2010-05-03 12:52:15 UTC (rev 16869)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/renderer-template-test/pom.xml 2010-05-03 13:08:13 UTC (rev 16870)
@@ -54,7 +54,7 @@
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-mock</artifactId>
- <version>1.0.2</version>
+ <version>1.0.3</version>
<scope>test</scope>
</dependency>
<dependency>
14 years, 8 months
JBoss Rich Faces SVN: r16869 - in root: framework/trunk/api/src/main/java/org/richfaces/renderkit and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-03 08:52:15 -0400 (Mon, 03 May 2010)
New Revision: 16869
Added:
root/framework/trunk/api/src/main/java/org/richfaces/renderkit/MetaComponentRenderer.java
Removed:
root/framework/trunk/api/src/main/java/org/richfaces/component/PartiallyEncodedComponent.java
root/framework/trunk/api/src/main/java/org/richfaces/renderkit/PartialEncodingRenderer.java
Modified:
root/ui-sandbox/trunk/components/componentcontrol/
root/ui-sandbox/trunk/components/datascroller/api/
root/ui-sandbox/trunk/components/datascroller/ui/
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java
root/ui-sandbox/trunk/components/tables/ui/
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIExtendedDataTable.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-7856 refactoring
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/component/PartiallyEncodedComponent.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/component/PartiallyEncodedComponent.java 2010-05-03 12:03:25 UTC (rev 16868)
+++ root/framework/trunk/api/src/main/java/org/richfaces/component/PartiallyEncodedComponent.java 2010-05-03 12:52:15 UTC (rev 16869)
@@ -1,40 +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.component;
-
-import java.io.IOException;
-import java.util.Collection;
-
-import javax.faces.component.visit.VisitCallback;
-import javax.faces.component.visit.VisitContext;
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface PartiallyEncodedComponent {
-
- // TODO document this method
- public void encodePartially(VisitContext context, VisitCallback callback,
- Collection<String> subComponentIdentifiers) throws IOException;
-
-}
Added: root/framework/trunk/api/src/main/java/org/richfaces/renderkit/MetaComponentRenderer.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/renderkit/MetaComponentRenderer.java (rev 0)
+++ root/framework/trunk/api/src/main/java/org/richfaces/renderkit/MetaComponentRenderer.java 2010-05-03 12:52:15 UTC (rev 16869)
@@ -0,0 +1,37 @@
+/*
+ * 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;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface MetaComponentRenderer {
+
+ public void encodeMetaComponent(FacesContext context, UIComponent component) throws IOException;
+
+}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/renderkit/PartialEncodingRenderer.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/renderkit/PartialEncodingRenderer.java 2010-05-03 12:03:25 UTC (rev 16868)
+++ root/framework/trunk/api/src/main/java/org/richfaces/renderkit/PartialEncodingRenderer.java 2010-05-03 12:52:15 UTC (rev 16869)
@@ -1,40 +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;
-
-import java.io.IOException;
-import java.util.Collection;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.visit.VisitCallback;
-import javax.faces.component.visit.VisitContext;
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface PartialEncodingRenderer {
-
- // TODO document this method
- public void encodePartially(UIComponent component, VisitContext context, VisitCallback callback,
- Collection<String> subComponentIdentifiers) throws IOException;
-}
Property changes on: root/ui-sandbox/trunk/components/componentcontrol
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: root/ui-sandbox/trunk/components/datascroller/api
___________________________________________________________________
Name: svn:ignore
+ target
.classpath
.project
.settings
Property changes on: root/ui-sandbox/trunk/components/datascroller/ui
___________________________________________________________________
Name: svn:ignore
+ target
.classpath
.project
.settings
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java 2010-05-03 12:03:25 UTC (rev 16868)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java 2010-05-03 12:52:15 UTC (rev 16869)
@@ -136,11 +136,15 @@
facesContext.getPartialViewContext().getRenderIds().add(dataScroller.getClientId(facesContext));
}
- String dataTableId = dataTable.getClientId(facesContext);
- if (dataTable instanceof PartiallyEncodedComponent) {
- dataTableId += "@body";
+ String dataTableId = null;
+ if (dataTable instanceof MetaComponentResolver) {
+ dataTableId = ((MetaComponentResolver) dataTable).resolveClientId(facesContext, dataTable, "body");
}
+ if (dataTableId == null) {
+ dataTableId = dataTable.getClientId(facesContext);
+ }
+
facesContext.getPartialViewContext().getRenderIds().add(dataTableId);
}
}
Property changes on: root/ui-sandbox/trunk/components/tables/ui
___________________________________________________________________
Name: svn:ignore
- target
.classpath
.project
.settings
.clover
+ target
.classpath
.project
.settings
.clover
bin
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIExtendedDataTable.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIExtendedDataTable.java 2010-05-03 12:03:25 UTC (rev 16868)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIExtendedDataTable.java 2010-05-03 12:52:15 UTC (rev 16869)
@@ -23,11 +23,12 @@
package org.richfaces.component;
import java.io.IOException;
-import java.util.Collection;
import java.util.Map;
+import javax.faces.component.UIComponent;
import javax.faces.component.visit.VisitCallback;
import javax.faces.component.visit.VisitContext;
+import javax.faces.component.visit.VisitResult;
import javax.faces.context.FacesContext;
import javax.faces.render.Renderer;
@@ -35,39 +36,92 @@
import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.Range;
import org.ajax4jsf.model.RepeatState;
-import org.richfaces.renderkit.PartialEncodingRenderer;
+import org.richfaces.context.ExtendedVisitContext;
+import org.richfaces.context.ExtendedVisitContextMode;
+import org.richfaces.log.RichfacesLogger;
+import org.richfaces.renderkit.MetaComponentRenderer;
+import org.slf4j.Logger;
/**
* @author Anton Belevich
*
*/
-public class UIExtendedDataTable extends UIDataTableBase implements PartiallyEncodedComponent{
+public class UIExtendedDataTable extends UIDataTableBase {
public static final String SCROLL = "scroll";
public static final String SUBMITTED_CLIENT_FIRST = "submittedClientFirst";
public static final String OLD_CLIENT_FIRST = "oldClientFirst";
+ private static final Logger RENDERKIT_LOG = RichfacesLogger.RENDERKIT.getLogger();
+
+ private final class MetaComponentRenderVisitCallback implements VisitCallback {
+
+ private VisitCallback delegateCallback;
+
+ public MetaComponentRenderVisitCallback(VisitCallback delegateCallback) {
+ super();
+ this.delegateCallback = delegateCallback;
+ }
+
+ @Override
+ public VisitResult visit(VisitContext visitContext, UIComponent target) {
+ if (UIExtendedDataTable.this.equals(target)) {
+ FacesContext context = visitContext.getFacesContext();
+ if (SCROLL.equals(context.getAttributes().get(ExtendedVisitContext.META_COMPONENT_ID))) {
+ Map<String, Object> attributes = getAttributes();
+ Integer submittedClientFirst = (Integer) attributes.remove(SUBMITTED_CLIENT_FIRST);
+ if (submittedClientFirst != null) {
+ attributes.put(OLD_CLIENT_FIRST, getClientFirst());
+ setClientFirst(submittedClientFirst);
+ }
+
+ Renderer renderer = getRenderer(context);
+ try {
+ ((MetaComponentRenderer) renderer).encodeMetaComponent(context, target);
+ } catch (IOException e) {
+ if (RENDERKIT_LOG.isErrorEnabled()) {
+ RENDERKIT_LOG.error(e.getMessage());
+ }
+ if (RENDERKIT_LOG.isDebugEnabled()) {
+ RENDERKIT_LOG.debug(e.getMessage(), e);
+ }
+ }
+
+ return VisitResult.REJECT;
+ }
+ }
+
+ return delegateCallback.visit(visitContext, target);
+ }
+ }
+
protected enum PropertyKeys {
clientFirst, clientRows
}
@Override
- public void encodePartially(VisitContext context, VisitCallback callback,
- Collection<String> subComponentIdentifiers)
- throws IOException {
- if (subComponentIdentifiers.contains(SCROLL)) {
- Map<String, Object> attributes = getAttributes();
- Integer submittedClientFirst = (Integer) attributes.remove(SUBMITTED_CLIENT_FIRST);
- if (submittedClientFirst != null) {
- attributes.put(OLD_CLIENT_FIRST, getClientFirst());
- setClientFirst(submittedClientFirst);
+ protected boolean visitDataChildren(VisitContext visitContext, final VisitCallback callback, boolean resetKeyBeforeVisit) {
+ if (visitContext instanceof ExtendedVisitContext) {
+ ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) visitContext;
+
+ if (extendedVisitContext.getVisitMode() == ExtendedVisitContextMode.RENDER) {
+ if (resetKeyBeforeVisit) {
+ setRowKey(visitContext.getFacesContext(), null);
+ }
+
+ VisitResult result = extendedVisitContext.invokeMetaComponentVisitCallback(this,
+ new MetaComponentRenderVisitCallback(callback), SCROLL);
+
+ if (result != VisitResult.ACCEPT) {
+ return result == VisitResult.COMPLETE;
+ }
}
}
- Renderer renderer = getRenderer(context.getFacesContext());
- ((PartialEncodingRenderer) renderer).encodePartially(this, context, callback, subComponentIdentifiers);
+
+ return super.visitDataChildren(visitContext, callback, resetKeyBeforeVisit);
}
-
+
/**
* Walk ( visit ) this component on all data-aware children for each row from range.
*
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-05-03 12:03:25 UTC (rev 16868)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-05-03 12:52:15 UTC (rev 16869)
@@ -42,8 +42,6 @@
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
-import javax.faces.component.visit.VisitCallback;
-import javax.faces.component.visit.VisitContext;
import javax.faces.context.FacesContext;
import javax.faces.context.PartialResponseWriter;
import javax.faces.context.ResponseWriter;
@@ -60,13 +58,14 @@
import org.richfaces.component.UIDataTableBase;
import org.richfaces.component.UIExtendedDataTable;
import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.context.ExtendedVisitContext;
import org.richfaces.model.SortMode;
@ResourceDependencies({ @ResourceDependency(library = "javax.faces", name = "jsf-uncompressed.js"),
@ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "jquery.position.js"),
@ResourceDependency(name = "richfaces.js"), @ResourceDependency(name = "extendedDataTable.js"),
@ResourceDependency(name = "extendedDataTable.css") })
-public class ExtendedDataTableRenderer extends AbstractRowsRenderer implements PartialEncodingRenderer {
+public class ExtendedDataTableRenderer extends AbstractRowsRenderer implements MetaComponentRenderer {
private static enum PartName {
frozen, normal
@@ -166,10 +165,10 @@
}
@Override
- public void encodePartially(UIComponent component, VisitContext visitContext, VisitCallback callback,
- Collection<String> subComponentIdentifiers) throws IOException {
- if (subComponentIdentifiers.size() == 1 && subComponentIdentifiers.contains(UIExtendedDataTable.SCROLL)) {
- FacesContext context = visitContext.getFacesContext();
+ public void encodeMetaComponent(FacesContext context, UIComponent component) throws IOException {
+ String metaComponentId = (String) context.getAttributes().get(ExtendedVisitContext.META_COMPONENT_ID);
+
+ if (UIExtendedDataTable.SCROLL.equals(metaComponentId)) {
final PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter();
UIExtendedDataTable table = (UIExtendedDataTable) component;
int clientFirst = table.getClientFirst();
@@ -253,7 +252,7 @@
table.restoreOrigValue(context);
}
} else {
- throw new IllegalArgumentException("Incorect subComponentIdentifiers: " + subComponentIdentifiers);
+ throw new IllegalArgumentException("Unsupported metaComponentIdentifier: " + metaComponentId);
}
}
14 years, 8 months
JBoss Rich Faces SVN: r16868 - root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-05-03 08:03:25 -0400 (Mon, 03 May 2010)
New Revision: 16868
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
Log:
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2010-05-03 10:22:46 UTC (rev 16867)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2010-05-03 12:03:25 UTC (rev 16868)
@@ -220,7 +220,12 @@
}
try {
- generator.setNamespace(this.library.getTaglib().getShortName());
+ if (this.library != null
+ && this.library.getTaglib() != null
+ && this.library.getTaglib().getShortName() != null) {
+
+ generator.setNamespace(this.library.getTaglib().getShortName());
+ }
// Build JSF library.
// LibraryBuilder builder = LibraryBuilder.createInstance(context);
14 years, 8 months
JBoss Rich Faces SVN: r16867 - in root/ui-sandbox/trunk/components/datascroller: ui/src/main/java/org/richfaces and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-03 06:22:46 -0400 (Mon, 03 May 2010)
New Revision: 16867
Modified:
root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerEvent.java
root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerListener.java
root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerSource.java
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/DataScrollerUtils.java
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/ControlsState.java
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/taglib/DatascrollerTagHandler.java
Log:
apply checkstyles
Modified: root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerEvent.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerEvent.java 2010-05-03 09:58:02 UTC (rev 16866)
+++ root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerEvent.java 2010-05-03 10:22:46 UTC (rev 16867)
@@ -34,17 +34,20 @@
*
*/
private static final long serialVersionUID = 2657353903701932561L;
- private String oldScrolVal;
- private String newScrolVal;
+ private String oldScrolVal;
+ private String newScrolVal;
private int page;
/**
- * Creates a new ScrollerEvent.
- *
- * @param component the source of the event
- * @param thisOldScrolVal the previously showing item identifier
- * @param thisNewScrolVal the currently showing item identifier
- */
+ * Creates a new ScrollerEvent.
+ *
+ * @param component
+ * the source of the event
+ * @param thisOldScrolVal
+ * the previously showing item identifier
+ * @param thisNewScrolVal
+ * the currently showing item identifier
+ */
public DataScrollerEvent(UIComponent component, String thisOldScrolVal, String thisNewScrolVal, int page) {
super(component);
oldScrolVal = thisOldScrolVal;
@@ -65,26 +68,27 @@
* @return new page or <code>-1</code> if not applicable
*/
public int getPage() {
- return page;
+ return page;
}
-
- public boolean isAppropriateListener(FacesListener listener){
+
+ public boolean isAppropriateListener(FacesListener listener) {
return super.isAppropriateListener(listener) || (listener instanceof DataScrollerListener);
}
/**
- * Delivers this event to the SliderListener.
- *
- * @param listener the slider listener
- */
- public void processListener(FacesListener listener){
+ * Delivers this event to the SliderListener.
+ *
+ * @param listener
+ * the slider listener
+ */
+ public void processListener(FacesListener listener) {
if (listener instanceof DataScrollerListener) {
- DataScrollerListener dataScrollerListener = (DataScrollerListener) listener;
- dataScrollerListener.processScroller(this);
- }
-
+ DataScrollerListener dataScrollerListener = (DataScrollerListener) listener;
+ dataScrollerListener.processScroller(this);
+ }
+
if (super.isAppropriateListener(listener)) {
- super.processListener(listener);
+ super.processListener(listener);
}
}
}
Modified: root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerListener.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerListener.java 2010-05-03 09:58:02 UTC (rev 16866)
+++ root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerListener.java 2010-05-03 10:22:46 UTC (rev 16867)
@@ -23,7 +23,6 @@
import javax.faces.event.FacesListener;
-
public interface DataScrollerListener extends FacesListener {
public void processScroller(org.richfaces.event.DataScrollerEvent event);
Modified: root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerSource.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerSource.java 2010-05-03 09:58:02 UTC (rev 16866)
+++ root/ui-sandbox/trunk/components/datascroller/api/src/main/java/org/richfaces/event/DataScrollerSource.java 2010-05-03 10:22:46 UTC (rev 16867)
@@ -24,24 +24,25 @@
public interface DataScrollerSource {
/**
- * Adds a DataScrollerListener to this DataScrollerSource.
- *
- * @param listener the Scroler listener to be added
- */
+ * Adds a DataScrollerListener to this DataScrollerSource.
+ *
+ * @param listener
+ * the Scroler listener to be added
+ */
public void addScrollerListener(org.richfaces.event.DataScrollerListener listener);
/**
- * Removes a DataFilterSliderListener from this DataScrollerSourceSource.
- *
- * @param listener the Scroler listener to be removed
- */
+ * Removes a DataFilterSliderListener from this DataScrollerSourceSource.
+ *
+ * @param listener the Scroler listener to be removed
+ */
public void removeScrollerListener(DataScrollerListener listener);
/**
- * Returns all ScrollerListeners for this DataScrollerSource.
- *
- * @return the Scroler listener array
- */
+ * Returns all ScrollerListeners for this DataScrollerSource.
+ *
+ * @return the Scroler listener array
+ */
public DataScrollerListener[] getScrollerListeners();
}
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/DataScrollerUtils.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/DataScrollerUtils.java 2010-05-03 09:58:02 UTC (rev 16866)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/DataScrollerUtils.java 2010-05-03 10:22:46 UTC (rev 16867)
@@ -12,14 +12,16 @@
import org.richfaces.component.UIDataScroller;
+public final class DataScrollerUtils {
-
-public class DataScrollerUtils {
-
protected enum PropertyKeys {
rowCount, rows
}
+ private DataScrollerUtils(){
+ }
+
+
public static int getPageCount(UIComponent data, int rowCount, int rows) {
int pageCount;
if (rows > 0) {
@@ -35,64 +37,63 @@
pageCount = 1;
}
return pageCount;
- }
-
+ }
+
public static int getRows(UIComponent component) {
- int row = (Integer)component.getAttributes().get("rows");
+ int row = (Integer) component.getAttributes().get("rows");
if (row == 0) {
row = getRowCount(component);
}
return row;
}
-
+
public static int getRowCount(UIComponent component) {
- return (Integer)eval(PropertyKeys.rowCount, component, 0);
+ return (Integer) eval(PropertyKeys.rowCount, component, 0);
}
-
+
protected static Object eval(Serializable key, UIComponent component, Object defaultValue) {
String name = key.toString();
- Object retObject = component.getAttributes().get(name);
- return retObject != null ? retObject : defaultValue;
+ Object retObject = component.getAttributes().get(name);
+ return retObject != null ? retObject : defaultValue;
}
-
+
public static UIComponent findParentContainer(UIComponent component) {
UIComponent parent = component.getParent();
- if(!(component instanceof NamingContainer)) {
+ if (!(component instanceof NamingContainer)) {
findParentContainer(parent);
}
return parent;
}
-
+
public static List<UIDataScroller> findDataScrollers(UIComponent dataTable) {
- List <UIDataScroller> datascrollers = new ArrayList<UIDataScroller>();
+ List<UIDataScroller> datascrollers = new ArrayList<UIDataScroller>();
Map<String, UIComponent> facets = dataTable.getFacets();
Set<Entry<String, UIComponent>> entries = facets.entrySet();
-
- for (Entry<String, UIComponent> entry: entries) {
+
+ for (Entry<String, UIComponent> entry : entries) {
findBelow(entry.getValue(), datascrollers);
}
-
+
UIComponent parent = findParentContainer(dataTable);
- if(parent != null) {
+ if (parent != null) {
findBelow(parent, datascrollers);
}
-
+
return datascrollers;
- }
-
-
+ }
+
protected static void findBelow(UIComponent component, List<UIDataScroller> result) {
- if((component instanceof UIDataScroller) && component.isRendered()) {
- result.add((UIDataScroller)component);
-
+ if ((component instanceof UIDataScroller) && component.isRendered()) {
+ result.add((UIDataScroller) component);
+
} else {
- for(UIComponent child: component.getChildren()) {
- if(!(child instanceof NamingContainer)) {
- findBelow(child, result);
+ for (UIComponent child : component.getChildren()) {
+ if (!(child instanceof NamingContainer)) {
+ findBelow(child, result);
}
}
}
-
+
}
}
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java 2010-05-03 09:58:02 UTC (rev 16866)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java 2010-05-03 10:22:46 UTC (rev 16867)
@@ -24,15 +24,14 @@
import org.richfaces.event.DataScrollerListener;
import org.richfaces.event.DataScrollerSource;
+public class UIDataScroller extends UIComponentBase implements DataScrollerSource, IterationStateHolder {
-public class UIDataScroller extends UIComponentBase implements DataScrollerSource, IterationStateHolder {
-
public static final String COMPONENT_TYPE = "org.richfaces.DataScroller";
-
- public static final String COMPONENT_FAMILY = "org.richfaces.DataScroller";
+ public static final String COMPONENT_FAMILY = "org.richfaces.DataScroller";
+
public static final String SCROLLER_STATE_ATTRIBUTE = COMPONENT_TYPE + ":page";
-
+
public static final String FIRST_FACET_NAME = "first";
public static final String LAST_FACET_NAME = "last";
@@ -44,363 +43,349 @@
public static final String FIRST_DISABLED_FACET_NAME = "first_disabled";
public static final String LAST_DISABLED_FACET_NAME = "last_disabled";
-
+
public static final String PAGEMODE_FULL = "full";
-
+
public static final String PAGEMODE_SHORT = "short";
-
+
private Integer page;
-
+
protected enum PropertyKeys {
- boundaryControls, fastControls, fastStep, forComponent, inactiveStyle, selectStyle, inactiveStyleClass, selectStyleClass, scrollerListener, lastPageMode, maxPages, pageIndexVar, pagesVar, renderIfSinglePage,
- style, styleClass, stepControls
+ boundaryControls, fastControls, fastStep, forComponent, inactiveStyle, selectStyle, inactiveStyleClass, selectStyleClass, scrollerListener, lastPageMode, maxPages, pageIndexVar, pagesVar, renderIfSinglePage, style, styleClass, stepControls
}
-
-
+
public String getLastPageMode() {
- return (String)getStateHelper().eval(PropertyKeys.lastPageMode);
+ return (String) getStateHelper().eval(PropertyKeys.lastPageMode);
}
-
+
public void setLastPageMode(String lastPageMode) {
getStateHelper().put(PropertyKeys.lastPageMode, lastPageMode);
}
-
+
public int getFastStep() {
- return (Integer)getStateHelper().eval(PropertyKeys.fastStep, 0);
+ return (Integer) getStateHelper().eval(PropertyKeys.fastStep, 0);
}
-
+
public void setFastStep(int fastStep) {
getStateHelper().put(PropertyKeys.fastStep, fastStep);
}
-
+
public String getFor() {
- return (String)getStateHelper().eval(PropertyKeys.forComponent);
+ return (String) getStateHelper().eval(PropertyKeys.forComponent);
}
-
+
public void setFor(String f) {
getStateHelper().put(PropertyKeys.forComponent, f);
}
-
+
public int getMaxPages() {
- return (Integer)getStateHelper().eval(PropertyKeys.maxPages,0);
+ return (Integer) getStateHelper().eval(PropertyKeys.maxPages, 0);
}
-
+
public void setMaxPages(int maxPages) {
getStateHelper().put(PropertyKeys.maxPages, maxPages);
}
-
+
public String getBoundaryControls() {
- return (String)getStateHelper().eval(PropertyKeys.boundaryControls, "show");
+ return (String) getStateHelper().eval(PropertyKeys.boundaryControls, "show");
}
-
+
public void setBoundaryControls(String boundaryControls) {
getStateHelper().put(PropertyKeys.boundaryControls, boundaryControls);
}
public String getFastControls() {
- return (String)getStateHelper().eval(PropertyKeys.fastControls, "show");
+ return (String) getStateHelper().eval(PropertyKeys.fastControls, "show");
}
-
+
public void setFastControls(String fastControls) {
getStateHelper().put(PropertyKeys.fastControls, fastControls);
}
-
- public void addScrollerListener(DataScrollerListener listener) {
- addFacesListener(listener);
- }
- public DataScrollerListener[] getScrollerListeners() {
- return (DataScrollerListener[]) getFacesListeners(DataScrollerListener.class);
- }
+ public void addScrollerListener(DataScrollerListener listener) {
+ addFacesListener(listener);
+ }
- public void removeScrollerListener(DataScrollerListener listener) {
- removeFacesListener(listener);
- }
+ public DataScrollerListener[] getScrollerListeners() {
+ return (DataScrollerListener[]) getFacesListeners(DataScrollerListener.class);
+ }
-
- public void broadcast(FacesEvent event) throws AbortProcessingException {
- super.broadcast(event);
-
- if (event instanceof DataScrollerEvent) {
- DataScrollerEvent dataScrollerEvent = (DataScrollerEvent) event;
+ public void removeScrollerListener(DataScrollerListener listener) {
+ removeFacesListener(listener);
+ }
- updateModel(dataScrollerEvent.getPage());
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ super.broadcast(event);
- FacesContext facesContext = getFacesContext();
-
- MethodExpression scrollerListener = (MethodExpression)getStateHelper().eval(PropertyKeys.scrollerListener);
- if (scrollerListener != null) {
- scrollerListener.invoke(facesContext.getELContext(), new Object[]{event});
- }
-
- UIComponent dataTable = getDataTable();
-
- List <UIDataScroller> dataScrollers = DataScrollerUtils.findDataScrollers(dataTable);
- for(UIDataScroller dataScroller: dataScrollers) {
- facesContext.getPartialViewContext().getRenderIds().add(dataScroller.getClientId(facesContext));
- }
-
- String dataTableId = dataTable.getClientId(facesContext);
- if(dataTable instanceof PartiallyEncodedComponent) {
- dataTableId += "@body";
- }
-
- facesContext.getPartialViewContext().getRenderIds().add(dataTableId);
- }
- }
+ if (event instanceof DataScrollerEvent) {
+ DataScrollerEvent dataScrollerEvent = (DataScrollerEvent) event;
- /**
- * Finds the dataTable which id is mapped to the "for" property
- *
- * @return the dataTable component
- */
-
- public UIComponent getDataTable() {
- String forAttribute = (String)getStateHelper().get(PropertyKeys.forComponent);
- UIComponent forComp;
-
- if (forAttribute == null) {
- forComp = this;
-
- while ((forComp = forComp.getParent()) != null) {
- if (forComp instanceof UIData || forComp instanceof UIDataAdaptor) {
- getStateHelper().put(PropertyKeys.forComponent, forComp.getId());
- return forComp;
- }
- }
- throw new FacesException("could not find dataTable for datascroller " + this.getId());
-
- } else {
- forComp = RendererUtils.getInstance().findComponentFor(this, forAttribute);
- }
-
- if (forComp == null) {
- throw new IllegalArgumentException("could not find dataTable with id '" + forAttribute + "'");
- } else if (!((forComp instanceof UIData) || (forComp instanceof UIDataAdaptor))) {
-
- throw new IllegalArgumentException( "component with id '" + forAttribute
- + "' must be of type " + UIData.class.getName() + " or " + UIDataAdaptor.class
- + ", not type "
- + forComp.getClass().getName());
- }
-
- return forComp;
- }
-
- private int getFastStepOrDefault() {
- return (Integer)getStateHelper().eval(PropertyKeys.fastStep,1);
- }
+ updateModel(dataScrollerEvent.getPage());
- public int getPageForFacet(String facetName) {
- if (facetName == null) {
- throw new NullPointerException();
- }
+ FacesContext facesContext = getFacesContext();
- int newPage = 1;
- int pageCount = getPageCount();
-
- if (FIRST_FACET_NAME.equals(facetName)) {
- newPage = 1;
- } else if (LAST_FACET_NAME.equals(facetName)) {
- newPage = pageCount > 0 ? pageCount : 1;
- } else if (FAST_FORWARD_FACET_NAME.equals(facetName)) {
- newPage = getPage() + getFastStepOrDefault();
- } else if (FAST_REWIND_FACET_NAME.equals(facetName)) {
- newPage = getPage() - getFastStepOrDefault();
- } else {
- try {
- newPage = Integer.parseInt(facetName.toString());
- } catch (NumberFormatException e) {
- throw new FacesException(e.getLocalizedMessage(), e);
- }
- }
+ MethodExpression scrollerListener = (MethodExpression) getStateHelper().eval(PropertyKeys.scrollerListener);
+ if (scrollerListener != null) {
+ scrollerListener.invoke(facesContext.getELContext(), new Object[] { event });
+ }
- if (newPage >= 1 && newPage <= pageCount) {
- return newPage;
- } else {
- return 0;
- }
- }
+ UIComponent dataTable = getDataTable();
- public int getPageCount(UIComponent data) {
- int rowCount = getRowCount(data);
- int rows = getRows(data);
- return getPageCount(data, rowCount, rows);
- }
-
- public int getPageCount(UIComponent data, int rowCount, int rows) {
- return DataScrollerUtils.getPageCount(data, rowCount, rows);
- }
+ List<UIDataScroller> dataScrollers = DataScrollerUtils.findDataScrollers(dataTable);
+ for (UIDataScroller dataScroller : dataScrollers) {
+ facesContext.getPartialViewContext().getRenderIds().add(dataScroller.getClientId(facesContext));
+ }
- /** @return the page count of the uidata */
- public int getPageCount() {
- return getPageCount(getDataTable());
- }
+ String dataTableId = dataTable.getClientId(facesContext);
+ if (dataTable instanceof PartiallyEncodedComponent) {
+ dataTableId += "@body";
+ }
- public int getRowCount(UIComponent data) {
- return (Integer)data.getAttributes().get("rowCount");
- }
+ facesContext.getPartialViewContext().getRenderIds().add(dataTableId);
+ }
+ }
- /** @return int */
- public int getRowCount() {
- return getRowCount(getDataTable());
- }
+ /**
+ * Finds the dataTable which id is mapped to the "for" property
+ *
+ * @return the dataTable component
+ */
- public int getRows(UIComponent data) {
- return DataScrollerUtils.getRows(data);
- }
+ public UIComponent getDataTable() {
+ String forAttribute = (String) getStateHelper().get(PropertyKeys.forComponent);
+ UIComponent forComp;
- // facet getter methods
- public UIComponent getFirst() {
- return getFacet(FIRST_FACET_NAME);
- }
+ if (forAttribute == null) {
+ forComp = this;
- public UIComponent getLast() {
- return getFacetByKey(LAST_FACET_NAME);
- }
+ while ((forComp = forComp.getParent()) != null) {
+ if (forComp instanceof UIData || forComp instanceof UIDataAdaptor) {
+ getStateHelper().put(PropertyKeys.forComponent, forComp.getId());
+ return forComp;
+ }
+ }
+ throw new FacesException("could not find dataTable for datascroller " + this.getId());
- public UIComponent getFastForward() {
- return getFacetByKey(FAST_FORWARD_FACET_NAME);
- }
+ } else {
+ forComp = RendererUtils.getInstance().findComponentFor(this, forAttribute);
+ }
- public UIComponent getFastRewind() {
- return getFacetByKey(FAST_REWIND_FACET_NAME);
- }
+ if (forComp == null) {
+ throw new IllegalArgumentException("could not find dataTable with id '" + forAttribute + "'");
+ } else if (!((forComp instanceof UIData) || (forComp instanceof UIDataAdaptor))) {
- private UIComponent getFacetByKey(String key) {
- return getFacet(key.toString());
- }
-
- private static boolean isRendered(UIComponent component) {
- UIComponent c = component;
- while (c != null) {
- if (!c.isRendered()) {
- return false;
- }
- c = c.getParent();
- }
+ throw new IllegalArgumentException("component with id '" + forAttribute + "' must be of type "
+ + UIData.class.getName() + " or " + UIDataAdaptor.class + ", not type " + forComp.getClass().getName());
+ }
- return true;
- }
-
- public void setPage(int newPage) {
- this.page = newPage;
- }
+ return forComp;
+ }
- public int getPage() {
-
- UIComponent dataTable = getDataTable();
- Map<String, Object> attributes = dataTable.getAttributes();
-
- FacesContext facesContext = getFacesContext();
- Integer state = (Integer) attributes.get(dataTable.getClientId(facesContext)+ SCROLLER_STATE_ATTRIBUTE);
+ private int getFastStepOrDefault() {
+ return (Integer) getStateHelper().eval(PropertyKeys.fastStep, 1);
+ }
- if (state != null) {
- return state;
- }
-
- if (this.page != null) {
- return page;
- }
-
- ValueExpression ve = getValueExpression("page");
- if (ve != null) {
- try {
- Integer pageObject = (Integer) ve.getValue(getFacesContext().getELContext());
+ public int getPageForFacet(String facetName) {
+ if (facetName == null) {
+ throw new NullPointerException();
+ }
- if (pageObject != null) {
- return pageObject;
- }
- } catch (ELException e) {
- throw new FacesException(e);
- }
- }
-
- return 1;
- }
-
- private void updateModel(int newPage) {
-
- FacesContext facesContext = getFacesContext();
- UIComponent dataTable = getDataTable();
+ int newPage = 1;
+ int pageCount = getPageCount();
- if (isRendered(dataTable)) {
- dataTable.getAttributes().put("first", (newPage - 1) * getRows(dataTable));
- }
-
- Map<String, Object> attributes = dataTable.getAttributes();
- attributes.put(dataTable.getClientId(facesContext) + SCROLLER_STATE_ATTRIBUTE, newPage);
-
- ValueExpression ve = getValueExpression("page");
- if (ve != null) {
- try {
- ve.setValue(facesContext.getELContext(), newPage);
- attributes.remove(dataTable.getClientId(facesContext) + SCROLLER_STATE_ATTRIBUTE);
- } catch (ELException e) {
- String messageStr = e.getMessage();
- Throwable result = e.getCause();
- while (null != result &&
- result.getClass().isAssignableFrom(ELException.class)) {
- messageStr = result.getMessage();
- result = result.getCause();
- }
- FacesMessage message;
- if (null == messageStr) {
- message =
- MessageUtil.getMessage(facesContext, UIInput.UPDATE_MESSAGE_ID,
- new Object[] { MessageUtil.getLabel(
- facesContext, this) });
- } else {
- message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
- messageStr,
- messageStr);
- }
- facesContext.getExternalContext().log(message.getSummary(), result);
- facesContext.addMessage(getClientId(facesContext), message);
- facesContext.renderResponse();
- } catch (IllegalArgumentException e) {
- FacesMessage message =
- MessageUtil.getMessage(facesContext, UIInput.UPDATE_MESSAGE_ID,
- new Object[] { MessageUtil.getLabel(
- facesContext, this) });
- facesContext.getExternalContext().log(message.getSummary(), e);
- facesContext.addMessage(getClientId(facesContext), message);
- facesContext.renderResponse();
- } catch (Exception e) {
- FacesMessage message =
- MessageUtil.getMessage(facesContext, UIInput.UPDATE_MESSAGE_ID,
- new Object[] { MessageUtil.getLabel(
- facesContext, this) });
- facesContext.getExternalContext().log(message.getSummary(), e);
- facesContext.addMessage(getClientId(facesContext), message);
- facesContext.renderResponse();
- }
- }
- }
+ if (FIRST_FACET_NAME.equals(facetName)) {
+ newPage = 1;
+ } else if (LAST_FACET_NAME.equals(facetName)) {
+ newPage = pageCount > 0 ? pageCount : 1;
+ } else if (FAST_FORWARD_FACET_NAME.equals(facetName)) {
+ newPage = getPage() + getFastStepOrDefault();
+ } else if (FAST_REWIND_FACET_NAME.equals(facetName)) {
+ newPage = getPage() - getFastStepOrDefault();
+ } else {
+ try {
+ newPage = Integer.parseInt(facetName.toString());
+ } catch (NumberFormatException e) {
+ throw new FacesException(e.getLocalizedMessage(), e);
+ }
+ }
- public boolean isLocalPageSet() {
- return page != null;
- }
+ if (newPage >= 1 && newPage <= pageCount) {
+ return newPage;
+ } else {
+ return 0;
+ }
+ }
- public void resetLocalPage() {
- page = null;
- }
-
- @Override
- public String getFamily() {
- return COMPONENT_FAMILY;
- }
-
- @Override
+ public int getPageCount(UIComponent data) {
+ int rowCount = getRowCount(data);
+ int rows = getRows(data);
+ return getPageCount(data, rowCount, rows);
+ }
+
+ public int getPageCount(UIComponent data, int rowCount, int rows) {
+ return DataScrollerUtils.getPageCount(data, rowCount, rows);
+ }
+
+ /** @return the page count of the uidata */
+ public int getPageCount() {
+ return getPageCount(getDataTable());
+ }
+
+ public int getRowCount(UIComponent data) {
+ return (Integer) data.getAttributes().get("rowCount");
+ }
+
+ /** @return int */
+ public int getRowCount() {
+ return getRowCount(getDataTable());
+ }
+
+ public int getRows(UIComponent data) {
+ return DataScrollerUtils.getRows(data);
+ }
+
+ // facet getter methods
+ public UIComponent getFirst() {
+ return getFacet(FIRST_FACET_NAME);
+ }
+
+ public UIComponent getLast() {
+ return getFacetByKey(LAST_FACET_NAME);
+ }
+
+ public UIComponent getFastForward() {
+ return getFacetByKey(FAST_FORWARD_FACET_NAME);
+ }
+
+ public UIComponent getFastRewind() {
+ return getFacetByKey(FAST_REWIND_FACET_NAME);
+ }
+
+ private UIComponent getFacetByKey(String key) {
+ return getFacet(key.toString());
+ }
+
+ private static boolean isRendered(UIComponent component) {
+ UIComponent c = component;
+ while (c != null) {
+ if (!c.isRendered()) {
+ return false;
+ }
+ c = c.getParent();
+ }
+
+ return true;
+ }
+
+ public void setPage(int newPage) {
+ this.page = newPage;
+ }
+
+ public int getPage() {
+
+ UIComponent dataTable = getDataTable();
+ Map<String, Object> attributes = dataTable.getAttributes();
+
+ FacesContext facesContext = getFacesContext();
+ Integer state = (Integer) attributes.get(dataTable.getClientId(facesContext) + SCROLLER_STATE_ATTRIBUTE);
+
+ if (state != null) {
+ return state;
+ }
+
+ if (this.page != null) {
+ return page;
+ }
+
+ ValueExpression ve = getValueExpression("page");
+ if (ve != null) {
+ try {
+ Integer pageObject = (Integer) ve.getValue(getFacesContext().getELContext());
+
+ if (pageObject != null) {
+ return pageObject;
+ }
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ }
+
+ return 1;
+ }
+
+ private void updateModel(int newPage) {
+
+ FacesContext facesContext = getFacesContext();
+ UIComponent dataTable = getDataTable();
+
+ if (isRendered(dataTable)) {
+ dataTable.getAttributes().put("first", (newPage - 1) * getRows(dataTable));
+ }
+
+ Map<String, Object> attributes = dataTable.getAttributes();
+ attributes.put(dataTable.getClientId(facesContext) + SCROLLER_STATE_ATTRIBUTE, newPage);
+
+ ValueExpression ve = getValueExpression("page");
+ if (ve != null) {
+ try {
+ ve.setValue(facesContext.getELContext(), newPage);
+ attributes.remove(dataTable.getClientId(facesContext) + SCROLLER_STATE_ATTRIBUTE);
+ } catch (ELException e) {
+ String messageStr = e.getMessage();
+ Throwable result = e.getCause();
+ while (null != result && result.getClass().isAssignableFrom(ELException.class)) {
+ messageStr = result.getMessage();
+ result = result.getCause();
+ }
+ FacesMessage message;
+ if (null == messageStr) {
+ message = MessageUtil.getMessage(facesContext, UIInput.UPDATE_MESSAGE_ID,
+ new Object[] { MessageUtil.getLabel(facesContext, this) });
+ } else {
+ message = new FacesMessage(FacesMessage.SEVERITY_ERROR, messageStr, messageStr);
+ }
+ facesContext.getExternalContext().log(message.getSummary(), result);
+ facesContext.addMessage(getClientId(facesContext), message);
+ facesContext.renderResponse();
+ } catch (IllegalArgumentException e) {
+ FacesMessage message = MessageUtil.getMessage(facesContext, UIInput.UPDATE_MESSAGE_ID,
+ new Object[] { MessageUtil.getLabel(facesContext, this) });
+ facesContext.getExternalContext().log(message.getSummary(), e);
+ facesContext.addMessage(getClientId(facesContext), message);
+ facesContext.renderResponse();
+ } catch (Exception e) {
+ FacesMessage message = MessageUtil.getMessage(facesContext, UIInput.UPDATE_MESSAGE_ID,
+ new Object[] { MessageUtil.getLabel(facesContext, this) });
+ facesContext.getExternalContext().log(message.getSummary(), e);
+ facesContext.addMessage(getClientId(facesContext), message);
+ facesContext.renderResponse();
+ }
+ }
+ }
+
+ public boolean isLocalPageSet() {
+ return page != null;
+ }
+
+ public void resetLocalPage() {
+ page = null;
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ @Override
public Object getIterationState(FacesContext context) {
- return new Object[] {this.page};
+ return new Object[] { this.page };
}
@Override
public void setIterationState(FacesContext context, Object state) {
- if(state != null) {
- Object [] stateObject = (Object[])state;
- this.page = (Integer)stateObject[0];
+ if (state != null) {
+ Object[] stateObject = (Object[]) state;
+ this.page = (Integer) stateObject[0];
} else {
this.page = null;
}
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2010-05-03 09:58:02 UTC (rev 16866)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/event/DataTablePreRenderListener.java 2010-05-03 10:22:46 UTC (rev 16867)
@@ -22,30 +22,30 @@
import org.slf4j.Logger;
public class DataTablePreRenderListener implements SystemEventListener {
-
- private static final Logger log = RichfacesLogger.COMPONENTS.getLogger();
-
-
+
+ private static final Logger LOG = RichfacesLogger.COMPONENTS.getLogger();
+
@Override
public boolean isListenerForSource(Object source) {
return ((source instanceof UIDataAdaptor) || (source instanceof UIData));
}
-
- public UIDataScroller processActiveDatascroller(FacesContext facesContext, List<UIDataScroller> dataScrollers, UIComponent dataTable) {
+
+ public UIDataScroller processActiveDatascroller(FacesContext facesContext, List<UIDataScroller> dataScrollers,
+ UIComponent dataTable) {
UIDataScroller activeComponent = null;
List<Object> values = new ArrayList<Object>(dataScrollers.size());
-
+
String stateKey = dataTable.getClientId(facesContext) + UIDataScroller.SCROLLER_STATE_ATTRIBUTE;
Map<String, Object> attributes = dataTable.getAttributes();
Object pageValue = attributes.get(stateKey);
-
+
boolean valid = true;
-
- if(pageValue == null) {
-
+
+ if (pageValue == null) {
+
for (UIDataScroller datascroller : dataScrollers) {
Object nextPageValue = null;
-
+
if (datascroller.isLocalPageSet()) {
nextPageValue = datascroller.getPage();
attributes.put(stateKey, nextPageValue);
@@ -53,52 +53,52 @@
} else {
nextPageValue = datascroller.getValueExpression("page");
}
-
+
if (!values.isEmpty() && !same(values.get(values.size() - 1), nextPageValue)) {
valid = false;
}
-
+
values.add(nextPageValue);
-
+
if (nextPageValue != null) {
activeComponent = datascroller;
- }
+ }
}
-
+
}
-
- if(activeComponent == null) {
- activeComponent = dataScrollers.get(dataScrollers.size()-1);
+
+ if (activeComponent == null) {
+ activeComponent = dataScrollers.get(dataScrollers.size() - 1);
}
-
+
if (!valid) {
String formattedMessage = getPageDifferentMessage(facesContext, activeComponent, dataScrollers, values);
- log.error(formattedMessage);
-
+ LOG.error(formattedMessage);
+
}
-
+
return activeComponent;
}
-
+
@Override
public void processEvent(SystemEvent event) throws AbortProcessingException {
- UIComponent dataTable = (UIComponent)event.getSource();
+ UIComponent dataTable = (UIComponent) event.getSource();
List<UIDataScroller> dataScrollers = DataScrollerUtils.findDataScrollers(dataTable);
-
- if(!dataScrollers.isEmpty()) {
+ if (!dataScrollers.isEmpty()) {
+
FacesContext facesContext = FacesContext.getCurrentInstance();
-
+
UIDataScroller activeComponent = processActiveDatascroller(facesContext, dataScrollers, dataTable);
-
+
int rowCount = DataScrollerUtils.getRowCount(dataTable);
int rows = DataScrollerUtils.getRows(dataTable);
-
+
Integer pageCount = DataScrollerUtils.getPageCount(dataTable, rowCount, rows);
-
+
int page = activeComponent.getPage();
int newPage = -1;
-
+
if (page < 1) {
newPage = 1;
} else if (page > pageCount) {
@@ -107,26 +107,27 @@
if (newPage != -1) {
Object label = MessageUtil.getLabel(facesContext, activeComponent);
- String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGE_MISSING, new Object[] {label, page, pageCount, newPage});
+ String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGE_MISSING, new Object[] { label,
+ page, pageCount, newPage });
- log.warn(formattedMessage);
-
+ LOG.warn(formattedMessage);
+
page = newPage;
- dataTable.getAttributes().put(dataTable.getClientId(facesContext) + UIDataScroller.SCROLLER_STATE_ATTRIBUTE, page);
+ dataTable.getAttributes().put(
+ dataTable.getClientId(facesContext) + UIDataScroller.SCROLLER_STATE_ATTRIBUTE, page);
}
-
int first;
-
+
String lastPageMode = activeComponent.getLastPageMode();
-
+
if (lastPageMode == null) {
lastPageMode = UIDataScroller.PAGEMODE_SHORT;
- } else if (!UIDataScroller.PAGEMODE_SHORT.equals(lastPageMode)
- && !UIDataScroller.PAGEMODE_FULL.equals(lastPageMode)) {
+ } else if (!UIDataScroller.PAGEMODE_SHORT.equals(lastPageMode)
+ && !UIDataScroller.PAGEMODE_FULL.equals(lastPageMode)) {
throw new IllegalArgumentException("Illegal value of 'lastPageMode' attribute: '" + lastPageMode + "'");
}
-
+
if (page != pageCount || UIDataScroller.PAGEMODE_SHORT.equals(lastPageMode)) {
first = (page - 1) * rows;
} else {
@@ -138,41 +139,44 @@
dataTable.getAttributes().put("first", first);
}
}
-
- private String getPageDifferentMessage(FacesContext facesContext, UIDataScroller activeComponent, List<UIDataScroller> dataScrollers, List<Object> values) {
+
+ private String getPageDifferentMessage(FacesContext facesContext, UIDataScroller activeComponent,
+ List<UIDataScroller> dataScrollers, List<Object> values) {
StringBuilder builder = new StringBuilder("\n[");
Iterator<UIDataScroller> scrollerItr = dataScrollers.iterator();
Iterator<Object> valueItr = values.iterator();
-
+
while (scrollerItr.hasNext()) {
UIDataScroller next = scrollerItr.next();
builder.append(MessageUtil.getLabel(facesContext, next));
builder.append(": ");
-
+
Object value = valueItr.next();
if (value instanceof ValueExpression) {
builder.append(((ValueExpression) value).getExpressionString());
} else {
builder.append(value);
}
-
+
builder.append(scrollerItr.hasNext() ? ",\n" : "]");
}
-
- return Messages.getMessage(Messages.DATASCROLLER_PAGES_DIFFERENT, new Object[] {MessageUtil.getLabel(facesContext, activeComponent), builder});
-
+
+ return Messages.getMessage(Messages.DATASCROLLER_PAGES_DIFFERENT, new Object[] {
+ MessageUtil.getLabel(facesContext, activeComponent), builder });
+
}
-
+
private static boolean same(Object o1, Object o2) {
if (o1 instanceof ValueExpression && o2 instanceof ValueExpression) {
ValueExpression ve1 = (ValueExpression) o1;
ValueExpression ve2 = (ValueExpression) o2;
-
- if (same(ve1.getExpressionString(), ve2.getExpressionString()) && same(ve1.getExpectedType(), ve2.getExpectedType())) {
+
+ if (same(ve1.getExpressionString(), ve2.getExpressionString())
+ && same(ve1.getExpectedType(), ve2.getExpectedType())) {
return true;
}
}
-
+
return (o1 != null && o1.equals(o2)) || (o1 == null && o2 == null);
}
}
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/ControlsState.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/ControlsState.java 2010-05-03 09:58:02 UTC (rev 16866)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/ControlsState.java 2010-05-03 10:22:46 UTC (rev 16867)
@@ -23,98 +23,97 @@
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
- *
+ *
*/
public class ControlsState {
-
+
private boolean firstRendered = true;
-
+
private boolean firstEnabled = true;
- private boolean lastRendered = true;
-
- private boolean lastEnabled = true;
+ private boolean lastRendered = true;
- private boolean fastRewindRendered = true;
+ private boolean lastEnabled = true;
- private boolean fastRewindEnabled = true;
+ private boolean fastRewindRendered = true;
- private boolean fastForwardRendered = true;
-
- private boolean fastForwardEnabled = true;
-
- private boolean controlsSeparatorRendered = false;
-
-
+ private boolean fastRewindEnabled = true;
+
+ private boolean fastForwardRendered = true;
+
+ private boolean fastForwardEnabled = true;
+
+ private boolean controlsSeparatorRendered = false;
+
public boolean getFirstRendered() {
- return firstRendered;
- }
-
- public void setFirstRendered(boolean firstRendered) {
- this.firstRendered = firstRendered;
- }
-
- public boolean getFirstEnabled() {
- return firstEnabled;
- }
-
- public void setFirstEnabled(boolean firstEnabled) {
- this.firstEnabled = firstEnabled;
- }
-
- public boolean getLastRendered() {
- return lastRendered;
- }
-
- public void setLastRendered(boolean lastRendered) {
- this.lastRendered = lastRendered;
- }
-
- public boolean getLastEnabled() {
- return lastEnabled;
- }
-
- public void setLastEnabled(boolean lastEnabled) {
- this.lastEnabled = lastEnabled;
- }
-
- public boolean getFastRewindRendered() {
- return fastRewindRendered;
- }
-
- public void setFastRewindRendered(boolean fastRewindRendered) {
- this.fastRewindRendered = fastRewindRendered;
- }
-
- public boolean getFastRewindEnabled() {
- return fastRewindEnabled;
- }
-
- public void setFastRewindEnabled(boolean fastRewindEnabled) {
- this.fastRewindEnabled = fastRewindEnabled;
- }
-
- public boolean getFastForwardRendered() {
- return fastForwardRendered;
- }
-
- public void setFastForwardRendered(boolean fastForwardRendered) {
- this.fastForwardRendered = fastForwardRendered;
- }
-
- public boolean getFastForwardEnabled() {
- return fastForwardEnabled;
- }
-
- public void setFastForwardEnabled(boolean fastForwardEnabled) {
- this.fastForwardEnabled = fastForwardEnabled;
- }
-
- public boolean isControlsSeparatorRendered() {
- return controlsSeparatorRendered;
- }
-
- public void setControlsSeparatorRendered(boolean controlsSeparatorRendered) {
- this.controlsSeparatorRendered = controlsSeparatorRendered;
- }
+ return firstRendered;
+ }
+
+ public void setFirstRendered(boolean firstRendered) {
+ this.firstRendered = firstRendered;
+ }
+
+ public boolean getFirstEnabled() {
+ return firstEnabled;
+ }
+
+ public void setFirstEnabled(boolean firstEnabled) {
+ this.firstEnabled = firstEnabled;
+ }
+
+ public boolean getLastRendered() {
+ return lastRendered;
+ }
+
+ public void setLastRendered(boolean lastRendered) {
+ this.lastRendered = lastRendered;
+ }
+
+ public boolean getLastEnabled() {
+ return lastEnabled;
+ }
+
+ public void setLastEnabled(boolean lastEnabled) {
+ this.lastEnabled = lastEnabled;
+ }
+
+ public boolean getFastRewindRendered() {
+ return fastRewindRendered;
+ }
+
+ public void setFastRewindRendered(boolean fastRewindRendered) {
+ this.fastRewindRendered = fastRewindRendered;
+ }
+
+ public boolean getFastRewindEnabled() {
+ return fastRewindEnabled;
+ }
+
+ public void setFastRewindEnabled(boolean fastRewindEnabled) {
+ this.fastRewindEnabled = fastRewindEnabled;
+ }
+
+ public boolean getFastForwardRendered() {
+ return fastForwardRendered;
+ }
+
+ public void setFastForwardRendered(boolean fastForwardRendered) {
+ this.fastForwardRendered = fastForwardRendered;
+ }
+
+ public boolean getFastForwardEnabled() {
+ return fastForwardEnabled;
+ }
+
+ public void setFastForwardEnabled(boolean fastForwardEnabled) {
+ this.fastForwardEnabled = fastForwardEnabled;
+ }
+
+ public boolean isControlsSeparatorRendered() {
+ return controlsSeparatorRendered;
+ }
+
+ public void setControlsSeparatorRendered(boolean controlsSeparatorRendered) {
+ this.controlsSeparatorRendered = controlsSeparatorRendered;
+ }
}
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-05-03 09:58:02 UTC (rev 16866)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-05-03 10:22:46 UTC (rev 16867)
@@ -42,47 +42,42 @@
import org.richfaces.component.UIDataScroller;
import org.richfaces.event.DataScrollerEvent;
-
-@ResourceDependencies( {@ResourceDependency(library = "javax.faces", name = "jsf-uncompressed.js"),
- @ResourceDependency(name = "jquery.js"),
- @ResourceDependency(name = "richfaces.js"),
- @ResourceDependency(name= "richfaces-event.js"),
- @ResourceDependency(name = "richfaces-queue.js"),
- @ResourceDependency(name = "richfaces-base-component.js"),
- @ResourceDependency(name = "script/datascroller.js"),
+@ResourceDependencies( { @ResourceDependency(library = "javax.faces", name = "jsf-uncompressed.js"),
+ @ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-event.js"), @ResourceDependency(name = "richfaces-queue.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"), @ResourceDependency(name = "script/datascroller.js"),
@ResourceDependency(name = "css/datascroller.css")
-
-})
+})
public class DataScrollerBaseRenderer extends RendererBase {
public void doDecode(FacesContext context, UIComponent component) {
- Map <String, String> paramMap = context.getExternalContext().getRequestParameterMap();
-
- String clientId = component.getClientId(context);
- String param = (String) paramMap.get(clientId + ":page");
-
- if (param != null) {
-
- UIDataScroller scroller = (UIDataScroller) component;
- int newPage = scroller.getPageForFacet(param);
- int page = scroller.getPage();
-
- if (newPage != 0 && newPage != page) {
- new DataScrollerEvent(scroller,String.valueOf(page), param, newPage).queue();
- }
- }
+ Map<String, String> paramMap = context.getExternalContext().getRequestParameterMap();
+
+ String clientId = component.getClientId(context);
+ String param = (String) paramMap.get(clientId + ":page");
+
+ if (param != null) {
+
+ UIDataScroller scroller = (UIDataScroller) component;
+ int newPage = scroller.getPageForFacet(param);
+ int page = scroller.getPage();
+
+ if (newPage != 0 && newPage != page) {
+ new DataScrollerEvent(scroller, String.valueOf(page), param, newPage).queue();
+ }
+ }
}
-
+
public ControlsState getControlsState(FacesContext context, UIComponent component) {
-
- int fastStep = (Integer)component.getAttributes().get("fastStep");
- int pageIndex = (Integer)component.getAttributes().get("page");
- int pageCount = (Integer)component.getAttributes().get("pageCount");
-
+
+ int fastStep = (Integer) component.getAttributes().get("fastStep");
+ int pageIndex = (Integer) component.getAttributes().get("page");
+ int pageCount = (Integer) component.getAttributes().get("pageCount");
+
int minPageIdx = 1;
int maxPageIdx = pageCount;
-
+
if (fastStep <= 1) {
fastStep = 1;
}
@@ -111,13 +106,11 @@
useForwFast = false;
}
- boolean isAuto;
+ String boundaryControls = (String) component.getAttributes().get("boundaryControls");
+ String fastControls = (String) component.getAttributes().get("fastControls");
- String boundaryControls = (String)component.getAttributes().get("boundaryControls");
- String fastControls = (String)component.getAttributes().get("fastControls");
-
- if ((isAuto = "auto".equals(boundaryControls)) || "show".equals(
- boundaryControls)) {
+ boolean isAuto = "auto".equals(boundaryControls);
+ if (isAuto || "show".equals(boundaryControls)) {
if (isAuto) {
controlsState.setFirstRendered(useFirst);
controlsState.setLastRendered(useLast);
@@ -130,8 +123,8 @@
controlsState.setLastRendered(false);
}
- if ((isAuto = "auto".equals(fastControls)) || "show".equals(
- fastControls)) {
+ isAuto = "auto".equals(fastControls);
+ if (isAuto || "show".equals(fastControls)) {
if (isAuto) {
controlsState.setFastForwardRendered(useForwFast);
controlsState.setFastRewindRendered(useBackFast);
@@ -146,33 +139,34 @@
UIComponent controlsSeparatorFacet = component.getFacet("controlsSeparator");
if (controlsSeparatorFacet != null && controlsSeparatorFacet.isRendered()) {
- controlsState.setControlsSeparatorRendered(true);
+ controlsState.setControlsSeparatorRendered(true);
}
-
+
return controlsState;
}
- public Map<String,String> renderPager(ResponseWriter out, FacesContext context, UIComponent component) throws IOException {
-
- int currentPage = (Integer)component.getAttributes().get("page");
- int maxPages = (Integer)component.getAttributes().get("maxPages");
- int pageCount = (Integer)component.getAttributes().get("pageCount");
+ public Map<String, String> renderPager(ResponseWriter out, FacesContext context, UIComponent component)
+ throws IOException {
- Map<String,String> digital = new HashMap<String, String>();
+ int currentPage = (Integer) component.getAttributes().get("page");
+ int maxPages = (Integer) component.getAttributes().get("maxPages");
+ int pageCount = (Integer) component.getAttributes().get("pageCount");
+ Map<String, String> digital = new HashMap<String, String>();
+
if (pageCount <= 1) {
return digital;
}
-
+
if (maxPages <= 1) {
maxPages = 1;
}
-
+
int delta = maxPages / 2;
int pages;
int start;
-
+
if (pageCount > maxPages && currentPage > delta) {
pages = maxPages;
start = currentPage - pages / 2 - 1;
@@ -186,120 +180,124 @@
String clientId = component.getClientId(context);
- for (int i = start, size = start + pages; i < size; i++) {
+ int size = start + pages;
+ for (int i = start ; i < size; i++) {
boolean isCurrentPage = (i + 1 == currentPage);
String styleClass;
String style;
-
+
if (isCurrentPage) {
- styleClass = (String)component.getAttributes().get("selectedStyleClass");
- style = (String)component.getAttributes().get("selectedStyle");
- } else {
- styleClass = (String)component.getAttributes().get("inactiveStyleClass");
- style = (String)component.getAttributes().get("inactiveStyle");
- }
-
- if (styleClass==null){
- styleClass="";
- }
+ styleClass = (String) component.getAttributes().get("selectedStyleClass");
+ style = (String) component.getAttributes().get("selectedStyle");
+ } else {
+ styleClass = (String) component.getAttributes().get("inactiveStyleClass");
+ style = (String) component.getAttributes().get("inactiveStyle");
+ }
+ if (styleClass == null) {
+ styleClass = "";
+ }
+
out.startElement(HTML.A_ELEMENT, component);
-
+
if (isCurrentPage) {
out.writeAttribute(HTML.CLASS_ATTRIBUTE, "ds_digital ds_current " + styleClass, null);
} else {
out.writeAttribute(HTML.CLASS_ATTRIBUTE, "ds_digital " + styleClass, null);
}
-
+
out.writeAttribute(HTML.HREF_ATTR, "javascript:void(0);", null);
-
-
+
if (null != style) {
out.writeAttribute(HTML.STYLE_ATTRIBUTE, style, null);
}
-
+
String page = Integer.toString(i + 1);
- String id = clientId+ "_ds_" + page;
-
- out.writeAttribute(HTML.ID_ATTRIBUTE,id, null);
-
+ String id = clientId + "_ds_" + page;
+
+ out.writeAttribute(HTML.ID_ATTRIBUTE, id, null);
+
digital.put(id, page);
out.writeText(page, null);
out.endElement(HTML.A_ELEMENT);
}
-
+
return digital;
}
-
- public Map<String, Map<String,String>> getControls(FacesContext context, UIComponent component, ControlsState controlsState) {
- Map<String, Map<String, String>> controls = new HashMap<String, Map<String,String>>();
+ public Map<String, Map<String, String>> getControls(FacesContext context, UIComponent component,
+ ControlsState controlsState) {
+
+ Map<String, Map<String, String>> controls = new HashMap<String, Map<String, String>>();
Map<String, String> right = new HashMap<String, String>();
Map<String, String> left = new HashMap<String, String>();
-
+
String clientId = component.getClientId(context);
-
- if(controlsState.getFirstRendered() && controlsState.getFirstEnabled()) {
+
+ if (controlsState.getFirstRendered() && controlsState.getFirstEnabled()) {
left.put(clientId + "_ds_f", UIDataScroller.FIRST_FACET_NAME);
}
-
- if(controlsState.getFastRewindRendered()&& controlsState.getFastRewindEnabled()) {
+
+ if (controlsState.getFastRewindRendered() && controlsState.getFastRewindEnabled()) {
left.put(clientId + "_ds_fr", UIDataScroller.FAST_REWIND_FACET_NAME);
}
-
- if(controlsState.getFastForwardRendered()&& controlsState.getFastForwardEnabled()) {
+
+ if (controlsState.getFastForwardRendered() && controlsState.getFastForwardEnabled()) {
right.put(clientId + "_ds_ff", UIDataScroller.FAST_FORWARD_FACET_NAME);
}
-
- if(controlsState.getLastRendered()&& controlsState.getLastEnabled()) {
+
+ if (controlsState.getLastRendered() && controlsState.getLastEnabled()) {
right.put(clientId + "_ds_l", UIDataScroller.LAST_FACET_NAME);
}
-
- if(!left.isEmpty()) {
+
+ if (!left.isEmpty()) {
controls.put("left", left);
}
-
- if(!right.isEmpty()) {
+
+ if (!right.isEmpty()) {
controls.put("right", right);
}
return controls;
}
-
- public void buildScript(ResponseWriter writer, FacesContext context, UIComponent component, Map buttons, Map digitals) throws IOException {
-
+
+ public void buildScript(ResponseWriter writer, FacesContext context, UIComponent component, Map buttons,
+ Map digitals) throws IOException {
+
JSFunction function = new JSFunction("new RichFaces.ui.DataScroller");
function.addParameter(component.getClientId(context));
-
+
Map<String, Object> options = new HashMap<String, Object>();
options.put("buttons", buttons);
options.put("digitals", digitals);
- options.put("currentPage", (Integer)component.getAttributes().get("page"));
-
+ options.put("currentPage", (Integer) component.getAttributes().get("page"));
+
function.addParameter(getSubmitFunction(context, component));
function.addParameter(options);
-
+
writer.write(function.toString());
}
-
+
public JSFunctionDefinition getSubmitFunction(FacesContext facesContext, UIComponent component) {
- JSFunctionDefinition definition = new JSFunctionDefinition(JSReference.EVENT, new JSReference("element"), new JSReference("data"));
-
- JSFunction function = AjaxRendererUtils.buildAjaxFunction(facesContext, component, AjaxRendererUtils.AJAX_FUNCTION_NAME);
- AjaxEventOptions options = AjaxRendererUtils.buildEventOptions(facesContext, component);
-
- Map<String, Object> parameters = options.getParameters();
- parameters.put(component.getClientId(facesContext) + ":page", new JSLiteral("data.page"));
-
- function.addParameter(options);
-
- StringBuffer buffer = new StringBuffer();
- function.appendScript(buffer);
- definition.addToBody(buffer);
- return definition;
+ JSFunctionDefinition definition = new JSFunctionDefinition(JSReference.EVENT, new JSReference("element"),
+ new JSReference("data"));
+
+ JSFunction function = AjaxRendererUtils.buildAjaxFunction(facesContext, component,
+ AjaxRendererUtils.AJAX_FUNCTION_NAME);
+ AjaxEventOptions options = AjaxRendererUtils.buildEventOptions(facesContext, component);
+
+ Map<String, Object> parameters = options.getParameters();
+ parameters.put(component.getClientId(facesContext) + ":page", new JSLiteral("data.page"));
+
+ function.addParameter(options);
+
+ StringBuffer buffer = new StringBuffer();
+ function.appendScript(buffer);
+ definition.addToBody(buffer);
+ return definition;
}
-
+
public boolean getRendersChildren() {
return true;
}
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/taglib/DatascrollerTagHandler.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/taglib/DatascrollerTagHandler.java 2010-05-03 09:58:02 UTC (rev 16866)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/taglib/DatascrollerTagHandler.java 2010-05-03 10:22:46 UTC (rev 16867)
@@ -33,45 +33,45 @@
import org.richfaces.component.UIDataScroller;
-
/**
* Created 11.03.2008
+ *
* @author Nick Belaevski
* @since 3.2
*/
public class DatascrollerTagHandler extends ComponentHandler {
- private static final MetaRule pageRule = new MetaRule() {
+ private static final MetaRule PAGERULE = new MetaRule() {
- public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
- if ("page".equals(name)) {
- return new PageMapper(attribute);
- } else {
- return null;
- }
- }
-
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
+ if ("page".equals(name)) {
+ return new PageMapper(attribute);
+ } else {
+ return null;
+ }
+ }
+
};
-
+
private static final class PageMapper extends Metadata {
- private final TagAttribute page;
+ private final TagAttribute page;
- public PageMapper(TagAttribute attribute) {
- page = attribute;
- }
+ public PageMapper(TagAttribute attribute) {
+ page = attribute;
+ }
- public void applyMetadata(FaceletContext ctx, Object instance) {
- UIDataScroller datascroller = (UIDataScroller) instance;
- ValueExpression ve = page.getValueExpression(ctx, int.class);
- if (ve.isLiteralText()) {
- Integer value = (Integer) ve.getValue(ctx.getFacesContext().getELContext());
- datascroller.setPage(value);
- } else {
- datascroller.setValueExpression("page", ve);
- }
- }
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ UIDataScroller datascroller = (UIDataScroller) instance;
+ ValueExpression ve = page.getValueExpression(ctx, int.class);
+ if (ve.isLiteralText()) {
+ Integer value = (Integer) ve.getValue(ctx.getFacesContext().getELContext());
+ datascroller.setPage(value);
+ } else {
+ datascroller.setValueExpression("page", ve);
+ }
+ }
}
@@ -81,7 +81,7 @@
protected MetaRuleset createMetaRuleset(Class type) {
MetaRuleset ruleset = super.createMetaRuleset(type);
- ruleset.addRule(pageRule);
+ ruleset.addRule(PAGERULE);
return ruleset;
}
}
14 years, 8 months