JBoss Rich Faces SVN: r14583 - in branches/community/3.3.X/ui/editor/src: test/java/org/richfaces/seamparser and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-06-10 10:39:03 -0400 (Wed, 10 Jun 2009)
New Revision: 14583
Modified:
branches/community/3.3.X/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java
branches/community/3.3.X/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
Log:
Rich editor fails to convert "_" character to seam text
https://jira.jboss.org/jira/browse/RF-7347
Modified: branches/community/3.3.X/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java
===================================================================
--- branches/community/3.3.X/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java 2009-06-10 14:30:51 UTC (rev 14582)
+++ branches/community/3.3.X/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java 2009-06-10 14:39:03 UTC (rev 14583)
@@ -136,7 +136,7 @@
switch (text[start]) {
case '*': case '|': case '^' : case '+':
case '=': case '#': case '\\': case '~':
- case '[': case ']': case '`' :
+ case '[': case ']': case '`' : case '_':
case '<': case '>': case '&':
if (localStart != -1) {
out(text, localStart, start - localStart);
Modified: branches/community/3.3.X/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
===================================================================
--- branches/community/3.3.X/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2009-06-10 14:30:51 UTC (rev 14582)
+++ branches/community/3.3.X/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2009-06-10 14:39:03 UTC (rev 14583)
@@ -7,6 +7,8 @@
import org.jboss.seam.text.SeamTextParser;
import org.richfaces.convert.seamtext.HtmlToSeamSAXParser;
+import com.gargoylesoftware.htmlunit.Assert;
+
import java.io.StringReader;
/**
@@ -245,7 +247,7 @@
}
public void testSkipComment() throws Exception {
- assertHtml2SeamConverting("<!-- Hello Cfif -->");
+ assertHtml2SeamConverting("<!-- Hello Alex -->");
}
public void testEmptyList() throws Exception {
@@ -350,6 +352,20 @@
assertHtml2SeamConverting(content);
}
+ public void testRF7347() throws Exception {
+ final String content = "case '*': case '|': case '^' : case '+': " +
+ "case '=': case '#': case '\\': case '~': " +
+ "case '[': case ']': case '`' : case '_': ";
+ final String result = assertHtml2SeamConverting(content);
+ assertTrue(result.contains(content));
+ }
+
+ public void testRF7347_2() throws Exception {
+ final String content = "_*Hello ^World^*_ ";
+ final String result = assertHtml2SeamConverting(content);
+ assertTrue(result.contains(content));
+ }
+
public void testUglyTextFromWord() throws Exception {
final String str = "<p><meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\"/><meta content=\"Word.Document\" name=\"ProgId\"/><meta content=\"Microsoft Word 12\" name=\"Generator\"/><meta content=\"Microsoft Word 12\" name=\"Originator\"/><link href=\"file:///E:\\TEMP~1\\msohtmlclip1\\01\\clip_filelist.xml\" rel=\"File-List\"/><link href=\"file:///E:\\TEMP~1\\msohtmlclip1\\01\\clip_themedata.thmx\" rel=\"themeData\"/><link href=\"file:///E:\\TEMP~1\\msohtmlclip1\\01\\clip_colorschememapping.xml\" rel=\"colorSchemeMapping\"/>"
+ "<!--[if gte mso 9]><xml>\n"
17 years, 1 month
JBoss Rich Faces SVN: r14582 - in branches/sandbox/rf4_build: cdk/trunk/plugins and 23 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-06-10 10:30:51 -0400 (Wed, 10 Jun 2009)
New Revision: 14582
Modified:
branches/sandbox/rf4_build/cdk/trunk/archetypes/pom.xml
branches/sandbox/rf4_build/cdk/trunk/plugins/maven-cdk-plugin/pom.xml
branches/sandbox/rf4_build/cdk/trunk/plugins/pom.xml
branches/sandbox/rf4_build/docs/trunk/commons/highlight/pom.xml
branches/sandbox/rf4_build/docs/trunk/commons/pom.xml
branches/sandbox/rf4_build/docs/trunk/commons/resources/en/pom.xml
branches/sandbox/rf4_build/docs/trunk/commons/resources/pom.xml
branches/sandbox/rf4_build/docs/trunk/guides/pom.xml
branches/sandbox/rf4_build/docs/trunk/guides/testguide/en/pom.xml
branches/sandbox/rf4_build/docs/trunk/guides/testguide/pom.xml
branches/sandbox/rf4_build/examples/trunk/components/calendar-demo/pom.xml
branches/sandbox/rf4_build/examples/trunk/components/panel-demo/pom.xml
branches/sandbox/rf4_build/examples/trunk/components/pom.xml
branches/sandbox/rf4_build/examples/trunk/components/tree-demo/pom.xml
branches/sandbox/rf4_build/examples/trunk/photoalbum/pom.xml
branches/sandbox/rf4_build/examples/trunk/richfaces-demo/pom.xml
branches/sandbox/rf4_build/framework/trunk/api/pom.xml
branches/sandbox/rf4_build/framework/trunk/impl/pom.xml
branches/sandbox/rf4_build/framework/trunk/test-base/pom.xml
branches/sandbox/rf4_build/ui/trunk/components/calendar/pom.xml
branches/sandbox/rf4_build/ui/trunk/components/panel/pom.xml
branches/sandbox/rf4_build/ui/trunk/components/pom.xml
branches/sandbox/rf4_build/ui/trunk/components/tree/pom.xml
branches/sandbox/rf4_build/ui/trunk/skins/pom.xml
branches/sandbox/rf4_build/ui/trunk/themes/pom.xml
Log:
Build system: hardcoded group identifiers replaced by expressions
Modified: branches/sandbox/rf4_build/cdk/trunk/archetypes/pom.xml
===================================================================
--- branches/sandbox/rf4_build/cdk/trunk/archetypes/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/cdk/trunk/archetypes/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.cdk</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>maven-archetypes</artifactId>
<packaging>pom</packaging>
Modified: branches/sandbox/rf4_build/cdk/trunk/plugins/maven-cdk-plugin/pom.xml
===================================================================
--- branches/sandbox/rf4_build/cdk/trunk/plugins/maven-cdk-plugin/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/cdk/trunk/plugins/maven-cdk-plugin/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,6 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
<packaging>maven-plugin</packaging>
Modified: branches/sandbox/rf4_build/cdk/trunk/plugins/pom.xml
===================================================================
--- branches/sandbox/rf4_build/cdk/trunk/plugins/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/cdk/trunk/plugins/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.cdk</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>maven-plugins</artifactId>
<packaging>pom</packaging>
Modified: branches/sandbox/rf4_build/docs/trunk/commons/highlight/pom.xml
===================================================================
--- branches/sandbox/rf4_build/docs/trunk/commons/highlight/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/docs/trunk/commons/highlight/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.docs.commons</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>highlight</artifactId>
<dependencies>
Modified: branches/sandbox/rf4_build/docs/trunk/commons/pom.xml
===================================================================
--- branches/sandbox/rf4_build/docs/trunk/commons/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/docs/trunk/commons/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.docs</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>commons</artifactId>
<packaging>pom</packaging>
Modified: branches/sandbox/rf4_build/docs/trunk/commons/resources/en/pom.xml
===================================================================
--- branches/sandbox/rf4_build/docs/trunk/commons/resources/en/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/docs/trunk/commons/resources/en/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.docs.commons.resources</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>en</artifactId>
Modified: branches/sandbox/rf4_build/docs/trunk/commons/resources/pom.xml
===================================================================
--- branches/sandbox/rf4_build/docs/trunk/commons/resources/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/docs/trunk/commons/resources/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.docs.commons</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>resources</artifactId>
<packaging>pom</packaging>
Modified: branches/sandbox/rf4_build/docs/trunk/guides/pom.xml
===================================================================
--- branches/sandbox/rf4_build/docs/trunk/guides/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/docs/trunk/guides/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.docs</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>guides</artifactId>
<packaging>pom</packaging>
Modified: branches/sandbox/rf4_build/docs/trunk/guides/testguide/en/pom.xml
===================================================================
--- branches/sandbox/rf4_build/docs/trunk/guides/testguide/en/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/docs/trunk/guides/testguide/en/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.docs.guides.testguide</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>en</artifactId>
<packaging>jar</packaging>
Modified: branches/sandbox/rf4_build/docs/trunk/guides/testguide/pom.xml
===================================================================
--- branches/sandbox/rf4_build/docs/trunk/guides/testguide/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/docs/trunk/guides/testguide/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.docs.guides</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>testguide</artifactId>
<packaging>pom</packaging>
Modified: branches/sandbox/rf4_build/examples/trunk/components/calendar-demo/pom.xml
===================================================================
--- branches/sandbox/rf4_build/examples/trunk/components/calendar-demo/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/examples/trunk/components/calendar-demo/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.examples.components</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>${example.componentName}-demo</artifactId>
<packaging>war</packaging>
Modified: branches/sandbox/rf4_build/examples/trunk/components/panel-demo/pom.xml
===================================================================
--- branches/sandbox/rf4_build/examples/trunk/components/panel-demo/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/examples/trunk/components/panel-demo/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.examples.components</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>${example.componentName}-demo</artifactId>
<packaging>war</packaging>
Modified: branches/sandbox/rf4_build/examples/trunk/components/pom.xml
===================================================================
--- branches/sandbox/rf4_build/examples/trunk/components/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/examples/trunk/components/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.examples</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>components</artifactId>
<packaging>pom</packaging>
Modified: branches/sandbox/rf4_build/examples/trunk/components/tree-demo/pom.xml
===================================================================
--- branches/sandbox/rf4_build/examples/trunk/components/tree-demo/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/examples/trunk/components/tree-demo/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.examples.components</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>${example.componentName}-demo</artifactId>
<packaging>war</packaging>
Modified: branches/sandbox/rf4_build/examples/trunk/photoalbum/pom.xml
===================================================================
--- branches/sandbox/rf4_build/examples/trunk/photoalbum/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/examples/trunk/photoalbum/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.examples</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>photoalbum</artifactId>
<packaging>ear</packaging>
Modified: branches/sandbox/rf4_build/examples/trunk/richfaces-demo/pom.xml
===================================================================
--- branches/sandbox/rf4_build/examples/trunk/richfaces-demo/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/examples/trunk/richfaces-demo/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.examples</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>richfaces-demo</artifactId>
<packaging>war</packaging>
Modified: branches/sandbox/rf4_build/framework/trunk/api/pom.xml
===================================================================
--- branches/sandbox/rf4_build/framework/trunk/api/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/framework/trunk/api/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.framework</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>richfaces-api</artifactId>
</project>
\ No newline at end of file
Modified: branches/sandbox/rf4_build/framework/trunk/impl/pom.xml
===================================================================
--- branches/sandbox/rf4_build/framework/trunk/impl/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/framework/trunk/impl/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.framework</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>richfaces-impl</artifactId>
<dependencies>
Modified: branches/sandbox/rf4_build/framework/trunk/test-base/pom.xml
===================================================================
--- branches/sandbox/rf4_build/framework/trunk/test-base/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/framework/trunk/test-base/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.framework</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>richfaces-test-base</artifactId>
<packaging>jar</packaging>
Modified: branches/sandbox/rf4_build/ui/trunk/components/calendar/pom.xml
===================================================================
--- branches/sandbox/rf4_build/ui/trunk/components/calendar/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/ui/trunk/components/calendar/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.ui.components</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>calendar</artifactId>
<packaging>pom</packaging>
Modified: branches/sandbox/rf4_build/ui/trunk/components/panel/pom.xml
===================================================================
--- branches/sandbox/rf4_build/ui/trunk/components/panel/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/ui/trunk/components/panel/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.ui.components</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>panel-ui</artifactId>
<packaging>jar</packaging>
Modified: branches/sandbox/rf4_build/ui/trunk/components/pom.xml
===================================================================
--- branches/sandbox/rf4_build/ui/trunk/components/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/ui/trunk/components/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -1,24 +1,21 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
- http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <parent>
- <groupId>org.richfaces</groupId>
- <artifactId>ui</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>components</artifactId>
- <packaging>pom</packaging>
-
- <modules>
- <module>panel</module>
- <module>tree</module>
- <module>calendar</module>
- </modules>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>ui</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>components</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>panel</module>
+ <module>tree</module>
+ <module>calendar</module>
+ </modules>
+
</project>
\ No newline at end of file
Modified: branches/sandbox/rf4_build/ui/trunk/components/tree/pom.xml
===================================================================
--- branches/sandbox/rf4_build/ui/trunk/components/tree/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/ui/trunk/components/tree/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.ui.components</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>tree</artifactId>
<packaging>pom</packaging>
Modified: branches/sandbox/rf4_build/ui/trunk/skins/pom.xml
===================================================================
--- branches/sandbox/rf4_build/ui/trunk/skins/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/ui/trunk/skins/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.ui</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>skins</artifactId>
<packaging>pom</packaging>
Modified: branches/sandbox/rf4_build/ui/trunk/themes/pom.xml
===================================================================
--- branches/sandbox/rf4_build/ui/trunk/themes/pom.xml 2009-06-10 14:15:43 UTC (rev 14581)
+++ branches/sandbox/rf4_build/ui/trunk/themes/pom.xml 2009-06-10 14:30:51 UTC (rev 14582)
@@ -11,7 +11,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.ui</groupId>
+ <groupId>${parent.groupId}.${parent.artifactId}</groupId>
<artifactId>themes</artifactId>
<packaging>pom</packaging>
17 years, 1 month
JBoss Rich Faces SVN: r14581 - in branches/community/3.3.X/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-06-10 10:15:43 -0400 (Wed, 10 Jun 2009)
New Revision: 14581
Modified:
branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/main/webapp/pages/componentControl/componentControlWithDisabledDefault.xhtml
branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComponentControlTest.java
Log:
rich:componentControl: disableDefault attribute not work
https://jira.jboss.org/jira/browse/RF-5607
Modified: branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/main/webapp/pages/componentControl/componentControlWithDisabledDefault.xhtml
===================================================================
(Binary files differ)
Modified: branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComponentControlTest.java
===================================================================
--- branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComponentControlTest.java 2009-06-10 13:40:11 UTC (rev 14580)
+++ branches/community/3.3.X/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComponentControlTest.java 2009-06-10 14:15:43 UTC (rev 14581)
@@ -114,7 +114,6 @@
renderPage(template);
initIds(getParentId());
-
//check operations show and hide for modal panel working
asserPanel(false);
clickById(panelShowLinkId);
@@ -129,10 +128,8 @@
}
}
- @Test(groups=FAILURES_GROUP)
+ @Test
public void testDisableDefaultAttribute(Template template) {
- //Not working: https://jira.jboss.org/jira/browse/RF-5607 - waiting for fix
-
renderPage(TEST_COMPONENT_CONTROL_WITH_DISABLE_DEFAULT, template, null);
initIds(getParentId());
@@ -140,13 +137,13 @@
//attach to in same naming container
asserPanel(false);
- clickCommandAndWait(panelShowLinkId);
+ clickById(panelShowLinkId);
asserPanel(true);
clickById(panelHideLinkId);
//attach to in another naming container
asserPanel(false);
- clickCommandAndWait(panelSecondShowLinkId);
+ clickById(panelSecondShowLinkId);
asserPanel(true);
clickById(panelHideLinkId);
}
17 years, 1 month
JBoss Rich Faces SVN: r14580 - in branches/community/3.3.X/ui/inputnumber-spinner/src: test/java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-06-10 09:40:11 -0400 (Wed, 10 Jun 2009)
New Revision: 14580
Modified:
branches/community/3.3.X/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
branches/community/3.3.X/ui/inputnumber-spinner/src/test/java/org/richfaces/component/InputNumberSpinnerComponentTest.java
Log:
https://jira.jboss.org/jira/browse/RF-7360
Modified: branches/community/3.3.X/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
===================================================================
--- branches/community/3.3.X/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2009-06-10 12:59:52 UTC (rev 14579)
+++ branches/community/3.3.X/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2009-06-10 13:40:11 UTC (rev 14580)
@@ -79,12 +79,12 @@
<input
type="image"
src="#{up_arrow}"
- class="rich-spinner-btn"
+ class="rich-spinner-btn rich-spinner-button"
style="border:0"
onclick="return false"
- onmousedown="this.className='rich-spinner-btn-press'"
- onmouseup="this.className='rich-spinner-btn'"
- onmouseout="this.className='rich-spinner-btn'"
+ onmousedown="this.className='rich-spinner-btn-press rich-spinner-button'"
+ onmouseup="this.className='rich-spinner-btn rich-spinner-button'"
+ onmouseout="this.className='rich-spinner-btn rich-spinner-button'"
tabindex="#{component.attributes['tabindex']}" />
<jsp:scriptlet><![CDATA[
} else {
@@ -92,7 +92,7 @@
<input
type="image"
src="#{up_arrow}"
- class="rich-spinner-btn"
+ class="rich-spinner-btn rich-spinner-button"
style="border:0"
onclick="return false"
tabindex="#{component.attributes['tabindex']}" />
@@ -106,12 +106,12 @@
<jsp:scriptlet><![CDATA[
if (! disabled) {
]]></jsp:scriptlet>
- <input type="image" src="#{down_arrow}" class="rich-spinner-btn" style="border:0" onclick="return false"
- onmousedown="this.className='rich-spinner-btn-press'" onmouseup="this.className='rich-spinner-btn'" onmouseout="this.className='rich-spinner-btn'" />
+ <input type="image" src="#{down_arrow}" class="rich-spinner-btn rich-spinner-button" style="border:0" onclick="return false"
+ onmousedown="this.className='rich-spinner-btn-press rich-spinner-button'" onmouseup="this.className='rich-spinner-btn rich-spinner-button'" onmouseout="this.className='rich-spinner-btn rich-spinner-button'" />
<jsp:scriptlet><![CDATA[
} else {
]]></jsp:scriptlet>
- <input type="image" src="#{down_arrow}" class="rich-spinner-btn" style="border:0" onclick="return false" />
+ <input type="image" src="#{down_arrow}" class="rich-spinner-btn rich-spinner-button" style="border:0" onclick="return false" />
<jsp:scriptlet><![CDATA[
}
]]></jsp:scriptlet>
Modified: branches/community/3.3.X/ui/inputnumber-spinner/src/test/java/org/richfaces/component/InputNumberSpinnerComponentTest.java
===================================================================
--- branches/community/3.3.X/ui/inputnumber-spinner/src/test/java/org/richfaces/component/InputNumberSpinnerComponentTest.java 2009-06-10 12:59:52 UTC (rev 14579)
+++ branches/community/3.3.X/ui/inputnumber-spinner/src/test/java/org/richfaces/component/InputNumberSpinnerComponentTest.java 2009-06-10 13:40:11 UTC (rev 14580)
@@ -144,7 +144,7 @@
HtmlInput child = (HtmlInput) iter.next();
assertTrue(child.getTypeAttribute().equals("image"));
assertTrue(child.getAttributeValue("class").contains(
- "rich-spinner-btn"));
+ "rich-spinner-btn rich-spinner-button"));
}
}
17 years, 1 month
JBoss Rich Faces SVN: r14579 - in branches/community/3.3.X/ui/simpleTogglePanel/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-06-10 08:59:52 -0400 (Wed, 10 Jun 2009)
New Revision: 14579
Modified:
branches/community/3.3.X/ui/simpleTogglePanel/src/main/resources/org/richfaces/renderkit/html/css/simpleTogglePanel.xcss
branches/community/3.3.X/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx
Log:
https://jira.jboss.org/jira/browse/RF-7360
Modified: branches/community/3.3.X/ui/simpleTogglePanel/src/main/resources/org/richfaces/renderkit/html/css/simpleTogglePanel.xcss
===================================================================
--- branches/community/3.3.X/ui/simpleTogglePanel/src/main/resources/org/richfaces/renderkit/html/css/simpleTogglePanel.xcss 2009-06-10 12:07:54 UTC (rev 14578)
+++ branches/community/3.3.X/ui/simpleTogglePanel/src/main/resources/org/richfaces/renderkit/html/css/simpleTogglePanel.xcss 2009-06-10 12:59:52 UTC (rev 14579)
@@ -12,7 +12,7 @@
background-repeat : no-repeat;
}
-.rich-stglpanel-marker-open, .rich-stglpanel-marker-close {
+.rich-stglpnl-marker {
padding-right: 3px;
}
Modified: branches/community/3.3.X/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx
===================================================================
--- branches/community/3.3.X/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx 2009-06-10 12:07:54 UTC (rev 14578)
+++ branches/community/3.3.X/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx 2009-06-10 12:59:52 UTC (rev 14579)
@@ -40,7 +40,7 @@
onclick="#{this:getOnClick(context,component)}">
<div class="rich-stglpanel-marker">
- <div id="#{clientId}_switch_on" style="display: #{this:getSwitchOnStatus(context, component)};" class="rich-stglpanel-marker-close">
+ <div id="#{clientId}_switch_on" style="display: #{this:getSwitchOnStatus(context, component)};" class="rich-stglpnl-marker">
<jsp:scriptlet><![CDATA[
if(component.getFacet("closeMarker")!=null && component.getFacet("closeMarker").isRendered()) {
]]></jsp:scriptlet>
@@ -52,7 +52,7 @@
]]></jsp:scriptlet>
</div>
<div id="#{clientId}_switch_off"
- style="display: #{this:getSwitchOffStatus(context, component)};" class="rich-stglpanel-marker-open">
+ style="display: #{this:getSwitchOffStatus(context, component)};" class="rich-stglpnl-marker">
<jsp:scriptlet><![CDATA[
if(component.getFacet("openMarker")!=null && component.getFacet("openMarker").isRendered()) {
]]></jsp:scriptlet>
17 years, 1 month
JBoss Rich Faces SVN: r14578 - in branches/community/3.3.X/ui/togglePanel/src: main/templates and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-06-10 08:07:54 -0400 (Wed, 10 Jun 2009)
New Revision: 14578
Modified:
branches/community/3.3.X/ui/togglePanel/src/main/resources/org/richfaces/renderkit/html/css/toggleControl.xcss
branches/community/3.3.X/ui/togglePanel/src/main/templates/toggleControl.jspx
branches/community/3.3.X/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java
Log:
https://jira.jboss.org/jira/browse/RF-7360
Modified: branches/community/3.3.X/ui/togglePanel/src/main/resources/org/richfaces/renderkit/html/css/toggleControl.xcss
===================================================================
--- branches/community/3.3.X/ui/togglePanel/src/main/resources/org/richfaces/renderkit/html/css/toggleControl.xcss 2009-06-10 09:06:32 UTC (rev 14577)
+++ branches/community/3.3.X/ui/togglePanel/src/main/resources/org/richfaces/renderkit/html/css/toggleControl.xcss 2009-06-10 12:07:54 UTC (rev 14578)
@@ -3,7 +3,7 @@
xmlns:u='http:/jsf.exadel.com/template/util'
xmlns="http://www.w3.org/1999/xhtml" >
<f:verbatim><![CDATA[
- .rich-toggle-ctrl{
+ .rich-tglctrl{
}
Modified: branches/community/3.3.X/ui/togglePanel/src/main/templates/toggleControl.jspx
===================================================================
--- branches/community/3.3.X/ui/togglePanel/src/main/templates/toggleControl.jspx 2009-06-10 09:06:32 UTC (rev 14577)
+++ branches/community/3.3.X/ui/togglePanel/src/main/templates/toggleControl.jspx 2009-06-10 12:07:54 UTC (rev 14578)
@@ -20,7 +20,7 @@
x:passThruWithExclusions="id,href,name,onclick,class"
onclick="#{this:getOnClick(context,component)}; return false;"
- class="rich-toggle-ctrl #{component.attributes['styleClass']}"
+ class="rich-tglctrl #{component.attributes['styleClass']}"
>#{component.attributes['value']}
<vcp:body>
<f:call name="renderChildren" />
Modified: branches/community/3.3.X/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java
===================================================================
--- branches/community/3.3.X/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java 2009-06-10 09:06:32 UTC (rev 14577)
+++ branches/community/3.3.X/ui/togglePanel/src/test/java/org/richfaces/component/TogglePanelComponentTest.java 2009-06-10 12:07:54 UTC (rev 14578)
@@ -148,14 +148,14 @@
HtmlElement div = page.getHtmlElementById(togglePanel
.getClientId(facesContext));
String classAttr0 = div.getAttributeValue("class");
- assertTrue(classAttr0.contains("rich-toggle-panel"));
+ assertTrue(classAttr0.contains("rich-tglctrl"));
assertNotNull(div);
assertEquals("div", div.getNodeName());
HtmlElement div_control = page.getHtmlElementById(toggleControl
.getClientId(facesContext));
String classAttr = div_control.getAttributeValue("class");
- assertTrue(classAttr.contains("rich-toggle-ctrl"));
+ assertTrue(classAttr.contains("rich-tglctrl"));
}
/**
17 years, 1 month
JBoss Rich Faces SVN: r14577 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: ochikvina
Date: 2009-06-10 05:06:32 -0400 (Wed, 10 Jun 2009)
New Revision: 14577
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_page.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/ajaxListener.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/calendar.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/column.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/columnGroup.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/columns.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/contextMenu.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataFilterSlider.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataGrid.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataTable.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/datascroller.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dndParam.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragIndicator.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragListener.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragSupport.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dropListener.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dropSupport.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/effect.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/fileUpload.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/gmap.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/graphValidator.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inplaceInput.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/insert.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jQuery.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/layout.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/layoutPanel.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/listShuttle.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/mediaOutput.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuGroup.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuItem.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuSeparator.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/message.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/messages.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/modalPanel.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/orderingList.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/outputPanel.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/paint2D.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panel.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelBar.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelBarItem.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenu.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/pickList.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/portlet.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/progressBar.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/push.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/queue.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/region.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_page.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/spacer.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/status.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/subTable.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/support.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tab.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tabPanel.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toggleControl.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/togglePanel.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolBar.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolBarGroup.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolTip.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tree.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/treeNode.xml
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/virtualEarth.xml
Log:
https://jira.jboss.org/jira/browse/RF-5117 - formatting code samples;
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_page.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_page.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/a4j_page.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -43,9 +43,9 @@
<programlisting role="XML"><![CDATA[<f:view>
<a4j:page>
<f:facet name="head">
- <!--...Head Content here-->
+ <!--Head Content here-->
</f:facet>
- <!--...Page Content here-->
+ <!--Page Content here-->
</a4j:page>
</f:view>]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/ajaxListener.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/ajaxListener.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/ajaxListener.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -112,11 +112,11 @@
import org.ajax4jsf.event.AjaxEvent;
public class Bean implements org.ajax4jsf.event.AjaxListener{
-...
- public void processAjax(AjaxEvent arg){
- //Custom Developer Code
- }
-...
+ ...
+ public void processAjax(AjaxEvent arg){
+ //Custom Developer Code
+ }
+ ...
}]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/calendar.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/calendar.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/calendar.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -62,7 +62,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:calendar popup="false"/>
+<rich:calendar popup="false"/>
...]]></programlisting>
</section>
@@ -449,13 +449,13 @@
text-align:center;
}
</style>
- ...]]></programlisting>
+...]]></programlisting>
<programlisting role="XML"><![CDATA[...
<rich:calendar id="myCalendar" popup="true" locale="#{calendarBean.locale}" value="#{bean.date}"
preloadRangeBegin="#{bean.date}" preloadRangeEnd="#{bean.date}" cellWidth="40px" cellHeight="40px">
-<!-- Customization with usage of facets and accessible elements -->
+ <!-- Customization with usage of facets and accessible elements -->
<f:facet name="header">
<h:panelGrid columns="2" width="100%" columnClasses="width100, fake">
<h:outputText value="{selectedDateControl}" />
@@ -547,12 +547,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:calendar value="#{calendarBean.selectedDate}" id="calendarID"
+<rich:calendar value="#{calendarBean.selectedDate}" id="calendarID"
locale="#{calendarBean.locale}"
popup="#{calendarBean.popup}"
datePattern="#{calendarBean.pattern}"
showApplyButton="#{calendarBean.showApply}" style="width:200px"/>
- <a4j:commandLink onclick="$('formID:calendarID').component.doExpand(event)" value="Expand"/>
+<a4j:commandLink onclick="$('formID:calendarID').component.doExpand(event)" value="Expand"/>
...]]></programlisting>
<para>Also the discussion about this problem can be found on the <ulink
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/changeExpandListener.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -43,7 +43,7 @@
</para>
<programlisting role="XML"><![CDATA[...
- <rich:changeExpandListener type="demo.Bean"/>
+<rich:changeExpandListener type="demo.Bean"/>
...
]]></programlisting>
</section>
@@ -99,11 +99,11 @@
<programlisting role="JAVA"><![CDATA[package demo;
import org.richfaces.event.NodeExpandedEvent;
public class ListenerBean implements org.richfaces.event.NodeExpandedListener{
-...
+ ...
public void processExpansion(NodeExpandedEvent arg0){
//Custom Developer Code
}
-...
+ ...
}
...]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/column.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/column.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/column.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,12 +50,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable var="set">
- <rich:column>
- <h:outputText value="#{set.property1}"/>
- </rich:column>
- <!--Set of another columns and header/footer facets-->
- </rich:dataTable>
+<rich:dataTable var="set">
+ <rich:column>
+ <h:outputText value="#{set.property1}"/>
+ </rich:column>
+ <!--Set of another columns and header/footer facets-->
+</rich:dataTable>
...
]]></programlisting>
</section>
@@ -84,24 +84,24 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
- <rich:column>
- <f:facet name="header">State Flag</f:facet>
- <h:graphicImage value="#{cap.stateFlag}"/>
- </rich:column>
- <rich:column>
- <f:facet name="header">State Name</f:facet>
- <h:outputText value="#{cap.state}"/>
- </rich:column>
- <rich:column >
- <f:facet name="header">State Capital</f:facet>
- <h:outputText value="#{cap.name}"/>
- </rich:column>
- <rich:column>
- <f:facet name="header">Time Zone</f:facet>
- <h:outputText value="#{cap.timeZone}"/>
- </rich:column>
- </rich:dataTable>
+<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
+ <rich:column>
+ <f:facet name="header">State Flag</f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">State Name</f:facet>
+ <h:outputText value="#{cap.state}"/>
+ </rich:column>
+ <rich:column >
+ <f:facet name="header">State Capital</f:facet>
+ <h:outputText value="#{cap.name}"/>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Time Zone</f:facet>
+ <h:outputText value="#{cap.timeZone}"/>
+ </rich:column>
+</rich:dataTable>
...
]]></programlisting>
<para>The result is:</para>
@@ -128,20 +128,20 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
- <rich:column colspan="3">
- <h:graphicImage value="#{cap.stateFlag}"/>
- </rich:column>
- <rich:column breakBefore="true">
- <h:outputText value="#{cap.state}"/>
- </rich:column>
- <rich:column >
- <h:outputText value="#{cap.name}"/>
- </rich:column>
- <rich:column>
- <h:outputText value="#{cap.timeZone}"/>
- </rich:column>
- </rich:dataTable>
+<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
+ <rich:column colspan="3">
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{cap.state}"/>
+ </rich:column>
+ <rich:column >
+ <h:outputText value="#{cap.name}"/>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{cap.timeZone}"/>
+ </rich:column>
+</rich:dataTable>
...
]]></programlisting>
<para>As a result the following structure is rendered:</para>
@@ -170,22 +170,22 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
- <rich:column rowspan="3">
- <f:facet name="header">State Flag</f:facet>
- <h:graphicImage value="#{cap.stateFlag}"/>
- </rich:column>
- <rich:column>
- <f:facet name="header">State Info</f:facet>
- <h:outputText value="#{cap.state}"/>
- </rich:column>
- <rich:column breakBefore="true">
- <h:outputText value="#{cap.name}"/>
- </rich:column>
- <rich:column breakBefore="true">
- <h:outputText value="#{cap.timeZone}"/>
- </rich:column>
- </rich:dataTable>
+<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
+ <rich:column rowspan="3">
+ <f:facet name="header">State Flag</f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">State Info</f:facet>
+ <h:outputText value="#{cap.state}"/>
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{cap.name}"/>
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{cap.timeZone}"/>
+ </rich:column>
+</rich:dataTable>
...
]]></programlisting>
<para>As a result:</para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/columnGroup.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/columnGroup.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/columnGroup.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -47,14 +47,14 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:columnGroup>
- <rich:column>
- <h:outputText value="Column1"/>
- </rich:column>
- <rich:column>
- <h:outputText value="Column2"/>
- </rich:column>
- </rich:columnGroup>
+<rich:columnGroup>
+ <rich:column>
+ <h:outputText value="Column1"/>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Column2"/>
+ </rich:column>
+</rich:columnGroup>
...
]]></programlisting>
</section>
@@ -81,23 +81,23 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5" id="sublist">
- <rich:column colspan="3">
- <f:facet name="header">State Flag</f:facet>
- <h:graphicImage value="#{cap.stateFlag}"/>
- </rich:column>
- <rich:columnGroup>
- <rich:column>
- <h:outputText value="#{cap.state}"/>
- </rich:column>
- <rich:column >
- <h:outputText value="#{cap.name}"/>
- </rich:column>
- <rich:column >
- <h:outputText value="#{cap.timeZone}"/>
- </rich:column>
- </rich:columnGroup>
- </rich:dataTable>
+<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5" id="sublist">
+ <rich:column colspan="3">
+ <f:facet name="header">State Flag</f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ </rich:column>
+ <rich:columnGroup>
+ <rich:column>
+ <h:outputText value="#{cap.state}"/>
+ </rich:column>
+ <rich:column >
+ <h:outputText value="#{cap.name}"/>
+ </rich:column>
+ <rich:column >
+ <h:outputText value="#{cap.timeZone}"/>
+ </rich:column>
+ </rich:columnGroup>
+</rich:dataTable>
...
]]></programlisting>
<para>And representation without a grouping:</para>
@@ -106,21 +106,21 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5" id="sublist">
- <rich:column colspan="3">
- <f:facet name="header">State Flag</f:facet>
- <h:graphicImage value="#{cap.stateFlag}"/>
- </rich:column>
- <rich:column breakBefore="true">
- <h:outputText value="#{cap.state}"/>
- </rich:column>
- <rich:column breakBefore="true">
- <h:outputText value="#{cap.name}"/>
- </rich:column>
- <rich:column >
- <h:outputText value="#{cap.timeZone}"/>
- </rich:column>
- </rich:dataTable>
+<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5" id="sublist">
+ <rich:column colspan="3">
+ <f:facet name="header">State Flag</f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{cap.state}"/>
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{cap.name}"/>
+ </rich:column>
+ <rich:column >
+ <h:outputText value="#{cap.timeZone}"/>
+ </rich:column>
+</rich:dataTable>
....
]]></programlisting>
<para>The result is:</para>
@@ -140,25 +140,25 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <f:facet name="header">
- <rich:columnGroup>
- <rich:column rowspan="2">
- <h:outputText value="State Flag"/>
- </rich:column>
- <rich:column colspan="3">
- <h:outputText value="State Info"/>
- </rich:column>
- <rich:column breakBefore="true">
- <h:outputText value="State Name"/>
- </rich:column>
- <rich:column>
- <h:outputText value="State Capital"/>
- </rich:column>
- <rich:column>
- <h:outputText value="Time Zone"/>
- </rich:column>
- </rich:columnGroup>
- </f:facet>
+<f:facet name="header">
+ <rich:columnGroup>
+ <rich:column rowspan="2">
+ <h:outputText value="State Flag"/>
+ </rich:column>
+ <rich:column colspan="3">
+ <h:outputText value="State Info"/>
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="State Name"/>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="State Capital"/>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Time Zone"/>
+ </rich:column>
+ </rich:columnGroup>
+</f:facet>
...
]]></programlisting>
<para>Generated on a page as:</para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/columns.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/columns.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/columns.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -176,27 +176,27 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:dataTable value="#{dataTableScrollerBean.model}" var="model" width="500px" rows="5">
- <f:facet name="header">
- <h:outputText value="Cars Available"></h:outputText>
- </f:facet>
- <rich:columns value="#{dataTableScrollerBean.columns}" var="columns" index="ind">
- <f:facet name="header">
- <h:outputText value="#{columns.header}" />
- </f:facet>
- <h:outputText value="#{model[ind].model} " />
- </rich:columns>
- <rich:column>
<f:facet name="header">
- <h:outputText value="Price" />
+ <h:outputText value="Cars Available"></h:outputText>
</f:facet>
- <h:outputText value="Price" />
- </rich:column>
- <rich:columns value="#{dataTableScrollerBean.columns}" var="columns" index="ind">
- <f:facet name="header">
- <h:outputText value="#{columns.header}" />
- </f:facet>
- <h:outputText value="#{model[ind].mileage}$" />
- </rich:columns>
+ <rich:columns value="#{dataTableScrollerBean.columns}" var="columns" index="ind">
+ <f:facet name="header">
+ <h:outputText value="#{columns.header}" />
+ </f:facet>
+ <h:outputText value="#{model[ind].model} " />
+ </rich:columns>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Price" />
+ </f:facet>
+ <h:outputText value="Price" />
+ </rich:column>
+ <rich:columns value="#{dataTableScrollerBean.columns}" var="columns" index="ind">
+ <f:facet name="header">
+ <h:outputText value="#{columns.header}" />
+ </f:facet>
+ <h:outputText value="#{model[ind].mileage}$" />
+ </rich:columns>
</rich:dataTable>
...]]>
</programlisting>
@@ -295,17 +295,17 @@
<para> This code calls the exception: </para>
<programlisting role="XML"><![CDATA[...
<rich:dataTable value="#{bean.data}" var="var">
- <rich:columns value="#{var.columns}">
- ...
- </rich:columns>
+ <rich:columns value="#{var.columns}">
+ ...
+ </rich:columns>
</rich:dataTable>
...]]></programlisting>
<para> This code works properly: </para>
<programlisting role="XML"><![CDATA[...
<c:forEach items="#{bean.data}" var="var">
- <rich:columns value="#{var.columns}">
- ...
- </rich:columns>
+ <rich:columns value="#{var.columns}">
+ ...
+ </rich:columns>
</c:forEach>
...]]></programlisting>
</note>
@@ -315,10 +315,10 @@
<para>Since 3.3.0GA <emphasis role="bold"><property><rich:columns></property></emphasis> requires explicit definition of <emphasis><property>"id"</property></emphasis> for children components to ensure that decode process works properly.
The example of how you can define unique <emphasis><property>"id"</property></emphasis> for children component: </para>
<programlisting role="XML"><![CDATA[...
-<rich:columns value="#{bean.columns}" var="col" index="ind" ....>
-<h:inputText id="input#{ind}" value="">
-<a4j:support id="support#{ind}" event="onchange" reRender="someId" />
-</h:inputText>
+<rich:columns value="#{bean.columns}" var="col" index="ind" ... >
+ <h:inputText id="input#{ind}" value="">
+ <a4j:support id="support#{ind}" event="onchange" reRender="someId" />
+ </h:inputText>
</rich:columns>
...]]></programlisting>
<para>Only if <emphasis><property>"id"</property></emphasis> defined as shown above Ajax after onchange event will be processed as expected. </para>
@@ -328,7 +328,7 @@
<para> Information about sorting and filtering you can find <link
- linkend="sortAndFilter"> in the corresponding section</link> . </para>
+ linkend="sortAndFilter"> in the corresponding section</link>. </para>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/contextMenu.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/contextMenu.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/contextMenu.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -99,35 +99,35 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:contextMenu event="oncontextmenu" attachTo="pic1" submitMode="none">
- <rich:menuItem value="Zoom In" onclick="enlarge();" id="zin"/>
- <rich:menuItem value="Zoom Out" onclick="decrease();" id="zout"/>
- </rich:contextMenu>
- <h:panelGrid columns="1" columnClasses="cent">
- <h:panelGroup id="picture">
- <h:graphicImage value="/richfaces/jQuery/images/pic1.png" id="pic"/>
- </h:panelGroup>
- </h:panelGrid>
- <h:panelGrid columns="1" columnClasses="cent">
- <h:panelGroup id="picture1">
- <h:graphicImage value="/richfaces/jQuery/images/pic2.png" id="pic1"/>
- </h:panelGroup>
- </h:panelGrid>
+<rich:contextMenu event="oncontextmenu" attachTo="pic1" submitMode="none">
+ <rich:menuItem value="Zoom In" onclick="enlarge();" id="zin"/>
+ <rich:menuItem value="Zoom Out" onclick="decrease();" id="zout"/>
+</rich:contextMenu>
+<h:panelGrid columns="1" columnClasses="cent">
+ <h:panelGroup id="picture">
+ <h:graphicImage value="/richfaces/jQuery/images/pic1.png" id="pic"/>
+ </h:panelGroup>
+</h:panelGrid>
+<h:panelGrid columns="1" columnClasses="cent">
+ <h:panelGroup id="picture1">
+ <h:graphicImage value="/richfaces/jQuery/images/pic2.png" id="pic1"/>
+ </h:panelGroup>
+</h:panelGrid>
...]]></programlisting>
<para>The <code>"enlarge()"</code> and
<code>"decrease()"</code> functions definition is placed
below.</para>
<programlisting role="JAVA"><![CDATA[...
- <script type="text/javascript">
- function enlarge(){
- document.getElementById('pic').width=document.getElementById('pic').width*1.1;
- document.getElementById('pic').height=document.getElementById('pic').height*1.1;
- }
- function decrease(){
- document.getElementById('pic').width=document.getElementById('pic').width*0.9;
- document.getElementById('pic').height=document.getElementById('pic').height*0.9;
- }
- </script>
+<script type="text/javascript">
+ function enlarge(){
+ document.getElementById('pic').width=document.getElementById('pic').width*1.1;
+ document.getElementById('pic').height=document.getElementById('pic').height*1.1;
+ }
+ function decrease(){
+ document.getElementById('pic').width=document.getElementById('pic').width*0.9;
+ document.getElementById('pic').height=document.getElementById('pic').height*0.9;
+ }
+</script>
...]]></programlisting>
<para>In the example a picture zooming possibility with <emphasis role="bold">
@@ -172,58 +172,58 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <h:form id="form">
- <rich:contextMenu attached="false" id="menu" submitMode="ajax">
- <rich:menuItem ajaxSingle="true">
- <b>{car} {model}</b> details
- <a4j:actionparam name="det" assignTo="#{ddmenu.current}" value="{car} {model} details"/>
- </rich:menuItem>
- <rich:menuGroup value="Actions">
- <rich:menuItem ajaxSingle="true">
- Put <b>{car} {model}</b> To Basket
- <a4j:actionparam name="bask" assignTo="#{ddmenu.current}" value="Put {car} {model} To Basket"/>
- </rich:menuItem>
- <rich:menuItem value="Read Comments" ajaxSingle="true">
- <a4j:actionparam name="bask" assignTo="#{ddmenu.current}" value="Read Comments"/>
- </rich:menuItem>
- <rich:menuItem ajaxSingle="true">
- Go to <b>{car}</b> site
- <a4j:actionparam name="bask" assignTo="#{ddmenu.current}" value="Go to {car} site"/>
- </rich:menuItem>
- </rich:menuGroup>
- </rich:contextMenu>
+<h:form id="form">
+ <rich:contextMenu attached="false" id="menu" submitMode="ajax">
+ <rich:menuItem ajaxSingle="true">
+ <b>{car} {model}</b> details
+ <a4j:actionparam name="det" assignTo="#{ddmenu.current}" value="{car} {model} details"/>
+ </rich:menuItem>
+ <rich:menuGroup value="Actions">
+ <rich:menuItem ajaxSingle="true">
+ Put <b>{car} {model}</b> To Basket
+ <a4j:actionparam name="bask" assignTo="#{ddmenu.current}" value="Put {car} {model} To Basket"/>
+ </rich:menuItem>
+ <rich:menuItem value="Read Comments" ajaxSingle="true">
+ <a4j:actionparam name="bask" assignTo="#{ddmenu.current}" value="Read Comments"/>
+ </rich:menuItem>
+ <rich:menuItem ajaxSingle="true">
+ Go to <b>{car}</b> site
+ <a4j:actionparam name="bask" assignTo="#{ddmenu.current}" value="Go to {car} site"/>
+ </rich:menuItem>
+ </rich:menuGroup>
+ </rich:contextMenu>
- <h:panelGrid columns="2">
- <rich:dataTable value="#{dataTableScrollerBean.tenRandomCars}" var="car" id="table"
+ <h:panelGrid columns="2">
+ <rich:dataTable value="#{dataTableScrollerBean.tenRandomCars}" var="car" id="table"
onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" rowClasses="cur">
- <rich:column>
- <f:facet name="header">Make</f:facet>
- <h:outputText value="#{car.make}"/>
- </rich:column>
- <rich:column>
- <f:facet name="header">Model</f:facet>
- <h:outputText value="#{car.model}"/>
- </rich:column>
- <rich:column>
- <f:facet name="header">Price</f:facet>
- <h:outputText value="#{car.price}" />
- </rich:column>
+ <rich:column>
+ <f:facet name="header">Make</f:facet>
+ <h:outputText value="#{car.make}"/>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Model</f:facet>
+ <h:outputText value="#{car.model}"/>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Price</f:facet>
+ <h:outputText value="#{car.price}" />
+ </rich:column>
- <rich:componentControl event="onRowClick" for="menu" operation="show">
- <f:param value="#{car.model}" name="model"/>
- <f:param value="#{car.make}" name="car"/>
- </rich:componentControl>
- </rich:dataTable>
+ <rich:componentControl event="onRowClick" for="menu" operation="show">
+ <f:param value="#{car.model}" name="model"/>
+ <f:param value="#{car.make}" name="car"/>
+ </rich:componentControl>
+ </rich:dataTable>
- <a4j:outputPanel ajaxRendered="true">
- <rich:panel>
- <f:facet name="header">Last Menu Action</f:facet>
- <h:outputText value="#{ddmenu.current}"></h:outputText>
- </rich:panel>
- </a4j:outputPanel>
- </h:panelGrid>
- </h:form>
+ <a4j:outputPanel ajaxRendered="true">
+ <rich:panel>
+ <f:facet name="header">Last Menu Action</f:facet>
+ <h:outputText value="#{ddmenu.current}"></h:outputText>
+ </rich:panel>
+ </a4j:outputPanel>
+ </h:panelGrid>
+ </h:form>
...]]></programlisting>
<para>This is a result:</para>
<figure>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -49,10 +49,10 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataDefinitionList value="#{bean.capitals}" var="caps">
- <f:facet name="term">Cars</f:facet>
- <h:outputText value="#{car.model}"/>
- </rich:dataDefinitionList>
+<rich:dataDefinitionList value="#{bean.capitals}" var="caps">
+ <f:facet name="term">Cars</f:facet>
+ <h:outputText value="#{car.model}"/>
+</rich:dataDefinitionList>
...
]]></programlisting>
</section>
@@ -84,17 +84,17 @@
<para>Here is an example:</para>
<programlisting role="XML"><![CDATA[...
- <h:form>
- <rich:dataDefinitionList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" first="4" title="Cars">
- <f:facet name="term">
- <h:outputText value="#{car.make} #{car.model}"></h:outputText>
- </f:facet>
- <h:outputText value="Price:" styleClass="label"></h:outputText>
- <h:outputText value="#{car.price}" /><br/>
- <h:outputText value="Mileage:" styleClass="label"></h:outputText>
- <h:outputText value="#{car.mileage}" /><br/>
- </rich:dataDefinitionList>
- </h:form>
+<h:form>
+ <rich:dataDefinitionList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" first="4" title="Cars">
+ <f:facet name="term">
+ <h:outputText value="#{car.make} #{car.model}"></h:outputText>
+ </f:facet>
+ <h:outputText value="Price:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.price}" /><br/>
+ <h:outputText value="Mileage:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.mileage}" /><br/>
+ </rich:dataDefinitionList>
+</h:form>
...
]]></programlisting>
@@ -134,12 +134,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataDefinitionList value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
+<rich:dataDefinitionList value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
binding="#{listBean.dataList}" id="list">
- ...
- </rich:dataDefinitionList>
+ ...
+</rich:dataDefinitionList>
...
- <a4j:commandButton action="#{listBean.action}" reRender="list" value="Submit"/>
+<a4j:commandButton action="#{listBean.action}" reRender="list" value="Submit"/>
...
]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataFilterSlider.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataFilterSlider.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataFilterSlider.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -48,7 +48,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataFilterSlider sliderListener="#{mybean.doSlide}" startRange="0"
+<rich:dataFilterSlider sliderListener="#{mybean.doSlide}" startRange="0"
endRange="50000" increment="10000" handleValue="1" />
...]]></programlisting>
</section>
@@ -74,7 +74,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataFilterSlider sliderListener="#{mybean.doSlide}"
+<rich:dataFilterSlider sliderListener="#{mybean.doSlide}"
startRange="0"
endRange="50000"
increment="10000"
@@ -83,9 +83,9 @@
forValRef="inventoryList.carInventory"
filterBy="getMileage" />
...
- <h:dataTable id="carIndex">
- ...
- </h:dataTable>
+<h:dataTable id="carIndex">
+ ...
+</h:dataTable>
...]]></programlisting>
<para>In this example other two attributes are used for filtering:</para>
<itemizedlist>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataGrid.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataGrid.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataGrid.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -51,9 +51,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car">
- <h:outputText value="#{car.model}"/>
- </rich:dataGrid>
+<rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car">
+ <h:outputText value="#{car.model}"/>
+</rich:dataGrid>
...
]]></programlisting>
</section>
@@ -100,29 +100,29 @@
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panel style="width:150px;height:200px;">
- <h:form>
- <rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car" columns="2" elements="4" first="1">
- <f:facet name="header">
- <h:outputText value="Car Store"></h:outputText>
- </f:facet>
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="#{car.make} #{car.model}"></h:outputText>
- </f:facet>
- <h:panelGrid columns="2">
- <h:outputText value="Price:" styleClass="label"></h:outputText>
- <h:outputText value="#{car.price}"/>
- <h:outputText value="Mileage:" styleClass="label"></h:outputText>
- <h:outputText value="#{car.mileage}"/>
- </h:panelGrid>
- </rich:panel>
- <f:facet name="footer">
- <rich:datascroller></rich:datascroller>
- </f:facet>
- </rich:dataGrid>
- </h:form>
- </rich:panel>
+<rich:panel style="width:150px;height:200px;">
+ <h:form>
+ <rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car" columns="2" elements="4" first="1">
+ <f:facet name="header">
+ <h:outputText value="Car Store"></h:outputText>
+ </f:facet>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="#{car.make} #{car.model}"></h:outputText>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="Price:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.price}"/>
+ <h:outputText value="Mileage:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.mileage}"/>
+ </h:panelGrid>
+ </rich:panel>
+ <f:facet name="footer">
+ <rich:datascroller></rich:datascroller>
+ </f:facet>
+ </rich:dataGrid>
+ </h:form>
+</rich:panel>
...
]]></programlisting>
<para>This is a result:</para>
@@ -147,14 +147,13 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
+<rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
binding="#{listBean.dataGrid}" id="grid" elements="4" columns="2">
- ...
- </rich:dataGrid>
+ ...
+</rich:dataGrid>
...
- <a4j:commandButton action="#{listBean.action}" reRender="grid" value="Submit"/>
-...
-]]></programlisting>
+<a4j:commandButton action="#{listBean.action}" reRender="grid" value="Submit"/>
+...]]></programlisting>
<para> In the example <emphasis>
<property>"reRender"</property>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataList.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -52,9 +52,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataList var="car" value="#{dataTableScrollerBean.allCars}" >
- <h:outputText value="#{car.model}"/>
- </rich:dataList>
+<rich:dataList var="car" value="#{dataTableScrollerBean.allCars}" >
+ <h:outputText value="#{car.model}"/>
+</rich:dataList>
...
]]></programlisting>
</section>
@@ -89,14 +89,14 @@
<para>Here is an example:</para>
<programlisting role="XML"><![CDATA[...
- <h:form>
- <rich:dataList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" type="disc" title="Car Store">
- <h:outputText value="#{car.make} #{car.model}"/><br/>
- <h:outputText value="Price:" styleClass="label"></h:outputText>
- <h:outputText value="#{car.price} "/><br/>
- <h:outputText value="Mileage:" styleClass="label"></h:outputText>
- <h:outputText value="#{car.mileage} "/><br/>
- </rich:dataList>
+<h:form>
+ <rich:dataList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" type="disc" title="Car Store">
+ <h:outputText value="#{car.make} #{car.model}"/><br/>
+ <h:outputText value="Price:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.price} "/><br/>
+ <h:outputText value="Mileage:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.mileage} "/><br/>
+ </rich:dataList>
</h:form>
...
]]></programlisting>
@@ -150,12 +150,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataList value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
+<rich:dataList value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
binding="#{listBean.dataList}" id="list" rows="5" type="disc">
- ...
- </rich:dataList>
+ ...
+</rich:dataList>
...
- <a4j:commandButton action="#{listBean.action}" reRender="list" value="Submit"/>
+<a4j:commandButton action="#{listBean.action}" reRender="list" value="Submit"/>
...
]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -58,9 +58,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataOrderedList var="car" value="#{dataTableScrollerBean.allCars}" >
- <h:outputText value="#{car.model}"/>
- </rich:dataOrderedList>
+<rich:dataOrderedList var="car" value="#{dataTableScrollerBean.allCars}" >
+ <h:outputText value="#{car.model}"/>
+</rich:dataOrderedList>
...
]]></programlisting>
</section>
@@ -107,15 +107,15 @@
<para>Here is an example:</para>
<programlisting role="XML"><![CDATA[...
- <h:form>
- <rich:dataOrderedList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" type="1" title="Car Store">
- <h:outputText value="#{car.make} #{car.model}"/><br/>
- <h:outputText value="Price:" styleClass="label"></h:outputText>
- <h:outputText value="#{car.price}" /><br/>
- <h:outputText value="Mileage:" styleClass="label"></h:outputText>
- <h:outputText value="#{car.mileage}" /><br/>
- </rich:dataOrderedList>
- </h:form>
+<h:form>
+ <rich:dataOrderedList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" type="1" title="Car Store">
+ <h:outputText value="#{car.make} #{car.model}"/><br/>
+ <h:outputText value="Price:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.price}" /><br/>
+ <h:outputText value="Mileage:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.mileage}" /><br/>
+ </rich:dataOrderedList>
+</h:form>
...
]]></programlisting>
@@ -177,12 +177,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataOrderedList value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
+<rich:dataOrderedList value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
binding="#{listBean.dataList}" id="list">
- ...
- </rich:dataOrderedList>
+ ...
+</rich:dataOrderedList>
...
- <a4j:commandButton action="#{listBean.action}" reRender="list" value="Submit"/>
+<a4j:commandButton action="#{listBean.action}" reRender="list" value="Submit"/>
...
]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataTable.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataTable.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dataTable.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -51,11 +51,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="capitals">
- <rich:column>
- ...
- </rich:column>
- </rich:dataTable>
+ <rich:dataTable value="#{capitalsBean.capitals}" var="capitals">
+ <rich:column>
+ ...
+ </rich:column>
+</rich:dataTable>
...
]]></programlisting>
</section>
@@ -90,12 +90,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="capitals"
+<rich:dataTable value="#{capitalsBean.capitals}" var="capitals"
ajaxKeys="#{bean.ajaxSet}" binding="#{bean.table}" id="table">
- ...
- </rich:dataTable>
+ ...
+</rich:dataTable>
...
- <a4j:commandButton action="#{tableBean.action}" reRender="table" value="Submit"/>
+<a4j:commandButton action="#{tableBean.action}" reRender="table" value="Submit"/>
...
]]></programlisting>
@@ -119,31 +119,37 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
- <f:facet name="caption"><h:outputText value="United States Capitals" /></f:facet>
- <f:facet name="header"><h:outputText value="Capitals and States Table" /></f:facet>
- <rich:column>
- <f:facet name="header">State Flag</f:facet>
- <h:graphicImage value="#{cap.stateFlag}"/>
- <f:facet name="footer">State Flag</f:facet>
- </rich:column>
- <rich:column>
- <f:facet name="header">State Name</f:facet>
- <h:outputText value="#{cap.state}"/>
- <f:facet name="footer">State Name</f:facet>
- </rich:column>
- <rich:column >
- <f:facet name="header">State Capital</f:facet>
- <h:outputText value="#{cap.name}"/>
- <f:facet name="footer">State Capital</f:facet>
- </rich:column>
- <rich:column>
- <f:facet name="header">Time Zone</f:facet>
- <h:outputText value="#{cap.timeZone}"/>
- <f:facet name="footer">Time Zone</f:facet>
- </rich:column>
- <f:facet name="footer"><h:outputText value="Capitals and States Table" /></f:facet>
- </rich:dataTable>
+<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
+ <f:facet name="caption">
+ <h:outputText value="United States Capitals" />
+ </f:facet>
+ <f:facet name="header">
+ <h:outputText value="Capitals and States Table" />
+ </f:facet>
+ <rich:column>
+ <f:facet name="header">State Flag</f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ <f:facet name="footer">State Flag</f:facet>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">State Name</f:facet>
+ <h:outputText value="#{cap.state}"/>
+ <f:facet name="footer">State Name</f:facet>
+ </rich:column>
+ <rich:column >
+ <f:facet name="header">State Capital</f:facet>
+ <h:outputText value="#{cap.name}"/>
+ <f:facet name="footer">State Capital</f:facet>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Time Zone</f:facet>
+ <h:outputText value="#{cap.timeZone}"/>
+ <f:facet name="footer">Time Zone</f:facet>
+ </rich:column>
+ <f:facet name="footer">
+ <h:outputText value="Capitals and States Table" />
+ </f:facet>
+</rich:dataTable>
...
]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/datascroller.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/datascroller.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/datascroller.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -54,7 +54,7 @@
<h:dataTable id="table">
...
</h:dataTable>
- ...
+...
<rich:datascroller for="table"/>
...]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dndParam.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dndParam.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dndParam.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -58,10 +58,10 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dragSupport dragType="file">
- <rich:dndParam name="testDrag" value="testDragValue"
+<rich:dragSupport dragType="file">
+ <rich:dndParam name="testDrag" value="testDragValue"
type="drag"/>
- </rich:dragSupport>
+</rich:dragSupport>
...
]]></programlisting>
</section>
@@ -106,12 +106,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dragSupport ...>
- <rich:dndParam type="drag" name="dragging">
- <h:graphicImage value="/img/product1_small.png"/>
- </rich:dndParam>
- <h:graphicImage value="product1.png"/>
- </rich:dragSupport>
+<rich:dragSupport ... >
+ <rich:dndParam type="drag" name="dragging">
+ <h:graphicImage value="/img/product1_small.png"/>
+ </rich:dndParam>
+ <h:graphicImage value="product1.png"/>
+</rich:dragSupport>
...
]]></programlisting>
@@ -132,10 +132,10 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dragSupport ...>
- <rich:dndParam type="drag" name="label" value="#{msg.subj}"/>
- ...
- </rich:dragSupport>
+<rich:dragSupport ... >
+ <rich:dndParam type="drag" name="label" value="#{msg.subj}"/>
+ ...
+</rich:dragSupport>
...
]]></programlisting>
@@ -156,12 +156,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dropSupport ...>
- <rich:dndParam type="drop" name="comp" >
- <h:graphicImage height="16" width="16" value="/images/comp.png"/>
- </rich:dndParam>
+<rich:dropSupport ... >
+ <rich:dndParam type="drop" name="comp" >
+ <h:graphicImage height="16" width="16" value="/images/comp.png"/>
+ </rich:dndParam>
...
- </rich:dropSupport >
+</rich:dropSupport >
...
]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragIndicator.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragIndicator.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragIndicator.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -51,16 +51,16 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dragIndicator id="indicator">
- <f:facet name="single">
- <f:verbatim>
- <b>Single item</b> {DragInfo}
- </f:verbatim>
- </f:facet>
- </rich:dragIndicator>
- ...
- <rich:dragSupport dragType="text" dragIndicator="indicator">
+<rich:dragIndicator id="indicator">
+ <f:facet name="single">
+ <f:verbatim>
+ <b>Single item</b> {DragInfo}
+ </f:verbatim>
+ </f:facet>
+</rich:dragIndicator>
...
+<rich:dragSupport dragType="text" dragIndicator="indicator"/>
+...
]]></programlisting>
</section>
<section>
@@ -131,18 +131,18 @@
</itemizedlist>
<para> For instance, this:</para>
<programlisting role="XML"><![CDATA[...
- <rich:dropSupport...>
- <rich:dndParam name="testDrop">
- <h:graphicImage value="/images/file-manager.png" />
- </rich:dndParam>
- </rich:dropSupport>
+<rich:dropSupport...>
+ <rich:dndParam name="testDrop">
+ <h:graphicImage value="/images/file-manager.png" />
+ </rich:dndParam>
+</rich:dropSupport>
...
]]></programlisting>
<para>Is placed into indicator as follows:</para>
<programlisting role="XML"><![CDATA[...
- <f:facet name="single">
- {testDrop}
- </f:facet>
+<f:facet name="single">
+ {testDrop}
+</f:facet>
...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragListener.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragListener.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragListener.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -47,7 +47,7 @@
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dragListener type="demo.Bean"/>
+<rich:dragListener type="demo.Bean"/>
...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragSupport.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragSupport.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dragSupport.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -70,10 +70,10 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <h:panelGrid id="drag1">
- <rich:dragSupport dragType="item"/>
- <!--Some content to be dragged-->
- </h:panelGrid>
+<h:panelGrid id="drag1">
+ <rich:dragSupport dragType="item"/>
+ <!--Some content to be dragged-->
+</h:panelGrid>
...
]]></programlisting>
</section>
@@ -115,12 +115,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <h:column>
- <rich:dragSupport dragIndicator=":form:iii" dragType="text">
- <a4j:actionparam value="#{caps.name}" name="name"/>
- </rich:dragSupport>
- <h:outputText value="#{caps.name}"/>
- </h:column>
+<h:column>
+ <rich:dragSupport dragIndicator=":form:iii" dragType="text">
+ <a4j:actionparam value="#{caps.name}" name="name"/>
+ </rich:dragSupport>
+ <h:outputText value="#{caps.name}"/>
+</h:column>
...
]]></programlisting>
@@ -137,14 +137,14 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <h:column>
- <a4j:outputPanel>
- <rich:dragSupport dragIndicator=":form:iii" dragType="text">
- <a4j:actionparam value="#{caps.name}" name="name"/>
- </rich:dragSupport>
- <h:outputText value="#{caps.name}"/>
- </a4j:outputPanel>
- </h:column>
+<h:column>
+ <a4j:outputPanel>
+ <rich:dragSupport dragIndicator=":form:iii" dragType="text">
+ <a4j:actionparam value="#{caps.name}" name="name"/>
+ </rich:dragSupport>
+ <h:outputText value="#{caps.name}"/>
+ </a4j:outputPanel>
+</h:column>
...
]]></programlisting>
@@ -168,20 +168,20 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <h:panelGrid id="drag1">
- <rich:dragSupport dragType="singleItems" .../>
- <!--Some content to be dragged-->
- </h:panelGrid>
+<h:panelGrid id="drag1">
+ <rich:dragSupport dragType="singleItems" .../>
+ <!--Some content to be dragged-->
+</h:panelGrid>
...
- <h:panelGrid id="drag2">
- <rich:dragSupport dragType="groups" .../>
- <!--Some content to be dragged-->
- </h:panelGrid>
+<h:panelGrid id="drag2">
+ <rich:dragSupport dragType="groups" .../>
+ <!--Some content to be dragged-->
+</h:panelGrid>
...
- <h:panelGrid id="drop1">
- <rich:dropSupport acceptedTypes="singleItems" .../>
- <!--Drop zone content-->
- </h:panelGrid>
+<h:panelGrid id="drop1">
+ <rich:dropSupport acceptedTypes="singleItems" .../>
+ <!--Drop zone content-->
+</h:panelGrid>
...
]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dropListener.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dropListener.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dropListener.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -47,7 +47,7 @@
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dropListener type="demo.Bean"/>
+<rich:dropListener type="demo.Bean"/>
...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dropSupport.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dropSupport.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/dropSupport.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -71,9 +71,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panel>
- <rich:dropSupport acceptedTypes="text"/>
- </rich:panel>
+<rich:panel>
+ <rich:dropSupport acceptedTypes="text"/>
+</rich:panel>
...
]]></programlisting>
</section>
@@ -176,17 +176,17 @@
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="caps">
- <f:facet name="caption">Capitals List</f:facet>
- <h:column>
- <a4j:outputPanel>
- <rich:dragSupport dragIndicator=":form:ind" dragType="text">
- <a4j:actionparam value="#{caps.name}" name="name"/>
- </rich:dragSupport>
- <h:outputText value="#{caps.name}"/>
- </a4j:outputPanel>
- </h:column>
- </rich:dataTable>
+<rich:dataTable value="#{capitalsBean.capitals}" var="caps">
+ <f:facet name="caption">Capitals List</f:facet>
+ <h:column>
+ <a4j:outputPanel>
+ <rich:dragSupport dragIndicator=":form:ind" dragType="text">
+ <a4j:actionparam value="#{caps.name}" name="name"/>
+ </rich:dragSupport>
+ <h:outputText value="#{caps.name}"/>
+ </a4j:outputPanel>
+ </h:column>
+</rich:dataTable>
...
]]></programlisting>
@@ -205,11 +205,11 @@
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panel style="width:100px;height:100px;">
- <f:facet name="header">Drop Zone</f:facet>
- <rich:dropSupport acceptedTypes="text" reRender="box"
+<rich:panel style="width:100px;height:100px;">
+ <f:facet name="header">Drop Zone</f:facet>
+ <rich:dropSupport acceptedTypes="text" reRender="box"
dropListener="#{capitalsBean.addCapital2}"/>
- </rich:panel>
+</rich:panel>
...
]]></programlisting>
@@ -225,12 +225,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals2}" var="cap2" id="box">
- <f:facet name="caption">Capitals chosen</f:facet>
- <h:column>
- <h:outputText value="#{cap2.name}"/>
- </h:column>
- </rich:dataTable>
+<rich:dataTable value="#{capitalsBean.capitals2}" var="cap2" id="box">
+ <f:facet name="caption">Capitals chosen</f:facet>
+ <h:column>
+ <h:outputText value="#{cap2.name}"/>
+ </h:column>
+</rich:dataTable>
...]]></programlisting>
<para>
@@ -243,12 +243,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="JAVA"><![CDATA[...
- public void addCapital2(DropEvent event) {
+public void addCapital2(DropEvent event) {
FacesContext context = FacesContext.getCurrentInstance();
Capital cap = new Capital();
cap.setName(context.getExternalContext().getRequestParameterMap().get("name").toString());
capitals2.add(cap);
- }
+}
...
]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/editor.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -221,14 +221,14 @@
<para>Your Java file should look like this.</para>
<programlisting role="JAVA"><![CDATA[...
- String configuration;
- if(some condition){//defines some condition
- configuration = "configurationAdvanced"; //the name on the file with advanced properties
- }
- else{
- configuration= "configurationSimple"; //the name on the file with simplified properties
-
- }
+String configuration;
+
+if(some condition){//defines some condition
+ configuration = "configurationAdvanced"; //the name on the file with advanced properties
+}
+else{
+ configuration= "configurationSimple"; //the name on the file with simplified properties
+}
...]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/effect.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/effect.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/effect.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -87,13 +87,13 @@
<!-- attaching by event -->
<rich:panel>
<rich:effect event="onmouseout" type="Opacity" params="duration:0.8,from:1.0,to:0.3" />
- .... panel content ....
+ <!--panel content-->
</rich:panel>
...
<!-- invoking from JavaScript -->
<div id="contentDiv">
- ..... div content ......
+ <!--div content-->
</div>
<input type="button" onclick="hideDiv({duration:0.7})" value="Hide" />
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/fileUpload.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/fileUpload.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/fileUpload.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -217,7 +217,7 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:fileUpload maxFilesQuantity="2"/>
- ...]]></programlisting>
+...]]></programlisting>
<para> This is the result: </para>
<figure>
<title><emphasis role="bold">
@@ -329,20 +329,20 @@
<para>The given bellow code sample demonstrates how the properties can be used. Please study
it carefully. </para>
<programlisting role="XML"><![CDATA[...
- <head>
- <script>
- function _onaddHandler (e) {
- var i = 0;
- for (; i < e.memo.entries.lenght; i++) {
- alert(e.memo.entries[i].creator); //Shows creators of the added files
- }
- }
+<head>
+ <script>
+ function _onaddHandler (e) {
+ var i = 0;
+ for (; i < e.memo.entries.lenght; i++) {
+ alert(e.memo.entries[i].creator); //Shows creators of the added files
+ }
+ }
- function _onerrorhandle(e) {
- alert(e.memo.entry.fileName + "file was not uploaded due transfer error");
- }
- </script>
- </head>
+ function _onerrorhandle(e) {
+ alert(e.memo.entry.fileName + "file was not uploaded due transfer error");
+ }
+ </script>
+</head>
...]]></programlisting>
@@ -523,11 +523,11 @@
<programlisting role="XML"><![CDATA[...
<rich:fileUpload fileUploadListener="#{fileUploadBean.listener}"
- maxFilesQuantity="#{fileUploadBean.uploadsAvailable}"
- id="upload"
- immediateUpload="#{fileUploadBean.autoUpload}"
- acceptedTypes="jpg, gif, png, bmp">
- <a4j:support event="onuploadcomplete" reRender="info" />
+ maxFilesQuantity="#{fileUploadBean.uploadsAvailable}"
+ id="upload"
+ immediateUpload="#{fileUploadBean.autoUpload}"
+ acceptedTypes="jpg, gif, png, bmp"/>
+ <a4j:support event="onuploadcomplete" reRender="info" />
</rich:fileUpload>
<h:commandButton onclick="if($('j_id232:upload').component.entries[0].state == FileUploadEntry.UPLOAD_SUCCESS) alert ('DONE');" value="Check file state"/>
...]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/gmap.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/gmap.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/gmap.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -53,7 +53,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:gmap gmapKey="..."/>
+<rich:gmap gmapKey="..."/>
...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/graphValidator.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/graphValidator.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/graphValidator.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -102,16 +102,16 @@
</emphasis> can be used:</para>
<programlisting role="XML"><![CDATA[...
<rich:graphValidator>
- <h:panelGrid columns="3">
- <h:outputText value="Name:" />
- <h:inputText value="#{validationBean.name}" id="name">
- <f:validateLength minimum="2" />
- </h:inputText>
- <rich:message for="name" />
- <h:outputText value="Email:" />
- <h:inputText value="#{validationBean.email}" id="email" />
- <rich:message for="email" />
- </h:panelGrid>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name">
+ <f:validateLength minimum="2" />
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email:" />
+ <h:inputText value="#{validationBean.email}" id="email" />
+ <rich:message for="email" />
+ </h:panelGrid>
</rich:graphValidator>
...
]]></programlisting>
@@ -133,11 +133,11 @@
<programlisting role="XML"><![CDATA[...
<rich:graphValidator summary="Invalid values: " value="#{dayStatistics}">
- <a4j:repeat value="#{dayStatistics.dayPasstimes}" var="pt" id="table">
- <h:outputText value="#{pt.title}" />
- <rich:inputNumberSpinner minValue="0" maxValue="24" value="#{pt.time}" id="time" />
- <rich:message for="time" />
- </a4j:repeat>
+ <a4j:repeat value="#{dayStatistics.dayPasstimes}" var="pt" id="table">
+ <h:outputText value="#{pt.title}" />
+ <rich:inputNumberSpinner minValue="0" maxValue="24" value="#{pt.time}" id="time" />
+ <rich:message for="time" />
+ </a4j:repeat>
</rich:graphValidator>
...]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inplaceInput.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inplaceInput.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inplaceInput.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -759,9 +759,8 @@
</para>
<programlisting role="CSS"><![CDATA[...
.rich-inplace-field {
- font-style: italic;
+ font-style: italic;
}
-
...]]></programlisting>
<para>This is the result:</para>
@@ -797,7 +796,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[...<rich:inplaceInput value="click to edit" styleClass="myClass"/>
+ <programlisting role="XML"><![CDATA[<rich:inplaceInput value="click to edit" styleClass="myClass"/>
]]></programlisting>
<para>This is a result:</para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -868,9 +868,8 @@
</para>
<programlisting role="CSS"><![CDATA[...
.rich-inplace-select-list-decoration{
- background-color: #ecf4fe;
+ background-color: #ecf4fe;
}
-
...]]></programlisting>
<para>This is the result:</para>
@@ -897,7 +896,8 @@
<programlisting role="CSS"><![CDATA[...
.myClass {
background-color:#bed6f8;
- font-style:italic;}
+ font-style:italic;
+}
...]]></programlisting>
<para>The <emphasis><property>"viewClass"</property></emphasis> attribute for <emphasis role="bold"
><property><rich:inplaceSelect> </property></emphasis> is defined as it's shown in the example below:</para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -66,7 +66,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:inputNumberSlider minValue="0" maxValue="100" step="1"/>
+<rich:inputNumberSlider minValue="0" maxValue="100" step="1"/>
...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -54,7 +54,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:inputNumberSpinner minValue="0" maxValue="100" step="1"/>
+<rich:inputNumberSpinner minValue="0" maxValue="100" step="1"/>
...
]]></programlisting>
</section>
@@ -91,7 +91,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:inputNumberSpinner minValue="1" maxValue="100"/>
+<rich:inputNumberSpinner minValue="1" maxValue="100"/>
...
]]></programlisting>
<para>It generates on a page:</para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/insert.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/insert.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/insert.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -62,7 +62,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:insert src="/pages/sourcePage.xhtml" highlight="xhtml"/>
+<rich:insert src="/pages/sourcePage.xhtml" highlight="xhtml"/>
...]]></programlisting>
</section>
@@ -96,7 +96,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:insert src="/pages/sourcePage.xhtml" highlight="xhtml"/>
+<rich:insert src="/pages/sourcePage.xhtml" highlight="xhtml"/>
...]]></programlisting>
<para>The result of using <emphasis role="bold">
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jQuery.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jQuery.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jQuery.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -61,7 +61,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:jQuery selector="#customList tr:odd" timing="onload" query="addClass(odd)" />
+<rich:jQuery selector="#customList tr:odd" timing="onload" query="addClass(odd)" />
...]]></programlisting>
</section>
@@ -126,11 +126,11 @@
...]]></programlisting>
<programlisting role="XML"><![CDATA[...
- <rich:table id="customList" ...>
- ...
- </rich:table>
- ...
- <rich:jQuery selector="#customList tr:odd" timing="onload" query="addClass(odd)" />
+<rich:table id="customList" ...>
+ ...
+</rich:table>
+...
+<rich:jQuery selector="#customList tr:odd" timing="onload" query="addClass(odd)" />
...]]></programlisting>
<para>The <emphasis>
<property>"selector"</property>
@@ -244,14 +244,14 @@
<para>For example, you have the following code:</para>
<programlisting role="XML"><![CDATA[...
- <h:form id="form">
- ...
- <h:panelGrid id="menu">
- <h:graphicImage ... />
- <h:graphicImage ... />
- ...
- </h:panelGrid>
- </h:form>
+<h:form id="form">
+ ...
+ <h:panelGrid id="menu">
+ <h:graphicImage ... />
+ <h:graphicImage ... />
+ ...
+ </h:panelGrid>
+</h:form>
...]]></programlisting>
<para>The actual id of the <emphasis role="bold">
@@ -260,14 +260,14 @@
reference to images inside this table using the following selector: </para>
<programlisting role="XML"><![CDATA[...
- <rich:jQuery selector="#menu img" query="..." />
+<rich:jQuery selector="#menu img" query="..." />
...]]></programlisting>
<para>You can define the exact id in the selector if you want. The following code reference to
the same set of a DOM object:</para>
<programlisting role="XML"><![CDATA[...
- <rich:jQuery selector="#form\\:menu img" query="..." />
+<rich:jQuery selector="#form\\:menu img" query="..." />
...]]></programlisting>
<para>Pay attention to double slashes that escape a colon in the id.</para>
@@ -283,13 +283,13 @@
back to the normal size on mouse out:</para>
<programlisting role="XML"><![CDATA[...
- <h:graphicImage width="50" value="/images/price.png"
+<h:graphicImage width="50" value="/images/price.png"
onmouseover="enlargePic(this, {pwidth:'60px'})" onmouseout="releasePic(this)" />
- <h:graphicImage width="50" value="/images/discount.png"
+<h:graphicImage width="50" value="/images/discount.png"
onmouseover="enlargePic(this, {pwidth:'100px'})" onmouseout="releasePic(this)" />
- ...
- <rich:jQuery name="enlargePic" timing="onJScall" query="animate({width:param.pwidth})" />
- <rich:jQuery name="releasePic" timing="onJScall" query="animate({width:'50px'})"/>
+...
+<rich:jQuery name="enlargePic" timing="onJScall" query="animate({width:param.pwidth})" />
+<rich:jQuery name="releasePic" timing="onJScall" query="animate({width:'50px'})"/>
...]]></programlisting>
<para>The JavaScript could use two parameters. The first parameter is a replacement for the
@@ -327,7 +327,7 @@
on the page, include the library into a page with the following code:</para>
<programlisting role="XML"><![CDATA[...
- <a4j:loadScript src="resource://jquery.js"/>
+<a4j:loadScript src="resource://jquery.js"/>
...]]></programlisting>
<para>Refer to the <ulink url="http://docs.jquery.com/">jQuery documentation</ulink> for the
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/jsFunction.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -84,12 +84,12 @@
<body onload="callScript()">
...
<h:form>
- ...
- <a4j:jsFunction name="callScript" data="#{bean.someProperty1}"
- reRender="someComponent" oncomplete="myScript(data.subProperty1, data.subProperty2)">
+ ...
+ <a4j:jsFunction name="callScript" data="#{bean.someProperty1}"
+ reRender="someComponent" oncomplete="myScript(data.subProperty1, data.subProperty2)">
<a4j:actionparam name="param_name" assignTo="#{bean.someProperty2}"/>
- </a4j:jsFunction>
- ...
+ </a4j:jsFunction>
+ ...
</h:form>
...
</body>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/layout.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/layout.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/layout.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -51,9 +51,9 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:layout>
- <rich:layoutPanel position="center">
- <!--center-->
- </rich:layoutPanel>
+ <rich:layoutPanel position="center">
+ <!--center-->
+ </rich:layoutPanel>
</rich:layout>
...
]]></programlisting>
@@ -84,28 +84,24 @@
<programlisting role="XML"><![CDATA[...
<rich:layout>
- <rich:layoutPanel position="top">
- <!--top-->
- </rich:layoutPanel>
- <rich:layoutPanel position="left">
- <!--left-->
- </rich:layoutPanel>
- <rich:layoutPanel position="center">
- <!--center-->
- </rich:layoutPanel>
- <rich:layoutPanel position="right">
- <!--right-->
- </rich:layoutPanel>
- <rich:layoutPanel position="bottom">
- <!--bottom-->
- </rich:layoutPanel>
+ <rich:layoutPanel position="top">
+ <!--top-->
+ </rich:layoutPanel>
+ <rich:layoutPanel position="left">
+ <!--left-->
+ </rich:layoutPanel>
+ <rich:layoutPanel position="center">
+ <!--center-->
+ </rich:layoutPanel>
+ <rich:layoutPanel position="right">
+ <!--right-->
+ </rich:layoutPanel>
+ <rich:layoutPanel position="bottom">
+ <!--bottom-->
+ </rich:layoutPanel>
</rich:layout>
...]]></programlisting>
- <para>To get more details about <emphasis role="bold"><property><rich:layoutPanel></property></emphasis> please read the <link linkend="rich_layoutPanel"> chapter about layoutPanel </link> in the guide.</para>
-
-
-
-
+ <para>To get more details about <emphasis role="bold"><property><rich:layoutPanel></property></emphasis> please read the <link linkend="rich_layoutPanel"> chapter about layoutPanel </link> in the guide.</para>
</section>
<section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/layoutPanel.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/layoutPanel.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/layoutPanel.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -52,9 +52,9 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:layout>
- <rich:layoutPanel position="center">
- <!--center-->
-</rich:layoutPanel>
+ <rich:layoutPanel position="center">
+ <!--center-->
+ </rich:layoutPanel>
</rich:layout>
...]]></programlisting>
</section>
@@ -79,21 +79,21 @@
<para>The <emphasis><property>"position"</property></emphasis> attribute defines the position of the <emphasis role="bold"><property><rich:layoutPanel></property></emphasis> in the area created with <emphasis role="bold"><property><rich:layout></property></emphasis> .</para>
<programlisting role="XML"><![CDATA[...
<rich:layout>
- <rich:layoutPanel position="top">
- <!--top-->
- </rich:layoutPanel>
- <rich:layoutPanel position="left">
- <!--left-->
- </rich:layoutPanel>
- <rich:layoutPanel position="center">
- <!--center-->
- </rich:layoutPanel>
- <rich:layoutPanel position="right">
- <!--right-->
- </rich:layoutPanel>
- <rich:layoutPanel position="bottom">
- <!--bottom-->
- </rich:layoutPanel>
+ <rich:layoutPanel position="top">
+ <!--top-->
+ </rich:layoutPanel>
+ <rich:layoutPanel position="left">
+ <!--left-->
+ </rich:layoutPanel>
+ <rich:layoutPanel position="center">
+ <!--center-->
+ </rich:layoutPanel>
+ <rich:layoutPanel position="right">
+ <!--right-->
+ </rich:layoutPanel>
+ <rich:layoutPanel position="bottom">
+ <!--bottom-->
+ </rich:layoutPanel>
</rich:layout>
...]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/listShuttle.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/listShuttle.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/listShuttle.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -182,19 +182,19 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:listShuttle var="item" sourceValue="#{bean.source}" targetValue="#{bean.target}" converter="listShuttleconverter">
-...
- <f:facet name="topControl">
- <h:outputText value="Move to top" />
- </f:facet>
- <f:facet name="upControl">
- <h:outputText value="Move up" />
- </f:facet>
- <f:facet name="downControl">
- <h:outputText value="Move down" />
- </f:facet>
- <f:facet name="bottomControl">
- <h:outputText value="Move to bottom" />
- </f:facet>
+ ...
+ <f:facet name="topControl">
+ <h:outputText value="Move to top" />
+ </f:facet>
+ <f:facet name="upControl">
+ <h:outputText value="Move up" />
+ </f:facet>
+ <f:facet name="downControl">
+ <h:outputText value="Move down" />
+ </f:facet>
+ <f:facet name="bottomControl">
+ <h:outputText value="Move to bottom" />
+ </f:facet>
</rich:listShuttle>
...
]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/mediaOutput.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/mediaOutput.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/mediaOutput.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -72,10 +72,11 @@
<programlisting role="JAVA"><![CDATA[package demo;
public class PaintData implements Serializable{
- private static final long serialVersionUID = 1L;
- Integer width=100;
- Integer weight=50;
-...
+ private static final long serialVersionUID = 1L;
+ Integer width=100;
+ Integer weight=50;
+ ...
+}
]]></programlisting>
<para>The Paint method of the <code>paintBean</code> class is a method transmitting graphical data into output stream.</para>
@@ -83,8 +84,8 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="JAVA"><![CDATA[public void paint(OutputStream out, Object data) throws IOException{
- <!--...Some code that puts binary data to "out" Stream-->
- }
+ //Some code that puts binary data to "out" Stream
+}
]]></programlisting>
<para>As it was shown in the example above there are two main components:</para>
<itemizedlist>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuGroup.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuGroup.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuGroup.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -48,13 +48,13 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dropDownMenu value="Active">
+<rich:dropDownMenu value="Active">
+ ...
+ <rich:menuGroup value="Active">
+ <!--Nested menu components-->
+ </rich:menuGroup>
...
- <rich:menuGroup value="Active">
- <!--Nested menu components-->
- </rich:menuGroup>
- ...
- </rich:dropDownMenu >
+</rich:dropDownMenu >
...
]]></programlisting>
</section>
@@ -94,9 +94,9 @@
This could be used for an item check box implementation. </para>
<para> Here is an example: </para>
<programlisting role="XML"><![CDATA[...
- <f:facet name="icon">
- <h:selectBooleanCheckbox value="#{bean.property}"/>
- </f:facet>
+<f:facet name="icon">
+ <h:selectBooleanCheckbox value="#{bean.property}"/>
+</f:facet>
...
]]></programlisting>
<para> The <emphasis>
@@ -140,10 +140,10 @@
</emphasis> attribute is set to "auto". </para>
<para> Here is an example: </para>
<programlisting role="XML"><![CDATA[...
- <rich:menuGroup value="Save As..." direction="left-down">
- <rich:menuItem submitMode="ajax" value="Text File" action="#{ddmenu.doSaveText}"/>
- <rich:menuItem submitMode="ajax" value="PDF File" action="#{ddmenu.doSavePDF}"/>
- </rich:menuGroup>
+<rich:menuGroup value="Save As..." direction="left-down">
+ <rich:menuItem submitMode="ajax" value="Text File" action="#{ddmenu.doSaveText}"/>
+ <rich:menuItem submitMode="ajax" value="PDF File" action="#{ddmenu.doSavePDF}"/>
+</rich:menuGroup>
...
]]></programlisting>
<para> This would be the result: </para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuItem.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuItem.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuItem.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -48,11 +48,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dropDownMenu>
- ...
- <rich:menuItem value="Active"/>
- ...
- <rich:dropDownMenu>
+<rich:dropDownMenu>
+ ...
+ <rich:menuItem value="Active"/>
+ ...
+<rich:dropDownMenu>
...
]]></programlisting>
</section>
@@ -93,9 +93,9 @@
an icon. It could be used for an item check box implementation. </para>
<para> Here is an example: </para>
<programlisting role="XML"><![CDATA[...
- <f:facet name="icon">
- <h:selectBooleanCheckbox value="#{bean.property}"/>
- </f:facet>
+<f:facet name="icon">
+ <h:selectBooleanCheckbox value="#{bean.property}"/>
+</f:facet>
...
]]></programlisting>
@@ -147,13 +147,13 @@
</emphasis>.</para>
<para> Here is an example: </para>
<programlisting role="XML"><![CDATA[...
- <rich:dropDownMenu>
- ...
- <rich:menuItem submitMode="none">
- <h:outputLink value="www.jboss.org"/>
- </rich:menuItem>
- ...
- <rich:dropDownMenu>
+<rich:dropDownMenu>
+ ...
+ <rich:menuItem submitMode="none">
+ <h:outputLink value="www.jboss.org"/>
+ </rich:menuItem>
+ ...
+<rich:dropDownMenu>
...
]]></programlisting>
<para> You can use the <emphasis>
@@ -161,9 +161,9 @@
</emphasis> attribute to set the item state. </para>
<para> Here is an example: </para>
<programlisting role="XML"><![CDATA[...
- <rich:dropDownMenu>
- <rich:menuItem value="Disable" disabled="true"/>
- <rich:dropDownMenu>
+<rich:dropDownMenu>
+ <rich:menuItem value="Disable" disabled="true"/>
+<rich:dropDownMenu>
...
]]></programlisting>
<note>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuSeparator.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuSeparator.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/menuSeparator.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -48,11 +48,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dropDownMenu/>
- ...
- <rich:menuSeparator/>
- ...
- <rich:dropDownMenu/>
+<rich:dropDownMenu/>
+ ...
+ <rich:menuSeparator/>
+ ...
+<rich:dropDownMenu/>
...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/message.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/message.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/message.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -51,7 +51,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:message for="id"/>
+<rich:message for="id"/>
...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/messages.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/messages.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/messages.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -51,8 +51,8 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:messages/>
-...component is considered as JSF HTML
+<rich:messages/>
+...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/modalPanel.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -73,7 +73,7 @@
...
<!--Any Content inside-->
...
-<a onclick="Richfaces.hideModalPanel('modalPanelID');" href="#">Hide</a>
+ <a onclick="Richfaces.hideModalPanel('modalPanelID');" href="#">Hide</a>
</rich:modalPanel>
<a onclick="Richfaces.showModalPanel('modalPanelID');" href="#">Show</a>
...
@@ -366,17 +366,17 @@
</para>
<programlisting role="XML"><![CDATA[<a4j:form>
- <rich:modalPanel>
+<rich:modalPanel>
<f:facet name="header">
- <h:outputText value="Test" />
+ <h:outputText value="Test" />
</f:facet>
<f:facet name="controls">
- <h:commandLink value="Close" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
+ <h:commandLink value="Close" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
</f:facet>
<h:form>
- <h:commandButton value="Test" action="#{TESTCONTROLLER.test}" />
+ <h:commandButton value="Test" action="#{TESTCONTROLLER.test}" />
</h:form>
- </rich:modalPanel>]]></programlisting>
+</rich:modalPanel>]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/nodeSelectListener.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -43,7 +43,7 @@
</para>
<programlisting role="XML"><![CDATA[...
- <rich:nodeSelectListener type="demo.Bean"/>
+<rich:nodeSelectListener type="demo.Bean"/>
...
]]></programlisting>
</section>
@@ -100,11 +100,11 @@
<programlisting role="JAVA"><![CDATA[package demo;
import org.richfaces.event.NodeSelectedEvent;
public class ListenerBean implements org.richfaces.event.NodeSelectedListener{
-...
+ ...
public void processSelection(NodeSelectedEvent arg0){
//Custom Developer Code
}
-...
+ ...
}
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/orderingList.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/orderingList.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/orderingList.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,12 +50,12 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:orderingList value="#{bean.list}" var="list">
- <rich:column>
- <f:facet name="header">
- <h:outputText value="Name" />
- </f:facet>
- <h:inputText value="#{list.name}" />
- </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Name" />
+ </f:facet>
+ <h:inputText value="#{list.name}" />
+ </rich:column>
<rich:orderingList>
...]]></programlisting>
</section>
@@ -103,7 +103,7 @@
<para>
Currently the button controls type is based on <emphasis role="bold"><property><div></property></emphasis> element.
</para>
- </note>
+ </note>
<para>The information about the <emphasis><property>"converter"</property></emphasis> attribute is <link linkend="conv">here</link>.</para>
<para> The <emphasis>
<property>"selection" </property>
@@ -123,7 +123,7 @@
<f:facet name="header">
<h:outputText value="Cars" />
</f:facet>
- <h:outputText value="#{item}" />
+ <h:outputText value="#{item}" />
</rich:column>
</rich:orderingList>
<rich:dataTable id="infoPanelID" value="#{bean.info}" var="info" rendered="true">
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/outputPanel.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/outputPanel.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/outputPanel.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -47,10 +47,10 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[<a4j:outputPanel>
- <h:form>
- <h:outputText value="Some text"/>
- <h:inputText id="text1" label="text1" value="#{rsBean.text1}"/>
- </h:form>
+ <h:form>
+ <h:outputText value="Some text"/>
+ <h:inputText id="text1" label="text1" value="#{rsBean.text1}"/>
+ </h:form>
</a4j:outputPanel>]]></programlisting>
</section>
<section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/paint2D.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/paint2D.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/paint2D.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,7 +50,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:paint2D paint="#{paint2D.paint}" data="#{paint2DModel}"/>
+<rich:paint2D paint="#{paint2D.paint}" data="#{paint2DModel}"/>
...
]]></programlisting>
<para>Here <emphasis>
@@ -115,29 +115,30 @@
</para>
<programlisting role="JAVA"><![CDATA[paintBean.java:
- public void paint(Graphics2D g2, Object obj) {
- // code that gets data from the data Bean (PaintData)
- PaintData data = (PaintData) obj;
- ...
- // a code drawing a rectangle
- g2.drawRect(0, 0, data.Width, data.Height);
- ...
- // some more code placing graphical data into g2 stream below
- }
+public void paint(Graphics2D g2, Object obj) {
+ // code that gets data from the data Bean (PaintData)
+ PaintData data = (PaintData) obj;
+ ...
+ // a code drawing a rectangle
+ g2.drawRect(0, 0, data.Width, data.Height);
+ ...
+ // some more code placing graphical data into g2 stream below
+}
dataBean.java:
- public class PaintData implements Serializable{
- private static final long serialVersionUID = 1L;
- Integer Width=100;
- Integer Height=50;
- ...
- }
+public class PaintData implements Serializable{
+ private static final long serialVersionUID = 1L;
+ Integer Width=100;
+ Integer Height=50;
+ ...
+}
- page.xhtml:
- ...
- <rich:paint2D paint="#{paint2D.paint}" data="#{paint2DModel.data}"/>
- ...
+page.xhtml:
+
+...
+<rich:paint2D paint="#{paint2D.paint}" data="#{paint2DModel.data}"/>
+...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panel.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panel.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panel.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,11 +50,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panel header="Panel Header">
- ...
- <!--Any Content inside-->
- ...
- </rich:panel>
+<rich:panel header="Panel Header">
+ ...
+ <!--Any Content inside-->
+ ...
+</rich:panel>
...
]]></programlisting>
</section>
@@ -78,14 +78,14 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panel>
- <f:facet name="header">
- <h:graphicImage value="/images/img1.png"/>
- </f:facet>
- ...
- <!--Any Content inside-->
- ...
- </rich:panel>
+<rich:panel>
+ <f:facet name="header">
+ <h:graphicImage value="/images/img1.png"/>
+ </f:facet>
+ ...
+ <!--Any Content inside-->
+ ...
+</rich:panel>
...
]]></programlisting>
@@ -97,9 +97,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panel>
- ...
- </rich:panel>
+<rich:panel>
+ ...
+</rich:panel>
...
]]></programlisting>
<para>It's generating on a page in the following way:</para>
@@ -123,12 +123,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="Olympus EVOLT E-500 "/>
- </f:facet>
- ...
- </rich:panel>
+<rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Olympus EVOLT E-500 "/>
+ </f:facet>
+ ...
+</rich:panel>
...
]]></programlisting>
<para>It's displayed on a page in the following way:</para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelBar.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelBar.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelBar.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,15 +50,15 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelBar>
- <!--//... -->
- <rich:panelBarItem label="Canon">
- ...
- </rich:panelBarItem>
- <rich:panelBarItem label="Nikon">
- ...
- </rich:panelBarItem>
- </rich:panelBar>
+<rich:panelBar>
+ ...
+ <rich:panelBarItem label="Canon">
+ ...
+ </rich:panelBarItem>
+ <rich:panelBarItem label="Nikon">
+ ...
+ </rich:panelBarItem>
+</rich:panelBar>
...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelBarItem.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelBarItem.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelBarItem.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,14 +50,14 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelBar>
- <rich:panelBarItem label="Canon">
- ...
- </rich:panelBarItem>
+<rich:panelBar>
+ <rich:panelBarItem label="Canon">
+ ...
+ </rich:panelBarItem>
<rich:panelBarItem label="Nikon">
- ...
+ ...
</rich:panelBarItem>
- </rich:panelBar>
+</rich:panelBar>
...
]]></programlisting>
</section>
@@ -84,14 +84,14 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelBarItem...>
- <f:facet name="label">
- <h:graphicImage value="/images/img1.png"/>
- </f:facet>
- ...
- <!--Any Content inside-->
- ...
- </rich:panelBarItem>
+<rich:panelBarItem...>
+ <f:facet name="label">
+ <h:graphicImage value="/images/img1.png"/>
+ </f:facet>
+ ...
+ <!--Any Content inside-->
+ ...
+</rich:panelBarItem>
...
]]></programlisting>
<para>As it was mentioned <link linkend="panelBarItem">above</link>,
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenu.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenu.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenu.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -62,9 +62,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu event="onmouseover">
- <!--Nested panelMenu components-->
- </rich:panelMenu>
+<rich:panelMenu event="onmouseover">
+ <!--Nested panelMenu components-->
+</rich:panelMenu>
...]]></programlisting>
</section>
@@ -94,9 +94,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu event="onmouseover">
- <!--Nested panelMenu components-->
- </rich:panelMenu>
+<rich:panelMenu event="onmouseover">
+ <!--Nested panelMenu components-->
+</rich:panelMenu>
...]]></programlisting>
<para>Switching mode could be chosen with the <emphasis>
@@ -128,13 +128,13 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu mode="server">
- <rich:panelMenuGroup label="test Group" action="#{bean.action}">
- <rich:panelMenuItem label="test" action="#{capitalsBean.action}">
- <f:param value="test value" name="test"/>
- </rich:panelMenuItem>
- </rich:panelMenuGroup>
- </rich:panelMenu>
+<rich:panelMenu mode="server">
+ <rich:panelMenuGroup label="test Group" action="#{bean.action}">
+ <rich:panelMenuItem label="test" action="#{capitalsBean.action}">
+ <f:param value="test value" name="test"/>
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+</rich:panelMenu>
...]]></programlisting>
<itemizedlist>
<listitem>
@@ -149,13 +149,13 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu mode="ajax">
- <rich:panelMenuGroup label="test Group" action="#{bean.action}">
- <rich:panelMenuItem label="test" reRender="test" action="#{capitalsBean.action}">
- <f:param value="test value" name="test"/>
- </rich:panelMenuItem>
- </rich:panelMenuGroup>
- </rich:panelMenu>
+<rich:panelMenu mode="ajax">
+ <rich:panelMenuGroup label="test Group" action="#{bean.action}">
+ <rich:panelMenuItem label="test" reRender="test" action="#{capitalsBean.action}">
+ <f:param value="test value" name="test"/>
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+</rich:panelMenu>
...]]></programlisting>
<itemizedlist>
<listitem>
@@ -174,11 +174,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu event="onclick" submitMode="none">
- <rich:panelMenuItem label="Link to external page">
- <h:outputLink ... >
- <rich:panelMenuItem>
- </rich:panelMenu>
+<rich:panelMenu event="onclick" submitMode="none">
+ <rich:panelMenuItem label="Link to external page">
+ <h:outputLink ... >
+ <rich:panelMenuItem>
+</rich:panelMenu>
...]]></programlisting>
<note><title>Note:</title><para> As the <emphasis role="bold">
@@ -214,12 +214,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu selectedChild="thisChild">
- <rich:panelMenuGroup label="Group1" name="thisChild">
- <!--Nested panelMenu components-->
- </rich:panelMenuGroup>
- </rich:panelMenu>
- ...]]></programlisting>
+<rich:panelMenu selectedChild="thisChild">
+ <rich:panelMenuGroup label="Group1" name="thisChild">
+ <!--Nested panelMenu components-->
+ </rich:panelMenuGroup>
+</rich:panelMenu>
+...]]></programlisting>
<para>
The <emphasis>
<property>"label"</property>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -62,11 +62,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu>
- <rich:panelMenuGroup label="Group1">
- <!--Nested panelMenu components-->
- </rich:panelMenuGroup>
- </rich:panelMenu>
+<rich:panelMenu>
+ <rich:panelMenuGroup label="Group1">
+ <!--Nested panelMenu components-->
+ </rich:panelMenuGroup>
+</rich:panelMenu>
...]]></programlisting>
</section>
@@ -153,11 +153,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu>
- <rich:panelMenuGroup label="Group1" iconExpanded="disc" iconCollapsed="chevron">
- <!--Nested panelMenu components-->
- </rich:panelMenuGroup>
- </rich:panelMenu>
+<rich:panelMenu>
+ <rich:panelMenuGroup label="Group1" iconExpanded="disc" iconCollapsed="chevron">
+ <!--Nested panelMenu components-->
+ </rich:panelMenuGroup>
+</rich:panelMenu>
...]]></programlisting>
<para> As the result the pictures are shown below. The first one represents the collapsed state,
the second one - expanded state:</para>
@@ -185,11 +185,11 @@
<para>It's also possible to define a path to the icon. Simple code is placed below.</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu>
- <rich:panelMenuGroup label="Group1" iconExpanded="\images\img1.png" iconCollapsed="\images\img2.png">
- <!--Nested menu components-->
- </rich:panelMenuGroup>
- </rich:panelMenu>
+<rich:panelMenu>
+ <rich:panelMenuGroup label="Group1" iconExpanded="\images\img1.png" iconCollapsed="\images\img2.png">
+ <!--Nested menu components-->
+ </rich:panelMenuGroup>
+</rich:panelMenu>
...]]></programlisting>
<para>
Information about the <emphasis><property>"process"</property></emphasis> attribute usage you can find <link linkend="process">" Decide what to process " </link> guide section.
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -62,11 +62,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu>
- ...
- <rich:panelMenuItem value="Item1"/>
- ...
- </rich:panelMenu>
+<rich:panelMenu>
+ ...
+ <rich:panelMenuItem value="Item1"/>
+ ...
+</rich:panelMenu>
...]]></programlisting>
</section>
@@ -135,15 +135,15 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu>
- ...
- <rich:panelMenuItem mode="none" onclick="document.location.href='http://labs.jboss.com/jbossrichfaces/">
- <h:outputLink value="http://labs.jboss.com/jbossrichfaces/">
- <h:outputText value="RichFaces Home Page"></h:outputText>
- </h:outputLink>
- </rich:panelMenuItem>
- ...
- </rich:panelMenu>
+<rich:panelMenu>
+ ...
+ <rich:panelMenuItem mode="none" onclick="document.location.href='http://labs.jboss.com/jbossrichfaces/">
+ <h:outputLink value="http://labs.jboss.com/jbossrichfaces/">
+ <h:outputText value="RichFaces Home Page"></h:outputText>
+ </h:outputLink>
+ </rich:panelMenuItem>
+ ...
+</rich:panelMenu>
...]]></programlisting>
<para>There are two icon-related attributes. The <emphasis>
@@ -194,11 +194,11 @@
placed below.</para>
<programlisting role="XML"><![CDATA[...
- <rich:panelMenu>
- ...
- <rich:panelMenuItem value="Item 1.1" icon="\images\img1.png" />
- ...
- </rich:panelMenu>
+<rich:panelMenu>
+ ...
+ <rich:panelMenuItem value="Item 1.1" icon="\images\img1.png" />
+ ...
+</rich:panelMenu>
...]]></programlisting>
<para> Information about the <emphasis>
<property>"process"</property>
@@ -493,7 +493,7 @@
</para>
<programlisting role="CSS"><![CDATA[...
.rich-pmenu-hovered-element {
- background-color: #ff7800;
+ background-color: #ff7800;
}
...]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/pickList.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/pickList.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/pickList.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -112,8 +112,8 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:pickList copyAllControlLabel = "#{pickBean.copyAllLabel}" copyControlLabel = "#{pickBean.copyLabel}" removeControlLabel = "#{pickBean.removeLabel}"
-removeAllControlLabel ="#{pickBean.removeAllLabel}" value="#{pickBean.listValues}">
+<rich:pickList copyAllControlLabel = "#{pickBean.copyAllLabel}" copyControlLabel = "#{pickBean.copyLabel}"
+ removeControlLabel = "#{pickBean.removeLabel}" removeAllControlLabel ="#{pickBean.removeAllLabel}" value="#{pickBean.listValues}">
<f:selectItem itemValue="Bentley" itemLabel="Bentley"/>
<f:selectItem itemValue="Audi" itemLabel="Audi"/>
<f:selectItems value="#{pickBean.sourceList}"/>
@@ -159,9 +159,9 @@
<f:facet name="removeAllControl">
<h:commandButton value="#{pickBean.removeAllLabel}" />
</f:facet>
- <f:selectItem itemValue="Bentley" itemLabel="Bentley"/>
- <f:selectItem itemValue="Audi" itemLabel="Audi"/>
- <f:selectItems value="#{pickBean.sourceList}"/>
+ <f:selectItem itemValue="Bentley" itemLabel="Bentley"/>
+ <f:selectItem itemValue="Audi" itemLabel="Audi"/>
+ <f:selectItems value="#{pickBean.sourceList}"/>
</rich:pickList>
...]]></programlisting>
<para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/portlet.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/portlet.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/portlet.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -35,9 +35,9 @@
<title>Creating the Component with a Page Tag</title>
<para>To create the simplest variant on a page use the following syntax:</para>
<programlisting role="XML"><![CDATA[<f:view>
- <a4j:portlet>
- ...
- </a4j:portlet>
+ <a4j:portlet>
+ ...
+ </a4j:portlet>
</f:view>]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/progressBar.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/progressBar.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/progressBar.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -691,7 +691,7 @@
</para>
<programlisting role="CSS"><![CDATA[...
.myClass{
-background-color: #ebf3fd;
+ background-color: #ebf3fd;
}
...]]></programlisting>
<para>The <emphasis><property>"styleClass"</property></emphasis> attribute for <emphasis role="bold"
@@ -722,7 +722,7 @@
</para>
<programlisting role="CSS"><![CDATA[...
.rich-progress-bar-uploaded {
-background-image : url(images/accept.gif);
+ background-image : url(images/accept.gif);
}
...]]></programlisting>
<para>This is the result:</para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/push.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/push.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/push.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -90,11 +90,11 @@
</para>
<programlisting role="JAVA"><![CDATA[...
public void addListener(EventListener listener) {
-synchronized (listener) {
- if (this.listener != listener) {
- this.listener = (PushEventListener) listener;
- }
- }
+ synchronized (listener) {
+ if (this.listener != listener) {
+ this.listener = (PushEventListener) listener;
+ }
+ }
}
...]]></programlisting>
@@ -105,16 +105,16 @@
</para>
<programlisting role="XML"><![CDATA[...
<a4j:status startText="in progress" stopText="done"/>
- <a4j:form>
- <a4j:region>
- <a4j:push reRender="msg" eventProducer="#{pushBean.addListener}" interval="2000"/>
- </a4j:region>
- <a4j:outputPanel id="msg" >
- <h:outputText value="#{pushBean.date}">
- <f:convertDateTime type="time"/>
- </h:outputText>
- </a4j:outputPanel>
- <a4j:commandButton value="Push!!" action="#{pushBean.push}" ajaxSingle="true"/>
+<a4j:form>
+ <a4j:region>
+ <a4j:push reRender="msg" eventProducer="#{pushBean.addListener}" interval="2000"/>
+ </a4j:region>
+ <a4j:outputPanel id="msg">
+ <h:outputText value="#{pushBean.date}">
+ <f:convertDateTime type="time"/>
+ </h:outputText>
+ </a4j:outputPanel>
+ <a4j:commandButton value="Push!!" action="#{pushBean.push}" ajaxSingle="true"/>
</a4j:form>
...]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/queue.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/queue.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/queue.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -176,7 +176,7 @@
<emphasis role="bold"> Example: </emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<h:form >
+<h:form>
<a4j:queue oncomplete="alert(request.queue.getSize())" requestDelay="1000" />
<h:inputText value="#{bean.a}">
<a4j:support event="onkeyup" />
@@ -186,7 +186,7 @@
</h:selectBooleanCheckbox>
</h:form>
...]]></programlisting>
-
+
<para>In this example you can see how the number of requests waiting in the queue change. You will get a message with the number of the requests in the queue.</para>
<para>The <emphasis><property>"onbeforedomupdate"</property></emphasis> event handler called before
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -109,9 +109,9 @@
</rich:treeNode>
</rich:treeNodesAdaptor>
<rich:recursiveTreeNodesAdaptor id="archiveEntry" var="archiveEntry"
- roots="#{dir.files}" nodes="#{archiveEntry.archiveEntries}"
- includedRoot="#{archiveEntry.class.simpleName == 'ArchiveFile'}"
- includedNode="#{archiveEntry.class.simpleName == 'ArchiveEntry'}">
+ roots="#{dir.files}" nodes="#{archiveEntry.archiveEntries}"
+ includedRoot="#{archiveEntry.class.simpleName == 'ArchiveFile'}"
+ includedNode="#{archiveEntry.class.simpleName == 'ArchiveEntry'}">
<rich:treeNode id="archiveEntryNode">
<h:commandLink action="#{archiveEntry.click}" value="Archive entry: #{archiveEntry.name}" />
</rich:treeNode>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/region.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/region.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/region.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -103,9 +103,9 @@
...
<a4j:region>
<a4j:commandLink value="Link 1" id="link1"/>
- <a4j:region>
- <a4j:commandLink value="Link 2" id="link2"/>
- </a4j:region >
+ <a4j:region>
+ <a4j:commandLink value="Link 2" id="link2"/>
+ </a4j:region >
</a4j:region>
...
<h:form>]]></programlisting>
@@ -150,7 +150,7 @@
</para>
<programlisting role="XML"><![CDATA[<a4j:region selfRendered ="true">
<a4j:commandLink value="Link" id="link"/>
- <!--Some HTML content-->
+ <!--Some HTML content-->
</a4j:region>]]></programlisting>
<para>In this case the processing is quicker and going on without referring to the page code.
The HTML code is not saved in a component tree and could be lost.
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_page.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_page.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_page.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -48,7 +48,7 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:page>
- <!-- page body -->
+ <!-- page body -->
</rich:page>
...]]></programlisting>
</section>
@@ -138,7 +138,6 @@
<!-- footer content -->
</f:facet>
</rich:page>
-
...]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -49,9 +49,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:scrollableDataTable value="#{dataTableScrollerBean.allCars}" var="category">
- <!--...//Set of columns and header/footer facets-->
- </rich:scrollableDataTable>
+<rich:scrollableDataTable value="#{dataTableScrollerBean.allCars}" var="category">
+ <!--Set of columns and header/footer facets-->
+</rich:scrollableDataTable>
...
]]></programlisting>
</section>
@@ -139,7 +139,7 @@
<h:outputText value="State"/>
</f:facet>
</rich:column>
- <!--...//Set of columns and header/footer facets-->
+ <!--Set of columns and header/footer facets-->
</rich:scrollableDataTable>
...
]]></programlisting>
@@ -164,52 +164,52 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <h:form>
- <rich:spacer height="30" />
- <rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1" height="200px"
- width="300px" id="carList" rows="40" columnClasses="col"
- value="#{dataTableScrollerBean.allCars}" var="category" sortMode="single"
- selection="#{dataTableScrollerBean.selection}">
- <rich:column id="make">
- <f:facet name="header"><h:outputText styleClass="headerText" value="Make" /></f:facet>
- <h:outputText value="#{category.make}" />
- </rich:column>
- <rich:column id="model">
- <f:facet name="header"><h:outputText styleClass="headerText" value="Model" /></f:facet>
- <h:outputText value="#{category.model}" />
- </rich:column>
- <rich:column id="price">
- <f:facet name="header"><h:outputText styleClass="headerText" value="Price" /></f:facet>
- <h:outputText value="#{category.price}" />
- </rich:column>
+<h:form>
+ <rich:spacer height="30" />
+ <rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1" height="200px"
+ width="300px" id="carList" rows="40" columnClasses="col"
+ value="#{dataTableScrollerBean.allCars}" var="category" sortMode="single"
+ selection="#{dataTableScrollerBean.selection}">
+ <rich:column id="make">
+ <f:facet name="header"><h:outputText styleClass="headerText" value="Make" /></f:facet>
+ <h:outputText value="#{category.make}" />
+ </rich:column>
+ <rich:column id="model">
+ <f:facet name="header"><h:outputText styleClass="headerText" value="Model" /></f:facet>
+ <h:outputText value="#{category.model}" />
+ </rich:column>
+ <rich:column id="price">
+ <f:facet name="header"><h:outputText styleClass="headerText" value="Price" /></f:facet>
+ <h:outputText value="#{category.price}" />
+ </rich:column>
</rich:scrollableDataTable>
- <rich:spacer height="20px"/>
- <a4j:commandButton value="Show Current Selection" reRender="table"
- action="#{dataTableScrollerBean.takeSelection}"
- oncomplete="javascript:Richfaces.showModalPanel('panel');"/>
- </h:form>
- <rich:modalPanel id="panel" autosized="true">
- <f:facet name="header">
- <h:outputText value="Selected Rows"/>
- </f:facet>
- <f:facet name="controls">
- <span style="cursor:pointer" onclick="javascript:Richfaces.hideModalPanel('panel')">X</span>
- </f:facet>
- <rich:dataTable value="#{dataTableScrollerBean.selectedCars}" var="sel" id="table">
+ <rich:spacer height="20px"/>
+ <a4j:commandButton value="Show Current Selection" reRender="table"
+ action="#{dataTableScrollerBean.takeSelection}"
+ oncomplete="javascript:Richfaces.showModalPanel('panel');"/>
+</h:form>
+<rich:modalPanel id="panel" autosized="true">
+ <f:facet name="header">
+ <h:outputText value="Selected Rows"/>
+ </f:facet>
+ <f:facet name="controls">
+ <span style="cursor:pointer" onclick="javascript:Richfaces.hideModalPanel('panel')">X</span>
+ </f:facet>
+ <rich:dataTable value="#{dataTableScrollerBean.selectedCars}" var="sel" id="table">
<rich:column>
- <f:facet name="header"><h:outputText value="Make" /></f:facet>
- <h:outputText value="#{sel.make}" />
+ <f:facet name="header"><h:outputText value="Make" /></f:facet>
+ <h:outputText value="#{sel.make}" />
</rich:column>
<rich:column id="model">
- <f:facet name="header"><h:outputText value="Model" /></f:facet>
- <h:outputText value="#{sel.model}" />
+ <f:facet name="header"><h:outputText value="Model" /></f:facet>
+ <h:outputText value="#{sel.model}" />
</rich:column>
<rich:column id="price">
- <f:facet name="header"><h:outputText value="Price" /></f:facet>
- <h:outputText value="#{sel.price}" />
+ <f:facet name="header"><h:outputText value="Price" /></f:facet>
+ <h:outputText value="#{sel.price}" />
</rich:column>
- </rich:dataTable>
- </rich:modalPanel>
+ </rich:dataTable>
+</rich:modalPanel>
...]]></programlisting>
<para>This is a result:</para>
<figure>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/spacer.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/spacer.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/spacer.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,7 +50,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:spacer/>
+<rich:spacer/>
...]]></programlisting>
</section>
<section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/status.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/status.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/status.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -51,12 +51,12 @@
<listitem><para>
With <emphasis><property>"Start"</property></emphasis>/<emphasis><property>"Stop"</property></emphasis > facets definition:</para>
<programlisting role="XML"><![CDATA[<a4j:status for="stat2">
- <f:facet name="start">
- <h:graphicImage value="ajax_process.png" />
- </f:facet>
- <f:facet name="stop">
- <h:graphicImage value="ajax_stoped.png" />
- </f:facet>
+ <f:facet name="start">
+ <h:graphicImage value="ajax_process.png" />
+ </f:facet>
+ <f:facet name="stop">
+ <h:graphicImage value="ajax_stoped.png" />
+ </f:facet>
</a4j:status>]]></programlisting>
<para>In this case, the elements are generated for each status and correspond the facets content.</para>
</listitem>
@@ -131,17 +131,17 @@
</para>
<programlisting role="XML"><![CDATA[<a4j:status startText="Started" stopText="stopped" />]]></programlisting>
<para>The code shown in the example above is decoded on a page as:</para><programlisting role="XML"><![CDATA[<span id="j_id20:status.start" style="display: none">
- Started
+ Started
</span>
<span id="j_id20:status.stop">
- Stopped
+ Stopped
</span>]]></programlisting>
<para>and after the generation of an Ajax response is changed to:</para>
<programlisting role="XML"><![CDATA[<span id="j_id20:status.start">
- Started
+ Started
</span>
<span id="j_id20:status.stop" style="display: none">
- Stopped
+ Stopped
</span>]]></programlisting>
<para>There is a possibility to group a <emphasis role="bold"><property><a4j:status></property></emphasis> elements content into <emphasis role="bold"><property><div></property></emphasis> elements, instead of <emphasis role="bold"><property><span></property></emphasis>. To use it, just redefine the <emphasis >
<property>"layout"</property>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/subTable.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/subTable.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/subTable.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -49,16 +49,16 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="capitals">
- <rich:column>
- ...
- </rich:column>
- <rich:subTable value=#{capitals.details} var="detail">
- <rich:column>
- ...
- </rich:column>
- </rich:subTable>
- </rich:dataTable>
+<rich:dataTable value="#{capitalsBean.capitals}" var="capitals">
+ <rich:column>
+ ...
+ </rich:column>
+ <rich:subTable value=#{capitals.details} var="detail">
+ <rich:column>
+ ...
+ </rich:column>
+ </rich:subTable>
+</rich:dataTable>
...
]]></programlisting>
</section>
@@ -100,18 +100,18 @@
</para>
<programlisting role="XML"><![CDATA[...
- <rich:dataTable value="#{capitalsBean.capitals}" var="capitals">
- <rich:column>
- ...
- </rich:column>
- <rich:subTable value="#{capitals.details}" var="detail" ajaxKeys="#{bean.ajaxSet}" binding="#{bean.subtable}" id="subtable">
- <rich:column>
- ...
- </rich:column>
- </rich:subTable>
- </rich:dataTable>
+<rich:dataTable value="#{capitalsBean.capitals}" var="capitals">
+ <rich:column>
+ ...
+ </rich:column>
+ <rich:subTable value="#{capitals.details}" var="detail" ajaxKeys="#{bean.ajaxSet}" binding="#{bean.subtable}" id="subtable">
+ <rich:column>
+ ...
+ </rich:column>
+ </rich:subTable>
+</rich:dataTable>
...
- <a4j:commandButton action="#{tableBean.action}" reRender="subtable"/>
+<a4j:commandButton action="#{tableBean.action}" reRender="subtable"/>
...
]]></programlisting>
<para> In the example <emphasis>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/suggestionbox.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,12 +50,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <h:inputText value="#{bean.property}" id="suggest"/>
- <rich:suggestionbox for="suggest" suggestionAction="#{bean.autocomplete}" var="suggest">
- <h:column>
- <h:outputText value="#{suggest.text}"/>
- </h:column>
- </rich:suggestionbox>
+<h:inputText value="#{bean.property}" id="suggest"/>
+<rich:suggestionbox for="suggest" suggestionAction="#{bean.autocomplete}" var="suggest">
+ <h:column>
+ <h:outputText value="#{suggest.text}"/>
+ </h:column>
+</rich:suggestionbox>
...
]]></programlisting>
<para>Here is the <code>bean.autocomplete</code> method that returns the
@@ -66,10 +66,10 @@
</para>
<programlisting role="JAVA"><![CDATA[public List autocomplete(Object event) {
String pref = event.toString();
- //collecting some data that begins with "pref" letters.
- ...
- return result;
- }
+ //Collecting some data that begins with "pref" letters
+ ...
+ return result;
+}
]]></programlisting>
</section>
<section>
@@ -128,14 +128,14 @@
screenshot, could get any collection for an output and outputs it in a
ToolTip window the same as a custom dataTable (in several columns)</para>
<programlisting role="XML"><![CDATA[...
- <rich:suggestionbox for="test" suggestionAction="#{bean.autocomplete}" var="cit" fetchValue="#{cit.text}">
- <h:column>
- <h:outputText value="#{cit.label}"/>
- </h:column>
- <h:column>
- <h:outputText value="#{cit.text}"/>
- </h:column>
- </rich:suggestionbox>
+<rich:suggestionbox for="test" suggestionAction="#{bean.autocomplete}" var="cit" fetchValue="#{cit.text}">
+ <h:column>
+ <h:outputText value="#{cit.label}"/>
+ </h:column>
+ <h:column>
+ <h:outputText value="#{cit.text}"/>
+ </h:column>
+</rich:suggestionbox>
...
]]></programlisting>
<para>It looks on a page in the following way:</para>
@@ -160,11 +160,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:suggestionbox for="test" suggestionAction="#{bean.autocomplete}" var="cit" selfRendered="true" tokens=",">
- <h:column>
- <h:outputText value="#{cit.text}"/>
- </h:column>
- </rich:suggestionbox>
+<rich:suggestionbox for="test" suggestionAction="#{bean.autocomplete}" var="cit" selfRendered="true" tokens=",">
+ <h:column>
+ <h:outputText value="#{cit.text}"/>
+ </h:column>
+</rich:suggestionbox>
...
]]></programlisting>
<para>This example shows that when a city is chosen and a comma and first letter
@@ -209,11 +209,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:suggestionbox nothingLabel="Empty" for="test" suggestionAction="#{bean.autocomplete}" var="cit">
- <h:column>
- <h:outputText value="#{cit.text}"/>
- </h:column>
- </rich:suggestionbox>
+<rich:suggestionbox nothingLabel="Empty" for="test" suggestionAction="#{bean.autocomplete}" var="cit">
+ <h:column>
+ <h:outputText value="#{cit.text}"/>
+ </h:column>
+</rich:suggestionbox>
...
]]></programlisting>
<para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/support.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/support.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/support.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -67,11 +67,11 @@
<programlisting role="JAVA"><![CDATA[HtmlInputText inputText = new HtmlInputText();
...
HtmlAjaxSupport ajaxSupport = new HtmlAjaxSupport();
- ajaxSupport.setActionExpression(FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createMethodExpression(
+ajaxSupport.setActionExpression(FacesContext.getCurrentInstance().getApplication().getExpressionFactory().createMethodExpression(
FacesContext.getCurrentInstance().getELContext(), "#{bean.action}", String.class, new Class[] {}));
- ajaxSupport.setEvent("onkeyup");
- ajaxSupport.setReRender("output");
- inputText.getFacets().put("a4jsupport", ajaxSupport);
+ajaxSupport.setEvent("onkeyup");
+ajaxSupport.setReRender("output");
+inputText.getFacets().put("a4jsupport", ajaxSupport);
]]></programlisting>
</section>
<section>
@@ -130,7 +130,7 @@
<f:selectItem itemValue="First Item" itemLabel="First Item"/>
<f:selectItem itemValue=" Second Item" itemLabel="Second Item"/>
<f:selectItem itemValue=" Third Item" itemLabel="Third Item"/>
- <a4j:support event="onblur" reRender="panel" onsubmit="if(!confirm('Are you sure to change the option ?')) {form.reset(); return false;}" oncomplete="alert('Value succesfully stored')"/>
+ <a4j:support event="onblur" reRender="panel" onsubmit="if(!confirm('Are you sure to change the option ?')) {form.reset(); return false;}" oncomplete="alert('Value succesfully stored')"/>
</h:selectOneMenu>]]></programlisting>
<para>In example there is the condition checking (confirm) is used before
request sending and message printing after the request processing is
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tab.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tab.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tab.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -49,12 +49,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:tabPanel>
- <!--Set of Tabs inside-->
- <rich:tab>
- ...
- </rich:tab>
- </rich:tabPanel>
+<rich:tabPanel>
+ <!--Set of Tabs inside-->
+ <rich:tab>
+ ...
+ </rich:tab>
+</rich:tabPanel>
...
]]></programlisting>
</section>
@@ -89,14 +89,14 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:tab>
- <f:facet name="label">
- <h:graphicImage value="/images/img1.png"/>
- </f:facet>
- ...
- <!--Any Content inside-->
- ...
- </rich:tab>
+<rich:tab>
+ <f:facet name="label">
+ <h:graphicImage value="/images/img1.png"/>
+ </f:facet>
+ ...
+ <!--Any Content inside-->
+ ...
+</rich:tab>
...
]]></programlisting>
@@ -112,21 +112,21 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:tabPanel width="20%">
- <tabs:tab label="Canon">
- <h:outputText value="Canon EOS Digital Rebel XT" />
- ...
- </tabs:tab>
- <tabs:tab label="Nikon">
- <h:outputText value="Nikon D70s" />
- ...
+<rich:tabPanel width="20%">
+ <tabs:tab label="Canon">
+ <h:outputText value="Canon EOS Digital Rebel XT" />
+ ...
+ </tabs:tab>
+ <tabs:tab label="Nikon">
+ <h:outputText value="Nikon D70s" />
+ ...
</tabs:tab>
<tabs:tab label="Olympus">
- <h:outputText value="Olympus EVOLT E-500" />
- ...
- </tabs:tab>
- <tabs:tab disabled="true" name="disabled" label="Disabled"/>
- </rich:tabPanel>
+ <h:outputText value="Olympus EVOLT E-500" />
+ ...
+ </tabs:tab>
+ <tabs:tab disabled="true" name="disabled" label="Disabled"/>
+</rich:tabPanel>
...]]></programlisting>
<para>With this example it's possible to generate the <property>tab
panel</property> with the last disabled and three active
@@ -188,12 +188,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:tabPanel>
- <rich:tab label="Tab1" ontabenter="alert()">
- ...
- </rich:tab>
- ...
- </rich:tabPanel>
+<rich:tabPanel>
+ <rich:tab label="Tab1" ontabenter="alert()">
+ ...
+ </rich:tab>
+ ...
+</rich:tabPanel>
...]]></programlisting>
<para> The following example shows how on the client side to get the names of
<code>entered</code>/<code>left</code> tabs. </para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tabPanel.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tabPanel.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tabPanel.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,12 +50,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:tabPanel>
- <!--//Set of Tabs inside-->
- <rich:tab>
- ...
- </rich:tab>
- </rich:tabPanel>
+<rich:tabPanel>
+ <!--Set of Tabs inside-->
+ <rich:tab>
+ ...
+ </rich:tab>
+</rich:tabPanel>
...
]]></programlisting>
</section>
@@ -141,17 +141,17 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:tabPanel width="40%" headerAlignment="right">
- <rich:tab label="Canon">
- ...
- </rich:tab>
- <rich:tab label="Nikon">
- ...
- </rich:tab>
- <rich:tab label="Olympus">
- ...
- </rich:tab>
- </rich:tabPanel>
+<rich:tabPanel width="40%" headerAlignment="right">
+ <rich:tab label="Canon">
+ ...
+ </rich:tab>
+ <rich:tab label="Nikon">
+ ...
+ </rich:tab>
+ <rich:tab label="Olympus">
+ ...
+ </rich:tab>
+</rich:tabPanel>
...
]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toggleControl.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toggleControl.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toggleControl.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -51,11 +51,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:toggleControl for="panel"/>
- ...
- <rich:togglePanel id="panel" stateOrder="[facets order to be switched]">
- <!--//Set of Facets-->
- </rich:togglePanel>
+<rich:toggleControl for="panel"/>
+ ...
+ <rich:togglePanel id="panel" stateOrder="[facets order to be switched]">
+ <!--Set of Facets-->
+ </rich:togglePanel>
...
]]></programlisting>
</section>
@@ -85,28 +85,28 @@
><property>"switchOrder"</property></emphasis> attribute of <emphasis role="bold"><property><rich:togglePanel></property>.</emphasis></para>
<para><emphasis role="bold">Example:</emphasis></para>
<programlisting role="XML"><![CDATA[...
- <rich:togglePanel id="panel" initialState="empty" switchType="client">
- <f:facet name="first">
- <h:panelGroup>
- <rich:toggleControl for="helloForm:panel" value="Empty" switchToState="empty"/>
- <rich:toggleControl for="helloForm:panel" value=" Second" switchToState="second"/>
- ...//Some Content
- </h:panelGroup>
- </f:facet>
- <f:facet name="second">
- <h:panelGroup>
- <rich:toggleControl for="helloForm:panel" value="Empty" switchToState="empty"/>
- <rich:toggleControl for="helloForm:panel" value=" first" switchToState="first"/>
- ...//Some Content
- </h:panelGroup>
- </f:facet>
- <f:facet name="empty">
- <h:panelGroup>
- <rich:toggleControl for="helloForm:panel" value="first" switchToState="first"/>
- <rich:toggleControl for="helloForm:panel" value=" second" switchToState="second"/>
- </h:panelGroup>
- </f:facet>
- </rich:togglePanel>
+<rich:togglePanel id="panel" initialState="empty" switchType="client">
+ <f:facet name="first">
+ <h:panelGroup>
+ <rich:toggleControl for="helloForm:panel" value="Empty" switchToState="empty"/>
+ <rich:toggleControl for="helloForm:panel" value=" Second" switchToState="second"/>
+ <!--Some content-->
+ </h:panelGroup>
+ </f:facet>
+ <f:facet name="second">
+ <h:panelGroup>
+ <rich:toggleControl for="helloForm:panel" value="Empty" switchToState="empty"/>
+ <rich:toggleControl for="helloForm:panel" value=" first" switchToState="first"/>
+ <!--Some content-->
+ </h:panelGroup>
+ </f:facet>
+ <f:facet name="empty">
+ <h:panelGroup>
+ <rich:toggleControl for="helloForm:panel" value="first" switchToState="first"/>
+ <rich:toggleControl for="helloForm:panel" value=" second" switchToState="second"/>
+ </h:panelGroup>
+ </f:facet>
+</rich:togglePanel>
...
]]></programlisting>
<para>In this example the switching is performed on facets specified in the <emphasis
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/togglePanel.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/togglePanel.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/togglePanel.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,18 +50,18 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:togglePanel>
- <f:facet name="first">
- ...
- </f:facet>
- <f:facet name="second">
- ...
- </f:facet>
- ...
- </rich:togglePanel>
- ...
- <!--//Set of the toggleControls somewhere on a page.-->
+<rich:togglePanel>
+ <f:facet name="first">
+ ...
+ </f:facet>
+ <f:facet name="second">
+ ...
+ </f:facet>
+ ...
+</rich:togglePanel>
...
+<!--Set of the toggleControls somewhere on a page-->
+...
]]></programlisting>
</section>
<section>
@@ -141,19 +141,19 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:togglePanel id="panel" initialState="panelB" switchType="client"
+<rich:togglePanel id="panel" initialState="panelB" switchType="client"
stateOrder="panelA,panelB,panelC">
- <f:facet name="panelA">
- ...
+ <f:facet name="panelA">
+ ...
</f:facet>
<f:facet name="panelB">
- ...
+ ...
</f:facet>
<f:facet name="panelC">
- ...
+ ...
</f:facet>
- </rich:togglePanel>
- <rich:toggleControl for="panel" value="Switch"/>
+</rich:togglePanel>
+<rich:toggleControl for="panel" value="Switch"/>
...
]]></programlisting>
<para>The example shows a <property>togglePanel</property> initial state when
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolBar.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolBar.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolBar.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,9 +50,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:toolBar>
- <!--//...Set of action or other JSF components-->
- </rich:toolBar>
+<rich:toolBar>
+ <!--Set of action or other JSF components-->
+</rich:toolBar>
...
]]></programlisting>
</section>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolBarGroup.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolBarGroup.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolBarGroup.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,16 +50,16 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:toolBar>
- ...
- <rich:toolBarGroup>
- <!--...Set of action or other JSF components-->
- </rich:toolBarGroup>
- <rich:toolBarGroup>
- <!--...Set of action or other JSF components-->
- </rich:toolBarGroup>
- ...
- </rich:toolBar>
+<rich:toolBar>
+ ...
+ <rich:toolBarGroup>
+ <!--Set of action or other JSF components-->
+ </rich:toolBarGroup>
+ <rich:toolBarGroup>
+ <!--Set of action or other JSF components-->
+ </rich:toolBarGroup>
+ ...
+</rich:toolBar>
...
]]></programlisting>
</section>
@@ -95,16 +95,16 @@
><property>"location"</property></emphasis> attribute with "left" (DEFAULT) and "right" values.</para>
<para><emphasis role="bold">Example:</emphasis></para>
<programlisting role="XML"><![CDATA[...
- <rich:toolBar itemSeparator="disc" width="500">
- <rich:toolBarGroup itemSeparator="line">
- <h:commandLink value="Command 1.1"/>
- <h:commandLink value="Command 2.1"/>
- </rich:toolBarGroup>
- <rich:toolBarGroup itemSeparator="line" location="right">
- <h:commandLink value="Command 1.2"/>
- <h:commandLink value="Command 2.2"/>
- </rich:toolBarGroup>
- </rich:toolBar>
+<rich:toolBar itemSeparator="disc" width="500">
+ <rich:toolBarGroup itemSeparator="line">
+ <h:commandLink value="Command 1.1"/>
+ <h:commandLink value="Command 2.1"/>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup itemSeparator="line" location="right">
+ <h:commandLink value="Command 1.2"/>
+ <h:commandLink value="Command 2.2"/>
+ </rich:toolBarGroup>
+</rich:toolBar>
...
]]></programlisting>
<para>The code result is the following:</para>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolTip.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolTip.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/toolTip.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -398,7 +398,6 @@
.rich-tool-tip{
background-color: #eef2f8;
border-color: #7196c8;
-
}
...]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tree.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tree.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/tree.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -415,7 +415,7 @@
<programlisting role="XML"><![CDATA[...
<h:form>
<rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
- ...
+ ...
<rich:treeNode type="album" iconLeaf="/images/tree/album.gif" icon="/images/tree/album.gif"
rendered="#{item.exist}">
<h:outputText value="#{item.name}" />
@@ -424,7 +424,7 @@
rendered="#{not item.exist}">
<h:outputText value="#{item.name}" />
</rich:treeNode>
- ...
+ ...
</rich:tree>
</h:form>
...]]></programlisting>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/treeNode.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/treeNode.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/treeNode.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -50,11 +50,11 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:tree ... faceNode="simpleNode">
- <rich:treeNode type="simpleNode">
- <!--Tree node data displaying template-->
- </rich:treeNode>
- </rich:tree>
+<rich:tree ... faceNode="simpleNode">
+ <rich:treeNode type="simpleNode">
+ <!--Tree node data displaying template-->
+ </rich:treeNode>
+</rich:tree>
...
]]></programlisting>
</section>
@@ -85,24 +85,24 @@
facets contents are used as icons. The width of a rendered facet area is 16px. </para>
<programlisting role="XML"><![CDATA[...
- <rich:tree ...>
- ...
- <rich:treeNode ...>
- <f:facet name="icon">
- <outputText value="A"/>
- </f:facet>
- <f:facet name="iconCollapsed">
- <outputText value="B"/>
- </f:facet>
- <f:facet name="iconExpanded">
- <outputText value="C"/>
- </f:facet>
- <f:facet name="iconLeaf">
- <outputText value="D"/>
- </f:facet>
- </rich:treeNode>
- ...
- </rich:tree>
+<rich:tree ...>
+ ...
+ <rich:treeNode ...>
+ <f:facet name="icon">
+ <outputText value="A"/>
+ </f:facet>
+ <f:facet name="iconCollapsed">
+ <outputText value="B"/>
+ </f:facet>
+ <f:facet name="iconExpanded">
+ <outputText value="C"/>
+ </f:facet>
+ <f:facet name="iconLeaf">
+ <outputText value="D"/>
+ </f:facet>
+ </rich:treeNode>
+ ...
+</rich:tree>
...
]]></programlisting>
<para>As it has been mentioned <link linkend="treeNode">above</link>, <emphasis role="bold"><property><rich:treeNode></property></emphasis> defines a template for nodes
@@ -112,12 +112,12 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:tree ... faceNode="simpleNode" ... value="#{bean.data}" var="data">
- <rich:treeNode type="simpleNode">
- <h:outputText value="context-param:"/>
- <h:inputText value="#{data.name}"/>
- </rich:treeNode>
- </rich:tree >
+<rich:tree ... faceNode="simpleNode" ... value="#{bean.data}" var="data">
+ <rich:treeNode type="simpleNode">
+ <h:outputText value="context-param:"/>
+ <h:inputText value="#{data.name}"/>
+ </rich:treeNode>
+</rich:tree>
...
]]></programlisting>
<figure>
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/virtualEarth.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/virtualEarth.xml 2009-06-10 00:26:34 UTC (rev 14576)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/virtualEarth.xml 2009-06-10 09:06:32 UTC (rev 14577)
@@ -54,7 +54,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:virtualEarth lat="..." lng="..."/>
+<rich:virtualEarth lat="..." lng="..."/>
...
]]></programlisting>
</section>
@@ -144,7 +144,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:virtualEarth style="width:800px;" id="vm" lat="48.833" lng="2.40"
+<rich:virtualEarth style="width:800px;" id="vm" lat="48.833" lng="2.40"
dashboardSize="Normal" zoom="11" mapStyle="Hybrid" var="map" />
...
]]></programlisting>
@@ -273,14 +273,11 @@
Here
</ulink>
you can found additional information about Microsoft
- <property>Virtual Earth map</property>
- .
+ <property>Virtual Earth map</property>.
</para>
<para>
Some additional information about usage of component can be found
<ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/virtualEarth.jsf?c=vi...">on its LiveDemo page</ulink>.</para>
-
-
</section>
</section>
17 years, 1 month
JBoss Rich Faces SVN: r14576 - in branches/jsf2.0/cdk/generator/src/main: java/org/richfaces/builder and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-06-09 20:26:34 -0400 (Tue, 09 Jun 2009)
New Revision: 14576
Added:
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/Component.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/Property.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/cdk/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/cdk/annotations/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/cdk/annotations/Component.java
branches/jsf2.0/cdk/generator/src/main/xsd/cdk3.xsd
branches/jsf2.0/cdk/generator/src/main/xsd/javaee_5.xsd
branches/jsf2.0/cdk/generator/src/main/xsd/javaee_web_services_1_2.xsd
branches/jsf2.0/cdk/generator/src/main/xsd/javaee_web_services_client_1_2.xsd
branches/jsf2.0/cdk/generator/src/main/xsd/web-facesconfig_2_0.xsd
Modified:
branches/jsf2.0/cdk/generator/src/main/xsd/cdk.xsd
Log:
Create new CDK models
Added: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/Component.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/Component.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/Component.java 2009-06-10 00:26:34 UTC (rev 14576)
@@ -0,0 +1,28 @@
+package org.richfaces.builder.jsfmodel;
+
+import java.util.List;
+
+/**
+ * That class represents JSF component in the CDK.
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class Component {
+
+ private String type;
+
+ private String family;
+
+ private String classname;
+
+ private String superclass;
+
+ private String description;
+
+ private String displayname;
+
+ private String icon;
+
+ private List<Property> properties;
+
+}
Property changes on: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/Component.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/Property.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/Property.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/Property.java 2009-06-10 00:26:34 UTC (rev 14576)
@@ -0,0 +1,115 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.jsfmodel;
+
+/**
+ * That class represents JSF component property.
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class Property {
+
+ /**
+ * <p class="changed_added_4_0">Bean property name of component attribute</p>
+ */
+ private String name;
+
+ /**
+ * <p class="changed_added_4_0">Name of the attribute type class</p>
+ */
+ private String classname;
+
+ /**
+ * <p class="changed_added_4_0">Attribute description</p>
+ */
+ private String description;
+
+ /**
+ * <p class="changed_added_4_0">Display name for IDE</p>
+ */
+ private String displayname;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the classname
+ */
+ public String getClassname() {
+ return classname;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param classname the classname to set
+ */
+ public void setClassname(String classname) {
+ this.classname = classname;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the displayname
+ */
+ public String getDisplayname() {
+ return displayname;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param displayname the displayname to set
+ */
+ public void setDisplayname(String displayname) {
+ this.displayname = displayname;
+ }
+
+}
Property changes on: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/jsfmodel/Property.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/cdk/annotations/Component.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/cdk/annotations/Component.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/cdk/annotations/Component.java 2009-06-10 00:26:34 UTC (rev 14576)
@@ -0,0 +1,40 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.annotations;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)Retention(RetentionPolicy.CLASS)
+@Inherited
+public @interface Component {
+
+ public String type();
+}
Property changes on: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/cdk/annotations/Component.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/jsf2.0/cdk/generator/src/main/xsd/cdk.xsd
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/xsd/cdk.xsd 2009-06-09 22:53:29 UTC (rev 14575)
+++ branches/jsf2.0/cdk/generator/src/main/xsd/cdk.xsd 2009-06-10 00:26:34 UTC (rev 14576)
@@ -6,7 +6,7 @@
<xsd:documentation>$Id$</xsd:documentation>
</xsd:annotation>
- <xsd:element name="components" type="xsd:string"></xsd:element>
+ <xsd:element name="components" type="cdk:componentsType"></xsd:element>
<xsd:complexType name="componentsType">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
Added: branches/jsf2.0/cdk/generator/src/main/xsd/cdk3.xsd
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/xsd/cdk3.xsd (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/xsd/cdk3.xsd 2009-06-10 00:26:34 UTC (rev 14576)
@@ -0,0 +1,442 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="alias">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="classname">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="component">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name" />
+ <xs:element ref="family" minOccurs="0" />
+ <xs:element ref="classname" minOccurs="0" />
+ <xs:element ref="superclass" minOccurs="0" />
+ <xs:element ref="test" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="description" minOccurs="0" />
+ <xs:element ref="displayname" minOccurs="0" />
+ <xs:element ref="icon" minOccurs="0" />
+ <xs:element ref="facet" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="renderer" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="tag" minOccurs="0" />
+ <xs:element ref="taghandler" minOccurs="0" />
+ <xs:choice>
+ <xs:element ref="include" />
+ <xs:element ref="properties" />
+ <xs:element ref="property" />
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="generate" use="optional" default="true">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="componentclass">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="components">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="component" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="renderer" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="listener" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="validator" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="converter" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="function" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="converter">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="id" />
+ <xs:element ref="classname" minOccurs="0" />
+ <xs:element ref="superclass" minOccurs="0" />
+ <xs:element ref="test" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="description" minOccurs="0" />
+ <xs:element ref="displayname" minOccurs="0" />
+ <xs:element ref="icon" minOccurs="0" />
+ <xs:element ref="tag" minOccurs="0" />
+ <xs:element ref="taghandler" minOccurs="0" />
+ <xs:choice>
+ <xs:element ref="include" />
+ <xs:element ref="properties" />
+ <xs:element ref="property" />
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="generate" use="optional" default="true">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="defaultvalue">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="description">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any namespace="http://www.w3.org/namespace/" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="displayname">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any namespace="http://www.w3.org/namespace/" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="eventclass">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="facet">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name" />
+ <xs:element ref="displayname" minOccurs="0" />
+ <xs:element ref="description" minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="family">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="function">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name" />
+ <xs:element ref="description" minOccurs="0" />
+ <xs:element ref="method" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="icon">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="id">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="include">
+ <xs:complexType>
+ <xs:attribute name="href" type="xs:string" use="required" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="listener">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name" />
+ <xs:element ref="listenerclass" />
+ <xs:element ref="componentclass" />
+ <xs:element ref="eventclass" />
+ <xs:element ref="methodname" minOccurs="0" />
+ <xs:element ref="tag" minOccurs="0" />
+ <xs:element ref="taghandler" minOccurs="0" />
+ <xs:element ref="property" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="listenerclass">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="method">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="methodargs">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="methodname">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="name">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="properties">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element ref="include" />
+ <xs:element ref="properties" />
+ <xs:element ref="property" />
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="property">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name" />
+ <xs:element ref="classname" minOccurs="0" />
+ <xs:element ref="description" minOccurs="0" />
+ <xs:element ref="defaultvalue" minOccurs="0" />
+ <xs:element ref="methodargs" minOccurs="0" />
+ <xs:element ref="returntype" minOccurs="0" />
+ <xs:element ref="alias" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:attribute name="el" use="optional" default="true">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="transient" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="disabled" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="hidden" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="required" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="attachedstate" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="exist" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="elonly" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="existintag" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="raw" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="renderer">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name" />
+ <xs:element ref="family" minOccurs="0" />
+ <xs:choice>
+ <xs:element ref="classname" />
+ <xs:element ref="template" />
+ </xs:choice>
+ <xs:element ref="superclass" minOccurs="0" />
+ <xs:element ref="description" minOccurs="0" />
+ <xs:element ref="displayname" minOccurs="0" />
+ <xs:element ref="icon" minOccurs="0" />
+ <xs:element ref="facet" minOccurs="0" />
+ <xs:element ref="renderkit" minOccurs="0" />
+ </xs:sequence>
+ <xs:attribute name="generate" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="override" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="renderkit">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="returntype">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="superclass">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="superclassname">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="tag">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name" />
+ <xs:element ref="classname" />
+ <xs:element ref="superclass" minOccurs="0" />
+ <xs:element ref="test" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="taglib" minOccurs="0" />
+ <xs:element ref="description" minOccurs="0" />
+ <xs:element ref="displayname" minOccurs="0" />
+ <xs:element ref="icon" minOccurs="0" />
+ </xs:sequence>
+ <xs:attribute name="generate" use="optional" default="true">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="bodyContent" use="optional" default="JSP">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="JSP" />
+ <xs:enumeration value="empty" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="taghandler">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="name" minOccurs="0" />
+ <xs:element ref="classname" />
+ <xs:element ref="superclass" minOccurs="0" />
+ <xs:element ref="description" minOccurs="0" />
+ <xs:element ref="displayname" minOccurs="0" />
+ <xs:element ref="icon" minOccurs="0" />
+ </xs:sequence>
+ <xs:attribute name="generate" use="optional" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="taglib">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="template">
+ <xs:complexType mixed="true" />
+ </xs:element>
+
+ <xs:element name="test">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="classname" minOccurs="0" />
+ <xs:element ref="superclassname" minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="validator">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="id" />
+ <xs:element ref="classname" minOccurs="0" />
+ <xs:element ref="superclass" minOccurs="0" />
+ <xs:element ref="test" minOccurs="0" maxOccurs="unbounded" />
+ <xs:element ref="description" minOccurs="0" />
+ <xs:element ref="displayname" minOccurs="0" />
+ <xs:element ref="icon" minOccurs="0" />
+ <xs:element ref="tag" minOccurs="0" />
+ <xs:element ref="taghandler" minOccurs="0" />
+ <xs:choice>
+ <xs:element ref="include" />
+ <xs:element ref="properties" />
+ <xs:element ref="property" />
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="generate" use="optional" default="true">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="true" />
+ <xs:enumeration value="false" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
\ No newline at end of file
Property changes on: branches/jsf2.0/cdk/generator/src/main/xsd/cdk3.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/cdk/generator/src/main/xsd/javaee_5.xsd
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/xsd/javaee_5.xsd (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/xsd/javaee_5.xsd 2009-06-10 00:26:34 UTC (rev 14576)
@@ -0,0 +1,2133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
+
+<xsd:schema
+ targetNamespace="http://java.sun.com/xml/ns/javaee"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="5">
+ <xsd:annotation>
+ <xsd:documentation>
+ @(#)javaee_5.xsds 1.65 06/02/17
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Copyright 2003-2005 Sun Microsystems, Inc.
+ 4150 Network Circle
+ Santa Clara, California 95054
+ U.S.A
+ All rights reserved.
+
+ Sun Microsystems, Inc. has intellectual property rights
+ relating to technology described in this document. In
+ particular, and without limitation, these intellectual
+ property rights may include one or more of the U.S. patents
+ listed at http://www.sun.com/patents and one or more
+ additional patents or pending patent applications in the
+ U.S. and other countries.
+
+ This document and the technology which it describes are
+ distributed under licenses restricting their use, copying,
+ distribution, and decompilation. No part of this document
+ may be reproduced in any form by any means without prior
+ written authorization of Sun and its licensors, if any.
+
+ Third-party software, including font technology, is
+ copyrighted and licensed from Sun suppliers.
+
+ Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+ JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+ Cup logo are trademarks or registered trademarks of Sun
+ Microsystems, Inc. in the U.S. and other countries.
+
+ Federal Acquisitions: Commercial Software - Government Users
+ Subject to Standard License Terms and Conditions.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+<xsd:annotation>
+<xsd:documentation>
+
+The following definitions that appear in the common
+shareable schema(s) of J2EE deployment descriptors should be
+interpreted with respect to the context they are included:
+
+Deployment Component may indicate one of the following:
+ j2ee application;
+ application client;
+ web application;
+ enterprise bean;
+ resource adapter;
+
+Deployment File may indicate one of the following:
+ ear file;
+ war file;
+ jar file;
+ rar file;
+
+</xsd:documentation>
+</xsd:annotation>
+
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
+ schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+ <xsd:include schemaLocation="javaee_web_services_client_1_2.xsd"/>
+
+
+<!-- **************************************************** -->
+
+ <xsd:group name="descriptionGroup">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This group keeps the usage of the contained description related
+ elements consistent across Java EE deployment descriptors.
+
+ All elements may occur multiple times with different languages,
+ to support localization of the content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="display-name"
+ type="javaee:display-nameType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="icon"
+ type="javaee:iconType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:group>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="descriptionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The description type is used by a description element to
+ provide text describing the parent element. The elements
+ that use this type should include any information that the
+ Deployment Component's Deployment File file producer wants
+ to provide to the consumer of the Deployment Component's
+ Deployment File (i.e., to the Deployer). Typically, the
+ tools used by such a Deployment File consumer will display
+ the description when processing the parent element that
+ contains the description.
+
+ The lang attribute defines the language that the
+ description is provided in. The default value is "en" (English).
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="javaee:xsdStringType">
+ <xsd:attribute ref="xml:lang"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:simpleType name="dewey-versionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type defines a dewey decimal that is used
+ to describe versions of documents.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:restriction base="xsd:token">
+ <xsd:pattern value="\.?[0-9]+(\.[0-9]+)*"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="display-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The display-name type contains a short name that is intended
+ to be displayed by tools. It is used by display-name
+ elements. The display name need not be unique.
+
+ Example:
+
+ ...
+ <display-name xml:lang="en">
+ Employee Self Service
+ </display-name>
+
+ The value of the xml:lang attribute is "en" (English) by default.
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="javaee:string">
+ <xsd:attribute ref="xml:lang"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="ejb-linkType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The ejb-linkType is used by ejb-link
+ elements in the ejb-ref or ejb-local-ref elements to specify
+ that an EJB reference is linked to enterprise bean.
+
+ The value of the ejb-link element must be the ejb-name of an
+ enterprise bean in the same ejb-jar file or in another ejb-jar
+ file in the same Java EE application unit.
+
+ Alternatively, the name in the ejb-link element may be
+ composed of a path name specifying the ejb-jar containing the
+ referenced enterprise bean with the ejb-name of the target
+ bean appended and separated from the path name by "#". The
+ path name is relative to the Deployment File containing
+ Deployment Component that is referencing the enterprise
+ bean. This allows multiple enterprise beans with the same
+ ejb-name to be uniquely identified.
+
+ Examples:
+
+ <ejb-link>EmployeeRecord</ejb-link>
+
+ <ejb-link>../products/product.jar#ProductEJB</ejb-link>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="ejb-local-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The ejb-local-refType is used by ejb-local-ref elements for
+ the declaration of a reference to an enterprise bean's local
+ home or to the local business interface of a 3.0 bean.
+ The declaration consists of:
+
+ - an optional description
+ - the EJB reference name used in the code of the Deployment
+ Component that's referencing the enterprise bean.
+ - the optional expected type of the referenced enterprise bean
+ - the optional expected local interface of the referenced
+ enterprise bean or the local business interface of the
+ referenced enterprise bean.
+ - the optional expected local home interface of the referenced
+ enterprise bean. Not applicable if this ejb-local-ref refers
+ to the local business interface of a 3.0 bean.
+ - optional ejb-link information, used to specify the
+ referenced enterprise bean
+ - optional elements to define injection of the named enterprise
+ bean into a component field or property.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="ejb-ref-name"
+ type="javaee:ejb-ref-nameType"/>
+ <xsd:element name="ejb-ref-type"
+ type="javaee:ejb-ref-typeType"
+ minOccurs="0"/>
+ <xsd:element name="local-home"
+ type="javaee:local-homeType"
+ minOccurs="0"/>
+ <xsd:element name="local"
+ type="javaee:localType"
+ minOccurs="0"/>
+ <xsd:element name="ejb-link"
+ type="javaee:ejb-linkType"
+ minOccurs="0"/>
+ <xsd:group ref="javaee:resourceGroup"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="ejb-ref-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The ejb-ref-name element contains the name of an EJB
+ reference. The EJB reference is an entry in the
+ Deployment Component's environment and is relative to the
+ java:comp/env context. The name must be unique within the
+ Deployment Component.
+
+ It is recommended that name is prefixed with "ejb/".
+
+ Example:
+
+ <ejb-ref-name>ejb/Payroll</ejb-ref-name>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:jndi-nameType"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="ejb-ref-typeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The ejb-ref-typeType contains the expected type of the
+ referenced enterprise bean.
+
+ The ejb-ref-type designates a value
+ that must be one of the following:
+
+ Entity
+ Session
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:enumeration value="Entity"/>
+ <xsd:enumeration value="Session"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="ejb-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The ejb-refType is used by ejb-ref elements for the
+ declaration of a reference to an enterprise bean's home or
+ to the remote business interface of a 3.0 bean.
+ The declaration consists of:
+
+ - an optional description
+ - the EJB reference name used in the code of
+ the Deployment Component that's referencing the enterprise
+ bean.
+ - the optional expected type of the referenced enterprise bean
+ - the optional remote interface of the referenced enterprise bean
+ or the remote business interface of the referenced enterprise
+ bean
+ - the optional expected home interface of the referenced
+ enterprise bean. Not applicable if this ejb-ref
+ refers to the remote business interface of a 3.0 bean.
+ - optional ejb-link information, used to specify the
+ referenced enterprise bean
+ - optional elements to define injection of the named enterprise
+ bean into a component field or property
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="ejb-ref-name"
+ type="javaee:ejb-ref-nameType"/>
+ <xsd:element name="ejb-ref-type"
+ type="javaee:ejb-ref-typeType"
+ minOccurs="0"/>
+ <xsd:element name="home"
+ type="javaee:homeType"
+ minOccurs="0"/>
+ <xsd:element name="remote"
+ type="javaee:remoteType"
+ minOccurs="0"/>
+ <xsd:element name="ejb-link"
+ type="javaee:ejb-linkType"
+ minOccurs="0"/>
+ <xsd:group ref="javaee:resourceGroup"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="emptyType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type is used to designate an empty
+ element when used.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="env-entry-type-valuesType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ This type contains the fully-qualified Java type of the
+ environment entry value that is expected by the
+ application's code.
+
+ The following are the legal values of env-entry-type-valuesType:
+
+ java.lang.Boolean
+ java.lang.Byte
+ java.lang.Character
+ java.lang.String
+ java.lang.Short
+ java.lang.Integer
+ java.lang.Long
+ java.lang.Float
+ java.lang.Double
+
+ Example:
+
+ <env-entry-type>java.lang.Boolean</env-entry-type>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:enumeration value="java.lang.Boolean"/>
+ <xsd:enumeration value="java.lang.Byte"/>
+ <xsd:enumeration value="java.lang.Character"/>
+ <xsd:enumeration value="java.lang.String"/>
+ <xsd:enumeration value="java.lang.Short"/>
+ <xsd:enumeration value="java.lang.Integer"/>
+ <xsd:enumeration value="java.lang.Long"/>
+ <xsd:enumeration value="java.lang.Float"/>
+ <xsd:enumeration value="java.lang.Double"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="env-entryType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The env-entryType is used to declare an application's
+ environment entry. The declaration consists of an optional
+ description, the name of the environment entry, a type
+ (optional if the value is injected, otherwise required), and
+ an optional value.
+
+ It also includes optional elements to define injection of
+ the named resource into fields or JavaBeans properties.
+
+ If a value is not specified and injection is requested,
+ no injection will occur and no entry of the specified name
+ will be created. This allows an initial value to be
+ specified in the source code without being incorrectly
+ changed when no override has been specified.
+
+ If a value is not specified and no injection is requested,
+ a value must be supplied during deployment.
+
+ This type is used by env-entry elements.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="env-entry-name"
+ type="javaee:jndi-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The env-entry-name element contains the name of a
+ Deployment Component's environment entry. The name
+ is a JNDI name relative to the java:comp/env
+ context. The name must be unique within a
+ Deployment Component. The uniqueness
+ constraints must be defined within the declared
+ context.
+
+ Example:
+
+ <env-entry-name>minAmount</env-entry-name>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="env-entry-type"
+ type="javaee:env-entry-type-valuesType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The env-entry-type element contains the Java language
+ type of the environment entry. If an injection target
+ is specified for the environment entry, the type may
+ be omitted, or must match the type of the injection
+ target. If no injection target is specified, the type
+ is required.
+
+ Example:
+
+ <env-entry-type>java.lang.Integer</env-entry-type>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="env-entry-value"
+ type="javaee:xsdStringType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The env-entry-value designates the value of a
+ Deployment Component's environment entry. The value
+ must be a String that is valid for the
+ constructor of the specified type that takes a
+ single String parameter, or for java.lang.Character,
+ a single character.
+
+ Example:
+
+ <env-entry-value>100.00</env-entry-value>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:group ref="javaee:resourceGroup"/>
+
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The elements that use this type designate the name of a
+ Java class or interface. The name is in the form of a
+ "binary name", as defined in the JLS. This is the form
+ of name used in Class.forName(). Tools that need the
+ canonical name (the name used in source code) will need
+ to convert this binary name to the canonical name.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="generic-booleanType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type defines four different values which can designate
+ boolean values. This includes values yes and no which are
+ not designated by xsd:boolean
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:enumeration value="true"/>
+ <xsd:enumeration value="false"/>
+ <xsd:enumeration value="yes"/>
+ <xsd:enumeration value="no"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="homeType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The homeType defines the fully-qualified name of
+ an enterprise bean's home interface.
+
+ Example:
+
+ <home>com.aardvark.payroll.PayrollHome</home>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:fully-qualified-classType"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="iconType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The icon type contains small-icon and large-icon elements
+ that specify the file names for small and large GIF, JPEG,
+ or PNG icon images used to represent the parent element in a
+ GUI tool.
+
+ The xml:lang attribute defines the language that the
+ icon file names are provided in. Its value is "en" (English)
+ by default.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="small-icon" type="javaee:pathType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The small-icon element contains the name of a file
+ containing a small (16 x 16) icon image. The file
+ name is a relative path within the Deployment
+ Component's Deployment File.
+
+ The image may be in the GIF, JPEG, or PNG format.
+ The icon can be used by tools.
+
+ Example:
+
+ <small-icon>employee-service-icon16x16.jpg</small-icon>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="large-icon" type="javaee:pathType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The large-icon element contains the name of a file
+ containing a large
+ (32 x 32) icon image. The file name is a relative
+ path within the Deployment Component's Deployment
+ File.
+
+ The image may be in the GIF, JPEG, or PNG format.
+ The icon can be used by tools.
+
+ Example:
+
+ <large-icon>employee-service-icon32x32.jpg</large-icon>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ </xsd:sequence>
+
+ <xsd:attribute ref="xml:lang"/>
+ <xsd:attribute name="id" type="xsd:ID"/>
+
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="injection-targetType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ An injection target specifies a class and a name within
+ that class into which a resource should be injected.
+
+ The injection target class specifies the fully qualified
+ class name that is the target of the injection. The
+ Java EE specifications describe which classes can be an
+ injection target.
+
+ The injection target name specifies the target within
+ the specified class. The target is first looked for as a
+ JavaBeans property name. If not found, the target is
+ looked for as a field name.
+
+ The specified resource will be injected into the target
+ during initialization of the class by either calling the
+ set method for the target property or by setting a value
+ into the named field.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="injection-target-class"
+ type="javaee:fully-qualified-classType"/>
+ <xsd:element name="injection-target-name"
+ type="javaee:java-identifierType"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="java-identifierType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The java-identifierType defines a Java identifier.
+ The users of this type should further verify that
+ the content does not contain Java reserved keywords.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:pattern value="($|_|\p{L})(\p{L}|\p{Nd}|_|$)*"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="java-typeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This is a generic type that designates a Java primitive
+ type or a fully qualified name of a Java interface/type,
+ or an array of such types.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:pattern value="[^\p{Z}]*"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="jndi-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The jndi-nameType type designates a JNDI name in the
+ Deployment Component's environment and is relative to the
+ java:comp/env context. A JNDI name must be unique within the
+ Deployment Component.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:group name="jndiEnvironmentRefsGroup">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This group keeps the usage of the contained JNDI environment
+ reference elements consistent across Java EE deployment descriptors.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="env-entry"
+ type="javaee:env-entryType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="ejb-ref"
+ type="javaee:ejb-refType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="ejb-local-ref"
+ type="javaee:ejb-local-refType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:group ref="javaee:service-refGroup"/>
+ <xsd:element name="resource-ref"
+ type="javaee:resource-refType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="resource-env-ref"
+ type="javaee:resource-env-refType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="message-destination-ref"
+ type="javaee:message-destination-refType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="persistence-context-ref"
+ type="javaee:persistence-context-refType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="persistence-unit-ref"
+ type="javaee:persistence-unit-refType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="post-construct"
+ type="javaee:lifecycle-callbackType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="pre-destroy"
+ type="javaee:lifecycle-callbackType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:group>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="lifecycle-callbackType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The lifecycle-callback type specifies a method on a
+ class to be called when a lifecycle event occurs.
+ Note that each class may have only one lifecycle callback
+ method for any given event and that the method may not
+ be overloaded.
+
+ If the lifefycle-callback-class element is missing then
+ the class defining the callback is assumed to be the
+ component class in scope at the place in the descriptor
+ in which the callback definition appears.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="lifecycle-callback-class"
+ type="javaee:fully-qualified-classType"
+ minOccurs="0"/>
+ <xsd:element name="lifecycle-callback-method"
+ type="javaee:java-identifierType"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="listenerType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The listenerType indicates the deployment properties for a web
+ application listener bean.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="listener-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The listener-class element declares a class in the
+ application must be registered as a web
+ application listener bean. The value is the fully
+ qualified classname of the listener class.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="local-homeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The local-homeType defines the fully-qualified
+ name of an enterprise bean's local home interface.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:fully-qualified-classType"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="localType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The localType defines the fully-qualified name of an
+ enterprise bean's local interface.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:fully-qualified-classType"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="message-destination-linkType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The message-destination-linkType is used to link a message
+ destination reference or message-driven bean to a message
+ destination.
+
+ The Assembler sets the value to reflect the flow of messages
+ between producers and consumers in the application.
+
+ The value must be the message-destination-name of a message
+ destination in the same Deployment File or in another
+ Deployment File in the same Java EE application unit.
+
+ Alternatively, the value may be composed of a path name
+ specifying a Deployment File containing the referenced
+ message destination with the message-destination-name of the
+ destination appended and separated from the path name by
+ "#". The path name is relative to the Deployment File
+ containing Deployment Component that is referencing the
+ message destination. This allows multiple message
+ destinations with the same name to be uniquely identified.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="message-destination-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The message-destination-ref element contains a declaration
+ of Deployment Component's reference to a message destination
+ associated with a resource in Deployment Component's
+ environment. It consists of:
+
+ - an optional description
+ - the message destination reference name
+ - an optional message destination type
+ - an optional specification as to whether
+ the destination is used for
+ consuming or producing messages, or both.
+ if not specified, "both" is assumed.
+ - an optional link to the message destination
+ - optional injection targets
+
+ The message destination type must be supplied unless an
+ injection target is specified, in which case the type
+ of the target is used. If both are specified, the type
+ must be assignment compatible with the type of the injection
+ target.
+
+ Examples:
+
+ <message-destination-ref>
+ <message-destination-ref-name>jms/StockQueue
+ </message-destination-ref-name>
+ <message-destination-type>javax.jms.Queue
+ </message-destination-type>
+ <message-destination-usage>Consumes
+ </message-destination-usage>
+ <message-destination-link>CorporateStocks
+ </message-destination-link>
+ </message-destination-ref>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="message-destination-ref-name"
+ type="javaee:jndi-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The message-destination-ref-name element specifies
+ the name of a message destination reference; its
+ value is the environment entry name used in
+ Deployment Component code. The name is a JNDI name
+ relative to the java:comp/env context and must be
+ unique within an ejb-jar (for enterprise beans) or a
+ Deployment File (for others).
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="message-destination-type"
+ type="javaee:message-destination-typeType"
+ minOccurs="0"/>
+ <xsd:element name="message-destination-usage"
+ type="javaee:message-destination-usageType"
+ minOccurs="0"/>
+ <xsd:element name="message-destination-link"
+ type="javaee:message-destination-linkType"
+ minOccurs="0"/>
+
+ <xsd:group ref="javaee:resourceGroup"/>
+
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="message-destination-typeType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The message-destination-typeType specifies the type of
+ the destination. The type is specified by the Java interface
+ expected to be implemented by the destination.
+
+ Example:
+
+ <message-destination-type>javax.jms.Queue
+ </message-destination-type>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:fully-qualified-classType"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="message-destination-usageType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The message-destination-usageType specifies the use of the
+ message destination indicated by the reference. The value
+ indicates whether messages are consumed from the message
+ destination, produced for the destination, or both. The
+ Assembler makes use of this information in linking producers
+ of a destination with its consumers.
+
+ The value of the message-destination-usage element must be
+ one of the following:
+ Consumes
+ Produces
+ ConsumesProduces
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:enumeration value="Consumes"/>
+ <xsd:enumeration value="Produces"/>
+ <xsd:enumeration value="ConsumesProduces"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="message-destinationType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The message-destinationType specifies a message
+ destination. The logical destination described by this
+ element is mapped to a physical destination by the Deployer.
+
+ The message destination element contains:
+
+ - an optional description
+ - an optional display-name
+ - an optional icon
+ - a message destination name which must be unique
+ among message destination names within the same
+ Deployment File.
+ - an optional mapped name
+
+ Example:
+
+ <message-destination>
+ <message-destination-name>CorporateStocks
+ </message-destination-name>
+ </message-destination>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="message-destination-name"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The message-destination-name element specifies a
+ name for a message destination. This name must be
+ unique among the names of message destinations
+ within the Deployment File.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="mapped-name"
+ type="javaee:xsdStringType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ A product specific name that this message destination
+ should be mapped to. Each message-destination-ref
+ element that references this message destination will
+ define a name in the namespace of the referencing
+ component. (It's a name in the JNDI java:comp/env
+ namespace.) Many application servers provide a way to
+ map these local names to names of resources known to the
+ application server. This mapped name is often a global
+ JNDI name, but may be a name of any form. Each of the
+ local names should be mapped to this same global name.
+
+ Application servers are not required to support any
+ particular form or type of mapped name, nor the ability
+ to use mapped names. The mapped name is
+ product-dependent and often installation-dependent. No
+ use of a mapped name is portable.
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="param-valueType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type is a general type that can be used to declare
+ parameter/value lists.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="param-name"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The param-name element contains the name of a
+ parameter.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="param-value"
+ type="javaee:xsdStringType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The param-value element contains the value of a
+ parameter.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="pathType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The elements that use this type designate either a relative
+ path or an absolute path starting with a "/".
+
+ In elements that specify a pathname to a file within the
+ same Deployment File, relative filenames (i.e., those not
+ starting with "/") are considered relative to the root of
+ the Deployment File's namespace. Absolute filenames (i.e.,
+ those starting with "/") also specify names in the root of
+ the Deployment File's namespace. In general, relative names
+ are preferred. The exception is .war files where absolute
+ names are preferred for consistency with the Servlet API.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="persistence-context-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The persistence-context-ref element contains a declaration
+ of Deployment Component's reference to a persistence context
+ associated within a Deployment Component's
+ environment. It consists of:
+
+ - an optional description
+ - the persistence context reference name
+ - an optional persistence unit name. If not specified,
+ the default persistence unit is assumed.
+ - an optional specification as to whether
+ the persistence context type is Transaction or
+ Extended. If not specified, Transaction is assumed.
+ - an optional list of persistence properties
+ - optional injection targets
+
+ Examples:
+
+ <persistence-context-ref>
+ <persistence-context-ref-name>myPersistenceContext
+ </persistence-context-ref-name>
+ </persistence-context-ref>
+
+ <persistence-context-ref>
+ <persistence-context-ref-name>myPersistenceContext
+ </persistence-context-ref-name>
+ <persistence-unit-name>PersistenceUnit1
+ </persistence-unit-name>
+ <persistence-context-type>Extended</persistence-context-type>
+ </persistence-context-ref>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="persistence-context-ref-name"
+ type="javaee:jndi-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The persistence-context-ref-name element specifies
+ the name of a persistence context reference; its
+ value is the environment entry name used in
+ Deployment Component code. The name is a JNDI name
+ relative to the java:comp/env context.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="persistence-unit-name"
+ type="javaee:string"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The Application Assembler(or BeanProvider) may use the
+ following syntax to avoid the need to rename persistence
+ units to have unique names within a Java EE application.
+
+ The Application Assembler specifies the pathname of the
+ root of the persistence.xml file for the referenced
+ persistence unit and appends the name of the persistence
+ unit separated from the pathname by #. The pathname is
+ relative to the referencing application component jar file.
+ In this manner, multiple persistence units with the same
+ persistence unit name may be uniquely identified when the
+ Application Assembler cannot change persistence unit names.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="persistence-context-type"
+ type="javaee:persistence-context-typeType"
+ minOccurs="0"/>
+
+ <xsd:element name="persistence-property"
+ type="javaee:propertyType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Used to specify properties for the container or persistence
+ provider. Vendor-specific properties may be included in
+ the set of properties. Properties that are not recognized
+ by a vendor must be ignored. Entries that make use of the
+ namespace javax.persistence and its subnamespaces must not
+ be used for vendor-specific properties. The namespace
+ javax.persistence is reserved for use by the specification.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:group ref="javaee:resourceGroup"/>
+
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="persistence-context-typeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The persistence-context-typeType specifies the transactional
+ nature of a persistence context reference.
+
+ The value of the persistence-context-type element must be
+ one of the following:
+ Transaction
+ Extended
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:enumeration value="Transaction"/>
+ <xsd:enumeration value="Extended"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="persistence-unit-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The persistence-unit-ref element contains a declaration
+ of Deployment Component's reference to a persistence unit
+ associated within a Deployment Component's
+ environment. It consists of:
+
+ - an optional description
+ - the persistence unit reference name
+ - an optional persistence unit name. If not specified,
+ the default persistence unit is assumed.
+ - optional injection targets
+
+ Examples:
+
+ <persistence-unit-ref>
+ <persistence-unit-ref-name>myPersistenceUnit
+ </persistence-unit-ref-name>
+ </persistence-unit-ref>
+
+ <persistence-unit-ref>
+ <persistence-unit-ref-name>myPersistenceUnit
+ </persistence-unit-ref-name>
+ <persistence-unit-name>PersistenceUnit1
+ </persistence-unit-name>
+ </persistence-unit-ref>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="persistence-unit-ref-name"
+ type="javaee:jndi-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The persistence-unit-ref-name element specifies
+ the name of a persistence unit reference; its
+ value is the environment entry name used in
+ Deployment Component code. The name is a JNDI name
+ relative to the java:comp/env context.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="persistence-unit-name"
+ type="javaee:string"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The Application Assembler(or BeanProvider) may use the
+ following syntax to avoid the need to rename persistence
+ units to have unique names within a Java EE application.
+
+ The Application Assembler specifies the pathname of the
+ root of the persistence.xml file for the referenced
+ persistence unit and appends the name of the persistence
+ unit separated from the pathname by #. The pathname is
+ relative to the referencing application component jar file.
+ In this manner, multiple persistence units with the same
+ persistence unit name may be uniquely identified when the
+ Application Assembler cannot change persistence unit names.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:group ref="javaee:resourceGroup"/>
+
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="propertyType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Specifies a name/value pair.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="name"
+ type="javaee:xsdStringType">
+ </xsd:element>
+ <xsd:element name="value"
+ type="javaee:xsdStringType">
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="remoteType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The remote element contains the fully-qualified name
+ of the enterprise bean's remote interface.
+
+ Example:
+
+ <remote>com.wombat.empl.EmployeeService</remote>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:fully-qualified-classType"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="res-authType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The res-authType specifies whether the Deployment Component
+ code signs on programmatically to the resource manager, or
+ whether the Container will sign on to the resource manager
+ on behalf of the Deployment Component. In the latter case,
+ the Container uses information that is supplied by the
+ Deployer.
+
+ The value must be one of the two following:
+
+ Application
+ Container
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:enumeration value="Application"/>
+ <xsd:enumeration value="Container"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="res-sharing-scopeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The res-sharing-scope type specifies whether connections
+ obtained through the given resource manager connection
+ factory reference can be shared. The value, if specified,
+ must be one of the two following:
+
+ Shareable
+ Unshareable
+
+ The default value is Shareable.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:enumeration value="Shareable"/>
+ <xsd:enumeration value="Unshareable"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="resource-env-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The resource-env-refType is used to define
+ resource-env-type elements. It contains a declaration of a
+ Deployment Component's reference to an administered object
+ associated with a resource in the Deployment Component's
+ environment. It consists of an optional description, the
+ resource environment reference name, and an optional
+ indication of the resource environment reference type
+ expected by the Deployment Component code.
+
+ It also includes optional elements to define injection of
+ the named resource into fields or JavaBeans properties.
+
+ The resource environment type must be supplied unless an
+ injection target is specified, in which case the type
+ of the target is used. If both are specified, the type
+ must be assignment compatible with the type of the injection
+ target.
+
+ Example:
+
+ <resource-env-ref>
+ <resource-env-ref-name>jms/StockQueue
+ </resource-env-ref-name>
+ <resource-env-ref-type>javax.jms.Queue
+ </resource-env-ref-type>
+ </resource-env-ref>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="resource-env-ref-name"
+ type="javaee:jndi-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The resource-env-ref-name element specifies the name
+ of a resource environment reference; its value is
+ the environment entry name used in
+ the Deployment Component code. The name is a JNDI
+ name relative to the java:comp/env context and must
+ be unique within a Deployment Component.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="resource-env-ref-type"
+ type="javaee:fully-qualified-classType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The resource-env-ref-type element specifies the type
+ of a resource environment reference. It is the
+ fully qualified name of a Java language class or
+ interface.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:group ref="javaee:resourceGroup"/>
+
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="resource-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The resource-refType contains a declaration of a
+ Deployment Component's reference to an external resource. It
+ consists of an optional description, the resource manager
+ connection factory reference name, an optional indication of
+ the resource manager connection factory type expected by the
+ Deployment Component code, an optional type of authentication
+ (Application or Container), and an optional specification of
+ the shareability of connections obtained from the resource
+ (Shareable or Unshareable).
+
+ It also includes optional elements to define injection of
+ the named resource into fields or JavaBeans properties.
+
+ The connection factory type must be supplied unless an
+ injection target is specified, in which case the type
+ of the target is used. If both are specified, the type
+ must be assignment compatible with the type of the injection
+ target.
+
+ Example:
+
+ <resource-ref>
+ <res-ref-name>jdbc/EmployeeAppDB</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ <res-sharing-scope>Shareable</res-sharing-scope>
+ </resource-ref>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="res-ref-name"
+ type="javaee:jndi-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The res-ref-name element specifies the name of a
+ resource manager connection factory reference.
+ The name is a JNDI name relative to the
+ java:comp/env context.
+ The name must be unique within a Deployment File.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="res-type"
+ type="javaee:fully-qualified-classType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The res-type element specifies the type of the data
+ source. The type is specified by the fully qualified
+ Java language class or interface
+ expected to be implemented by the data source.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="res-auth"
+ type="javaee:res-authType"
+ minOccurs="0"/>
+
+ <xsd:element name="res-sharing-scope"
+ type="javaee:res-sharing-scopeType"
+ minOccurs="0"/>
+
+ <xsd:group ref="javaee:resourceGroup"/>
+
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:group name="resourceGroup">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This group collects elements that are common to all the
+ JNDI resource elements.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="mapped-name"
+ type="javaee:xsdStringType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ A product specific name that this resource should be
+ mapped to. The name of this resource, as defined by the
+ resource's name element or defaulted, is a name that is
+ local to the application component using the resource.
+ (It's a name in the JNDI java:comp/env namespace.) Many
+ application servers provide a way to map these local
+ names to names of resources known to the application
+ server. This mapped name is often a global JNDI name,
+ but may be a name of any form.
+
+ Application servers are not required to support any
+ particular form or type of mapped name, nor the ability
+ to use mapped names. The mapped name is
+ product-dependent and often installation-dependent. No
+ use of a mapped name is portable.
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="injection-target"
+ type="javaee:injection-targetType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:group>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="role-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The role-nameType designates the name of a security role.
+
+ The name must conform to the lexical rules for a token.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="run-asType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The run-asType specifies the run-as identity to be
+ used for the execution of a component. It contains an
+ optional description, and the name of a security role.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="role-name"
+ type="javaee:role-nameType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="security-role-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The security-role-refType contains the declaration of a
+ security role reference in a component's or a
+ Deployment Component's code. The declaration consists of an
+ optional description, the security role name used in the
+ code, and an optional link to a security role. If the
+ security role is not specified, the Deployer must choose an
+ appropriate security role.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="role-name"
+ type="javaee:role-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The value of the role-name element must be the String used
+ as the parameter to the
+ EJBContext.isCallerInRole(String roleName) method or the
+ HttpServletRequest.isUserInRole(String role) method.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="role-link"
+ type="javaee:role-nameType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The role-link element is a reference to a defined
+ security role. The role-link element must contain
+ the name of one of the security roles defined in the
+ security-role elements.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="security-roleType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The security-roleType contains the definition of a security
+ role. The definition consists of an optional description of
+ the security role, and the security role name.
+
+ Example:
+
+ <security-role>
+ <description>
+ This role includes all employees who are authorized
+ to access the employee service application.
+ </description>
+ <role-name>employee</role-name>
+ </security-role>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="role-name"
+ type="javaee:role-nameType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This is a special string datatype that is defined by Java EE as
+ a base type for defining collapsed strings. When schemas
+ require trailing/leading space elimination as well as
+ collapsing the existing whitespace, this base type may be
+ used.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:token">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="true-falseType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This simple type designates a boolean with only two
+ permissible values
+
+ - true
+ - false
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:xsdBooleanType">
+ <xsd:pattern value="(true|false)"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="url-patternType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The url-patternType contains the url pattern of the mapping.
+ It must follow the rules specified in Section 11.2 of the
+ Servlet API Specification. This pattern is assumed to be in
+ URL-decoded form and must not contain CR(#xD) or LF(#xA).
+ If it contains those characters, the container must inform
+ the developer with a descriptive error message.
+ The container must preserve all characters including whitespaces.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="xsdAnyURIType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type adds an "id" attribute to xsd:anyURI.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:anyURI">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="xsdBooleanType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type adds an "id" attribute to xsd:boolean.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:boolean">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="xsdIntegerType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type adds an "id" attribute to xsd:integer.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:integer">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="xsdNMTOKENType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type adds an "id" attribute to xsd:NMTOKEN.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:NMTOKEN">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="xsdNonNegativeIntegerType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type adds an "id" attribute to xsd:nonNegativeInteger.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:nonNegativeInteger">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="xsdPositiveIntegerType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type adds an "id" attribute to xsd:positiveInteger.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:positiveInteger">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="xsdQNameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type adds an "id" attribute to xsd:QName.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:QName">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="xsdStringType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type adds an "id" attribute to xsd:string.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+</xsd:schema>
+
Property changes on: branches/jsf2.0/cdk/generator/src/main/xsd/javaee_5.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/cdk/generator/src/main/xsd/javaee_web_services_1_2.xsd
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/xsd/javaee_web_services_1_2.xsd (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/xsd/javaee_web_services_1_2.xsd 2009-06-10 00:26:34 UTC (rev 14576)
@@ -0,0 +1,784 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://java.sun.com/xml/ns/javaee"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.2">
+ <xsd:annotation>
+ <xsd:documentation>
+ @(#)javaee_web_services_1_2.xsds 1.18 02/13/06
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Copyright 2003-2005 Sun Microsystems, Inc.
+ 4150 Network Circle
+ Santa Clara, California 95054
+ U.S.A
+ All rights reserved.
+
+ Sun Microsystems, Inc. has intellectual property rights
+ relating to technology described in this document. In
+ particular, and without limitation, these intellectual
+ property rights may include one or more of the U.S. patents
+ listed at http://www.sun.com/patents and one or more
+ additional patents or pending patent applications in the
+ U.S. and other countries.
+
+ This document and the technology which it describes are
+ distributed under licenses restricting their use, copying,
+ distribution, and decompilation. No part of this document
+ may be reproduced in any form by any means without prior
+ written authorization of Sun and its licensors, if any.
+
+ Third-party software, including font technology, is
+ copyrighted and licensed from Sun suppliers.
+
+ Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+ JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+ Cup logo are trademarks or registered trademarks of Sun
+ Microsystems, Inc. in the U.S. and other countries.
+
+ Federal Acquisitions: Commercial Software - Government Users
+ Subject to Standard License Terms and Conditions.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ (C) Copyright International Business Machines Corporation 2002
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The webservices element is the root element for the web services
+ deployment descriptor. It specifies the set of web service
+ descriptions that are to be deployed into the Java EE Application
+ Server and the dependencies they have on container resources and
+ services. The deployment descriptor must be named
+ "META-INF/webservices.xml" in the web services' jar file.
+
+ Used in: webservices.xml
+
+ All webservices deployment descriptors must indicate the
+ webservices schema by using the Java EE namespace:
+
+ http://java.sun.com/xml/ns/javaee
+
+ and by indicating the version of the schema by using the version
+ element as shown below:
+
+ <webservices xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd"
+ version="1.2">
+ ...
+ </webservices>
+
+ The instance documents may indicate the published version of the
+ schema using the xsi:schemaLocation attribute for the Java EE
+ namespace with the following location:
+
+ http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The following conventions apply to all Java EE
+ deployment descriptor elements unless indicated otherwise.
+
+ - In elements that specify a pathname to a file within the
+ same JAR file, relative filenames (i.e., those not
+ starting with "/") are considered relative to the root of
+ the JAR file's namespace. Absolute filenames (i.e., those
+ starting with "/") also specify names in the root of the
+ JAR file's namespace. In general, relative names are
+ preferred. The exception is .war files where absolute
+ names are preferred for consistency with the Servlet API.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:include schemaLocation="javaee_5.xsd"/>
+
+
+<!-- **************************************************** -->
+
+ <xsd:element name="webservices" type="javaee:webservicesType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The webservices element is the root element for the web services
+ deployment descriptor. It specifies the set of web service
+ descriptions that are to be deployed into the Java EE Application Server
+ and the dependencies they have on container resources and services.
+
+ Used in: webservices.xml
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:key name="webservice-description-name-key">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The webservice-description-name identifies the collection of
+ port-components associated with a WSDL file and JAX-RPC mapping. The
+ name must be unique within the deployment descriptor.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:selector xpath="javaee:webservice-description"/>
+ <xsd:field xpath="javaee:webservice-description-name"/>
+ </xsd:key>
+ </xsd:element>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="handler-chainType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The handler-chain element defines the handlerchain.
+ Handlerchain can be defined such that the handlers in the
+ handlerchain operate,all ports of a service, on a specific
+ port or on a list of protocol-bindings. The choice of elements
+ service-name-pattern, port-name-pattern and protocol-bindings
+ are used to specify whether the handlers in handler-chain are
+ for a service, port or protocol binding. If none of these
+ choices are specified with the handler-chain element then the
+ handlers specified in the handler-chain will be applied on
+ everything.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+
+ <xsd:choice minOccurs="0" maxOccurs="1">
+ <xsd:element name="service-name-pattern"
+ type="javaee:qname-pattern" />
+ <xsd:element name="port-name-pattern"
+ type="javaee:qname-pattern" />
+ <xsd:element name="protocol-bindings"
+ type="javaee:protocol-bindingListType"/>
+ </xsd:choice>
+
+ <xsd:element name="handler"
+ type="javaee:port-component_handlerType"
+ minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="handler-chainsType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The handler-chains element defines the handlerchains associated
+ with this service or service endpoint.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="handler-chain"
+ type="javaee:handler-chainType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="port-componentType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The port-component element associates a WSDL port with a web service
+ interface and implementation. It defines the name of the port as a
+ component, optional description, optional display name, optional iconic
+ representations, WSDL port QName, Service Endpoint Interface, Service
+ Implementation Bean.
+
+ This element also associates a WSDL service with a JAX-WS Provider
+ implementation.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="display-name"
+ type="javaee:display-nameType"
+ minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="icon"
+ type="javaee:iconType"
+ minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="port-component-name"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The port-component-name element specifies a port component's
+ name. This name is assigned by the module producer to name
+ the service implementation bean in the module's deployment
+ descriptor. The name must be unique among the port component
+ names defined in the same module.
+
+ Used in: port-component
+
+ Example:
+ <port-component-name>EmployeeService
+ </port-component-name>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="wsdl-service"
+ type="javaee:xsdQNameType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the name space and local name part of the WSDL
+ service QName. This is required to be specified for
+ port components that are JAX-WS Provider implementations.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="wsdl-port"
+ type="javaee:xsdQNameType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the name space and local name part of the WSDL
+ port QName. This is not required to be specified for port
+ components that are JAX-WS Provider implementations
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="enable-mtom"
+ type="javaee:true-falseType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Used to enable or disable SOAP MTOM/XOP mechanism for an
+ endpoint implementation.
+
+ Not to be specified for JAX-RPC runtime
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="protocol-binding"
+ type="javaee:protocol-bindingType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Used to specify the protocol binding used by the port-component.
+ If this element is not specified, then the default binding is
+ used (SOAP 1.1 over HTTP)
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="service-endpoint-interface"
+ type="javaee:fully-qualified-classType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The service-endpoint-interface element contains the
+ fully-qualified name of the port component's Service Endpoint
+ Interface.
+
+ Used in: port-component
+
+ Example:
+ <remote>com.wombat.empl.EmployeeService</remote>
+
+ This may not be specified in case there is no Service
+ Enpoint Interface as is the case with directly using an
+ implementation class with the @WebService annotation.
+
+ When the port component is a Provider implementation
+ this is not specified.
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="service-impl-bean"
+ type="javaee:service-impl-beanType"/>
+
+ <xsd:choice>
+ <xsd:element name="handler"
+ type="javaee:port-component_handlerType"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+ To be used with JAX-RPC based runtime only.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="handler-chains"
+ type="javaee:handler-chainsType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+ To be used with JAX-WS based runtime only.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:choice>
+
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="port-component_handlerType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Declares the handler for a port-component. Handlers can access the
+ init-param name/value pairs using the HandlerInfo interface.
+
+ Used in: port-component
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="handler-name"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the name of the handler. The name must be unique within the
+ module.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="handler-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines a fully qualified class name for the handler implementation.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="init-param"
+ type="javaee:param-valueType"
+ minOccurs="0" maxOccurs="unbounded"/>
+
+ <xsd:element name="soap-header"
+ type="javaee:xsdQNameType"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the QName of a SOAP header that will be processed by the
+ handler.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="soap-role"
+ type="javaee:string"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The soap-role element contains a SOAP actor definition that the
+ Handler will play as a role.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:simpleType name="protocol-URIAliasType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Defines the type that is used for specifying tokens that
+ start with ## which are used to alias existing standard
+ protocol bindings and support aliases for new standard
+ binding URIs that are introduced in future specifications.
+
+ The following tokens alias the standard protocol binding
+ URIs:
+
+ ##SOAP11_HTTP = "http://schemas.xmlsoap.org/wsdl/soap/http"
+ ##SOAP11_HTTP_MTOM =
+ "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true"
+ ##SOAP12_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/"
+ ##SOAP12_HTTP_MTOM =
+ "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true"
+ ##XML_HTTP = "http://www.w3.org/2004/08/wsdl/http"
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:token">
+ <xsd:pattern value="##.+"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+ <xsd:simpleType name="protocol-bindingListType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Defines the type used for specifying a list of
+ protocol-bindingType(s). For e.g.
+
+ ##SOAP11_HTTP ##SOAP12_HTTP ##XML_HTTP
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:list itemType="javaee:protocol-bindingType"/>
+ </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+ <xsd:simpleType name="protocol-bindingType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Defines the type used for specifying the URI for the
+ protocol binding used by the port-component. For
+ portability one could use one of the following tokens that
+ alias the standard binding types:
+
+ ##SOAP11_HTTP
+ ##SOAP11_HTTP_MTOM
+ ##SOAP12_HTTP
+ ##SOAP12_HTTP_MTOM
+ ##XML_HTTP
+
+ Other specifications could define tokens that start with ##
+ to alias new standard binding URIs that are introduced.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:union memberTypes="xsd:anyURI javaee:protocol-URIAliasType"/>
+ </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+ <xsd:simpleType name="qname-pattern">
+ <xsd:annotation>
+ <xsd:documentation>
+ This is used to specify the QName pattern in the
+ attribute service-name-pattern and port-name-pattern in
+ the handler-chain element
+
+ For example, the various forms acceptable here for
+ service-name-pattern attribute in handler-chain element
+ are :
+
+ Exact Name: service-name-pattern="ns1:EchoService"
+
+ In this case, handlers specified in this
+ handler-chain element will apply to all ports with
+ this exact service name. The namespace prefix must
+ have been declared in a namespace declaration
+ attribute in either the start-tag of the element
+ where the prefix is used or in an an ancestor
+ element (i.e. an element in whose content the
+ prefixed markup occurs)
+
+ Pattern : service-name-pattern="ns1:EchoService*"
+
+ In this case, handlers specified in this
+ handler-chain element will apply to all ports whose
+ Service names are like EchoService1, EchoServiceFoo
+ etc. The namespace prefix must have been declared in
+ a namespace declaration attribute in either the
+ start-tag of the element where the prefix is used or
+ in an an ancestor element (i.e. an element in whose
+ content the prefixed markup occurs)
+
+ Wild Card : service-name-pattern="*"
+
+ In this case, handlers specified in this handler-chain
+ element will apply to ports of all service names.
+
+ The same can be applied to port-name attribute in
+ handler-chain element.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:restriction base="xsd:token">
+ <xsd:pattern value="\*|([\i-[:]][\c-[:]]*:)?[\i-[:]][\c-[:]]*\*?"/>
+ </xsd:restriction>
+
+ </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="service-impl-beanType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-impl-bean element defines the web service implementation.
+ A service implementation can be an EJB bean class or JAX-RPC web
+ component. Existing EJB implementations are exposed as a web service
+ using an ejb-link.
+
+ Used in: port-component
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:choice>
+ <xsd:element name="ejb-link"
+ type="javaee:ejb-linkType"/>
+ <xsd:element name="servlet-link"
+ type="javaee:servlet-linkType"/>
+ </xsd:choice>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="servlet-linkType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The servlet-link element is used in the service-impl-bean element
+ to specify that a Service Implementation Bean is defined as a
+ JAX-RPC Service Endpoint.
+
+ The value of the servlet-link element must be the servlet-name of
+ a JAX-RPC Service Endpoint in the same WAR file.
+
+ Used in: service-impl-bean
+
+ Example:
+ <servlet-link>StockQuoteService</servlet-link>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="webservice-descriptionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The webservice-description element defines a WSDL document file
+ and the set of Port components associated with the WSDL ports
+ defined in the WSDL document. There may be multiple
+ webservice-descriptions defined within a module.
+
+ All WSDL file ports must have a corresponding port-component element
+ defined.
+
+ Used in: webservices
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="description"
+ type="javaee:descriptionType"
+ minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="display-name"
+ type="javaee:display-nameType"
+ minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="icon"
+ type="javaee:iconType"
+ minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="webservice-description-name"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The webservice-description-name identifies the collection of
+ port-components associated with a WSDL file and JAX-RPC
+ mapping. The name must be unique within the deployment descriptor.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="wsdl-file"
+ type="javaee:pathType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The wsdl-file element contains the name of a WSDL file in the
+ module. The file name is a relative path within the module.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="jaxrpc-mapping-file"
+ type="javaee:pathType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The jaxrpc-mapping-file element contains the name of a file that
+ describes the JAX-RPC mapping between the Java interaces used by
+ the application and the WSDL description in the wsdl-file. The
+ file name is a relative path within the module.
+
+ This is not required when JAX-WS based runtime is used.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="port-component"
+ type="javaee:port-componentType"
+ minOccurs="1" maxOccurs="unbounded">
+ <xsd:key name="port-component_handler-name-key">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the name of the handler. The name must be unique
+ within the module.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:selector xpath="javaee:handler"/>
+ <xsd:field xpath="javaee:handler-name"/>
+ </xsd:key>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="webservicesType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="webservice-description"
+ type="javaee:webservice-descriptionType"
+ minOccurs="1" maxOccurs="unbounded">
+ <xsd:key name="port-component-name-key">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The port-component-name element specifies a port
+ component's name. This name is assigned by the module
+ producer to name the service implementation bean in the
+ module's deployment descriptor. The name must be unique
+ among the port component names defined in the same module.
+
+ Used in: port-component
+
+ Example:
+ <port-component-name>EmployeeService
+ </port-component-name>
+
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:selector xpath="javaee:port-component"/>
+ <xsd:field xpath="javaee:port-component-name"/>
+ </xsd:key>
+ </xsd:element>
+ </xsd:sequence>
+
+ <xsd:attribute name="version"
+ type="javaee:dewey-versionType"
+ fixed="1.2"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The required value for the version is 1.2.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+</xsd:schema>
+
Property changes on: branches/jsf2.0/cdk/generator/src/main/xsd/javaee_web_services_1_2.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/cdk/generator/src/main/xsd/javaee_web_services_client_1_2.xsd
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/xsd/javaee_web_services_client_1_2.xsd (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/xsd/javaee_web_services_client_1_2.xsd 2009-06-10 00:26:34 UTC (rev 14576)
@@ -0,0 +1,615 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://java.sun.com/xml/ns/javaee"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.2">
+ <xsd:annotation>
+ <xsd:documentation>
+ @(#)javaee_web_services_client_1_2.xsds 1.19 02/13/06
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Copyright 2003-2005 Sun Microsystems, Inc.
+ 4150 Network Circle
+ Santa Clara, California 95054
+ U.S.A
+ All rights reserved.
+
+ Sun Microsystems, Inc. has intellectual property rights
+ relating to technology described in this document. In
+ particular, and without limitation, these intellectual
+ property rights may include one or more of the U.S. patents
+ listed at http://www.sun.com/patents and one or more
+ additional patents or pending patent applications in the
+ U.S. and other countries.
+
+ This document and the technology which it describes are
+ distributed under licenses restricting their use, copying,
+ distribution, and decompilation. No part of this document
+ may be reproduced in any form by any means without prior
+ written authorization of Sun and its licensors, if any.
+
+ Third-party software, including font technology, is
+ copyrighted and licensed from Sun suppliers.
+
+ Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
+ JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+ Cup logo are trademarks or registered trademarks of Sun
+ Microsystems, Inc. in the U.S. and other countries.
+
+ Federal Acquisitions: Commercial Software - Government Users
+ Subject to Standard License Terms and Conditions.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ (C) Copyright International Business Machines Corporation 2002
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="port-component-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The port-component-ref element declares a client dependency
+ on the container for resolving a Service Endpoint Interface
+ to a WSDL port. It optionally associates the Service Endpoint
+ Interface with a particular port-component. This is only used
+ by the container for a Service.getPort(Class) method call.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="service-endpoint-interface"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-endpoint-interface element defines a fully qualified
+ Java class that represents the Service Endpoint Interface of a
+ WSDL port.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="enable-mtom"
+ type="javaee:true-falseType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Used to enable or disable SOAP MTOM/XOP mechanism on the client
+ side for a port-component.
+
+ Not to be specified for JAX-RPC runtime
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="port-component-link"
+ type="javaee:string"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The port-component-link element links a port-component-ref
+ to a specific port-component required to be made available
+ by a service reference.
+
+ The value of a port-component-link must be the
+ port-component-name of a port-component in the same module
+ or another module in the same application unit. The syntax
+ for specification follows the syntax defined for ejb-link
+ in the EJB 2.0 specification.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:group name="service-refGroup">
+ <xsd:sequence>
+ <xsd:element name="service-ref"
+ type="javaee:service-refType"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:key name="service-ref_handler-name-key">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the name of the handler. The name must be unique
+ within the module.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:selector xpath="javaee:handler"/>
+ <xsd:field xpath="javaee:handler-name"/>
+ </xsd:key>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:group>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="service-refType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-ref element declares a reference to a Web
+ service. It contains optional description, display name and
+ icons, a declaration of the required Service interface,
+ an optional WSDL document location, an optional set
+ of JAX-RPC mappings, an optional QName for the service element,
+ an optional set of Service Endpoint Interfaces to be resolved
+ by the container to a WSDL port, and an optional set of handlers.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="service-ref-name"
+ type="javaee:jndi-nameType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-ref-name element declares logical name that the
+ components in the module use to look up the Web service. It
+ is recommended that all service reference names start with
+ "service/".
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="service-interface"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-interface element declares the fully qualified class
+ name of the JAX-RPC Service interface the client depends on.
+ In most cases the value will be javax.xml.rpc.Service. A JAX-RPC
+ generated Service Interface class may also be specified.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="service-ref-type"
+ type="javaee:fully-qualified-classType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-ref-type element declares the type of the service-ref
+ element that is injected or returned when a JNDI lookup is done.
+ This must be either a fully qualified name of Service class or
+ the fully qualified name of service endpoint interface class.
+ This is only used with JAX-WS runtime where the corresponding
+ @WebServiceRef annotation can be used to denote both a Service
+ or a Port.
+
+ If this is not specified, then the type of service-ref element
+ that is injected or returned when a JNDI lookup is done is
+ always a Service interface/class.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="wsdl-file"
+ type="javaee:xsdAnyURIType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The wsdl-file element contains the URI location of a WSDL
+ file. The location is relative to the root of the module.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="jaxrpc-mapping-file"
+ type="javaee:pathType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The jaxrpc-mapping-file element contains the name of a file that
+ describes the JAX-RPC mapping between the Java interaces used by
+ the application and the WSDL description in the wsdl-file. The
+ file name is a relative path within the module file.
+
+ This is not required when JAX-WS based runtime is used.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="service-qname"
+ type="javaee:xsdQNameType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The service-qname element declares the specific WSDL service
+ element that is being refered to. It is not specified if no
+ wsdl-file is declared.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="port-component-ref"
+ type="javaee:port-component-refType"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The port-component-ref element declares a client dependency
+ on the container for resolving a Service Endpoint Interface
+ to a WSDL port. It optionally associates the Service Endpoint
+ Interface with a particular port-component. This is only used
+ by the container for a Service.getPort(Class) method call.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:choice>
+ <xsd:element name="handler"
+ type="javaee:service-ref_handlerType"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Declares the handler for a port-component. Handlers can
+ access the init-param name/value pairs using the
+ HandlerInfo interface. If port-name is not specified, the
+ handler is assumed to be associated with all ports of the
+ service.
+
+ To be used with JAX-RPC based runtime only.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="handler-chains"
+ type="javaee:service-ref_handler-chainsType"
+ minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+ To be used with JAX-WS based runtime only.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:choice>
+
+ <xsd:group ref="javaee:resourceGroup"/>
+
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="service-ref_handler-chainType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The handler-chain element defines the handlerchain.
+ Handlerchain can be defined such that the handlers in the
+ handlerchain operate,all ports of a service, on a specific
+ port or on a list of protocol-bindings. The choice of elements
+ service-name-pattern, port-name-pattern and protocol-bindings
+ are used to specify whether the handlers in handler-chain are
+ for a service, port or protocol binding. If none of these
+ choices are specified with the handler-chain element then the
+ handlers specified in the handler-chain will be applied on
+ everything.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+
+ <xsd:choice minOccurs="0" maxOccurs="1">
+ <xsd:element name="service-name-pattern"
+ type="javaee:service-ref_qname-pattern" />
+ <xsd:element name="port-name-pattern"
+ type="javaee:service-ref_qname-pattern" />
+ <xsd:element name="protocol-bindings"
+ type="javaee:service-ref_protocol-bindingListType"/>
+ </xsd:choice>
+
+ <xsd:element name="handler"
+ type="javaee:service-ref_handlerType"
+ minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="service-ref_handler-chainsType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The handler-chains element defines the handlerchains associated with this
+ service or service endpoint.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="handler-chain"
+ type="javaee:service-ref_handler-chainType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="service-ref_handlerType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Declares the handler for a port-component. Handlers can access the
+ init-param name/value pairs using the HandlerInfo interface. If
+ port-name is not specified, the handler is assumed to be associated
+ with all ports of the service.
+
+ Used in: service-ref
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="handler-name"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the name of the handler. The name must be unique
+ within the module.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="handler-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines a fully qualified class name for the handler
+ implementation.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="init-param"
+ type="javaee:param-valueType"
+ minOccurs="0" maxOccurs="unbounded"/>
+
+ <xsd:element name="soap-header"
+ type="javaee:xsdQNameType"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Defines the QName of a SOAP header that will be processed
+ by the handler.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="soap-role"
+ type="javaee:string"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The soap-role element contains a SOAP actor definition that
+ the Handler will play as a role.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="port-name"
+ type="javaee:string"
+ minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The port-name element defines the WSDL port-name that a
+ handler should be associated with.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+<!-- **************************************************** -->
+
+ <xsd:simpleType name="service-ref_protocol-URIAliasType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Defines the type that is used for specifying tokens that
+ start with ## which are used to alias existing standard
+ protocol bindings and support aliases for new standard
+ binding URIs that are introduced in future specifications.
+
+ The following tokens alias the standard protocol binding
+ URIs:
+
+ ##SOAP11_HTTP = "http://schemas.xmlsoap.org/wsdl/soap/http"
+ ##SOAP11_HTTP_MTOM =
+ "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true"
+ ##SOAP12_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/"
+ ##SOAP12_HTTP_MTOM =
+ "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true"
+ ##XML_HTTP = "http://www.w3.org/2004/08/wsdl/http"
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:token">
+ <xsd:pattern value="##.+"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+ <xsd:simpleType name="service-ref_protocol-bindingListType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Defines the type used for specifying a list of
+ protocol-bindingType(s). For e.g.
+
+ ##SOAP11_HTTP ##SOAP12_HTTP ##XML_HTTP
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:list itemType="javaee:service-ref_protocol-bindingType"/>
+ </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+ <xsd:simpleType name="service-ref_protocol-bindingType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Defines the type used for specifying the URI for the
+ protocol binding used by the port-component. For
+ portability one could use one of the following tokens that
+ alias the standard binding types:
+
+ ##SOAP11_HTTP
+ ##SOAP11_HTTP_MTOM
+ ##SOAP12_HTTP
+ ##SOAP12_HTTP_MTOM
+ ##XML_HTTP
+
+ Other specifications could define tokens that start with ##
+ to alias new standard binding URIs that are introduced.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:union memberTypes="xsd:anyURI javaee:service-ref_protocol-URIAliasType"/>
+ </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+ <xsd:simpleType name="service-ref_qname-pattern">
+ <xsd:annotation>
+ <xsd:documentation>
+ This is used to specify the QName pattern in the
+ attribute service-name-pattern and port-name-pattern in
+ the handler-chain element
+
+ For example, the various forms acceptable here for
+ service-name-pattern attribute in handler-chain element
+ are :
+
+ Exact Name: service-name-pattern="ns1:EchoService"
+
+ In this case, handlers specified in this
+ handler-chain element will apply to all ports with
+ this exact service name. The namespace prefix must
+ have been declared in a namespace declaration
+ attribute in either the start-tag of the element
+ where the prefix is used or in an an ancestor
+ element (i.e. an element in whose content the
+ prefixed markup occurs)
+
+ Pattern : service-name-pattern="ns1:EchoService*"
+
+ In this case, handlers specified in this
+ handler-chain element will apply to all ports whose
+ Service names are like EchoService1, EchoServiceFoo
+ etc. The namespace prefix must have been declared in
+ a namespace declaration attribute in either the
+ start-tag of the element where the prefix is used or
+ in an an ancestor element (i.e. an element in whose
+ content the prefixed markup occurs)
+
+ Wild Card : service-name-pattern="*"
+
+ In this case, handlers specified in this handler-chain
+ element will apply to ports of all service names.
+
+ The same can be applied to port-name attribute in
+ handler-chain element.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:restriction base="xsd:token">
+ <xsd:pattern value="\*|([\i-[:]][\c-[:]]*:)?[\i-[:]][\c-[:]]*\*?"/>
+ </xsd:restriction>
+
+ </xsd:simpleType>
+
+</xsd:schema>
+
Property changes on: branches/jsf2.0/cdk/generator/src/main/xsd/javaee_web_services_client_1_2.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/cdk/generator/src/main/xsd/web-facesconfig_2_0.xsd
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/xsd/web-facesconfig_2_0.xsd (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/xsd/web-facesconfig_2_0.xsd 2009-06-10 00:26:34 UTC (rev 14576)
@@ -0,0 +1,2743 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
+
+<xsd:schema
+ targetNamespace="http://java.sun.com/xml/ns/javaee"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xml="http://www.w3.org/XML/1998/namespace"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="2.0">
+
+ <xsd:annotation>
+ <xsd:documentation>
+ $Id: web-facesconfig_2_0.xsd,v 1.1.8.2 2008/03/20 21:12:50 edburns Exp $
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Copyright 2007 Sun Microsystems, Inc.,
+ 901 San Antonio Road,
+ Palo Alto, California 94303, U.S.A.
+ All rights reserved.
+
+ Sun Microsystems, Inc. has intellectual property
+ rights relating to technology described in this document. In
+ particular, and without limitation, these intellectual
+ property rights may include one or more of the U.S. patents
+ listed at http://www.sun.com/patents and one or more
+ additional patents or pending patent applications in the
+ U.S. and other countries.
+
+ This document and the technology which it describes are
+ distributed under licenses restricting their use, copying,
+ distribution, and decompilation. No part of this document
+ may be reproduced in any form by any means without prior
+ written authorization of Sun and its licensors, if any.
+
+ Third-party software, including font technology, is
+ copyrighted and licensed from Sun suppliers.
+
+ Sun, Sun Microsystems, the Sun logo, Solaris, Java, Java EE,
+ JavaServer Pages, Enterprise JavaBeans and the Java Coffee
+ Cup logo are trademarks or registered trademarks of Sun
+ Microsystems, Inc. in the U.S. and other countries.
+
+ Federal Acquisitions: Commercial Software - Government Users
+ Subject to Standard License Terms and Conditions.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ <![CDATA[
+
+ The XML Schema for the JavaServer Faces Application
+ Configuration File (Version 2.0).
+
+ All JavaServer Faces configuration files must indicate
+ the JavaServer Faces schema by indicating the JavaServer
+ Faces namespace:
+
+ http://java.sun.com/xml/ns/javaee
+
+ and by indicating the version of the schema by
+ using the version element as shown below:
+
+ <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="..."
+ version="2.0">
+ ...
+ </faces-config>
+
+ The instance documents may indicate the published
+ version of the schema using xsi:schemaLocation attribute
+ for javaee namespace with the following location:
+
+ http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd
+
+ ]]>
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:include schemaLocation="javaee_5.xsd"/>
+
+ <!-- **************************************************** -->
+
+ <xsd:element name = "faces-config" type="javaee:faces-configType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "faces-config" element is the root of the configuration
+ information hierarchy, and contains nested elements for all
+ of the other configuration settings.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:unique name="faces-config-behavior-ID-uniqueness">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Behavior IDs must be unique within a document.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:selector xpath="javaee:behavior"/>
+ <xsd:field xpath="javaee:behavior-id"/>
+ </xsd:unique>
+
+ <xsd:unique name="faces-config-converter-ID-uniqueness">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Converter IDs must be unique within a document.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:selector xpath="javaee:converter"/>
+ <xsd:field xpath="javaee:converter-id"/>
+ </xsd:unique>
+
+ <xsd:unique name="faces-config-converter-for-class-uniqueness">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ 'converter-for-class' element values must be unique
+ within a document.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:selector xpath="javaee:converter"/>
+ <xsd:field xpath="javaee:converter-for-class"/>
+ </xsd:unique>
+
+ <xsd:unique name="faces-config-validator-ID-uniqueness">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Validator IDs must be unique within a document.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:selector xpath="javaee:validator"/>
+ <xsd:field xpath="javaee:validator-id"/>
+ </xsd:unique>
+
+ <xsd:unique name="faces-config-managed-bean-name-uniqueness">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Managed bean names must be unique within a document.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:selector xpath="javaee:managed-bean"/>
+ <xsd:field xpath="javaee:managed-bean-name"/>
+ </xsd:unique>
+ </xsd:element>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-configType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "faces-config" element is the root of the configuration
+ information hierarchy, and contains nested elements for all
+ of the other configuration settings.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="application"
+ type="javaee:faces-config-applicationType"/>
+ <xsd:element name="ordering"
+ type="javaee:faces-config-orderingType"/>
+ <xsd:element name="absolute-ordering"
+ type="javaee:faces-config-absoluteOrderingType"
+ minOccurs="0"
+ maxOccurs="1"/>
+ <xsd:element name="factory"
+ type="javaee:faces-config-factoryType"/>
+ <xsd:element name="component"
+ type="javaee:faces-config-componentType"/>
+ <xsd:element name="converter"
+ type="javaee:faces-config-converterType"/>
+ <xsd:element name="managed-bean"
+ type="javaee:faces-config-managed-beanType"/>
+ <xsd:element name="name"
+ type="javaee:java-identifierType"
+ minOccurs="0"
+ maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "name" element within the top level "faces-config"
+ element declares the name of this application
+ configuration resource. Such names are used
+ in the document ordering scheme specified in section
+ JSF.11.4.6.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="navigation-rule"
+ type="javaee:faces-config-navigation-ruleType"/>
+ <xsd:element name="referenced-bean"
+ type="javaee:faces-config-referenced-beanType"/>
+ <xsd:element name="render-kit"
+ type="javaee:faces-config-render-kitType"/>
+ <xsd:element name="lifecycle"
+ type="javaee:faces-config-lifecycleType"/>
+ <xsd:element name="validator"
+ type="javaee:faces-config-validatorType"/>
+ <xsd:element name="behavior"
+ type="javaee:faces-config-behaviorType"/>
+ <xsd:element name="faces-config-extension"
+ type="javaee:faces-config-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:choice>
+ <xsd:attribute name="metadata-complete"
+ type="xsd:boolean"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The metadata-complete attribute defines whether this
+ JavaServer Faces application is complete, or whether
+ the class files available to this module and packaged with
+ this application should be examined for annotations
+ that specify configuration information.
+
+ This attribute is only inspected on the application
+ configuration resource file located at "WEB-INF/faces-config.xml".
+ The presence of this attribute on any application configuration
+ resource other than the one located at "WEB-INF/faces-config.xml",
+ including any files named using the javax.faces.CONFIG_FILES
+ attribute, must be ignored.
+
+ If metadata-complete is set to "true", the JavaServer Faces
+ runtime must ignore any annotations that specify configuration
+ information, which might be present in the class files
+ of the application.
+
+ If metadata-complete is not specified or is set to
+ "false", the JavaServer Faces runtime must examine the class
+ files of the application for annotations, as specified by
+ the specification.
+
+ If "WEB-INF/faces-config.xml" is not present, the JavaServer
+ Faces runtime will assume metadata-complete to be "false".
+
+ The value of this attribute will have no impact on
+ runtime annotations such as @ResourceDependency or
+ @ListenerFor.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="id" type="xsd:ID" />
+ <xsd:attribute name="version"
+ type="javaee:faces-config-versionType"
+ use="required"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for faces-config. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+
+ <!-- **************************************************** -->
+
+
+ <xsd:complexType name="faces-config-orderingType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Please see section JSF.11.4.6 for the specification of this element.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="after"
+ type="javaee:faces-config-ordering-orderingType"
+ minOccurs="0"
+ maxOccurs="1"/>
+ <xsd:element name="before"
+ type="javaee:faces-config-ordering-orderingType"
+ minOccurs="0"
+ maxOccurs="1"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-ordering-orderingType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This element contains a sequence of "id" elements, each of which
+ refers to an application configuration resource by the "id"
+ declared on its faces-config element. This element can also contain
+ a single "others" element which specifies that this document comes
+ before or after other documents within the application.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="name" type="javaee:java-identifierType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="others" type="javaee:faces-config-ordering-othersType" minOccurs="0" maxOccurs="1" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-ordering-othersType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This element indicates that the ordering sub-element in which
+ it was placed should take special action regarding the ordering
+ of this application resource relative to other
+ application configuration resources. See section JSF.11.4.6
+ for the complete specification.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+
+ <!-- **************************************************** -->
+
+
+ <xsd:complexType name="faces-config-absoluteOrderingType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Only relevant if this is placed within the /WEB-INF/faces-config.xml.
+ Please see section JSF.11.4.6 for the specification for details.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="javaee:java-identifierType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="others" type="javaee:faces-config-ordering-othersType" minOccurs="0" maxOccurs="1" />
+ </xsd:choice>
+ </xsd:complexType>
+
+
+ <!-- **************************************************** -->
+
+
+ <xsd:complexType name="faces-config-applicationType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "application" element provides a mechanism to define the
+ various per-application-singleton implementation artifacts for
+ a particular web application that is utilizing
+ JavaServer Faces. For nested elements that are not specified,
+ the JSF implementation must provide a suitable default.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="action-listener"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "action-listener" element contains the fully
+ qualified class name of the concrete
+ ActionListener implementation class that will be
+ called during the Invoke Application phase of the
+ request processing lifecycle.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="default-render-kit-id"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "default-render-kit-id" element allows the
+ application to define a renderkit to be used other
+ than the standard one.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="message-bundle"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The base name of a resource bundle representing
+ the message resources for this application. See
+ the JavaDocs for the "java.util.ResourceBundle"
+ class for more information on the syntax of
+ resource bundle names.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="navigation-handler"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "navigation-handler" element contains the
+ fully qualified class name of the concrete
+ NavigationHandler implementation class that will
+ be called during the Invoke Application phase
+ of the request processing lifecycle, if the
+ default ActionListener (provided by the JSF
+ implementation) is used.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="partial-traversal"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "partial-traversal" element contains the fully
+ qualified class name of the concrete
+ PartialTraversal implementation class that will be
+ called during the "execute" and "render" phases of the
+ request processing lifecycle.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="view-handler"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "view-handler" element contains the fully
+ qualified class name of the concrete ViewHandler
+ implementation class that will be called during
+ the Restore View and Render Response phases of the
+ request processing lifecycle. The faces
+ implementation must provide a default
+ implementation of this class.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="state-manager"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "state-manager" element contains the fully
+ qualified class name of the concrete StateManager
+ implementation class that will be called during
+ the Restore View and Render Response phases of the
+ request processing lifecycle. The faces
+ implementation must provide a default
+ implementation of this class.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="el-resolver"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "el-resolver" element contains the fully
+ qualified class name of the concrete
+ javax.el.ELResolver implementation class
+ that will be used during the processing of
+ EL expressions.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="property-resolver"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "property-resolver" element contains the fully
+ qualified class name of the concrete
+ PropertyResolver implementation class that will
+ be used during the processing of value binding
+ expressions.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="variable-resolver"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "variable-resolver" element contains the fully
+ qualified class name of the concrete
+ VariableResolver implementation class that will
+ be used during the processing of value binding
+ expressions.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="resource-handler"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+
+ The "resource-handler" element contains the
+ fully qualified class name of the concrete
+ ResourceHandler implementation class that
+ will be used during rendering and decoding
+ of resource requests The standard
+ constructor based decorator pattern used for
+ other application singletons will be
+ honored.
+
+ ]]>
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="system-event-listener"
+ type="javaee:faces-config-system-event-listenerType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ </xsd:element>
+ <xsd:element
+ name="locale-config"
+ type="javaee:faces-config-locale-configType"/>
+ <xsd:element
+ name="resource-bundle"
+ type="javaee:faces-config-application-resource-bundleType"/>
+ <xsd:element name="application-extension"
+ type="javaee:faces-config-application-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element
+ name="default-validators"
+ type="javaee:faces-config-default-validatorsType"/>
+ </xsd:choice>
+ <xsd:attribute name = "id" type = "xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-application-resource-bundleType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The resource-bundle element inside the application element
+ references a java.util.ResourceBundle instance by name
+ using the var element. ResourceBundles referenced in this
+ manner may be returned by a call to
+ Application.getResourceBundle() passing the current
+ FacesContext for this request and the value of the var
+ element below.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="base-name"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The fully qualified class name of the
+ java.util.ResourceBundle instance.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="var"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The name by which this ResourceBundle instance
+ is retrieved by a call to
+ Application.getResourceBundle().
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-application-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for application. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-factoryType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "factory" element provides a mechanism to define the
+ various Factories that comprise parts of the implementation
+ of JavaServer Faces. For nested elements that are not
+ specified, the JSF implementation must provide a suitable
+ default.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="application-factory"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "application-factory" element contains the
+ fully qualified class name of the concrete
+ ApplicationFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(APPLICATION_FACTORY) is
+ called.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="exception-handler-factory"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "exception-handler-factory" element contains the
+ fully qualified class name of the concrete
+ ExceptionHandlerFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(EXCEPTION_HANDLER_FACTORY)
+ is called.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="external-context-factory"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "external-context-factory" element contains the
+ fully qualified class name of the concrete
+ ExternalContextFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(EXTERNAL_CONTEXT_FACTORY)
+ is called.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="faces-context-factory"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "faces-context-factory" element contains the
+ fully qualified class name of the concrete
+ FacesContextFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(FACES_CONTEXT_FACTORY)
+ is called.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="partial-view-context-factory"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "partial-view-context-factory" element contains the
+ fully qualified class name of the concrete
+ PartialViewContextFactory implementation class that will
+ be called when FactoryFinder.getFactory
+ (FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY) is called.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="lifecycle-factory"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "lifecycle-factory" element contains the fully
+ qualified class name of the concrete LifecycleFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(LIFECYCLE_FACTORY) is called.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="view-declaration-language-factory"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "view-declaration-language-factory" element contains
+ the fully qualified class name of the concrete
+ ViewDeclarationLanguageFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(VIEW_DECLARATION_FACTORY) is called.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="tag-handler-delegate-factory"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "tag-handler-delegate-factory" element contains
+ the fully qualified class name of the concrete
+ ViewDeclarationLanguageFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(TAG_HANDLER_DELEGATE_FACTORY) is called.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="render-kit-factory"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "render-kit-factory" element contains the fully
+ qualified class name of the concrete RenderKitFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(RENDER_KIT_FACTORY) is
+ called.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="visit-context-factory"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "visit-context-factory" element contains the fully
+ qualified class name of the concrete VisitContextFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY) is
+ called.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="factory-extension"
+ type="javaee:faces-config-factory-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:choice>
+ <xsd:attribute name = "id" type = "xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-factory-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for factory. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-attributeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "attribute" element represents a named, typed, value
+ associated with the parent UIComponent via the generic
+ attributes mechanism.
+
+ Attribute names must be unique within the scope of the parent
+ (or related) component.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="attribute-name"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "attribute-name" element represents the name under
+ which the corresponding value will be stored, in the
+ generic attributes of the UIComponent we are related
+ to.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="attribute-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "attribute-class" element represents the Java type
+ of the value associated with this attribute name.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="default-value"
+ type="javaee:faces-config-default-valueType"
+ minOccurs="0"/>
+ <xsd:element name="suggested-value"
+ type="javaee:faces-config-suggested-valueType"
+ minOccurs="0"/>
+ <xsd:element name="attribute-extension"
+ type="javaee:faces-config-attribute-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name = "id" type = "xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-attribute-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for attribute. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-componentType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "component" element represents a concrete UIComponent
+ implementation class that should be registered under the
+ specified type identifier, along with its associated
+ properties and attributes. Component types must be unique
+ within the entire web application.
+
+ Nested "attribute" elements identify generic attributes that
+ are recognized by the implementation logic of this component.
+ Nested "property" elements identify JavaBeans properties of
+ the component class that may be exposed for manipulation
+ via tools.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="component-type"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "component-type" element represents the name under
+ which the corresponding UIComponent class should be
+ registered.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="component-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "component-class" element represents the fully
+ qualified class name of a concrete UIComponent
+ implementation class.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="facet"
+ type="javaee:faces-config-facetType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="attribute"
+ type="javaee:faces-config-attributeType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="property"
+ type="javaee:faces-config-propertyType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="component-extension"
+ type="javaee:faces-config-component-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-component-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Extension element for component. It may contain
+ implementation specific content.
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-default-localeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "default-locale" element declares the default locale
+ for this application instance.
+
+ It must be specified as :language:[_:country:[_:variant:]]
+ without the colons, for example "ja_JP_SJIS". The
+ separators between the segments may be '-' or '_'.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="javaee:faces-config-localeType">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+
+ <xsd:complexType name="faces-config-default-valueType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "default-value" contains the value for the property or
+ attribute in which this element resides. This value differs
+ from the "suggested-value" in that the property or attribute
+ must take the value, whereas in "suggested-value" taking the
+ value is optional.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:simpleType name="faces-config-el-expressionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ EL expressions present within a faces config file
+ must start with the character sequence of '#{' and
+ end with '}'.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value="#\{.*\}"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-facetType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Define the name and other design-time information for a facet
+ that is associated with a renderer or a component.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="facet-name"
+ type="javaee:java-identifierType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "facet-name" element represents the facet name
+ under which a UIComponent will be added to its parent.
+ It must be of type "Identifier".
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="facet-extension"
+ type="javaee:faces-config-facet-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-facet-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for facet. It may contain implementation
+ specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-from-view-idType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The value of from-view-id must contain one of the following
+ values:
+
+ - The exact match for a view identifier that is recognized
+ by the the ViewHandler implementation being used (such as
+ "/index.jsp" if you are using the default ViewHandler).
+
+ - A proper prefix of a view identifier, plus a trailing
+ "*" character. This pattern indicates that all view
+ identifiers that match the portion of the pattern up to
+ the asterisk will match the surrounding rule. When more
+ than one match exists, the match with the longest pattern
+ is selected.
+
+ - An "*" character, which means that this pattern applies
+ to all view identifiers.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-from-actionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "from-action" element contains an action reference
+ expression that must have been executed (by the default
+ ActionListener for handling application level events)
+ in order to select the navigation rule. If not specified,
+ this rule will be relevant no matter which action reference
+ was executed (or if no action reference was executed).
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="javaee:faces-config-el-expressionType">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-ifType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "if" element defines a condition that must resolve
+ to true in order for the navigation case on which it is
+ defined to be matched, with the existing match criteria
+ (action method and outcome) as a prerequiste, if present.
+ The condition is defined declaratively using a value
+ expression in the body of this element. The expression is
+ evaluated at the time the navigation case is being matched.
+ If the "from-outcome" is omitted and this element is
+ present, the navigation handler will match a null outcome
+ and use the condition return value to determine if the
+ case should be considered a match.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="javaee:faces-config-el-expressionType">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-converterType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "converter" element represents a concrete Converter
+ implementation class that should be registered under the
+ specified converter identifier. Converter identifiers must
+ be unique within the entire web application.
+
+ Nested "attribute" elements identify generic attributes that
+ may be configured on the corresponding UIComponent in order
+ to affect the operation of the Converter. Nested "property"
+ elements identify JavaBeans properties of the Converter
+ implementation class that may be configured to affect the
+ operation of the Converter. "attribute" and "property"
+ elements are intended to allow component developers to
+ more completely describe their components to tools and users.
+ These elements have no required runtime semantics.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:choice>
+ <xsd:element name="converter-id"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "converter-id" element represents the
+ identifier under which the corresponding
+ Converter class should be registered.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:element name="converter-for-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "converter-for-class" element represents the
+ fully qualified class name for which a Converter
+ class will be registered.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:choice>
+
+ <xsd:element name="converter-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "converter-class" element represents the fully
+ qualified class name of a concrete Converter
+ implementation class.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="attribute"
+ type="javaee:faces-config-attributeType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Nested "attribute" elements identify generic
+ attributes that may be configured on the
+ corresponding UIComponent in order to affect the
+ operation of the Converter. This attribute is
+ primarily for design-time tools and is not
+ specified to have any meaning at runtime.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="property"
+ type="javaee:faces-config-propertyType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Nested "property" elements identify JavaBeans
+ properties of the Converter implementation class
+ that may be configured to affect the operation of
+ the Converter. This attribute is primarily for
+ design-time tools and is not specified to have
+ any meaning at runtime.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="converter-extension"
+ type="javaee:faces-config-converter-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-converter-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for converter. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-lifecycleType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "lifecycle" element provides a mechanism to specify
+ modifications to the behaviour of the default Lifecycle
+ implementation for this web application.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="phase-listener"
+ type="javaee:fully-qualified-classType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "phase-listener" element contains the fully
+ qualified class name of the concrete PhaseListener
+ implementation class that will be registered on
+ the Lifecycle.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="lifecycle-extension"
+ type="javaee:faces-config-lifecycle-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-lifecycle-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for lifecycle. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+
+ <!-- **************************************************** -->
+
+ <xsd:simpleType name="faces-config-localeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The localeType defines valid locale defined by ISO-639-1
+ and ISO-3166.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value="([a-z]{2})[_|\-]?([\p{L}]{2})?[_|\-]?(\w+)?"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-locale-configType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "locale-config" element allows the app developer to
+ declare the supported locales for this application.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="default-locale"
+ type="javaee:faces-config-default-localeType"
+ minOccurs="0">
+ </xsd:element>
+ <xsd:element name="supported-locale"
+ type="javaee:faces-config-supported-localeType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-default-validatorsType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "default-validators" element allows the app developer to
+ register a set of validators, referenced by identifier, that
+ are automatically assigned to any EditableValueHolder component
+ in the application, unless overridden or disabled locally.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="validator-id"
+ type="javaee:string"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "validator-id" element represents the identifier
+ of a registered validator.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-managed-beanType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "managed-bean" element represents a JavaBean, of a
+ particular class, that will be dynamically instantiated
+ at runtime (by the default VariableResolver implementation)
+ if it is referenced as the first element of a value binding
+ expression, and no corresponding bean can be identified in
+ any scope. In addition to the creation of the managed bean,
+ and the optional storing of it into the specified scope,
+ the nested managed-property elements can be used to
+ initialize the contents of settable JavaBeans properties of
+ the created instance.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="managed-bean-name"
+ type="javaee:java-identifierType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "managed-bean-name" element represents the
+ attribute name under which a managed bean will
+ be searched for, as well as stored (unless the
+ "managed-bean-scope" value is "none").
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="managed-bean-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "managed-bean-class" element represents the fully
+ qualified class name of the Java class that will be
+ used`to instantiate a new instance if creation of the
+ specified`managed bean is requested.
+
+ The specified class must conform to standard JavaBeans
+ conventions. In particular, it must have a public
+ zero-arguments constructor, and zero or more public
+ property setters.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element
+ name="managed-bean-scope"
+ type="javaee:faces-config-managed-bean-scopeOrNoneType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "managed-bean-scope" element represents the scope
+ into which a newly created instance of the specified
+ managed bean will be stored (unless the value is
+ "none").
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:choice>
+ <xsd:element name="managed-property"
+ type="javaee:faces-config-managed-propertyType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="map-entries"
+ type="javaee:faces-config-map-entriesType"/>
+ <xsd:element name="list-entries"
+ type="javaee:faces-config-list-entriesType"/>
+ </xsd:choice>
+ <xsd:element name="managed-bean-extension"
+ type="javaee:faces-config-managed-bean-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="eager"
+ type="xsd:boolean"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This attribute is only considered when associated with
+ an application-scoped managed bean. If the value of the eager
+ attribute is true the runtime must instantiate this class
+ and store the instance within the application scope when the
+ application starts.
+
+ If eager is unspecified or is false, the default "lazy"
+ instantiation and scoped storage of the managed bean
+ will occur.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-managed-bean-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for managed-bean. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-managed-bean-scopeOrNoneType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ <![CDATA[
+ Defines the legal values for the <managed-bean-scope>
+ element's body content, which includes all of the scopes
+ normally used in a web application, plus the "none" value
+ indicating that a created bean should not be stored into
+ any scope. Alternatively, an EL expression may be used
+ as the value of this element. The result of evaluating this
+ expression must by of type java.util.Map.
+ ]]>
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:pattern value="view|request|session|application|none|#\{.*\}"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-managed-propertyType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "managed-property" element represents an individual
+ property of a managed bean that will be configured to the
+ specified value (or value set) if the corresponding
+ managed bean is automatically created.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="property-name"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "property-name" element represents the JavaBeans
+ property name under which the corresponding value may
+ be stored.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="property-class"
+ type="javaee:java-typeType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "property-class" element represents the Java type
+ of the value associated with this property name.
+ If not specified, it can be inferred from existing
+ classes; however, this element should be specified
+ if the configuration file is going to be the source
+ for generating the corresponding classes.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:choice>
+ <xsd:element name="map-entries"
+ type="javaee:faces-config-map-entriesType"/>
+ <xsd:element name="null-value"
+ type="javaee:faces-config-null-valueType">
+ </xsd:element>
+ <xsd:element name="value"
+ type="javaee:faces-config-valueType"/>
+ <xsd:element name="list-entries"
+ type="javaee:faces-config-list-entriesType"/>
+ </xsd:choice>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-map-entryType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "map-entry" element reprsents a single key-entry pair
+ that will be added to the computed value of a managed
+ property of type java.util.Map.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="key"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "key" element is the String representation of a
+ map key that will be stored in a managed property of
+ type java.util.Map.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:choice>
+ <xsd:element name="null-value"
+ type="javaee:faces-config-null-valueType"/>
+ <xsd:element name="value"
+ type="javaee:faces-config-valueType"/>
+ </xsd:choice>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-map-entriesType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "map-entries' element represents a set of key-entry pairs
+ that will be added to the computed value of a managed property
+ of type java.util.Map. In addition, the Java class types
+ of the key and entry values may be optionally declared.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="key-class"
+ type="javaee:fully-qualified-classType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "key-class" element defines the Java type to which
+ each "key" element in a set of "map-entry" elements
+ will be converted to. If omitted, "java.lang.String"
+ is assumed.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="value-class"
+ type="javaee:faces-config-value-classType"
+ minOccurs="0"/>
+ <xsd:element name="map-entry"
+ type="javaee:faces-config-map-entryType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-navigation-caseType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "navigation-case" element describes a particular
+ combination of conditions that must match for this case to
+ be executed, and the view id of the component tree that
+ should be selected next.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="from-action"
+ type="javaee:faces-config-from-actionType"
+ minOccurs="0">
+ </xsd:element>
+ <xsd:element name="from-outcome"
+ type="javaee:string" minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "from-outcome" element contains a logical outcome
+ string returned by the execution of an application
+ action method selected via an "actionRef" property
+ (or a literal value specified by an "action" property)
+ of a UICommand component. If specified, this rule
+ will be relevant only if the outcome value matches
+ this element's value. If not specified, this rule
+ will be relevant if the outcome value is non-null
+ or, if the "if" element is present, will be relevant
+ for any outcome value, with the assumption that the
+ condition specified in the "if" element ultimately
+ determines if this rule is a match.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="if"
+ type="javaee:faces-config-ifType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Please see section JSF.7.4.2 for the specification of this element.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="to-view-id"
+ type="javaee:faces-config-valueType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "to-view-id" element contains the view identifier
+ of the next view that should be displayed if this
+ navigation rule is matched. If the contents is a
+ value expression, it should be resolved by the
+ navigation handler to obtain the view identifier.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element
+ name="redirect"
+ type="javaee:faces-config-redirectType" minOccurs="0"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-navigation-ruleType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "navigation-rule" element represents an individual
+ decision rule that will be utilized by the default
+ NavigationHandler implementation to make decisions on
+ what view should be displayed next, based on the
+ view id being processed.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="from-view-id"
+ type="javaee:faces-config-from-view-idType"
+ minOccurs="0"/>
+ <xsd:element name="navigation-case"
+ type="javaee:faces-config-navigation-caseType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element
+ name="navigation-rule-extension"
+ type="javaee:faces-config-navigation-rule-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-navigation-rule-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for navigation-rule. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-null-valueType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "null-value" element indicates that the managed
+ property in which we are nested will be explicitly
+ set to null if our managed bean is automatically
+ created. This is different from omitting the managed
+ property element entirely, which will cause no
+ property setter to be called for this property.
+
+ The "null-value" element can only be used when the
+ associated "property-class" identifies a Java class,
+ not a Java primitive.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-propertyType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "property" element represents a JavaBean property of the
+ Java class represented by our parent element.
+
+ Property names must be unique within the scope of the Java
+ class that is represented by the parent element, and must
+ correspond to property names that will be recognized when
+ performing introspection against that class via
+ java.beans.Introspector.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="property-name"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "property-name" element represents the JavaBeans
+ property name under which the corresponding value
+ may be stored.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="property-class"
+ type="javaee:java-typeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "property-class" element represents the Java type
+ of the value associated with this property name.
+ If not specified, it can be inferred from existing
+ classes; however, this element should be specified if
+ the configuration file is going to be the source for
+ generating the corresponding classes.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="default-value"
+ type="javaee:faces-config-default-valueType"
+ minOccurs="0"/>
+ <xsd:element name="suggested-value"
+ type="javaee:faces-config-suggested-valueType"
+ minOccurs="0"/>
+ <xsd:element name="property-extension"
+ type="javaee:faces-config-property-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-property-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for property. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-redirectType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "redirect" element indicates that navigation to the
+ specified "to-view-id" should be accomplished by
+ performing an HTTP redirect rather than the usual
+ ViewHandler mechanisms.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="view-param"
+ type="javaee:faces-config-redirect-viewParamType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ <xsd:attribute name="include-view-params" type="xsd:boolean" use="optional"/>
+
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-redirect-viewParamType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "view-param" element, only valid within
+ a "redirect" element, contains child "name"
+ and "value" elements that must be included in the
+ redirect url when the redirect is performed.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="name"
+ type="javaee:string"
+ minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="value"
+ type="javaee:string"
+ minOccurs="1" maxOccurs="1"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-referenced-beanType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "referenced-bean" element represents at design time the
+ promise that a Java object of the specified type will exist at
+ runtime in some scope, under the specified key. This can be
+ used by design time tools to construct user interface dialogs
+ based on the properties of the specified class. The presence
+ or absence of a referenced bean element has no impact on the
+ JavaServer Faces runtime environment inside a web application.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="referenced-bean-name"
+ type="javaee:java-identifierType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "referenced-bean-name" element represents the
+ attribute name under which the corresponding
+ referenced bean may be assumed to be stored, in one
+ of 'request', 'session', 'view', 'application'
+ or a custom scope.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="referenced-bean-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "referenced-bean-class" element represents the
+ fully qualified class name of the Java class
+ (either abstract or concrete) or Java interface
+ implemented by the corresponding referenced bean.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-render-kitType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "render-kit" element represents a concrete RenderKit
+ implementation that should be registered under the specified
+ render-kit-id. If no render-kit-id is specified, the
+ identifier of the default RenderKit
+ (RenderKitFactory.DEFAULT_RENDER_KIT) is assumed.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="render-kit-id"
+ type="javaee:string"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "render-kit-id" element represents an identifier
+ for the RenderKit represented by the parent
+ "render-kit" element.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="render-kit-class"
+ type="javaee:fully-qualified-classType"
+ minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "render-kit-class" element represents the fully
+ qualified class name of a concrete RenderKit
+ implementation class.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="renderer"
+ type="javaee:faces-config-rendererType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="client-behavior-renderer"
+ type="javaee:faces-config-client-behavior-rendererType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="render-kit-extension"
+ type="javaee:faces-config-render-kit-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-client-behavior-rendererType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "client-behavior-renderer" element represents a concrete
+ ClientBehaviorRenderer implementation class that should be
+ registered under the specified behavior renderer type identifier,
+ in the RenderKit associated with the parent "render-kit"
+ element. Client Behavior renderer type must be unique within the RenderKit
+ associated with the parent "render-kit" element.
+
+ Nested "attribute" elements identify generic component
+ attributes that are recognized by this renderer.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:element name="client-behavior-renderer-type"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "client-behavior-renderer-type" element represents a renderer type
+ identifier for the Client Behavior Renderer represented by the parent
+ "client-behavior-renderer" element.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="client-behavior-renderer-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "client-behavior-renderer-class" element represents the fully
+ qualified class name of a concrete Client Behavior Renderer
+ implementation class.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-rendererType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "renderer" element represents a concrete Renderer
+ implementation class that should be registered under the
+ specified component family and renderer type identifiers,
+ in the RenderKit associated with the parent "render-kit"
+ element. Combinations of component family and
+ renderer type must be unique within the RenderKit
+ associated with the parent "render-kit" element.
+
+ Nested "attribute" elements identify generic component
+ attributes that are recognized by this renderer.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="component-family"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "component-family" element represents the
+ component family for which the Renderer represented
+ by the parent "renderer" element will be used.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="renderer-type"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "renderer-type" element represents a renderer type
+ identifier for the Renderer represented by the parent
+ "renderer" element.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="renderer-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "renderer-class" element represents the fully
+ qualified class name of a concrete Renderer
+ implementation class.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="facet"
+ type="javaee:faces-config-facetType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="attribute"
+ type="javaee:faces-config-attributeType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ <xsd:element name="renderer-extension"
+ type="javaee:faces-config-renderer-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-renderer-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for renderer. It may contain implementation
+ specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-render-kit-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for render-kit. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-suggested-valueType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "suggested-value" contains the value for the property or
+ attribute in which this element resides. This value is
+ advisory only and is intended for tools to use when
+ populating pallettes.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-supported-localeType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "supported-locale" element allows authors to declare
+ which locales are supported in this application instance.
+
+ It must be specified as :language:[_:country:[_:variant:]]
+ without the colons, for example "ja_JP_SJIS". The
+ separators between the segments may be '-' or '_'.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="javaee:faces-config-localeType">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-behaviorType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "behavior" element represents a concrete Behavior
+ implementation class that should be registered under the
+ specified behavior identifier. Behavior identifiers must
+ be unique within the entire web application.
+
+ Nested "attribute" elements identify generic attributes that
+ may be configured on the corresponding UIComponent in order
+ to affect the operation of the Behavior. Nested "property"
+ elements identify JavaBeans properties of the Behavior
+ implementation class that may be configured to affect the
+ operation of the Behavior. "attribute" and "property"
+ elements are intended to allow component developers to
+ more completely describe their components to tools and users.
+ These elements have no required runtime semantics.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="behavior-id"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "behavior-id" element represents the identifier
+ under which the corresponding Behavior class should
+ be registered.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="behavior-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "behavior-class" element represents the fully
+ qualified class name of a concrete Behavior
+ implementation class.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="attribute"
+ type="javaee:faces-config-attributeType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Nested "attribute" elements identify generic
+ attributes that may be configured on the
+ corresponding UIComponent in order to affect the
+ operation of the Behavior. This attribute is
+ primarily for design-time tools and is not
+ specified to have any meaning at runtime.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ </xsd:element>
+ <xsd:element name="property"
+ type="javaee:faces-config-propertyType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Nested "property" elements identify JavaBeans
+ properties of the Behavior implementation class
+ that may be configured to affect the operation of
+ the Behavior. This attribute is primarily for
+ design-time tools and is not specified to have
+ any meaning at runtime.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="behavior-extension"
+ type="javaee:faces-config-behavior-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-behavior-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for behavior. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-validatorType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "validator" element represents a concrete Validator
+ implementation class that should be registered under the
+ specified validator identifier. Validator identifiers must
+ be unique within the entire web application.
+
+ Nested "attribute" elements identify generic attributes that
+ may be configured on the corresponding UIComponent in order
+ to affect the operation of the Validator. Nested "property"
+ elements identify JavaBeans properties of the Validator
+ implementation class that may be configured to affect the
+ operation of the Validator. "attribute" and "property"
+ elements are intended to allow component developers to
+ more completely describe their components to tools and users.
+ These elements have no required runtime semantics.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="validator-id"
+ type="javaee:string">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "validator-id" element represents the identifier
+ under which the corresponding Validator class should
+ be registered.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="validator-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "validator-class" element represents the fully
+ qualified class name of a concrete Validator
+ implementation class.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="attribute"
+ type="javaee:faces-config-attributeType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Nested "attribute" elements identify generic
+ attributes that may be configured on the
+ corresponding UIComponent in order to affect the
+ operation of the Validator. This attribute is
+ primarily for design-time tools and is not
+ specified to have any meaning at runtime.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ </xsd:element>
+ <xsd:element name="property"
+ type="javaee:faces-config-propertyType"
+ minOccurs="0"
+ maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Nested "property" elements identify JavaBeans
+ properties of the Validator implementation class
+ that may be configured to affect the operation of
+ the Validator. This attribute is primarily for
+ design-time tools and is not specified to have
+ any meaning at runtime.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="validator-extension"
+ type="javaee:faces-config-validator-extensionType"
+ minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name = "faces-config-validator-extensionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ Extension element for validator. It may contain
+ implementation specific content.
+
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:sequence>
+ <xsd:any namespace="##any"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:simpleType name="faces-config-valueType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "value" element is the String representation of
+ a literal value to which a scalar managed property
+ will be set, or a value binding expression ("#{...}")
+ that will be used to calculate the required value.
+ It will be converted as specified for the actual
+ property type.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:union
+ memberTypes="javaee:faces-config-el-expressionType xsd:string"/>
+ </xsd:simpleType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-value-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "value-class" element defines the Java type to which each
+ "value" element's value will be converted to, prior to adding
+ it to the "list-entries" list for a managed property that is
+ a java.util.List, or a "map-entries" map for a managed
+ property that is a java.util.Map.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:fully-qualified-classType"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-list-entriesType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "list-entries" element represents a set of initialization
+ elements for a managed property that is a java.util.List or an
+ array. In the former case, the "value-class" element can
+ optionally be used to declare the Java type to which each
+ value should be converted before adding it to the Collection.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="value-class"
+ type="javaee:faces-config-value-classType"
+ minOccurs="0"/>
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="null-value"
+ type="javaee:faces-config-null-valueType"/>
+ <xsd:element name="value"
+ type="javaee:faces-config-valueType"/>
+ </xsd:choice>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:complexType name="faces-config-system-event-listenerType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The presence of this element within the "application" element in
+ an application configuration resource file indicates the
+ developer wants to add an SystemEventListener to this
+ application instance. Elements nested within this element allow
+ selecting the kinds of events that will be delivered to the
+ listener instance, and allow selecting the kinds of classes that
+ can be the source of events that are delivered to the listener
+ instance.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="system-event-listener-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "system-event-listener-class" element contains
+ the fully qualified class name of the concrete
+ SystemEventListener implementation class that will be
+ called when events of the type specified by the
+ "system-event-class" are sent by the runtime.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="system-event-class"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "system-event-class" element contains the fully
+ qualified class name of the SystemEvent subclass for
+ which events will be delivered to the class whose fully
+ qualified class name is given by the
+ "system-event-listener-class" element.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="source-class" minOccurs="0"
+ type="javaee:fully-qualified-classType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ The "source-class" element, if present, contains the
+ fully qualified class name of the class that will be the
+ source for the event to be delivered to the class whose
+ fully qualified class name is given by the
+ "system-event-listener-class" element.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <!-- **************************************************** -->
+
+ <xsd:simpleType name="faces-config-versionType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ This type contains the recognized versions of
+ faces-config supported.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="2.0"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <!-- **************************************************** -->
+
+</xsd:schema>
Property changes on: branches/jsf2.0/cdk/generator/src/main/xsd/web-facesconfig_2_0.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 1 month
JBoss Rich Faces SVN: r14575 - in branches/jsf2.0/cdk: generator/src/main/java/org/ajax4jsf/builder/component and 49 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-06-09 18:53:29 -0400 (Tue, 09 Jun 2009)
New Revision: 14575
Added:
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ActionSource2PropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ComponentModelBuilder.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ComponentPropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ELPropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ExpressionPropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/PrimitivePropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/PropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ComponentBaseBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ConverterBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagTestClassHolder.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TestClassHolder.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ValidatorBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/AbstractClassStubBuilder.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentTestGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourceType.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBeanEntry.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigParser.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesDependenciesGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TagTestGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator2.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodyMerge.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodySerializer.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XPathComparator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/ant/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ELCompiler.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/A4JRendererElementsFactory.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/Attribute.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/BodyElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/DeclarationElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/ElementsArray.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/ElementsFactory.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/JSTLElementsFactory.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/RootElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/TemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/TemplateElementBase.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/CDATAElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/CommentElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLAttributes.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLTags.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HtmlAttributesFactory.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/PIElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/TextElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/attribute/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/CallbackListener.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/ReducedHTMLParser.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/velocity/
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/AppTest.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/config/
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodyMergeTest.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodySerializerTest.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XPathComparatorTest.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/VelocityTaglibMergeCallBack.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/XMLMergeCallback.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCDKMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCreateMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateComponentMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateThemeMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Taglib.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/velocity/
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/velocity/ResourceLoader.java
Removed:
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ActionSource2PropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentModelBuilder.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentPropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ELPropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ExpressionPropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PrimitivePropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PropertyProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/methods/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/render/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/velocity/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/xml/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/ant/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/A4JRendererElementsFactory.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/Attribute.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/BodyElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/DeclarationElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/ElementsArray.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/ElementsFactory.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/JSTLElementsFactory.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/RootElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/TemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/TemplateElementBase.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/CDATAElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/CommentElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLAttributes.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLTags.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HtmlAttributesFactory.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/PIElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/TextElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/attribute/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/jsp/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/std/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/utils/
branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/velocity/
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ComponentBaseBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ConverterBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagTestClassHolder.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TestClassHolder.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ValidatorBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/AbstractClassStubBuilder.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentTestGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TagTestGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator2.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodyMerge.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodySerializer.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XPathComparator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ELCompiler.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/CallbackListener.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/ReducedHTMLParser.java
branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/AppTest.java
branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/config/
branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/generator/
branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/xml/
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodyMergeTest.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodySerializerTest.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XPathComparatorTest.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/maven/
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/velocity/
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/VelocityTaglibMergeCallBack.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/XMLMergeCallback.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCDKMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateComponentMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Taglib.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/velocity/ResourceLoader.java
Modified:
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/ELPropertyAccessorMethodBody.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleAccessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleAccessorMethodBody.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleMutator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleMutatorMethodBody.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/VelocityMethodBody.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/AttachedStateDescriptor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/ComponentStateDescriptor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/ComponentStateManager.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/PrimitiveStateDescriptor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/SimplePropertyDescriptor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/BuilderConfig.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ClassVisitor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ClassWalkingLogic.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ComponentBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/EventBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/FunctionBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/JsfBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ListenerBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/LoaderHolder.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ParsingException.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/PropertyBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/RendererBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagHandlerBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/BlankRendererGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ClassPatternSet.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentGenerator2.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentTagGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ConverterGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ConverterTagGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/FaceletsTaglibGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/FacesConfigGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/GeneratorException.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/InnerGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/JSFGeneratorConfiguration.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ListenerGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ListenerTagGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/Logger.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/RenderKitBean.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/RendererCompilationContext.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/RendererGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TagHandlerGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TaglibGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ValidatorGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ValidatorTagGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/XMLConfigGenerator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/Argument.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/ClassImport.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaClass.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaComment.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaConstructor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaField.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaImport.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaModifier.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaPrimitive.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/MethodBody.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaClassRenderer.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaFieldRenderer.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaLanguageElementRenderer.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaMethodRenderer.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity/AntFileResourceLoader.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity/BuilderContext.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity/ClasspathTemplateLoader.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/NamesListComparator.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBody.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/ant/AntCompilationContext.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/ant/TemplateCompilerTask.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/AbstractCompilationContext.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/CompilationContext.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/CompilationException.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/StringUtils.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/TemplateCompiler.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/Variable.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/CompiledEL.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ELParser.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ICompiledEL.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/IELCompiler.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/attribute/HtmlAttribute.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/attribute/PassThruWithExclusions.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/Declaration.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/DirectiveInclude.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/DirectivePage.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/Expression.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/Scriptlet.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/ForEachTemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/IFTemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/ObjectTemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/SetTemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FCallTemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FClientIDTemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FInsertChildren.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FResourceTemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/HeaderResourceElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/HeaderScriptsElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/HeaderStylesElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/InsertComponent.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/Parameter.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/ParameterProcessor.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/UInsertFacetTemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/VcpBodyTemplateElement.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/velocity/AntFileResourceLoader.java
branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/velocity/BuilderContext.java
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/plexus/components.xml
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/component.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/componenttest.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/listener_tag.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/renderer.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/tag.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/templatecompiler/ComponentTemplate.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/listener_tag.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/renderer.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/tag.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm
branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/templatecompiler/ComponentTemplate.vm
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/config/ClassWalkingLogicTest.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/AbstractClass.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/AbstractClassStubBuilderTest.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/BaseClass.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/BaseInterface.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/ClassPatternSetTest.java
branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodyTest.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenLogger.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyAttachedLibraryMojo.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Library.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Renderkit.java
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/resources/META-INF/plexus/components.xml
branches/jsf2.0/cdk/maven-cdk-plugin/src/main/resources/component/config.xml
branches/jsf2.0/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java
Log:
rename CDK packages to 'org.richfaces'
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ActionSource2PropertyProcessor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ActionSource2PropertyProcessor.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ActionSource2PropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,111 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.component;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.faces.component.ActionSource2;
-import javax.faces.el.MethodBinding;
-
-import org.ajax4jsf.builder.component.methods.VelocityMethodBody;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.generator.GeneratorException;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.model.JavaClass;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaLanguageElement;
-import org.ajax4jsf.builder.model.JavaMethod;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-@SuppressWarnings("deprecation")
-public class ActionSource2PropertyProcessor extends ComponentPropertyProcessor {
-
- private static final List<String> ACCEPTED_NAMES = Arrays.asList("action", "actionListener", "actionExpression");
-
- @Override
- public boolean accept(PropertyBean propertyBean, JavaClass javaClass,
- JSFGeneratorConfiguration configuration) {
-
- boolean result = !propertyBean.isExist();
-
- if (result) {
- result = ActionSource2.class.isAssignableFrom(javaClass.getSuperClass());
- if (result) {
- result = ACCEPTED_NAMES.contains(propertyBean.getName());
- }
- }
-
- return result;
- }
-
- @Override
- public void process(PropertyBean propertyBean, JavaClass javaClass,
- JSFGeneratorConfiguration configuration) {
-
- JavaField field = getField(propertyBean, configuration);
- JavaMethod accessor = getAccessor(configuration, propertyBean, field);
- JavaMethod mutator = getMutator(configuration, propertyBean, field);
-
- if("action".equals(propertyBean.getName())) {
-
- try {
- accessor.setMethodBody(new VelocityMethodBody(configuration) {
- @Override
- public String getTemplate() {
- return "snippets/get-action.vm";
- }
- });
- mutator.setMethodBody(new VelocityMethodBody(configuration) {
- @Override
- public String getTemplate() {
- return "snippets/set-action.vm";
- }
- });
-
- } catch (GeneratorException e) {
- e.printStackTrace();
- }
-
- } else {
- javaClass.addField(field);
- }
-
- if (field.getType().getName().equals(MethodBinding.class.getName())) {
-
- for(JavaLanguageElement el : new JavaLanguageElement[] {field, accessor, mutator}) {
- el.addAnnotation(SuppressWarnings.class, "\"deprecation\"");
- }
-
- }
-
-
- //Do not add variable
- javaClass.addMethod(accessor);
- javaClass.addMethod(mutator);
-
- }
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentModelBuilder.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentModelBuilder.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentModelBuilder.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,206 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.component;
-
-import static org.ajax4jsf.builder.model.Argument.arg;
-
-import java.util.Collection;
-
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.builder.component.state.ComponentStateManager;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.config.RendererBean;
-import org.ajax4jsf.builder.generator.GeneratorException;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.model.JavaClass;
-import org.ajax4jsf.builder.model.JavaConstructor;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaMethod;
-import org.ajax4jsf.builder.model.JavaModifier;
-import org.ajax4jsf.builder.model.JavaPackage;
-import org.ajax4jsf.builder.model.MethodBody;
-
-/**
- * Build component class model from configs
- * @author Maksim Kaszynski
- *
- */
-public class ComponentModelBuilder {
-
- private PropertyProcessor[] propertyProcessors = {
- new ActionSource2PropertyProcessor(),
- new ExpressionPropertyProcessor(),
- new PrimitivePropertyProcessor(),
- new ELPropertyProcessor(),
- new ComponentPropertyProcessor()};
-
- public JavaClass build(ComponentBean componentBean, JSFGeneratorConfiguration configuration) {
-
- String superclassname =
- componentBean.getSuperclass();
-
- JavaClass javaClass =
- new JavaClass(componentBean.getSimpleClassName(),
- new JavaPackage(componentBean.getPackageName()));
-
- try {
- Class<?> superClass =
- Class.forName(superclassname, false, configuration.getClassLoader());
-
- javaClass.setSuperClass(superClass);
-
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- javaClass.setSuperClass(UIComponentBase.class);
- }
-
- javaClass.addModifier(JavaModifier.PUBLIC);
-
- javaClass.addField(getComponentFamily(componentBean));
- javaClass.addField(getComponentType(componentBean));
-
- javaClass.addMethod(getConstructor(componentBean, javaClass));
-
- Collection<PropertyBean> properties = componentBean.getProperties();
-
- for (PropertyBean propertyBean : properties) {
- PropertyProcessor proc = null;
-
- for (int i = 0; i < propertyProcessors.length && proc == null; i++) {
-
- PropertyProcessor processor =
- propertyProcessors[i];
-
- if (processor.accept(propertyBean, javaClass, configuration)) {
- proc = processor;
- }
- }
-
- if (proc != null) {
- proc.process(propertyBean, javaClass, configuration);
- }
- }
-
- javaClass.addMethod(getComponentFamilyMethod(componentBean));
-
- ComponentStateManager stateManager = new ComponentStateManager(javaClass);
-
- JavaMethod saveState = getSaveStateTemplate();
- try {
- saveState.setMethodBody(stateManager.getSaveStateMethodBody(configuration));
- } catch (GeneratorException e) {
- e.printStackTrace();
- }
- javaClass.addMethod(saveState);
-
- JavaMethod restoreState = getRestoreStateTemplate();
- try {
- restoreState.setMethodBody(stateManager.getRestoreStateMethodBody(configuration));
- } catch (GeneratorException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- javaClass.addMethod(restoreState);
-
-
-
- return javaClass;
-
- }
-
- private JavaMethod getComponentFamilyMethod(ComponentBean componentBean) {
- JavaMethod javaMethod = new JavaMethod("getFamily", String.class);
- javaMethod.addModifier(JavaModifier.PUBLIC);
- javaMethod.setMethodBody(new MethodBody() {
- @Override
- public String toCode() {
- return "return COMPONENT_FAMILY;";
- }
- });
- return javaMethod;
- }
-
- private JavaMethod getRestoreStateTemplate() {
- JavaMethod method =
- new JavaMethod("restoreState",
- Void.TYPE,
- arg("context", FacesContext.class),
- arg("state", Object.class));
- method.addModifier(JavaModifier.PUBLIC);
- method.addAnnotation(Override.class);
-
- return method;
- }
-
- private JavaMethod getSaveStateTemplate() {
- JavaMethod method =
- new JavaMethod("saveState",
- Object.class,
- arg("context", FacesContext.class));
- method.addModifier(JavaModifier.PUBLIC);
- method.addAnnotation(Override.class);
- method.setMethodBody(new MethodBody() {
- @Override
- public String toCode() {
- return "return super.saveState(context);";
- }
- });
- return method;
- }
-
- private JavaField getComponentType(ComponentBean componentBean) {
- JavaField field = new JavaField(String.class, "COMPONENT_TYPE");
- field.addModifier(JavaModifier.PUBLIC);
- field.addModifier(JavaModifier.STATIC);
- field.addModifier(JavaModifier.FINAL);
- field.setValue("\"" + componentBean.getName() + "\"");
- return field;
- }
- private JavaField getComponentFamily(ComponentBean componentBean) {
- JavaField field = new JavaField(String.class, "COMPONENT_FAMILY");
- field.addModifier(JavaModifier.PUBLIC);
- field.addModifier(JavaModifier.STATIC);
- field.addModifier(JavaModifier.FINAL);
- field.setValue("\"" + componentBean.getFamily() + "\"");
- return field;
- }
-
- private JavaMethod getConstructor(ComponentBean componentBean, JavaClass javaClass) {
- final RendererBean renderer = componentBean.getRenderer();
- JavaMethod method = new JavaConstructor(javaClass);
- method.addModifier(JavaModifier.PUBLIC);
- method.setMethodBody(new MethodBody(method) {
- @Override
- public String toCode() {
- if (renderer != null) {
- return "setRendererType(\"" + renderer.getName() + "\");";
- }
- return super.toCode();
- }
- });
-
- return method;
- }
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentPropertyProcessor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentPropertyProcessor.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentPropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,133 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.component;
-
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.model.Argument;
-import org.ajax4jsf.builder.model.JavaClass;
-import org.ajax4jsf.builder.model.JavaComment;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaLanguageElement;
-import org.ajax4jsf.builder.model.JavaMethod;
-import org.ajax4jsf.builder.model.JavaModifier;
-import org.ajax4jsf.builder.model.JavaPrimitive;
-import org.ajax4jsf.builder.model.MethodBody;
-
-/**
- * Default property handler - a fallback one.
- * @author Maksim Kaszynski
- *
- */
-public class ComponentPropertyProcessor implements PropertyProcessor {
-
- public boolean accept(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration) {
- return !propertyBean.isExist();
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.builder.render.PropertyProcessor#process(org.ajax4jsf.builder.config.PropertyBean, org.ajax4jsf.builder.model.JavaClass)
- */
- public void process(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration) {
- JavaField field = getField(propertyBean, configuration);
-
- javaClass.addField(field);
- javaClass.addMethod(getAccessor(configuration, propertyBean, field));
- javaClass.addMethod(getMutator(configuration, propertyBean, field));
- }
-
- protected JavaField getField(PropertyBean propertyBean, JSFGeneratorConfiguration configuration) {
- String name = propertyBean.getName();
- String defaultvalue = propertyBean.getDefaultvalue();
- Class<?> propertyClass = getType(propertyBean, configuration.getClassLoader());
- JavaField field = new JavaField(propertyClass, "_" + name, defaultvalue);
- field.getComments().add(new JavaComment(propertyBean.getXmlEncodedDescription()));
- field.getModifiers().add(JavaModifier.PRIVATE);
-
- if (propertyBean.isTransient()) {
- field.addModifier(JavaModifier.TRANSIENT);
- }
-
- handleDeprecation(field.getType(), field);
- return field;
- }
-
- protected Class<?> getType(PropertyBean propertyBean, ClassLoader classLoader) {
- if (propertyBean.isSimpleType()) {
- try {
- Class<?> clazz = JavaPrimitive.forName(propertyBean.getClassname());
- return clazz;
- } catch (Exception e) {
- e.printStackTrace();
- }
- } else {
- try {
- Class<?> clazz = Class.forName(propertyBean.getClassname(), false, classLoader);
- return clazz;
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- return Object.class;
- }
-
- protected JavaMethod getAccessor(JSFGeneratorConfiguration configuration, PropertyBean propertyBean, final JavaField field) {
- JavaMethod accessor =
- new JavaMethod(propertyBean.getGetterName(), field.getType());
-
- accessor.setMethodBody(new MethodBody() {
- @Override
- public String toCode() {
- return "return " + field.getName() + ";";
- }
- });
-
- accessor.addModifier(JavaModifier.PUBLIC);
- handleDeprecation(field.getType(), accessor);
-
- return accessor;
- }
-
- protected JavaMethod getMutator(JSFGeneratorConfiguration configuration, PropertyBean propertyBean, final JavaField field) {
- JavaMethod mutator =
- new JavaMethod(propertyBean.getSetterName(),
- new Argument(field.getName(), field.getType()));
-
- mutator.setMethodBody(new MethodBody(mutator) {
- @Override
- public String toCode() {
- return "this." + field.getName() + " = " + field.getName() + ";";
- }
- });
-
- handleDeprecation(field.getType(), mutator);
- mutator.addModifier(JavaModifier.PUBLIC);
- return mutator;
- }
-
- protected void handleDeprecation(Class<?> type, JavaLanguageElement element) {
- if (type.isAnnotationPresent(Deprecated.class)) {
- element.addAnnotation(SuppressWarnings.class, "\"deprecation\"");
- }
- }
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ELPropertyProcessor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ELPropertyProcessor.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ELPropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,65 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.component;
-
-import org.ajax4jsf.builder.component.methods.ELPropertyAccessorMethodBody;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.generator.GeneratorException;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.model.JavaClass;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaMethod;
-import org.ajax4jsf.builder.model.MethodBody;
-
-/**
- * Processing of EL-enabled properties
- * @author Maksim Kaszynski
- *
- */
-public class ELPropertyProcessor extends ComponentPropertyProcessor {
-
- @Override
- public boolean accept(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration) {
- return !(propertyBean.isExist() || propertyBean.isSimpleType()) && propertyBean.isEl() ;
- }
-
- @Override
- protected JavaMethod getAccessor(JSFGeneratorConfiguration config, PropertyBean propertyBean, JavaField field) {
- field.setValue("null");
-
- JavaMethod accessor = super.getAccessor(config, propertyBean, field);
-
- try {
- ELPropertyAccessorMethodBody propertyAccessorMethodBody =
- new ELPropertyAccessorMethodBody(config, propertyBean, field);
-
- accessor.setMethodBody(propertyAccessorMethodBody);
-
- } catch (GeneratorException e) {
- accessor.setMethodBody(new MethodBody());
- e.printStackTrace();
- }
-
- return accessor;
- }
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ExpressionPropertyProcessor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ExpressionPropertyProcessor.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ExpressionPropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,73 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.component;
-
-import javax.el.Expression;
-import javax.faces.el.MethodBinding;
-import javax.faces.el.ValueBinding;
-
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.model.JavaClass;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-@SuppressWarnings("deprecation")
-public class ExpressionPropertyProcessor extends ComponentPropertyProcessor {
-
- private static final Class<?>[] acceptedClasses = {
- MethodBinding.class,
- ValueBinding.class,
- Expression.class};
-
- @Override
- public boolean accept(PropertyBean propertyBean, JavaClass javaClass,
- JSFGeneratorConfiguration configuration) {
-
- boolean result =
- !propertyBean.isExist() &&
- propertyBean.isEl() &&
- propertyBean.isElonly();
-
- if (result) {
- Class<?> type =
- getType(propertyBean, configuration.getClassLoader());
-
- result = false;
-
- for (Class<?> clazz : acceptedClasses) {
- if (clazz.isAssignableFrom(type)) {
- result = true;
- break;
- }
- }
-
-
- }
-
-
-
- return result;
- }
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PrimitivePropertyProcessor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PrimitivePropertyProcessor.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PrimitivePropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,141 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.component;
-
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-
-import org.ajax4jsf.builder.component.methods.VelocityMethodBody;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.generator.GeneratorException;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.model.JavaClass;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaMethod;
-import org.ajax4jsf.builder.model.JavaModifier;
-import org.ajax4jsf.builder.model.JavaPrimitive;
-import org.ajax4jsf.builder.model.MethodBody;
-
-/**
- * Handle primitive properties
- * @author Maksim Kaszynski
- *
- */
-public class PrimitivePropertyProcessor extends ComponentPropertyProcessor {
-
- class PrimitiveELPropertyAccessorMethodBody extends VelocityMethodBody {
-
- public PrimitiveELPropertyAccessorMethodBody(
- JSFGeneratorConfiguration configuration, JavaField field, JavaField field2, PropertyBean property)
- throws GeneratorException {
- super(configuration);
- getContext().put("field1", field);
- getContext().put("field2", field2);
- getContext().put("wrapperClass", JavaPrimitive.wrapperType(field.getType()));
- getContext().put("property", property);
- addType(ValueExpression.class);
- addType(ELException.class);
- addType(FacesException.class);
- }
-
- @Override
- public String getTemplate() {
- return "snippets/primitive-el-property-accessor.vm";
- }
- }
-
- class PrimitivePropertyAccessorMethodBody extends VelocityMethodBody {
-
- public PrimitivePropertyAccessorMethodBody(
- JSFGeneratorConfiguration configuration, JavaField field, JavaField field2)
- throws GeneratorException {
- super(configuration);
- getContext().put("field1", field);
- getContext().put("field2", field2);
- }
-
- @Override
- public String getTemplate() {
- return "snippets/primitive-property-accessor.vm";
- }
- }
-
- class PrimitivePropertyMutatorMethodBody extends VelocityMethodBody {
-
- public PrimitivePropertyMutatorMethodBody(
- JSFGeneratorConfiguration configuration, JavaField field, JavaField field2)
- throws GeneratorException {
- super(configuration);
- getContext().put("field1", field);
- getContext().put("field2", field2);
- }
-
- @Override
- public String getTemplate() {
- return "snippets/primitive-property-mutator.vm";
- }
- }
-
- @Override
- public boolean accept(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration) {
- return propertyBean.isSimpleType() && super.accept(propertyBean, javaClass, configuration);
- }
-
- @Override
- public void process(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration) {
- JavaField field = getField(propertyBean, configuration);
- JavaField field2 = new JavaField(boolean.class, field.getName() + "Set", "false");
- field2.addModifier(JavaModifier.PRIVATE);
- if (propertyBean.isTransient()) {
- field2.addModifier(JavaModifier.TRANSIENT);
- }
- JavaMethod accessor = getAccessor(configuration, propertyBean, field);
- MethodBody accessorMethodBody;
-
- try {
- if (propertyBean.isEl()) {
- accessorMethodBody = new PrimitiveELPropertyAccessorMethodBody(configuration, field, field2, propertyBean);
- } else {
- accessorMethodBody = new PrimitivePropertyAccessorMethodBody(configuration, field, field2);
- }
- accessor.setMethodBody(accessorMethodBody);
- } catch (GeneratorException e) {
- e.printStackTrace();
- }
-
- JavaMethod mutator = getMutator(configuration, propertyBean, field);
-
- try {
- PrimitivePropertyMutatorMethodBody mutatorBody = new PrimitivePropertyMutatorMethodBody(configuration, field, field2);
- mutator.setMethodBody(mutatorBody);
- } catch (GeneratorException e) {
- e.printStackTrace();
- }
-
- javaClass.addField(field);
- javaClass.addField(field2);
- javaClass.addMethod(accessor);
- javaClass.addMethod(mutator);
- }
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PropertyProcessor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PropertyProcessor.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,36 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.component;
-
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.model.JavaClass;
-
-/**
- * Process single property - add field to class, accessor, mutator, etc.
- * @author Maksim Kaszynski
- *
- */
-public interface PropertyProcessor {
- boolean accept(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration);
- void process(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration);
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/A4JRendererElementsFactory.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/A4JRendererElementsFactory.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/A4JRendererElementsFactory.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,175 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.elements.html.CDATAElement;
-import org.ajax4jsf.templatecompiler.elements.html.CommentElement;
-import org.ajax4jsf.templatecompiler.elements.html.PIElement;
-import org.ajax4jsf.templatecompiler.elements.html.TextElement;
-import org.ajax4jsf.templatecompiler.elements.vcp.AjaxRenderedAreaElement;
-import org.ajax4jsf.templatecompiler.elements.vcp.HeaderScriptsElement;
-import org.ajax4jsf.templatecompiler.elements.vcp.HeaderStylesElement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Node;
-
-/**
- * Tag processors factory.
- *
- * @author ayukhovich(a)exadel.com (latest modification by $Author:
- * maksimkaszynski $)
- * @version $Revision: 1.1.2.2 $ $Date: 2007/02/26 20:48:44 $
- *
- */
-public class A4JRendererElementsFactory implements ElementsFactory {
-
- private static final Log log = LogFactory.getLog(A4JRendererElementsFactory.class);
-
- public static final String TEMPLATES_PATH = "META-INF/templates";
-
- public static final String TEMPLATES_TEMPLATECOMPILER_PATH = TEMPLATES_PATH+"/templatecompiler";
-
- private final static String DEFAULT_CLASS_ELEMENT_PROCESSOR = "org.ajax4jsf.templatecompiler.elements.html.HTMLElement";
-
- private final static Class[] paramClasses = new Class[] { Node.class,
- CompilationContext.class };
-
- private final static HashMap<String, String> mapClasses = new HashMap<String, String>();
-
- static {
- mapClasses
- .put("c:set",
- "org.ajax4jsf.templatecompiler.elements.std.SetTemplateElement");
- mapClasses
- .put("c:object",
- "org.ajax4jsf.templatecompiler.elements.std.ObjectTemplateElement");
- mapClasses.put("c:if",
- "org.ajax4jsf.templatecompiler.elements.std.IFTemplateElement");
- mapClasses
- .put("c:forEach",
- "org.ajax4jsf.templatecompiler.elements.std.ForEachTemplateElement");
- mapClasses
- .put("f:clientid",
- "org.ajax4jsf.templatecompiler.elements.vcp.FClientIDTemplateElement");
- mapClasses
- .put("f:clientId",
- "org.ajax4jsf.templatecompiler.elements.vcp.FClientIDTemplateElement");
- mapClasses.put("f:insertComponent",
- "org.ajax4jsf.templatecompiler.elements.vcp.InsertComponent");
-
- mapClasses
- .put("f:call",
- "org.ajax4jsf.templatecompiler.elements.vcp.FCallTemplateElement");
- mapClasses
- .put("f:resource",
- "org.ajax4jsf.templatecompiler.elements.vcp.FResourceTemplateElement");
-
- mapClasses
- .put("u:insertFacet",
- "org.ajax4jsf.templatecompiler.elements.vcp.UInsertFacetTemplateElement");
-
- mapClasses
- .put("vcp:body",
- "org.ajax4jsf.templatecompiler.elements.vcp.VcpBodyTemplateElement");
- mapClasses.put("vcp:mock", "");
-
- mapClasses.put("jsp:scriptlet",
- "org.ajax4jsf.templatecompiler.elements.jsp.Scriptlet");
- mapClasses.put("jsp:declaration",
- "org.ajax4jsf.templatecompiler.elements.jsp.Declaration");
- mapClasses.put("jsp:directive.page",
- "org.ajax4jsf.templatecompiler.elements.jsp.DirectivePage");
- mapClasses.put("jsp:expression",
- "org.ajax4jsf.templatecompiler.elements.jsp.Expression");
- mapClasses.put("h:styles", HeaderStylesElement.class.getName());
- mapClasses.put("h:scripts", HeaderScriptsElement.class.getName());
- mapClasses.put("f:template", RootElement.class.getName());
- mapClasses.put("f:root", RootElement.class.getName());
- mapClasses.put("jsp:root", RootElement.class.getName());
- mapClasses.put("ajax:update", AjaxRenderedAreaElement.class.getName());
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.elements.ElementsFactory#getProcessor(org.w3c.dom.Node, org.ajax4jsf.templatecompiler.builder.CompilationContext)
- */
- public TemplateElement getProcessor(final Node nodeElement,
- final CompilationContext componentBean) throws CompilationException {
- TemplateElement returnValue = null;
-
- short nodeType = nodeElement.getNodeType();
- if (Node.CDATA_SECTION_NODE == nodeType) {
- returnValue =new CDATAElement(nodeElement, componentBean);
- } else if (Node.TEXT_NODE == nodeType) {
- returnValue =new TextElement(nodeElement, componentBean);
- } else if (Node.COMMENT_NODE == nodeType) {
- returnValue =new CommentElement(nodeElement, componentBean);
- } else if (Node.PROCESSING_INSTRUCTION_NODE == nodeType) {
- returnValue =new PIElement(nodeElement, componentBean);
- } else if (Node.ELEMENT_NODE == nodeType) {
- String className = (String) mapClasses.get(nodeElement.getNodeName());
-
- if (className == null) {
- className = DEFAULT_CLASS_ELEMENT_PROCESSOR;
- }
-
- if (!className.equals("")) {
- Class class1;
- try {
- log.debug("loading class: " + className);
-
- class1 = Class.forName(className);
- Object[] objects = new Object[2];
- objects[0] = nodeElement;
- objects[1] = componentBean;
-
- returnValue = (TemplateElement) class1.getConstructor(
- paramClasses).newInstance(objects);
- } catch (InstantiationException e) {
- throw new CompilationException("InstantiationException: "
- + e.getLocalizedMessage(), e);
- } catch (IllegalAccessException e) {
- throw new CompilationException("IllegalAccessException: "
- + e.getLocalizedMessage(), e);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (SecurityException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- throw new CompilationException("InvocationTargetException: "
- + e.getMessage(), e);
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- } catch (ClassNotFoundException e) {
- throw new CompilationException(" error loading class: "
- + e.getLocalizedMessage());
- }
- }
- }
- return returnValue;
- }
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/Attribute.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/Attribute.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/Attribute.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,40 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements;
-
-/**
- * Interface for HTLM-attributes.
- *
- * @author ayukhovich(a)exadel.com (latest modification by $Author:
- * alexeyyukhovich $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/26 20:48:44 $
- *
- */
-public interface Attribute {
- public void copyValues(final Attribute src);
-
- public String getName();
-
- public String getValue();
-
- public String getCode();
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/BodyElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/BodyElement.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/BodyElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,31 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements;
-
-/**
- * Marker interface for central body element ( for renderer, contain encodeChildren method content )
- * @author shura
- *
- */
-public interface BodyElement {
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/DeclarationElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/DeclarationElement.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/DeclarationElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,32 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements;
-
-/**
- * Marker interdace for {@link TemplateElement} processed as declaration, outside
- * of encode... methods
- * @author shura
- *
- */
-public interface DeclarationElement {
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/ElementsArray.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/ElementsArray.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/ElementsArray.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,55 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-
-/**
- * @author ayukhovich(a)exadel.com (latest modification by $Author:
- * alexeyyukhovich $)
- * @version $Revision: 1.1.2.3 $ $Date: 2007/02/26 20:48:45 $
- *
- */
-class ElementsArray extends ArrayList<TemplateElement> {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public String toCode() throws CompilationException {
- StringBuffer buf = new StringBuffer();
-
- Iterator<TemplateElement> i = iterator();
- boolean hasNext = i.hasNext();
- while (hasNext) {
- TemplateElement o = i.next();
- if (o != null) {
- buf.append(o.toCode());
- }
- hasNext = i.hasNext();
- } // while
- return buf.toString();
- }
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/ElementsFactory.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/ElementsFactory.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/ElementsFactory.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,37 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.w3c.dom.Node;
-
-/**
- * @author shura
- *
- */
-public interface ElementsFactory {
-
- public abstract TemplateElement getProcessor(final Node nodeElement,
- final CompilationContext componentBean) throws CompilationException;
-
-}
\ No newline at end of file
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/JSTLElementsFactory.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/JSTLElementsFactory.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/JSTLElementsFactory.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,43 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.w3c.dom.Node;
-
-/**
- * @author shura
- *
- */
-public class JSTLElementsFactory implements ElementsFactory {
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.elements.ElementsFactory#getProcessor(org.w3c.dom.Node, org.ajax4jsf.templatecompiler.builder.CompilationContext)
- */
- public TemplateElement getProcessor(Node nodeElement,
- CompilationContext componentBean) throws CompilationException {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/RootElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/RootElement.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/RootElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,196 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.elements.vcp.VcpBodyTemplateElement;
-import org.apache.velocity.VelocityContext;
-import org.w3c.dom.Node;
-
-/**
- * @author shura
- *
- */
-public class RootElement extends TemplateElementBase {
-
- private static final String TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/ComponentTemplate.vm";
- private static final String ENCODE_BEGIN_TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/EncodeBegin.vm";
- private static final String ENCODE_END_TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/EncodeEnd.vm";
- private static final String ENCODE_CHILDREN_TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/EncodeChildren.vm";
-
- final private static String regexComponent = "(.*)" + VcpBodyTemplateElement.STR_VCB_BODY + "(.*)"
- + VcpBodyTemplateElement.STR_VCB_BODY + "(.*)";
-
- final private static Pattern patternComponent = Pattern.compile(
- regexComponent, Pattern.UNIX_LINES + Pattern.DOTALL);
-
- /**
- * @param element
- * @param componentBean
- */
- public RootElement(Node element, CompilationContext componentBean) {
- super(element, componentBean);
- // TODO apply global attributes
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getBeginElement()
- */
- public String getBeginElement() throws CompilationException {
- VelocityContext context = new VelocityContext();
- context.put("component", this.getComponentBean());
- return this.getComponentBean().processTemplate(getTemplateName(), context);
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElementBase#toCode()
- */
- public String toCode() throws CompilationException {
- VelocityContext context = new VelocityContext();
- context.put("component", this.getComponentBean());
- StringBuffer code = new StringBuffer();
- String beginElement = this.getBeginElement();
- if (null != beginElement) {
- code.append(beginElement);
- code.append("\n");
- }
- StringBuffer declarationsCode = new StringBuffer();
- StringBuffer methodCode = new StringBuffer();
- for (ListIterator<TemplateElement> iter = getSubElements().listIterator(); iter.hasNext();) {
- TemplateElement element = iter.next();
- String toCode = element.toCode();
- if(element instanceof DeclarationElement){
- declarationsCode.append(toCode);
- } /*else if(element instanceof BodyElement){
- // All collected code put to encodeBegin method.
- if (methodCode.length()>0) {
- context.put("body", methodCode.toString());
- code.append(this.getComponentBean().processTemplate(
- getEncodeBeginTemplateName(), context));
- }
- // If body contain any code, create encodeChildren method.
- if (toCode.length()>0) {
- context.put("body", toCode);
- code.append(this.getComponentBean().processTemplate(
- getEncodeChildrenTemplateName(), context));
- }
- methodCode = new StringBuffer();
- } */
- else {
- methodCode.append(toCode);
- }
- }
-
- if (methodCode.length()>0) {
-
- Matcher matcher = patternComponent.matcher(methodCode);
-
- String strEncodeBegin;
- String strEncodeChildren;
- String strEncodeEnd;
-
- if (matcher.find()) {
- strEncodeBegin = matcher.group(1);
- // put content before body element to encodeBegin
- if (strEncodeBegin.trim().length()>0) {
- context.put("body", strEncodeBegin);
- code.append(this.getComponentBean().processTemplate(
- getEncodeBeginTemplateName(), context));
- }
- strEncodeChildren = matcher.group(2);
- if (strEncodeChildren.trim().length()>0 ) {
- // put content of body element
- context.put("body", strEncodeChildren);
- code.append(this.getComponentBean().processTemplate(
- getEncodeChildrenTemplateName(), context));
- }
-
- strEncodeEnd = matcher.group(3);
- if(strEncodeEnd.trim().length()>0){
- // All code after body put to encodeEnd method.
- context.put("body", strEncodeEnd);
- code.append(this.getComponentBean().processTemplate(
- getEncodeEndTemplateName(), context));
- }
- } else {
- // All collected code put to encodeEnd method.
- context.put("body", methodCode.toString());
- code.append(this.getComponentBean().processTemplate(
- getEncodeEndTemplateName(), context));
- }
- }
- if(declarationsCode.length()>0){
- code.append(declarationsCode);
- }
- String endElement = this.getEndElement();
- if (endElement != null) {
- code.append(endElement);
- code.append("\n");
- }
- return code.toString();
- }
-
- /**
- * @return
- */
- protected String getEncodeBeginTemplateName() {
- return ENCODE_BEGIN_TEMPLATE;
- }
-
- /**
- * @return
- */
- protected String getEncodeEndTemplateName() {
- return ENCODE_END_TEMPLATE;
- }
- /**
- * @return
- */
- protected String getEncodeChildrenTemplateName() {
- return ENCODE_CHILDREN_TEMPLATE;
- }
- /**
- * @return
- */
- protected String getTemplateName() {
- return TEMPLATE;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getEndElement()
- */
- public String getEndElement() throws CompilationException {
- // TODO Auto-generated method stub
- return "\n}";
- }
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/TemplateElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/TemplateElement.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/TemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,51 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements;
-
-import java.util.ArrayList;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-
-/**
- * Intarace for tag processors.
- *
- * @author ayukhovich(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.2 $ $Date: 2007/02/26 20:48:43 $
- *
- */
-public interface TemplateElement {
- public String getBeginElement() throws CompilationException;
-
- public String getEndElement() throws CompilationException;
-
- public boolean isSkipBody();
-
- public void addSubElement(TemplateElement e);
-
- public String toCode() throws CompilationException;
-
- /**
- * @return the subElements
- */
- public ArrayList<TemplateElement> getSubElements();
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/TemplateElementBase.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/TemplateElementBase.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/TemplateElementBase.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,93 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.w3c.dom.Node;
-
-/**
- * Abstract base class for tag processors.
- *
- * @author ayukhovich(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.3 $ $Date: 2007/02/26 20:48:44 $
- */
-public abstract class TemplateElementBase implements TemplateElement {
-
-
- private CompilationContext componentBean;
-
- private ElementsArray subElements = new ElementsArray();
-
-
- public TemplateElementBase(final Node element,
- final CompilationContext componentBean) {
- this.componentBean = componentBean;
- };
-
- public boolean isSkipBody() {
- // by default, children process by compiler.
- return false;
- }
-
- public void addSubElement(TemplateElement e) {
- this.subElements.add(e);
- }
-
- public String toCode() throws CompilationException {
- StringBuffer buf = new StringBuffer();
-
- String beginElement = this.getBeginElement();
- if (null != beginElement) {
- buf.append(beginElement);
- buf.append("\n");
- }
-
- if (this.subElements.size() != 0) {
- buf.append(this.subElements.toCode());
- }
-
- String endElement = this.getEndElement();
- if (endElement != null) {
- buf.append(endElement);
- buf.append("\n");
- }
-
- return buf.toString();
- }
-
- /**
- * @return the componentBean
- */
- public CompilationContext getComponentBean() {
- return componentBean;
- }
-
- /**
- * @return the subElements
- */
- public ElementsArray getSubElements() {
- return this.subElements;
- }
-
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/CDATAElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/CDATAElement.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/CDATAElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,69 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements.html;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
-import org.w3c.dom.Node;
-
-/**
- * @author shura
- *
- */
-public class CDATAElement extends TemplateElementBase {
-
- private String htmlText;
-
- public CDATAElement(Node element, CompilationContext componentBean) {
- super(element, componentBean);
- this.htmlText = element.getNodeValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getBeginElement()
- */
- public String getBeginElement() {
- StringBuffer retValue = new StringBuffer();
- if ((null != this.htmlText) && (this.htmlText.length() > 0)) {
- retValue.append(" writer.write(\"<![CDATA[\");\n");
- retValue.append(" writer.write(convertToString(").append(
- ELParser.compileEL(this.htmlText, this.getComponentBean()))
- .append("));\n");
- retValue.append(" writer.write(\"]]>\");\n");
- }
- return retValue.toString();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getEndElement()
- */
- public String getEndElement() {
- // Do nothitg - text not have childs
- return null;
- }
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/CommentElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/CommentElement.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/CommentElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,70 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements.html;
-
-import java.util.Formatter;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
-import org.w3c.dom.Node;
-
-/**
- * @author shura
- *
- */
-public class CommentElement extends TemplateElementBase {
-
- private String htmlText;
-
- public CommentElement(Node element, CompilationContext componentBean) {
- super(element, componentBean);
- this.htmlText = element.getNodeValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getBeginElement()
- */
- public String getBeginElement() {
- String retValue = null;
- if ((null != this.htmlText) && (this.htmlText.length() > 0)) {
- Object[] params = { ELParser.compileEL(this.htmlText, this.getComponentBean()) };
- retValue = new Formatter().format(
- "writer.writeComment(convertToString(%s));\n", params)
- .toString();
- }
- return retValue;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getEndElement()
- */
- public String getEndElement() {
- // Do nothitg - text not have childs
- return null;
- }
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLAttributes.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLAttributes.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLAttributes.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,63 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements.html;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.ajax4jsf.templatecompiler.elements.Attribute;
-
-/**
- * Processing HTLM-attributes.
- *
- * @author ayukhovich(a)exadel.com (latest modification by $Author:
- * alexeyyukhovich $)
- * @version $Revision: 1.1.2.2 $ $Date: 2007/02/26 20:48:41 $
- *
- */
-public class HTMLAttributes {
- private LinkedHashMap attributesMap = new LinkedHashMap();
-
-
- public void addAttribute(String nameAttribute, String valueAttribute) {
-
- Attribute attribute = HtmlAttributesFactory.getProcessor(
- nameAttribute, valueAttribute);
-
- if (attribute != null) {
- Attribute oldElemet = (Attribute) this.attributesMap.get(attribute
- .getName());
-
- if (oldElemet != null) {
- oldElemet.copyValues(attribute);
- } else {
- this.attributesMap.put(attribute.getName(), attribute);
- }
- } else {
- System.out.println("attribute is null");
- }
- }
-
- public Map getAttributes() {
- return this.attributesMap;
- }
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLElement.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,187 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements.html;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Formatter;
-import java.util.List;
-import java.util.TreeSet;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
-import org.apache.velocity.VelocityContext;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Processing template HTLM-attributes.
- *
- * @author ayukhovich(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.3 $ $Date: 2007/02/26 20:48:42 $
- *
- */
-public class HTMLElement extends TemplateElementBase {
- final static private String PRE_TAG_NAME = "pre";
-
- private static final String PASS_THRU_ATTR = "x:passThruWithExclusions";
-
- private static final List<String> DEFAULT_EXCLUSIONS = Arrays.asList("class", "id");
-
- private static final String TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH
- + "/HTMLElement.vm";
-
- private String htmlTag;
-
- private String htmlText;
-
- private HTMLAttributes htmlAttributes = new HTMLAttributes();
-
- private Collection<String> passThruAttributes = null;
-
- private CompilationContext componentBean;
-
- /**
- *
- * @param element
- * @param variables
- */
- public HTMLElement(final Node element,
- final CompilationContext componentBean) {
- super(element, componentBean);
-
- this.passThruAttributes = null;
- this.htmlTag = element.getNodeName();
- this.componentBean = componentBean;
- processingAttributes(element.getAttributes());
- }
-
- /**
- * @return string contain
- * @throws CompilationException
- */
- public String getBeginElement() throws CompilationException {
- VelocityContext context = new VelocityContext();
- context.put("htmlTag", this.htmlTag);
- context.put("htmlAttributes", this.htmlAttributes.getAttributes());
- context.put("passThruAttributes", this.passThruAttributes);
- if (this.htmlText != null) {
- context.put("htmlText", this.htmlText);
- }
- return this.componentBean.processTemplate(getTemplateName(), context);
-
- }
-
- /**
- * @return
- */
- protected String getTemplateName() {
- // TODO Auto-generated method stub
- return TEMPLATE;
- }
-
- /**
- * @return
- */
- public String getEndElement() {
- String sReturnValue;
-
- Object[] objects = new Object[1];
- objects[0] = this.htmlTag;
-
- sReturnValue = new Formatter().format("writer.endElement(\"%s\");",
- objects).toString();
- return sReturnValue;
- }
-
- /**
- *
- * @param attributes
- */
- public void processingAttributes(NamedNodeMap attributes) {
- if (attributes == null) {
- return;
- }
-
- for (int iElement = 0; iElement != attributes.getLength(); iElement++) {
- Node attribute = attributes.item(iElement);
- String attributeName = attribute.getNodeName();
- String attributeValue = attribute.getNodeValue();
-
- if (attributeName.equals(PASS_THRU_ATTR)) {
- processingPassThruAtrribute(attributeValue);
- } else {
- this.htmlAttributes.addAttribute(attributeName, ELParser
- .compileEL(attributeValue, this.componentBean));
- }
-
- } // for
- }
-
- /**
- *
- * @param listPassThruAttributes
- */
- private void processingPassThruAtrribute(String listPassThruAttributes) {
-
- passThruAttributes =
- new TreeSet<String>(HTMLTags.getAttributes(this.htmlTag));
-
- String[] excludeAttributes = listPassThruAttributes.split(",");
-
- passThruAttributes.removeAll(DEFAULT_EXCLUSIONS);
-
- for (String attribute : excludeAttributes) {
- passThruAttributes.remove(attribute);
- }
-
- }
-
- /**
- * Set a body text for HTML-tag
- *
- * @param nodeText
- */
- public void setText(final String nodeText) {
- String tempStr = null;
- // if TAG is not PRE test do not trim
- if (nodeText.trim().length() != 0) {
- if (this.htmlTag.compareToIgnoreCase(PRE_TAG_NAME) == 0) {
- tempStr = nodeText;
- } else {
- tempStr = nodeText.trim();
- }
- }
-
- if (null != tempStr) {
- if (null == this.htmlText) {
- this.htmlText = ELParser.compileEL(tempStr, this.componentBean);
- } else {
- this.htmlText = this.htmlText
- + ELParser.compileEL(tempStr, this.componentBean);
- }
- }
- }
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLTags.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLTags.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLTags.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,107 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements.html;
-
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.net.URL;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.Map.Entry;
-
-import org.richfaces.dtd.DocumentDefinition;
-import org.richfaces.dtd.DocumentDefinitionFactory;
-import org.richfaces.dtd.Element;
-
-
-/**
- * @author yukhovich
- * @author Maksim Kaszynski
- */
-public class HTMLTags {
- /**
- *
- */
-
- private static final String HTML_SCHEMA = "META-INF/schema/html/xhtml1-transitional.dtd";
-
- private static final URL HTML_DTD = HTMLTags.class.getClassLoader().getResource(HTML_SCHEMA);
-
- @SuppressWarnings("unchecked")
- public static Set<String> getAttributes(String tagName) {
- Set<String> atrs = Collections.emptySet();
-
- DocumentDefinition dtd =
- DocumentDefinitionFactory.instance().getDocumentDefinition(HTML_DTD);
-
- if (dtd != null) {
- Element element = dtd.getElement(tagName);
-
- if (element != null) {
- atrs = element.getAttributes().keySet();
- }
- }
-
- return atrs;
-
- }
-
- /**
- * Look for tags.bin, and compare with it
- * @param args
- * @throws Exception
- */
- public static void main(String [] args) throws Exception{
- InputStream stream = HTMLTags.class.getClassLoader().getResourceAsStream("META-INF/templates/templatecompiler/tags.bin");
-
- ObjectInputStream stream2 = new ObjectInputStream(stream);
-
- @SuppressWarnings("unchecked")
- Map<String, List<String>> m =
- (Map<String, List<String>>) stream2.readObject();
-
- Set<String> newAttrs = new TreeSet<String>();
-
- Set<Entry<String,List<String>>> entrySet = m.entrySet();
- for (Entry<String, List<String>> entry : entrySet) {
- String element = entry.getKey();
-
- Set<String> attributes = HTMLTags.getAttributes(element);
- List<String> attributeList = entry.getValue();
-
- if (attributeList != null && attributes != null) {
- attributes.removeAll(attributeList);
- }
- newAttrs.addAll(attributes);
-
- System.out.println(element + attributes);
-
- }
-
- System.out.println(newAttrs);
- }
-
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HtmlAttributesFactory.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HtmlAttributesFactory.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HtmlAttributesFactory.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,93 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements.html;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-
-import org.ajax4jsf.templatecompiler.elements.Attribute;
-
-/**
- * Factory for processing HTLM-attributes.
- *
- * @author ayukhovich(a)exadel.com (latest modification by $Author:
- * alexeyyukhovich $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/26 20:48:42 $
- *
- */
-public class HtmlAttributesFactory {
- private final static String DEFAULT_CLASS_ATTRIBUTE_PROCESSOR = "org.ajax4jsf.templatecompiler.elements.html.attribute.HtmlAttribute";
-
- private final static Class[] paramClasses = new Class[] { String.class,
- String.class };
-
- private final static HashMap mapClasses = new HashMap();
-
- static {
- // mapClasses.put("x:passThruWithExclusions",
- // "org.ajax4jsf.templatecompiler.elements.html.attribute.PassThruWithExclusions");
- mapClasses.put("x:otherParameters", "");
- }
-
- public static Attribute getProcessor(String attributeName,
- String attributeValue) {
- Attribute returnValue = null;
-
- String className = (String) mapClasses.get(attributeName);
-
- if (className == null) {
- className = DEFAULT_CLASS_ATTRIBUTE_PROCESSOR;
- }
-
- if (!className.equals("")) {
- Class class1;
- try {
- class1 = Class.forName(className);
- try {
- try {
- Object[] objects = new Object[2];
- objects[0] = attributeName;
- objects[1] = attributeValue;
- returnValue = (Attribute) class1.getConstructor(
- paramClasses).newInstance(objects);
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (SecurityException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- } catch (ClassNotFoundException e1) {
- e1.printStackTrace();
- }
- }
-
- return returnValue;
- }
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/PIElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/PIElement.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/PIElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,68 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements.html;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
-import org.w3c.dom.Node;
-
-/**
- * @author shura
- *
- */
-public class PIElement extends TemplateElementBase {
-
- private String htmlText;
-
- public PIElement(Node element, CompilationContext componentBean) {
- super(element, componentBean);
- this.htmlText = element.getNodeValue();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getBeginElement()
- */
- public String getBeginElement() {
- StringBuffer retValue = new StringBuffer();
- if ((null != this.htmlText) && (this.htmlText.length() > 0)) {
- retValue.append(" writer.write(\"<![CDATA[\");\n");
- retValue.append(" writer.write(").append(
- ELParser.compileEL(this.htmlText, this.getComponentBean())).append(");\n");
- retValue.append(" writer.write(\"]]>\");\n");
- }
- return null; // retValue.toString();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getEndElement()
- */
- public String getEndElement() {
- // Do nothitg - text not have childs
- return null;
- }
-
-}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/TextElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/TextElement.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/TextElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,70 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.elements.html;
-
-import java.util.Formatter;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
-import org.w3c.dom.Node;
-
-/**
- * @author shura
- *
- */
-public class TextElement extends TemplateElementBase {
-
- private String htmlText;
-
- public TextElement(Node element, CompilationContext componentBean) {
- super(element, componentBean);
- this.htmlText = element.getNodeValue().trim();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getBeginElement()
- */
- public String getBeginElement() {
- String retValue = null;
- if ((null != this.htmlText) && (this.htmlText.length() > 0)) {
- Object[] params = { ELParser.compileEL(this.htmlText, this.getComponentBean()) };
- retValue = new Formatter().format(
- "writer.writeText(convertToString(%s),null);\n", params)
- .toString();
- }
- return retValue;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getEndElement()
- */
- public String getEndElement() {
- // Do nothitg - text not have childs
- return null;
- }
-
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ActionSource2PropertyProcessor.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ActionSource2PropertyProcessor.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ActionSource2PropertyProcessor.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ActionSource2PropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,111 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.component;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.faces.component.ActionSource2;
+import javax.faces.el.MethodBinding;
+
+import org.richfaces.builder.component.methods.VelocityMethodBody;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.generator.GeneratorException;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.model.JavaClass;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaLanguageElement;
+import org.richfaces.builder.model.JavaMethod;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+@SuppressWarnings("deprecation")
+public class ActionSource2PropertyProcessor extends ComponentPropertyProcessor {
+
+ private static final List<String> ACCEPTED_NAMES = Arrays.asList("action", "actionListener", "actionExpression");
+
+ @Override
+ public boolean accept(PropertyBean propertyBean, JavaClass javaClass,
+ JSFGeneratorConfiguration configuration) {
+
+ boolean result = !propertyBean.isExist();
+
+ if (result) {
+ result = ActionSource2.class.isAssignableFrom(javaClass.getSuperClass());
+ if (result) {
+ result = ACCEPTED_NAMES.contains(propertyBean.getName());
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public void process(PropertyBean propertyBean, JavaClass javaClass,
+ JSFGeneratorConfiguration configuration) {
+
+ JavaField field = getField(propertyBean, configuration);
+ JavaMethod accessor = getAccessor(configuration, propertyBean, field);
+ JavaMethod mutator = getMutator(configuration, propertyBean, field);
+
+ if("action".equals(propertyBean.getName())) {
+
+ try {
+ accessor.setMethodBody(new VelocityMethodBody(configuration) {
+ @Override
+ public String getTemplate() {
+ return "snippets/get-action.vm";
+ }
+ });
+ mutator.setMethodBody(new VelocityMethodBody(configuration) {
+ @Override
+ public String getTemplate() {
+ return "snippets/set-action.vm";
+ }
+ });
+
+ } catch (GeneratorException e) {
+ e.printStackTrace();
+ }
+
+ } else {
+ javaClass.addField(field);
+ }
+
+ if (field.getType().getName().equals(MethodBinding.class.getName())) {
+
+ for(JavaLanguageElement el : new JavaLanguageElement[] {field, accessor, mutator}) {
+ el.addAnnotation(SuppressWarnings.class, "\"deprecation\"");
+ }
+
+ }
+
+
+ //Do not add variable
+ javaClass.addMethod(accessor);
+ javaClass.addMethod(mutator);
+
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ComponentModelBuilder.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentModelBuilder.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ComponentModelBuilder.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ComponentModelBuilder.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,206 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.component;
+
+import static org.richfaces.builder.model.Argument.*;
+
+import java.util.Collection;
+
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.builder.component.state.ComponentStateManager;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.config.RendererBean;
+import org.richfaces.builder.generator.GeneratorException;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.model.JavaClass;
+import org.richfaces.builder.model.JavaConstructor;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaMethod;
+import org.richfaces.builder.model.JavaModifier;
+import org.richfaces.builder.model.JavaPackage;
+import org.richfaces.builder.model.MethodBody;
+
+/**
+ * Build component class model from configs
+ * @author Maksim Kaszynski
+ *
+ */
+public class ComponentModelBuilder {
+
+ private PropertyProcessor[] propertyProcessors = {
+ new ActionSource2PropertyProcessor(),
+ new ExpressionPropertyProcessor(),
+ new PrimitivePropertyProcessor(),
+ new ELPropertyProcessor(),
+ new ComponentPropertyProcessor()};
+
+ public JavaClass build(ComponentBean componentBean, JSFGeneratorConfiguration configuration) {
+
+ String superclassname =
+ componentBean.getSuperclass();
+
+ JavaClass javaClass =
+ new JavaClass(componentBean.getSimpleClassName(),
+ new JavaPackage(componentBean.getPackageName()));
+
+ try {
+ Class<?> superClass =
+ Class.forName(superclassname, false, configuration.getClassLoader());
+
+ javaClass.setSuperClass(superClass);
+
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ javaClass.setSuperClass(UIComponentBase.class);
+ }
+
+ javaClass.addModifier(JavaModifier.PUBLIC);
+
+ javaClass.addField(getComponentFamily(componentBean));
+ javaClass.addField(getComponentType(componentBean));
+
+ javaClass.addMethod(getConstructor(componentBean, javaClass));
+
+ Collection<PropertyBean> properties = componentBean.getProperties();
+
+ for (PropertyBean propertyBean : properties) {
+ PropertyProcessor proc = null;
+
+ for (int i = 0; i < propertyProcessors.length && proc == null; i++) {
+
+ PropertyProcessor processor =
+ propertyProcessors[i];
+
+ if (processor.accept(propertyBean, javaClass, configuration)) {
+ proc = processor;
+ }
+ }
+
+ if (proc != null) {
+ proc.process(propertyBean, javaClass, configuration);
+ }
+ }
+
+ javaClass.addMethod(getComponentFamilyMethod(componentBean));
+
+ ComponentStateManager stateManager = new ComponentStateManager(javaClass);
+
+ JavaMethod saveState = getSaveStateTemplate();
+ try {
+ saveState.setMethodBody(stateManager.getSaveStateMethodBody(configuration));
+ } catch (GeneratorException e) {
+ e.printStackTrace();
+ }
+ javaClass.addMethod(saveState);
+
+ JavaMethod restoreState = getRestoreStateTemplate();
+ try {
+ restoreState.setMethodBody(stateManager.getRestoreStateMethodBody(configuration));
+ } catch (GeneratorException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ javaClass.addMethod(restoreState);
+
+
+
+ return javaClass;
+
+ }
+
+ private JavaMethod getComponentFamilyMethod(ComponentBean componentBean) {
+ JavaMethod javaMethod = new JavaMethod("getFamily", String.class);
+ javaMethod.addModifier(JavaModifier.PUBLIC);
+ javaMethod.setMethodBody(new MethodBody() {
+ @Override
+ public String toCode() {
+ return "return COMPONENT_FAMILY;";
+ }
+ });
+ return javaMethod;
+ }
+
+ private JavaMethod getRestoreStateTemplate() {
+ JavaMethod method =
+ new JavaMethod("restoreState",
+ Void.TYPE,
+ arg("context", FacesContext.class),
+ arg("state", Object.class));
+ method.addModifier(JavaModifier.PUBLIC);
+ method.addAnnotation(Override.class);
+
+ return method;
+ }
+
+ private JavaMethod getSaveStateTemplate() {
+ JavaMethod method =
+ new JavaMethod("saveState",
+ Object.class,
+ arg("context", FacesContext.class));
+ method.addModifier(JavaModifier.PUBLIC);
+ method.addAnnotation(Override.class);
+ method.setMethodBody(new MethodBody() {
+ @Override
+ public String toCode() {
+ return "return super.saveState(context);";
+ }
+ });
+ return method;
+ }
+
+ private JavaField getComponentType(ComponentBean componentBean) {
+ JavaField field = new JavaField(String.class, "COMPONENT_TYPE");
+ field.addModifier(JavaModifier.PUBLIC);
+ field.addModifier(JavaModifier.STATIC);
+ field.addModifier(JavaModifier.FINAL);
+ field.setValue("\"" + componentBean.getName() + "\"");
+ return field;
+ }
+ private JavaField getComponentFamily(ComponentBean componentBean) {
+ JavaField field = new JavaField(String.class, "COMPONENT_FAMILY");
+ field.addModifier(JavaModifier.PUBLIC);
+ field.addModifier(JavaModifier.STATIC);
+ field.addModifier(JavaModifier.FINAL);
+ field.setValue("\"" + componentBean.getFamily() + "\"");
+ return field;
+ }
+
+ private JavaMethod getConstructor(ComponentBean componentBean, JavaClass javaClass) {
+ final RendererBean renderer = componentBean.getRenderer();
+ JavaMethod method = new JavaConstructor(javaClass);
+ method.addModifier(JavaModifier.PUBLIC);
+ method.setMethodBody(new MethodBody(method) {
+ @Override
+ public String toCode() {
+ if (renderer != null) {
+ return "setRendererType(\"" + renderer.getName() + "\");";
+ }
+ return super.toCode();
+ }
+ });
+
+ return method;
+ }
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ComponentPropertyProcessor.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ComponentPropertyProcessor.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ComponentPropertyProcessor.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ComponentPropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,133 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.component;
+
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.model.Argument;
+import org.richfaces.builder.model.JavaClass;
+import org.richfaces.builder.model.JavaComment;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaLanguageElement;
+import org.richfaces.builder.model.JavaMethod;
+import org.richfaces.builder.model.JavaModifier;
+import org.richfaces.builder.model.JavaPrimitive;
+import org.richfaces.builder.model.MethodBody;
+
+/**
+ * Default property handler - a fallback one.
+ * @author Maksim Kaszynski
+ *
+ */
+public class ComponentPropertyProcessor implements PropertyProcessor {
+
+ public boolean accept(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration) {
+ return !propertyBean.isExist();
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.builder.render.PropertyProcessor#process(org.richfaces.builder.config.PropertyBean, org.richfaces.builder.model.JavaClass)
+ */
+ public void process(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration) {
+ JavaField field = getField(propertyBean, configuration);
+
+ javaClass.addField(field);
+ javaClass.addMethod(getAccessor(configuration, propertyBean, field));
+ javaClass.addMethod(getMutator(configuration, propertyBean, field));
+ }
+
+ protected JavaField getField(PropertyBean propertyBean, JSFGeneratorConfiguration configuration) {
+ String name = propertyBean.getName();
+ String defaultvalue = propertyBean.getDefaultvalue();
+ Class<?> propertyClass = getType(propertyBean, configuration.getClassLoader());
+ JavaField field = new JavaField(propertyClass, "_" + name, defaultvalue);
+ field.getComments().add(new JavaComment(propertyBean.getXmlEncodedDescription()));
+ field.getModifiers().add(JavaModifier.PRIVATE);
+
+ if (propertyBean.isTransient()) {
+ field.addModifier(JavaModifier.TRANSIENT);
+ }
+
+ handleDeprecation(field.getType(), field);
+ return field;
+ }
+
+ protected Class<?> getType(PropertyBean propertyBean, ClassLoader classLoader) {
+ if (propertyBean.isSimpleType()) {
+ try {
+ Class<?> clazz = JavaPrimitive.forName(propertyBean.getClassname());
+ return clazz;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } else {
+ try {
+ Class<?> clazz = Class.forName(propertyBean.getClassname(), false, classLoader);
+ return clazz;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ return Object.class;
+ }
+
+ protected JavaMethod getAccessor(JSFGeneratorConfiguration configuration, PropertyBean propertyBean, final JavaField field) {
+ JavaMethod accessor =
+ new JavaMethod(propertyBean.getGetterName(), field.getType());
+
+ accessor.setMethodBody(new MethodBody() {
+ @Override
+ public String toCode() {
+ return "return " + field.getName() + ";";
+ }
+ });
+
+ accessor.addModifier(JavaModifier.PUBLIC);
+ handleDeprecation(field.getType(), accessor);
+
+ return accessor;
+ }
+
+ protected JavaMethod getMutator(JSFGeneratorConfiguration configuration, PropertyBean propertyBean, final JavaField field) {
+ JavaMethod mutator =
+ new JavaMethod(propertyBean.getSetterName(),
+ new Argument(field.getName(), field.getType()));
+
+ mutator.setMethodBody(new MethodBody(mutator) {
+ @Override
+ public String toCode() {
+ return "this." + field.getName() + " = " + field.getName() + ";";
+ }
+ });
+
+ handleDeprecation(field.getType(), mutator);
+ mutator.addModifier(JavaModifier.PUBLIC);
+ return mutator;
+ }
+
+ protected void handleDeprecation(Class<?> type, JavaLanguageElement element) {
+ if (type.isAnnotationPresent(Deprecated.class)) {
+ element.addAnnotation(SuppressWarnings.class, "\"deprecation\"");
+ }
+ }
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ELPropertyProcessor.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ELPropertyProcessor.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ELPropertyProcessor.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ELPropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,65 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.component;
+
+import org.richfaces.builder.component.methods.ELPropertyAccessorMethodBody;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.generator.GeneratorException;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.model.JavaClass;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaMethod;
+import org.richfaces.builder.model.MethodBody;
+
+/**
+ * Processing of EL-enabled properties
+ * @author Maksim Kaszynski
+ *
+ */
+public class ELPropertyProcessor extends ComponentPropertyProcessor {
+
+ @Override
+ public boolean accept(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration) {
+ return !(propertyBean.isExist() || propertyBean.isSimpleType()) && propertyBean.isEl() ;
+ }
+
+ @Override
+ protected JavaMethod getAccessor(JSFGeneratorConfiguration config, PropertyBean propertyBean, JavaField field) {
+ field.setValue("null");
+
+ JavaMethod accessor = super.getAccessor(config, propertyBean, field);
+
+ try {
+ ELPropertyAccessorMethodBody propertyAccessorMethodBody =
+ new ELPropertyAccessorMethodBody(config, propertyBean, field);
+
+ accessor.setMethodBody(propertyAccessorMethodBody);
+
+ } catch (GeneratorException e) {
+ accessor.setMethodBody(new MethodBody());
+ e.printStackTrace();
+ }
+
+ return accessor;
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ExpressionPropertyProcessor.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/ExpressionPropertyProcessor.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ExpressionPropertyProcessor.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/ExpressionPropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,73 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.component;
+
+import javax.el.Expression;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.ValueBinding;
+
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.model.JavaClass;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+@SuppressWarnings("deprecation")
+public class ExpressionPropertyProcessor extends ComponentPropertyProcessor {
+
+ private static final Class<?>[] acceptedClasses = {
+ MethodBinding.class,
+ ValueBinding.class,
+ Expression.class};
+
+ @Override
+ public boolean accept(PropertyBean propertyBean, JavaClass javaClass,
+ JSFGeneratorConfiguration configuration) {
+
+ boolean result =
+ !propertyBean.isExist() &&
+ propertyBean.isEl() &&
+ propertyBean.isElonly();
+
+ if (result) {
+ Class<?> type =
+ getType(propertyBean, configuration.getClassLoader());
+
+ result = false;
+
+ for (Class<?> clazz : acceptedClasses) {
+ if (clazz.isAssignableFrom(type)) {
+ result = true;
+ break;
+ }
+ }
+
+
+ }
+
+
+
+ return result;
+ }
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/PrimitivePropertyProcessor.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PrimitivePropertyProcessor.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/PrimitivePropertyProcessor.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/PrimitivePropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,141 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.component;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+
+import org.richfaces.builder.component.methods.VelocityMethodBody;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.generator.GeneratorException;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.model.JavaClass;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaMethod;
+import org.richfaces.builder.model.JavaModifier;
+import org.richfaces.builder.model.JavaPrimitive;
+import org.richfaces.builder.model.MethodBody;
+
+/**
+ * Handle primitive properties
+ * @author Maksim Kaszynski
+ *
+ */
+public class PrimitivePropertyProcessor extends ComponentPropertyProcessor {
+
+ class PrimitiveELPropertyAccessorMethodBody extends VelocityMethodBody {
+
+ public PrimitiveELPropertyAccessorMethodBody(
+ JSFGeneratorConfiguration configuration, JavaField field, JavaField field2, PropertyBean property)
+ throws GeneratorException {
+ super(configuration);
+ getContext().put("field1", field);
+ getContext().put("field2", field2);
+ getContext().put("wrapperClass", JavaPrimitive.wrapperType(field.getType()));
+ getContext().put("property", property);
+ addType(ValueExpression.class);
+ addType(ELException.class);
+ addType(FacesException.class);
+ }
+
+ @Override
+ public String getTemplate() {
+ return "snippets/primitive-el-property-accessor.vm";
+ }
+ }
+
+ class PrimitivePropertyAccessorMethodBody extends VelocityMethodBody {
+
+ public PrimitivePropertyAccessorMethodBody(
+ JSFGeneratorConfiguration configuration, JavaField field, JavaField field2)
+ throws GeneratorException {
+ super(configuration);
+ getContext().put("field1", field);
+ getContext().put("field2", field2);
+ }
+
+ @Override
+ public String getTemplate() {
+ return "snippets/primitive-property-accessor.vm";
+ }
+ }
+
+ class PrimitivePropertyMutatorMethodBody extends VelocityMethodBody {
+
+ public PrimitivePropertyMutatorMethodBody(
+ JSFGeneratorConfiguration configuration, JavaField field, JavaField field2)
+ throws GeneratorException {
+ super(configuration);
+ getContext().put("field1", field);
+ getContext().put("field2", field2);
+ }
+
+ @Override
+ public String getTemplate() {
+ return "snippets/primitive-property-mutator.vm";
+ }
+ }
+
+ @Override
+ public boolean accept(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration) {
+ return propertyBean.isSimpleType() && super.accept(propertyBean, javaClass, configuration);
+ }
+
+ @Override
+ public void process(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration) {
+ JavaField field = getField(propertyBean, configuration);
+ JavaField field2 = new JavaField(boolean.class, field.getName() + "Set", "false");
+ field2.addModifier(JavaModifier.PRIVATE);
+ if (propertyBean.isTransient()) {
+ field2.addModifier(JavaModifier.TRANSIENT);
+ }
+ JavaMethod accessor = getAccessor(configuration, propertyBean, field);
+ MethodBody accessorMethodBody;
+
+ try {
+ if (propertyBean.isEl()) {
+ accessorMethodBody = new PrimitiveELPropertyAccessorMethodBody(configuration, field, field2, propertyBean);
+ } else {
+ accessorMethodBody = new PrimitivePropertyAccessorMethodBody(configuration, field, field2);
+ }
+ accessor.setMethodBody(accessorMethodBody);
+ } catch (GeneratorException e) {
+ e.printStackTrace();
+ }
+
+ JavaMethod mutator = getMutator(configuration, propertyBean, field);
+
+ try {
+ PrimitivePropertyMutatorMethodBody mutatorBody = new PrimitivePropertyMutatorMethodBody(configuration, field, field2);
+ mutator.setMethodBody(mutatorBody);
+ } catch (GeneratorException e) {
+ e.printStackTrace();
+ }
+
+ javaClass.addField(field);
+ javaClass.addField(field2);
+ javaClass.addMethod(accessor);
+ javaClass.addMethod(mutator);
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/PropertyProcessor.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/PropertyProcessor.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/PropertyProcessor.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/PropertyProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,36 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.component;
+
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.model.JavaClass;
+
+/**
+ * Process single property - add field to class, accessor, mutator, etc.
+ * @author Maksim Kaszynski
+ *
+ */
+public interface PropertyProcessor {
+ boolean accept(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration);
+ void process(PropertyBean propertyBean, JavaClass javaClass, JSFGeneratorConfiguration configuration);
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/methods)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/ELPropertyAccessorMethodBody.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/methods/ELPropertyAccessorMethodBody.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/ELPropertyAccessorMethodBody.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,16 +19,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.methods;
+package org.richfaces.builder.component.methods;
import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.FacesException;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.generator.GeneratorException;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.model.JavaField;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.generator.GeneratorException;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.model.JavaField;
/**
* Render accessor for EL-enabled property
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleAccessor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/methods/SimpleAccessor.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleAccessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.methods;
+package org.richfaces.builder.component.methods;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaMethod;
-import org.ajax4jsf.builder.model.JavaModifier;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaMethod;
+import org.richfaces.builder.model.JavaModifier;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleAccessorMethodBody.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/methods/SimpleAccessorMethodBody.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleAccessorMethodBody.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.methods;
+package org.richfaces.builder.component.methods;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaMethod;
-import org.ajax4jsf.builder.model.MethodBody;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaMethod;
+import org.richfaces.builder.model.MethodBody;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleMutator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/methods/SimpleMutator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleMutator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,12 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.methods;
+package org.richfaces.builder.component.methods;
-import org.ajax4jsf.builder.model.Argument;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaMethod;
-import org.ajax4jsf.builder.model.JavaModifier;
+import org.richfaces.builder.model.Argument;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaMethod;
+import org.richfaces.builder.model.JavaModifier;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleMutatorMethodBody.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/methods/SimpleMutatorMethodBody.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/SimpleMutatorMethodBody.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.methods;
+package org.richfaces.builder.component.methods;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaMethod;
-import org.ajax4jsf.builder.model.MethodBody;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaMethod;
+import org.richfaces.builder.model.MethodBody;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/VelocityMethodBody.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/methods/VelocityMethodBody.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/methods/VelocityMethodBody.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,15 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.methods;
+package org.richfaces.builder.component.methods;
import java.io.StringWriter;
-import org.ajax4jsf.builder.generator.GeneratorException;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.model.MethodBody;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.generator.GeneratorException;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.model.MethodBody;
/**
* Render method body by using Velocity
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/AttachedStateDescriptor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state/AttachedStateDescriptor.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/AttachedStateDescriptor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,9 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.state;
+package org.richfaces.builder.component.state;
-import org.ajax4jsf.builder.model.JavaField;
+import org.richfaces.builder.model.JavaField;
/**
* Save attached state,
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/ComponentStateDescriptor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state/ComponentStateDescriptor.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/ComponentStateDescriptor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,9 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.state;
+package org.richfaces.builder.component.state;
-import org.ajax4jsf.builder.model.JavaField;
+import org.richfaces.builder.model.JavaField;
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/ComponentStateManager.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state/ComponentStateManager.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/ComponentStateManager.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,21 +19,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.state;
+package org.richfaces.builder.component.state;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import org.ajax4jsf.builder.component.methods.VelocityMethodBody;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.generator.GeneratorException;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.model.JavaClass;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaModifier;
-import org.ajax4jsf.builder.model.MethodBody;
+import org.richfaces.builder.component.methods.VelocityMethodBody;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.generator.GeneratorException;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.model.JavaClass;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaModifier;
+import org.richfaces.builder.model.MethodBody;
/**
* Class responsible for generating save/restore state methods.
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/PrimitiveStateDescriptor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state/PrimitiveStateDescriptor.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/PrimitiveStateDescriptor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.state;
+package org.richfaces.builder.component.state;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaPrimitive;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaPrimitive;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/SimplePropertyDescriptor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/component/state/SimplePropertyDescriptor.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/component/state/SimplePropertyDescriptor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,9 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.component.state;
+package org.richfaces.builder.component.state;
-import org.ajax4jsf.builder.model.JavaField;
+import org.richfaces.builder.model.JavaField;
/**
* @author Maksim Kaszynski
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/BuilderConfig.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/BuilderConfig.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
import java.beans.PropertyDescriptor;
import java.io.File;
@@ -34,11 +34,11 @@
import javax.naming.ConfigurationException;
-import org.ajax4jsf.builder.generator.Logger;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.digester.Digester;
import org.apache.commons.digester.ExtendedBaseRules;
import org.apache.tools.ant.BuildException;
+import org.richfaces.builder.generator.Logger;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.ext.EntityResolver2;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ClassVisitor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ClassVisitor.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ClassVisitor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ClassWalkingLogic.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ClassWalkingLogic.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ClassWalkingLogic.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
/**
* @author Maksim Kaszynski
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ComponentBaseBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ComponentBaseBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,381 +0,0 @@
-package org.ajax4jsf.builder.config;
-
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.faces.component.StateHolder;
-import javax.faces.context.FacesContext;
-import javax.naming.ConfigurationException;
-
-import org.apache.commons.beanutils.PropertyUtils;
-
-public class ComponentBaseBean extends JsfBean {
-
- private static final String[] ignorableComponentProperties = {
- "class",
- "attributes",
- "childCount",
- "children",
- "facets",
- "facetsAndChildren",
- "family",
- "parent",
- "rendererType",
- "rendersChildren",
- "submittedValue",
- "transient"};
- private static final String[] enabledTagProperties = {
- "binding"
- };
- private static final String[] attachedStateProperties = {
- "javax.faces.component.StateHolder",
- "java.util.List",
- "javax.faces.el.MethodBinding",
- "javax.faces.el.ValueBinding",
- "javax.el.MethodExpression",
- "javax.el.ValueExpression",
- "javax.faces.convert.Converter"
- };
-
-
- /**
- * JSP ( facelets ? ) tag description for component
- */
- private TagBean _tag;
- private TagHandlerBean _taghandler;
- /**
- * Descriptions of component JavaBean properties
- */
- private Map<String,PropertyBean> properties = new TreeMap<String,PropertyBean>();
- /**
- * Flag for generate component instance class
- */
- private boolean generate = true;
-
- /**
- * @return Returns the tag.
- */
- public TagBean getTag() {
- return _tag;
- }
-
- /**
- * @param tag The tag to set.
- */
- public void setTag(TagBean tag) {
- _tag = tag;
- tag.setParent(this);
- }
-
- /**
- * @return Returns the generate.
- */
- public boolean isGenerate() {
- return this.generate;
- }
-
- /**
- * @param generate The generate to set.
- */
- public void setGenerate(boolean generate) {
- this.generate = generate;
- }
-
- /**
- * @return Returns the tagSupport.
- */
- public TagHandlerBean getTaghandler() {
- return this._taghandler;
- }
-
- /**
- * @param tagSupport The tagSupport to set.
- */
- public void setTaghandler(TagHandlerBean tagSupport) {
- this._taghandler = tagSupport;
- }
-
- /**
- * @return Returns the properties.
- */
- public Collection<PropertyBean> getProperties() {
- return properties.values();
- }
-
- /**
- * @param name
- * @return true if component have property with given name
- */
- public boolean containProperty(String name) {
- return properties.containsKey(name);
- }
-
- public PropertyBean getProperty(String name){
- return properties.get(name);
- }
-
- /**
- * Append property to component. If property with name exist, replace it
- * @param property
- */
- public void addProperty(PropertyBean property) {
- this.properties.put(property.getName(),property);
- property.setParent(this);
- }
-
- /**
- * Subclasses should extend this method to provide specifc checks
- *
- * Check existing and default properties
- * For properties filled from configuration, attempt to set additional parameters.
- * If base class have any bean properties, append it to configured
- * @throws ConfigurationException
- */
- public void checkProperties() throws ParsingException {
- try {
- getLog().debug("Parse properties for Component "+getName()+" with superclass "+getSuperclass());
- if (getSuperclass() != null)
- {
- Class <?> superClass = getLoader().loadClass(getSuperclass());
-
- new ClassWalkingLogic(superClass)
- .walk(new ClassVisitor() {
- public void visit(Class<?> clazz) {
- checkPropertiesForClass(clazz);
- }
- });
- }
- } catch (ClassNotFoundException e) {
- getLog().error("superclass not found for component "+getName(), e);
- }
- if (null != getTag()) {
- try {
- Class superClass = getLoader().loadClass(getTag().getSuperclass());
- PropertyDescriptor[] properties = PropertyUtils.getPropertyDescriptors(superClass);
- // for all properties, add it to component. If property have not abstract getter/setter ,
- // add it with exist = true . If property in list of hidden names, set hidden = true.
- for (int i = 0; i < properties.length; i++) {
- PropertyDescriptor descriptor = properties[i];
- Method writeMethod = descriptor.getWriteMethod();
- if(containProperty(descriptor.getName())){
- if (null != writeMethod && !Modifier.isAbstract(writeMethod.getModifiers()) && Modifier.isPublic(writeMethod.getModifiers()) ) {
- ((PropertyBean) this.properties.get(descriptor
- .getName())).setExistintag(true);
- }
- } else if (null != writeMethod && Modifier.isPublic(writeMethod.getModifiers())) {
- if (Arrays.asList(enabledTagProperties).contains(
- descriptor.getName())) {
- Class type = descriptor.getPropertyType();
- getLog().debug("Register tag property "
- + descriptor.getName() + " with type name "
- + type.getCanonicalName() );
- PropertyBean property = new PropertyBean();
- property.setName(descriptor.getName());
- property.setDescription(descriptor
- .getShortDescription());
- property
- .setDisplayname(descriptor.getDisplayName());
- property.setClassname(descriptor.getPropertyType()
- .getCanonicalName());
- property.setExist(true);
- if (!Modifier
- .isAbstract(writeMethod.getModifiers())) {
- property.setExistintag(true);
- }
- addProperty(property);
- }
- }
- }
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- getLog().error("superclass not found for tag "+getTag().getName(), e);
- }
-
- }
- }
-
-
-
-
- /**
- * @param superClass
- */
- private void checkPropertiesForClass(Class<?> superClass) {
- getLog().debug("Check properties for class "+superClass.getName());
- // get all property descriptors
- PropertyDescriptor[] properties = PropertyUtils.getPropertyDescriptors(superClass);
- // for all properties, add it to component. If property have not abstract getter/setter ,
- // add it with exist = true . If property in list of hidden names, set hidden = true.
- PropertyBean property;
- for (int i = 0; i < properties.length; i++) {
- PropertyDescriptor descriptor = properties[i];
- if(!containProperty(descriptor.getName())){
- if(isIgnorableProperty(superClass, descriptor.getName())) {
- continue;
- }
- Class<?> type = descriptor.getPropertyType();
- getLog().debug("Register property "+descriptor.getName()+" with type name "+type.getCanonicalName());
- property = new PropertyBean();
- property.setName(descriptor.getName());
- property.setDescription(descriptor.getShortDescription());
- property.setDisplayname(descriptor.getDisplayName());
- property.setClassname(descriptor.getPropertyType().getCanonicalName());
- property.setExist(true);
- addProperty(property);
- } else {
- // Load and check property.
- getLog().debug("Check property "+descriptor.getName());
- property = (PropertyBean) this.properties.get(descriptor.getName());
- if(property.getClassname() == null) {
- property.setClassname(descriptor.getPropertyType().getCanonicalName());
- } else {
- if(!property.getClassname().equals(descriptor.getPropertyType().getCanonicalName())){
- String message = "Class "+property.getClassname()+" for property "+property.getName()+" not equals with real bean property type: "+descriptor.getPropertyType().getCanonicalName();
- getLog().error(message);
- //throw new IllegalArgumentException(message);
- }
- }
- if (property.getDescription() == null) {
- property.setDescription(descriptor.getShortDescription());
- }
- if(property.getDisplayname() == null){
- property.setDisplayname(descriptor.getDisplayName());
- }
- property.setExist(true);
- }
- Method getter = descriptor.getReadMethod();
- Method setter = descriptor.getWriteMethod();
- // Abstract methods
- if(null != setter && null != getter ){
- if( (Modifier.isAbstract(getter.getModifiers()) && Modifier.isAbstract(setter.getModifiers())) || superClass.isInterface()){
- getLog().debug("Detect as abstract property "+descriptor.getName());
- property.setExist(false);
- }
- }
-
- if(null == setter || (! Modifier.isPublic(setter.getModifiers())) ){
- getLog().debug("Detect as hidden property "+descriptor.getName());
- property.setHidden(true);
- }
- if (isAttachedProperty(property)) {
- property.setAttachedstate(true);
- }
- if (property.isInstanceof("javax.faces.el.MethodBinding") ||
- property.isInstanceof("javax.faces.el.ValueBinding")) {
- property.setElonly(true);
- }
-
- }
- }
-
- private boolean isIgnorableProperty(Class<?> base, String name) {
- return Arrays.asList(ignorableComponentProperties).contains(name);
- }
-
- private boolean isAttachedProperty(PropertyBean prop) {
- for (int i = 0; i < attachedStateProperties.length; i++) {
- String clazz = attachedStateProperties[i];
- if(prop.isInstanceof(clazz)) {
- return true;
- }
- }
- return false;
- }
-
- public boolean isStateHolderRequired() {
- getLog().info("isStateHolderRequired");
- for (PropertyBean propertyBean : getProperties())
- {
- getLog().info("Property " + propertyBean.getName() + "/" + propertyBean.isTransient());
- if (!propertyBean.isTransient())
- {
- return true;
- }
- }
- return false;
- }
-
- public boolean isSuperclassImplementsStateHolder()
- {
- try {
- Class superClass = getLoader().loadClass(getSuperclass());
- return (StateHolder.class.isAssignableFrom(superClass));
- } catch (ClassNotFoundException e) {
- getLog().error("superclass not found for tag "+getTag().getName(), e);
- return false;
- }
- }
-
- public boolean isSuperSaveStateMethodExists()
- {
- try {
- Class superClass = getLoader().loadClass(getSuperclass());
- Class[] signature = {FacesContext.class};
- try {
- Method m = superClass.getMethod("saveState", signature);
- return !Modifier.isAbstract(m.getModifiers());
- } catch (NoSuchMethodException e) {
- return false;
- }
- } catch (ClassNotFoundException e) {
- getLog().error("superclass not found for tag "+getTag().getName(), e);
- return false;
- }
- }
-
- public boolean isSuperRestoreStateMethodExists()
- {
- try {
- Class superClass = getLoader().loadClass(getSuperclass());
- Class[] signature = {FacesContext.class, Object.class};
- try {
- Method m = superClass.getMethod("restoreState", signature);
- return !Modifier.isAbstract(m.getModifiers());
- } catch (NoSuchMethodException e) {
- return false;
- }
- } catch (ClassNotFoundException e) {
- getLog().error("superclass not found for tag "+getTag().getName(), e);
- return false;
- }
- }
-
- public boolean isSuperIsTransientMethodExists()
- {
- try {
- Class superClass = getLoader().loadClass(getSuperclass());
- Class[] signature = new Class[0];
- try {
- Method m = superClass.getMethod("isTransient", signature);
- return !Modifier.isAbstract(m.getModifiers());
- } catch (NoSuchMethodException e) {
- return false;
- }
- } catch (ClassNotFoundException e) {
- getLog().error("superclass not found for tag "+getTag().getName(), e);
- return false;
- }
- }
-
- public boolean isSuperSetTransientMethodExists()
- {
- try {
- Class superClass = getLoader().loadClass(getSuperclass());
- Class[] signature = {boolean.class};
- try {
- Method m = superClass.getMethod("setTransient", signature);
- return !Modifier.isAbstract(m.getModifiers());
- } catch (NoSuchMethodException e) {
- return false;
- }
- } catch (ClassNotFoundException e) {
- getLog().error("superclass not found for tag "+getTag().getName(), e);
- return false;
- }
- }
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ComponentBaseBean.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ComponentBaseBean.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ComponentBaseBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,402 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.config;
+
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
+import javax.naming.ConfigurationException;
+
+import org.apache.commons.beanutils.PropertyUtils;
+
+public class ComponentBaseBean extends JsfBean {
+
+ private static final String[] ignorableComponentProperties = {
+ "class",
+ "attributes",
+ "childCount",
+ "children",
+ "facets",
+ "facetsAndChildren",
+ "family",
+ "parent",
+ "rendererType",
+ "rendersChildren",
+ "submittedValue",
+ "transient"};
+ private static final String[] enabledTagProperties = {
+ "binding"
+ };
+ private static final String[] attachedStateProperties = {
+ "javax.faces.component.StateHolder",
+ "java.util.List",
+ "javax.faces.el.MethodBinding",
+ "javax.faces.el.ValueBinding",
+ "javax.el.MethodExpression",
+ "javax.el.ValueExpression",
+ "javax.faces.convert.Converter"
+ };
+
+
+ /**
+ * JSP ( facelets ? ) tag description for component
+ */
+ private TagBean _tag;
+ private TagHandlerBean _taghandler;
+ /**
+ * Descriptions of component JavaBean properties
+ */
+ private Map<String,PropertyBean> properties = new TreeMap<String,PropertyBean>();
+ /**
+ * Flag for generate component instance class
+ */
+ private boolean generate = true;
+
+ /**
+ * @return Returns the tag.
+ */
+ public TagBean getTag() {
+ return _tag;
+ }
+
+ /**
+ * @param tag The tag to set.
+ */
+ public void setTag(TagBean tag) {
+ _tag = tag;
+ tag.setParent(this);
+ }
+
+ /**
+ * @return Returns the generate.
+ */
+ public boolean isGenerate() {
+ return this.generate;
+ }
+
+ /**
+ * @param generate The generate to set.
+ */
+ public void setGenerate(boolean generate) {
+ this.generate = generate;
+ }
+
+ /**
+ * @return Returns the tagSupport.
+ */
+ public TagHandlerBean getTaghandler() {
+ return this._taghandler;
+ }
+
+ /**
+ * @param tagSupport The tagSupport to set.
+ */
+ public void setTaghandler(TagHandlerBean tagSupport) {
+ this._taghandler = tagSupport;
+ }
+
+ /**
+ * @return Returns the properties.
+ */
+ public Collection<PropertyBean> getProperties() {
+ return properties.values();
+ }
+
+ /**
+ * @param name
+ * @return true if component have property with given name
+ */
+ public boolean containProperty(String name) {
+ return properties.containsKey(name);
+ }
+
+ public PropertyBean getProperty(String name){
+ return properties.get(name);
+ }
+
+ /**
+ * Append property to component. If property with name exist, replace it
+ * @param property
+ */
+ public void addProperty(PropertyBean property) {
+ this.properties.put(property.getName(),property);
+ property.setParent(this);
+ }
+
+ /**
+ * Subclasses should extend this method to provide specifc checks
+ *
+ * Check existing and default properties
+ * For properties filled from configuration, attempt to set additional parameters.
+ * If base class have any bean properties, append it to configured
+ * @throws ConfigurationException
+ */
+ public void checkProperties() throws ParsingException {
+ try {
+ getLog().debug("Parse properties for Component "+getName()+" with superclass "+getSuperclass());
+ if (getSuperclass() != null)
+ {
+ Class <?> superClass = getLoader().loadClass(getSuperclass());
+
+ new ClassWalkingLogic(superClass)
+ .walk(new ClassVisitor() {
+ public void visit(Class<?> clazz) {
+ checkPropertiesForClass(clazz);
+ }
+ });
+ }
+ } catch (ClassNotFoundException e) {
+ getLog().error("superclass not found for component "+getName(), e);
+ }
+ if (null != getTag()) {
+ try {
+ Class superClass = getLoader().loadClass(getTag().getSuperclass());
+ PropertyDescriptor[] properties = PropertyUtils.getPropertyDescriptors(superClass);
+ // for all properties, add it to component. If property have not abstract getter/setter ,
+ // add it with exist = true . If property in list of hidden names, set hidden = true.
+ for (int i = 0; i < properties.length; i++) {
+ PropertyDescriptor descriptor = properties[i];
+ Method writeMethod = descriptor.getWriteMethod();
+ if(containProperty(descriptor.getName())){
+ if (null != writeMethod && !Modifier.isAbstract(writeMethod.getModifiers()) && Modifier.isPublic(writeMethod.getModifiers()) ) {
+ ((PropertyBean) this.properties.get(descriptor
+ .getName())).setExistintag(true);
+ }
+ } else if (null != writeMethod && Modifier.isPublic(writeMethod.getModifiers())) {
+ if (Arrays.asList(enabledTagProperties).contains(
+ descriptor.getName())) {
+ Class type = descriptor.getPropertyType();
+ getLog().debug("Register tag property "
+ + descriptor.getName() + " with type name "
+ + type.getCanonicalName() );
+ PropertyBean property = new PropertyBean();
+ property.setName(descriptor.getName());
+ property.setDescription(descriptor
+ .getShortDescription());
+ property
+ .setDisplayname(descriptor.getDisplayName());
+ property.setClassname(descriptor.getPropertyType()
+ .getCanonicalName());
+ property.setExist(true);
+ if (!Modifier
+ .isAbstract(writeMethod.getModifiers())) {
+ property.setExistintag(true);
+ }
+ addProperty(property);
+ }
+ }
+ }
+ } catch (ClassNotFoundException e) {
+ // TODO Auto-generated catch block
+ getLog().error("superclass not found for tag "+getTag().getName(), e);
+ }
+
+ }
+ }
+
+
+
+
+ /**
+ * @param superClass
+ */
+ private void checkPropertiesForClass(Class<?> superClass) {
+ getLog().debug("Check properties for class "+superClass.getName());
+ // get all property descriptors
+ PropertyDescriptor[] properties = PropertyUtils.getPropertyDescriptors(superClass);
+ // for all properties, add it to component. If property have not abstract getter/setter ,
+ // add it with exist = true . If property in list of hidden names, set hidden = true.
+ PropertyBean property;
+ for (int i = 0; i < properties.length; i++) {
+ PropertyDescriptor descriptor = properties[i];
+ if(!containProperty(descriptor.getName())){
+ if(isIgnorableProperty(superClass, descriptor.getName())) {
+ continue;
+ }
+ Class<?> type = descriptor.getPropertyType();
+ getLog().debug("Register property "+descriptor.getName()+" with type name "+type.getCanonicalName());
+ property = new PropertyBean();
+ property.setName(descriptor.getName());
+ property.setDescription(descriptor.getShortDescription());
+ property.setDisplayname(descriptor.getDisplayName());
+ property.setClassname(descriptor.getPropertyType().getCanonicalName());
+ property.setExist(true);
+ addProperty(property);
+ } else {
+ // Load and check property.
+ getLog().debug("Check property "+descriptor.getName());
+ property = (PropertyBean) this.properties.get(descriptor.getName());
+ if(property.getClassname() == null) {
+ property.setClassname(descriptor.getPropertyType().getCanonicalName());
+ } else {
+ if(!property.getClassname().equals(descriptor.getPropertyType().getCanonicalName())){
+ String message = "Class "+property.getClassname()+" for property "+property.getName()+" not equals with real bean property type: "+descriptor.getPropertyType().getCanonicalName();
+ getLog().error(message);
+ //throw new IllegalArgumentException(message);
+ }
+ }
+ if (property.getDescription() == null) {
+ property.setDescription(descriptor.getShortDescription());
+ }
+ if(property.getDisplayname() == null){
+ property.setDisplayname(descriptor.getDisplayName());
+ }
+ property.setExist(true);
+ }
+ Method getter = descriptor.getReadMethod();
+ Method setter = descriptor.getWriteMethod();
+ // Abstract methods
+ if(null != setter && null != getter ){
+ if( (Modifier.isAbstract(getter.getModifiers()) && Modifier.isAbstract(setter.getModifiers())) || superClass.isInterface()){
+ getLog().debug("Detect as abstract property "+descriptor.getName());
+ property.setExist(false);
+ }
+ }
+
+ if(null == setter || (! Modifier.isPublic(setter.getModifiers())) ){
+ getLog().debug("Detect as hidden property "+descriptor.getName());
+ property.setHidden(true);
+ }
+ if (isAttachedProperty(property)) {
+ property.setAttachedstate(true);
+ }
+ if (property.isInstanceof("javax.faces.el.MethodBinding") ||
+ property.isInstanceof("javax.faces.el.ValueBinding")) {
+ property.setElonly(true);
+ }
+
+ }
+ }
+
+ private boolean isIgnorableProperty(Class<?> base, String name) {
+ return Arrays.asList(ignorableComponentProperties).contains(name);
+ }
+
+ private boolean isAttachedProperty(PropertyBean prop) {
+ for (int i = 0; i < attachedStateProperties.length; i++) {
+ String clazz = attachedStateProperties[i];
+ if(prop.isInstanceof(clazz)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean isStateHolderRequired() {
+ getLog().info("isStateHolderRequired");
+ for (PropertyBean propertyBean : getProperties())
+ {
+ getLog().info("Property " + propertyBean.getName() + "/" + propertyBean.isTransient());
+ if (!propertyBean.isTransient())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean isSuperclassImplementsStateHolder()
+ {
+ try {
+ Class superClass = getLoader().loadClass(getSuperclass());
+ return (StateHolder.class.isAssignableFrom(superClass));
+ } catch (ClassNotFoundException e) {
+ getLog().error("superclass not found for tag "+getTag().getName(), e);
+ return false;
+ }
+ }
+
+ public boolean isSuperSaveStateMethodExists()
+ {
+ try {
+ Class superClass = getLoader().loadClass(getSuperclass());
+ Class[] signature = {FacesContext.class};
+ try {
+ Method m = superClass.getMethod("saveState", signature);
+ return !Modifier.isAbstract(m.getModifiers());
+ } catch (NoSuchMethodException e) {
+ return false;
+ }
+ } catch (ClassNotFoundException e) {
+ getLog().error("superclass not found for tag "+getTag().getName(), e);
+ return false;
+ }
+ }
+
+ public boolean isSuperRestoreStateMethodExists()
+ {
+ try {
+ Class superClass = getLoader().loadClass(getSuperclass());
+ Class[] signature = {FacesContext.class, Object.class};
+ try {
+ Method m = superClass.getMethod("restoreState", signature);
+ return !Modifier.isAbstract(m.getModifiers());
+ } catch (NoSuchMethodException e) {
+ return false;
+ }
+ } catch (ClassNotFoundException e) {
+ getLog().error("superclass not found for tag "+getTag().getName(), e);
+ return false;
+ }
+ }
+
+ public boolean isSuperIsTransientMethodExists()
+ {
+ try {
+ Class superClass = getLoader().loadClass(getSuperclass());
+ Class[] signature = new Class[0];
+ try {
+ Method m = superClass.getMethod("isTransient", signature);
+ return !Modifier.isAbstract(m.getModifiers());
+ } catch (NoSuchMethodException e) {
+ return false;
+ }
+ } catch (ClassNotFoundException e) {
+ getLog().error("superclass not found for tag "+getTag().getName(), e);
+ return false;
+ }
+ }
+
+ public boolean isSuperSetTransientMethodExists()
+ {
+ try {
+ Class superClass = getLoader().loadClass(getSuperclass());
+ Class[] signature = {boolean.class};
+ try {
+ Method m = superClass.getMethod("setTransient", signature);
+ return !Modifier.isAbstract(m.getModifiers());
+ } catch (NoSuchMethodException e) {
+ return false;
+ }
+ } catch (ClassNotFoundException e) {
+ getLog().error("superclass not found for tag "+getTag().getName(), e);
+ return false;
+ }
+ }
+}
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ComponentBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ComponentBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
import java.util.HashSet;
import java.util.Set;
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ConverterBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ConverterBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ConverterBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,26 +0,0 @@
-package org.ajax4jsf.builder.config;
-
-public class ConverterBean extends ComponentBaseBean {
-
- private String forclass;
-
- // Map the id onto name
-
- public String getId() {
- return super.getName();
- }
-
- public void setId(String id)
- {
- super.setName(id);
- }
-
- public String getForclass() {
- return forclass;
- }
-
- public void setForclass(String forclass) {
- this.forclass = forclass;
- }
-
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ConverterBean.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ConverterBean.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ConverterBean.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ConverterBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,47 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.config;
+
+public class ConverterBean extends ComponentBaseBean {
+
+ private String forclass;
+
+ // Map the id onto name
+
+ public String getId() {
+ return super.getName();
+ }
+
+ public void setId(String id)
+ {
+ super.setName(id);
+ }
+
+ public String getForclass() {
+ return forclass;
+ }
+
+ public void setForclass(String forclass) {
+ this.forclass = forclass;
+ }
+
+}
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/EventBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/EventBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/EventBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
/**
* @author shura
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/FunctionBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/FunctionBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/FunctionBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/JsfBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/JsfBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/JsfBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,14 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Collections;
import java.util.List;
-import org.ajax4jsf.builder.generator.Logger;
+import org.richfaces.builder.generator.Logger;
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ListenerBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ListenerBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ListenerBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
import java.util.ArrayList;
import java.util.List;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/LoaderHolder.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/LoaderHolder.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/LoaderHolder.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,9 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
-import org.ajax4jsf.builder.generator.Logger;
+import org.richfaces.builder.generator.Logger;
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: ishabalov $)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ParsingException.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ParsingException.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ParsingException.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: ishabalov $)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/PropertyBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/PropertyBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/PropertyBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
import java.util.HashMap;
import java.util.Map;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/RendererBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/RendererBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/RendererBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
/**
* JavaBean to hold renderer configuration properties
@@ -64,7 +64,7 @@
*/
public RendererBean() {
super();
- setSuperclass("org.ajax4jsf.renderkit.RendererBase");
+ setSuperclass("org.richfaces.renderkit.RendererBase");
}
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/TagBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
/**
* Java Bean for hold JSP tag configuration
@@ -42,7 +42,7 @@
*/
public TagBean() {
super();
- setSuperclass("org.ajax4jsf.webapp.taglib.UIComponentTagBase");
+ setSuperclass("org.richfaces.webapp.taglib.UIComponentTagBase");
}
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagHandlerBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/TagHandlerBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagHandlerBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
/**
* Bean for handle facelets tag class properties.
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagTestClassHolder.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/TagTestClassHolder.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagTestClassHolder.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,19 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.config;
-
-/**
- * @author Administrator
- *
- */
-public class TagTestClassHolder extends TestClassHolder {
-
- /**
- *
- */
- public TagTestClassHolder() {
- setSuperclassname("org.ajax4jsf.tests.AbstractJspTestCase");
- }
-
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagTestClassHolder.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/TagTestClassHolder.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagTestClassHolder.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TagTestClassHolder.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,37 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.config;
+
+/**
+ * @author Administrator
+ *
+ */
+public class TagTestClassHolder extends TestClassHolder {
+
+ /**
+ *
+ */
+ public TagTestClassHolder() {
+ setSuperclassname("org.richfaces.tests.AbstractJspTestCase");
+ }
+
+}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TestClassHolder.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/TestClassHolder.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TestClassHolder.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,43 +0,0 @@
-package org.ajax4jsf.builder.config;
-
-/**
- * Simple holder for test class name and test superclass name
- * @author dbiatenia
- *
- */
-public class TestClassHolder {
-
- private String _classname;
-
- private String _superclassname = "org.ajax4jsf.tests.AbstractAjax4JsfTestCase";
-
- public String getClassname() {
- return _classname;
- }
-
- public void setClassname(String classname) {
- this._classname = classname;
- }
-
- public String getSuperclassname() {
- return _superclassname;
- }
-
- public void setSuperclassname(String superclassname) {
- this._superclassname = superclassname;
- }
-
- /**
- * Convert full class name to simple.
- * @return class name without package name.
- */
- public String getSimpleClassName() {
- int lastPoint = getClassname().lastIndexOf('.');
- if (lastPoint>0) {
- return getClassname().substring(lastPoint+1);
- }
- return getClassname();
- }
-
-
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TestClassHolder.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/TestClassHolder.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TestClassHolder.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/TestClassHolder.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,64 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.config;
+
+/**
+ * Simple holder for test class name and test superclass name
+ * @author dbiatenia
+ *
+ */
+public class TestClassHolder {
+
+ private String _classname;
+
+ private String _superclassname = "org.richfaces.tests.AbstractAjax4JsfTestCase";
+
+ public String getClassname() {
+ return _classname;
+ }
+
+ public void setClassname(String classname) {
+ this._classname = classname;
+ }
+
+ public String getSuperclassname() {
+ return _superclassname;
+ }
+
+ public void setSuperclassname(String superclassname) {
+ this._superclassname = superclassname;
+ }
+
+ /**
+ * Convert full class name to simple.
+ * @return class name without package name.
+ */
+ public String getSimpleClassName() {
+ int lastPoint = getClassname().lastIndexOf('.');
+ if (lastPoint>0) {
+ return getClassname().substring(lastPoint+1);
+ }
+ return getClassname();
+ }
+
+
+}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ValidatorBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ValidatorBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ValidatorBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,17 +0,0 @@
-package org.ajax4jsf.builder.config;
-
-public class ValidatorBean extends ComponentBaseBean {
-
-
- // Map the id onto name
-
- public String getId() {
- return super.getName();
- }
-
- public void setId(String id)
- {
- super.setName(id);
- }
-
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ValidatorBean.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ValidatorBean.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ValidatorBean.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/config/ValidatorBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,38 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.config;
+
+public class ValidatorBean extends ComponentBaseBean {
+
+
+ // Map the id onto name
+
+ public String getId() {
+ return super.getName();
+ }
+
+ public void setId(String id)
+ {
+ super.setName(id);
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator)
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/AbstractClassStubBuilder.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/AbstractClassStubBuilder.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/AbstractClassStubBuilder.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,113 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.generator;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import net.sf.cglib.core.ClassEmitter;
-import net.sf.cglib.core.CodeEmitter;
-import net.sf.cglib.core.EmitUtils;
-import net.sf.cglib.core.MethodInfo;
-import net.sf.cglib.core.ReflectUtils;
-import net.sf.cglib.core.Signature;
-import net.sf.cglib.proxy.Enhancer;
-import net.sf.cglib.proxy.MethodInterceptor;
-
-import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.Constants;
-import org.objectweb.asm.Type;
-
-/**
- * @author Nick - mailto:nbelaevski@exadel.com
- * created 20.04.2007
- *
- */
-public class AbstractClassStubBuilder {
- public static <T> T buildStub(final Class<T> clazz, MethodInterceptor interceptor,
- ClassLoader classLoader) {
- Enhancer enhancer = new Enhancer() {
- @Override
- public void generateClass(ClassVisitor v) throws Exception {
- ClassEmitter ce = new ClassEmitter(v);
- ce.begin_class(Constants.V1_4,
- Constants.ACC_PUBLIC,
- getClassName(),
- Type.getType(clazz),
- null,
- null);
- EmitUtils.null_constructor(ce);
- List methods = new ArrayList();
- getMethods(clazz, null, methods);
-
- for (Iterator iterator = methods.iterator(); iterator
- .hasNext();) {
- Method method = (Method) iterator.next();
-
- if (Modifier.isAbstract(method.getModifiers())) {
- MethodInfo methodInfo = ReflectUtils.getMethodInfo(method);
- Signature signature = methodInfo.getSignature();
- Type returnType = signature.getReturnType();
-
- CodeEmitter e = ce.begin_method(method.getModifiers() & ~Modifier.ABSTRACT,
- signature, methodInfo.getExceptionTypes(),
- methodInfo.getAttribute());
-
- e.zero_or_null(returnType);
- e.return_value();
-
- Type[] argumentTypes = methodInfo.getSignature().getArgumentTypes();
- int size = 0;
- if (argumentTypes != null) {
- for (int i = 0; i < argumentTypes.length; i++) {
- size += argumentTypes[i].getSize();
- }
- }
-
- // 1 is for this
- e.visitMaxs(returnType.getSize(), size + 1);
-
- e.end_method();
- }
- }
-
- ce.end_class();
- }
- };
- enhancer.setSuperclass(clazz);
- enhancer.setCallbackType(MethodInterceptor.class);
- enhancer.setClassLoader(classLoader != null ?
- classLoader : clazz.getClassLoader());
- Class<T> instrumentedClass = enhancer.createClass();
-
- Enhancer enhancer2 = new Enhancer();
- enhancer2.setSuperclass(instrumentedClass);
- enhancer2.setCallback(interceptor);
- enhancer2.setClassLoader(instrumentedClass.getClassLoader());
-
- return (T) enhancer2.create();
- }
-}
-
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/AbstractClassStubBuilder.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/AbstractClassStubBuilder.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/AbstractClassStubBuilder.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/AbstractClassStubBuilder.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,180 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.generator;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import net.sf.cglib.core.ClassEmitter;
+import net.sf.cglib.core.CodeEmitter;
+import net.sf.cglib.core.EmitUtils;
+import net.sf.cglib.core.MethodInfo;
+import net.sf.cglib.core.ReflectUtils;
+import net.sf.cglib.core.Signature;
+import net.sf.cglib.proxy.Callback;
+import net.sf.cglib.proxy.Enhancer;
+import net.sf.cglib.proxy.MethodInterceptor;
+import net.sf.cglib.proxy.NoOp;
+
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.Constants;
+import org.objectweb.asm.Type;
+
+/**
+ * @author Nick - mailto:nbelaevski@exadel.com
+ * created 20.04.2007
+ *
+ */
+public class AbstractClassStubBuilder {
+
+ public static Object buildInterfaceStub(final Class<?> clazz, ClassLoader classLoader) throws InstantiationException, IllegalAccessException {
+ Enhancer enhancer = new Enhancer() {
+ public void generateClass(ClassVisitor v) throws Exception {
+ ClassEmitter ce = new ClassEmitter(v);
+ ce.begin_class(Constants.V1_5,
+ Constants.ACC_PUBLIC,
+ getClassName(),
+ null,
+ new Type[]{Type.getType(clazz)},
+ null);
+ EmitUtils.null_constructor(ce);
+ List methods = new ArrayList();
+ getMethods(Object.class, new Class[]{clazz}, methods);
+
+ for (Iterator iterator = methods.iterator(); iterator
+ .hasNext();) {
+ Method method = (Method) iterator.next();
+
+ if (Modifier.isAbstract(method.getModifiers())) {
+ MethodInfo methodInfo = ReflectUtils.getMethodInfo(method);
+ Signature signature = methodInfo.getSignature();
+ Type returnType = signature.getReturnType();
+
+ CodeEmitter e = ce.begin_method(method.getModifiers() & ~Modifier.ABSTRACT,
+ signature, methodInfo.getExceptionTypes(),
+ methodInfo.getAttribute());
+
+ e.zero_or_null(returnType);
+ e.return_value();
+
+ Type[] argumentTypes = methodInfo.getSignature().getArgumentTypes();
+ int size = 0;
+ if (argumentTypes != null) {
+ for (int i = 0; i < argumentTypes.length; i++) {
+ size += argumentTypes[i].getSize();
+ }
+ }
+
+ // 1 is for this
+ e.visitMaxs(returnType.getSize(), size + 1);
+
+ e.end_method();
+ }
+ }
+
+ ce.end_class();
+ }
+ };
+
+ enhancer.setCallbackType(NoOp.class);
+ enhancer.setInterfaces(new Class[]{clazz});
+ enhancer.setClassLoader(classLoader != null ?
+ classLoader : clazz.getClassLoader());
+
+ return enhancer.createClass().newInstance();
+ }
+
+ public static <T> T buildStub(final Class<T> clazz, MethodInterceptor interceptor,
+ ClassLoader classLoader) {
+ Class<T> instrumentedClass;
+
+ if ((Modifier.ABSTRACT & clazz.getModifiers()) != 0) {
+ Enhancer enhancer = new Enhancer() {
+ @Override
+ public void generateClass(ClassVisitor v) throws Exception {
+ ClassEmitter ce = new ClassEmitter(v);
+ ce.begin_class(Constants.V1_5,
+ Constants.ACC_PUBLIC,
+ getClassName(),
+ Type.getType(clazz),
+ null,
+ null);
+ EmitUtils.null_constructor(ce);
+ List methods = new ArrayList();
+ getMethods(clazz, null, methods);
+
+ for (Iterator iterator = methods.iterator(); iterator
+ .hasNext();) {
+ Method method = (Method) iterator.next();
+
+ if (Modifier.isAbstract(method.getModifiers())) {
+ MethodInfo methodInfo = ReflectUtils.getMethodInfo(method);
+ Signature signature = methodInfo.getSignature();
+ Type returnType = signature.getReturnType();
+
+ CodeEmitter e = ce.begin_method(method.getModifiers() & ~Modifier.ABSTRACT,
+ signature, methodInfo.getExceptionTypes(),
+ methodInfo.getAttribute());
+
+ e.zero_or_null(returnType);
+ e.return_value();
+
+ Type[] argumentTypes = methodInfo.getSignature().getArgumentTypes();
+ int size = 0;
+ if (argumentTypes != null) {
+ for (int i = 0; i < argumentTypes.length; i++) {
+ size += argumentTypes[i].getSize();
+ }
+ }
+
+ // 1 is for this
+ e.visitMaxs(returnType.getSize(), size + 1);
+
+ e.end_method();
+ }
+ }
+
+ ce.end_class();
+ }
+ };
+ enhancer.setSuperclass(clazz);
+ enhancer.setCallbackType(MethodInterceptor.class);
+ enhancer.setClassLoader(classLoader != null ?
+ classLoader : clazz.getClassLoader());
+ instrumentedClass = enhancer.createClass();
+ } else {
+ instrumentedClass = clazz;
+ }
+
+ Enhancer enhancer2 = new Enhancer();
+ enhancer2.setSuperclass(instrumentedClass);
+ enhancer2.setCallback(interceptor);
+ enhancer2.setClassLoader(instrumentedClass.getClassLoader());
+
+ return (T) enhancer2.create();
+ }
+}
+
+
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/BlankRendererGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/BlankRendererGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/BlankRendererGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,17 +29,17 @@
import java.util.Iterator;
import java.util.Set;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBean;
/**
* Class implement functionality for generate base renderers java files,
* for manual extention. If renderer property override in config file set to true,
* override existing renderers files.
- * inner element of {@link org.ajax4jsf.builder.ant.JSFGeneratorTask}
+ * inner element of {@link org.richfaces.builder.ant.JSFGeneratorTask}
* use in ant build.xml :
* <jsfgenerator ... >
* ....
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ClassPatternSet.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ClassPatternSet.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ClassPatternSet.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.util.ArrayList;
import java.util.List;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ComponentGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,16 +29,16 @@
import java.util.Iterator;
import java.util.Set;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.PropertyBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.config.PropertyBean;
/**
* Class implement functionality for generate component java files
- * inner element of {@link org.ajax4jsf.builder.ant.JSFGeneratorTask}
+ * inner element of {@link org.richfaces.builder.ant.JSFGeneratorTask}
* use in ant build.xml :
* <jsfgenerator ... >
* ....
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentGenerator2.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ComponentGenerator2.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentGenerator2.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -28,11 +28,11 @@
import java.io.Writer;
import java.util.List;
-import org.ajax4jsf.builder.component.ComponentModelBuilder;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.model.JavaClass;
-import org.ajax4jsf.builder.render.JavaClassRenderer;
+import org.richfaces.builder.component.ComponentModelBuilder;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.model.JavaClass;
+import org.richfaces.builder.render.JavaClassRenderer;
/**
* @author Maksim Kaszynski
@@ -47,7 +47,7 @@
super(task,log);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.InnerGenerator#createFiles(org.ajax4jsf.builder.config.BuilderConfig)
+ * @see org.richfaces.builder.generator.InnerGenerator#createFiles(org.richfaces.builder.config.BuilderConfig)
*/
@Override
public void createFiles(BuilderConfig config) throws GeneratorException {
@@ -85,7 +85,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.InnerGenerator#getDefaultTemplateName()
+ * @see org.richfaces.builder.generator.InnerGenerator#getDefaultTemplateName()
*/
@Override
protected String getDefaultTemplateName() {
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentTagGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ComponentTagGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentTagGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,17 +29,17 @@
import java.util.Iterator;
import java.util.Set;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.config.TagBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.config.TagBean;
/**
* Class implement functionality for generate jap tags java files
- * inner element of {@link org.ajax4jsf.builder.ant.JSFGeneratorTask}
+ * inner element of {@link org.richfaces.builder.ant.JSFGeneratorTask}
* use in ant build.xml :
* <jsfgenerator ... >
* ....
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentTestGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ComponentTestGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentTestGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,87 +0,0 @@
-package org.ajax4jsf.builder.generator;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.Writer;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-
-public class ComponentTestGenerator extends InnerGenerator{
-
- private static final String COMPONENT_FILE_TEMPLATE = "componenttest.vm";
-
- public ComponentTestGenerator(JSFGeneratorConfiguration config, Logger log) {
- super(config, log);
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public void createFiles(BuilderConfig config) throws GeneratorException {
- VelocityContext context = new VelocityContext();
- Template template = getTemplate();
- context.put("generator",this);
-
- context.put("testDataGenerator", new TestDataGenerator(getClassLoader(), getLog()));
-
- // Put common properties
- for (Iterator iter = config.getComponents().iterator(); iter.hasNext();) {
- ComponentBean component = (ComponentBean) iter.next();
- if(component.getTest() != null){
- info("Create component test class file for component "+component.getClassname());
- if (component.isGenerate()) {
- context.put("component", component);
- context.put("renderer", component.getRenderer());
- context.put("package", component.getPackageName());
- Set<String> importClasses = new HashSet<String>();
- for (Iterator it = component.getProperties().iterator(); it
- .hasNext();) {
- PropertyBean property = (PropertyBean) it.next();
- // For non-primitive types, add import declaration.
- if (!property.isSimpleType() && !property.isExist()) {
- importClasses.add(property.getClassname());
- }
- }
- importClasses.add(component.getTest().getSuperclassname());
- context.put("imports", importClasses);
- String resultPath = component.getTest().getClassname().replace('.', '/')
- + ".java";
- File javaFile = new File(getDestDir(), resultPath);
- File javaDir = javaFile.getParentFile();
- if (!javaDir.exists()) {
- javaDir.mkdirs();
- }
- try {
- if (javaFile.exists()) {
- javaFile.delete();
- }
- Writer out = new BufferedWriter(new FileWriter(javaFile));
- template.merge(context, out);
- out.flush();
- out.close();
- } catch (Exception e) {
- throw new GeneratorException(
- "Error create new Component Java file ", e);
- }
- }
-
- }
- }
-
- }
-
- @Override
- protected String getDefaultTemplateName() {
- // TODO Auto-generated method stub
- return COMPONENT_FILE_TEMPLATE;
- }
-
-
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentTestGenerator.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ComponentTestGenerator.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentTestGenerator.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ComponentTestGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,108 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.generator;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.Writer;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.config.PropertyBean;
+
+public class ComponentTestGenerator extends InnerGenerator{
+
+ private static final String COMPONENT_FILE_TEMPLATE = "componenttest.vm";
+
+ public ComponentTestGenerator(JSFGeneratorConfiguration config, Logger log) {
+ super(config, log);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public void createFiles(BuilderConfig config) throws GeneratorException {
+ VelocityContext context = new VelocityContext();
+ Template template = getTemplate();
+ context.put("generator",this);
+
+ context.put("testDataGenerator", new TestDataGenerator(getClassLoader(), getLog()));
+
+ // Put common properties
+ for (Iterator iter = config.getComponents().iterator(); iter.hasNext();) {
+ ComponentBean component = (ComponentBean) iter.next();
+ if(component.getTest() != null){
+ info("Create component test class file for component "+component.getClassname());
+ if (component.isGenerate()) {
+ context.put("component", component);
+ context.put("renderer", component.getRenderer());
+ context.put("package", component.getPackageName());
+ Set<String> importClasses = new HashSet<String>();
+ for (Iterator it = component.getProperties().iterator(); it
+ .hasNext();) {
+ PropertyBean property = (PropertyBean) it.next();
+ // For non-primitive types, add import declaration.
+ if (!property.isSimpleType() && !property.isExist()) {
+ importClasses.add(property.getClassname());
+ }
+ }
+ importClasses.add(component.getTest().getSuperclassname());
+ context.put("imports", importClasses);
+ String resultPath = component.getTest().getClassname().replace('.', '/')
+ + ".java";
+ File javaFile = new File(getDestDir(), resultPath);
+ File javaDir = javaFile.getParentFile();
+ if (!javaDir.exists()) {
+ javaDir.mkdirs();
+ }
+ try {
+ if (javaFile.exists()) {
+ javaFile.delete();
+ }
+ Writer out = new BufferedWriter(new FileWriter(javaFile));
+ template.merge(context, out);
+ out.flush();
+ out.close();
+ } catch (Exception e) {
+ throw new GeneratorException(
+ "Error create new Component Java file ", e);
+ }
+ }
+
+ }
+ }
+
+ }
+
+ @Override
+ protected String getDefaultTemplateName() {
+ // TODO Auto-generated method stub
+ return COMPONENT_FILE_TEMPLATE;
+ }
+
+
+}
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ConverterGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ConverterGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ConverterGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,12 +29,12 @@
import java.util.Iterator;
import java.util.Set;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ConverterBean;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.config.ValidatorBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ConverterBean;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.config.ValidatorBean;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ConverterTagGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ConverterTagGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ConverterTagGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,18 +29,18 @@
import java.util.Iterator;
import java.util.Set;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ConverterBean;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.config.TagBean;
-import org.ajax4jsf.builder.config.ValidatorBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ConverterBean;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.config.TagBean;
+import org.richfaces.builder.config.ValidatorBean;
/**
* Class implement functionality for generate jsp tags for validators
- * inner element of {@link org.ajax4jsf.builder.ant.JSFGeneratorTask}
+ * inner element of {@link org.richfaces.builder.ant.JSFGeneratorTask}
* use in ant build.xml :
* <jsfgenerator ... >
* ....
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/FaceletsTaglibGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/FaceletsTaglibGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/FaceletsTaglibGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,15 +29,15 @@
import java.util.Iterator;
import java.util.List;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBaseBean;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.ConverterBean;
-import org.ajax4jsf.builder.config.FunctionBean;
-import org.ajax4jsf.builder.config.ListenerBean;
-import org.ajax4jsf.builder.config.ValidatorBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBaseBean;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.config.ConverterBean;
+import org.richfaces.builder.config.FunctionBean;
+import org.richfaces.builder.config.ListenerBean;
+import org.richfaces.builder.config.ValidatorBean;
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: ishabalov $)
@@ -262,7 +262,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.XMLConfigGenerator#getRootTag()
+ * @see org.richfaces.builder.generator.XMLConfigGenerator#getRootTag()
*/
protected String getRootTag() {
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/FacesConfigGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/FacesConfigGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/FacesConfigGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -28,13 +28,13 @@
import java.util.ArrayList;
import java.util.List;
-import org.ajax4jsf.builder.config.BuilderConfig;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
/**
* Class implement functionality for generate faces-config file inner element of
- * {@link org.ajax4jsf.builder.ant.JSFGeneratorTask} use in ant build.xml :
+ * {@link org.richfaces.builder.ant.JSFGeneratorTask} use in ant build.xml :
* <jsfgenerator ... > .... <facesconfig ... /> ....
* </jsfgenerator> attributes: facesconfig - name of faces-config file
* include - name of file, included in config renderkitid - name of renderkit
@@ -167,7 +167,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.builder.generator.XMLConfigGenerator#getRootTag()
+ * @see org.richfaces.builder.generator.XMLConfigGenerator#getRootTag()
*/
protected String getRootTag() {
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/GeneratorException.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/GeneratorException.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/GeneratorException.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
/**
* @author shura
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/InnerGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/InnerGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/InnerGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,22 +19,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.File;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.ComponentBaseBean;
-import org.ajax4jsf.builder.generator.ClassPatternSet.PatternEntry;
import org.apache.tools.ant.BuildException;
import org.apache.velocity.Template;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBaseBean;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.generator.ClassPatternSet.PatternEntry;
/**
* Base class for all JSF generators - component java file ,
* faces-config.xml , jsp tag java file , renderer template, jsp & facelets taglib
- * inner element of {@link org.ajax4jsf.builder.ant.JSFGeneratorTask}
+ * inner element of {@link org.richfaces.builder.ant.JSFGeneratorTask}
* use in ant build.xml :
* <jsfgenerator ... >
* ....
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/JSFGeneratorConfiguration.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/JSFGeneratorConfiguration.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/JSFGeneratorConfiguration.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.File;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ListenerGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ListenerGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ListenerGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -27,11 +27,11 @@
import java.io.Writer;
import java.util.List;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ListenerBean;
-import org.ajax4jsf.builder.config.TagHandlerBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ListenerBean;
+import org.richfaces.builder.config.TagHandlerBean;
/**
* @author Nick - mailto:nbelaevski@exadel.com
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ListenerTagGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ListenerTagGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ListenerTagGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -27,11 +27,11 @@
import java.io.Writer;
import java.util.List;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ListenerBean;
-import org.ajax4jsf.builder.config.TagBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ListenerBean;
+import org.richfaces.builder.config.TagBean;
/**
*
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/Logger.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/Logger.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/Logger.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
/**
* @author shura
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/RenderKitBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/RenderKitBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/RenderKitBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
/**
- * Child element for {@link org.ajax4jsf.builder.generator.FacesConfigGenerator}
+ * Child element for {@link org.richfaces.builder.generator.FacesConfigGenerator}
* <facesconfig ... >
* <renderkit renderkitid="..." renderkitclass="..." [package="..."] > for generate any of render-kits at time.
* .....
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/RendererCompilationContext.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/RendererCompilationContext.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/RendererCompilationContext.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
-import org.ajax4jsf.templatecompiler.builder.AbstractCompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
import org.apache.velocity.Template;
+import org.richfaces.templatecompiler.builder.AbstractCompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
/**
* @author shura
@@ -50,7 +50,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#debug(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#debug(java.lang.String)
*/
public void debug(String content) {
_log.debug(content);
@@ -60,7 +60,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#debug(java.lang.String,
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#debug(java.lang.String,
* java.lang.Throwable)
*/
public void debug(String content, Throwable error) {
@@ -70,7 +70,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#error(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#error(java.lang.String)
*/
public void error(String content) {
_log.error(content);
@@ -79,7 +79,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#error(java.lang.String,
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#error(java.lang.String,
* java.lang.Throwable)
*/
public void error(String content, Throwable error) {
@@ -90,7 +90,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#info(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#info(java.lang.String)
*/
public void info(String content) {
_log.info(content);
@@ -100,7 +100,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#info(java.lang.String,
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#info(java.lang.String,
* java.lang.Throwable)
*/
public void info(String content, Throwable error) {
@@ -111,7 +111,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#warn(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#warn(java.lang.String)
*/
public void warn(String content) {
_log.warn(content);
@@ -121,7 +121,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#warn(java.lang.String,
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#warn(java.lang.String,
* java.lang.Throwable)
*/
public void warn(String content, Throwable error) {
@@ -131,7 +131,7 @@
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#getTemplate(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#getTemplate(java.lang.String)
*/
public Template getTemplate(String name) throws CompilationException {
// TODO Auto-generated method stub
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/RendererGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/RendererGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/RendererGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,19 +29,19 @@
import java.io.Writer;
import java.util.Iterator;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBaseBean;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.RendererBean;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.builder.TemplateCompiler;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBaseBean;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.config.RendererBean;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.builder.TemplateCompiler;
/**
* Class implement functionality for generate base renderers java files, for
* manual extention. If renderer property override in config file set to true,
* override existing renderers files. inner element of
- * {@link org.ajax4jsf.builder.ant.JSFGeneratorTask} use in ant build.xml :
+ * {@link org.richfaces.builder.ant.JSFGeneratorTask} use in ant build.xml :
* <jsfgenerator ... > .... <renderers ... /> ....
* </jsfgenerator> attributes: package - optional Java package name for
* override from configuration, used for create set of differern render-kits in
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourceType.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourceType.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourceType.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourceType.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,30 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.builder.generator;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public enum ResourceType {
+ SCRIPT, STYLE
+}
+
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,474 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.generator;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.io.Writer;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import net.sf.cglib.proxy.MethodInterceptor;
-import net.sf.cglib.proxy.MethodProxy;
-
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.RendererBean;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.builder.TemplateCompiler;
-import org.ajax4jsf.templatecompiler.elements.RootElement;
-import org.ajax4jsf.templatecompiler.elements.TemplateElement;
-import org.ajax4jsf.templatecompiler.elements.vcp.FResourceTemplateElement;
-import org.ajax4jsf.templatecompiler.elements.vcp.HeaderResourceElement;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * @author Nick - mailto:nbelaevski@exadel.com
- * created 17.04.2007
- *
- */
-public class ResourcesConfigGenerator extends FacesConfigGenerator {
-
- private File resourcesConfig;
- private File templatesDirectory;
-
- private static final SAXParserFactory parserFactory = SAXParserFactory.newInstance();
-
- public ResourcesConfigGenerator(JSFGeneratorConfiguration task, Logger log) {
- super(task, log);
- }
-
- private void addResources(ResourcesConfigGeneratorBean configBean, TemplateElement templateElement,
- String packageName, RendererBean renderer, BuilderConfig builderConfig) throws ClassNotFoundException {
- if (templateElement instanceof FResourceTemplateElement) {
- FResourceTemplateElement resourceTemplateElement = (FResourceTemplateElement) templateElement;
- String name = resourceTemplateElement.getName();
-
- addResource(name, packageName, configBean);
- } else if (templateElement instanceof RootElement) {
- RootElement rootElement = (RootElement) templateElement;
-
- CompilationContext compilationContext = rootElement.getComponentBean();
-
- String classname = renderer.getClassname();
- int idx = classname.lastIndexOf('.');
- if (idx != -1) {
- packageName = classname.substring(0, idx);
- } else {
- packageName = "";
- }
-
- ClassLoader loader = builderConfig.getLoader();
- Class cl = null;
-
- try {
- cl = loader.loadClass(classname);
- } catch (ClassNotFoundException e) {
- String superclass = compilationContext.getBaseclassPackageName() + "." + compilationContext.getBaseclassName();
- if (superclass != null) {
- cl = loader.loadClass(superclass);
- }
- }
-
- if (cl != null) {
- GetResourceInterceptor interceptor = new GetResourceInterceptor();
- Object instance = AbstractClassStubBuilder.buildStub(cl, interceptor,
- builderConfig.getLoader());
-
- try {
- Method method = null;
- Object object = null;
-
- Class<?> cl1 = instance.getClass();
- while (cl1 != null && method == null) {
- try {
- method = cl1.getDeclaredMethod("getStyles", null);
- } catch (NoSuchMethodException e) {
- cl1 = cl1.getSuperclass();
- }
- }
-
- if (method != null) {
- method.setAccessible(true);
- object = method.invoke(instance, null);
- List<String> list = interceptor.getList();
- if (list != null) {
- for (String name : list) {
- addResource(name, packageName, configBean);
- }
- }
- }
-
- interceptor.clearList();
-
- method = null;
- cl1 = instance.getClass();
- while (cl1 != null && method == null) {
- try {
- method = cl1.getDeclaredMethod("getScripts", null);
- } catch (NoSuchMethodException e) {
- cl1 = cl1.getSuperclass();
- }
- }
-
- if (method != null) {
- method.setAccessible(true);
- object = method.invoke(instance, null);
- List<String> list = interceptor.getList();
- if (list != null) {
- for (String name : list) {
- addResource(name, packageName, configBean);
- }
- }
- }
- } catch (SecurityException e) {
- builderConfig.getLog().error(e.getMessage(), e);
- } catch (IllegalArgumentException e) {
- builderConfig.getLog().error(e.getMessage(), e);
- } catch (IllegalAccessException e) {
- builderConfig.getLog().error(e.getMessage(), e);
- } catch (InvocationTargetException e) {
- builderConfig.getLog().error(e.getMessage(), e);
- }
- }
- } else if (templateElement instanceof HeaderResourceElement) {
- HeaderResourceElement resourceElement = (HeaderResourceElement) templateElement;
- String[] paths = resourceElement.getResourcePaths();
- if (paths != null) {
- for (int i = 0; i < paths.length; i++) {
- String string = paths[i];
-
- addResource(string, packageName, configBean);
- }
- }
- }
-
- ArrayList<TemplateElement> subElements = templateElement.getSubElements();
- for (TemplateElement element : subElements) {
- addResources(configBean, element, packageName, renderer, builderConfig);
- }
- }
-
- private void addResource(String name, String packageName,
- ResourcesConfigGeneratorBean configBean) {
-
- String resolvedPath = resolveResourcePath(name, packageName);
- // remove leading / from resource name.
- if(name.startsWith("/")){
- name = name.substring(1);
- }
- if (resolvedPath != null) {
- configBean.addPathResource(name, resolvedPath);
- } else {
- //couldn't resolve, treat as class name
- configBean.addClassResource(name, name);
- }
- }
-
- private String resolveResourcePath(String name, String packageName) {
- if (name.contains("/")) {
- String resolvedName;
-
- if (!name.startsWith("/")) {
- //need to resolve
- StringBuffer normalizedName = new StringBuffer();
- normalizedName.append(packageName.replace('.', '/'));
-
- if (!packageName.endsWith("/")) {
- normalizedName.append('/');
- }
-
- normalizedName.append(name);
-
- resolvedName = normalizedName.toString();
- } else {
- if (name.length() > 0) {
- resolvedName = name.substring(1);
- } else {
- resolvedName = null;
- }
- }
-
- return resolvedName;
- }
-
- return null;
- }
-
- private void addResources(ResourcesConfigGeneratorBean configBean, RendererBean renderer, BuilderConfig builderConfig) throws CompilationException, IOException, ClassNotFoundException {
- if (null != renderer && renderer.isGenerate()
- && null != renderer.getTemplate()) {
-
- File template;
- if (null != getTemplates()) {
- template = new File(getTemplates(), renderer.getTemplate());
- } else {
- template = new File(renderer.getTemplate());
- }
- CompilationContext rendererBean = new RendererCompilationContext(
- getLog(), getClassLoader(),getConfig());
-
- TemplateCompiler templateCompiler = new TemplateCompiler();
- InputStream templateStream = new FileInputStream(template);
- templateCompiler.processing(templateStream, rendererBean);
-
- TemplateElement root = rendererBean.getTree();
-
- String classname = renderer.getClassname();
- String packageName;
- int idx = classname.lastIndexOf('.');
- if (idx != -1) {
- packageName = classname.substring(0, idx);
- } else {
- packageName = "";
- }
-
- addResources(configBean, root, packageName, renderer, builderConfig);
- }
- }
-
- private void parseXCSSResource(String resourcePath, final ResourcesConfigGeneratorBean bean) throws SAXException, IOException, ParserConfigurationException {
- InputStream resourceStream = getClassLoader().getResourceAsStream(resourcePath);
- if (resourceStream != null) {
- debug("XCSS file exists in classpath");
-
- try {
- SAXParser parser = parserFactory.newSAXParser();
- parser.parse(resourceStream, new DefaultHandler() {
- @Override
- public void startElement(String uri,
- String localName, String name,
- Attributes attributes)
- throws SAXException {
-
- super.startElement(uri, localName, name, attributes);
-
- if ("f:resource".equals(name)) {
- String value = attributes.getValue("f:key");
-
- if (value != null) {
- debug("Adding resource: " + value);
-
- addResource(value, "", bean);
- }
- }
- }
- });
-
- } finally {
- try {
- resourceStream.close();
- } catch (IOException e) {
- getLog().error(e.getLocalizedMessage(), e);
- }
- }
- } else {
- getLog().error("Resource " + resourcePath + " hasn't been found!");
- }
- }
-
- private boolean isXCSSPath(String resourcePath) {
- return resourcePath != null && resourcePath.endsWith(".xcss");
- }
-
- public void createFiles(BuilderConfig config) throws GeneratorException {
- VelocityContext context = new VelocityContext();
- Template template = getTemplate();
- try {
- // Put common properties
-
- final ResourcesConfigGeneratorBean bean = new ResourcesConfigGeneratorBean();
-
- List<ComponentBean> components = config.getComponents();
- for (ComponentBean componentBean : components) {
- RendererBean rendererBean = componentBean.getRenderer();
-
- addResources(bean, rendererBean, config);
- }
-
- List<RendererBean> renderers = config.getRenderers();
- for (RendererBean rendererBean : renderers) {
- addResources(bean, rendererBean, config);
- }
-
- String includedContent = getIncludeContent();
- if (includedContent != null && includedContent.length() != 0) {
- String parseableContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><resource-config>" + includedContent +
- "</resource-config>";
-
- SAXParser parser = parserFactory.newSAXParser();
- parser.parse(new InputSource(new StringReader(parseableContent)), new DefaultHandler() {
- private StringBuilder path;
-
- @Override
- public void startElement(String uri,
- String localName, String name,
- Attributes attributes)
- throws SAXException {
-
- super.startElement(uri, localName, name, attributes);
-
- if ("path".equals(name)) {
- this.path = new StringBuilder();
- }
- }
-
- public void characters(char[] ch, int start, int length) throws SAXException {
- if (this.path != null) {
- this.path.append(ch, start, length);
- }
- };
-
- @Override
- public void endElement(String uri, String localName, String name) throws SAXException {
- super.endElement(uri, localName, name);
-
- if ("resource".equals(name)) {
- if (this.path != null && this.path.length() != 0) {
- String resourcePath = this.path.toString().trim();
- if (isXCSSPath(resourcePath)) {
- debug("XCSS file detected: " + resourcePath);
- try {
- parseXCSSResource(resourcePath, bean);
- } catch (IOException e) {
- throw new SAXException(e.getLocalizedMessage(), e);
- } catch (ParserConfigurationException e) {
- throw new SAXException(e.getLocalizedMessage(), e);
- }
- }
- }
- this.path = null;
- }
- }
- });
- }
-
- Set<String> pathResourcesSet = new LinkedHashSet<String>(bean.getPathResources().values());
- for (Iterator<String> iterator = pathResourcesSet.iterator(); iterator
- .hasNext();) {
- String resourcePath = iterator.next();
-
- if (isXCSSPath(resourcePath)) {
- debug("XCSS file detected: " + resourcePath);
- parseXCSSResource(resourcePath, bean);
- }
- }
-
- context.put("classResources", bean.getClassResources());
- context.put("pathResources", bean.getPathResources());
- context.put("resourcesConfig", this);
-
- File configFile = getResourcesConfig();
- File javaDir = configFile.getParentFile();
- if (!javaDir.exists()) {
- javaDir.mkdirs();
- }
- if (configFile.exists()) {
- configFile.delete();
- }
- Writer out = new BufferedWriter(new FileWriter(configFile));
- template.merge(context, out);
- out.flush();
- out.close();
- } catch (Exception e) {
- throw new GeneratorException("Error create new resources-config.xml ",
- e);
- }
- }
-
- protected String getRootTag() {
- return "resource-config";
- }
-
- public File getResourcesConfig() {
- return resourcesConfig;
- }
-
- public void setResourcesConfig(File resourcesConfig) {
- this.resourcesConfig = resourcesConfig;
- }
-
- protected String getDefaultTemplateName() {
- return "resources-config.vm";
- }
-
- public void setTemplates(File templatesDirectory) {
- this.templatesDirectory = templatesDirectory;
- }
-
- public File getTemplates() {
- return this.templatesDirectory;
- }
-}
-
-class GetResourceInterceptor implements MethodInterceptor {
-
- private static final Class<?>[] SIGNATURE = new Class<?>[] {
- String.class
- };
-
- private List<String> list = new ArrayList<String>();
-
- public List<String> getList() {
- return list;
- }
-
- public void clearList() {
- list.clear();
- }
-
- public Object intercept(Object instance, Method method, Object[] args,
- MethodProxy methodProxy) throws Throwable {
-
- if ("getResource".equals(method.getName()) &&
- Arrays.equals(SIGNATURE, method.getParameterTypes())) {
-
- list.add((String) args[0]);
-
- return null;
- } else {
- return methodProxy.invokeSuper(instance, args);
- }
- }
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGenerator.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGenerator.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,270 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.generator;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.Writer;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * @author Nick - mailto:nbelaevski@exadel.com created 17.04.2007
+ *
+ */
+public class ResourcesConfigGenerator extends FacesConfigGenerator {
+
+ private File resourcesConfig;
+ private File templatesDirectory;
+ private ResourcesConfigGeneratorBean resourcesConfigGeneratorBean;
+
+ private static final SAXParserFactory parserFactory = SAXParserFactory
+ .newInstance();
+
+ public ResourcesConfigGenerator(JSFGeneratorConfiguration task, Logger log) {
+ super(task, log);
+ }
+
+ private void parseXCSSResource(String resourcePath,
+ final ResourcesConfigGeneratorBean bean) throws SAXException,
+ IOException, ParserConfigurationException {
+ InputStream resourceStream = getClassLoader().getResourceAsStream(
+ resourcePath);
+ if (resourceStream != null) {
+ debug("XCSS file exists in classpath");
+
+ try {
+ SAXParser parser = parserFactory.newSAXParser();
+ parser.parse(resourceStream, new DefaultHandler() {
+ @Override
+ public void startElement(String uri, String localName,
+ String name, Attributes attributes)
+ throws SAXException {
+
+ super.startElement(uri, localName, name, attributes);
+
+ if ("f:resource".equals(name)) {
+ String value = attributes.getValue("f:key");
+
+ if (value != null) {
+ debug("Adding resource: " + value);
+
+ bean.addResource(value, "", null, true);
+ }
+ }
+ }
+ });
+
+ } finally {
+ try {
+ resourceStream.close();
+ } catch (IOException e) {
+ getLog().error(e.getLocalizedMessage(), e);
+ }
+ }
+ } else {
+ getLog().error("Resource " + resourcePath + " hasn't been found!");
+ }
+ }
+
+ private boolean isXCSSPath(String resourcePath) {
+ return resourcePath != null && resourcePath.endsWith(".xcss");
+ }
+
+ public void createFiles(BuilderConfig config) throws GeneratorException {
+ VelocityContext context = new VelocityContext();
+ Template template = getTemplate();
+ try {
+ // Put common properties
+
+ final ResourcesConfigGeneratorBean bean = new ResourcesConfigGeneratorBean();
+ if (this.resourcesConfigGeneratorBean != null) {
+ bean.merge(resourcesConfigGeneratorBean);
+ }
+
+ String includedContent = getIncludeContent();
+ if (includedContent != null && includedContent.length() != 0) {
+ String parseableContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><resource-config>"
+ + includedContent + "</resource-config>";
+
+ SAXParser parser = parserFactory.newSAXParser();
+ parser.parse(
+ new InputSource(new StringReader(parseableContent)),
+ new DefaultHandler() {
+ private StringBuilder path;
+
+ @Override
+ public void startElement(String uri,
+ String localName, String name,
+ Attributes attributes) throws SAXException {
+
+ super.startElement(uri, localName, name,
+ attributes);
+
+ if ("path".equals(name)) {
+ this.path = new StringBuilder();
+ }
+ }
+
+ public void characters(char[] ch, int start,
+ int length) throws SAXException {
+ if (this.path != null) {
+ this.path.append(ch, start, length);
+ }
+ };
+
+ @Override
+ public void endElement(String uri,
+ String localName, String name)
+ throws SAXException {
+ super.endElement(uri, localName, name);
+
+ if ("resource".equals(name)) {
+ if (this.path != null
+ && this.path.length() != 0) {
+ String resourcePath = this.path
+ .toString().trim();
+ if (isXCSSPath(resourcePath)) {
+ debug("XCSS file detected: "
+ + resourcePath);
+ try {
+ parseXCSSResource(resourcePath,
+ bean);
+ } catch (IOException e) {
+ throw new SAXException(e
+ .getLocalizedMessage(),
+ e);
+ } catch (ParserConfigurationException e) {
+ throw new SAXException(e
+ .getLocalizedMessage(),
+ e);
+ }
+ }
+ }
+ this.path = null;
+ }
+ }
+ });
+ }
+
+ Set<String> pathResourcesSet = new LinkedHashSet<String>();
+ for (ResourcesConfigGeneratorBeanEntry entry : bean.getDependencies()) {
+ if (entry.isPathResource()) {
+ pathResourcesSet.add(entry.getPath());
+ }
+ }
+
+ for (Iterator<String> iterator = pathResourcesSet.iterator(); iterator
+ .hasNext();) {
+ String resourcePath = iterator.next();
+
+ if (isXCSSPath(resourcePath)) {
+ debug("XCSS file detected: " + resourcePath);
+ parseXCSSResource(resourcePath, bean);
+ }
+ }
+
+ Map<String, String> classResources = new HashMap<String, String>();
+ Map<String, String> pathResources = new HashMap<String, String>();
+
+ for (ResourcesConfigGeneratorBeanEntry entry : bean.getDependencies()) {
+ if (entry.isPathResource()) {
+ pathResources.put(entry.getName(), entry.getPath());
+ } else {
+ classResources.put(entry.getName(), entry.getPath());
+ }
+ }
+
+ context.put("classResources", classResources);
+ context.put("pathResources", pathResources);
+ context.put("resourcesConfig", this);
+
+ File configFile = getResourcesConfig();
+ File javaDir = configFile.getParentFile();
+ if (!javaDir.exists()) {
+ javaDir.mkdirs();
+ }
+ if (configFile.exists()) {
+ configFile.delete();
+ }
+ Writer out = new BufferedWriter(new FileWriter(configFile));
+ template.merge(context, out);
+ out.flush();
+ out.close();
+ } catch (Exception e) {
+ throw new GeneratorException(
+ "Error create new resources-config.xml ", e);
+ }
+ }
+
+ protected String getRootTag() {
+ return "resource-config";
+ }
+
+ public File getResourcesConfig() {
+ return resourcesConfig;
+ }
+
+ public void setResourcesConfig(File resourcesConfig) {
+ this.resourcesConfig = resourcesConfig;
+ }
+
+ protected String getDefaultTemplateName() {
+ return "resources-config.vm";
+ }
+
+ public void setTemplates(File templatesDirectory) {
+ this.templatesDirectory = templatesDirectory;
+ }
+
+ public File getTemplates() {
+ return this.templatesDirectory;
+ }
+
+ public void setResourcesConfigGeneratorBean(
+ ResourcesConfigGeneratorBean resourcesConfigGeneratorBean) {
+ this.resourcesConfigGeneratorBean = resourcesConfigGeneratorBean;
+ }
+
+ public ResourcesConfigGeneratorBean getResourcesConfigGeneratorBean() {
+ return resourcesConfigGeneratorBean;
+ }
+}
\ No newline at end of file
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBean.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBean.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,53 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.generator;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-
-/**
- * @author Nick - mailto:nbelaevski@exadel.com
- * created 17.04.2007
- *
- */
-public class ResourcesConfigGeneratorBean {
- private HashMap<String, String> classResources = new HashMap<String, String>();
- private HashMap<String, String> pathResources = new HashMap<String, String>();
-
- public void addClassResource(String name, String className) {
- classResources.put(name, className);
- }
-
- public void addPathResource(String name, String path) {
- pathResources.put(name, path);
- }
-
- public Map<String, String> getClassResources() {
- return classResources;
- }
-
- public Map<String, String> getPathResources() {
- return pathResources;
- }
-}
\ No newline at end of file
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBean.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBean.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBean.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBean.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,93 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.generator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Nick - mailto:nbelaevski@exadel.com
+ * created 17.04.2007
+ *
+ */
+public class ResourcesConfigGeneratorBean {
+
+ private List<ResourcesConfigGeneratorBeanEntry> dependencies = new ArrayList<ResourcesConfigGeneratorBeanEntry>();
+
+ private String resolveResourcePath(String name, String packageName) {
+ if (name.contains("/")) {
+ String resolvedName;
+
+ if (!name.startsWith("/")) {
+ // need to resolve
+ StringBuffer normalizedName = new StringBuffer();
+ normalizedName.append(packageName.replace('.', '/'));
+
+ if (!packageName.endsWith("/")) {
+ normalizedName.append('/');
+ }
+
+ normalizedName.append(name);
+
+ resolvedName = normalizedName.toString();
+ } else {
+ if (name.length() > 0) {
+ resolvedName = name.substring(1);
+ } else {
+ resolvedName = null;
+ }
+ }
+
+ return resolvedName;
+ }
+
+ return null;
+ }
+
+ public void addResource(String name, String path, ResourceType type, boolean isDerived) {
+ boolean isPathResource = true;
+ String resolvedPath = resolveResourcePath(name, path);
+
+ // remove leading / from resource name.
+ if (name.startsWith("/")) {
+ name = name.substring(1);
+ }
+
+ if (resolvedPath == null) {
+ // couldn't resolve, treat as class name
+ resolvedPath = name;
+ isPathResource = false;
+ }
+
+ this.dependencies.add(
+ new ResourcesConfigGeneratorBeanEntry(
+ name, resolvedPath, isPathResource, type, isDerived));
+ }
+
+ public List<ResourcesConfigGeneratorBeanEntry> getDependencies() {
+ return dependencies;
+ }
+
+ public void merge(ResourcesConfigGeneratorBean bean) {
+ this.dependencies.addAll(bean.dependencies);
+ }
+}
\ No newline at end of file
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBeanEntry.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBeanEntry.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBeanEntry.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigGeneratorBeanEntry.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,66 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.builder.generator;
+
+public final class ResourcesConfigGeneratorBeanEntry {
+
+ public ResourcesConfigGeneratorBeanEntry(String name, String path, boolean pathResource,
+ ResourceType type, boolean derived) {
+ super();
+ this.name = name;
+ this.path = path;
+ this.pathResource = pathResource;
+ this.type = type;
+ this.derived = derived;
+ }
+
+ private String name;
+
+ private String path;
+
+ private boolean pathResource;
+
+ private ResourceType type;
+
+ private boolean derived;
+
+ public boolean isPathResource() {
+ return pathResource;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public ResourceType getType() {
+ return type;
+ }
+
+ public boolean isDerived() {
+ return derived;
+ }
+}
\ No newline at end of file
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigParser.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigParser.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigParser.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesConfigParser.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,428 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.generator;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import net.sf.cglib.proxy.MethodInterceptor;
+import net.sf.cglib.proxy.MethodProxy;
+
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.config.RendererBean;
+import org.richfaces.builder.config.TagBean;
+import org.richfaces.builder.config.TagHandlerBean;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.builder.TemplateCompiler;
+import org.richfaces.templatecompiler.elements.RootElement;
+import org.richfaces.templatecompiler.elements.TemplateElement;
+import org.richfaces.templatecompiler.elements.vcp.FResourceTemplateElement;
+import org.richfaces.templatecompiler.elements.vcp.HeaderResourceElement;
+import org.richfaces.templatecompiler.elements.vcp.HeaderScriptsElement;
+import org.richfaces.templatecompiler.elements.vcp.HeaderStylesElement;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class ResourcesConfigParser {
+
+ private JSFGeneratorConfiguration config;
+
+ private Logger log;
+
+ private File templates;
+
+ private ResourcesConfigGeneratorBean resourcesConfigGeneratorBean;
+
+ private Map<String, ResourcesConfigGeneratorBean> componentResourcesMap;
+
+ public ResourcesConfigParser(JSFGeneratorConfiguration config, Logger log) {
+ super();
+
+ this.config = config;
+ this.log = log;
+ this.resourcesConfigGeneratorBean = new ResourcesConfigGeneratorBean();
+ this.componentResourcesMap = new HashMap<String, ResourcesConfigGeneratorBean>();
+ }
+
+ public File getTemplates() {
+ return templates;
+ }
+
+ public void setTemplates(File templates) {
+ this.templates = templates;
+ }
+
+ private void addResources(ResourcesConfigGeneratorBean configBean,
+ TemplateElement templateElement, String packageName,
+ RendererBean renderer, BuilderConfig builderConfig)
+ throws ClassNotFoundException {
+ if (templateElement instanceof FResourceTemplateElement) {
+ FResourceTemplateElement resourceTemplateElement = (FResourceTemplateElement) templateElement;
+ String name = resourceTemplateElement.getName();
+
+ configBean.addResource(name, packageName, null, true);
+ } else if (templateElement instanceof RootElement) {
+ RootElement rootElement = (RootElement) templateElement;
+
+ CompilationContext compilationContext = rootElement
+ .getComponentBean();
+
+ addResource(configBean, renderer, builderConfig, compilationContext);
+ } else if (templateElement instanceof HeaderResourceElement) {
+ HeaderResourceElement resourceElement = (HeaderResourceElement) templateElement;
+
+ ResourceType type = null;
+ if (templateElement instanceof HeaderScriptsElement) {
+ type = ResourceType.SCRIPT;
+ } else if (templateElement instanceof HeaderStylesElement) {
+ type = ResourceType.STYLE;
+ }
+
+ String[] paths = resourceElement.getResourcePaths();
+ if (paths != null) {
+ for (int i = 0; i < paths.length; i++) {
+ String string = paths[i];
+
+ configBean.addResource(string, packageName, type, false);
+ }
+ }
+ }
+
+ ArrayList<TemplateElement> subElements = templateElement
+ .getSubElements();
+ for (TemplateElement element : subElements) {
+ addResources(configBean, element, packageName, renderer,
+ builderConfig);
+ }
+ }
+
+ private String getResourceKey(String packageName, Object resource) {
+ try {
+ Class<? extends Object> resourceClass = resource.getClass();
+ Method method = resourceClass.getMethod("getKey");
+ String resourceKey = (String) method.invoke(resource);
+
+ if (resourceKey != null && !resourceKey.equals(resourceClass.getName())) {
+ ClassLoader loader = config.getClassLoader();
+
+ if (loader.getResource(resourceKey) == null) {
+ String packagePath = packageName.replace('.', '/');
+ if (packagePath.length() != 0) {
+ packagePath += "/";
+ }
+
+ if (loader.getResource(packagePath + resourceKey) == null) {
+ resourceKey = null;
+ }
+ } else {
+ if (!resourceKey.startsWith("/")) {
+ resourceKey = "/" + resourceKey;
+ }
+ }
+ }
+
+ return resourceKey;
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+
+ return null;
+ }
+
+ private String addResource(ResourcesConfigGeneratorBean configBean,
+ RendererBean renderer, BuilderConfig builderConfig,
+ CompilationContext compilationContext)
+ throws ClassNotFoundException {
+ String packageName;
+ String classname = renderer.getClassname();
+ int idx = classname.lastIndexOf('.');
+ if (idx != -1) {
+ packageName = classname.substring(0, idx);
+ } else {
+ packageName = "";
+ }
+
+ ClassLoader loader = builderConfig.getLoader();
+ Class<?> cl = null;
+
+ try {
+ cl = loader.loadClass(classname);
+ } catch (ClassNotFoundException e) {
+ String superclass = compilationContext.getBaseclassPackageName()
+ + "." + compilationContext.getBaseclassName();
+ if (superclass != null) {
+ cl = loader.loadClass(superclass);
+ }
+ }
+
+ if (cl != null) {
+ try {
+ GetResourceInterceptor interceptor = new GetResourceInterceptor(builderConfig.getLoader());
+
+ Object instance = AbstractClassStubBuilder.buildStub(cl,
+ interceptor, builderConfig.getLoader());
+
+ //clear list - some resources could be requested during class/instance initialization
+ Object[] result = null;
+ Method method = null;
+ Set<String> locatedResources = new HashSet<String>();
+
+ Class<?> cl1 = instance.getClass();
+ while (cl1 != null && method == null) {
+ try {
+ method = cl1.getDeclaredMethod("getStyles");
+ } catch (NoSuchMethodException e) {
+ cl1 = cl1.getSuperclass();
+ }
+ }
+
+ if (method != null) {
+ method.setAccessible(true);
+ result = (Object[]) method.invoke(instance);
+ if (result instanceof Object[]) {
+ for (Object object : result) {
+ String resourceName = interceptor.getResourceName(object);
+
+ if (resourceName == null) {
+ resourceName = getResourceKey(packageName, object);
+ }
+
+ if (resourceName != null) {
+ locatedResources.add(resourceName);
+ configBean.addResource(resourceName, packageName, ResourceType.STYLE,
+ false);
+ }
+ }
+ }
+ }
+
+ method = null;
+ cl1 = instance.getClass();
+ while (cl1 != null && method == null) {
+ try {
+ method = cl1.getDeclaredMethod("getScripts");
+ } catch (NoSuchMethodException e) {
+ cl1 = cl1.getSuperclass();
+ }
+ }
+
+ if (method != null) {
+ method.setAccessible(true);
+ result = (Object[]) method.invoke(instance);
+ if (result instanceof Object[]) {
+ for (Object object : result) {
+ String resourceName = interceptor.getResourceName(object);
+
+ if (resourceName == null) {
+ resourceName = getResourceKey(packageName, object);
+ }
+
+ if (resourceName != null) {
+ locatedResources.add(resourceName);
+ configBean.addResource(resourceName, packageName, ResourceType.SCRIPT,
+ false);
+ }
+ }
+ }
+
+ List<String> list = interceptor.getList();
+ if (list != null) {
+ list.removeAll(locatedResources);
+ for (String resourceName : list) {
+ log.warn("Error detecting resource type: " + resourceName);
+ configBean.addResource(resourceName, packageName, null,
+ false);
+ }
+ }
+ }
+ } catch (SecurityException e) {
+ builderConfig.getLog().error(e.getMessage(), e);
+ } catch (IllegalArgumentException e) {
+ builderConfig.getLog().error(e.getMessage(), e);
+ } catch (IllegalAccessException e) {
+ builderConfig.getLog().error(e.getMessage(), e);
+ } catch (InvocationTargetException e) {
+ builderConfig.getLog().error(e.getMessage(), e);
+ }
+ }
+ return packageName;
+ }
+
+ private void addResources(ResourcesConfigGeneratorBean configBean,
+ RendererBean renderer, BuilderConfig builderConfig)
+ throws CompilationException, IOException, ClassNotFoundException {
+ if (null != renderer) {
+ CompilationContext compilationContext = new RendererCompilationContext(
+ log, config.getClassLoader(), config);
+
+ if (renderer.isGenerate()) {
+ String templateString = renderer.getTemplate();
+ if (templateString != null) {
+ File template;
+ if (null != getTemplates()) {
+ template = new File(getTemplates(), templateString);
+ } else {
+ template = new File(templateString);
+ }
+
+ TemplateCompiler templateCompiler = new TemplateCompiler();
+ InputStream templateStream = new FileInputStream(template);
+ templateCompiler.processing(templateStream,
+ compilationContext);
+
+ TemplateElement root = compilationContext.getTree();
+
+ String classname = renderer.getClassname();
+ String packageName;
+ int idx = classname.lastIndexOf('.');
+ if (idx != -1) {
+ packageName = classname.substring(0, idx);
+ } else {
+ packageName = "";
+ }
+
+ addResources(configBean, root, packageName, renderer,
+ builderConfig);
+ }
+ } else {
+ addResource(configBean, renderer, builderConfig,
+ compilationContext);
+ }
+ }
+ }
+
+ public void parse(BuilderConfig config) throws CompilationException, IOException, ClassNotFoundException {
+ List<ComponentBean> components = config.getComponents();
+ for (ComponentBean componentBean : components) {
+ ResourcesConfigGeneratorBean localBeanInstance = new ResourcesConfigGeneratorBean();
+ RendererBean rendererBean = componentBean.getRenderer();
+
+ addResources(localBeanInstance, rendererBean, config);
+
+ String componentName = null;
+
+ TagBean tag = componentBean.getTag();
+ if (tag != null) {
+ componentName = tag.getName();
+ }
+
+ if (componentName == null) {
+ TagHandlerBean taghandler = componentBean.getTaghandler();
+ if (taghandler != null) {
+ componentName = taghandler.getName();
+ }
+ }
+
+ if (componentName != null) {
+ this.componentResourcesMap.put(componentName, localBeanInstance);
+ }
+
+ this.resourcesConfigGeneratorBean.merge(localBeanInstance);
+ }
+
+ List<RendererBean> renderers = config.getRenderers();
+ for (RendererBean rendererBean : renderers) {
+ addResources(this.resourcesConfigGeneratorBean, rendererBean, config);
+ }
+ }
+
+ public ResourcesConfigGeneratorBean getResourcesConfigGeneratorBean() {
+ return resourcesConfigGeneratorBean;
+ }
+
+ public Map<String, ResourcesConfigGeneratorBean> getComponentResourcesMap() {
+ return componentResourcesMap;
+ }
+}
+
+class GetResourceInterceptor implements MethodInterceptor {
+
+ private static final Class<?>[] SIGNATURE = new Class<?>[] { String.class };
+
+ private ClassLoader classLoader;
+
+ private List<String> list = new ArrayList<String>();
+
+ private Map<String, Object> resources = new HashMap<String, Object>();
+
+ private Map<Object, String> resourcesInverse = new IdentityHashMap<Object, String>();
+
+ public GetResourceInterceptor(ClassLoader loader) {
+ this.classLoader = loader;
+ }
+
+ public List<String> getList() {
+ return list;
+ }
+
+ public String getResourceName(Object resource) {
+ return resourcesInverse.get(resource);
+ }
+
+ public void clearList() {
+ list.clear();
+ }
+
+ public Object intercept(Object instance, Method method, Object[] args,
+ MethodProxy methodProxy) throws Throwable {
+
+ if ("getResource".equals(method.getName())
+ && Arrays.equals(SIGNATURE, method.getParameterTypes())) {
+
+ String resourceName = (String) args[0];
+ list.add(resourceName);
+
+ Object resource = resources.get(resourceName);
+ if (resource == null) {
+ Class<?> returnType = method.getReturnType();
+ if (returnType.isInterface()) {
+ Object interfaceStub = AbstractClassStubBuilder.buildInterfaceStub(returnType, classLoader);
+ resources.put(resourceName, interfaceStub);
+ resourcesInverse.put(interfaceStub, resourceName);
+
+ return interfaceStub;
+ }
+ }
+
+ return null;
+ } else {
+ return methodProxy.invokeSuper(instance, args);
+ }
+ }
+
+}
\ No newline at end of file
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesDependenciesGenerator.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesDependenciesGenerator.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesDependenciesGenerator.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ResourcesDependenciesGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,143 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces.builder.generator;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.Writer;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class ResourcesDependenciesGenerator extends InnerGenerator {
+
+ private Map<String, ResourcesConfigGeneratorBean> componentDependencies;
+ private String uri;
+ private File dependencyFile;
+
+ public ResourcesDependenciesGenerator(JSFGeneratorConfiguration config,
+ Logger log) {
+ super(config, log);
+ }
+
+ @Override
+ public void createFiles(BuilderConfig config) throws GeneratorException {
+ try {
+ VelocityContext context = new VelocityContext();
+ Template template = getTemplate();
+
+ Map<String, Map<String, Collection<String>>> componentsMap = new HashMap<String, Map<String, Collection<String>>>();
+ for (Entry<String, ResourcesConfigGeneratorBean> entry : componentDependencies.entrySet()) {
+ Map<String, Collection<String>> resourcesMap = new HashMap<String, Collection<String>>();
+ componentsMap.put(entry.getKey(), resourcesMap);
+
+ Collection<String> scripts = new LinkedHashSet<String>();
+ Collection<String> styles = new LinkedHashSet<String>();
+
+ ResourcesConfigGeneratorBean resourcesConfigBean = entry.getValue();
+ List<ResourcesConfigGeneratorBeanEntry> dependencies = resourcesConfigBean.getDependencies();
+ for (ResourcesConfigGeneratorBeanEntry beanEntry : dependencies) {
+ if (beanEntry.isDerived()) {
+ continue;
+ }
+
+ ResourceType type = beanEntry.getType();
+ if (type != null) {
+ switch (type) {
+ case SCRIPT:
+ scripts.add(beanEntry.getPath());
+ break;
+
+ case STYLE:
+ styles.add(beanEntry.getPath());
+ break;
+ }
+ }
+ }
+
+ resourcesMap.put("scripts", scripts);
+ resourcesMap.put("styles", styles);
+ }
+
+ context.put("uri", uri);
+ context.put("components", componentsMap);
+
+ File configFile = getDependencyFile();
+ File javaDir = configFile.getParentFile();
+ if (!javaDir.exists()) {
+ javaDir.mkdirs();
+ }
+ if (configFile.exists()) {
+ configFile.delete();
+ }
+ Writer out = new BufferedWriter(new FileWriter(configFile));
+ template.merge(context, out);
+ out.flush();
+ out.close();
+ } catch (Exception e) {
+ throw new GeneratorException(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected String getDefaultTemplateName() {
+ return "resources-dependencies.vm";
+ }
+
+ public Map<String, ResourcesConfigGeneratorBean> getComponentDependencies() {
+ return componentDependencies;
+ }
+
+ public void setComponentDependencies(
+ Map<String, ResourcesConfigGeneratorBean> componentDependencies) {
+ this.componentDependencies = componentDependencies;
+ }
+
+ public void setDependencyFile(File dependencyFile) {
+ this.dependencyFile = dependencyFile;
+ }
+
+ public File getDependencyFile() {
+ return dependencyFile;
+ }
+
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+}
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TagHandlerGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/TagHandlerGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TagHandlerGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,17 +29,17 @@
import java.util.Iterator;
import java.util.Set;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.config.TagHandlerBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.config.TagHandlerBean;
/**
* Class implement functionality for generate facelets tags java files
- * inner element of {@link org.ajax4jsf.builder.ant.JSFGeneratorTask}
+ * inner element of {@link org.richfaces.builder.ant.JSFGeneratorTask}
* use in ant build.xml :
* <jsfgenerator ... >
* ....
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TagTestGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/TagTestGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TagTestGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,103 +0,0 @@
-package org.ajax4jsf.builder.generator;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.Writer;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.config.TagBean;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-
-public class TagTestGenerator extends InnerGenerator{
-
- private static final String COMPONENT_FILE_TEMPLATE = "tagtest.vm";
-
- public TagTestGenerator(JSFGeneratorConfiguration config, Logger log) {
- super(config, log);
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public void createFiles(BuilderConfig config) throws GeneratorException {
- // TODO Auto-generated method stub
- System.out.println("Preparing to generate test for tag class... ");
- VelocityContext context = new VelocityContext();
- context.put("generator",this);
- context.put("testDataGenerator", new TestDataGenerator2(getClassLoader(), getLog()));
-
- Template template = getTemplate();
- // Put common properties
- for (Iterator iter = config.getComponents().iterator(); iter.hasNext();) {
- ComponentBean component = (ComponentBean) iter.next();
- TagBean tag = component.getTag();
- if ( null != tag && null !=tag.getClassname() && tag.isGenerate()
- && tag.getTest() != null) {
- info("Create test class file for tag " + component.getTag().getSimpleClassName());
- context.put("component", component);
- if (null != component.getRenderer()) {
- context.put("renderer", component.getRenderer());
- } else {
- context.put("renderer",Boolean.FALSE);
- }
- context.put("tag", component.getTag());
- context.put("package", component.getTag().getPackageName());
- Set<String> importClasses = new HashSet<String>();
- for (Iterator<PropertyBean> it = component.getProperties().iterator(); it
- .hasNext();) {
- PropertyBean property = (PropertyBean) it.next();
- // For non-primitive types, add import declaration.
- if (!property.isSimpleType() && !property.isHidden()) {
- importClasses.add(property.getClassname());
- }
- }
- importClasses.add(component.getTag().getTest().getSuperclassname());
- context.put("imports", importClasses);
- String resultPath = component.getTag().getTest().getClassname().replace('.', '/')
- + ".java";
- //System.out.println("resultPath - " + resultPath);
- //System.out.println("getDestDir() - " + getDestDir());
- File javaFile = new File(getDestDir(), resultPath);
- File javaDir = javaFile.getParentFile();
- if (!javaDir.exists()) {
- javaDir.mkdirs();
- }
- try {
- if (javaFile.exists()) {
- javaFile.delete();
- }
- Writer out = new BufferedWriter(new FileWriter(javaFile));
- template.merge(context, out);
- out.flush();
- out.close();
- } catch (Exception e) {
- throw new GeneratorException(
- "Error create new Component JSP Tag Test Java file ", e);
- }
- }
- }
- }
-
- @Override
- protected String getDefaultTemplateName() {
- // TODO Auto-generated method stub
- return COMPONENT_FILE_TEMPLATE;
- }
-
- public String getSetterTestName(PropertyBean property){
- String setterName = property.getSetterName();
- String className = property.getSimpleClassName();
- StringBuilder name = new StringBuilder("test");
- name.append(Character.toUpperCase(setterName.charAt(0)));
- name.append(setterName.substring(1));
- name.append(Character.toUpperCase(className.charAt(0)));
- name.append(className.substring(1));
- return name.toString();
- }
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TagTestGenerator.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/TagTestGenerator.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TagTestGenerator.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TagTestGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,124 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.generator;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.Writer;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.config.TagBean;
+
+public class TagTestGenerator extends InnerGenerator{
+
+ private static final String COMPONENT_FILE_TEMPLATE = "tagtest.vm";
+
+ public TagTestGenerator(JSFGeneratorConfiguration config, Logger log) {
+ super(config, log);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public void createFiles(BuilderConfig config) throws GeneratorException {
+ // TODO Auto-generated method stub
+ System.out.println("Preparing to generate test for tag class... ");
+ VelocityContext context = new VelocityContext();
+ context.put("generator",this);
+ context.put("testDataGenerator", new TestDataGenerator2(getClassLoader(), getLog()));
+
+ Template template = getTemplate();
+ // Put common properties
+ for (Iterator iter = config.getComponents().iterator(); iter.hasNext();) {
+ ComponentBean component = (ComponentBean) iter.next();
+ TagBean tag = component.getTag();
+ if ( null != tag && null !=tag.getClassname() && tag.isGenerate()
+ && tag.getTest() != null) {
+ info("Create test class file for tag " + component.getTag().getSimpleClassName());
+ context.put("component", component);
+ if (null != component.getRenderer()) {
+ context.put("renderer", component.getRenderer());
+ } else {
+ context.put("renderer",Boolean.FALSE);
+ }
+ context.put("tag", component.getTag());
+ context.put("package", component.getTag().getPackageName());
+ Set<String> importClasses = new HashSet<String>();
+ for (Iterator<PropertyBean> it = component.getProperties().iterator(); it
+ .hasNext();) {
+ PropertyBean property = (PropertyBean) it.next();
+ // For non-primitive types, add import declaration.
+ if (!property.isSimpleType() && !property.isHidden()) {
+ importClasses.add(property.getClassname());
+ }
+ }
+ importClasses.add(component.getTag().getTest().getSuperclassname());
+ context.put("imports", importClasses);
+ String resultPath = component.getTag().getTest().getClassname().replace('.', '/')
+ + ".java";
+ //System.out.println("resultPath - " + resultPath);
+ //System.out.println("getDestDir() - " + getDestDir());
+ File javaFile = new File(getDestDir(), resultPath);
+ File javaDir = javaFile.getParentFile();
+ if (!javaDir.exists()) {
+ javaDir.mkdirs();
+ }
+ try {
+ if (javaFile.exists()) {
+ javaFile.delete();
+ }
+ Writer out = new BufferedWriter(new FileWriter(javaFile));
+ template.merge(context, out);
+ out.flush();
+ out.close();
+ } catch (Exception e) {
+ throw new GeneratorException(
+ "Error create new Component JSP Tag Test Java file ", e);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected String getDefaultTemplateName() {
+ // TODO Auto-generated method stub
+ return COMPONENT_FILE_TEMPLATE;
+ }
+
+ public String getSetterTestName(PropertyBean property){
+ String setterName = property.getSetterName();
+ String className = property.getSimpleClassName();
+ StringBuilder name = new StringBuilder("test");
+ name.append(Character.toUpperCase(setterName.charAt(0)));
+ name.append(setterName.substring(1));
+ name.append(Character.toUpperCase(className.charAt(0)));
+ name.append(className.substring(1));
+ return name.toString();
+ }
+}
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TaglibGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/TaglibGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TaglibGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,19 +29,19 @@
import java.util.Iterator;
import java.util.List;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.ConverterBean;
-import org.ajax4jsf.builder.config.FunctionBean;
-import org.ajax4jsf.builder.config.ListenerBean;
-import org.ajax4jsf.builder.config.ValidatorBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ComponentBean;
+import org.richfaces.builder.config.ConverterBean;
+import org.richfaces.builder.config.FunctionBean;
+import org.richfaces.builder.config.ListenerBean;
+import org.richfaces.builder.config.ValidatorBean;
/**
* Class implement functionality for generate jsp taglib .tld file
- * inner element of {@link org.ajax4jsf.builder.ant.JSFGeneratorTask}
+ * inner element of {@link org.richfaces.builder.ant.JSFGeneratorTask}
* use in ant build.xml :
* <jsfgenerator ... >
* ....
@@ -354,7 +354,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.XMLConfigGenerator#getRootTag()
+ * @see org.richfaces.builder.generator.XMLConfigGenerator#getRootTag()
*/
protected String getRootTag() {
//
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/TestDataGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,206 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.generator;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.ajax4jsf.builder.config.PropertyBean;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 13.04.2007
- *
- */
-public class TestDataGenerator {
-
- private ClassLoader loader;
- private Logger logger;
-
- private static Map<String, String> testData = new HashMap<String, String>();
- static {
- testData.put(Boolean.TYPE.getName(), "true");
- testData.put(Character.TYPE.getName(), "'#'");
- testData.put(Byte.TYPE.getName(), "17");
- testData.put(Short.TYPE.getName(), "18");
- testData.put(Integer.TYPE.getName(), "20");
- testData.put(Long.TYPE.getName(), "26");
- testData.put(Float.TYPE.getName(), "2.05f");
- testData.put(Double.TYPE.getName(), "1.34d");
-
- testData.put(Boolean.class.getName(), "new Boolean(true)");
- testData.put(Character.class.getName(), "new Character('#')");
- testData.put(Byte.class.getName(), "new Byte(17)");
- testData.put(Short.class.getName(), "new Short(18)");
- testData.put(Integer.class.getName(), "new Integer(20)");
- testData.put(Long.class.getName(), "new Long(26)");
- testData.put(Float.class.getName(), "new Float(2.05f)");
- testData.put(Double.class.getName(), "new Double(1.34d)");
-
- testData.put(Date.class.getName(), "java.text.DateFormat.getDateInstance(" +
- "java.text.DateFormat.SHORT, java.util.Locale.US).parse(\"09/08/2007\")");
- }
-
- private static Map<String, String> testData1 = new HashMap<String, String>();
- static {
- testData1.put(Boolean.TYPE.getName(), "false");
- testData1.put(Character.TYPE.getName(), "'*'");
- testData1.put(Byte.TYPE.getName(), "8");
- testData1.put(Short.TYPE.getName(), "26");
- testData1.put(Integer.TYPE.getName(), "15");
- testData1.put(Long.TYPE.getName(), "13");
- testData1.put(Float.TYPE.getName(), "1.05f");
- testData1.put(Double.TYPE.getName(), "1.44d");
-
- testData1.put(Boolean.class.getName(), "new Boolean(false)");
- testData1.put(Character.class.getName(), "new Character('*')");
- testData1.put(Byte.class.getName(), "new Byte(8)");
- testData1.put(Short.class.getName(), "new Short(26)");
- testData1.put(Integer.class.getName(), "new Integer(15)");
- testData1.put(Long.class.getName(), "new Long(13)");
- testData1.put(Float.class.getName(), "new Float(1.05f)");
- testData1.put(Double.class.getName(), "new Double(1.44d)");
-
- testData1.put(Date.class.getName(), "java.text.DateFormat.getDateInstance(" +
- "java.text.DateFormat.SHORT, java.util.Locale.US).parse(\"02/29/2008\")");
- }
-
- private static Map<String, Class> primitiveToWrapper = new HashMap<String, Class>();
- static {
- primitiveToWrapper.put(Boolean.TYPE.getName(), Boolean.class);
- primitiveToWrapper.put(Character.TYPE.getName(), Character.class);
- primitiveToWrapper.put(Byte.TYPE.getName(), Byte.class);
- primitiveToWrapper.put(Short.TYPE.getName(), Short.class);
- primitiveToWrapper.put(Integer.TYPE.getName(), Integer.class);
- primitiveToWrapper.put(Long.TYPE.getName(), Long.class);
- primitiveToWrapper.put(Float.TYPE.getName(), Float.class);
- primitiveToWrapper.put(Double.TYPE.getName(), Double.class);
- }
-
- public TestDataGenerator(ClassLoader loader, Logger logger) {
- super();
- this.loader = loader;
- this.logger = logger;
- }
-
-
- public String getTestVeClass(PropertyBean propertyBean) {
- String type = propertyBean.getClassname();
- Class clazz = primitiveToWrapper.get(propertyBean.getClassname());
- if (clazz == null) {
- try {
- clazz = loader.loadClass(propertyBean.getClassname());
- } catch (ClassNotFoundException e) {
- logger.error(e);
-
- return null;
- }
- }
-
- return clazz.getName();
- }
-
- public String getTestVeData(PropertyBean propertyBean) {
- String veClass = getTestVeClass(propertyBean);
- if (veClass != null) {
- return getTestData(propertyBean.getName(), veClass, 0);
- }
-
- return "";
- }
-
- public String getTestVeData1(PropertyBean propertyBean) {
- String veClass = getTestVeClass(propertyBean);
- if (veClass != null) {
- return getTestData(propertyBean.getName(), veClass, 1);
- }
-
- return "";
- }
-
- private String getTestData(String propertyName, String className, int number) {
-
- String string = number == 0 ? testData.get(className) : testData1.get(className);
-
- if (string != null) {
- return string;
- }
-
- try {
- Class<?> clazz = Class.forName(className, false, loader);
- if (clazz.isAssignableFrom(String.class)) {
- if (number == 0) {
- return "\"" + propertyName + "\"";
- } else {
- return "\"" + propertyName + "_" + propertyName + "\"";
- }
- } else if (clazz.isEnum()) {
- return getEnumData(propertyName, (Class<Enum<?>>)clazz, number);
- }
-
- } catch(Exception e) {
-
- }
-
- return "createTestData_" + number + "_" + propertyName + "()";
- }
-
- private String getEnumData(String propertyName, Class<Enum<?>> clazz, int number) {
- if (clazz.isEnum()) {
- Enum<?>[] enumConstants = clazz.getEnumConstants();
- if (enumConstants.length > 0) {
- if (number >= enumConstants.length) {
- return enumToString(enumConstants[enumConstants.length - 1]);
- }
- return enumToString(enumConstants[number]);
- }
- }
- return "null";
- }
-
- private String enumToString(Enum<?> e) {
- return e.getDeclaringClass().getName() + "." + e;
- }
-
- public String getTestData(PropertyBean propertyBean) {
- return getTestData(propertyBean.getName(), propertyBean.getClassname(), 0);
- }
-
- public String getTestData1(PropertyBean propertyBean) {
- return getTestData(propertyBean.getName(), propertyBean.getClassname(), 1);
- }
- /**
- * Returns true if property
- * @param propertyBean
- * @return
- */
- public boolean isNativelySupported(PropertyBean propertyBean) {
- String classname = propertyBean.getClassname();
- return testData.containsKey(classname) || isAssignabelFromString(propertyBean) || isEnum(propertyBean);
-
- }
-
- protected boolean isAssignabelFromString(PropertyBean bean) {
- String classname = bean.getClassname();
- Class<?> class1;
- try {
- class1 = Class.forName(classname, false, loader);
- } catch (ClassNotFoundException e) {
- return false;
- }
- return class1.isAssignableFrom(String.class);
- }
-
- protected boolean isEnum(PropertyBean bean) {
- String classname = bean.getClassname();
- Class<?> class1;
- try {
- class1 = Class.forName(classname, false, loader);
- } catch (ClassNotFoundException e) {
- return false;
- }
- return class1.isEnum();
- }
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/TestDataGenerator.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,224 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.generator;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.richfaces.builder.config.PropertyBean;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 13.04.2007
+ *
+ */
+public class TestDataGenerator {
+
+ private ClassLoader loader;
+ private Logger logger;
+
+ private static Map<String, String> testData = new HashMap<String, String>();
+ static {
+ testData.put(Boolean.TYPE.getName(), "true");
+ testData.put(Character.TYPE.getName(), "'#'");
+ testData.put(Byte.TYPE.getName(), "17");
+ testData.put(Short.TYPE.getName(), "18");
+ testData.put(Integer.TYPE.getName(), "20");
+ testData.put(Long.TYPE.getName(), "26");
+ testData.put(Float.TYPE.getName(), "2.05f");
+ testData.put(Double.TYPE.getName(), "1.34d");
+
+ testData.put(Boolean.class.getName(), "new Boolean(true)");
+ testData.put(Character.class.getName(), "new Character('#')");
+ testData.put(Byte.class.getName(), "new Byte(17)");
+ testData.put(Short.class.getName(), "new Short(18)");
+ testData.put(Integer.class.getName(), "new Integer(20)");
+ testData.put(Long.class.getName(), "new Long(26)");
+ testData.put(Float.class.getName(), "new Float(2.05f)");
+ testData.put(Double.class.getName(), "new Double(1.34d)");
+
+ testData.put(Date.class.getName(), "java.text.DateFormat.getDateInstance(" +
+ "java.text.DateFormat.SHORT, java.util.Locale.US).parse(\"09/08/2007\")");
+ }
+
+ private static Map<String, String> testData1 = new HashMap<String, String>();
+ static {
+ testData1.put(Boolean.TYPE.getName(), "false");
+ testData1.put(Character.TYPE.getName(), "'*'");
+ testData1.put(Byte.TYPE.getName(), "8");
+ testData1.put(Short.TYPE.getName(), "26");
+ testData1.put(Integer.TYPE.getName(), "15");
+ testData1.put(Long.TYPE.getName(), "13");
+ testData1.put(Float.TYPE.getName(), "1.05f");
+ testData1.put(Double.TYPE.getName(), "1.44d");
+
+ testData1.put(Boolean.class.getName(), "new Boolean(false)");
+ testData1.put(Character.class.getName(), "new Character('*')");
+ testData1.put(Byte.class.getName(), "new Byte(8)");
+ testData1.put(Short.class.getName(), "new Short(26)");
+ testData1.put(Integer.class.getName(), "new Integer(15)");
+ testData1.put(Long.class.getName(), "new Long(13)");
+ testData1.put(Float.class.getName(), "new Float(1.05f)");
+ testData1.put(Double.class.getName(), "new Double(1.44d)");
+
+ testData1.put(Date.class.getName(), "java.text.DateFormat.getDateInstance(" +
+ "java.text.DateFormat.SHORT, java.util.Locale.US).parse(\"02/29/2008\")");
+ }
+
+ private static Map<String, Class> primitiveToWrapper = new HashMap<String, Class>();
+ static {
+ primitiveToWrapper.put(Boolean.TYPE.getName(), Boolean.class);
+ primitiveToWrapper.put(Character.TYPE.getName(), Character.class);
+ primitiveToWrapper.put(Byte.TYPE.getName(), Byte.class);
+ primitiveToWrapper.put(Short.TYPE.getName(), Short.class);
+ primitiveToWrapper.put(Integer.TYPE.getName(), Integer.class);
+ primitiveToWrapper.put(Long.TYPE.getName(), Long.class);
+ primitiveToWrapper.put(Float.TYPE.getName(), Float.class);
+ primitiveToWrapper.put(Double.TYPE.getName(), Double.class);
+ }
+
+ public TestDataGenerator(ClassLoader loader, Logger logger) {
+ super();
+ this.loader = loader;
+ this.logger = logger;
+ }
+
+
+ public String getTestVeClass(PropertyBean propertyBean) {
+ String type = propertyBean.getClassname();
+ Class clazz = primitiveToWrapper.get(propertyBean.getClassname());
+ if (clazz == null) {
+ try {
+ clazz = loader.loadClass(propertyBean.getClassname());
+ } catch (ClassNotFoundException e) {
+ logger.error(e);
+
+ return null;
+ }
+ }
+
+ return clazz.getName();
+ }
+
+ public String getTestVeData(PropertyBean propertyBean) {
+ String veClass = getTestVeClass(propertyBean);
+ if (veClass != null) {
+ return getTestData(propertyBean.getName(), veClass, 0);
+ }
+
+ return "";
+ }
+
+ public String getTestVeData1(PropertyBean propertyBean) {
+ String veClass = getTestVeClass(propertyBean);
+ if (veClass != null) {
+ return getTestData(propertyBean.getName(), veClass, 1);
+ }
+
+ return "";
+ }
+
+ private String getTestData(String propertyName, String className, int number) {
+
+ String string = number == 0 ? testData.get(className) : testData1.get(className);
+
+ if (string != null) {
+ return string;
+ }
+
+ try {
+ Class<?> clazz = Class.forName(className, false, loader);
+ if (clazz.isAssignableFrom(String.class)) {
+ if (number == 0) {
+ return "\"" + propertyName + "\"";
+ } else {
+ return "\"" + propertyName + "_" + propertyName + "\"";
+ }
+ } else if (clazz.isEnum()) {
+ return getEnumData(propertyName, (Class<Enum<?>>)clazz, number);
+ }
+
+ } catch(Exception e) {
+
+ }
+
+ return "createTestData_" + number + "_" + propertyName + "()";
+ }
+
+ private String getEnumData(String propertyName, Class<Enum<?>> clazz, int number) {
+ if (clazz.isEnum()) {
+ Enum<?>[] enumConstants = clazz.getEnumConstants();
+ if (enumConstants.length > 0) {
+ if (number >= enumConstants.length) {
+ return enumToString(enumConstants[enumConstants.length - 1]);
+ }
+ return enumToString(enumConstants[number]);
+ }
+ }
+ return "null";
+ }
+
+ private String enumToString(Enum<?> e) {
+ return e.getDeclaringClass().getName() + "." + e;
+ }
+
+ public String getTestData(PropertyBean propertyBean) {
+ return getTestData(propertyBean.getName(), propertyBean.getClassname(), 0);
+ }
+
+ public String getTestData1(PropertyBean propertyBean) {
+ return getTestData(propertyBean.getName(), propertyBean.getClassname(), 1);
+ }
+ /**
+ * Returns true if property
+ * @param propertyBean
+ * @return
+ */
+ public boolean isNativelySupported(PropertyBean propertyBean) {
+ String classname = propertyBean.getClassname();
+ return testData.containsKey(classname) || isAssignabelFromString(propertyBean) || isEnum(propertyBean);
+
+ }
+
+ protected boolean isAssignabelFromString(PropertyBean bean) {
+ String classname = bean.getClassname();
+ Class<?> class1;
+ try {
+ class1 = Class.forName(classname, false, loader);
+ } catch (ClassNotFoundException e) {
+ return false;
+ }
+ return class1.isAssignableFrom(String.class);
+ }
+
+ protected boolean isEnum(PropertyBean bean) {
+ String classname = bean.getClassname();
+ Class<?> class1;
+ try {
+ class1 = Class.forName(classname, false, loader);
+ } catch (ClassNotFoundException e) {
+ return false;
+ }
+ return class1.isEnum();
+ }
+}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator2.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/TestDataGenerator2.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator2.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,56 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.generator;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.ajax4jsf.builder.config.PropertyBean;
-
-/**
- * @author Administrator
- *
- */
-public class TestDataGenerator2 extends TestDataGenerator {
-
-
- @SuppressWarnings("serial")
- private static final Map<String, String> testData = new HashMap<String, String>() {
- {
- put(java.util.Date.class.getName(), "new Date()");
- put(java.util.Calendar.class.getName(), "Calendar.getInstance()");
- }
- };
-
- public TestDataGenerator2(ClassLoader loader, Logger logger) {
- super(loader, logger);
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public String getTestData(PropertyBean propertyBean) {
- String classname = propertyBean.getClassname();
- if (testData.containsKey(classname)) {
- return testData.get(classname);
- }
- return super.getTestData(propertyBean);
- }
-
- @Override
- public String getTestData1(PropertyBean propertyBean) {
- String classname = propertyBean.getClassname();
- if (testData.containsKey(classname)) {
- return testData.get(classname);
- }
- return super.getTestData1(propertyBean);
- }
-
- @Override
- /**
- * Disable date types
- */
- public boolean isNativelySupported(PropertyBean propertyBean) {
- return super.isNativelySupported(propertyBean) && !testData.containsKey(propertyBean.getClassname());
- }
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator2.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/TestDataGenerator2.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator2.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/TestDataGenerator2.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,74 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.generator;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.richfaces.builder.config.PropertyBean;
+
+/**
+ * @author Administrator
+ *
+ */
+public class TestDataGenerator2 extends TestDataGenerator {
+
+
+ @SuppressWarnings("serial")
+ private static final Map<String, String> testData = new HashMap<String, String>() {
+ {
+ put(java.util.Date.class.getName(), "new Date()");
+ put(java.util.Calendar.class.getName(), "Calendar.getInstance()");
+ }
+ };
+
+ public TestDataGenerator2(ClassLoader loader, Logger logger) {
+ super(loader, logger);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public String getTestData(PropertyBean propertyBean) {
+ String classname = propertyBean.getClassname();
+ if (testData.containsKey(classname)) {
+ return testData.get(classname);
+ }
+ return super.getTestData(propertyBean);
+ }
+
+ @Override
+ public String getTestData1(PropertyBean propertyBean) {
+ String classname = propertyBean.getClassname();
+ if (testData.containsKey(classname)) {
+ return testData.get(classname);
+ }
+ return super.getTestData1(propertyBean);
+ }
+
+ @Override
+ /**
+ * Disable date types
+ */
+ public boolean isNativelySupported(PropertyBean propertyBean) {
+ return super.isNativelySupported(propertyBean) && !testData.containsKey(propertyBean.getClassname());
+ }
+}
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ValidatorGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ValidatorGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ValidatorGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,11 +29,11 @@
import java.util.Iterator;
import java.util.Set;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.config.ValidatorBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.config.ValidatorBean;
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ValidatorTagGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ValidatorTagGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/ValidatorTagGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.BufferedWriter;
import java.io.File;
@@ -29,17 +29,17 @@
import java.util.Iterator;
import java.util.Set;
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.PropertyBean;
-import org.ajax4jsf.builder.config.TagBean;
-import org.ajax4jsf.builder.config.ValidatorBean;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.PropertyBean;
+import org.richfaces.builder.config.TagBean;
+import org.richfaces.builder.config.ValidatorBean;
/**
* Class implement functionality for generate jsp tags for validators
- * inner element of {@link org.ajax4jsf.builder.ant.JSFGeneratorTask}
+ * inner element of {@link org.richfaces.builder.ant.JSFGeneratorTask}
* use in ant build.xml :
* <jsfgenerator ... >
* ....
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/XMLConfigGenerator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/XMLConfigGenerator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/generator/XMLConfigGenerator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,14 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
-import org.ajax4jsf.builder.config.ParsingException;
-import org.ajax4jsf.builder.xml.XMLBody;
+import org.richfaces.builder.config.ParsingException;
+import org.richfaces.builder.xml.XMLBody;
/**
* @author shura
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/Argument.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/Argument.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/Argument.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
/**
* Representation of method argument
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/ClassImport.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/ClassImport.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/ClassImport.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaAnnotation.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
import java.util.ArrayList;
import java.util.Arrays;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaClass.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaClass.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaClass.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
import java.util.ArrayList;
import java.util.Comparator;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaComment.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaComment.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaComment.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
/**
* Java comment representation
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaConstructor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaConstructor.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaConstructor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaField.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaField.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaField.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
/**
* Class field abstraction
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaImport.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaImport.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaImport.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaLanguageElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
import java.util.ArrayList;
import java.util.HashSet;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaMethod.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
import java.util.ArrayList;
import java.util.Arrays;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaModifier.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaModifier.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaModifier.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaPackage.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaPrimitive.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/JavaPrimitive.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/JavaPrimitive.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
import java.util.HashMap;
import java.util.Map;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/MethodBody.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/MethodBody.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/MethodBody.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
import java.util.HashSet;
import java.util.Set;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/model/RuntimeImport.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.model;
+package org.richfaces.builder.model;
/**
* Implementation of import taht cannot be resolved in design time
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/render)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaClassRenderer.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaClassRenderer.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaClassRenderer.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.render;
+package org.richfaces.builder.render;
import java.io.PrintWriter;
import java.util.List;
@@ -27,14 +27,14 @@
import javax.faces.component.UIComponentBase;
-import org.ajax4jsf.builder.model.Argument;
-import org.ajax4jsf.builder.model.JavaClass;
-import org.ajax4jsf.builder.model.JavaField;
-import org.ajax4jsf.builder.model.JavaImport;
-import org.ajax4jsf.builder.model.JavaMethod;
-import org.ajax4jsf.builder.model.JavaModifier;
-import org.ajax4jsf.builder.model.JavaPackage;
-import org.ajax4jsf.builder.model.MethodBody;
+import org.richfaces.builder.model.Argument;
+import org.richfaces.builder.model.JavaClass;
+import org.richfaces.builder.model.JavaField;
+import org.richfaces.builder.model.JavaImport;
+import org.richfaces.builder.model.JavaMethod;
+import org.richfaces.builder.model.JavaModifier;
+import org.richfaces.builder.model.JavaPackage;
+import org.richfaces.builder.model.MethodBody;
/**
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaFieldRenderer.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaFieldRenderer.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaFieldRenderer.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.render;
+package org.richfaces.builder.render;
import java.io.PrintWriter;
-import org.ajax4jsf.builder.model.JavaField;
+import org.richfaces.builder.model.JavaField;
/**
* @author Maksim Kaszynski
@@ -32,7 +32,7 @@
public class JavaFieldRenderer extends JavaLanguageElementRenderer<JavaField> {
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.render.JavaLanguageElementRenderer#render(org.ajax4jsf.builder.model.JavaLanguageElement, java.io.PrintWriter)
+ * @see org.richfaces.builder.render.JavaLanguageElementRenderer#render(org.richfaces.builder.model.JavaLanguageElement, java.io.PrintWriter)
*/
@Override
public void render(JavaField field, PrintWriter out) {
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaLanguageElementRenderer.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaLanguageElementRenderer.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaLanguageElementRenderer.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -18,17 +18,17 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.render;
+package org.richfaces.builder.render;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import org.ajax4jsf.builder.model.JavaAnnotation;
-import org.ajax4jsf.builder.model.JavaComment;
-import org.ajax4jsf.builder.model.JavaLanguageElement;
-import org.ajax4jsf.builder.model.JavaModifier;
+import org.richfaces.builder.model.JavaAnnotation;
+import org.richfaces.builder.model.JavaComment;
+import org.richfaces.builder.model.JavaLanguageElement;
+import org.richfaces.builder.model.JavaModifier;
/**
*
* @author Maksim Kaszynski
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaMethodRenderer.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/render/JavaMethodRenderer.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/render/JavaMethodRenderer.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,15 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.render;
+package org.richfaces.builder.render;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
-import org.ajax4jsf.builder.model.Argument;
-import org.ajax4jsf.builder.model.JavaMethod;
-import org.ajax4jsf.builder.model.MethodBody;
+import org.richfaces.builder.model.Argument;
+import org.richfaces.builder.model.JavaMethod;
+import org.richfaces.builder.model.MethodBody;
/**
* @author Maksim Kaszynski
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/velocity)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity/AntFileResourceLoader.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/velocity/AntFileResourceLoader.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity/AntFileResourceLoader.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.velocity;
+package org.richfaces.builder.velocity;
import java.io.BufferedInputStream;
import java.io.File;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity/BuilderContext.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/velocity/BuilderContext.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity/BuilderContext.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,15 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.velocity;
+package org.richfaces.builder.velocity;
import java.io.File;
import java.util.Properties;
-import org.ajax4jsf.builder.generator.GeneratorException;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
+import org.richfaces.builder.generator.GeneratorException;
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
@@ -72,7 +72,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.ant.JSFGeneratorConfiguration#getTemplate(java.lang.String)
+ * @see org.richfaces.builder.ant.JSFGeneratorConfiguration#getTemplate(java.lang.String)
*/
public static Template getTemplate(String templateName) throws GeneratorException {
try {
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity/ClasspathTemplateLoader.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/velocity/ClasspathTemplateLoader.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/velocity/ClasspathTemplateLoader.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.velocity;
+package org.richfaces.builder.velocity;
import java.io.InputStream;
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/xml)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/NamesListComparator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/xml/NamesListComparator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/NamesListComparator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.xml;
+package org.richfaces.builder.xml;
import java.util.Comparator;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBody.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/xml/XMLBody.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBody.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.xml;
+package org.richfaces.builder.xml;
import java.io.IOException;
import java.io.InputStream;
@@ -35,7 +35,7 @@
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
-import org.ajax4jsf.builder.config.ParsingException;
+import org.richfaces.builder.config.ParsingException;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
import org.w3c.dom.Element;
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodyMerge.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/xml/XMLBodyMerge.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodyMerge.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,130 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.xml;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.ajax4jsf.builder.config.ParsingException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class XMLBodyMerge implements NodeList{
-
- private String xpath;
-
- private List<Node> nodes = new ArrayList<Node>();
-
- private Document document = null;
-
- private XPathExpression keyXpath = null;
-
- private StringBuffer content = new StringBuffer();
-
- private Set<String> keys = new HashSet<String>();
-
-
-
- public XMLBodyMerge(String xpath) {
- super();
- this.xpath = xpath;
- }
-
- public XMLBodyMerge(String xpath, String keyXpath) {
- this(xpath);
- if (keyXpath != null) {
- try {
- XPath newXPath = XPathFactory.newInstance().newXPath();
- this.keyXpath = newXPath.compile(keyXpath);
- } catch (XPathExpressionException e) {
- e.printStackTrace();
- }
- }
- }
-
- public void add(Node node) {
-
- if (keyXpath != null) {
- String key = getKey(node);
- if (key == null || keys.contains(key)) {
- return;
- }
- }
-
- if (document == null) {
- document = node.getOwnerDocument();
- } else {
- node = document.importNode(node, true);
- }
- nodes.add(node);
- }
-
- public void add(XMLBody xmlBody) throws ParsingException {
-
- if (xpath != null) {
- NodeList nodeList = xmlBody.getByXpath(xpath);
- if (nodeList != null) {
- for(int i = 0; i < nodeList.getLength(); i++) {
- add(nodeList.item(i));
- }
- }
- } else {
- content.append(xmlBody.getContent());
- }
-
- }
-
- public int getLength() {
- return nodes.size();
- }
-
- public Node item(int index) {
- if (index < nodes.size()) {
- return nodes.get(index);
- }
- return null;
- }
-
-
- public void sort(Comparator<Node> comparator) {
- Collections.sort(nodes, comparator);
- }
-
- public String getContent() throws Exception{
- StringBuilder buf = new StringBuilder();
- if (content != null) {
- buf.append(content);
- }
- if (document != null) {
- buf.append(new XMLBodySerializer().serialize(this, document));
- }
-
- return buf.toString();
- }
-
- private String getKey(Node node) {
- try {
- NodeList list = (NodeList) keyXpath.evaluate(node, XPathConstants.NODESET);
- return new XMLBodySerializer().serialize(list, node.getOwnerDocument());
- } catch (Exception e) {
- }
- return null;
- }
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodyMerge.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/xml/XMLBodyMerge.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodyMerge.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodyMerge.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,148 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.xml;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.richfaces.builder.config.ParsingException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class XMLBodyMerge implements NodeList{
+
+ private String xpath;
+
+ private List<Node> nodes = new ArrayList<Node>();
+
+ private Document document = null;
+
+ private XPathExpression keyXpath = null;
+
+ private StringBuffer content = new StringBuffer();
+
+ private Set<String> keys = new HashSet<String>();
+
+
+
+ public XMLBodyMerge(String xpath) {
+ super();
+ this.xpath = xpath;
+ }
+
+ public XMLBodyMerge(String xpath, String keyXpath) {
+ this(xpath);
+ if (keyXpath != null) {
+ try {
+ XPath newXPath = XPathFactory.newInstance().newXPath();
+ this.keyXpath = newXPath.compile(keyXpath);
+ } catch (XPathExpressionException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void add(Node node) {
+
+ if (keyXpath != null) {
+ String key = getKey(node);
+ if (key == null || keys.contains(key)) {
+ return;
+ }
+ }
+
+ if (document == null) {
+ document = node.getOwnerDocument();
+ } else {
+ node = document.importNode(node, true);
+ }
+ nodes.add(node);
+ }
+
+ public void add(XMLBody xmlBody) throws ParsingException {
+
+ if (xpath != null) {
+ NodeList nodeList = xmlBody.getByXpath(xpath);
+ if (nodeList != null) {
+ for(int i = 0; i < nodeList.getLength(); i++) {
+ add(nodeList.item(i));
+ }
+ }
+ } else {
+ content.append(xmlBody.getContent());
+ }
+
+ }
+
+ public int getLength() {
+ return nodes.size();
+ }
+
+ public Node item(int index) {
+ if (index < nodes.size()) {
+ return nodes.get(index);
+ }
+ return null;
+ }
+
+
+ public void sort(Comparator<Node> comparator) {
+ Collections.sort(nodes, comparator);
+ }
+
+ public String getContent() throws Exception{
+ StringBuilder buf = new StringBuilder();
+ if (content != null) {
+ buf.append(content);
+ }
+ if (document != null) {
+ buf.append(new XMLBodySerializer().serialize(this, document));
+ }
+
+ return buf.toString();
+ }
+
+ private String getKey(Node node) {
+ try {
+ NodeList list = (NodeList) keyXpath.evaluate(node, XPathConstants.NODESET);
+ return new XMLBodySerializer().serialize(list, node.getOwnerDocument());
+ } catch (Exception e) {
+ }
+ return null;
+ }
+}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodySerializer.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/xml/XMLBodySerializer.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodySerializer.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,60 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.xml;
-
-import java.io.StringWriter;
-
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.ajax4jsf.builder.config.ParsingException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.NodeList;
-
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class XMLBodySerializer {
- public String serialize(NodeList childNodes, Document xmlDocument) throws ParsingException {
- try {
- StringWriter out;
- DocumentFragment fragment = xmlDocument.createDocumentFragment();
- for (int i = 0; i < childNodes.getLength(); i++) {
- fragment.appendChild(childNodes.item(i).cloneNode(true));
- }
- TransformerFactory transformerFactory = TransformerFactory.newInstance();
- Transformer transformer = transformerFactory.newTransformer();
- transformer.setErrorListener(new ErrorListener(){
-
- public void error(TransformerException exception)
- throws TransformerException {
- }
-
- public void fatalError(TransformerException exception)
- throws TransformerException {
- }
-
- public void warning(TransformerException exception)
- throws TransformerException {
- }
-
- });
- transformer.setOutputProperty("indent", "yes");
- transformer.setOutputProperty("omit-xml-declaration", "yes");
- out = new StringWriter();
- StreamResult result = new StreamResult(out);
- transformer.transform(new DOMSource(fragment), result);
- return out.toString();
- } catch (Exception e) {
- throw new ParsingException(e);
- }
- }
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodySerializer.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/xml/XMLBodySerializer.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodySerializer.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XMLBodySerializer.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,78 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.xml;
+
+import java.io.StringWriter;
+
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.richfaces.builder.config.ParsingException;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.NodeList;
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class XMLBodySerializer {
+ public String serialize(NodeList childNodes, Document xmlDocument) throws ParsingException {
+ try {
+ StringWriter out;
+ DocumentFragment fragment = xmlDocument.createDocumentFragment();
+ for (int i = 0; i < childNodes.getLength(); i++) {
+ fragment.appendChild(childNodes.item(i).cloneNode(true));
+ }
+ TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ Transformer transformer = transformerFactory.newTransformer();
+ transformer.setErrorListener(new ErrorListener(){
+
+ public void error(TransformerException exception)
+ throws TransformerException {
+ }
+
+ public void fatalError(TransformerException exception)
+ throws TransformerException {
+ }
+
+ public void warning(TransformerException exception)
+ throws TransformerException {
+ }
+
+ });
+ transformer.setOutputProperty("indent", "yes");
+ transformer.setOutputProperty("omit-xml-declaration", "yes");
+ out = new StringWriter();
+ StreamResult result = new StreamResult(out);
+ transformer.transform(new DOMSource(fragment), result);
+ return out.toString();
+ } catch (Exception e) {
+ throw new ParsingException(e);
+ }
+ }
+}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XPathComparator.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/xml/XPathComparator.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XPathComparator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,79 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.xml;
-
-import java.util.Comparator;
-
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.w3c.dom.Node;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class XPathComparator implements Comparator<Node> {
-
- class XPathCompatorCriterion {
- private XPathExpression expression = null;
-
- public XPathCompatorCriterion(String xPath){
- try {
- expression = XPathFactory.newInstance().newXPath().compile(xPath);
- } catch (XPathExpressionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- public String getValue(Object node) throws XPathExpressionException {
- return expression == null ? null : expression.evaluate(node);
- }
- }
-
- private XPathCompatorCriterion [] criteria;
-
- public XPathComparator(String ... criteria) {
- this.criteria = new XPathCompatorCriterion[criteria.length];
- for(int i = 0; i < criteria.length; i++) {
- this.criteria[i] = new XPathCompatorCriterion(criteria[i]);
- }
- }
-
- public int compare(Node o1, Node o2) {
- int result = 0;
-
- for(int i = 0; i < criteria.length && result == 0; i++) {
- String s1 = null;
- String s2 = null;
- try {
- s1 = this.criteria[i].getValue(o1);
- } catch (XPathExpressionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- try {
- s2 = this.criteria[i].getValue(o2);
- } catch (XPathExpressionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- if (s1 != null) {
- if (s2 != null) {
- result = s1.compareTo(s2);
- } else {
- result = 1;
- }
- } else if (s2 != null) {
- result = -1;
- }
- }
-
- return result;
- }
-
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XPathComparator.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/builder/xml/XPathComparator.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XPathComparator.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/builder/xml/XPathComparator.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,97 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.xml;
+
+import java.util.Comparator;
+
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.w3c.dom.Node;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class XPathComparator implements Comparator<Node> {
+
+ class XPathCompatorCriterion {
+ private XPathExpression expression = null;
+
+ public XPathCompatorCriterion(String xPath){
+ try {
+ expression = XPathFactory.newInstance().newXPath().compile(xPath);
+ } catch (XPathExpressionException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public String getValue(Object node) throws XPathExpressionException {
+ return expression == null ? null : expression.evaluate(node);
+ }
+ }
+
+ private XPathCompatorCriterion [] criteria;
+
+ public XPathComparator(String ... criteria) {
+ this.criteria = new XPathCompatorCriterion[criteria.length];
+ for(int i = 0; i < criteria.length; i++) {
+ this.criteria[i] = new XPathCompatorCriterion(criteria[i]);
+ }
+ }
+
+ public int compare(Node o1, Node o2) {
+ int result = 0;
+
+ for(int i = 0; i < criteria.length && result == 0; i++) {
+ String s1 = null;
+ String s2 = null;
+ try {
+ s1 = this.criteria[i].getValue(o1);
+ } catch (XPathExpressionException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ try {
+ s2 = this.criteria[i].getValue(o2);
+ } catch (XPathExpressionException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ if (s1 != null) {
+ if (s2 != null) {
+ result = s1.compareTo(s2);
+ } else {
+ result = 1;
+ }
+ } else if (s2 != null) {
+ result = -1;
+ }
+ }
+
+ return result;
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/ant (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/ant)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/ant/AntCompilationContext.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/ant/AntCompilationContext.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/ant/AntCompilationContext.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,12 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.ant;
+package org.richfaces.templatecompiler.ant;
-import org.ajax4jsf.templatecompiler.builder.AbstractCompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
import org.apache.tools.ant.Project;
import org.apache.velocity.Template;
+import org.richfaces.templatecompiler.builder.AbstractCompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
/**
* @author shura
@@ -50,63 +50,63 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#debug(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#debug(java.lang.String)
*/
public void debug(String content) {
project.log(content, Project.MSG_DEBUG);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#debug(java.lang.String, java.lang.Throwable)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#debug(java.lang.String, java.lang.Throwable)
*/
public void debug(String content, Throwable error) {
project.log(content, Project.MSG_DEBUG);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#error(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#error(java.lang.String)
*/
public void error(String content) {
project.log(content, Project.MSG_ERR);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#error(java.lang.String, java.lang.Throwable)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#error(java.lang.String, java.lang.Throwable)
*/
public void error(String content, Throwable error) {
project.log(content, Project.MSG_ERR);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#info(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#info(java.lang.String)
*/
public void info(String content) {
project.log(content, Project.MSG_INFO);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#info(java.lang.String, java.lang.Throwable)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#info(java.lang.String, java.lang.Throwable)
*/
public void info(String content, Throwable error) {
project.log(content, Project.MSG_INFO);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#warn(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#warn(java.lang.String)
*/
public void warn(String content) {
project.log(content, Project.MSG_WARN);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#warn(java.lang.String, java.lang.Throwable)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#warn(java.lang.String, java.lang.Throwable)
*/
public void warn(String content, Throwable error) {
project.log(content, Project.MSG_INFO);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#getTemplate(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#getTemplate(java.lang.String)
*/
public Template getTemplate(String name) throws CompilationException {
return task.getTemplate(name);
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/ant/TemplateCompilerTask.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/ant/TemplateCompilerTask.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/ant/TemplateCompilerTask.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.ant;
+package org.richfaces.templatecompiler.ant;
import java.io.BufferedWriter;
import java.io.File;
@@ -38,9 +38,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.builder.TemplateCompiler;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task;
@@ -51,6 +48,9 @@
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.builder.TemplateCompiler;
/**
* Task template compiler.
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/AbstractCompilationContext.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/AbstractCompilationContext.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.builder;
+package org.richfaces.templatecompiler.builder;
import java.beans.PropertyDescriptor;
import java.io.StringWriter;
@@ -33,12 +33,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.ajax4jsf.builder.config.ClassVisitor;
-import org.ajax4jsf.builder.config.ClassWalkingLogic;
-import org.ajax4jsf.builder.model.JavaPrimitive;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.ElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElement;
import org.apache.commons.beanutils.MethodUtils;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.logging.Log;
@@ -46,6 +40,12 @@
import org.apache.velocity.VelocityContext;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
+import org.richfaces.builder.config.ClassVisitor;
+import org.richfaces.builder.config.ClassWalkingLogic;
+import org.richfaces.builder.model.JavaPrimitive;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.ElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElement;
import org.w3c.dom.Node;
/**
@@ -66,7 +66,7 @@
final private static Pattern patternComponent = Pattern.compile(
regexComponent, Pattern.UNIX_LINES + Pattern.DOTALL);
- private final static String DEFAULT_BASE_CLASS = "org.ajax4jsf.renderkit.RendererBase";
+ private final static String DEFAULT_BASE_CLASS = "org.richfaces.renderkit.RendererBase";
private String packageName;
@@ -95,8 +95,8 @@
"java.io.IOException", "javax.faces.component.UIComponent",
"javax.faces.context.FacesContext",
"javax.faces.context.ResponseWriter",
- "org.ajax4jsf.renderkit.ComponentsVariableResolver",
- "org.ajax4jsf.renderkit.ComponentVariables" };
+ "org.richfaces.renderkit.ComponentsVariableResolver",
+ "org.richfaces.renderkit.ComponentVariables" };
private TemplateElement tree;
@@ -369,7 +369,7 @@
addVariable("writer", "javax.faces.context.ResponseWriter");
// addLocalVariable("component", "javax.faces.component.UIComponent" );
addVariable("variables",
- "org.ajax4jsf.renderkit.ComponentVariables");
+ "org.richfaces.renderkit.ComponentVariables");
}
public Class<?> getMethodReturnedClass(Class<?> clazz, String methodName,
@@ -492,7 +492,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#getProcessor(org.w3c.dom.Node)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#getProcessor(org.w3c.dom.Node)
*/
public TemplateElement getProcessor(Node nodeElement) throws CompilationException {
for (Iterator<ElementsFactory> iter = elementFactories.listIterator(); iter.hasNext();) {
@@ -506,7 +506,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#processTemplate(java.lang.String, org.apache.velocity.VelocityContext)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#processTemplate(java.lang.String, org.apache.velocity.VelocityContext)
*/
public String processTemplate(String name, VelocityContext context) throws CompilationException {
StringWriter out = new StringWriter();
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/CompilationContext.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/CompilationContext.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/CompilationContext.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,13 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.builder;
+package org.richfaces.templatecompiler.builder;
import java.beans.PropertyDescriptor;
-import org.ajax4jsf.templatecompiler.elements.TemplateElement;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.elements.TemplateElement;
import org.w3c.dom.Node;
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/CompilationException.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/CompilationException.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/CompilationException.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.builder;
+package org.richfaces.templatecompiler.builder;
/**
* @author shura
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/StringUtils.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/StringUtils.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/StringUtils.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.builder;
+package org.richfaces.templatecompiler.builder;
/**
* String utilites.
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/TemplateCompiler.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/TemplateCompiler.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/TemplateCompiler.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.builder;
+package org.richfaces.templatecompiler.builder;
import java.io.IOException;
import java.io.InputStream;
@@ -29,7 +29,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.ajax4jsf.templatecompiler.elements.TemplateElement;
+import org.richfaces.templatecompiler.elements.TemplateElement;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/Variable.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/Variable.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/builder/Variable.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.builder;
+package org.richfaces.templatecompiler.builder;
/**
* Interface for local and global variable references in EL expressions.
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/CompiledEL.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/CompiledEL.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/CompiledEL.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.el;
+package org.richfaces.templatecompiler.el;
import java.util.ArrayList;
import java.util.Iterator;
@@ -59,7 +59,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.templatecompiler.el.ICompiledEL#getJavaCode()
+ * @see org.richfaces.templatecompiler.el.ICompiledEL#getJavaCode()
*/
public String getJavaCode() {
int i = 0;
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ELCompiler.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELCompiler.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ELCompiler.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,717 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.el;
-
-import java.beans.PropertyDescriptor;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.el.PropertyNotFoundException;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import com.sun.el.parser.ArithmeticNode;
-import com.sun.el.parser.AstAnd;
-import com.sun.el.parser.AstBracketSuffix;
-import com.sun.el.parser.AstChoice;
-import com.sun.el.parser.AstDeferredExpression;
-import com.sun.el.parser.AstDiv;
-import com.sun.el.parser.AstDotSuffix;
-import com.sun.el.parser.AstEmpty;
-import com.sun.el.parser.AstEqual;
-import com.sun.el.parser.AstFalse;
-import com.sun.el.parser.AstFunction;
-import com.sun.el.parser.AstGreaterThan;
-import com.sun.el.parser.AstGreaterThanEqual;
-import com.sun.el.parser.AstIdentifier;
-import com.sun.el.parser.AstInteger;
-import com.sun.el.parser.AstLessThan;
-import com.sun.el.parser.AstLessThanEqual;
-import com.sun.el.parser.AstLiteralExpression;
-import com.sun.el.parser.AstMinus;
-import com.sun.el.parser.AstMod;
-import com.sun.el.parser.AstMult;
-import com.sun.el.parser.AstNot;
-import com.sun.el.parser.AstNotEqual;
-import com.sun.el.parser.AstOr;
-import com.sun.el.parser.AstPlus;
-import com.sun.el.parser.AstString;
-import com.sun.el.parser.AstTrue;
-import com.sun.el.parser.AstValue;
-import com.sun.el.parser.BooleanNode;
-import com.sun.el.parser.ELParser;
-import com.sun.el.parser.Node;
-
-/**
- * Compiler EL-expressions.
- *
- * @author ayukhovich(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.2 $ $Date: 2007/02/21 17:17:12 $
- *
- */
-public class ELCompiler implements IELCompiler {
-
- private static final Log log = LogFactory.getLog(ELCompiler.class);
-
- Map<String, String> functionsMap = new HashMap<String,String>();
-
- static {
- }
-
- /**
- *
- */
- public ELCompiler() {
- super();
- resetVariables();
- }
-
- /**
- *
- */
- public void resetVariables() {
- // maps.put("context", "javax.faces.context.FacesContext" );
- // maps.put("component", "javax.faces.component.UIComponent" );
- // maps.put("a4jSkin", "org.ajax4jsf.framework.skin.Skin" );
-
- this.functionsMap.put("a4jSkin:getParameter",
- "org.ajax4jsf.framework.skin.getParameter");
- }
-
- public String compileEL(String expression, CompilationContext componentBean) {
- Node node = ELParser.parse(expression);
- StringBuffer sbMain = new StringBuffer();
- processNode(node, sbMain, componentBean);
- return sbMain.toString();
- }
-
- /**
- * Processing node
- *
- * @param node
- * @param sbMain
- * @param componentBean
- */
- private void processNode(Node node, StringBuffer sbMain,
- CompilationContext componentBean) {
- int numChildren = node.jjtGetNumChildren();
-
- boolean bNeedConversion = false;
- for (int i = 0; i < numChildren; i++) {
- Node childNode = node.jjtGetChild(i);
- if (childNode instanceof AstLiteralExpression) {
- bNeedConversion = true;
- break;
- }
- }
-
- for (int i = 0; i < numChildren; i++) {
- Node childNode = node.jjtGetChild(i);
-
- if (childNode instanceof AstLiteralExpression) {
- if (childNode.getImage() != null) {
- if (i > 0) {
- sbMain.append(" + ");
- }
- sbMain.append("\"");
- sbMain.append(StringUtils.getEscapedString(childNode
- .getImage()));
- sbMain.append("\"");
-
- if (i < (numChildren - 1)) {
- sbMain.append(" + ");
- }
- }
- } else {
- if (bNeedConversion) {
- sbMain.append("convertToString(");
- }
- boolean processing = processingNode(childNode, sbMain,
- componentBean);
- if (!processing) {
- processNode(childNode, sbMain, componentBean);
- }
- if (bNeedConversion) {
- sbMain.append(")");
- }
- }
-
- }
- }
-
- /**
- *
- * @param node
- * @param sbMain
- * @param componentBean
- * @param cMain
- * @return
- */
- public boolean processingNode(Node node, StringBuffer sbMain,
- CompilationContext componentBean) {
- boolean returnValue = false;
- if (node instanceof ArithmeticNode) {
- returnValue = processingArithmeticNode((ArithmeticNode) node,
- sbMain, componentBean);
- } else if (node instanceof AstIdentifier) {
- returnValue = processingIdentifier((AstIdentifier) node, sbMain,
- componentBean);
- } else if (node instanceof AstValue) {
- returnValue = processingValue((AstValue) node, sbMain,
- componentBean);
- } else if (node instanceof AstInteger) {
- returnValue = processingInteger((AstInteger) node, sbMain);
- } else if (node instanceof AstString) {
- returnValue = processingString((AstString) node, sbMain);
- } else if (node instanceof AstFunction) {
- returnValue = processingFunction((AstFunction) node, sbMain,
- componentBean);
- } else if (node instanceof AstDeferredExpression) {
-
- } else if (node instanceof BooleanNode) {
- returnValue = processingBooleanNode((BooleanNode) node,
- sbMain, componentBean);
- } else if (node instanceof AstNot) {
- returnValue = processingNot((AstNot) node,
- sbMain, componentBean);
- } else if (node instanceof AstChoice) {
- returnValue = processingChoice((AstChoice) node,
- sbMain, componentBean);
- } else if (node instanceof AstEmpty) {
- returnValue = processingEmpty((AstEmpty) node,
- sbMain, componentBean);
- } else {
- StringBuffer sb = new StringBuffer();
- sb.append(node.toString());
- sb.append(" (");
- sb.append(node.getClass().getName());
- sb.append(")");
- log.debug(sb.toString());
- }
-
- return returnValue;
- }
-
- /**
- * Processing 'empty' node
- *
- * @param node
- * @param sb
- * @param cMain
- * @return
- */
- private boolean processingEmpty(AstEmpty node, StringBuffer sbMain,
- CompilationContext componentBean) {
- boolean returnValue = false;
- StringBuffer sb1 = new StringBuffer();
-
- Node node1 = node.jjtGetChild(0);
-
- if (null != node1) {
- if (!(returnValue = processingNode(node1, sb1,
- componentBean))) {
- log.error("Error processing node1: "
- + node1.getImage());
- }
- }
-
- if (returnValue) {
- sbMain.append(" isEmpty( ");
- sbMain.append(sb1);
- sbMain.append(" ) ");
- }
-
- return returnValue;
- }
-
- /**
- * Processing 'choice' node
- *
- * @param node
- * @param sb
- * @param cMain
- * @return
- */
- private boolean processingChoice(AstChoice node, StringBuffer sbMain,
- CompilationContext componentBean) {
- boolean returnValue = true;
-
- StringBuffer sb1 = new StringBuffer();
- StringBuffer sb2 = new StringBuffer();
- StringBuffer sb3 = new StringBuffer();
-
- Node node1 = node.jjtGetChild(0);
-
- if (node1 != null) {
- if (!(returnValue &= processingNode(node1, sb1,
- componentBean))) {
- log.error("Error processing node1: "
- + node1.getImage());
- }
- }
-
- Node node2 = node.jjtGetChild(1);
-
- if (null != node2) {
- if (!(returnValue &= processingNode(node2, sb2,
- componentBean))) {
- log.error("Error processing node2: "
- + node2.getImage());
- }
- }
-
- Node node3 = node.jjtGetChild(2);
-
- if (null != node3) {
- if (!(returnValue &= processingNode(node3, sb3,
- componentBean))) {
- log.error("Error processing node3: "
- + node3.getImage());
- }
- }
-
- if (returnValue) {
- sbMain.append(" ( ");
- sbMain.append(sb1);
- sbMain.append(" ? ");
- sbMain.append(sb2);
- sbMain.append(" : ");
- sbMain.append(sb3);
- sbMain.append(" ) ");
- }
-
- return returnValue;
- }
-
- /**
- * Processing node containing 'not' expression
- *
- * @param node
- * @param sb
- * @param cMain
- * @return
- */
- private boolean processingNot(AstNot node, StringBuffer sbMain,
- CompilationContext componentBean) {
- boolean returnValue = false;
- StringBuffer sb1 = new StringBuffer();
-
- Node node1 = node.jjtGetChild(0);
-
- if (null != node1) {
- if (!(returnValue = processingNode(node1, sb1,
- componentBean))) {
- log.error("Error processing node1: "
- + node1.getImage());
- }
- }
-
- if (returnValue) {
- sbMain.append(" ( ! ");
- sbMain.append(sb1);
- sbMain.append(" ) ");
- }
-
- return returnValue;
- }
-
- /**
- * Processing boolean node
- *
- * @param node
- * @param sb
- * @param cMain
- * @return
- */
- private boolean processingBooleanNode(BooleanNode node,
- StringBuffer sb, CompilationContext componentBean) {
- boolean returnValue = true;
-
- StringBuffer sb1 = new StringBuffer();
- StringBuffer sb2 = new StringBuffer();
-
- if (node instanceof AstFalse) {
- sb.append(" false ");
- return returnValue;
- }
- if (node instanceof AstTrue) {
- sb.append(" true ");
- return returnValue;
- }
-
- Node node1 = node.jjtGetChild(0);
-
- if (node1 != null) {
- if (!(returnValue &= processingNode(node1, sb1,
- componentBean))) {
- log.error("Error processing node1: "
- + node1.getImage());
- }
- }
-
- Node node2 = node.jjtGetChild(1);
-
- if (null != node2) {
- if (!(returnValue &= processingNode(node2, sb2,
- componentBean))) {
- log.error("Error processing node2: "
- + node2.getImage());
- }
- }
-
- if (returnValue) {
- sb.append(" ( ");
- sb.append(sb1);
-
- if (node instanceof AstAnd) {
- sb.append(" && ");
- } else if (node instanceof AstEqual) {
- sb.append(" == ");
- } else if (node instanceof AstGreaterThan) {
- sb.append(" > ");
- } else if (node instanceof AstGreaterThanEqual) {
- sb.append(" >= ");
- } else if (node instanceof AstLessThan) {
- sb.append(" < ");
- } else if (node instanceof AstLessThanEqual) {
- sb.append(" <= ");
- } else if (node instanceof AstNotEqual) {
- sb.append(" != ");
- } else if (node instanceof AstOr) {
- sb.append(" || ");
- }
- sb.append(sb2);
- sb.append(" ) ");
- }
-
- return returnValue;
- }
-
-
- /**
- * Processing arithmetic node
- *
- * @param node
- * @param sb
- * @param cMain
- * @return
- */
- private boolean processingArithmeticNode(ArithmeticNode node,
- StringBuffer sb, CompilationContext componentBean) {
- StringBuffer sb1 = new StringBuffer();
- StringBuffer sb2 = new StringBuffer();
-
- boolean returnValue = true;
-
- Node node1 = node.jjtGetChild(0);
-
- if (node1 != null) {
- if (!(returnValue &= processingNode(node1, sb1,
- componentBean))) {
- log.error("Error processing node1: "
- + node1.getImage());
- }
- }
-
- Node node2 = node.jjtGetChild(1);
-
- if (null != node2) {
- if (!(returnValue &= processingNode(node2, sb2,
- componentBean))) {
- log.error("Error processing node2: "
- + node2.getImage());
- }
- }
-
- if (returnValue) {
- sb.append(" ( ");
- sb.append(sb1);
-
- if (node instanceof AstDiv) {
- sb.append(" / ");
- } else if (node instanceof AstMult) {
- sb.append(" * ");
- } else if (node instanceof AstMod) {
- sb.append(" % ");
- } else if (node instanceof AstPlus) {
- sb.append(" + ");
- } else if (node instanceof AstMinus) {
- sb.append(" - ");
- }
-
- sb.append(sb2);
- sb.append(" ) ");
- }
- return returnValue;
- }
-
- /**
- * Processing node contain integer
- *
- * @param node
- * @param sb
- * @return
- */
- private boolean processingInteger(AstInteger node, StringBuffer sb) {
- sb.append(node.getImage());
- return true;
- }
-
- /**
- * Processing node contain string
- *
- * @param node
- * @param sb
- * @return
- */
- private boolean processingString(AstString node, StringBuffer sb) {
- sb.append("\"");
- sb.append(node.getString());
- sb.append("\"");
- return true;
- }
-
- /**
- *
- * @param node
- * @param sb
- * @return
- */
- private boolean processingFunction(AstFunction node, StringBuffer sb,
- CompilationContext componentBean) {
-
- log.debug("Processing function : " + node.getPrefix());
- log.debug("Processing function : " + node.getLocalName());
- log.debug("Processing function : " + node.getOutputName());
-
- if (node.getPrefix().equals("this")) {
- sb.append(node.getLocalName());
- sb.append("(");
- int numChildren = node.jjtGetNumChildren();
- for (int i = 0; i < numChildren; i++) {
- Node childNode = node.jjtGetChild(i);
- StringBuffer buf = new StringBuffer();
- processingNode(childNode, buf, componentBean);
- if (i != 0) {
- sb.append(",");
- }
- sb.append(buf);
- }
- sb.append(")");
- } else {
- String functionName = node.getOutputName();
- if (this.functionsMap.containsKey(functionName)) {
- sb.append(this.functionsMap.get(functionName));
- sb.append("(");
- int numChildren = node.jjtGetNumChildren();
- for (int i = 0; i < numChildren; i++) {
- Node childNode = node.jjtGetChild(i);
- StringBuffer buf = new StringBuffer();
- processingNode(childNode, buf, componentBean);
- if (i != 0) {
- sb.append(",");
- }
- sb.append(buf);
- }
- sb.append(")");
- } // if
- } // else
- return true;
- }
-
- /**
- *
- * @param node
- * @param sb
- * @return
- */
- private boolean processingIdentifier(AstIdentifier node, StringBuffer sb,
- CompilationContext componentBean) {
- String variableName = node.getImage();
- if (componentBean.containsVariable(variableName)) {
- sb.append(variableName);
- } else {
- sb.append("variables.getVariable(\"");
- sb.append(variableName);
- sb.append("\")");
- }
-
- return true;
- }
-
- /**
- *
- * @param basketSuffix
- * @return
- */
- private String processingBracketSuffix(AstBracketSuffix basketSuffix,
- CompilationContext componentBean) {
- StringBuffer sb = new StringBuffer();
- Node node = basketSuffix.jjtGetChild(0);
- if (node instanceof AstIdentifier) {
- processingIdentifier((AstIdentifier) node, sb, componentBean);
- } else if (node instanceof AstInteger) {
- // sb.append("new Integer(");
- sb.append(node.getImage());
- // sb.append(")");
- } else if (node instanceof AstString) {
- AstString stringNode = (AstString) node;
- sb.append("\"");
- sb.append(stringNode.getString());
- sb.append("\"");
- } else {
- sb.append("\"");
- sb.append(node.getImage());
- sb.append("\"");
- }
- return sb.toString();
- }
-
- /**
- *
- * @param clazz
- * @param propertyName
- * @return
- */
- private PropertyDescriptor getPropertyDescriptor(Class<?> clazz,
- String propertyName, CompilationContext compilationContext) {
- return compilationContext.getPropertyDescriptor(clazz, propertyName);
- }
-
- private boolean processingValue(AstValue node, StringBuffer sb,
- CompilationContext componentBean) {
- String lastIndexValue = "null";
- String lastVariableType = null;
- List<String> names = new ArrayList<String>();
-
- for (int i = 0; i < node.jjtGetNumChildren(); i++) {
- StringBuffer sb1 = new StringBuffer();
- Node subChild = node.jjtGetChild(i);
-
- if (subChild instanceof AstIdentifier) {
- String variableName = subChild.getImage();
- if (componentBean.containsVariable(variableName)) {
- lastVariableType = componentBean.getVariableType(
- variableName).getName();
- names.add(variableName);
- } else {
- processingIdentifier((AstIdentifier) subChild, sb1,
- componentBean);
- }
- } else if (subChild instanceof AstDotSuffix) {
- String propertyName = subChild.getImage();
- log.debug("Object: " + lastVariableType
- + ", property: " + propertyName);
-
- if (lastVariableType != null) {
- try {
-
- Class<?> clazz = componentBean.loadClass(lastVariableType);
-
- PropertyDescriptor propertyDescriptor = getPropertyDescriptor(
- clazz, propertyName, componentBean);
-
- if (propertyDescriptor == null) {
- throw new PropertyNotFoundException("property: "
- + propertyName + " not found in class: "
- + lastVariableType);
- }
-
- log.debug("propertyObject: "
- + propertyDescriptor.getPropertyType()
- .getName());
- StringBuffer tmpbuf = new StringBuffer();
- tmpbuf.append(propertyDescriptor.getReadMethod()
- .getName());
- tmpbuf.append("()");
- names.add(tmpbuf.toString());
-
- lastVariableType = propertyDescriptor.getPropertyType()
- .getName();
- } catch (ClassNotFoundException e) {
- log.error(e.getLocalizedMessage(), e);
- }
-
- } else {
-
- sb1.append("getProperty(");
- sb1.append(lastIndexValue);
- sb1.append(",");
- sb1.append("\"");
- sb1.append(subChild.getImage());
- sb1.append("\")");
- }
- } else if (subChild instanceof AstBracketSuffix) {
- String bracketSuffix = processingBracketSuffix(
- (AstBracketSuffix) subChild, componentBean);
-
- if (lastVariableType != null) {
- StringBuffer tmpbuf = new StringBuffer();
- if (lastVariableType.startsWith("[L")) {
- tmpbuf.append("[");
- tmpbuf.append(bracketSuffix);
- tmpbuf.append("]");
- names.add(tmpbuf.toString());
- }
-
- if ((lastVariableType.compareTo("java.util.List") == 0)
- || (lastVariableType.compareTo("java.util.Map") == 0)) {
- tmpbuf.append("get(");
- tmpbuf.append(bracketSuffix);
- tmpbuf.append(")");
- names.add(tmpbuf.toString());
- }
- } else {
-
- sb1.append("getElelmentByIndex(");
- sb1.append(lastIndexValue);
- sb1.append(",");
- sb1.append(bracketSuffix);
- sb1.append(")");
- }
-
- }
-
- }
-
- if (names.size() != 0) {
- StringBuffer tmpbuf = new StringBuffer();
- for (String element : names) {
- if (tmpbuf.length() != 0) {
- tmpbuf.append(".");
- }
- tmpbuf.append(element);
- }
- sb.append(tmpbuf.toString());
- } else {
- sb.append(lastIndexValue);
- }
-
- return true;
- }
-
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ELCompiler.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELCompiler.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ELCompiler.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ELCompiler.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,725 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.el;
+
+import java.beans.PropertyDescriptor;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.el.PropertyNotFoundException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.StringUtils;
+
+import com.sun.el.parser.ArithmeticNode;
+import com.sun.el.parser.AstAnd;
+import com.sun.el.parser.AstBracketSuffix;
+import com.sun.el.parser.AstChoice;
+import com.sun.el.parser.AstDeferredExpression;
+import com.sun.el.parser.AstDiv;
+import com.sun.el.parser.AstDotSuffix;
+import com.sun.el.parser.AstEmpty;
+import com.sun.el.parser.AstEqual;
+import com.sun.el.parser.AstFalse;
+import com.sun.el.parser.AstFunction;
+import com.sun.el.parser.AstGreaterThan;
+import com.sun.el.parser.AstGreaterThanEqual;
+import com.sun.el.parser.AstIdentifier;
+import com.sun.el.parser.AstInteger;
+import com.sun.el.parser.AstLessThan;
+import com.sun.el.parser.AstLessThanEqual;
+import com.sun.el.parser.AstLiteralExpression;
+import com.sun.el.parser.AstMinus;
+import com.sun.el.parser.AstMod;
+import com.sun.el.parser.AstMult;
+import com.sun.el.parser.AstNot;
+import com.sun.el.parser.AstNotEqual;
+import com.sun.el.parser.AstOr;
+import com.sun.el.parser.AstPlus;
+import com.sun.el.parser.AstString;
+import com.sun.el.parser.AstTrue;
+import com.sun.el.parser.AstValue;
+import com.sun.el.parser.BooleanNode;
+import com.sun.el.parser.ELParser;
+import com.sun.el.parser.Node;
+
+/**
+ * Compiler EL-expressions.
+ *
+ * @author ayukhovich(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/02/21 17:17:12 $
+ *
+ */
+public class ELCompiler implements IELCompiler {
+
+ private static final Log log = LogFactory.getLog(ELCompiler.class);
+
+ Map<String, String> functionsMap = new HashMap<String,String>();
+
+ static {
+ }
+
+ /**
+ *
+ */
+ public ELCompiler() {
+ super();
+ resetVariables();
+ }
+
+ /**
+ *
+ */
+ public void resetVariables() {
+ // maps.put("context", "javax.faces.context.FacesContext" );
+ // maps.put("component", "javax.faces.component.UIComponent" );
+ // maps.put("a4jSkin", "org.richfaces.framework.skin.Skin" );
+
+ this.functionsMap.put("a4jSkin:getParameter",
+ "org.richfaces.framework.skin.getParameter");
+ }
+
+ public String compileEL(String expression, CompilationContext componentBean) {
+ Node node = ELParser.parse(expression);
+ StringBuffer sbMain = new StringBuffer();
+ processNode(node, sbMain, componentBean);
+ return sbMain.toString();
+ }
+
+ /**
+ * Processing node
+ *
+ * @param node
+ * @param sbMain
+ * @param componentBean
+ */
+ private void processNode(Node node, StringBuffer sbMain,
+ CompilationContext componentBean) {
+ int numChildren = node.jjtGetNumChildren();
+
+ boolean bNeedConversion = false;
+ for (int i = 0; i < numChildren; i++) {
+ Node childNode = node.jjtGetChild(i);
+ if (childNode instanceof AstLiteralExpression) {
+ bNeedConversion = true;
+ break;
+ }
+ }
+
+ for (int i = 0; i < numChildren; i++) {
+ Node childNode = node.jjtGetChild(i);
+
+ if (childNode instanceof AstLiteralExpression) {
+ if (childNode.getImage() != null) {
+ if (i > 0) {
+ sbMain.append(" + ");
+ }
+ sbMain.append("\"");
+ sbMain.append(StringUtils.getEscapedString(childNode
+ .getImage()));
+ sbMain.append("\"");
+
+ if (i < (numChildren - 1)) {
+ sbMain.append(" + ");
+ }
+ }
+ } else {
+ if (bNeedConversion) {
+ sbMain.append("convertToString(");
+ }
+ boolean processing = processingNode(childNode, sbMain,
+ componentBean);
+ if (!processing) {
+ processNode(childNode, sbMain, componentBean);
+ }
+ if (bNeedConversion) {
+ sbMain.append(")");
+ }
+ }
+
+ }
+ }
+
+ /**
+ *
+ * @param node
+ * @param sbMain
+ * @param componentBean
+ * @param cMain
+ * @return
+ */
+ public boolean processingNode(Node node, StringBuffer sbMain,
+ CompilationContext componentBean) {
+ boolean returnValue = false;
+ if (node instanceof ArithmeticNode) {
+ returnValue = processingArithmeticNode((ArithmeticNode) node,
+ sbMain, componentBean);
+ } else if (node instanceof AstIdentifier) {
+ returnValue = processingIdentifier((AstIdentifier) node, sbMain,
+ componentBean);
+ } else if (node instanceof AstValue) {
+ returnValue = processingValue((AstValue) node, sbMain,
+ componentBean);
+ } else if (node instanceof AstInteger) {
+ returnValue = processingInteger((AstInteger) node, sbMain);
+ } else if (node instanceof AstString) {
+ returnValue = processingString((AstString) node, sbMain);
+ } else if (node instanceof AstFunction) {
+ returnValue = processingFunction((AstFunction) node, sbMain,
+ componentBean);
+ } else if (node instanceof AstDeferredExpression) {
+
+ } else if (node instanceof BooleanNode) {
+ returnValue = processingBooleanNode((BooleanNode) node,
+ sbMain, componentBean);
+ } else if (node instanceof AstNot) {
+ returnValue = processingNot((AstNot) node,
+ sbMain, componentBean);
+ } else if (node instanceof AstChoice) {
+ returnValue = processingChoice((AstChoice) node,
+ sbMain, componentBean);
+ } else if (node instanceof AstEmpty) {
+ returnValue = processingEmpty((AstEmpty) node,
+ sbMain, componentBean);
+ } else {
+ StringBuffer sb = new StringBuffer();
+ sb.append(node.toString());
+ sb.append(" (");
+ sb.append(node.getClass().getName());
+ sb.append(")");
+ log.debug(sb.toString());
+ }
+
+ return returnValue;
+ }
+
+ /**
+ * Processing 'empty' node
+ *
+ * @param node
+ * @param sb
+ * @param cMain
+ * @return
+ */
+ private boolean processingEmpty(AstEmpty node, StringBuffer sbMain,
+ CompilationContext componentBean) {
+ boolean returnValue = false;
+ StringBuffer sb1 = new StringBuffer();
+
+ Node node1 = node.jjtGetChild(0);
+
+ if (null != node1) {
+ if (!(returnValue = processingNode(node1, sb1,
+ componentBean))) {
+ log.error("Error processing node1: "
+ + node1.getImage());
+ }
+ }
+
+ if (returnValue) {
+ sbMain.append(" isEmpty( ");
+ sbMain.append(sb1);
+ sbMain.append(" ) ");
+ }
+
+ return returnValue;
+ }
+
+ /**
+ * Processing 'choice' node
+ *
+ * @param node
+ * @param sb
+ * @param cMain
+ * @return
+ */
+ private boolean processingChoice(AstChoice node, StringBuffer sbMain,
+ CompilationContext componentBean) {
+ boolean returnValue = true;
+
+ StringBuffer sb1 = new StringBuffer();
+ StringBuffer sb2 = new StringBuffer();
+ StringBuffer sb3 = new StringBuffer();
+
+ Node node1 = node.jjtGetChild(0);
+
+ if (node1 != null) {
+ if (!(returnValue &= processingNode(node1, sb1,
+ componentBean))) {
+ log.error("Error processing node1: "
+ + node1.getImage());
+ }
+ }
+
+ Node node2 = node.jjtGetChild(1);
+
+ if (null != node2) {
+ if (!(returnValue &= processingNode(node2, sb2,
+ componentBean))) {
+ log.error("Error processing node2: "
+ + node2.getImage());
+ }
+ }
+
+ Node node3 = node.jjtGetChild(2);
+
+ if (null != node3) {
+ if (!(returnValue &= processingNode(node3, sb3,
+ componentBean))) {
+ log.error("Error processing node3: "
+ + node3.getImage());
+ }
+ }
+
+ if (returnValue) {
+ sbMain.append(" ( ");
+ sbMain.append(sb1);
+ sbMain.append(" ? ");
+ sbMain.append(sb2);
+ sbMain.append(" : ");
+ sbMain.append(sb3);
+ sbMain.append(" ) ");
+ }
+
+ return returnValue;
+ }
+
+ /**
+ * Processing node containing 'not' expression
+ *
+ * @param node
+ * @param sb
+ * @param cMain
+ * @return
+ */
+ private boolean processingNot(AstNot node, StringBuffer sbMain,
+ CompilationContext componentBean) {
+ boolean returnValue = false;
+ StringBuffer sb1 = new StringBuffer();
+
+ Node node1 = node.jjtGetChild(0);
+
+ if (null != node1) {
+ if (!(returnValue = processingNode(node1, sb1,
+ componentBean))) {
+ log.error("Error processing node1: "
+ + node1.getImage());
+ }
+ }
+
+ if (returnValue) {
+ sbMain.append(" ( ! ");
+ sbMain.append(sb1);
+ sbMain.append(" ) ");
+ }
+
+ return returnValue;
+ }
+
+ /**
+ * Processing boolean node
+ *
+ * @param node
+ * @param sb
+ * @param cMain
+ * @return
+ */
+ private boolean processingBooleanNode(BooleanNode node,
+ StringBuffer sb, CompilationContext componentBean) {
+ boolean returnValue = true;
+
+ StringBuffer sb1 = new StringBuffer();
+ StringBuffer sb2 = new StringBuffer();
+
+ if (node instanceof AstFalse) {
+ sb.append(" false ");
+ return returnValue;
+ }
+ if (node instanceof AstTrue) {
+ sb.append(" true ");
+ return returnValue;
+ }
+
+ Node node1 = node.jjtGetChild(0);
+
+ if (node1 != null) {
+ if (!(returnValue &= processingNode(node1, sb1,
+ componentBean))) {
+ log.error("Error processing node1: "
+ + node1.getImage());
+ }
+ }
+
+ Node node2 = node.jjtGetChild(1);
+
+ if (null != node2) {
+ if (!(returnValue &= processingNode(node2, sb2,
+ componentBean))) {
+ log.error("Error processing node2: "
+ + node2.getImage());
+ }
+ }
+
+ if (returnValue) {
+ sb.append(" ( ");
+ sb.append(sb1);
+
+ if (node instanceof AstAnd) {
+ sb.append(" && ");
+ } else if (node instanceof AstEqual) {
+ sb.append(" == ");
+ } else if (node instanceof AstGreaterThan) {
+ sb.append(" > ");
+ } else if (node instanceof AstGreaterThanEqual) {
+ sb.append(" >= ");
+ } else if (node instanceof AstLessThan) {
+ sb.append(" < ");
+ } else if (node instanceof AstLessThanEqual) {
+ sb.append(" <= ");
+ } else if (node instanceof AstNotEqual) {
+ sb.append(" != ");
+ } else if (node instanceof AstOr) {
+ sb.append(" || ");
+ }
+ sb.append(sb2);
+ sb.append(" ) ");
+ }
+
+ return returnValue;
+ }
+
+
+ /**
+ * Processing arithmetic node
+ *
+ * @param node
+ * @param sb
+ * @param cMain
+ * @return
+ */
+ private boolean processingArithmeticNode(ArithmeticNode node,
+ StringBuffer sb, CompilationContext componentBean) {
+ StringBuffer sb1 = new StringBuffer();
+ StringBuffer sb2 = new StringBuffer();
+
+ boolean returnValue = true;
+
+ Node node1 = node.jjtGetChild(0);
+
+ if (node1 != null) {
+ if (!(returnValue &= processingNode(node1, sb1,
+ componentBean))) {
+ log.error("Error processing node1: "
+ + node1.getImage());
+ }
+ }
+
+ Node node2 = node.jjtGetChild(1);
+
+ if (null != node2) {
+ if (!(returnValue &= processingNode(node2, sb2,
+ componentBean))) {
+ log.error("Error processing node2: "
+ + node2.getImage());
+ }
+ }
+
+ if (returnValue) {
+ sb.append(" ( ");
+ sb.append(sb1);
+
+ if (node instanceof AstDiv) {
+ sb.append(" / ");
+ } else if (node instanceof AstMult) {
+ sb.append(" * ");
+ } else if (node instanceof AstMod) {
+ sb.append(" % ");
+ } else if (node instanceof AstPlus) {
+ sb.append(" + ");
+ } else if (node instanceof AstMinus) {
+ sb.append(" - ");
+ }
+
+ sb.append(sb2);
+ sb.append(" ) ");
+ }
+ return returnValue;
+ }
+
+ /**
+ * Processing node contain integer
+ *
+ * @param node
+ * @param sb
+ * @return
+ */
+ private boolean processingInteger(AstInteger node, StringBuffer sb) {
+ sb.append(node.getImage());
+ return true;
+ }
+
+ /**
+ * Processing node contain string
+ *
+ * @param node
+ * @param sb
+ * @return
+ */
+ private boolean processingString(AstString node, StringBuffer sb) {
+ sb.append("\"");
+ sb.append(node.getString());
+ sb.append("\"");
+ return true;
+ }
+
+ /**
+ *
+ * @param node
+ * @param sb
+ * @return
+ */
+ private boolean processingFunction(AstFunction node, StringBuffer sb,
+ CompilationContext componentBean) {
+
+ log.debug("Processing function : " + node.getPrefix());
+ log.debug("Processing function : " + node.getLocalName());
+ log.debug("Processing function : " + node.getOutputName());
+
+ String prefix = node.getPrefix();
+ boolean isThis = prefix.equals("this");
+ boolean isUtils = prefix.equals("utils");
+
+ if (isThis || isUtils) {
+ if (isUtils) {
+ sb.append("getUtils().");
+ }
+
+ sb.append(node.getLocalName());
+ sb.append("(");
+ int numChildren = node.jjtGetNumChildren();
+ for (int i = 0; i < numChildren; i++) {
+ Node childNode = node.jjtGetChild(i);
+ StringBuffer buf = new StringBuffer();
+ processingNode(childNode, buf, componentBean);
+ if (i != 0) {
+ sb.append(",");
+ }
+ sb.append(buf);
+ }
+ sb.append(")");
+ } else {
+ String functionName = node.getOutputName();
+ if (this.functionsMap.containsKey(functionName)) {
+ sb.append(this.functionsMap.get(functionName));
+ sb.append("(");
+ int numChildren = node.jjtGetNumChildren();
+ for (int i = 0; i < numChildren; i++) {
+ Node childNode = node.jjtGetChild(i);
+ StringBuffer buf = new StringBuffer();
+ processingNode(childNode, buf, componentBean);
+ if (i != 0) {
+ sb.append(",");
+ }
+ sb.append(buf);
+ }
+ sb.append(")");
+ } // if
+ } // else
+ return true;
+ }
+
+ /**
+ *
+ * @param node
+ * @param sb
+ * @return
+ */
+ private boolean processingIdentifier(AstIdentifier node, StringBuffer sb,
+ CompilationContext componentBean) {
+ String variableName = node.getImage();
+ if (componentBean.containsVariable(variableName)) {
+ sb.append(variableName);
+ } else {
+ sb.append("variables.getVariable(\"");
+ sb.append(variableName);
+ sb.append("\")");
+ }
+
+ return true;
+ }
+
+ /**
+ *
+ * @param basketSuffix
+ * @return
+ */
+ private String processingBracketSuffix(AstBracketSuffix basketSuffix,
+ CompilationContext componentBean) {
+ StringBuffer sb = new StringBuffer();
+ Node node = basketSuffix.jjtGetChild(0);
+ if (node instanceof AstIdentifier) {
+ processingIdentifier((AstIdentifier) node, sb, componentBean);
+ } else if (node instanceof AstInteger) {
+ // sb.append("new Integer(");
+ sb.append(node.getImage());
+ // sb.append(")");
+ } else if (node instanceof AstString) {
+ AstString stringNode = (AstString) node;
+ sb.append("\"");
+ sb.append(stringNode.getString());
+ sb.append("\"");
+ } else {
+ sb.append("\"");
+ sb.append(node.getImage());
+ sb.append("\"");
+ }
+ return sb.toString();
+ }
+
+ /**
+ *
+ * @param clazz
+ * @param propertyName
+ * @return
+ */
+ private PropertyDescriptor getPropertyDescriptor(Class<?> clazz,
+ String propertyName, CompilationContext compilationContext) {
+ return compilationContext.getPropertyDescriptor(clazz, propertyName);
+ }
+
+ private boolean processingValue(AstValue node, StringBuffer sb,
+ CompilationContext componentBean) {
+ String lastIndexValue = "null";
+ String lastVariableType = null;
+ List<String> names = new ArrayList<String>();
+
+ for (int i = 0; i < node.jjtGetNumChildren(); i++) {
+ StringBuffer sb1 = new StringBuffer();
+ Node subChild = node.jjtGetChild(i);
+
+ if (subChild instanceof AstIdentifier) {
+ String variableName = subChild.getImage();
+ if (componentBean.containsVariable(variableName)) {
+ lastVariableType = componentBean.getVariableType(
+ variableName).getName();
+ names.add(variableName);
+ } else {
+ processingIdentifier((AstIdentifier) subChild, sb1,
+ componentBean);
+ }
+ } else if (subChild instanceof AstDotSuffix) {
+ String propertyName = subChild.getImage();
+ log.debug("Object: " + lastVariableType
+ + ", property: " + propertyName);
+
+ if (lastVariableType != null) {
+ try {
+
+ Class<?> clazz = componentBean.loadClass(lastVariableType);
+
+ PropertyDescriptor propertyDescriptor = getPropertyDescriptor(
+ clazz, propertyName, componentBean);
+
+ if (propertyDescriptor == null) {
+ throw new PropertyNotFoundException("property: "
+ + propertyName + " not found in class: "
+ + lastVariableType);
+ }
+
+ log.debug("propertyObject: "
+ + propertyDescriptor.getPropertyType()
+ .getName());
+ StringBuffer tmpbuf = new StringBuffer();
+ tmpbuf.append(propertyDescriptor.getReadMethod()
+ .getName());
+ tmpbuf.append("()");
+ names.add(tmpbuf.toString());
+
+ lastVariableType = propertyDescriptor.getPropertyType()
+ .getName();
+ } catch (ClassNotFoundException e) {
+ log.error(e.getLocalizedMessage(), e);
+ }
+
+ } else {
+
+ sb1.append("getProperty(");
+ sb1.append(lastIndexValue);
+ sb1.append(",");
+ sb1.append("\"");
+ sb1.append(subChild.getImage());
+ sb1.append("\")");
+ }
+ } else if (subChild instanceof AstBracketSuffix) {
+ String bracketSuffix = processingBracketSuffix(
+ (AstBracketSuffix) subChild, componentBean);
+
+ if (lastVariableType != null) {
+ StringBuffer tmpbuf = new StringBuffer();
+ if (lastVariableType.startsWith("[L")) {
+ tmpbuf.append("[");
+ tmpbuf.append(bracketSuffix);
+ tmpbuf.append("]");
+ names.add(tmpbuf.toString());
+ }
+
+ if ((lastVariableType.compareTo("java.util.List") == 0)
+ || (lastVariableType.compareTo("java.util.Map") == 0)) {
+ tmpbuf.append("get(");
+ tmpbuf.append(bracketSuffix);
+ tmpbuf.append(")");
+ names.add(tmpbuf.toString());
+ }
+ } else {
+
+ sb1.append("getElelmentByIndex(");
+ sb1.append(lastIndexValue);
+ sb1.append(",");
+ sb1.append(bracketSuffix);
+ sb1.append(")");
+ }
+
+ }
+
+ }
+
+ if (names.size() != 0) {
+ StringBuffer tmpbuf = new StringBuffer();
+ for (String element : names) {
+ if (tmpbuf.length() != 0) {
+ tmpbuf.append(".");
+ }
+ tmpbuf.append(element);
+ }
+ sb.append(tmpbuf.toString());
+ } else {
+ sb.append(lastIndexValue);
+ }
+
+ return true;
+ }
+
+}
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ELParser.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELParser.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ELParser.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,12 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.el;
+package org.richfaces.templatecompiler.el;
import java.util.Formatter;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.StringUtils;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.StringUtils;
/**
* EL-parser.
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ICompiledEL.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ICompiledEL.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/ICompiledEL.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.el;
+package org.richfaces.templatecompiler.el;
/**
* @author yukhovich
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/IELCompiler.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/IELCompiler.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/el/IELCompiler.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,9 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.el;
+package org.richfaces.templatecompiler.el;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
/**
* EL-parser.
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/A4JRendererElementsFactory.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/A4JRendererElementsFactory.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/A4JRendererElementsFactory.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/A4JRendererElementsFactory.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,175 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.elements.html.CDATAElement;
+import org.richfaces.templatecompiler.elements.html.CommentElement;
+import org.richfaces.templatecompiler.elements.html.PIElement;
+import org.richfaces.templatecompiler.elements.html.TextElement;
+import org.richfaces.templatecompiler.elements.vcp.AjaxRenderedAreaElement;
+import org.richfaces.templatecompiler.elements.vcp.HeaderScriptsElement;
+import org.richfaces.templatecompiler.elements.vcp.HeaderStylesElement;
+import org.w3c.dom.Node;
+
+/**
+ * Tag processors factory.
+ *
+ * @author ayukhovich(a)exadel.com (latest modification by $Author:
+ * maksimkaszynski $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/02/26 20:48:44 $
+ *
+ */
+public class A4JRendererElementsFactory implements ElementsFactory {
+
+ private static final Log log = LogFactory.getLog(A4JRendererElementsFactory.class);
+
+ public static final String TEMPLATES_PATH = "META-INF/templates";
+
+ public static final String TEMPLATES_TEMPLATECOMPILER_PATH = TEMPLATES_PATH+"/templatecompiler";
+
+ private final static String DEFAULT_CLASS_ELEMENT_PROCESSOR = "org.richfaces.templatecompiler.elements.html.HTMLElement";
+
+ private final static Class[] paramClasses = new Class[] { Node.class,
+ CompilationContext.class };
+
+ private final static HashMap<String, String> mapClasses = new HashMap<String, String>();
+
+ static {
+ mapClasses
+ .put("c:set",
+ "org.richfaces.templatecompiler.elements.std.SetTemplateElement");
+ mapClasses
+ .put("c:object",
+ "org.richfaces.templatecompiler.elements.std.ObjectTemplateElement");
+ mapClasses.put("c:if",
+ "org.richfaces.templatecompiler.elements.std.IFTemplateElement");
+ mapClasses
+ .put("c:forEach",
+ "org.richfaces.templatecompiler.elements.std.ForEachTemplateElement");
+ mapClasses
+ .put("f:clientid",
+ "org.richfaces.templatecompiler.elements.vcp.FClientIDTemplateElement");
+ mapClasses
+ .put("f:clientId",
+ "org.richfaces.templatecompiler.elements.vcp.FClientIDTemplateElement");
+ mapClasses.put("f:insertComponent",
+ "org.richfaces.templatecompiler.elements.vcp.InsertComponent");
+
+ mapClasses
+ .put("f:call",
+ "org.richfaces.templatecompiler.elements.vcp.FCallTemplateElement");
+ mapClasses
+ .put("f:resource",
+ "org.richfaces.templatecompiler.elements.vcp.FResourceTemplateElement");
+
+ mapClasses
+ .put("u:insertFacet",
+ "org.richfaces.templatecompiler.elements.vcp.UInsertFacetTemplateElement");
+
+ mapClasses
+ .put("vcp:body",
+ "org.richfaces.templatecompiler.elements.vcp.VcpBodyTemplateElement");
+ mapClasses.put("vcp:mock", "");
+
+ mapClasses.put("jsp:scriptlet",
+ "org.richfaces.templatecompiler.elements.jsp.Scriptlet");
+ mapClasses.put("jsp:declaration",
+ "org.richfaces.templatecompiler.elements.jsp.Declaration");
+ mapClasses.put("jsp:directive.page",
+ "org.richfaces.templatecompiler.elements.jsp.DirectivePage");
+ mapClasses.put("jsp:expression",
+ "org.richfaces.templatecompiler.elements.jsp.Expression");
+ mapClasses.put("h:styles", HeaderStylesElement.class.getName());
+ mapClasses.put("h:scripts", HeaderScriptsElement.class.getName());
+ mapClasses.put("f:template", RootElement.class.getName());
+ mapClasses.put("f:root", RootElement.class.getName());
+ mapClasses.put("jsp:root", RootElement.class.getName());
+ mapClasses.put("ajax:update", AjaxRenderedAreaElement.class.getName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.templatecompiler.elements.ElementsFactory#getProcessor(org.w3c.dom.Node, org.richfaces.templatecompiler.builder.CompilationContext)
+ */
+ public TemplateElement getProcessor(final Node nodeElement,
+ final CompilationContext componentBean) throws CompilationException {
+ TemplateElement returnValue = null;
+
+ short nodeType = nodeElement.getNodeType();
+ if (Node.CDATA_SECTION_NODE == nodeType) {
+ returnValue =new CDATAElement(nodeElement, componentBean);
+ } else if (Node.TEXT_NODE == nodeType) {
+ returnValue =new TextElement(nodeElement, componentBean);
+ } else if (Node.COMMENT_NODE == nodeType) {
+ returnValue =new CommentElement(nodeElement, componentBean);
+ } else if (Node.PROCESSING_INSTRUCTION_NODE == nodeType) {
+ returnValue =new PIElement(nodeElement, componentBean);
+ } else if (Node.ELEMENT_NODE == nodeType) {
+ String className = (String) mapClasses.get(nodeElement.getNodeName());
+
+ if (className == null) {
+ className = DEFAULT_CLASS_ELEMENT_PROCESSOR;
+ }
+
+ if (!className.equals("")) {
+ Class class1;
+ try {
+ log.debug("loading class: " + className);
+
+ class1 = Class.forName(className);
+ Object[] objects = new Object[2];
+ objects[0] = nodeElement;
+ objects[1] = componentBean;
+
+ returnValue = (TemplateElement) class1.getConstructor(
+ paramClasses).newInstance(objects);
+ } catch (InstantiationException e) {
+ throw new CompilationException("InstantiationException: "
+ + e.getLocalizedMessage(), e);
+ } catch (IllegalAccessException e) {
+ throw new CompilationException("IllegalAccessException: "
+ + e.getLocalizedMessage(), e);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ throw new CompilationException("InvocationTargetException: "
+ + e.getMessage(), e);
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ throw new CompilationException(" error loading class: "
+ + e.getLocalizedMessage());
+ }
+ }
+ }
+ return returnValue;
+ }
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/Attribute.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/Attribute.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/Attribute.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/Attribute.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,40 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements;
+
+/**
+ * Interface for HTLM-attributes.
+ *
+ * @author ayukhovich(a)exadel.com (latest modification by $Author:
+ * alexeyyukhovich $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/02/26 20:48:44 $
+ *
+ */
+public interface Attribute {
+ public void copyValues(final Attribute src);
+
+ public String getName();
+
+ public String getValue();
+
+ public String getCode();
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/BodyElement.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/BodyElement.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/BodyElement.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/BodyElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,31 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements;
+
+/**
+ * Marker interface for central body element ( for renderer, contain encodeChildren method content )
+ * @author shura
+ *
+ */
+public interface BodyElement {
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/DeclarationElement.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/DeclarationElement.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/DeclarationElement.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/DeclarationElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,32 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements;
+
+/**
+ * Marker interdace for {@link TemplateElement} processed as declaration, outside
+ * of encode... methods
+ * @author shura
+ *
+ */
+public interface DeclarationElement {
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/ElementsArray.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/ElementsArray.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/ElementsArray.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/ElementsArray.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,55 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.richfaces.templatecompiler.builder.CompilationException;
+
+/**
+ * @author ayukhovich(a)exadel.com (latest modification by $Author:
+ * alexeyyukhovich $)
+ * @version $Revision: 1.1.2.3 $ $Date: 2007/02/26 20:48:45 $
+ *
+ */
+class ElementsArray extends ArrayList<TemplateElement> {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public String toCode() throws CompilationException {
+ StringBuffer buf = new StringBuffer();
+
+ Iterator<TemplateElement> i = iterator();
+ boolean hasNext = i.hasNext();
+ while (hasNext) {
+ TemplateElement o = i.next();
+ if (o != null) {
+ buf.append(o.toCode());
+ }
+ hasNext = i.hasNext();
+ } // while
+ return buf.toString();
+ }
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/ElementsFactory.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/ElementsFactory.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/ElementsFactory.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/ElementsFactory.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,37 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements;
+
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.w3c.dom.Node;
+
+/**
+ * @author shura
+ *
+ */
+public interface ElementsFactory {
+
+ public abstract TemplateElement getProcessor(final Node nodeElement,
+ final CompilationContext componentBean) throws CompilationException;
+
+}
\ No newline at end of file
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/JSTLElementsFactory.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/JSTLElementsFactory.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/JSTLElementsFactory.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/JSTLElementsFactory.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,43 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements;
+
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.w3c.dom.Node;
+
+/**
+ * @author shura
+ *
+ */
+public class JSTLElementsFactory implements ElementsFactory {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.templatecompiler.elements.ElementsFactory#getProcessor(org.w3c.dom.Node, org.richfaces.templatecompiler.builder.CompilationContext)
+ */
+ public TemplateElement getProcessor(Node nodeElement,
+ CompilationContext componentBean) throws CompilationException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/RootElement.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/RootElement.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/RootElement.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/RootElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,196 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements;
+
+import java.util.Iterator;
+import java.util.ListIterator;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.elements.vcp.VcpBodyTemplateElement;
+import org.w3c.dom.Node;
+
+/**
+ * @author shura
+ *
+ */
+public class RootElement extends TemplateElementBase {
+
+ private static final String TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/ComponentTemplate.vm";
+ private static final String ENCODE_BEGIN_TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/EncodeBegin.vm";
+ private static final String ENCODE_END_TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/EncodeEnd.vm";
+ private static final String ENCODE_CHILDREN_TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/EncodeChildren.vm";
+
+ final private static String regexComponent = "(.*)" + VcpBodyTemplateElement.STR_VCB_BODY + "(.*)"
+ + VcpBodyTemplateElement.STR_VCB_BODY + "(.*)";
+
+ final private static Pattern patternComponent = Pattern.compile(
+ regexComponent, Pattern.UNIX_LINES + Pattern.DOTALL);
+
+ /**
+ * @param element
+ * @param componentBean
+ */
+ public RootElement(Node element, CompilationContext componentBean) {
+ super(element, componentBean);
+ // TODO apply global attributes
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getBeginElement()
+ */
+ public String getBeginElement() throws CompilationException {
+ VelocityContext context = new VelocityContext();
+ context.put("component", this.getComponentBean());
+ return this.getComponentBean().processTemplate(getTemplateName(), context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.templatecompiler.elements.TemplateElementBase#toCode()
+ */
+ public String toCode() throws CompilationException {
+ VelocityContext context = new VelocityContext();
+ context.put("component", this.getComponentBean());
+ StringBuffer code = new StringBuffer();
+ String beginElement = this.getBeginElement();
+ if (null != beginElement) {
+ code.append(beginElement);
+ code.append("\n");
+ }
+ StringBuffer declarationsCode = new StringBuffer();
+ StringBuffer methodCode = new StringBuffer();
+ for (ListIterator<TemplateElement> iter = getSubElements().listIterator(); iter.hasNext();) {
+ TemplateElement element = iter.next();
+ String toCode = element.toCode();
+ if(element instanceof DeclarationElement){
+ declarationsCode.append(toCode);
+ } /*else if(element instanceof BodyElement){
+ // All collected code put to encodeBegin method.
+ if (methodCode.length()>0) {
+ context.put("body", methodCode.toString());
+ code.append(this.getComponentBean().processTemplate(
+ getEncodeBeginTemplateName(), context));
+ }
+ // If body contain any code, create encodeChildren method.
+ if (toCode.length()>0) {
+ context.put("body", toCode);
+ code.append(this.getComponentBean().processTemplate(
+ getEncodeChildrenTemplateName(), context));
+ }
+ methodCode = new StringBuffer();
+ } */
+ else {
+ methodCode.append(toCode);
+ }
+ }
+
+ if (methodCode.length()>0) {
+
+ Matcher matcher = patternComponent.matcher(methodCode);
+
+ String strEncodeBegin;
+ String strEncodeChildren;
+ String strEncodeEnd;
+
+ if (matcher.find()) {
+ strEncodeBegin = matcher.group(1);
+ // put content before body element to encodeBegin
+ if (strEncodeBegin.trim().length()>0) {
+ context.put("body", strEncodeBegin);
+ code.append(this.getComponentBean().processTemplate(
+ getEncodeBeginTemplateName(), context));
+ }
+ strEncodeChildren = matcher.group(2);
+ if (strEncodeChildren.trim().length()>0 ) {
+ // put content of body element
+ context.put("body", strEncodeChildren);
+ code.append(this.getComponentBean().processTemplate(
+ getEncodeChildrenTemplateName(), context));
+ }
+
+ strEncodeEnd = matcher.group(3);
+ if(strEncodeEnd.trim().length()>0){
+ // All code after body put to encodeEnd method.
+ context.put("body", strEncodeEnd);
+ code.append(this.getComponentBean().processTemplate(
+ getEncodeEndTemplateName(), context));
+ }
+ } else {
+ // All collected code put to encodeEnd method.
+ context.put("body", methodCode.toString());
+ code.append(this.getComponentBean().processTemplate(
+ getEncodeEndTemplateName(), context));
+ }
+ }
+ if(declarationsCode.length()>0){
+ code.append(declarationsCode);
+ }
+ String endElement = this.getEndElement();
+ if (endElement != null) {
+ code.append(endElement);
+ code.append("\n");
+ }
+ return code.toString();
+ }
+
+ /**
+ * @return
+ */
+ protected String getEncodeBeginTemplateName() {
+ return ENCODE_BEGIN_TEMPLATE;
+ }
+
+ /**
+ * @return
+ */
+ protected String getEncodeEndTemplateName() {
+ return ENCODE_END_TEMPLATE;
+ }
+ /**
+ * @return
+ */
+ protected String getEncodeChildrenTemplateName() {
+ return ENCODE_CHILDREN_TEMPLATE;
+ }
+ /**
+ * @return
+ */
+ protected String getTemplateName() {
+ return TEMPLATE;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getEndElement()
+ */
+ public String getEndElement() throws CompilationException {
+ // TODO Auto-generated method stub
+ return "\n}";
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/TemplateElement.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/TemplateElement.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/TemplateElement.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/TemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,51 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements;
+
+import java.util.ArrayList;
+
+import org.richfaces.templatecompiler.builder.CompilationException;
+
+/**
+ * Intarace for tag processors.
+ *
+ * @author ayukhovich(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/02/26 20:48:43 $
+ *
+ */
+public interface TemplateElement {
+ public String getBeginElement() throws CompilationException;
+
+ public String getEndElement() throws CompilationException;
+
+ public boolean isSkipBody();
+
+ public void addSubElement(TemplateElement e);
+
+ public String toCode() throws CompilationException;
+
+ /**
+ * @return the subElements
+ */
+ public ArrayList<TemplateElement> getSubElements();
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/TemplateElementBase.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/TemplateElementBase.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/TemplateElementBase.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/TemplateElementBase.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,93 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements;
+
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.w3c.dom.Node;
+
+/**
+ * Abstract base class for tag processors.
+ *
+ * @author ayukhovich(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.3 $ $Date: 2007/02/26 20:48:44 $
+ */
+public abstract class TemplateElementBase implements TemplateElement {
+
+
+ private CompilationContext componentBean;
+
+ private ElementsArray subElements = new ElementsArray();
+
+
+ public TemplateElementBase(final Node element,
+ final CompilationContext componentBean) {
+ this.componentBean = componentBean;
+ };
+
+ public boolean isSkipBody() {
+ // by default, children process by compiler.
+ return false;
+ }
+
+ public void addSubElement(TemplateElement e) {
+ this.subElements.add(e);
+ }
+
+ public String toCode() throws CompilationException {
+ StringBuffer buf = new StringBuffer();
+
+ String beginElement = this.getBeginElement();
+ if (null != beginElement) {
+ buf.append(beginElement);
+ buf.append("\n");
+ }
+
+ if (this.subElements.size() != 0) {
+ buf.append(this.subElements.toCode());
+ }
+
+ String endElement = this.getEndElement();
+ if (endElement != null) {
+ buf.append(endElement);
+ buf.append("\n");
+ }
+
+ return buf.toString();
+ }
+
+ /**
+ * @return the componentBean
+ */
+ public CompilationContext getComponentBean() {
+ return componentBean;
+ }
+
+ /**
+ * @return the subElements
+ */
+ public ElementsArray getSubElements() {
+ return this.subElements;
+ }
+
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/CDATAElement.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/CDATAElement.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/CDATAElement.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/CDATAElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,69 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements.html;
+
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
+import org.w3c.dom.Node;
+
+/**
+ * @author shura
+ *
+ */
+public class CDATAElement extends TemplateElementBase {
+
+ private String htmlText;
+
+ public CDATAElement(Node element, CompilationContext componentBean) {
+ super(element, componentBean);
+ this.htmlText = element.getNodeValue();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getBeginElement()
+ */
+ public String getBeginElement() {
+ StringBuffer retValue = new StringBuffer();
+ if ((null != this.htmlText) && (this.htmlText.length() > 0)) {
+ retValue.append(" writer.write(\"<![CDATA[\");\n");
+ retValue.append(" writer.write(convertToString(").append(
+ ELParser.compileEL(this.htmlText, this.getComponentBean()))
+ .append("));\n");
+ retValue.append(" writer.write(\"]]>\");\n");
+ }
+ return retValue.toString();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getEndElement()
+ */
+ public String getEndElement() {
+ // Do nothitg - text not have childs
+ return null;
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/CommentElement.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/CommentElement.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/CommentElement.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/CommentElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,70 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements.html;
+
+import java.util.Formatter;
+
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
+import org.w3c.dom.Node;
+
+/**
+ * @author shura
+ *
+ */
+public class CommentElement extends TemplateElementBase {
+
+ private String htmlText;
+
+ public CommentElement(Node element, CompilationContext componentBean) {
+ super(element, componentBean);
+ this.htmlText = element.getNodeValue();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getBeginElement()
+ */
+ public String getBeginElement() {
+ String retValue = null;
+ if ((null != this.htmlText) && (this.htmlText.length() > 0)) {
+ Object[] params = { ELParser.compileEL(this.htmlText, this.getComponentBean()) };
+ retValue = new Formatter().format(
+ "writer.writeComment(convertToString(%s));\n", params)
+ .toString();
+ }
+ return retValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getEndElement()
+ */
+ public String getEndElement() {
+ // Do nothitg - text not have childs
+ return null;
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLAttributes.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLAttributes.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLAttributes.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLAttributes.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,63 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements.html;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.richfaces.templatecompiler.elements.Attribute;
+
+/**
+ * Processing HTLM-attributes.
+ *
+ * @author ayukhovich(a)exadel.com (latest modification by $Author:
+ * alexeyyukhovich $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/02/26 20:48:41 $
+ *
+ */
+public class HTMLAttributes {
+ private LinkedHashMap attributesMap = new LinkedHashMap();
+
+
+ public void addAttribute(String nameAttribute, String valueAttribute) {
+
+ Attribute attribute = HtmlAttributesFactory.getProcessor(
+ nameAttribute, valueAttribute);
+
+ if (attribute != null) {
+ Attribute oldElemet = (Attribute) this.attributesMap.get(attribute
+ .getName());
+
+ if (oldElemet != null) {
+ oldElemet.copyValues(attribute);
+ } else {
+ this.attributesMap.put(attribute.getName(), attribute);
+ }
+ } else {
+ System.out.println("attribute is null");
+ }
+ }
+
+ public Map getAttributes() {
+ return this.attributesMap;
+ }
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLElement.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLElement.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLElement.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,187 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements.html;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Formatter;
+import java.util.List;
+import java.util.TreeSet;
+
+import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * Processing template HTLM-attributes.
+ *
+ * @author ayukhovich(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.3 $ $Date: 2007/02/26 20:48:42 $
+ *
+ */
+public class HTMLElement extends TemplateElementBase {
+ final static private String PRE_TAG_NAME = "pre";
+
+ private static final String PASS_THRU_ATTR = "x:passThruWithExclusions";
+
+ private static final List<String> DEFAULT_EXCLUSIONS = Arrays.asList("class", "id");
+
+ private static final String TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH
+ + "/HTMLElement.vm";
+
+ private String htmlTag;
+
+ private String htmlText;
+
+ private HTMLAttributes htmlAttributes = new HTMLAttributes();
+
+ private Collection<String> passThruAttributes = null;
+
+ private CompilationContext componentBean;
+
+ /**
+ *
+ * @param element
+ * @param variables
+ */
+ public HTMLElement(final Node element,
+ final CompilationContext componentBean) {
+ super(element, componentBean);
+
+ this.passThruAttributes = null;
+ this.htmlTag = element.getNodeName();
+ this.componentBean = componentBean;
+ processingAttributes(element.getAttributes());
+ }
+
+ /**
+ * @return string contain
+ * @throws CompilationException
+ */
+ public String getBeginElement() throws CompilationException {
+ VelocityContext context = new VelocityContext();
+ context.put("htmlTag", this.htmlTag);
+ context.put("htmlAttributes", this.htmlAttributes.getAttributes());
+ context.put("passThruAttributes", this.passThruAttributes);
+ if (this.htmlText != null) {
+ context.put("htmlText", this.htmlText);
+ }
+ return this.componentBean.processTemplate(getTemplateName(), context);
+
+ }
+
+ /**
+ * @return
+ */
+ protected String getTemplateName() {
+ // TODO Auto-generated method stub
+ return TEMPLATE;
+ }
+
+ /**
+ * @return
+ */
+ public String getEndElement() {
+ String sReturnValue;
+
+ Object[] objects = new Object[1];
+ objects[0] = this.htmlTag;
+
+ sReturnValue = new Formatter().format("writer.endElement(\"%s\");",
+ objects).toString();
+ return sReturnValue;
+ }
+
+ /**
+ *
+ * @param attributes
+ */
+ public void processingAttributes(NamedNodeMap attributes) {
+ if (attributes == null) {
+ return;
+ }
+
+ for (int iElement = 0; iElement != attributes.getLength(); iElement++) {
+ Node attribute = attributes.item(iElement);
+ String attributeName = attribute.getNodeName();
+ String attributeValue = attribute.getNodeValue();
+
+ if (attributeName.equals(PASS_THRU_ATTR)) {
+ processingPassThruAtrribute(attributeValue);
+ } else {
+ this.htmlAttributes.addAttribute(attributeName, ELParser
+ .compileEL(attributeValue, this.componentBean));
+ }
+
+ } // for
+ }
+
+ /**
+ *
+ * @param listPassThruAttributes
+ */
+ private void processingPassThruAtrribute(String listPassThruAttributes) {
+
+ passThruAttributes =
+ new TreeSet<String>(HTMLTags.getAttributes(this.htmlTag));
+
+ String[] excludeAttributes = listPassThruAttributes.split(",");
+
+ passThruAttributes.removeAll(DEFAULT_EXCLUSIONS);
+
+ for (String attribute : excludeAttributes) {
+ passThruAttributes.remove(attribute);
+ }
+
+ }
+
+ /**
+ * Set a body text for HTML-tag
+ *
+ * @param nodeText
+ */
+ public void setText(final String nodeText) {
+ String tempStr = null;
+ // if TAG is not PRE test do not trim
+ if (nodeText.trim().length() != 0) {
+ if (this.htmlTag.compareToIgnoreCase(PRE_TAG_NAME) == 0) {
+ tempStr = nodeText;
+ } else {
+ tempStr = nodeText.trim();
+ }
+ }
+
+ if (null != tempStr) {
+ if (null == this.htmlText) {
+ this.htmlText = ELParser.compileEL(tempStr, this.componentBean);
+ } else {
+ this.htmlText = this.htmlText
+ + ELParser.compileEL(tempStr, this.componentBean);
+ }
+ }
+ }
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLTags.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HTMLTags.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLTags.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HTMLTags.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,107 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements.html;
+
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.Map.Entry;
+
+import org.richfaces.dtd.DocumentDefinition;
+import org.richfaces.dtd.DocumentDefinitionFactory;
+import org.richfaces.dtd.Element;
+
+
+/**
+ * @author yukhovich
+ * @author Maksim Kaszynski
+ */
+public class HTMLTags {
+ /**
+ *
+ */
+
+ private static final String HTML_SCHEMA = "META-INF/schema/html/xhtml1-transitional.dtd";
+
+ private static final URL HTML_DTD = HTMLTags.class.getClassLoader().getResource(HTML_SCHEMA);
+
+ @SuppressWarnings("unchecked")
+ public static Set<String> getAttributes(String tagName) {
+ Set<String> atrs = Collections.emptySet();
+
+ DocumentDefinition dtd =
+ DocumentDefinitionFactory.instance().getDocumentDefinition(HTML_DTD);
+
+ if (dtd != null) {
+ Element element = dtd.getElement(tagName);
+
+ if (element != null) {
+ atrs = element.getAttributes().keySet();
+ }
+ }
+
+ return atrs;
+
+ }
+
+ /**
+ * Look for tags.bin, and compare with it
+ * @param args
+ * @throws Exception
+ */
+ public static void main(String [] args) throws Exception{
+ InputStream stream = HTMLTags.class.getClassLoader().getResourceAsStream("META-INF/templates/templatecompiler/tags.bin");
+
+ ObjectInputStream stream2 = new ObjectInputStream(stream);
+
+ @SuppressWarnings("unchecked")
+ Map<String, List<String>> m =
+ (Map<String, List<String>>) stream2.readObject();
+
+ Set<String> newAttrs = new TreeSet<String>();
+
+ Set<Entry<String,List<String>>> entrySet = m.entrySet();
+ for (Entry<String, List<String>> entry : entrySet) {
+ String element = entry.getKey();
+
+ Set<String> attributes = HTMLTags.getAttributes(element);
+ List<String> attributeList = entry.getValue();
+
+ if (attributeList != null && attributes != null) {
+ attributes.removeAll(attributeList);
+ }
+ newAttrs.addAll(attributes);
+
+ System.out.println(element + attributes);
+
+ }
+
+ System.out.println(newAttrs);
+ }
+
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HtmlAttributesFactory.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/HtmlAttributesFactory.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HtmlAttributesFactory.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/HtmlAttributesFactory.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,93 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements.html;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+
+import org.richfaces.templatecompiler.elements.Attribute;
+
+/**
+ * Factory for processing HTLM-attributes.
+ *
+ * @author ayukhovich(a)exadel.com (latest modification by $Author:
+ * alexeyyukhovich $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/02/26 20:48:42 $
+ *
+ */
+public class HtmlAttributesFactory {
+ private final static String DEFAULT_CLASS_ATTRIBUTE_PROCESSOR = "org.richfaces.templatecompiler.elements.html.attribute.HtmlAttribute";
+
+ private final static Class[] paramClasses = new Class[] { String.class,
+ String.class };
+
+ private final static HashMap mapClasses = new HashMap();
+
+ static {
+ // mapClasses.put("x:passThruWithExclusions",
+ // "org.richfaces.templatecompiler.elements.html.attribute.PassThruWithExclusions");
+ mapClasses.put("x:otherParameters", "");
+ }
+
+ public static Attribute getProcessor(String attributeName,
+ String attributeValue) {
+ Attribute returnValue = null;
+
+ String className = (String) mapClasses.get(attributeName);
+
+ if (className == null) {
+ className = DEFAULT_CLASS_ATTRIBUTE_PROCESSOR;
+ }
+
+ if (!className.equals("")) {
+ Class class1;
+ try {
+ class1 = Class.forName(className);
+ try {
+ try {
+ Object[] objects = new Object[2];
+ objects[0] = attributeName;
+ objects[1] = attributeValue;
+ returnValue = (Attribute) class1.getConstructor(
+ paramClasses).newInstance(objects);
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ }
+ } catch (ClassNotFoundException e1) {
+ e1.printStackTrace();
+ }
+ }
+
+ return returnValue;
+ }
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/PIElement.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/PIElement.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/PIElement.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/PIElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,68 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements.html;
+
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
+import org.w3c.dom.Node;
+
+/**
+ * @author shura
+ *
+ */
+public class PIElement extends TemplateElementBase {
+
+ private String htmlText;
+
+ public PIElement(Node element, CompilationContext componentBean) {
+ super(element, componentBean);
+ this.htmlText = element.getNodeValue();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getBeginElement()
+ */
+ public String getBeginElement() {
+ StringBuffer retValue = new StringBuffer();
+ if ((null != this.htmlText) && (this.htmlText.length() > 0)) {
+ retValue.append(" writer.write(\"<![CDATA[\");\n");
+ retValue.append(" writer.write(").append(
+ ELParser.compileEL(this.htmlText, this.getComponentBean())).append(");\n");
+ retValue.append(" writer.write(\"]]>\");\n");
+ }
+ return null; // retValue.toString();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getEndElement()
+ */
+ public String getEndElement() {
+ // Do nothitg - text not have childs
+ return null;
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/TextElement.java (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/TextElement.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/TextElement.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/TextElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,70 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements.html;
+
+import java.util.Formatter;
+
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
+import org.w3c.dom.Node;
+
+/**
+ * @author shura
+ *
+ */
+public class TextElement extends TemplateElementBase {
+
+ private String htmlText;
+
+ public TextElement(Node element, CompilationContext componentBean) {
+ super(element, componentBean);
+ this.htmlText = element.getNodeValue().trim();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getBeginElement()
+ */
+ public String getBeginElement() {
+ String retValue = null;
+ if ((null != this.htmlText) && (this.htmlText.length() > 0)) {
+ Object[] params = { ELParser.compileEL(this.htmlText, this.getComponentBean()) };
+ retValue = new Formatter().format(
+ "writer.writeText(convertToString(%s),null);\n", params)
+ .toString();
+ }
+ return retValue;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getEndElement()
+ */
+ public String getEndElement() {
+ // Do nothitg - text not have childs
+ return null;
+ }
+
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/attribute (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/attribute)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/attribute/HtmlAttribute.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/attribute/HtmlAttribute.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/attribute/HtmlAttribute.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,12 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.html.attribute;
+package org.richfaces.templatecompiler.elements.html.attribute;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.ajax4jsf.templatecompiler.elements.Attribute;
+import org.richfaces.templatecompiler.elements.Attribute;
/**
* Processing template simple HTLM-attributes.
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/attribute/PassThruWithExclusions.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/html/attribute/PassThruWithExclusions.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/html/attribute/PassThruWithExclusions.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.html.attribute;
+package org.richfaces.templatecompiler.elements.html.attribute;
import java.util.Formatter;
-import org.ajax4jsf.templatecompiler.elements.Attribute;
+import org.richfaces.templatecompiler.elements.Attribute;
/**
* Processing template PassThruWithExclusions-attributes.
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/jsp)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/Declaration.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/jsp/Declaration.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/Declaration.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.jsp;
+package org.richfaces.templatecompiler.elements.jsp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.Node;
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/DirectiveInclude.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/jsp/DirectiveInclude.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/DirectiveInclude.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.jsp;
+package org.richfaces.templatecompiler.elements.jsp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.Node;
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/DirectivePage.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/jsp/DirectivePage.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/DirectivePage.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.jsp;
+package org.richfaces.templatecompiler.elements.jsp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.DOMException;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/Expression.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/jsp/Expression.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/Expression.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.jsp;
+package org.richfaces.templatecompiler.elements.jsp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.Node;
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/Scriptlet.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/jsp/Scriptlet.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/jsp/Scriptlet.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.jsp;
+package org.richfaces.templatecompiler.elements.jsp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.Node;
/**
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/std)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/ForEachTemplateElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/std/ForEachTemplateElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/ForEachTemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,14 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.std;
+package org.richfaces.templatecompiler.elements.std;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/IFTemplateElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/std/IFTemplateElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/IFTemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,14 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.std;
+package org.richfaces.templatecompiler.elements.std;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/ObjectTemplateElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/std/ObjectTemplateElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/ObjectTemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,14 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.std;
+package org.richfaces.templatecompiler.elements.std;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/SetTemplateElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/std/SetTemplateElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/std/SetTemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,14 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.std;
+package org.richfaces.templatecompiler.elements.std;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp)
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,60 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.templatecompiler.elements.vcp;
-
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
-import org.apache.velocity.VelocityContext;
-import org.w3c.dom.Node;
-
-/**
- * Add comma separated list of ids to Ajax Context's rendered areas collection.
- * @author Maksim Kaszynski
- *
- */
-public class AjaxRenderedAreaElement extends TemplateElementBase {
-
- private static final String TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/ajaxRenderedArea.vm";
-
- private String values;
-
- public AjaxRenderedAreaElement(Node element,
- CompilationContext componentBean) {
- super(element, componentBean);
- values = ELParser.compileEL(element.getTextContent(), this.getComponentBean());
- componentBean.addToImport("org.ajax4jsf.context.AjaxContext");
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getBeginElement()
- */
- public String getBeginElement() throws CompilationException {
-
- VelocityContext context = new VelocityContext();
- context.put("areas", this.values);
- return this.getComponentBean().processTemplate(getTemplateName(), context);
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getEndElement()
- */
- public String getEndElement() throws CompilationException {
-
- return null;
- }
-
- protected String getTemplateName() {
- return TEMPLATE;
- }
-
- @Override
- public boolean isSkipBody() {
- // TODO Auto-generated method stub
- return true;
- }
-
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,78 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.templatecompiler.elements.vcp;
+
+import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
+import org.w3c.dom.Node;
+
+/**
+ * Add comma separated list of ids to Ajax Context's rendered areas collection.
+ * @author Maksim Kaszynski
+ *
+ */
+public class AjaxRenderedAreaElement extends TemplateElementBase {
+
+ private static final String TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/ajaxRenderedArea.vm";
+
+ private String values;
+
+ public AjaxRenderedAreaElement(Node element,
+ CompilationContext componentBean) {
+ super(element, componentBean);
+ values = ELParser.compileEL(element.getTextContent(), this.getComponentBean());
+ componentBean.addToImport("org.richfaces.context.AjaxContext");
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getBeginElement()
+ */
+ public String getBeginElement() throws CompilationException {
+
+ VelocityContext context = new VelocityContext();
+ context.put("areas", this.values);
+ return this.getComponentBean().processTemplate(getTemplateName(), context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.templatecompiler.elements.TemplateElement#getEndElement()
+ */
+ public String getEndElement() throws CompilationException {
+
+ return null;
+ }
+
+ protected String getTemplateName() {
+ return TEMPLATE;
+ }
+
+ @Override
+ public boolean isSkipBody() {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+}
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FCallTemplateElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FCallTemplateElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FCallTemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
import java.beans.PropertyDescriptor;
import java.util.ArrayList;
@@ -27,15 +27,15 @@
import java.util.Iterator;
import java.util.List;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FClientIDTemplateElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FClientIDTemplateElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FClientIDTemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,13 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
import java.util.Formatter;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FInsertChildren.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FInsertChildren.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FInsertChildren.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,13 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FResourceTemplateElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FResourceTemplateElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/FResourceTemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,13 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/HeaderResourceElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/HeaderResourceElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/HeaderResourceElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,17 +19,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.Node;
/**
@@ -95,7 +95,7 @@
this.resourcePaths = (String[]) paths.toArray(new String[paths.size()]);
}
componentBean
- .addToImport("org.ajax4jsf.resource.InternetResource");
+ .addToImport("org.richfaces.resource.InternetResource");
componentBean.addToDeclaration(getContent());
}
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/HeaderScriptsElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/HeaderScriptsElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/HeaderScriptsElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
import org.w3c.dom.Node;
/**
@@ -43,7 +43,7 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.templatecompiler.elements.vcp.HeaderResourceElement#getPropertyName()
+ * @see org.richfaces.templatecompiler.elements.vcp.HeaderResourceElement#getPropertyName()
*/
protected String getPropertyName() {
return "scripts";
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/HeaderStylesElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/HeaderStylesElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/HeaderStylesElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
import org.w3c.dom.Node;
/**
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/InsertComponent.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/InsertComponent.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/InsertComponent.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,14 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.el.ELParser;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.el.ELParser;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/Parameter.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/Parameter.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/Parameter.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
/**
* container class for storing information about f:parameter-tags.
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/ParameterProcessor.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/ParameterProcessor.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/ParameterProcessor.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,12 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
import java.util.ArrayList;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/UInsertFacetTemplateElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/UInsertFacetTemplateElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/UInsertFacetTemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,15 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
import java.io.StringWriter;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.apache.velocity.VelocityContext;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.elements.A4JRendererElementsFactory;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/VcpBodyTemplateElement.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/VcpBodyTemplateElement.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/elements/vcp/VcpBodyTemplateElement.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,11 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.elements.vcp;
+package org.richfaces.templatecompiler.elements.vcp;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.elements.BodyElement;
-import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
+import org.richfaces.templatecompiler.builder.CompilationContext;
+import org.richfaces.templatecompiler.elements.BodyElement;
+import org.richfaces.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.Node;
/**
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/utils)
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/CallbackListener.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/utils/CallbackListener.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/CallbackListener.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,59 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.utils;
-
-/*
- * Copyright 2004-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @author Martin Marinschek
- * @version $Revision: 1.1.2.1 $ $Date: 2006/12/20 18:56:39 $ <p/> $Log:
- * CallbackListener.java,v $ Revision 1.1 2006/07/05 08:53:39
- * alexsmirnov Refactor filter system ( move different functions for
- * different classes ). Fix encoding for AJAX responses - forced to
- * UTF-8 Fix issue #5 from tracker Fix error message for xml parsing.
- *
- */
-public interface CallbackListener {
- void openedStartTag(int charIndex, int tagIdentifier);
-
- void closedStartTag(int charIndex, int tagIdentifier);
-
- void openedEndTag(int charIndex, int tagIdentifier);
-
- void closedEndTag(int charIndex, int tagIdentifier);
-
- void attribute(int charIndex, int tagIdentifier, String key, String value);
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/CallbackListener.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/utils/CallbackListener.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/CallbackListener.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/CallbackListener.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2004-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.richfaces.templatecompiler.utils;
+
+/**
+ * @author Martin Marinschek
+ * @version $Revision: 1.1.2.1 $ $Date: 2006/12/20 18:56:39 $ <p/> $Log:
+ * CallbackListener.java,v $ Revision 1.1 2006/07/05 08:53:39
+ * alexsmirnov Refactor filter system ( move different functions for
+ * different classes ). Fix encoding for AJAX responses - forced to
+ * UTF-8 Fix issue #5 from tracker Fix error message for xml parsing.
+ *
+ */
+public interface CallbackListener {
+ void openedStartTag(int charIndex, int tagIdentifier);
+
+ void closedStartTag(int charIndex, int tagIdentifier);
+
+ void openedEndTag(int charIndex, int tagIdentifier);
+
+ void closedEndTag(int charIndex, int tagIdentifier);
+
+ void attribute(int charIndex, int tagIdentifier, String key, String value);
+}
Deleted: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/ReducedHTMLParser.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/utils/ReducedHTMLParser.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/ReducedHTMLParser.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,624 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.templatecompiler.utils;
-
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * A class which detects the open/close tags in an HTML document and reports
- * them to a listener class.
- * <p>
- * This is unfortunately necessary when using JSF with JSP, as tags in the body
- * of the document can need to output commands into the document at points
- * earlier than the tag occurred (particularly into the document HEAD section).
- * This can only be implemented by buffering the response and post-processing it
- * to find the relevant HTML tags and modifying the buffer as needed.
- * <p>
- * This class tries to do the parsing as quickly as possible; many of the
- * details of HTML are not relevant for the purposes this class is used for.
- *
- * @version $Revision: 1.1.2.1 $ $Date: 2006/12/20 18:56:39 $
- */
-public class ReducedHTMLParser {
- // IMPLEMENTATION NOTE:
- //
- // Many of the methods on this class are package-scope. This is intended
- // solely for the purpose of unit-testing. This class does not expect
- // other classes in this package to access its methods.
-
- private static final Log log = LogFactory.getLog(ReducedHTMLParser.class);
-
- public static final int BODY_TAG = 0;
-
- public static final int HEAD_TAG = 1;
-
- public static final int SCRIPT_TAG = 2;
-
- private static final int STATE_READY = 0;
-
- private static final int STATE_IN_COMMENT = 1;
-
- private static final int STATE_IN_TAG = 2;
-
- private static final int STATE_IN_MARKED_SECTION = 3;
-
- private static final int STATE_EXPECTING_ETAGO = 4;
-
- private int _offset;
-
- private int _lineNumber;
-
- private CharSequence _seq;
-
- private CallbackListener _listener;
-
- public static void parse(CharSequence seq, CallbackListener l) {
- new ReducedHTMLParser(seq, l).parse();
- }
-
- /**
- * Constructor, package-scope for unit testing.
- *
- * @param s
- * is the sequence of chars to parse.
- * @param l
- * is the listener to invoke callbacks on.
- */
- ReducedHTMLParser(CharSequence s, CallbackListener l) {
- this._seq = s;
- this._listener = l;
- }
-
- /**
- * Return true if there are no more characters to parse.
- */
- boolean isFinished() {
- return this._offset >= this._seq.length();
- }
-
- int getCurrentLineNumber() {
- return this._lineNumber;
- }
-
- /**
- * Advance the current parse position over any whitespace characters.
- */
- void consumeWhitespace() {
- boolean crSeen = false;
-
- while (this._offset < this._seq.length()) {
- char c = this._seq.charAt(this._offset);
- if (!Character.isWhitespace(c)) {
- break;
- }
-
- // Track line number for error messages.
- if (c == '\r') {
- ++this._lineNumber;
- crSeen = true;
- } else if ((c == '\n') && !crSeen) {
- ++this._lineNumber;
- } else {
- crSeen = false;
- }
-
- ++this._offset;
- }
- }
-
- /**
- * Eat up a sequence of non-whitespace characters and return them.
- */
- String consumeNonWhitespace() {
- int wordStart = this._offset;
- while (this._offset < this._seq.length()) {
- char c = this._seq.charAt(this._offset);
- if (Character.isWhitespace(c)) {
- break;
- }
- ++this._offset;
- }
- if (wordStart == this._offset) {
- return null;
- } else {
- return this._seq.subSequence(wordStart, this._offset).toString();
- }
- }
-
- /**
- * If the next chars in the input sequence exactly match the specified
- * string then skip over them and return true.
- * <p>
- * If there is not a match then leave the current parse position unchanged
- * and return false.
- *
- * @param s
- * is the exact string to match.
- * @return true if the input contains exactly the param s
- */
- boolean consumeMatch(String s) {
- if (this._offset + s.length() > this._seq.length()) {
- // seq isn't long enough to contain the specified string
- return false;
- }
-
- int i = 0;
- while (i < s.length()) {
- if (this._seq.charAt(this._offset + i) == s.charAt(i)) {
- ++i;
- } else {
- return false;
- }
- }
-
- this._offset += i;
- return true;
- }
-
- /**
- * Eat up a sequence of chars which form a valid XML element name.
- * <p>
- * TODO: implement this properly in compliance with spec
- */
- String consumeElementName() {
- consumeWhitespace();
- int nameStart = this._offset;
- while (!isFinished()) {
- boolean ok = false;
- char c = this._seq.charAt(this._offset);
- if (Character.isLetterOrDigit(this._seq.charAt(this._offset))) {
- ok = true;
- } else if (c == '_') {
- ok = true;
- } else if (c == '-') {
- ok = true;
- } else if (c == ':') {
- ok = true;
- }
-
- if (!ok) {
- break;
- }
-
- ++this._offset;
- }
-
- if (nameStart == this._offset) {
- return null;
- } else {
- return this._seq.subSequence(nameStart, this._offset).toString();
- }
- }
-
- /**
- * Eat up a sequence of chars which form a valid XML attribute name.
- * <p>
- * TODO: implement this properly in compliance with spec
- */
- String consumeAttrName() {
- // for now, assume elements and attributes have same rules
- return consumeElementName();
- }
-
- /**
- * Eat up a string which is terminated with the specified quote character.
- * This means handling escaped quote chars within the string.
- * <p>
- * This method assumes that the leading quote has already been consumed.
- */
- String consumeString(char quote) {
- // TODO: should we consider a string to be terminated by a newline?
- // that would help with runaway strings but I think that multiline
- // strings *are* allowed...
- //
- // TODO: detect newlines within strings and increment lineNumber.
- // This isn't so important, though; they aren't common and being a
- // few lines out in an error message isn't serious either.
- StringBuffer stringBuf = new StringBuffer();
- boolean escaping = false;
- while (!isFinished()) {
- char c = this._seq.charAt(this._offset);
- ++this._offset;
- if (c == quote) {
- if (!escaping) {
- break;
- } else {
- stringBuf.append(c);
- escaping = false;
- }
- } else if (c == '\\') {
- if (escaping) {
- // append a real backslash
- stringBuf.append(c);
- escaping = false;
- } else {
- escaping = true;
- }
- } else {
- stringBuf.append(c);
- }
- }
- return stringBuf.toString();
- }
-
- /**
- * Assuming we have already encountered "attrname=", consume the value part
- * of the attribute definition. Note that unlike XML, HTML doesn't have to
- * quote its attribute values.
- *
- * @return the attribute value. If the attr-value was quoted, the returned
- * value will not include the quote chars.
- */
- String consumeAttrValue() {
- consumeWhitespace();
- if (consumeMatch("'")) {
- return consumeString('\'');
- } else if (consumeMatch("\"")) {
- return consumeString('"');
- } else {
- return consumeNonWhitespace();
- }
- }
-
- /**
- * Discard all characters in the input until one in the specified string
- * (character-set) is found.
- *
- * @param s
- * is a set of characters that should not be discarded.
- */
- void consumeExcept(String s) {
- boolean crSeen = false;
-
- while (this._offset < this._seq.length()) {
- char c = this._seq.charAt(this._offset);
- if (s.indexOf(c) >= 0) {
- // char is in the exception set
- return;
- }
-
- // Track line number for error messages.
- if (c == '\r') {
- ++this._lineNumber;
- crSeen = true;
- } else if ((c == '\n') && !crSeen) {
- ++this._lineNumber;
- } else {
- crSeen = false;
- }
-
- // Track line number for error messages.
- if (c == '\r') {
- ++this._lineNumber;
- crSeen = true;
- } else if ((c == '\n') && !crSeen) {
- ++this._lineNumber;
- } else {
- crSeen = false;
- }
-
- ++this._offset;
- }
- }
-
- /**
- * Process the entire input buffer, invoking callbacks on the listener
- * object as appropriate.
- */
- void parse() {
- int state = STATE_READY;
-
- int currentTagStart = -1;
- String currentTagName = null;
-
- this._lineNumber = 1;
- this._offset = 0;
- int lastOffset = this._offset - 1;
- while (this._offset < this._seq.length()) {
- // Sanity check; each pass through this loop must increase the
- // offset.
- // Failure to do this means a hang situation has occurred.
- if (this._offset <= lastOffset) {
- // throw new RuntimeException("Infinite loop detected in
- // ReducedHTMLParser");
- log
- .error("Infinite loop detected in ReducedHTMLParser; parsing skipped");
- // return;
- }
- lastOffset = this._offset;
-
- if (state == STATE_READY) {
- // in this state, nothing but "<" has any significance
- consumeExcept("<");
- if (isFinished()) {
- break;
- }
-
- if (consumeMatch("<!--")) {
- // Note that whitespace is *not* permitted in <!--
- state = STATE_IN_COMMENT;
- } else if (consumeMatch("<![")) {
- // Start of a "marked section", eg "<![CDATA" or
- // "<![INCLUDE" or "<![IGNORE". These always terminate
- // with "]]>"
- log.debug("Marked section found at line "
- + getCurrentLineNumber());
- state = STATE_IN_MARKED_SECTION;
- } else if (consumeMatch("<!DOCTYPE")) {
- log
- .debug("DOCTYPE found at line "
- + getCurrentLineNumber());
- // we don't need to actually do anything here; the
- // tag can't contain a bare "<", so the first "<"
- // indicates the start of the next real tag.
- //
- // TODO: Handle case where the DOCTYPE includes an internal
- // DTD. In
- // that case there *will* be embedded < chars in the
- // document. However
- // that's very unlikely to be used in a JSF page, so this is
- // pretty low
- // priority.
- } else if (consumeMatch("<?")) {
- // xml processing instruction or <!DOCTYPE> tag
- // we don't need to actually do anything here; the
- // tag can't contain a bare "<", so the first "<"
- // indicates the start of the next real tag.
- log.debug("PI found at line " + getCurrentLineNumber());
- } else if (consumeMatch("</")) {
- if (!processEndTag()) {
- // message already logged
- return;
- }
-
- // stay in state READY
- state = STATE_READY;
- } else if (consumeMatch("<")) {
- // We can't tell the user that the tag has closed until
- // after we have
- // processed any attributes and found the real end of the
- // tag. So save
- // the current info until the end of this tag.
- currentTagStart = this._offset - 1;
- currentTagName = consumeElementName();
- if (currentTagName == null) {
- log
- .warn("Invalid HTML; bare lessthan sign found at line "
- + getCurrentLineNumber());
- // remain in STATE_READY; this isn't really the start of
- // an xml element.
- } else {
- state = STATE_IN_TAG;
- }
- } else {
- // should never get here
- throw new Error("Internal error at line "
- + getCurrentLineNumber());
- }
-
- continue;
- }
-
- if (state == STATE_IN_COMMENT) {
- // TODO: handle "-- >", which is a valid way to close a
- // comment according to the specs.
-
- // in this state, nothing but "--" has any significance
- consumeExcept("-");
- if (isFinished()) {
- break;
- }
-
- if (consumeMatch("-->")) {
- state = STATE_READY;
- } else {
- // false call; hyphen is not end of comment
- consumeMatch("-");
- }
-
- continue;
- }
-
- if (state == STATE_IN_TAG) {
- consumeWhitespace();
-
- if (consumeMatch("/>")) {
- // ok, end of element
- state = STATE_READY;
- closedTag(currentTagStart, this._offset, currentTagName);
-
- // and reset vars just in case...
- currentTagStart = -1;
- currentTagName = null;
- } else if (consumeMatch(">")) {
- if (currentTagName.equalsIgnoreCase("script")
- || currentTagName.equalsIgnoreCase("style")) {
- // We've just started a special tag which can contain
- // anything except
- // the ETAGO marker ("</"). See
- // http://www.w3.org/TR/REC-html40/appendix/notes.html#notes-specifying-data
- state = STATE_EXPECTING_ETAGO;
- } else {
- state = STATE_READY;
- }
-
- // end of open tag, but not end of element
- openedTag(currentTagStart, this._offset, currentTagName);
-
- // and reset vars just in case...
- currentTagStart = -1;
- currentTagName = null;
- } else {
- // xml attribute
- String attrName = consumeAttrName();
- if (attrName == null) {
- // Oops, we found something quite unexpected in this
- // tag.
- // The best we can do is probably to drop back to
- // looking
- // for "/>", though that does risk us misinterpreting
- // the
- // contents of an attribute's associated string value.
- log
- .warn("Invalid tag found: unexpected input while looking for attr name or '/>'"
- + " at line " + getCurrentLineNumber());
- state = STATE_EXPECTING_ETAGO;
- // and consume one character
- ++this._offset;
- } else {
- consumeWhitespace();
-
- // html can have "stand-alone" attributes with no
- // following equals sign
- if (consumeMatch("=")) {
- String attrValue = consumeAttrValue();
- }
- }
- }
-
- continue;
- }
-
- if (state == STATE_IN_MARKED_SECTION) {
- // in this state, nothing but "]]>" has any significance
- consumeExcept("]");
- if (isFinished()) {
- break;
- }
-
- if (consumeMatch("]]>")) {
- state = STATE_READY;
- } else {
- // false call; ] is not end of cdata section
- consumeMatch("]");
- }
-
- continue;
- }
-
- if (state == STATE_EXPECTING_ETAGO) {
- // The term "ETAGO" is the official spec term for "</".
- consumeExcept("<");
- if (isFinished()) {
- log
- .debug("Malformed input page; input terminated while tag not closed.");
- break;
- }
-
- if (consumeMatch("</")) {
- if (!processEndTag()) {
- return;
- }
- state = STATE_READY;
- } else {
- // false call; < does not start an ETAGO
- consumeMatch("<");
- }
-
- continue;
- }
- }
- }
-
- /**
- * Invoked when "</" has been seen in the input, this method handles the
- * parsing of the end tag and the invocation of the appropriate callback
- * method.
- *
- * @return true if the tag was successfully parsed, and false if there was a
- * fatal parsing error.
- */
- private boolean processEndTag() {
- int tagStart = this._offset - 2;
- String tagName = consumeElementName();
- consumeWhitespace();
- if (!consumeMatch(">")) {
- log.error("Malformed end tag at line " + getCurrentLineNumber()
- + "; skipping parsing");
- return false;
- }
-
- // inform user that the tag has been closed
- closedTag(tagStart, this._offset, tagName);
-
- // We can't verify that the tag names balance because this is HTML
- // we are processing, not XML.
- return true;
- }
-
- /**
- * Invoke a callback method to inform the listener that we have found a
- * start tag.
- *
- * @param startOffset
- * @param endOffset
- * @param tagName
- */
- void openedTag(int startOffset, int endOffset, String tagName) {
- // log.debug("Found open tag at " + startOffset + ":" + endOffset + ":"
- // + tagName);
-
- if ("head".equalsIgnoreCase(tagName)) {
- this._listener.openedStartTag(startOffset, HEAD_TAG);
- this._listener.closedStartTag(endOffset, HEAD_TAG);
- } else if ("body".equalsIgnoreCase(tagName)) {
- this._listener.openedStartTag(startOffset, BODY_TAG);
- this._listener.closedStartTag(endOffset, BODY_TAG);
- } else if ("script".equalsIgnoreCase(tagName)) {
- this._listener.openedStartTag(startOffset, SCRIPT_TAG);
- this._listener.closedStartTag(endOffset, SCRIPT_TAG);
- }
- }
-
- void closedTag(int startOffset, int endOffset, String tagName) {
- // log.debug("Found close tag at " + startOffset + ":" + endOffset + ":"
- // + tagName);
-
- if ("head".equalsIgnoreCase(tagName)) {
- this._listener.openedEndTag(startOffset, HEAD_TAG);
- this._listener.closedEndTag(endOffset, HEAD_TAG);
- } else if ("body".equalsIgnoreCase(tagName)) {
- this._listener.openedEndTag(startOffset, BODY_TAG);
- this._listener.closedEndTag(endOffset, BODY_TAG);
- } else if ("script".equalsIgnoreCase(tagName)) {
- this._listener.openedEndTag(startOffset, SCRIPT_TAG);
- this._listener.closedEndTag(endOffset, SCRIPT_TAG);
- }
- }
-}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/ReducedHTMLParser.java (from rev 14245, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/utils/ReducedHTMLParser.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/ReducedHTMLParser.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/utils/ReducedHTMLParser.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,603 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.richfaces.templatecompiler.utils;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * A class which detects the open/close tags in an HTML document and reports
+ * them to a listener class.
+ * <p>
+ * This is unfortunately necessary when using JSF with JSP, as tags in the body
+ * of the document can need to output commands into the document at points
+ * earlier than the tag occurred (particularly into the document HEAD section).
+ * This can only be implemented by buffering the response and post-processing it
+ * to find the relevant HTML tags and modifying the buffer as needed.
+ * <p>
+ * This class tries to do the parsing as quickly as possible; many of the
+ * details of HTML are not relevant for the purposes this class is used for.
+ *
+ * @version $Revision: 1.1.2.1 $ $Date: 2006/12/20 18:56:39 $
+ */
+public class ReducedHTMLParser {
+ // IMPLEMENTATION NOTE:
+ //
+ // Many of the methods on this class are package-scope. This is intended
+ // solely for the purpose of unit-testing. This class does not expect
+ // other classes in this package to access its methods.
+
+ private static final Log log = LogFactory.getLog(ReducedHTMLParser.class);
+
+ public static final int BODY_TAG = 0;
+
+ public static final int HEAD_TAG = 1;
+
+ public static final int SCRIPT_TAG = 2;
+
+ private static final int STATE_READY = 0;
+
+ private static final int STATE_IN_COMMENT = 1;
+
+ private static final int STATE_IN_TAG = 2;
+
+ private static final int STATE_IN_MARKED_SECTION = 3;
+
+ private static final int STATE_EXPECTING_ETAGO = 4;
+
+ private int _offset;
+
+ private int _lineNumber;
+
+ private CharSequence _seq;
+
+ private CallbackListener _listener;
+
+ public static void parse(CharSequence seq, CallbackListener l) {
+ new ReducedHTMLParser(seq, l).parse();
+ }
+
+ /**
+ * Constructor, package-scope for unit testing.
+ *
+ * @param s
+ * is the sequence of chars to parse.
+ * @param l
+ * is the listener to invoke callbacks on.
+ */
+ ReducedHTMLParser(CharSequence s, CallbackListener l) {
+ this._seq = s;
+ this._listener = l;
+ }
+
+ /**
+ * Return true if there are no more characters to parse.
+ */
+ boolean isFinished() {
+ return this._offset >= this._seq.length();
+ }
+
+ int getCurrentLineNumber() {
+ return this._lineNumber;
+ }
+
+ /**
+ * Advance the current parse position over any whitespace characters.
+ */
+ void consumeWhitespace() {
+ boolean crSeen = false;
+
+ while (this._offset < this._seq.length()) {
+ char c = this._seq.charAt(this._offset);
+ if (!Character.isWhitespace(c)) {
+ break;
+ }
+
+ // Track line number for error messages.
+ if (c == '\r') {
+ ++this._lineNumber;
+ crSeen = true;
+ } else if ((c == '\n') && !crSeen) {
+ ++this._lineNumber;
+ } else {
+ crSeen = false;
+ }
+
+ ++this._offset;
+ }
+ }
+
+ /**
+ * Eat up a sequence of non-whitespace characters and return them.
+ */
+ String consumeNonWhitespace() {
+ int wordStart = this._offset;
+ while (this._offset < this._seq.length()) {
+ char c = this._seq.charAt(this._offset);
+ if (Character.isWhitespace(c)) {
+ break;
+ }
+ ++this._offset;
+ }
+ if (wordStart == this._offset) {
+ return null;
+ } else {
+ return this._seq.subSequence(wordStart, this._offset).toString();
+ }
+ }
+
+ /**
+ * If the next chars in the input sequence exactly match the specified
+ * string then skip over them and return true.
+ * <p>
+ * If there is not a match then leave the current parse position unchanged
+ * and return false.
+ *
+ * @param s
+ * is the exact string to match.
+ * @return true if the input contains exactly the param s
+ */
+ boolean consumeMatch(String s) {
+ if (this._offset + s.length() > this._seq.length()) {
+ // seq isn't long enough to contain the specified string
+ return false;
+ }
+
+ int i = 0;
+ while (i < s.length()) {
+ if (this._seq.charAt(this._offset + i) == s.charAt(i)) {
+ ++i;
+ } else {
+ return false;
+ }
+ }
+
+ this._offset += i;
+ return true;
+ }
+
+ /**
+ * Eat up a sequence of chars which form a valid XML element name.
+ * <p>
+ * TODO: implement this properly in compliance with spec
+ */
+ String consumeElementName() {
+ consumeWhitespace();
+ int nameStart = this._offset;
+ while (!isFinished()) {
+ boolean ok = false;
+ char c = this._seq.charAt(this._offset);
+ if (Character.isLetterOrDigit(this._seq.charAt(this._offset))) {
+ ok = true;
+ } else if (c == '_') {
+ ok = true;
+ } else if (c == '-') {
+ ok = true;
+ } else if (c == ':') {
+ ok = true;
+ }
+
+ if (!ok) {
+ break;
+ }
+
+ ++this._offset;
+ }
+
+ if (nameStart == this._offset) {
+ return null;
+ } else {
+ return this._seq.subSequence(nameStart, this._offset).toString();
+ }
+ }
+
+ /**
+ * Eat up a sequence of chars which form a valid XML attribute name.
+ * <p>
+ * TODO: implement this properly in compliance with spec
+ */
+ String consumeAttrName() {
+ // for now, assume elements and attributes have same rules
+ return consumeElementName();
+ }
+
+ /**
+ * Eat up a string which is terminated with the specified quote character.
+ * This means handling escaped quote chars within the string.
+ * <p>
+ * This method assumes that the leading quote has already been consumed.
+ */
+ String consumeString(char quote) {
+ // TODO: should we consider a string to be terminated by a newline?
+ // that would help with runaway strings but I think that multiline
+ // strings *are* allowed...
+ //
+ // TODO: detect newlines within strings and increment lineNumber.
+ // This isn't so important, though; they aren't common and being a
+ // few lines out in an error message isn't serious either.
+ StringBuffer stringBuf = new StringBuffer();
+ boolean escaping = false;
+ while (!isFinished()) {
+ char c = this._seq.charAt(this._offset);
+ ++this._offset;
+ if (c == quote) {
+ if (!escaping) {
+ break;
+ } else {
+ stringBuf.append(c);
+ escaping = false;
+ }
+ } else if (c == '\\') {
+ if (escaping) {
+ // append a real backslash
+ stringBuf.append(c);
+ escaping = false;
+ } else {
+ escaping = true;
+ }
+ } else {
+ stringBuf.append(c);
+ }
+ }
+ return stringBuf.toString();
+ }
+
+ /**
+ * Assuming we have already encountered "attrname=", consume the value part
+ * of the attribute definition. Note that unlike XML, HTML doesn't have to
+ * quote its attribute values.
+ *
+ * @return the attribute value. If the attr-value was quoted, the returned
+ * value will not include the quote chars.
+ */
+ String consumeAttrValue() {
+ consumeWhitespace();
+ if (consumeMatch("'")) {
+ return consumeString('\'');
+ } else if (consumeMatch("\"")) {
+ return consumeString('"');
+ } else {
+ return consumeNonWhitespace();
+ }
+ }
+
+ /**
+ * Discard all characters in the input until one in the specified string
+ * (character-set) is found.
+ *
+ * @param s
+ * is a set of characters that should not be discarded.
+ */
+ void consumeExcept(String s) {
+ boolean crSeen = false;
+
+ while (this._offset < this._seq.length()) {
+ char c = this._seq.charAt(this._offset);
+ if (s.indexOf(c) >= 0) {
+ // char is in the exception set
+ return;
+ }
+
+ // Track line number for error messages.
+ if (c == '\r') {
+ ++this._lineNumber;
+ crSeen = true;
+ } else if ((c == '\n') && !crSeen) {
+ ++this._lineNumber;
+ } else {
+ crSeen = false;
+ }
+
+ // Track line number for error messages.
+ if (c == '\r') {
+ ++this._lineNumber;
+ crSeen = true;
+ } else if ((c == '\n') && !crSeen) {
+ ++this._lineNumber;
+ } else {
+ crSeen = false;
+ }
+
+ ++this._offset;
+ }
+ }
+
+ /**
+ * Process the entire input buffer, invoking callbacks on the listener
+ * object as appropriate.
+ */
+ void parse() {
+ int state = STATE_READY;
+
+ int currentTagStart = -1;
+ String currentTagName = null;
+
+ this._lineNumber = 1;
+ this._offset = 0;
+ int lastOffset = this._offset - 1;
+ while (this._offset < this._seq.length()) {
+ // Sanity check; each pass through this loop must increase the
+ // offset.
+ // Failure to do this means a hang situation has occurred.
+ if (this._offset <= lastOffset) {
+ // throw new RuntimeException("Infinite loop detected in
+ // ReducedHTMLParser");
+ log
+ .error("Infinite loop detected in ReducedHTMLParser; parsing skipped");
+ // return;
+ }
+ lastOffset = this._offset;
+
+ if (state == STATE_READY) {
+ // in this state, nothing but "<" has any significance
+ consumeExcept("<");
+ if (isFinished()) {
+ break;
+ }
+
+ if (consumeMatch("<!--")) {
+ // Note that whitespace is *not* permitted in <!--
+ state = STATE_IN_COMMENT;
+ } else if (consumeMatch("<![")) {
+ // Start of a "marked section", eg "<![CDATA" or
+ // "<![INCLUDE" or "<![IGNORE". These always terminate
+ // with "]]>"
+ log.debug("Marked section found at line "
+ + getCurrentLineNumber());
+ state = STATE_IN_MARKED_SECTION;
+ } else if (consumeMatch("<!DOCTYPE")) {
+ log
+ .debug("DOCTYPE found at line "
+ + getCurrentLineNumber());
+ // we don't need to actually do anything here; the
+ // tag can't contain a bare "<", so the first "<"
+ // indicates the start of the next real tag.
+ //
+ // TODO: Handle case where the DOCTYPE includes an internal
+ // DTD. In
+ // that case there *will* be embedded < chars in the
+ // document. However
+ // that's very unlikely to be used in a JSF page, so this is
+ // pretty low
+ // priority.
+ } else if (consumeMatch("<?")) {
+ // xml processing instruction or <!DOCTYPE> tag
+ // we don't need to actually do anything here; the
+ // tag can't contain a bare "<", so the first "<"
+ // indicates the start of the next real tag.
+ log.debug("PI found at line " + getCurrentLineNumber());
+ } else if (consumeMatch("</")) {
+ if (!processEndTag()) {
+ // message already logged
+ return;
+ }
+
+ // stay in state READY
+ state = STATE_READY;
+ } else if (consumeMatch("<")) {
+ // We can't tell the user that the tag has closed until
+ // after we have
+ // processed any attributes and found the real end of the
+ // tag. So save
+ // the current info until the end of this tag.
+ currentTagStart = this._offset - 1;
+ currentTagName = consumeElementName();
+ if (currentTagName == null) {
+ log
+ .warn("Invalid HTML; bare lessthan sign found at line "
+ + getCurrentLineNumber());
+ // remain in STATE_READY; this isn't really the start of
+ // an xml element.
+ } else {
+ state = STATE_IN_TAG;
+ }
+ } else {
+ // should never get here
+ throw new Error("Internal error at line "
+ + getCurrentLineNumber());
+ }
+
+ continue;
+ }
+
+ if (state == STATE_IN_COMMENT) {
+ // TODO: handle "-- >", which is a valid way to close a
+ // comment according to the specs.
+
+ // in this state, nothing but "--" has any significance
+ consumeExcept("-");
+ if (isFinished()) {
+ break;
+ }
+
+ if (consumeMatch("-->")) {
+ state = STATE_READY;
+ } else {
+ // false call; hyphen is not end of comment
+ consumeMatch("-");
+ }
+
+ continue;
+ }
+
+ if (state == STATE_IN_TAG) {
+ consumeWhitespace();
+
+ if (consumeMatch("/>")) {
+ // ok, end of element
+ state = STATE_READY;
+ closedTag(currentTagStart, this._offset, currentTagName);
+
+ // and reset vars just in case...
+ currentTagStart = -1;
+ currentTagName = null;
+ } else if (consumeMatch(">")) {
+ if (currentTagName.equalsIgnoreCase("script")
+ || currentTagName.equalsIgnoreCase("style")) {
+ // We've just started a special tag which can contain
+ // anything except
+ // the ETAGO marker ("</"). See
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#notes-specifying-data
+ state = STATE_EXPECTING_ETAGO;
+ } else {
+ state = STATE_READY;
+ }
+
+ // end of open tag, but not end of element
+ openedTag(currentTagStart, this._offset, currentTagName);
+
+ // and reset vars just in case...
+ currentTagStart = -1;
+ currentTagName = null;
+ } else {
+ // xml attribute
+ String attrName = consumeAttrName();
+ if (attrName == null) {
+ // Oops, we found something quite unexpected in this
+ // tag.
+ // The best we can do is probably to drop back to
+ // looking
+ // for "/>", though that does risk us misinterpreting
+ // the
+ // contents of an attribute's associated string value.
+ log
+ .warn("Invalid tag found: unexpected input while looking for attr name or '/>'"
+ + " at line " + getCurrentLineNumber());
+ state = STATE_EXPECTING_ETAGO;
+ // and consume one character
+ ++this._offset;
+ } else {
+ consumeWhitespace();
+
+ // html can have "stand-alone" attributes with no
+ // following equals sign
+ if (consumeMatch("=")) {
+ String attrValue = consumeAttrValue();
+ }
+ }
+ }
+
+ continue;
+ }
+
+ if (state == STATE_IN_MARKED_SECTION) {
+ // in this state, nothing but "]]>" has any significance
+ consumeExcept("]");
+ if (isFinished()) {
+ break;
+ }
+
+ if (consumeMatch("]]>")) {
+ state = STATE_READY;
+ } else {
+ // false call; ] is not end of cdata section
+ consumeMatch("]");
+ }
+
+ continue;
+ }
+
+ if (state == STATE_EXPECTING_ETAGO) {
+ // The term "ETAGO" is the official spec term for "</".
+ consumeExcept("<");
+ if (isFinished()) {
+ log
+ .debug("Malformed input page; input terminated while tag not closed.");
+ break;
+ }
+
+ if (consumeMatch("</")) {
+ if (!processEndTag()) {
+ return;
+ }
+ state = STATE_READY;
+ } else {
+ // false call; < does not start an ETAGO
+ consumeMatch("<");
+ }
+
+ continue;
+ }
+ }
+ }
+
+ /**
+ * Invoked when "</" has been seen in the input, this method handles the
+ * parsing of the end tag and the invocation of the appropriate callback
+ * method.
+ *
+ * @return true if the tag was successfully parsed, and false if there was a
+ * fatal parsing error.
+ */
+ private boolean processEndTag() {
+ int tagStart = this._offset - 2;
+ String tagName = consumeElementName();
+ consumeWhitespace();
+ if (!consumeMatch(">")) {
+ log.error("Malformed end tag at line " + getCurrentLineNumber()
+ + "; skipping parsing");
+ return false;
+ }
+
+ // inform user that the tag has been closed
+ closedTag(tagStart, this._offset, tagName);
+
+ // We can't verify that the tag names balance because this is HTML
+ // we are processing, not XML.
+ return true;
+ }
+
+ /**
+ * Invoke a callback method to inform the listener that we have found a
+ * start tag.
+ *
+ * @param startOffset
+ * @param endOffset
+ * @param tagName
+ */
+ void openedTag(int startOffset, int endOffset, String tagName) {
+ // log.debug("Found open tag at " + startOffset + ":" + endOffset + ":"
+ // + tagName);
+
+ if ("head".equalsIgnoreCase(tagName)) {
+ this._listener.openedStartTag(startOffset, HEAD_TAG);
+ this._listener.closedStartTag(endOffset, HEAD_TAG);
+ } else if ("body".equalsIgnoreCase(tagName)) {
+ this._listener.openedStartTag(startOffset, BODY_TAG);
+ this._listener.closedStartTag(endOffset, BODY_TAG);
+ } else if ("script".equalsIgnoreCase(tagName)) {
+ this._listener.openedStartTag(startOffset, SCRIPT_TAG);
+ this._listener.closedStartTag(endOffset, SCRIPT_TAG);
+ }
+ }
+
+ void closedTag(int startOffset, int endOffset, String tagName) {
+ // log.debug("Found close tag at " + startOffset + ":" + endOffset + ":"
+ // + tagName);
+
+ if ("head".equalsIgnoreCase(tagName)) {
+ this._listener.openedEndTag(startOffset, HEAD_TAG);
+ this._listener.closedEndTag(endOffset, HEAD_TAG);
+ } else if ("body".equalsIgnoreCase(tagName)) {
+ this._listener.openedEndTag(startOffset, BODY_TAG);
+ this._listener.closedEndTag(endOffset, BODY_TAG);
+ } else if ("script".equalsIgnoreCase(tagName)) {
+ this._listener.openedEndTag(startOffset, SCRIPT_TAG);
+ this._listener.closedEndTag(endOffset, SCRIPT_TAG);
+ }
+ }
+}
Copied: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/velocity (from rev 14075, branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/velocity)
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/velocity/AntFileResourceLoader.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/velocity/AntFileResourceLoader.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/velocity/AntFileResourceLoader.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.velocity;
+package org.richfaces.templatecompiler.velocity;
import java.io.BufferedInputStream;
import java.io.File;
Modified: branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/velocity/BuilderContext.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/velocity/BuilderContext.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/main/java/org/richfaces/templatecompiler/velocity/BuilderContext.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.templatecompiler.velocity;
+package org.richfaces.templatecompiler.velocity;
import org.apache.velocity.context.AbstractContext;
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/plexus/components.xml
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/plexus/components.xml 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/plexus/components.xml 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,17 +1,17 @@
<component-set>
<components>
<component>
- <role>org.ajax4jsf.templatecompiler.elements.ElementsFactory</role>
+ <role>org.richfaces.templatecompiler.elements.ElementsFactory</role>
<role-hint>a4j</role-hint>
<implementation>
- org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory
+ org.richfaces.templatecompiler.elements.A4JRendererElementsFactory
</implementation>
</component>
<component>
- <role>org.ajax4jsf.templatecompiler.elements.ElementsFactory</role>
+ <role>org.richfaces.templatecompiler.elements.ElementsFactory</role>
<role-hint>jstl</role-hint>
<implementation>
- org.ajax4jsf.templatecompiler.elements.JSTLElementsFactory
+ org.richfaces.templatecompiler.elements.JSTLElementsFactory
</implementation>
</component>
</components>
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/component.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/component.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/component.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -15,7 +15,7 @@
import java.io.IOException;
import javax.faces.FacesException;
-import org.ajax4jsf.framework.util.base64.Codec;
+import org.richfaces.framework.util.base64.Codec;
#end
/**
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -54,7 +54,7 @@
// Release
/* (non-Javadoc)
- * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#release()
+ * @see org.richfaces.components.taglib.html.HtmlCommandButtonTagBase#release()
*/
public void release()
{
@@ -68,7 +68,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
+ * @see org.richfaces.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/componenttest.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/componenttest.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/componenttest.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -16,14 +16,14 @@
import javax.faces.el.ValueBinding;
import javax.faces.component.UIViewRoot;
-import org.ajax4jsf.tests.MockValueBinding;
+import org.richfaces.tests.MockValueBinding;
//import ${component.classname};
#if(${generator.key})
import java.io.IOException;
import javax.faces.FacesException;
-import org.ajax4jsf.framework.util.base64.Codec;
+import org.richfaces.framework.util.base64.Codec;
#end
public class $component.test.simpleClassName extends $component.test.superclassname {
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/listener_tag.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/listener_tag.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/listener_tag.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -39,7 +39,7 @@
import org.apache.commons.beanutils.ConvertUtils;
-import org.ajax4jsf.Messages;
+import org.richfaces.Messages;
public class $tag.simpleClassName extends TagSupport {
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/renderer.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/renderer.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/renderer.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -15,7 +15,7 @@
public class ${renderer.simpleClassName} extends ${renderer.superclass} {
/**
- * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
+ * @see org.richfaces.renderkit.RendererBase#getComponentClass()
*/
protected Class getComponentClass() {
// Expected component class for rendering
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/tag.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/tag.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/tag.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -59,7 +59,7 @@
// Release
/* (non-Javadoc)
- * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#release()
+ * @see org.richfaces.components.taglib.html.HtmlCommandButtonTagBase#release()
*/
public void release()
{
@@ -73,7 +73,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
+ * @see org.richfaces.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/templatecompiler/ComponentTemplate.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/templatecompiler/ComponentTemplate.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates/templatecompiler/ComponentTemplate.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -45,14 +45,14 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.renderkit.ComponentsVariableResolver;
-import org.ajax4jsf.renderkit.ComponentVariables;
+import org.richfaces.renderkit.ComponentsVariableResolver;
+import org.richfaces.renderkit.ComponentVariables;
#end
#if($component.fullBaseclass)
import $component.fullBaseclass;
#else
-import org.ajax4jsf.renderkit.RendererBase;
+import org.richfaces.renderkit.RendererBase;
#end
#if($component.baseclassName)
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -31,7 +31,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
+ * @see org.richfaces.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -17,14 +17,14 @@
import javax.faces.el.ValueBinding;
import javax.faces.component.UIViewRoot;
-import org.ajax4jsf.tests.MockValueBinding;
+import org.richfaces.tests.MockValueBinding;
//import ${component.classname};
#if(${generator.key})
import java.io.IOException;
import javax.faces.FacesException;
-import org.ajax4jsf.framework.util.base64.Codec;
+import org.richfaces.framework.util.base64.Codec;
#end
public class $component.test.simpleClassName extends $component.test.superclassname {
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/listener_tag.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/listener_tag.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/listener_tag.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -39,7 +39,7 @@
import org.apache.commons.beanutils.ConvertUtils;
-import org.ajax4jsf.Messages;
+import org.richfaces.Messages;
public class $tag.simpleClassName extends TagSupport {
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/renderer.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/renderer.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/renderer.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -15,7 +15,7 @@
public class ${renderer.simpleClassName} extends ${renderer.superclass} {
/**
- * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
+ * @see org.richfaces.renderkit.RendererBase#getComponentClass()
*/
protected Class getComponentClass() {
// Expected component class for rendering
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/tag.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/tag.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/tag.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -59,7 +59,7 @@
// Release
/* (non-Javadoc)
- * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#release()
+ * @see org.richfaces.components.taglib.html.HtmlCommandButtonTagBase#release()
*/
public void release()
{
@@ -73,7 +73,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
+ * @see org.richfaces.components.taglib.html.HtmlCommandButtonTagBase#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -5,7 +5,7 @@
package ${tag.packageName};
import static org.easymock.classextension.EasyMock.*;
-import static org.ajax4jsf.tests.JsfMock.*;
+import static org.richfaces.tests.JsfMock.*;
#foreach($import in $imports)
import $import ;
@@ -38,12 +38,12 @@
import javax.servlet.jsp.el.ExpressionEvaluator;
import javax.servlet.jsp.el.VariableResolver;
import javax.servlet.jsp.tagext.Tag;
-import org.ajax4jsf.tests.MockMethodExpression;
+import org.richfaces.tests.MockMethodExpression;
import java.io.IOException;
import java.util.Enumeration;
import java.util.List;
import java.util.ArrayList;
-import org.ajax4jsf.tests.Condition;
+import org.richfaces.tests.Condition;
/**
* @author Maksim Kaszynski
@@ -146,7 +146,7 @@
verify(component);
#elseif($prop.isInstanceof("javax.el.ValueExpression"))
- final ValueExpression expression = new org.ajax4jsf.tests.MockValueExpression("#{bean.${prop.name}}");
+ final ValueExpression expression = new org.richfaces.tests.MockValueExpression("#{bean.${prop.name}}");
component.${prop.setterName}(same(expression));
expectLastCall().once();
replay(component);
@@ -154,7 +154,7 @@
tag.setProperties(component);
verify(component);
#elseif($prop.isInstanceof("javax.faces.el.ValueBinding"))
- final ValueExpression expression = new org.ajax4jsf.tests.MockValueExpression("#{bean.${prop.name}}");
+ final ValueExpression expression = new org.richfaces.tests.MockValueExpression("#{bean.${prop.name}}");
component.${prop.setterName}(vbEqToVe(expression));
//Then test literal one
expectLastCall().once();
@@ -165,7 +165,7 @@
verify(component);
#elseif($prop.el)
//el=true
- ValueExpression expression = new org.ajax4jsf.tests.MockValueExpression("#{bean.${prop.name}}");
+ ValueExpression expression = new org.richfaces.tests.MockValueExpression("#{bean.${prop.name}}");
component.setValueExpression(eq("${prop.name}"), same(expression));
expectLastCall().once();
replay(component);
@@ -174,7 +174,7 @@
verify(component);
#if($prop.name == 'converter' || $prop.name == 'rowKeyConverter')
String converterType = this.getClass().getName();
- expression = new org.ajax4jsf.tests.LiteralValueExpression(converterType);
+ expression = new org.richfaces.tests.LiteralValueExpression(converterType);
reset(component);
component.${prop.setterName}(isA(MyConverter.class));
tag.${prop.setterName}(expression);
@@ -185,7 +185,7 @@
//In case of literal VE
${prop.classname} _${prop.name} = ${testDataGenerator.getTestVeData($prop)};
reset(component);
- expression = new org.ajax4jsf.tests.LiteralValueExpression(_${prop.name});
+ expression = new org.richfaces.tests.LiteralValueExpression(_${prop.name});
component.${prop.setterName}(eq(_${prop.name}));
expectLastCall().once();
@@ -196,7 +196,7 @@
try {
//Now test evaluation of literal
- expression = new org.ajax4jsf.tests.ConstantlyFailingLiteralValueExpression();
+ expression = new org.richfaces.tests.ConstantlyFailingLiteralValueExpression();
tag.${prop.setterName}(expression);
tag.setProperties(component);
fail("An exception should be thrown");
@@ -247,10 +247,10 @@
#if( !$prop.existintag && !$prop.hidden)
//First check EL-properties (value and method expressions)
#if($prop.isInstanceof("javax.el.MethodExpression") || $prop.isInstanceof("javax.faces.el.MethodBinding"))
- MethodExpression ${prop.name}Me = new org.ajax4jsf.tests.MockMethodExpression("#{bean.${prop.name}}", null, null);
+ MethodExpression ${prop.name}Me = new org.richfaces.tests.MockMethodExpression("#{bean.${prop.name}}", null, null);
tag.${prop.setterName}(${prop.name}Me);
#elseif ($prop.el)
- ValueExpression ${prop.name}Ve = new org.ajax4jsf.tests.MockValueExpression("#{bean.${prop.name}}");
+ ValueExpression ${prop.name}Ve = new org.richfaces.tests.MockValueExpression("#{bean.${prop.name}}");
tag.${prop.setterName}(${prop.name}Ve);
#end
#end
@@ -269,10 +269,10 @@
//First check EL-properties (value and method expressions)
#if($prop.isInstanceof("javax.el.MethodExpression") || $prop.isInstanceof("javax.faces.el.MethodBinding"))
#if (!$prop.elonly)
- tag.${prop.setterName}(new org.ajax4jsf.tests.MockMethodExpression("${prop.name}", null, null));
+ tag.${prop.setterName}(new org.richfaces.tests.MockMethodExpression("${prop.name}", null, null));
#end
#elseif ($prop.el && !$prop.elonly && ${testDataGenerator.isNativelySupported($prop)})
- tag.${prop.setterName}(new org.ajax4jsf.tests.LiteralValueExpression(String.valueOf(${testDataGenerator.getTestVeData($prop)})));
+ tag.${prop.setterName}(new org.richfaces.tests.LiteralValueExpression(String.valueOf(${testDataGenerator.getTestVeData($prop)})));
#elseif (!$prop.el && ${testDataGenerator.isNativelySupported($prop)})
tag.${prop.setterName}(String.valueOf(${testDataGenerator.getTestVeData($prop)}));
#end
Modified: branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/templatecompiler/ComponentTemplate.vm
===================================================================
--- branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/templatecompiler/ComponentTemplate.vm 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/main/resources/META-INF/templates12/templatecompiler/ComponentTemplate.vm 2009-06-09 22:53:29 UTC (rev 14575)
@@ -45,14 +45,14 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.renderkit.ComponentsVariableResolver;
-import org.ajax4jsf.renderkit.ComponentVariables;
+import org.richfaces.renderkit.ComponentsVariableResolver;
+import org.richfaces.renderkit.ComponentVariables;
#end
#if($component.fullBaseclass)
import $component.fullBaseclass;
#else
-import org.ajax4jsf.renderkit.RendererBase;
+import org.richfaces.renderkit.RendererBase;
#end
#if($component.baseclassName)
Deleted: branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/AppTest.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/AppTest.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/AppTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,59 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public AppTest( String testName )
- {
- super( testName );
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite( AppTest.class );
- }
-
- /**
- * Rigourous Test :-)
- */
- public void testApp()
- {
- assertTrue( true );
- }
-}
Copied: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/AppTest.java (from rev 14075, branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/AppTest.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/AppTest.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/AppTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,59 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Copied: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/config (from rev 14075, branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/config)
Modified: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/config/ClassWalkingLogicTest.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/config/ClassWalkingLogicTest.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/config/ClassWalkingLogicTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.config;
+package org.richfaces.builder.config;
import java.util.ArrayList;
import java.util.List;
@@ -29,6 +29,9 @@
import javax.faces.component.UIComponent;
import javax.faces.component.html.HtmlCommandButton;
+import org.richfaces.builder.config.ClassVisitor;
+import org.richfaces.builder.config.ClassWalkingLogic;
+
import junit.framework.TestCase;
/**
Copied: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator (from rev 14075, branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/generator)
Modified: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/AbstractClass.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/generator/AbstractClass.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/AbstractClass.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
Modified: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/AbstractClassStubBuilderTest.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/generator/AbstractClassStubBuilderTest.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/AbstractClassStubBuilderTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,10 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
import java.lang.reflect.Method;
+import org.richfaces.builder.generator.AbstractClassStubBuilder;
+
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
import junit.framework.TestCase;
Modified: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/BaseClass.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/generator/BaseClass.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/BaseClass.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,49 +19,49 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
public abstract class BaseClass implements BaseInterface {
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.BaseInterface#test()
+ * @see org.richfaces.builder.generator.BaseInterface#test()
*/
public abstract float test();
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.BaseInterface#test1()
+ * @see org.richfaces.builder.generator.BaseInterface#test1()
*/
public abstract double test1();
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.BaseInterface#test2()
+ * @see org.richfaces.builder.generator.BaseInterface#test2()
*/
public abstract short test2();
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.BaseInterface#test3()
+ * @see org.richfaces.builder.generator.BaseInterface#test3()
*/
public abstract long test3();
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.BaseInterface#test4()
+ * @see org.richfaces.builder.generator.BaseInterface#test4()
*/
public abstract float test4();
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.BaseInterface#test5()
+ * @see org.richfaces.builder.generator.BaseInterface#test5()
*/
public abstract int test5();
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.BaseInterface#test6()
+ * @see org.richfaces.builder.generator.BaseInterface#test6()
*/
public abstract String test6();
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.BaseInterface#test7()
+ * @see org.richfaces.builder.generator.BaseInterface#test7()
*/
public abstract void test7();
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.BaseInterface#test8()
+ * @see org.richfaces.builder.generator.BaseInterface#test8()
*/
public abstract boolean test8();
/* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.BaseInterface#test9()
+ * @see org.richfaces.builder.generator.BaseInterface#test9()
*/
public abstract char test9();
}
\ No newline at end of file
Modified: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/BaseInterface.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/generator/BaseInterface.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/BaseInterface.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
public interface BaseInterface {
Modified: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/ClassPatternSetTest.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/generator/ClassPatternSetTest.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/generator/ClassPatternSetTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,8 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.generator;
+package org.richfaces.builder.generator;
+import org.richfaces.builder.generator.ClassPatternSet;
+
import junit.framework.TestCase;
/**
@@ -56,7 +58,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.generator.ClassPatternSet#setExcludes(java.lang.String)}.
+ * Test method for {@link org.richfaces.builder.generator.ClassPatternSet#setExcludes(java.lang.String)}.
*/
public void testSetExcludes() {
patterns.setExcludes("a");
@@ -66,7 +68,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.generator.ClassPatternSet#setExcludes(java.lang.String)}.
+ * Test method for {@link org.richfaces.builder.generator.ClassPatternSet#setExcludes(java.lang.String)}.
*/
public void testSetExcludes1() {
patterns.setExcludes("a,b");
@@ -77,7 +79,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.generator.ClassPatternSet#setIncludes(java.lang.String)}.
+ * Test method for {@link org.richfaces.builder.generator.ClassPatternSet#setIncludes(java.lang.String)}.
*/
public void testSetIncludes() {
patterns.setIncludes("a");
@@ -87,7 +89,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.generator.ClassPatternSet#matchClass(java.lang.String)}.
+ * Test method for {@link org.richfaces.builder.generator.ClassPatternSet#matchClass(java.lang.String)}.
*/
public void testMatchClassExclude() {
patterns.setExcludes("**.Abst*,b.**");
@@ -97,7 +99,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.generator.ClassPatternSet#matchClass(java.lang.String)}.
+ * Test method for {@link org.richfaces.builder.generator.ClassPatternSet#matchClass(java.lang.String)}.
*/
public void testMatchClassInclude() {
patterns.setIncludes("**.UI*,a.**");
@@ -107,7 +109,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.generator.ClassPatternSet#matchClass(java.lang.String)}.
+ * Test method for {@link org.richfaces.builder.generator.ClassPatternSet#matchClass(java.lang.String)}.
*/
public void testMatchClassIncExclude() {
patterns.setExcludes("**.Abst*,b.**");
@@ -118,7 +120,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.generator.ClassPatternSet#matchPath(java.lang.String, java.lang.String)}.
+ * Test method for {@link org.richfaces.builder.generator.ClassPatternSet#matchPath(java.lang.String, java.lang.String)}.
*/
public void testMatchPath() {
assertTrue(patterns.matchPath("**.D", "a.b.D"));
@@ -128,7 +130,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.generator.ClassPatternSet#match(java.lang.String, java.lang.String)}.
+ * Test method for {@link org.richfaces.builder.generator.ClassPatternSet#match(java.lang.String, java.lang.String)}.
*/
public void testMatch() {
assertTrue(patterns.match("a", "a"));
@@ -147,7 +149,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.generator.ClassPatternSet#tokenizePathAsArray(java.lang.String)}.
+ * Test method for {@link org.richfaces.builder.generator.ClassPatternSet#tokenizePathAsArray(java.lang.String)}.
*/
public void testTokenizePathAsArray() {
String[] strings = patterns.tokenizePathAsArray("a.b.c");
Copied: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml (from rev 14075, branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/xml)
Deleted: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodyMergeTest.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/xml/XMLBodyMergeTest.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodyMergeTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,64 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.xml;
-
-import junit.framework.TestCase;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class XMLBodyMergeTest extends TestCase {
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Test method for {@link org.ajax4jsf.builder.xml.XMLBodyMerge#add(org.w3c.dom.Node)}.
- */
- public void testAddNode() {
- XMLBodyMerge merge = new XMLBodyMerge("//node()");
-
- }
-
- /**
- * Test method for {@link org.ajax4jsf.builder.xml.XMLBodyMerge#add(org.ajax4jsf.builder.xml.XMLBody)}.
- */
- public void testAddXMLBody() {
- //fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link org.ajax4jsf.builder.xml.XMLBodyMerge#getLength()}.
- */
- public void testGetLength() {
- //fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link org.ajax4jsf.builder.xml.XMLBodyMerge#item(int)}.
- */
- public void testItem() {
- //fail("Not yet implemented");
- }
-
- /**
- * Test method for {@link org.ajax4jsf.builder.xml.XMLBodyMerge#getContent()}.
- */
- public void testGetContent() {
- //fail("Not yet implemented");
- }
-
-}
Copied: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodyMergeTest.java (from rev 14245, branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/xml/XMLBodyMergeTest.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodyMergeTest.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodyMergeTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,84 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.xml;
+
+import org.richfaces.builder.xml.XMLBodyMerge;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class XMLBodyMergeTest extends TestCase {
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link org.richfaces.builder.xml.XMLBodyMerge#add(org.w3c.dom.Node)}.
+ */
+ public void testAddNode() {
+ XMLBodyMerge merge = new XMLBodyMerge("//node()");
+
+ }
+
+ /**
+ * Test method for {@link org.richfaces.builder.xml.XMLBodyMerge#add(org.richfaces.builder.xml.XMLBody)}.
+ */
+ public void testAddXMLBody() {
+ //fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.richfaces.builder.xml.XMLBodyMerge#getLength()}.
+ */
+ public void testGetLength() {
+ //fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.richfaces.builder.xml.XMLBodyMerge#item(int)}.
+ */
+ public void testItem() {
+ //fail("Not yet implemented");
+ }
+
+ /**
+ * Test method for {@link org.richfaces.builder.xml.XMLBodyMerge#getContent()}.
+ */
+ public void testGetContent() {
+ //fail("Not yet implemented");
+ }
+
+}
Deleted: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodySerializerTest.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/xml/XMLBodySerializerTest.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodySerializerTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,73 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.xml;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.ajax4jsf.builder.config.ParsingException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import junit.framework.TestCase;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class XMLBodySerializerTest extends TestCase {
-
- private XMLBodySerializer serializer;
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- serializer = new XMLBodySerializer();
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- serializer = null;
- super.tearDown();
- }
-
- /**
- * Test method for {@link org.ajax4jsf.builder.xml.XMLBodySerializer#serialize(org.w3c.dom.NodeList, org.w3c.dom.Document)}.
- */
- public void testSerialize() throws ParsingException{
- String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- + "<!DOCTYPE faces-config PUBLIC \"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN\"\n"
- + " \"http://java.sun.com/dtd/web-facesconfig_1_1.dtd\">\n"
- + "<faces-config>\n" + " <component><test>blabla</test></component><component><test>blabla</test></component><component><test>blabla2</test></component>\n"
- + "</faces-config>";
- InputStream in = new ByteArrayInputStream(xml.getBytes());
- XMLBody body = new XMLBody();
- body.loadXML(in);
-
- NodeList singleElementList = body.getByXpath("/faces-config");
- assertEquals(1, singleElementList.getLength());
- Node node = singleElementList.item(0);
- assertNotNull(node);
- assertEquals("faces-config", node.getNodeName());
- String actual = serializer.serialize(singleElementList, node.getOwnerDocument()).replaceAll("\\s", "");
- String expected = "<faces-config><component><test>blabla</test></component><component><test>blabla</test></component><component><test>blabla2</test></component></faces-config>";
- assertEquals(expected, actual);
-
- NodeList children = node.getChildNodes();
- actual = serializer.serialize(children, node.getOwnerDocument()).replaceAll("\\s", "");
- expected = "<component><test>blabla</test></component><component><test>blabla</test></component><component><test>blabla2</test></component>";
- assertEquals(expected, actual);
-
-
- }
-
-}
Copied: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodySerializerTest.java (from rev 14245, branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/xml/XMLBodySerializerTest.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodySerializerTest.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodySerializerTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,93 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.xml;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.richfaces.builder.config.ParsingException;
+import org.richfaces.builder.xml.XMLBody;
+import org.richfaces.builder.xml.XMLBodySerializer;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class XMLBodySerializerTest extends TestCase {
+
+ private XMLBodySerializer serializer;
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ serializer = new XMLBodySerializer();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ serializer = null;
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link org.richfaces.builder.xml.XMLBodySerializer#serialize(org.w3c.dom.NodeList, org.w3c.dom.Document)}.
+ */
+ public void testSerialize() throws ParsingException{
+ String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ + "<!DOCTYPE faces-config PUBLIC \"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN\"\n"
+ + " \"http://java.sun.com/dtd/web-facesconfig_1_1.dtd\">\n"
+ + "<faces-config>\n" + " <component><test>blabla</test></component><component><test>blabla</test></component><component><test>blabla2</test></component>\n"
+ + "</faces-config>";
+ InputStream in = new ByteArrayInputStream(xml.getBytes());
+ XMLBody body = new XMLBody();
+ body.loadXML(in);
+
+ NodeList singleElementList = body.getByXpath("/faces-config");
+ assertEquals(1, singleElementList.getLength());
+ Node node = singleElementList.item(0);
+ assertNotNull(node);
+ assertEquals("faces-config", node.getNodeName());
+ String actual = serializer.serialize(singleElementList, node.getOwnerDocument()).replaceAll("\\s", "");
+ String expected = "<faces-config><component><test>blabla</test></component><component><test>blabla</test></component><component><test>blabla2</test></component></faces-config>";
+ assertEquals(expected, actual);
+
+ NodeList children = node.getChildNodes();
+ actual = serializer.serialize(children, node.getOwnerDocument()).replaceAll("\\s", "");
+ expected = "<component><test>blabla</test></component><component><test>blabla</test></component><component><test>blabla2</test></component>";
+ assertEquals(expected, actual);
+
+
+ }
+
+}
Modified: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodyTest.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/xml/XMLBodyTest.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XMLBodyTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.xml;
+package org.richfaces.builder.xml;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
@@ -27,7 +27,8 @@
import junit.framework.TestCase;
-import org.ajax4jsf.builder.config.ParsingException;
+import org.richfaces.builder.config.ParsingException;
+import org.richfaces.builder.xml.XMLBody;
/**
* @author shura
@@ -55,7 +56,7 @@
/**
* Test method for
- * {@link org.ajax4jsf.builder.xml.XMLBody#loadXML(java.io.InputStream)}.
+ * {@link org.richfaces.builder.xml.XMLBody#loadXML(java.io.InputStream)}.
*
* @throws ParsingException
*/
@@ -65,11 +66,11 @@
+ " \"http://java.sun.com/dtd/web-facesconfig_1_1.dtd\">\n"
+ "<faces-config>\n"
+ " <component>\n"
- + " <component-type>org.ajax4jsf.ajax.Test</component-type>\n"
- + " <component-class>org.ajax4jsf.ajax.html.Test</component-class>\n"
+ + " <component-type>org.richfaces.ajax.Test</component-type>\n"
+ + " <component-class>org.richfaces.ajax.html.Test</component-class>\n"
+ "\n" + " <component-extension>\n"
- + " <component-family>org.ajax4jsf.Test</component-family>\n"
- + " <renderer-type>org.ajax4jsf.Test</renderer-type>\n"
+ + " <component-family>org.richfaces.Test</component-family>\n"
+ + " <renderer-type>org.richfaces.Test</renderer-type>\n"
+ " </component-extension>\n" + " </component>\n"
+ "</faces-config>";
InputStream in = new ByteArrayInputStream(xml.getBytes());
@@ -79,7 +80,7 @@
/**
* Test method for
- * {@link org.ajax4jsf.builder.xml.XMLBody#isRootName(java.lang.String)}.
+ * {@link org.richfaces.builder.xml.XMLBody#isRootName(java.lang.String)}.
*
* @throws ParsingException
*/
@@ -97,7 +98,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.xml.XMLBody#getDoctype()}.
+ * Test method for {@link org.richfaces.builder.xml.XMLBody#getDoctype()}.
*
* @throws ParsingException
*/
@@ -117,7 +118,7 @@
/**
* Test method for
- * {@link org.ajax4jsf.builder.xml.XMLBody#getRootNameSpace()}.
+ * {@link org.richfaces.builder.xml.XMLBody#getRootNameSpace()}.
*
* @throws ParsingException
*/
@@ -132,7 +133,7 @@
}
/**
- * Test method for {@link org.ajax4jsf.builder.xml.XMLBody#getContent()}.
+ * Test method for {@link org.richfaces.builder.xml.XMLBody#getContent()}.
*
* @throws ParsingException
*/
Deleted: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XPathComparatorTest.java
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/xml/XPathComparatorTest.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XPathComparatorTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,75 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.xml;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import junit.framework.TestCase;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class XPathComparatorTest extends TestCase {
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testCompare() throws Exception{
- String xml = "<faces-config>" +
- "<component><test>blabla1</test></component>" +
- "<component><test>blabla</test></component>" +
- "<renderer><foo>blabla2</foo></renderer>" +
- "<component><test>blabla2</test></component>"
- + "</faces-config>";
- InputStream in = new ByteArrayInputStream(xml.getBytes());
- XMLBody body = new XMLBody();
- body.loadXML(in);
- NodeList list = body.getByXpath("//component|//renderer");
- assertEquals(4, list.getLength());
- Node node0 = list.item(0);
- Node node1 = list.item(1);
- Node node2 = list.item(2);
- Node node3 = list.item(3);
-
- XPathComparator dummyComparator = new XPathComparator();
- assertEquals(0, dummyComparator.compare(node0, node1));
- assertEquals(0, dummyComparator.compare(node1, node2));
- assertEquals(0, dummyComparator.compare(node0, node2));
- assertEquals(0, dummyComparator.compare(node0, node3));
- assertEquals(0, dummyComparator.compare(node2, node3));
- assertEquals(0, dummyComparator.compare(node1, node0));
- assertEquals(0, dummyComparator.compare(node2, node1));
- assertEquals(0, dummyComparator.compare(node2, node0));
-
- XPathComparator simpleComparator = new XPathComparator("local-name()");
- assertEquals(0, simpleComparator.compare(node0, node1));
- assertEquals(0, simpleComparator.compare(node0, node3));
- assertTrue(simpleComparator.compare(node0, node2) < 0);
- assertTrue(simpleComparator.compare(node2, node1) > 0);
-
- XPathComparator advancedComparator = new XPathComparator("local-name()", "test/text()", "foo/text()");
- assertTrue(advancedComparator.compare(node0, node2) < 0);
- assertTrue(advancedComparator.compare(node2, node1) > 0);
- assertTrue(advancedComparator.compare(node0, node1) > 0);
- assertTrue(advancedComparator.compare(node1, node0) < 0);
-
-
- }
-}
Copied: branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XPathComparatorTest.java (from rev 14245, branches/jsf2.0/cdk/generator/src/test/java/org/ajax4jsf/builder/xml/XPathComparatorTest.java)
===================================================================
--- branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XPathComparatorTest.java (rev 0)
+++ branches/jsf2.0/cdk/generator/src/test/java/org/richfaces/builder/xml/XPathComparatorTest.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,95 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.xml;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.richfaces.builder.xml.XMLBody;
+import org.richfaces.builder.xml.XPathComparator;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class XPathComparatorTest extends TestCase {
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testCompare() throws Exception{
+ String xml = "<faces-config>" +
+ "<component><test>blabla1</test></component>" +
+ "<component><test>blabla</test></component>" +
+ "<renderer><foo>blabla2</foo></renderer>" +
+ "<component><test>blabla2</test></component>"
+ + "</faces-config>";
+ InputStream in = new ByteArrayInputStream(xml.getBytes());
+ XMLBody body = new XMLBody();
+ body.loadXML(in);
+ NodeList list = body.getByXpath("//component|//renderer");
+ assertEquals(4, list.getLength());
+ Node node0 = list.item(0);
+ Node node1 = list.item(1);
+ Node node2 = list.item(2);
+ Node node3 = list.item(3);
+
+ XPathComparator dummyComparator = new XPathComparator();
+ assertEquals(0, dummyComparator.compare(node0, node1));
+ assertEquals(0, dummyComparator.compare(node1, node2));
+ assertEquals(0, dummyComparator.compare(node0, node2));
+ assertEquals(0, dummyComparator.compare(node0, node3));
+ assertEquals(0, dummyComparator.compare(node2, node3));
+ assertEquals(0, dummyComparator.compare(node1, node0));
+ assertEquals(0, dummyComparator.compare(node2, node1));
+ assertEquals(0, dummyComparator.compare(node2, node0));
+
+ XPathComparator simpleComparator = new XPathComparator("local-name()");
+ assertEquals(0, simpleComparator.compare(node0, node1));
+ assertEquals(0, simpleComparator.compare(node0, node3));
+ assertTrue(simpleComparator.compare(node0, node2) < 0);
+ assertTrue(simpleComparator.compare(node2, node1) > 0);
+
+ XPathComparator advancedComparator = new XPathComparator("local-name()", "test/text()", "foo/text()");
+ assertTrue(advancedComparator.compare(node0, node2) < 0);
+ assertTrue(advancedComparator.compare(node2, node1) > 0);
+ assertTrue(advancedComparator.compare(node0, node1) > 0);
+ assertTrue(advancedComparator.compare(node1, node0) < 0);
+
+
+ }
+}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven (from rev 14075, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/maven)
Modified: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/maven/MavenCompilationContext.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,15 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.maven;
+package org.richfaces.builder.maven;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.builder.AbstractCompilationContext;
-import org.ajax4jsf.templatecompiler.elements.ElementsFactory;
import org.apache.velocity.Template;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
+import org.richfaces.templatecompiler.builder.AbstractCompilationContext;
+import org.richfaces.templatecompiler.builder.CompilationException;
+import org.richfaces.templatecompiler.elements.ElementsFactory;
/**
* @author shura
@@ -49,63 +49,63 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#debug(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#debug(java.lang.String)
*/
public void debug(String content) {
logger.debug(content);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#debug(java.lang.String, java.lang.Throwable)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#debug(java.lang.String, java.lang.Throwable)
*/
public void debug(String content, Throwable error) {
logger.debug(content, error);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#error(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#error(java.lang.String)
*/
public void error(String content) {
logger.error(content);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#error(java.lang.String, java.lang.Throwable)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#error(java.lang.String, java.lang.Throwable)
*/
public void error(String content, Throwable error) {
logger.error(content, error);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#info(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#info(java.lang.String)
*/
public void info(String content) {
logger.info(content);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#info(java.lang.String, java.lang.Throwable)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#info(java.lang.String, java.lang.Throwable)
*/
public void info(String content, Throwable error) {
logger.info(content, error);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#warn(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#warn(java.lang.String)
*/
public void warn(String content) {
logger.warn(content);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#warn(java.lang.String, java.lang.Throwable)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#warn(java.lang.String, java.lang.Throwable)
*/
public void warn(String content, Throwable error) {
logger.warn(content, error);
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#getElementsFactory()
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#getElementsFactory()
*/
public ElementsFactory getElementsFactory() {
// TODO Auto-generated method stub
@@ -113,7 +113,7 @@
}
/* (non-Javadoc)
- * @see org.ajax4jsf.templatecompiler.builder.CompilationContext#getTemplate(java.lang.String)
+ * @see org.richfaces.templatecompiler.builder.CompilationContext#getTemplate(java.lang.String)
*/
public Template getTemplate(String name) throws CompilationException {
try {
Modified: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenLogger.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/maven/MavenLogger.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenLogger.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.maven;
+package org.richfaces.builder.maven;
-import org.ajax4jsf.builder.generator.Logger;
import org.apache.maven.plugin.logging.Log;
+import org.richfaces.builder.generator.Logger;
/**
* @author shura
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/maven/MavenXMLMerge.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,120 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.maven;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.ajax4jsf.builder.config.ParsingException;
-import org.ajax4jsf.builder.xml.XMLBody;
-import org.ajax4jsf.builder.xml.XMLBodyMerge;
-import org.ajax4jsf.builder.xml.XPathComparator;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.logging.Log;
-import org.codehaus.plexus.util.DirectoryScanner;
-
-/**
- * Class is used to locate and merge several xml files
- * @author Maksim Kaszynski
- *
- */
-public class MavenXMLMerge {
-
- class DirectoryItem {
- private File baseDir;
- private String [] includes;
- public DirectoryItem(File baseDir, String[] includes) {
- super();
- this.baseDir = baseDir;
- this.includes = includes;
- }
-
- }
-
- private boolean namespaceAware = false;
-
- private Log log;
-
- private String xPath;
-
- private String keyXPath;
-
- private String [] sortBy = {};
-
- private List<DirectoryItem> directories = new ArrayList<DirectoryItem>();
-
- public MavenXMLMerge() {
- }
-
- public void addDirectory(File dir, String [] includes) {
- directories.add(new DirectoryItem(dir, includes));
- }
-
- public void setSortBy(String ... sortBy) {
- this.sortBy = sortBy;
- }
-
- public void performMerge(XMLMergeCallback callback) throws MojoExecutionException {
- XMLBodyMerge merge = new XMLBodyMerge(xPath, keyXPath);
-
- for (DirectoryItem item : directories) {
- DirectoryScanner ds = new DirectoryScanner();
- ds.setFollowSymlinks(true);
- ds.setBasedir(item.baseDir);
- ds.setIncludes(item.includes);
- ds.addDefaultExcludes();
- ds.scan();
- String[] files = ds.getIncludedFiles();
- for (String file : files) {
- File sourceFile = new File(item.baseDir, file);
- if (log != null){
- log.info("Process file " + sourceFile.getPath());
- }
- try {
- XMLBody configBody = new XMLBody();
- configBody.loadXML(new FileInputStream(sourceFile), namespaceAware);
- merge.add(configBody);
-
- } catch (FileNotFoundException e) {
- throw new MojoExecutionException("Could't read file "
- + sourceFile.getPath(), e);
- } catch (ParsingException e) {
- throw new MojoExecutionException(
- "Error parsing config file "
- + sourceFile.getPath(), e);
- }
-
- }
- }
-
- if (sortBy != null) {
- merge.sort(new XPathComparator(sortBy));
- }
-
- try {
- callback.onMergeComplete(merge.getContent());
- } catch (Exception e) {
- throw new MojoExecutionException("Exception uring XML merge", e);
- }
- }
-
- public void setNamespaceAware(boolean namespaceAware) {
- this.namespaceAware = namespaceAware;
- }
-
- public void setLog(Log log) {
- this.log = log;
- }
-
- public void setXPath(String path) {
- xPath = path;
- }
-
- public void setKeyXPath(String keyXPath) {
- this.keyXPath = keyXPath;
- }
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/maven/MavenXMLMerge.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,138 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.maven;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.richfaces.builder.config.ParsingException;
+import org.richfaces.builder.xml.XMLBody;
+import org.richfaces.builder.xml.XMLBodyMerge;
+import org.richfaces.builder.xml.XPathComparator;
+
+/**
+ * Class is used to locate and merge several xml files
+ * @author Maksim Kaszynski
+ *
+ */
+public class MavenXMLMerge {
+
+ class DirectoryItem {
+ private File baseDir;
+ private String [] includes;
+ public DirectoryItem(File baseDir, String[] includes) {
+ super();
+ this.baseDir = baseDir;
+ this.includes = includes;
+ }
+
+ }
+
+ private boolean namespaceAware = false;
+
+ private Log log;
+
+ private String xPath;
+
+ private String keyXPath;
+
+ private String [] sortBy = {};
+
+ private List<DirectoryItem> directories = new ArrayList<DirectoryItem>();
+
+ public MavenXMLMerge() {
+ }
+
+ public void addDirectory(File dir, String [] includes) {
+ directories.add(new DirectoryItem(dir, includes));
+ }
+
+ public void setSortBy(String ... sortBy) {
+ this.sortBy = sortBy;
+ }
+
+ public void performMerge(XMLMergeCallback callback) throws MojoExecutionException {
+ XMLBodyMerge merge = new XMLBodyMerge(xPath, keyXPath);
+
+ for (DirectoryItem item : directories) {
+ DirectoryScanner ds = new DirectoryScanner();
+ ds.setFollowSymlinks(true);
+ ds.setBasedir(item.baseDir);
+ ds.setIncludes(item.includes);
+ ds.addDefaultExcludes();
+ ds.scan();
+ String[] files = ds.getIncludedFiles();
+ for (String file : files) {
+ File sourceFile = new File(item.baseDir, file);
+ if (log != null){
+ log.info("Process file " + sourceFile.getPath());
+ }
+ try {
+ XMLBody configBody = new XMLBody();
+ configBody.loadXML(new FileInputStream(sourceFile), namespaceAware);
+ merge.add(configBody);
+
+ } catch (FileNotFoundException e) {
+ throw new MojoExecutionException("Could't read file "
+ + sourceFile.getPath(), e);
+ } catch (ParsingException e) {
+ throw new MojoExecutionException(
+ "Error parsing config file "
+ + sourceFile.getPath(), e);
+ }
+
+ }
+ }
+
+ if (sortBy != null) {
+ merge.sort(new XPathComparator(sortBy));
+ }
+
+ try {
+ callback.onMergeComplete(merge.getContent());
+ } catch (Exception e) {
+ throw new MojoExecutionException("Exception uring XML merge", e);
+ }
+ }
+
+ public void setNamespaceAware(boolean namespaceAware) {
+ this.namespaceAware = namespaceAware;
+ }
+
+ public void setLog(Log log) {
+ this.log = log;
+ }
+
+ public void setXPath(String path) {
+ xPath = path;
+ }
+
+ public void setKeyXPath(String keyXPath) {
+ this.keyXPath = keyXPath;
+ }
+}
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/VelocityTaglibMergeCallBack.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/maven/VelocityTaglibMergeCallBack.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/VelocityTaglibMergeCallBack.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,56 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.maven;
-
-import java.io.File;
-import java.io.FileWriter;
-
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.codehaus.plexus.velocity.VelocityComponent;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class VelocityTaglibMergeCallBack implements XMLMergeCallback {
-
- private File target;
-
- private String template;
-
- private VelocityComponent velocity;
-
- private VelocityContext initialContext;
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.builder.maven.XMLMergeCallback#onMergeComplete(java.lang.String)
- */
- public void onMergeComplete(String mergedContent) throws Exception{
-
- VelocityContext velocityContext;
-
- if (initialContext != null) {
- velocityContext = new VelocityContext(initialContext);
- } else {
- velocityContext = new VelocityContext();
- }
-
- VelocityEngine velocityEngine = velocity.getEngine();
- Template template2 = velocityEngine.getTemplate(template);
-
- File parentFile = target.getParentFile();
- if (!parentFile.exists()) {
- parentFile.mkdirs();
- }
-
- FileWriter fileWriter = new FileWriter(target);
-
- template2.merge(velocityContext, fileWriter);
- fileWriter.flush();
- fileWriter.close();
- }
-
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/VelocityTaglibMergeCallBack.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/maven/VelocityTaglibMergeCallBack.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/VelocityTaglibMergeCallBack.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/VelocityTaglibMergeCallBack.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,74 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.maven;
+
+import java.io.File;
+import java.io.FileWriter;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.codehaus.plexus.velocity.VelocityComponent;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class VelocityTaglibMergeCallBack implements XMLMergeCallback {
+
+ private File target;
+
+ private String template;
+
+ private VelocityComponent velocity;
+
+ private VelocityContext initialContext;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.builder.maven.XMLMergeCallback#onMergeComplete(java.lang.String)
+ */
+ public void onMergeComplete(String mergedContent) throws Exception{
+
+ VelocityContext velocityContext;
+
+ if (initialContext != null) {
+ velocityContext = new VelocityContext(initialContext);
+ } else {
+ velocityContext = new VelocityContext();
+ }
+
+ VelocityEngine velocityEngine = velocity.getEngine();
+ Template template2 = velocityEngine.getTemplate(template);
+
+ File parentFile = target.getParentFile();
+ if (!parentFile.exists()) {
+ parentFile.mkdirs();
+ }
+
+ FileWriter fileWriter = new FileWriter(target);
+
+ template2.merge(velocityContext, fileWriter);
+ fileWriter.flush();
+ fileWriter.close();
+ }
+
+}
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/XMLMergeCallback.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/maven/XMLMergeCallback.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/XMLMergeCallback.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,13 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.maven;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface XMLMergeCallback {
- void onMergeComplete(String mergedContent) throws Exception;
-
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/XMLMergeCallback.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/maven/XMLMergeCallback.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/XMLMergeCallback.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/XMLMergeCallback.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,31 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.maven;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface XMLMergeCallback {
+ void onMergeComplete(String mergedContent) throws Exception;
+
+}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo (from rev 14075, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo)
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCDKMojo.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCDKMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,341 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.mojo;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.maven.artifact.DependencyResolutionRequiredException;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.project.MavenProject;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.exception.MethodInvocationException;
-import org.apache.velocity.exception.ParseErrorException;
-import org.apache.velocity.exception.ResourceNotFoundException;
-import org.codehaus.plexus.velocity.DefaultVelocityComponent;
-import org.codehaus.plexus.velocity.VelocityComponent;
-
-/**
- * @author shura
- *
- */
-public abstract class AbstractCDKMojo extends AbstractMojo {
-
- /**
- * Top maven project.
- *
- * @parameter expression="${project}"
- * @readonly
- */
- protected MavenProject project;
- /**
- *
- * @parameter
- */
- protected String key;
- /**
- * Place for component configuration XML files. All '*.xml' files wil be
- * parsed as components config. All '*.ent' files will be processed as
- * include configurations.
- *
- * @parameter expression="src/main/config/component"
- */
- protected File componentConfigDirectory;
- /**
- * Place for validator configuration XML files. All '*.xml' files wil be
- * parsed as component config. All '*.ent' files will be processed as
- * include configurations.
- *
- * @parameter expression="src/main/config/validator"
- */
- protected File validatorConfigDirectory;
-
- /**
- * Place for converter configuration XML files. All '*.xml' files wil be
- * parsed as components config. All '*.ent' files will be processed as
- * include configurations.
- *
- * @parameter expression="src/main/config/converter"
- */
- protected File converterConfigDirectory;
-
- /**
- * Place for faces configuration XML files
- *
- * @parameter expression="src/main/config/faces"
- */
- protected File facesConfigInclude;
- /**
- * Place for component configuration XML files
- *
- * @parameter expression="src/main/config/taglib"
- */
- protected File taglibInclude;
- /**
- * Place for component configuration XML files
- *
- * @parameter expression="src/main/config/resources"
- */
- protected File resourcesInclude;
- /**
- *
- * @parameter expression="src/main/templates"
- */
- protected File templatesDirectory;
- /**
- * Directory where the output Java Files will be located.
- *
- * @parameter expression="${project.build.directory}/generated-component/java"
- */
- protected File outputJavaDirectory;
-
- /**
- * @parameter expression="${project.build.directory}/generated-component/test"
- */
- protected File outputTestsDirectory;
-
- /**
- * Directory where the output Java Files will be located.
- *
- * @parameter expression="${project.build.directory}/generated-component/resources"
- */
- protected File outputResourcesDirectory;
- /**
- * @parameter
- */
- protected Library library;
- /**
- * The source directories containing the sources to be compiled.
- *
- * @parameter expression="${project.compileSourceRoots}"
- * @required
- * @readonly
- */
- protected List compileSourceRoots;
- /**
- * Project classpath.
- *
- * @parameter expression="${project.compileClasspathElements}"
- * @required
- * @readonly
- */
- protected List classpathElements;
- /**
- * The directory for compiled classes.
- *
- * @parameter expression="${project.build.outputDirectory}"
- * @required
- * @readonly
- */
- protected File outputDirectory;
- /**
- * @component
- */
- protected VelocityComponent velocity;
- /**
- * Check library configuration, and fill all empty values to default.
- *
- * @return
- */
- protected Taglib checkLibraryConfig() {
- if (null != library) {
- getLog().debug("Library prefix is " + library.getPrefix());
- } else {
- library = new Library();
- }
- if (null == library.getPrefix()) {
- library.setPrefix(project.getGroupId());
-
- }
- getLog().debug("Default prefix for a generated packages: "+library.getPrefix());
- if (null == library.getDescription()) {
- library.setDescription(project.getDescription());
- }
- getLog().debug("Library description: "+library.getDescription());
- if( null == library.getJsfVersion()){
- String version = Library.JSF11;
- // Check version-specific methods in UIComponent class
- try {
- Class<?> componentClass = createProjectClassLoader(project, false).loadClass("javax.faces.component.UIComponent");
- Method[] methods = componentClass.getDeclaredMethods();
- for (int i = 0; i < methods.length; i++) {
- if("encodeAll".equals(methods[i].getName())){
- version = Library.JSF12;
- break;
- }
- }
- } catch (ClassNotFoundException e) {
- // Ignore - by defaule, generate codes for JSF 1.1
- }
- library.setJsfVersion(version);
- }
-
- //velocity = new DefaultVelocityComponent();
-
- getLog().debug("Generate files for a JSF "+library.getJsfVersion());
- Renderkit[] renderkits = library.getRenderkits();
- if (null != renderkits) {
- for (int i = 0; i < renderkits.length; i++) {
- Renderkit renderkit = renderkits[i];
- getLog().debug("Renderkit name is " + renderkit.getName());
- if(null == renderkit.getPackage()){
- renderkit.setPackage(library.getPrefix()+".renderkit."+renderkit.getName().toLowerCase());
- }
- }
- } else {
- renderkits = new Renderkit[1];
- Renderkit renderkit = new Renderkit();
- renderkit.setMarkup("html");
- renderkit.setName("HTML_BASIC");
- renderkit.setPackage(library.getPrefix()+".renderkit."+renderkit.getName().toLowerCase());
- renderkits[0] = renderkit;
- library.setRenderkits(renderkits);
- }
- Taglib taglib = library.getTaglib();
- if (null != taglib) {
- getLog().debug("Taglib uri is " + taglib.getUri());
- getLog().debug("Taglib shortname is " + taglib.getShortName());
- } else {
- taglib = new Taglib();
- library.setTaglib(taglib);
- }
- if (null == taglib.getDisplayName()) {
- taglib.setDisplayName(project.getDescription());
-
- }
- if( null == taglib.getJspVersion()){
- // Jsf 1.2 can use JSP 2.1 only, other - 2.0
- taglib.setJspVersion(library.getJsfVersion().equals(Library.JSF12)?"2.1":"1.2");
- }
- if (null == taglib.getUri()) {
- String url = project.getUrl();
- if (null == url) {
- url = "http://";
- String[] parts = project.getGroupId().split(".");
- for (int i = parts.length - 1; i >= 0; i--) {
- url = url + parts[i];
- if (i > 0) {
- url = url + ".";
- }
- }
- url = url + "/" + project.getArtifactId();
- }
- taglib.setUri(url);
-
- }
- if (null == taglib.getShortName()) {
- taglib.setShortName(project.getArtifactId());
-
- }
- if(null == taglib.getTaglib()){
- taglib.setTaglib(taglib.getShortName());
- }
- getLog().debug("Taglib uri is " + taglib.getUri());
- getLog().debug("Taglib shortname is " + taglib.getShortName());
- if (null != library.getTaglibs() && library.getTaglibs().length > 0) {
- for (int i = 0; i < library.getTaglibs().length; i++) {
- Taglib t = library.getTaglibs()[i];
- checkTaglib(t);
- }
- }
- return taglib;
- }
-
- protected void writeParsedTemplate(String templateName, VelocityContext context, File configFile) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException, Exception {
- File dir = configFile.getParentFile();
- if(!dir.exists()){
- dir.mkdirs();
- }
- VelocityEngine engine = velocity.getEngine();
- FileWriter fileWriter = new FileWriter(configFile);
- Template velocityTemplate = engine.getTemplate(templateName);
- velocityTemplate.merge(context, fileWriter);
- fileWriter.flush();
- fileWriter.close();
- }
-
- protected ClassLoader createProjectClassLoader(MavenProject project, boolean useCCL) {
- ClassLoader classLoader = Thread.currentThread()
- .getContextClassLoader();
- try {
- List<?> compileClasspathElements = project
- .getCompileClasspathElements();
- String outputDirectory = project.getBuild().getOutputDirectory();
- URL[] urls = new URL[compileClasspathElements.size() + 1];
- int i = 0;
- urls[i++] = new File(outputDirectory).toURI().toURL();
- for (Iterator<?> iter = compileClasspathElements.iterator(); iter
- .hasNext();) {
- String element = (String) iter.next();
- urls[i++] = new File(element).toURI().toURL();
- }
-
- if (useCCL) {
- classLoader = new URLClassLoader(urls, classLoader);
- } else {
- classLoader = new URLClassLoader(urls);
- }
- } catch (MalformedURLException e) {
- getLog().error("Bad URL in classpath", e);
- } catch (DependencyResolutionRequiredException e) {
- getLog().error("Dependencies not resolved ", e);
- }
-
- return classLoader;
- }
-
- protected ClassLoader createProjectClassLoader(MavenProject project) {
- return createProjectClassLoader(project, true);
- }
-
- protected void checkTaglib(Taglib taglib) {
- if (null == taglib.getDisplayName()) {
- taglib.setDisplayName(library.getTaglib().getDisplayName());
- }
- if (null == taglib.getShortName()) {
- taglib.setShortName(library.getTaglib().getShortName());
- }
- if (null == taglib.getJspVersion()) {
- taglib.setJspVersion(library.getTaglib().getJspVersion());
- }
- if (null == taglib.getUri()) {
- taglib.setUri(library.getTaglib().getUri() + "/"
- + taglib.getShortName());
- }
- if(null == taglib.getTaglib()){
- taglib.setTaglib(taglib.getShortName());
- }
- getLog().debug("Taglib uri is " + taglib.getUri());
- getLog().debug("Taglib shortname is " + taglib.getShortName());
-
- }
-
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCDKMojo.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCDKMojo.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCDKMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,361 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DependencyResolutionRequiredException;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.project.MavenProject;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.exception.MethodInvocationException;
+import org.apache.velocity.exception.ParseErrorException;
+import org.apache.velocity.exception.ResourceNotFoundException;
+import org.codehaus.plexus.velocity.VelocityComponent;
+
+/**
+ * @author shura
+ *
+ */
+public abstract class AbstractCDKMojo extends AbstractMojo {
+
+ /**
+ * Top maven project.
+ *
+ * @parameter expression="${project}"
+ * @readonly
+ */
+ protected MavenProject project;
+ /**
+ *
+ * @parameter
+ */
+ protected String key;
+ /**
+ * Place for component configuration XML files. All '*.xml' files wil be
+ * parsed as components config. All '*.ent' files will be processed as
+ * include configurations.
+ *
+ * @parameter expression="src/main/config/component"
+ */
+ protected File componentConfigDirectory;
+ /**
+ * Place for validator configuration XML files. All '*.xml' files wil be
+ * parsed as component config. All '*.ent' files will be processed as
+ * include configurations.
+ *
+ * @parameter expression="src/main/config/validator"
+ */
+ protected File validatorConfigDirectory;
+
+ /**
+ * Place for converter configuration XML files. All '*.xml' files wil be
+ * parsed as components config. All '*.ent' files will be processed as
+ * include configurations.
+ *
+ * @parameter expression="src/main/config/converter"
+ */
+ protected File converterConfigDirectory;
+
+ /**
+ * Place for faces configuration XML files
+ *
+ * @parameter expression="src/main/config/faces"
+ */
+ protected File facesConfigInclude;
+ /**
+ * Place for component configuration XML files
+ *
+ * @parameter expression="src/main/config/taglib"
+ */
+ protected File taglibInclude;
+ /**
+ * Place for component configuration XML files
+ *
+ * @parameter expression="src/main/config/resources"
+ */
+ protected File resourcesInclude;
+ /**
+ *
+ * @parameter expression="src/main/templates"
+ */
+ protected File templatesDirectory;
+ /**
+ * Directory where the output Java Files will be located.
+ *
+ * @parameter expression="${project.build.directory}/generated-component/java"
+ */
+ protected File outputJavaDirectory;
+
+ /**
+ * @parameter expression="${project.build.directory}/generated-component/test"
+ */
+ protected File outputTestsDirectory;
+
+ /**
+ * Directory where the output Java Files will be located.
+ *
+ * @parameter expression="${project.build.directory}/generated-component/resources"
+ */
+ protected File outputResourcesDirectory;
+ /**
+ * @parameter
+ */
+ protected Library library;
+ /**
+ * The source directories containing the sources to be compiled.
+ *
+ * @parameter expression="${project.compileSourceRoots}"
+ * @required
+ * @readonly
+ */
+ protected List compileSourceRoots;
+ /**
+ * Project classpath.
+ *
+ * @parameter expression="${project.compileClasspathElements}"
+ * @required
+ * @readonly
+ */
+ protected List classpathElements;
+ /**
+ * The directory for compiled classes.
+ *
+ * @parameter expression="${project.build.outputDirectory}"
+ * @required
+ * @readonly
+ */
+ protected File outputDirectory;
+ /**
+ * @component
+ */
+ protected VelocityComponent velocity;
+ /**
+ * Check library configuration, and fill all empty values to default.
+ *
+ * @return
+ */
+ protected Taglib checkLibraryConfig() {
+ if (null != library) {
+ getLog().debug("Library prefix is " + library.getPrefix());
+ } else {
+ library = new Library();
+ }
+ if (null == library.getPrefix()) {
+ library.setPrefix(project.getGroupId());
+
+ }
+ getLog().debug("Default prefix for a generated packages: "+library.getPrefix());
+ if (null == library.getDescription()) {
+ library.setDescription(project.getDescription());
+ }
+ getLog().debug("Library description: "+library.getDescription());
+ if( null == library.getJsfVersion()){
+ String version = Library.JSF11;
+ // Check version-specific methods in UIComponent class
+ try {
+ Class<?> componentClass = createProjectClassLoader(project, false).loadClass("javax.faces.component.UIComponent");
+ Method[] methods = componentClass.getDeclaredMethods();
+ for (int i = 0; i < methods.length; i++) {
+ if("encodeAll".equals(methods[i].getName())){
+ version = Library.JSF12;
+ break;
+ }
+ }
+ } catch (ClassNotFoundException e) {
+ // Ignore - by defaule, generate codes for JSF 1.1
+ }
+ library.setJsfVersion(version);
+ }
+
+ //velocity = new DefaultVelocityComponent();
+
+ getLog().debug("Generate files for a JSF "+library.getJsfVersion());
+ Renderkit[] renderkits = library.getRenderkits();
+ if (null != renderkits) {
+ for (int i = 0; i < renderkits.length; i++) {
+ Renderkit renderkit = renderkits[i];
+ getLog().debug("Renderkit name is " + renderkit.getName());
+ if(null == renderkit.getPackage()){
+ renderkit.setPackage(library.getPrefix()+".renderkit."+renderkit.getName().toLowerCase());
+ }
+ }
+ } else {
+ renderkits = new Renderkit[1];
+ Renderkit renderkit = new Renderkit();
+ renderkit.setMarkup("html");
+ renderkit.setName("HTML_BASIC");
+ renderkit.setPackage(library.getPrefix()+".renderkit."+renderkit.getName().toLowerCase());
+ renderkits[0] = renderkit;
+ library.setRenderkits(renderkits);
+ }
+ Taglib taglib = library.getTaglib();
+ if (null != taglib) {
+ getLog().debug("Taglib uri is " + taglib.getUri());
+ getLog().debug("Taglib shortname is " + taglib.getShortName());
+ } else {
+ taglib = new Taglib();
+ library.setTaglib(taglib);
+ }
+ if (null == taglib.getDisplayName()) {
+ taglib.setDisplayName(project.getDescription());
+
+ }
+ if( null == taglib.getJspVersion()){
+ // Jsf 1.2 can use JSP 2.1 only, other - 2.0
+ taglib.setJspVersion(library.getJsfVersion().equals(Library.JSF12)?"2.1":"1.2");
+ }
+ if (null == taglib.getUri()) {
+ String url = project.getUrl();
+ if (null == url) {
+ url = "http://";
+ String[] parts = project.getGroupId().split(".");
+ for (int i = parts.length - 1; i >= 0; i--) {
+ url = url + parts[i];
+ if (i > 0) {
+ url = url + ".";
+ }
+ }
+ url = url + "/" + project.getArtifactId();
+ }
+ taglib.setUri(url);
+
+ }
+ if (null == taglib.getShortName()) {
+ taglib.setShortName(project.getArtifactId());
+
+ }
+ if(null == taglib.getTaglib()){
+ taglib.setTaglib(taglib.getShortName());
+ }
+
+ if (null == taglib.getTlibVersion()) {
+ taglib.setTlibVersion(createTaglibVersionFromProjectVersion());
+ }
+ getLog().debug("Taglib uri is " + taglib.getUri());
+ getLog().debug("Taglib shortname is " + taglib.getShortName());
+ if (null != library.getTaglibs() && library.getTaglibs().length > 0) {
+ for (int i = 0; i < library.getTaglibs().length; i++) {
+ Taglib t = library.getTaglibs()[i];
+ checkTaglib(t);
+ }
+ }
+ return taglib;
+ }
+
+ private String createTaglibVersionFromProjectVersion() {
+ Artifact artifact = project.getArtifact();
+ String version = artifact.getVersion();
+ Matcher matcher = Pattern.compile("^(\\d+(?:\\.\\d+)*)").matcher(version);
+ if (matcher.find()) {
+ return matcher.group(1);
+ }
+
+ return "1.2";
+ }
+
+ protected void writeParsedTemplate(String templateName, VelocityContext context, File configFile) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException, Exception {
+ File dir = configFile.getParentFile();
+ if(!dir.exists()){
+ dir.mkdirs();
+ }
+ VelocityEngine engine = velocity.getEngine();
+ FileWriter fileWriter = new FileWriter(configFile);
+ Template velocityTemplate = engine.getTemplate(templateName);
+ velocityTemplate.merge(context, fileWriter);
+ fileWriter.flush();
+ fileWriter.close();
+ }
+
+ protected ClassLoader createProjectClassLoader(MavenProject project, boolean useCCL) {
+ ClassLoader classLoader = Thread.currentThread()
+ .getContextClassLoader();
+ try {
+ List<?> compileClasspathElements = project
+ .getCompileClasspathElements();
+ String outputDirectory = project.getBuild().getOutputDirectory();
+ URL[] urls = new URL[compileClasspathElements.size() + 1];
+ int i = 0;
+ urls[i++] = new File(outputDirectory).toURI().toURL();
+ for (Iterator<?> iter = compileClasspathElements.iterator(); iter
+ .hasNext();) {
+ String element = (String) iter.next();
+ urls[i++] = new File(element).toURI().toURL();
+ }
+
+ if (useCCL) {
+ classLoader = new URLClassLoader(urls, classLoader);
+ } else {
+ classLoader = new URLClassLoader(urls);
+ }
+ } catch (MalformedURLException e) {
+ getLog().error("Bad URL in classpath", e);
+ } catch (DependencyResolutionRequiredException e) {
+ getLog().error("Dependencies not resolved ", e);
+ }
+
+ return classLoader;
+ }
+
+ protected ClassLoader createProjectClassLoader(MavenProject project) {
+ return createProjectClassLoader(project, true);
+ }
+
+ protected void checkTaglib(Taglib taglib) {
+ if (null == taglib.getDisplayName()) {
+ taglib.setDisplayName(library.getTaglib().getDisplayName());
+ }
+ if (null == taglib.getShortName()) {
+ taglib.setShortName(library.getTaglib().getShortName());
+ }
+ if (null == taglib.getJspVersion()) {
+ taglib.setJspVersion(library.getTaglib().getJspVersion());
+ }
+ if (null == taglib.getUri()) {
+ taglib.setUri(library.getTaglib().getUri() + "/"
+ + taglib.getShortName());
+ }
+ if(null == taglib.getTaglib()){
+ taglib.setTaglib(taglib.getShortName());
+ }
+ if (null == taglib.getTlibVersion()) {
+ taglib.setTlibVersion(createTaglibVersionFromProjectVersion());
+ }
+ getLog().debug("Taglib uri is " + taglib.getUri());
+ getLog().debug("Taglib shortname is " + taglib.getShortName());
+ getLog().debug("Taglib version is " + taglib.getTlibVersion());
+ }
+
+}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCreateMojo.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCreateMojo.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCreateMojo.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCreateMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,141 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.aja4jsf.builder.model.Resource;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.velocity.VelocityContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public abstract class AbstractCreateMojo extends AbstractCDKMojo {
+
+ protected static final String SRC_MAIN_RESOURCES = "src/main/resources";
+
+ protected static final Set<String> JAVA_RESERVED_WORDS;
+
+ static{
+ JAVA_RESERVED_WORDS = new HashSet<String>();
+ JAVA_RESERVED_WORDS.add("abstract");
+ JAVA_RESERVED_WORDS.add("assert");
+ JAVA_RESERVED_WORDS.add("boolean");
+ JAVA_RESERVED_WORDS.add("break");
+ JAVA_RESERVED_WORDS.add("byte");
+ JAVA_RESERVED_WORDS.add("case");
+ JAVA_RESERVED_WORDS.add("catch");
+ JAVA_RESERVED_WORDS.add("char");
+ JAVA_RESERVED_WORDS.add("class");
+ JAVA_RESERVED_WORDS.add("const");
+ JAVA_RESERVED_WORDS.add("continue");
+ JAVA_RESERVED_WORDS.add("default");
+ JAVA_RESERVED_WORDS.add("do");
+ JAVA_RESERVED_WORDS.add("double");
+ JAVA_RESERVED_WORDS.add("else");
+ JAVA_RESERVED_WORDS.add("extends");
+ JAVA_RESERVED_WORDS.add("false");
+ JAVA_RESERVED_WORDS.add("final");
+ JAVA_RESERVED_WORDS.add("finally");
+ JAVA_RESERVED_WORDS.add("float");
+ JAVA_RESERVED_WORDS.add("for");
+ JAVA_RESERVED_WORDS.add("goto");
+ JAVA_RESERVED_WORDS.add("if");
+ JAVA_RESERVED_WORDS.add("implements");
+ JAVA_RESERVED_WORDS.add("import");
+ JAVA_RESERVED_WORDS.add("instanceof");
+ JAVA_RESERVED_WORDS.add("int");
+ JAVA_RESERVED_WORDS.add("interface");
+ JAVA_RESERVED_WORDS.add("long");
+ JAVA_RESERVED_WORDS.add("native");
+ JAVA_RESERVED_WORDS.add("new");
+ JAVA_RESERVED_WORDS.add("null");
+ JAVA_RESERVED_WORDS.add("package");
+ JAVA_RESERVED_WORDS.add("private");
+ JAVA_RESERVED_WORDS.add("protected");
+ JAVA_RESERVED_WORDS.add("public");
+ JAVA_RESERVED_WORDS.add("return");
+ JAVA_RESERVED_WORDS.add("short");
+ JAVA_RESERVED_WORDS.add("static");
+ JAVA_RESERVED_WORDS.add("strictfp");
+ JAVA_RESERVED_WORDS.add("super");
+ JAVA_RESERVED_WORDS.add("switch");
+ JAVA_RESERVED_WORDS.add("synchronized");
+ JAVA_RESERVED_WORDS.add("this");
+ JAVA_RESERVED_WORDS.add("throw");
+ JAVA_RESERVED_WORDS.add("throws");
+ JAVA_RESERVED_WORDS.add("transient");
+ JAVA_RESERVED_WORDS.add("true");
+ JAVA_RESERVED_WORDS.add("try");
+ JAVA_RESERVED_WORDS.add("void");
+ JAVA_RESERVED_WORDS.add("volatile");
+ JAVA_RESERVED_WORDS.add("while");
+ }
+
+ protected void checkAndCreateDirectory(File directory)
+ throws MojoExecutionException {
+ getLog().debug("Checking directory " + directory + " for existence");
+ if (!directory.exists()) {
+ directory.mkdirs();
+ getLog().debug("Directory " + directory + " created");
+ }
+ if (!directory.isDirectory()) {
+ throw new MojoExecutionException("Directory " + directory.getAbsolutePath() + " is not a Directory");
+ }
+ }
+
+ protected void filterJarResource(Resource template, Resource skinResource, File baseDir,
+ VelocityContext context) throws Exception {
+ File newFile = new File(baseDir, skinResource.getPath());
+ if (newFile.exists()) {
+ getLog().debug("File " + newFile + " already exists. Skipping.");
+ } else {
+ try {
+ writeParsedTemplate(template.getPath(), context, newFile);
+ } catch (Exception e) {
+ throw new MojoExecutionException("Unable to write file " + newFile, e);
+ }
+ }
+ }
+
+ protected boolean isValidJavaName(String name) {
+ return !JAVA_RESERVED_WORDS.contains(name);
+ }
+
+ protected boolean isValidPackageName(String packageName) {
+ if (packageName != null) {
+ String[] packageNameSegments = packageName.split("\\.");
+ for (String packageNameSegment : packageNameSegments) {
+ if (!isValidJavaName(packageNameSegment)) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+}
Modified: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyAttachedLibraryMojo.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyAttachedLibraryMojo.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyAttachedLibraryMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.mojo;
+package org.richfaces.builder.mojo;
import java.io.File;
import java.io.FileInputStream;
@@ -38,11 +38,6 @@
import java.util.Map;
import java.util.Set;
-import org.ajax4jsf.builder.config.ParsingException;
-import org.ajax4jsf.builder.xml.NamesListComparator;
-import org.ajax4jsf.builder.xml.XMLBody;
-import org.ajax4jsf.builder.xml.XMLBodyMerge;
-import org.ajax4jsf.builder.xml.XPathComparator;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
@@ -63,6 +58,11 @@
import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.manager.ArchiverManager;
import org.codehaus.plexus.util.DirectoryScanner;
+import org.richfaces.builder.config.ParsingException;
+import org.richfaces.builder.xml.NamesListComparator;
+import org.richfaces.builder.xml.XMLBody;
+import org.richfaces.builder.xml.XMLBodyMerge;
+import org.richfaces.builder.xml.XPathComparator;
import org.w3c.dom.Node;
/**
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,918 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.mojo;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.ajax4jsf.builder.config.ParsingException;
-import org.ajax4jsf.builder.xml.NamesListComparator;
-import org.ajax4jsf.builder.xml.XMLBody;
-import org.ajax4jsf.builder.xml.XMLBodyMerge;
-import org.ajax4jsf.builder.xml.XPathComparator;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Parent;
-import org.apache.maven.model.Resource;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
-import org.apache.maven.project.ProjectBuildingException;
-import org.apache.velocity.VelocityContext;
-import org.codehaus.plexus.archiver.UnArchiver;
-import org.codehaus.plexus.archiver.manager.ArchiverManager;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.w3c.dom.Node;
-
-/**
- * This plugin assembly full components library from modules, included in parent
- * project. Steps to create library : 1. Got parent project, and check modules
- * included in them. 2. For every module , build project and got it properties.
- * 3. Resolve module artifact, check for "jar" type and include/exclude
- * criteria. for accepted modules, unpack it to classes directory, and put
- * config files in separate directories. 4. Append unpacked directory to
- * resources, included in result jar. 5. Merge all META-INF/faces-config.xml ,
- * *.tld, *.taglib.xml , resources-config.xml into ones. 6. append dependencies
- * of included projects to this.
- *
- * @author shura
- * @goal assembly
- * @requiresDependencyResolution compile
- * @phase generate-resources
- */
-public class AssemblyLibraryMojo extends AbstractCDKMojo {
-
- private static final String TEMPLATES_PREFIX = "/templates/";
-
- private static final String TEMPLATES12_PREFIX = "/templates12/";
-
- private static final String FACES_CONFIG_TEMPLATE = "faces-config.vm";
-
- private static final String RESOURCES_CONFIG_TEMPLATE = "resources-config.vm";
-
- private static final String XCSS_TEMPLATE = "xcss.vm";
-
- private static final String TLD_TEMPLATE = "tld.vm";
-
- private static final String TAGLIB_TEMPLATE = "taglib.vm";
-
- private static final String[] TLD_TAG_NAMES = new String[] {
- "description", "display-name", "icon", "tlib-version",
- "short-name", "uri", "validator", "listener", "tag",
- "tag-file", "function", "taglib-extension"
- };
-
- private static final String[] TAGLIB_TAG_NAMES = new String[] {
- "library-class", "namespace", "tag", "function"
- };
-
- private static final Comparator<Node> TLD_COMPARATOR = new NamesListComparator(
- new XPathComparator("listener-class/text()", "name/text()"), TLD_TAG_NAMES);
-
- private static final Comparator<Node> FACELET_COMPARATOR = new NamesListComparator(
- new XPathComparator("function-name/text()", "tag-name/text()"), TAGLIB_TAG_NAMES);
-
- /**
- * Used to look up Artifacts in the remote repository.
- *
- * @component
- */
- private org.apache.maven.artifact.factory.ArtifactFactory factory;
-
- /**
- * Used to look up Artifacts in the remote repository.
- *
- * @component
- */
- private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
-
- /**
- * The local repository.
- *
- * @parameter expression="${localRepository}"
- */
- private ArtifactRepository localRepository;
-
- /**
- * To look up Archiver/UnArchiver implementations
- *
- * @component
- */
- private ArchiverManager archiverManager;
-
- /**
- * Project builder
- *
- * @component
- */
- private MavenProjectBuilder mavenProjectBuilder;
-
- /**
- * The reactor projects.
- *
- * @parameter expression="${reactorProjects}"
- * @required
- * @readonly
- */
- private List reactorProjects;
-
- /**
- * The reactor projects.
- *
- * @parameter expression="${project.parent}"
- * @readonly
- */
- private MavenProject parentProject;
-
- /**
- * The list of resources we want to transfer.
- *
- * @parameter default-value="src/main/config"
- */
- private File config;
-
- /**
- * The directory for compiled classes.
- *
- * @parameter expression="${project.build.directory}"
- * @required
- * @readonly
- */
- private File buildDirectory;
-
- /**
- * @parameter default-value="${project.build.directory}/modules"
- */
- private File modulesDirectory;
-
- /**
- * The directory for compiled classes.
- *
- * @parameter expression="${project.build.directory}/pom.xml"
- * @required
- * @readonly
- */
- private File generatedPom;
-
- /**
- * The directory for compiled classes.
- *
- * @parameter expression="${project.build.directory}/src"
- * @required
- * @readonly
- */
- private File modulesSrc;
-
- /**
- * @parameter
- */
- private String templates;
-
- /**
- * @parameter
- */
- private String includeTld = "META-INF/*.tld";
-
- /**
- * @parameter
- */
- private String includeTaglib = "META-INF/*.taglib.xml";
-
- /**
- * @parameter
- */
- private String includeXcss = "**/*.xcss";
-
- /**
- * @parameter
- */
- private String excludeXcss = null;
-
- /**
- * @parameter
- */
- private String commonStyle;
-
- /**
- * @parameter
- */
- private String templateXpath;
-
- /**
- *
- */
- public AssemblyLibraryMojo() {
- // used for plexus init.
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.maven.plugin.Mojo#execute()
- */
- public void execute() throws MojoExecutionException, MojoFailureException {
- setupParentProject();
- checkLibraryConfig();
- if (null == templates) {
- templates = Library.JSF12.equals(library.getJsfVersion()) ? TEMPLATES12_PREFIX
- : TEMPLATES_PREFIX;
- }
- List<Model> models = extractModules();
- mergeFacesConfig(models);
- File resourcesConfig = new File(outputDirectory,
- "META-INF/resources-config.xml");
- mergeXML(models, "META-INF/resources-config.xml", null,
- RESOURCES_CONFIG_TEMPLATE, "/resource-config/resource",
- "name/text()", new VelocityContext(), resourcesConfig, false, null);
- if (null != commonStyle) {
- File commonXcss = new File(outputDirectory, commonStyle);
- mergeXML(models, includeXcss, excludeXcss, XCSS_TEMPLATE,
- templateXpath, null, new VelocityContext(), commonXcss, true, null);
- }
-
- if (null != library.getTaglibs() && library.getTaglibs().length > 0) {
- for (int i = 0; i < library.getTaglibs().length; i++) {
- Taglib taglib = library.getTaglibs()[i];
- List<Model> taglibModels;
- if (taglib.getIncludeModules() == null
- && taglib.getExcludeModules() == null) {
- taglibModels = models;
- } else {
- String[] includeModules = null;
- String[] excludeModules = null;
- if (null != taglib.getIncludeModules()) {
- includeModules = taglib.getIncludeModules().split(",");
- Arrays.sort(includeModules);
- }
- if (null != taglib.getExcludeModules()) {
- excludeModules = taglib.getExcludeModules().split(",");
- Arrays.sort(excludeModules);
- }
- taglibModels = new ArrayList<Model>();
- for (Iterator iterator = models.iterator(); iterator
- .hasNext();) {
- Model model = (Model) iterator.next();
- String id = model.getArtifactId();
- if ((includeModules == null || Arrays.binarySearch(
- includeModules, id) >= 0)
- && (excludeModules == null || Arrays
- .binarySearch(excludeModules, id) < 0)) {
- taglibModels.add(model);
- }
- }
- }
- generateTaglib(taglibModels, taglib);
- }
- } else {
- generateTaglib(models, library.getTaglib());
- }
- }
-
- /**
- * @param models
- * @throws MojoExecutionException
- */
- private void generateTaglib(List<Model> models, Taglib taglib)
- throws MojoExecutionException {
- getLog().debug(
- "Assembly taglib for uri " + taglib.getUri()
- + " with short name " + taglib.getShortName());
- VelocityContext taglibContext = new VelocityContext();
- taglibContext.put("taglib", taglib);
- // Build includes/excludes Xpath condition
- String nameTag = "name";
- createTagCondition(taglib, nameTag);
- File tld = new File(outputDirectory, "META-INF/" + taglib.getTaglib()
- + ".tld");
- getLog().debug("Write JSP taglib " + tld.getPath());
- String commonXPath = "/taglib/tag"
- + createTagCondition(taglib, "name") + " | /taglib/listener | /taglib/function";
-
- mergeXML(models, includeTld, null, TLD_TEMPLATE, commonXPath,
- "listener-class/text() | name/text()", new VelocityContext(taglibContext), tld, false, TLD_COMPARATOR);
-
-
- File faceletsTaglib = new File(outputDirectory, "META-INF/"
- + taglib.getTaglib() + ".taglib.xml");
- commonXPath = "/facelet-taglib/tag"
- + createTagCondition(taglib, "tag-name")
- + " | /facelet-taglib/function";
-
- mergeXML(models, includeTaglib, null, TAGLIB_TEMPLATE, commonXPath, "tag-name/text() | function-name/text()", new VelocityContext(
- taglibContext), faceletsTaglib, false, FACELET_COMPARATOR);
- getLog().debug("Write Facelets taglib " + faceletsTaglib.getPath());
- }
-
- /**
- * @param taglib
- * @param nameTag
- */
- private String createTagCondition(Taglib taglib, String nameTag) {
- StringBuffer condition = new StringBuffer();
- if (taglib.getIncludeTags() != null || taglib.getExcludeTags() != null) {
- condition.append('[');
- if (taglib.getIncludeTags() != null) {
- condition.append('(');
- String[] includes = taglib.getIncludeTags().split(",");
- for (int i = 0; i < includes.length; i++) {
- String includeTag = includes[i];
- if (i != 0) {
- condition.append(" or ");
- }
- condition.append("normalize-space(").append(nameTag)
- .append(")='").append(includeTag).append("'");
- }
- condition.append(')');
- }
- if (taglib.getIncludeTags() != null
- && taglib.getExcludeTags() != null) {
- condition.append(" and ");
- }
- if (taglib.getExcludeTags() != null) {
- condition.append('(');
- String[] excludes = taglib.getExcludeTags().split(",");
- for (int i = 0; i < excludes.length; i++) {
- String includeTag = excludes[i];
- if (i != 0) {
- condition.append(" and ");
- }
- condition.append("normalize-space(").append(nameTag)
- .append(")!='").append(includeTag).append("'");
- }
- condition.append(')');
- }
- condition.append(']');
- }
- return condition.toString();
- }
-
- /**
- * @return
- * @throws MojoExecutionException
- */
- private List<Model> extractModules() throws MojoExecutionException {
- List<String> modules = parentProject.getModules();
- List<Model> models = new ArrayList<Model>(modules.size());
- Map<String, Dependency> projectsDependencies = new HashMap<String, Dependency>();
- for (Iterator<String> iter = modules.iterator(); iter.hasNext();) {
- String moduleName = iter.next();
- getLog().info("Parent project have module " + moduleName);
- Model model;
- File f = new File(parentProject.getBasedir(), moduleName
- + "/pom.xml");
- if (f.exists()) {
- try {
- model = mavenProjectBuilder.build(f, localRepository, null)
- .getModel();
- } catch (ProjectBuildingException e) {
- throw new MojoExecutionException(
- "Unable to read local module-POM", e);
- }
- } else {
- getLog().warn("No filesystem module-POM available");
-
- model = new Model();
- model.setName(moduleName);
- model.setUrl(moduleName);
- }
- if (project.getGroupId().equals(model.getGroupId())
- && "jar".equals(model.getPackaging())
- && (!project.getArtifactId().equals(model.getArtifactId()))) {
- // TODO - check include/exclude
- getLog().debug(
- "Project " + model.getName()
- + " included to library set");
- List<Dependency> dependencies = model.getDependencies();
- for (Iterator<Dependency> iterator = dependencies.iterator(); iterator
- .hasNext();) {
- Dependency dependency = iterator.next();
- getLog().debug(
- dependency.getClass().getName() + " : "
- + dependency + " with key: "
- + dependency.getManagementKey());
- if (!"test".equals(dependency.getScope())) {
- projectsDependencies.put(dependency.getManagementKey(),
- dependency);
-
- }
- }
- models.add(model);
- }
- }
- // Remove modules projects from dependencise
- Set<String> unwanted = new HashSet<String>(projectsDependencies.size());
- for (Iterator<Model> iter = models.iterator(); iter.hasNext();) {
- Model model = (Model) iter.next();
- for (Iterator<Dependency> iterator = projectsDependencies.values().iterator(); iterator
- .hasNext();) {
- Dependency dependency = (Dependency) iterator.next();
- if (model.getGroupId().equals(dependency.getGroupId())
- && model.getArtifactId().equals(
- dependency.getArtifactId())) {
- getLog().debug(
- "Remove dependency of library module "
- + dependency.getManagementKey());
- unwanted.add(dependency.getManagementKey());
- }
- }
- // Got module and unpack it to target directory.
- Artifact artifact = factory.createBuildArtifact(model.getGroupId(),
- model.getArtifactId(), model.getVersion(), model
- .getPackaging());
- File moduleDir = new File(modulesDirectory, model.getArtifactId());
- unpackArtifact(artifact, moduleDir, true);
- artifact = factory
- .createArtifactWithClassifier(model.getGroupId(), model
- .getArtifactId(), model.getVersion(), "jar",
- "sources");
- unpackArtifact(artifact, modulesSrc, false);
- }
- // Add projects dependencies to this project
- projectsDependencies.keySet().removeAll(unwanted);
- setupGeneratedProject(projectsDependencies);
- return models;
- }
-
- /**
- * @param projectsDependencies
- * @throws MojoExecutionException
- */
- private void setupGeneratedProject(
- Map<String, Dependency> projectsDependencies)
- throws MojoExecutionException {
- Model generatedProject;
- try {
- MavenXpp3Reader reader = new MavenXpp3Reader();
- generatedProject = reader.read(new FileReader(project.getFile()));
- } catch (Exception e1) {
- throw new MojoExecutionException("Unable to read local POM", e1);
- }
- generatedProject.getDependencies()
- .addAll(projectsDependencies.values());
- writePom(generatedProject);
- project.setDependencies(new ArrayList<Dependency>(projectsDependencies.values()));
- // project.setFile(generatedPom);
- }
-
- /**
- * Check parent project, build if nesessary.
- *
- * @throws MojoFailureException
- */
- protected void setupParentProject() throws MojoFailureException {
- // Parent project not set for a custom lifecycles. Try to load artifact.
- if (null == parentProject || null == parentProject.getFile()) {
- Parent parentModel = project.getModel().getParent();
- if (null != parentModel) {
- String relativePath = parentModel.getRelativePath();
- File parentPom = new File(project.getFile().getAbsoluteFile()
- .getParentFile(), relativePath);
- if (parentPom.isDirectory()) {
- parentPom = new File(parentPom, "pom.xml");
- }
- if (parentPom.exists()) {
- try {
- parentProject = mavenProjectBuilder.build(parentPom,
- localRepository, null);
- if (null == parentProject) {
- throw new MojoFailureException(
- "Components library project must have parent pom with components modules");
- }
- } catch (ProjectBuildingException e) {
- throw new MojoFailureException(
- "Error get parent project for a components library");
- }
- } else {
- throw new MojoFailureException(
- "Parent project pom file not found for a components library");
- }
- } else {
- throw new MojoFailureException(
- "Components library project must have parent pom with components modules");
- }
-
- }
- }
-
- /**
- * @param models
- * @throws MojoExecutionException
- */
- private void mergeFacesConfig(List<Model> models) throws MojoExecutionException {
- StringBuffer facesConfig = new StringBuffer();
- for (int i = 0; i < library.getRenderkits().length; i++) {
- Renderkit kit = library.getRenderkits()[i];
- kit.setContent(new StringBuffer());
- }
- // Process all faces-config.xml from modules
- for (Iterator<Model> iter = models.iterator(); iter.hasNext();) {
- Model model = iter.next();
- File moduleFacesConfig = new File(modulesDirectory, model
- .getArtifactId()
- + "/META-INF/faces-config.xml");
- processFacesConfigFile(facesConfig, moduleFacesConfig);
- }
- // Process faces-config from project resources
- if (null !=config) {
- processFacesConfigFile(facesConfig, new File(config, "META-INF/faces-config.xml"));
- }
- VelocityContext context = new VelocityContext();
- context.put("content", facesConfig.toString());
- context.put("library", library);
- context.put("renderkits", Arrays.asList(library.getRenderkits()));
- try {
- writeParsedTemplate(templates + FACES_CONFIG_TEMPLATE, context,
- new File(outputDirectory, "META-INF/faces-config.xml"));
- } catch (Exception e) {
- throw new MojoExecutionException(
- "Error to process faces-config template", e);
- }
- }
-
- /**
- * @param config
- * @param moduleFacesConfig
- * @throws MojoExecutionException
- */
- private void processFacesConfigFile(StringBuffer config,
- File moduleFacesConfig) throws MojoExecutionException {
- if (moduleFacesConfig.exists()) {
- getLog().info(
- "Process "+moduleFacesConfig.getName());
- XMLBody configBody = new XMLBody();
- try {
- configBody.loadXML(new FileInputStream(moduleFacesConfig));
- config
- .append(configBody
- .getContent("/faces-config/*[name()!=\'render-kit\']"));
- for (int i = 0; i < library.getRenderkits().length; i++) {
- Renderkit kit = library.getRenderkits()[i];
- kit
- .getContent()
- .append(
- configBody
- .getContent("/faces-config/render-kit[child::render-kit-id='"
- + kit.getName()
- + "']/renderer"));
- }
- } catch (FileNotFoundException e) {
- throw new MojoExecutionException(
- "Could't read faces-config file", e);
- } catch (ParsingException e) {
- throw new MojoExecutionException(
- "Error parsing faces-config file", e);
- }
- }
- }
-
- /**
- * Merge XML files from extracted models to one in build directory.
- *
- * @param models
- * models collected in library.
- * @param includes
- * relative path to config file in models/output.
- * @param templateName -
- * name of velocity template for result file.
- * @param commonXpath -
- * XPath expression fof common part of result file.
- * @param keyXPath -
- * XPath expression for key part of common parts
- * @param context -
- * Velocity context for template processing.
- * @param namespaceAware TODO
- * @param keySet -
- * {@link Set} to check for duplicate keys. Must not be null
- * @throws MojoExecutionException
- */
- private void mergeXML(List<Model> models, String includes, String excludes, String templateName,
- String commonXpath, String keyXPath, VelocityContext context,
- File target, boolean namespaceAware, Comparator<Node> comparator) throws MojoExecutionException {
- StringBuffer content = new StringBuffer();
- String[] split = includes.split(",");
- String[] excludesSplit = excludes != null ? excludes.split(",") : null;
- XMLBodyMerge xBodyMerge = new XMLBodyMerge(commonXpath, keyXPath);
- for (Iterator<Model> iter = models.iterator(); iter.hasNext();) {
- Model model = iter.next();
- File moduleDir = new File(modulesDirectory, model.getArtifactId());
- mergeXMLdir(moduleDir, namespaceAware, split, excludesSplit, xBodyMerge);
- }
- if(null!=config){
- mergeXMLdir(config, namespaceAware, split, excludesSplit, xBodyMerge);
- }
-
- if (comparator != null) {
- xBodyMerge.sort(comparator);
- }
- try {
- content.append(xBodyMerge.getContent());
- } catch (Exception e1) {
- throw new MojoExecutionException("XML Merge Exception Occured", e1);
- }
- if (content.length() > 0) {
- context.put("content", content.toString());
- context.put("library", library);
- context.put("models", models);
- try {
- writeParsedTemplate(templates + templateName, context, target);
- } catch (Exception e) {
- throw new MojoExecutionException("Error to process template "
- + templateName + " for files " + includes, e);
- }
-
- }
- }
-
- /**
- * @param moduleDir
- * @param commonXpath
- * @param keyXPath
- * @param namespaceAware
- * @param keySet
- * @param content
- * @param xmls
- * @param split
- * @throws IllegalStateException
- * @throws MojoExecutionException
- */
- private void mergeXMLdir(File moduleDir, boolean namespaceAware, String[] split, String[] excludesSplit, XMLBodyMerge xBodyMerge)
- throws IllegalStateException, MojoExecutionException {
- DirectoryScanner ds = new DirectoryScanner();
- ds.setFollowSymlinks(true);
- ds.setBasedir(moduleDir);
- ds.setIncludes(split);
- ds.setExcludes(excludesSplit);
- ds.addDefaultExcludes();
- ds.scan();
- String[] files = ds.getIncludedFiles();
- for (int i = 0; i < files.length; i++) {
- File moduleFacesConfig = new File(moduleDir, files[i]);
- getLog().info(
- "Process " + files[i] );
- XMLBody configBody = new XMLBody();
- try {
- configBody.loadXML(new FileInputStream(moduleFacesConfig),namespaceAware);
- xBodyMerge.add(configBody);
- } catch (FileNotFoundException e) {
- throw new MojoExecutionException("Could't read file "
- + moduleFacesConfig.getPath(), e);
- } catch (ParsingException e) {
- throw new MojoExecutionException(
- "Error parsing config file "
- + moduleFacesConfig.getPath(), e);
- }
- }
- }
-
- private void unpackArtifact(Artifact artifact, File moduleDir,
- boolean isResource) throws MojoExecutionException {
- try {
- resolver.resolve(artifact, Collections.EMPTY_LIST, localRepository);
- unpack(artifact.getFile(), moduleDir);
- if (isResource) {
- Resource resource = new Resource();
- resource.setDirectory(moduleDir.getPath());
- resource.addExclude("META-INF/faces-config.xml");
- resource.addExclude("META-INF/resources-config.xml");
- resource.addExclude("META-INF/*.taglib.xml");
- resource.addExclude("META-INF/*.tld");
- project.addResource(resource);
-
- }
- } catch (ArtifactResolutionException e) {
- getLog().error("Error with resolve artifact " + artifact, e);
- } catch (ArtifactNotFoundException e) {
- getLog().error("Not found artifact " + artifact, e);
- }
- }
-
- private List<MavenProject> populateReactorProjects() {
- List<MavenProject> projects = new ArrayList<MavenProject>();
- if (reactorProjects != null && reactorProjects.size() > 1) {
- Iterator reactorItr = reactorProjects.iterator();
-
- while (reactorItr.hasNext()) {
- MavenProject reactorProject = (MavenProject) reactorItr.next();
-
- if (reactorProject != null
- && reactorProject.getParent() != null
- && project.getArtifactId().equals(
- reactorProject.getParent().getArtifactId())) {
- String name = reactorProject.getGroupId() + ":"
- + reactorProject.getArtifactId();
- getLog().info("Have reactor project with name " + name);
- projects.add(reactorProject);
- }
- }
- }
- return projects;
- }
-
- /**
- * Unpacks the archive file.
- *
- * @param file
- * File to be unpacked.
- * @param location
- * Location where to put the unpacked files.
- */
- private void unpack(File file, File location) throws MojoExecutionException {
-
- getLog().debug(
- "Unpack file " + file.getAbsolutePath() + " to: "
- + location.getAbsolutePath());
- try {
- location.mkdirs();
-
- UnArchiver unArchiver;
-
- unArchiver = archiverManager.getUnArchiver(file);
-
- unArchiver.setSourceFile(file);
-
- unArchiver.setDestDirectory(location);
-
- unArchiver.setOverwrite(true);
-
- unArchiver.extract();
-
- } catch (Exception e) {
- throw new MojoExecutionException("Error unpacking file: " + file
- + " to: " + location + "\r\n" + e.toString(), e);
- }
- }
-
- private void writePom(Model pom) throws MojoExecutionException {
- MavenXpp3Writer pomWriter = new MavenXpp3Writer();
- try {
- FileWriter out = new FileWriter(generatedPom);
- pomWriter.write(out, pom);
- } catch (IOException e) {
- throw new MojoExecutionException("Error for write generated pom", e);
- }
-
- }
-
- /**
- * @return the archiverManager
- */
- public ArchiverManager getArchiverManager() {
- return this.archiverManager;
- }
-
- /**
- * @param archiverManager
- * the archiverManager to set
- */
- public void setArchiverManager(ArchiverManager archiverManager) {
- this.archiverManager = archiverManager;
- }
-
- /**
- * @return the buildDirectory
- */
- public File getBuildDirectory() {
- return this.buildDirectory;
- }
-
- /**
- * @param buildDirectory
- * the buildDirectory to set
- */
- public void setBuildDirectory(File buildDirectory) {
- this.buildDirectory = buildDirectory;
- }
-
- /**
- * @return the factory
- */
- public org.apache.maven.artifact.factory.ArtifactFactory getFactory() {
- return this.factory;
- }
-
- /**
- * @param factory
- * the factory to set
- */
- public void setFactory(
- org.apache.maven.artifact.factory.ArtifactFactory factory) {
- this.factory = factory;
- }
-
- /**
- * @return the localRepository
- */
- public ArtifactRepository getLocalRepository() {
- return this.localRepository;
- }
-
- /**
- * @param localRepository
- * the localRepository to set
- */
- public void setLocalRepository(ArtifactRepository localRepository) {
- this.localRepository = localRepository;
- }
-
- /**
- * @return the mavenProjectBuilder
- */
- public MavenProjectBuilder getMavenProjectBuilder() {
- return this.mavenProjectBuilder;
- }
-
- /**
- * @param mavenProjectBuilder
- * the mavenProjectBuilder to set
- */
- public void setMavenProjectBuilder(MavenProjectBuilder mavenProjectBuilder) {
- this.mavenProjectBuilder = mavenProjectBuilder;
- }
-
- /**
- * @return the parentProject
- */
- public MavenProject getParentProject() {
- return this.parentProject;
- }
-
- /**
- * @param parentProject
- * the parentProject to set
- */
- public void setParentProject(MavenProject parentProject) {
- this.parentProject = parentProject;
- }
-
- /**
- * @return the reactorProjects
- */
- public List getReactorProjects() {
- return this.reactorProjects;
- }
-
- /**
- * @param reactorProjects
- * the reactorProjects to set
- */
- public void setReactorProjects(List reactorProjects) {
- this.reactorProjects = reactorProjects;
- }
-
- /**
- * @return the resolver
- */
- public org.apache.maven.artifact.resolver.ArtifactResolver getResolver() {
- return this.resolver;
- }
-
- /**
- * @param resolver
- * the resolver to set
- */
- public void setResolver(
- org.apache.maven.artifact.resolver.ArtifactResolver resolver) {
- this.resolver = resolver;
- }
-
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,942 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.Resource;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.velocity.VelocityContext;
+import org.codehaus.plexus.archiver.UnArchiver;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.richfaces.builder.config.ParsingException;
+import org.richfaces.builder.xml.NamesListComparator;
+import org.richfaces.builder.xml.XMLBody;
+import org.richfaces.builder.xml.XMLBodyMerge;
+import org.richfaces.builder.xml.XPathComparator;
+import org.w3c.dom.Node;
+
+/**
+ * This plugin assembly full components library from modules, included in parent
+ * project. Steps to create library : 1. Got parent project, and check modules
+ * included in them. 2. For every module , build project and got it properties.
+ * 3. Resolve module artifact, check for "jar" type and include/exclude
+ * criteria. for accepted modules, unpack it to classes directory, and put
+ * config files in separate directories. 4. Append unpacked directory to
+ * resources, included in result jar. 5. Merge all META-INF/faces-config.xml ,
+ * *.tld, *.taglib.xml, *.component-dependencies.xml , resources-config.xml into ones.
+ * 6. append dependencies of included projects to this.
+ *
+ * @author shura
+ * @goal assembly
+ * @requiresDependencyResolution compile
+ * @phase generate-resources
+ */
+public class AssemblyLibraryMojo extends AbstractCDKMojo {
+
+ private static final String TEMPLATES_PREFIX = "/templates/";
+
+ private static final String TEMPLATES12_PREFIX = "/templates12/";
+
+ private static final String FACES_CONFIG_TEMPLATE = "faces-config.vm";
+
+ private static final String RESOURCES_CONFIG_TEMPLATE = "resources-config.vm";
+
+ private static final String COMPONENT_DEPENDENCIES_TEMPLATE = "component-dependencies.vm";
+
+ private static final String XCSS_TEMPLATE = "xcss.vm";
+
+ private static final String TLD_TEMPLATE = "tld.vm";
+
+ private static final String TAGLIB_TEMPLATE = "taglib.vm";
+
+ private static final String[] TLD_TAG_NAMES = new String[] {
+ "description", "display-name", "icon", "tlib-version",
+ "short-name", "uri", "validator", "listener", "tag",
+ "tag-file", "function", "taglib-extension"
+ };
+
+ private static final String[] TAGLIB_TAG_NAMES = new String[] {
+ "library-class", "namespace", "tag", "function"
+ };
+
+ private static final String[] DEPENDENCIES_TAG_NAMES = new String[] {
+ "component"
+ };
+
+ private static final Comparator<Node> TLD_COMPARATOR = new NamesListComparator(
+ new XPathComparator("listener-class/text()", "name/text()"), TLD_TAG_NAMES);
+
+ private static final Comparator<Node> FACELET_COMPARATOR = new NamesListComparator(
+ new XPathComparator("function-name/text()", "tag-name/text()"), TAGLIB_TAG_NAMES);
+
+ private static final Comparator<Node> DEPENDENCIES_COMPARATOR = new NamesListComparator(
+ new XPathComparator("name/text()"), DEPENDENCIES_TAG_NAMES);
+
+ /**
+ * Used to look up Artifacts in the remote repository.
+ *
+ * @component
+ */
+ private org.apache.maven.artifact.factory.ArtifactFactory factory;
+
+ /**
+ * Used to look up Artifacts in the remote repository.
+ *
+ * @component
+ */
+ private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
+
+ /**
+ * The local repository.
+ *
+ * @parameter expression="${localRepository}"
+ */
+ private ArtifactRepository localRepository;
+
+ /**
+ * To look up Archiver/UnArchiver implementations
+ *
+ * @component
+ */
+ private ArchiverManager archiverManager;
+
+ /**
+ * Project builder
+ *
+ * @component
+ */
+ private MavenProjectBuilder mavenProjectBuilder;
+
+ /**
+ * The reactor projects.
+ *
+ * @parameter expression="${reactorProjects}"
+ * @required
+ * @readonly
+ */
+ private List reactorProjects;
+
+ /**
+ * The reactor projects.
+ *
+ * @parameter expression="${project.parent}"
+ * @readonly
+ */
+ private MavenProject parentProject;
+
+ /**
+ * The list of resources we want to transfer.
+ *
+ * @parameter default-value="src/main/config"
+ */
+ private File config;
+
+ /**
+ * The directory for compiled classes.
+ *
+ * @parameter expression="${project.build.directory}"
+ * @required
+ * @readonly
+ */
+ private File buildDirectory;
+
+ /**
+ * @parameter default-value="${project.build.directory}/modules"
+ */
+ private File modulesDirectory;
+
+ /**
+ * The directory for compiled classes.
+ *
+ * @parameter expression="${project.build.directory}/pom.xml"
+ * @required
+ * @readonly
+ */
+ private File generatedPom;
+
+ /**
+ * The directory for compiled classes.
+ *
+ * @parameter expression="${project.build.directory}/src"
+ * @required
+ * @readonly
+ */
+ private File modulesSrc;
+
+ /**
+ * @parameter
+ */
+ private String templates;
+
+ /**
+ * @parameter
+ */
+ private String includeTld = "META-INF/*.tld";
+
+ /**
+ * @parameter
+ */
+ private String includeTaglib = "META-INF/*.taglib.xml";
+
+ /**
+ * @parameter
+ */
+ private String includeDependencies = "META-INF/*.component-dependencies.xml";
+
+ /**
+ * @parameter
+ */
+ private String includeXcss = "**/*.xcss";
+
+ /**
+ * @parameter
+ */
+ private String excludeXcss = null;
+
+ /**
+ * @parameter
+ */
+ private String commonStyle;
+
+ /**
+ * @parameter
+ */
+ private String templateXpath;
+
+ /**
+ *
+ */
+ public AssemblyLibraryMojo() {
+ // used for plexus init.
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.maven.plugin.Mojo#execute()
+ */
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ setupParentProject();
+ checkLibraryConfig();
+ if (null == templates) {
+ templates = Library.JSF12.equals(library.getJsfVersion()) ? TEMPLATES12_PREFIX
+ : TEMPLATES_PREFIX;
+ }
+ List<Model> models = extractModules();
+ mergeFacesConfig(models);
+ File resourcesConfig = new File(outputDirectory,
+ "META-INF/resources-config.xml");
+ mergeXML(models, "META-INF/resources-config.xml", null,
+ RESOURCES_CONFIG_TEMPLATE, "/resource-config/resource",
+ "name/text()", new VelocityContext(), resourcesConfig, false, null);
+
+ if (null != commonStyle) {
+ File commonXcss = new File(outputDirectory, commonStyle);
+ mergeXML(models, includeXcss, excludeXcss, XCSS_TEMPLATE,
+ templateXpath, null, new VelocityContext(), commonXcss, true, null);
+ }
+
+ if (null != library.getTaglibs() && library.getTaglibs().length > 0) {
+ for (int i = 0; i < library.getTaglibs().length; i++) {
+ Taglib taglib = library.getTaglibs()[i];
+ List<Model> taglibModels;
+ if (taglib.getIncludeModules() == null
+ && taglib.getExcludeModules() == null) {
+ taglibModels = models;
+ } else {
+ String[] includeModules = null;
+ String[] excludeModules = null;
+ if (null != taglib.getIncludeModules()) {
+ includeModules = taglib.getIncludeModules().split(",");
+ Arrays.sort(includeModules);
+ }
+ if (null != taglib.getExcludeModules()) {
+ excludeModules = taglib.getExcludeModules().split(",");
+ Arrays.sort(excludeModules);
+ }
+ taglibModels = new ArrayList<Model>();
+ for (Iterator iterator = models.iterator(); iterator
+ .hasNext();) {
+ Model model = (Model) iterator.next();
+ String id = model.getArtifactId();
+ if ((includeModules == null || Arrays.binarySearch(
+ includeModules, id) >= 0)
+ && (excludeModules == null || Arrays
+ .binarySearch(excludeModules, id) < 0)) {
+ taglibModels.add(model);
+ }
+ }
+ }
+ generateTaglibAndDependencies(taglibModels, taglib);
+ }
+ } else {
+ generateTaglibAndDependencies(models, library.getTaglib());
+ }
+ }
+
+ /**
+ * @param models
+ * @throws MojoExecutionException
+ */
+ private void generateTaglibAndDependencies(List<Model> models, Taglib taglib)
+ throws MojoExecutionException {
+ getLog().debug(
+ "Assembly taglib for uri " + taglib.getUri()
+ + " with short name " + taglib.getShortName());
+ VelocityContext taglibContext = new VelocityContext();
+ taglibContext.put("taglib", taglib);
+ // Build includes/excludes Xpath condition
+ String nameTag = "name";
+ createTagCondition(taglib, nameTag);
+ File tld = new File(outputDirectory, "META-INF/" + taglib.getTaglib()
+ + ".tld");
+ getLog().debug("Write JSP taglib " + tld.getPath());
+ String commonXPath = "/taglib/tag"
+ + createTagCondition(taglib, "name") + " | /taglib/listener | /taglib/function";
+
+ mergeXML(models, includeTld, null, TLD_TEMPLATE, commonXPath,
+ "listener-class/text() | name/text()", new VelocityContext(taglibContext), tld, false, TLD_COMPARATOR);
+
+
+ File faceletsTaglib = new File(outputDirectory, "META-INF/"
+ + taglib.getTaglib() + ".taglib.xml");
+ commonXPath = "/facelet-taglib/tag"
+ + createTagCondition(taglib, "tag-name")
+ + " | /facelet-taglib/function";
+
+ mergeXML(models, includeTaglib, null, TAGLIB_TEMPLATE, commonXPath, "tag-name/text() | function-name/text()", new VelocityContext(
+ taglibContext), faceletsTaglib, false, FACELET_COMPARATOR);
+ getLog().debug("Write Facelets taglib " + faceletsTaglib.getPath());
+
+ File dependenciesFile = new File(outputDirectory, "META-INF/"
+ + taglib.getTaglib() + ".component-dependencies.xml");
+ commonXPath = "/components/component" + createTagCondition(taglib, "name");
+
+ mergeXML(models, includeDependencies, null, COMPONENT_DEPENDENCIES_TEMPLATE, commonXPath, "name/text()", new VelocityContext(
+ taglibContext), dependenciesFile, false, DEPENDENCIES_COMPARATOR);
+ getLog().debug("Write dependencies file " + dependenciesFile.getPath());
+ }
+
+ /**
+ * @param taglib
+ * @param nameTag
+ */
+ private String createTagCondition(Taglib taglib, String nameTag) {
+ StringBuffer condition = new StringBuffer();
+ if (taglib.getIncludeTags() != null || taglib.getExcludeTags() != null) {
+ condition.append('[');
+ if (taglib.getIncludeTags() != null) {
+ condition.append('(');
+ String[] includes = taglib.getIncludeTags().split(",");
+ for (int i = 0; i < includes.length; i++) {
+ String includeTag = includes[i];
+ if (i != 0) {
+ condition.append(" or ");
+ }
+ condition.append("normalize-space(").append(nameTag)
+ .append(")='").append(includeTag).append("'");
+ }
+ condition.append(')');
+ }
+ if (taglib.getIncludeTags() != null
+ && taglib.getExcludeTags() != null) {
+ condition.append(" and ");
+ }
+ if (taglib.getExcludeTags() != null) {
+ condition.append('(');
+ String[] excludes = taglib.getExcludeTags().split(",");
+ for (int i = 0; i < excludes.length; i++) {
+ String includeTag = excludes[i];
+ if (i != 0) {
+ condition.append(" and ");
+ }
+ condition.append("normalize-space(").append(nameTag)
+ .append(")!='").append(includeTag).append("'");
+ }
+ condition.append(')');
+ }
+ condition.append(']');
+ }
+ return condition.toString();
+ }
+
+ /**
+ * @return
+ * @throws MojoExecutionException
+ */
+ private List<Model> extractModules() throws MojoExecutionException {
+ List<String> modules = parentProject.getModules();
+ List<Model> models = new ArrayList<Model>(modules.size());
+ Map<String, Dependency> projectsDependencies = new HashMap<String, Dependency>();
+ for (Iterator<String> iter = modules.iterator(); iter.hasNext();) {
+ String moduleName = iter.next();
+ getLog().info("Parent project have module " + moduleName);
+ Model model;
+ File f = new File(parentProject.getBasedir(), moduleName
+ + "/pom.xml");
+ if (f.exists()) {
+ try {
+ model = mavenProjectBuilder.build(f, localRepository, null)
+ .getModel();
+ } catch (ProjectBuildingException e) {
+ throw new MojoExecutionException(
+ "Unable to read local module-POM", e);
+ }
+ } else {
+ getLog().warn("No filesystem module-POM available");
+
+ model = new Model();
+ model.setName(moduleName);
+ model.setUrl(moduleName);
+ }
+ if (project.getGroupId().equals(model.getGroupId())
+ && "jar".equals(model.getPackaging())
+ && (!project.getArtifactId().equals(model.getArtifactId()))) {
+ // TODO - check include/exclude
+ getLog().debug(
+ "Project " + model.getName()
+ + " included to library set");
+ List<Dependency> dependencies = model.getDependencies();
+ for (Iterator<Dependency> iterator = dependencies.iterator(); iterator
+ .hasNext();) {
+ Dependency dependency = iterator.next();
+ getLog().debug(
+ dependency.getClass().getName() + " : "
+ + dependency + " with key: "
+ + dependency.getManagementKey());
+ if (!"test".equals(dependency.getScope())) {
+ projectsDependencies.put(dependency.getManagementKey(),
+ dependency);
+
+ }
+ }
+ models.add(model);
+ }
+ }
+ // Remove modules projects from dependencise
+ Set<String> unwanted = new HashSet<String>(projectsDependencies.size());
+ for (Iterator<Model> iter = models.iterator(); iter.hasNext();) {
+ Model model = (Model) iter.next();
+ for (Iterator<Dependency> iterator = projectsDependencies.values().iterator(); iterator
+ .hasNext();) {
+ Dependency dependency = (Dependency) iterator.next();
+ if (model.getGroupId().equals(dependency.getGroupId())
+ && model.getArtifactId().equals(
+ dependency.getArtifactId())) {
+ getLog().debug(
+ "Remove dependency of library module "
+ + dependency.getManagementKey());
+ unwanted.add(dependency.getManagementKey());
+ }
+ }
+ // Got module and unpack it to target directory.
+ Artifact artifact = factory.createBuildArtifact(model.getGroupId(),
+ model.getArtifactId(), model.getVersion(), model
+ .getPackaging());
+ File moduleDir = new File(modulesDirectory, model.getArtifactId());
+ unpackArtifact(artifact, moduleDir, true);
+ artifact = factory
+ .createArtifactWithClassifier(model.getGroupId(), model
+ .getArtifactId(), model.getVersion(), "jar",
+ "sources");
+ unpackArtifact(artifact, modulesSrc, false);
+ }
+ // Add projects dependencies to this project
+ projectsDependencies.keySet().removeAll(unwanted);
+ setupGeneratedProject(projectsDependencies);
+ return models;
+ }
+
+ /**
+ * @param projectsDependencies
+ * @throws MojoExecutionException
+ */
+ private void setupGeneratedProject(
+ Map<String, Dependency> projectsDependencies)
+ throws MojoExecutionException {
+ Model generatedProject;
+ try {
+ MavenXpp3Reader reader = new MavenXpp3Reader();
+ generatedProject = reader.read(new FileReader(project.getFile()));
+ } catch (Exception e1) {
+ throw new MojoExecutionException("Unable to read local POM", e1);
+ }
+ generatedProject.getDependencies()
+ .addAll(projectsDependencies.values());
+ writePom(generatedProject);
+ project.setDependencies(new ArrayList<Dependency>(projectsDependencies.values()));
+ // project.setFile(generatedPom);
+ }
+
+ /**
+ * Check parent project, build if nesessary.
+ *
+ * @throws MojoFailureException
+ */
+ protected void setupParentProject() throws MojoFailureException {
+ // Parent project not set for a custom lifecycles. Try to load artifact.
+ if (null == parentProject || null == parentProject.getFile()) {
+ Parent parentModel = project.getModel().getParent();
+ if (null != parentModel) {
+ String relativePath = parentModel.getRelativePath();
+ File parentPom = new File(project.getFile().getAbsoluteFile()
+ .getParentFile(), relativePath);
+ if (parentPom.isDirectory()) {
+ parentPom = new File(parentPom, "pom.xml");
+ }
+ if (parentPom.exists()) {
+ try {
+ parentProject = mavenProjectBuilder.build(parentPom,
+ localRepository, null);
+ if (null == parentProject) {
+ throw new MojoFailureException(
+ "Components library project must have parent pom with components modules");
+ }
+ } catch (ProjectBuildingException e) {
+ throw new MojoFailureException(
+ "Error get parent project for a components library");
+ }
+ } else {
+ throw new MojoFailureException(
+ "Parent project pom file not found for a components library");
+ }
+ } else {
+ throw new MojoFailureException(
+ "Components library project must have parent pom with components modules");
+ }
+
+ }
+ }
+
+ /**
+ * @param models
+ * @throws MojoExecutionException
+ */
+ private void mergeFacesConfig(List<Model> models) throws MojoExecutionException {
+ StringBuffer facesConfig = new StringBuffer();
+ for (int i = 0; i < library.getRenderkits().length; i++) {
+ Renderkit kit = library.getRenderkits()[i];
+ kit.setContent(new StringBuffer());
+ }
+ // Process all faces-config.xml from modules
+ for (Iterator<Model> iter = models.iterator(); iter.hasNext();) {
+ Model model = iter.next();
+ File moduleFacesConfig = new File(modulesDirectory, model
+ .getArtifactId()
+ + "/META-INF/faces-config.xml");
+ processFacesConfigFile(facesConfig, moduleFacesConfig);
+ }
+ // Process faces-config from project resources
+ if (null !=config) {
+ processFacesConfigFile(facesConfig, new File(config, "META-INF/faces-config.xml"));
+ }
+ VelocityContext context = new VelocityContext();
+ context.put("content", facesConfig.toString());
+ context.put("library", library);
+ context.put("renderkits", Arrays.asList(library.getRenderkits()));
+ try {
+ writeParsedTemplate(templates + FACES_CONFIG_TEMPLATE, context,
+ new File(outputDirectory, "META-INF/faces-config.xml"));
+ } catch (Exception e) {
+ throw new MojoExecutionException(
+ "Error to process faces-config template", e);
+ }
+ }
+
+ /**
+ * @param config
+ * @param moduleFacesConfig
+ * @throws MojoExecutionException
+ */
+ private void processFacesConfigFile(StringBuffer config,
+ File moduleFacesConfig) throws MojoExecutionException {
+ if (moduleFacesConfig.exists()) {
+ getLog().info(
+ "Process "+moduleFacesConfig.getName());
+ XMLBody configBody = new XMLBody();
+ try {
+ configBody.loadXML(new FileInputStream(moduleFacesConfig));
+ config
+ .append(configBody
+ .getContent("/faces-config/*[name()!=\'render-kit\']"));
+ for (int i = 0; i < library.getRenderkits().length; i++) {
+ Renderkit kit = library.getRenderkits()[i];
+ kit
+ .getContent()
+ .append(
+ configBody
+ .getContent("/faces-config/render-kit[child::render-kit-id='"
+ + kit.getName()
+ + "']/renderer"));
+ }
+ } catch (FileNotFoundException e) {
+ throw new MojoExecutionException(
+ "Could't read faces-config file", e);
+ } catch (ParsingException e) {
+ throw new MojoExecutionException(
+ "Error parsing faces-config file", e);
+ }
+ }
+ }
+
+ /**
+ * Merge XML files from extracted models to one in build directory.
+ *
+ * @param models
+ * models collected in library.
+ * @param includes
+ * relative path to config file in models/output.
+ * @param templateName -
+ * name of velocity template for result file.
+ * @param commonXpath -
+ * XPath expression fof common part of result file.
+ * @param keyXPath -
+ * XPath expression for key part of common parts
+ * @param context -
+ * Velocity context for template processing.
+ * @param namespaceAware TODO
+ * @param keySet -
+ * {@link Set} to check for duplicate keys. Must not be null
+ * @throws MojoExecutionException
+ */
+ private void mergeXML(List<Model> models, String includes, String excludes, String templateName,
+ String commonXpath, String keyXPath, VelocityContext context,
+ File target, boolean namespaceAware, Comparator<Node> comparator) throws MojoExecutionException {
+ StringBuffer content = new StringBuffer();
+ String[] split = includes.split(",");
+ String[] excludesSplit = excludes != null ? excludes.split(",") : null;
+ XMLBodyMerge xBodyMerge = new XMLBodyMerge(commonXpath, keyXPath);
+ for (Iterator<Model> iter = models.iterator(); iter.hasNext();) {
+ Model model = iter.next();
+ File moduleDir = new File(modulesDirectory, model.getArtifactId());
+ mergeXMLdir(moduleDir, namespaceAware, split, excludesSplit, xBodyMerge);
+ }
+ if(null!=config){
+ mergeXMLdir(config, namespaceAware, split, excludesSplit, xBodyMerge);
+ }
+
+ if (comparator != null) {
+ xBodyMerge.sort(comparator);
+ }
+ try {
+ content.append(xBodyMerge.getContent());
+ } catch (Exception e1) {
+ throw new MojoExecutionException("XML Merge Exception Occured", e1);
+ }
+ if (content.length() > 0) {
+ context.put("content", content.toString());
+ context.put("library", library);
+ context.put("models", models);
+ try {
+ writeParsedTemplate(templates + templateName, context, target);
+ } catch (Exception e) {
+ throw new MojoExecutionException("Error to process template "
+ + templateName + " for files " + includes, e);
+ }
+
+ }
+ }
+
+ /**
+ * @param moduleDir
+ * @param commonXpath
+ * @param keyXPath
+ * @param namespaceAware
+ * @param keySet
+ * @param content
+ * @param xmls
+ * @param split
+ * @throws IllegalStateException
+ * @throws MojoExecutionException
+ */
+ private void mergeXMLdir(File moduleDir, boolean namespaceAware, String[] split, String[] excludesSplit, XMLBodyMerge xBodyMerge)
+ throws IllegalStateException, MojoExecutionException {
+ DirectoryScanner ds = new DirectoryScanner();
+ ds.setFollowSymlinks(true);
+ ds.setBasedir(moduleDir);
+ ds.setIncludes(split);
+ ds.setExcludes(excludesSplit);
+ ds.addDefaultExcludes();
+ ds.scan();
+ String[] files = ds.getIncludedFiles();
+ for (int i = 0; i < files.length; i++) {
+ File moduleFacesConfig = new File(moduleDir, files[i]);
+ getLog().info(
+ "Process " + files[i] );
+ XMLBody configBody = new XMLBody();
+ try {
+ configBody.loadXML(new FileInputStream(moduleFacesConfig),namespaceAware);
+ xBodyMerge.add(configBody);
+ } catch (FileNotFoundException e) {
+ throw new MojoExecutionException("Could't read file "
+ + moduleFacesConfig.getPath(), e);
+ } catch (ParsingException e) {
+ throw new MojoExecutionException(
+ "Error parsing config file "
+ + moduleFacesConfig.getPath(), e);
+ }
+ }
+ }
+
+ private void unpackArtifact(Artifact artifact, File moduleDir,
+ boolean isResource) throws MojoExecutionException {
+ try {
+ resolver.resolve(artifact, Collections.EMPTY_LIST, localRepository);
+ unpack(artifact.getFile(), moduleDir);
+ if (isResource) {
+ Resource resource = new Resource();
+ resource.setDirectory(moduleDir.getPath());
+ resource.addExclude("META-INF/faces-config.xml");
+ resource.addExclude("META-INF/resources-config.xml");
+ resource.addExclude("META-INF/*.taglib.xml");
+ resource.addExclude("META-INF/*.component-dependencies.xml");
+ resource.addExclude("META-INF/*.tld");
+ project.addResource(resource);
+
+ }
+ } catch (ArtifactResolutionException e) {
+ getLog().error("Error with resolve artifact " + artifact, e);
+ } catch (ArtifactNotFoundException e) {
+ getLog().error("Not found artifact " + artifact, e);
+ }
+ }
+
+ private List<MavenProject> populateReactorProjects() {
+ List<MavenProject> projects = new ArrayList<MavenProject>();
+ if (reactorProjects != null && reactorProjects.size() > 1) {
+ Iterator reactorItr = reactorProjects.iterator();
+
+ while (reactorItr.hasNext()) {
+ MavenProject reactorProject = (MavenProject) reactorItr.next();
+
+ if (reactorProject != null
+ && reactorProject.getParent() != null
+ && project.getArtifactId().equals(
+ reactorProject.getParent().getArtifactId())) {
+ String name = reactorProject.getGroupId() + ":"
+ + reactorProject.getArtifactId();
+ getLog().info("Have reactor project with name " + name);
+ projects.add(reactorProject);
+ }
+ }
+ }
+ return projects;
+ }
+
+ /**
+ * Unpacks the archive file.
+ *
+ * @param file
+ * File to be unpacked.
+ * @param location
+ * Location where to put the unpacked files.
+ */
+ private void unpack(File file, File location) throws MojoExecutionException {
+
+ getLog().debug(
+ "Unpack file " + file.getAbsolutePath() + " to: "
+ + location.getAbsolutePath());
+ try {
+ location.mkdirs();
+
+ UnArchiver unArchiver;
+
+ unArchiver = archiverManager.getUnArchiver(file);
+
+ unArchiver.setSourceFile(file);
+
+ unArchiver.setDestDirectory(location);
+
+ unArchiver.setOverwrite(true);
+
+ unArchiver.extract();
+
+ } catch (Exception e) {
+ throw new MojoExecutionException("Error unpacking file: " + file
+ + " to: " + location + "\r\n" + e.toString(), e);
+ }
+ }
+
+ private void writePom(Model pom) throws MojoExecutionException {
+ MavenXpp3Writer pomWriter = new MavenXpp3Writer();
+ try {
+ FileWriter out = new FileWriter(generatedPom);
+ pomWriter.write(out, pom);
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error for write generated pom", e);
+ }
+
+ }
+
+ /**
+ * @return the archiverManager
+ */
+ public ArchiverManager getArchiverManager() {
+ return this.archiverManager;
+ }
+
+ /**
+ * @param archiverManager
+ * the archiverManager to set
+ */
+ public void setArchiverManager(ArchiverManager archiverManager) {
+ this.archiverManager = archiverManager;
+ }
+
+ /**
+ * @return the buildDirectory
+ */
+ public File getBuildDirectory() {
+ return this.buildDirectory;
+ }
+
+ /**
+ * @param buildDirectory
+ * the buildDirectory to set
+ */
+ public void setBuildDirectory(File buildDirectory) {
+ this.buildDirectory = buildDirectory;
+ }
+
+ /**
+ * @return the factory
+ */
+ public org.apache.maven.artifact.factory.ArtifactFactory getFactory() {
+ return this.factory;
+ }
+
+ /**
+ * @param factory
+ * the factory to set
+ */
+ public void setFactory(
+ org.apache.maven.artifact.factory.ArtifactFactory factory) {
+ this.factory = factory;
+ }
+
+ /**
+ * @return the localRepository
+ */
+ public ArtifactRepository getLocalRepository() {
+ return this.localRepository;
+ }
+
+ /**
+ * @param localRepository
+ * the localRepository to set
+ */
+ public void setLocalRepository(ArtifactRepository localRepository) {
+ this.localRepository = localRepository;
+ }
+
+ /**
+ * @return the mavenProjectBuilder
+ */
+ public MavenProjectBuilder getMavenProjectBuilder() {
+ return this.mavenProjectBuilder;
+ }
+
+ /**
+ * @param mavenProjectBuilder
+ * the mavenProjectBuilder to set
+ */
+ public void setMavenProjectBuilder(MavenProjectBuilder mavenProjectBuilder) {
+ this.mavenProjectBuilder = mavenProjectBuilder;
+ }
+
+ /**
+ * @return the parentProject
+ */
+ public MavenProject getParentProject() {
+ return this.parentProject;
+ }
+
+ /**
+ * @param parentProject
+ * the parentProject to set
+ */
+ public void setParentProject(MavenProject parentProject) {
+ this.parentProject = parentProject;
+ }
+
+ /**
+ * @return the reactorProjects
+ */
+ public List getReactorProjects() {
+ return this.reactorProjects;
+ }
+
+ /**
+ * @param reactorProjects
+ * the reactorProjects to set
+ */
+ public void setReactorProjects(List reactorProjects) {
+ this.reactorProjects = reactorProjects;
+ }
+
+ /**
+ * @return the resolver
+ */
+ public org.apache.maven.artifact.resolver.ArtifactResolver getResolver() {
+ return this.resolver;
+ }
+
+ /**
+ * @param resolver
+ * the resolver to set
+ */
+ public void setResolver(
+ org.apache.maven.artifact.resolver.ArtifactResolver resolver) {
+ this.resolver = resolver;
+ }
+
+}
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CompileMojo.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,296 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.mojo;
-
-import java.beans.PropertyDescriptor;
-import java.io.File;
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.model.Parent;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
-import org.apache.maven.project.ProjectBuildingException;
-import org.codehaus.plexus.PlexusConstants;
-import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.archiver.manager.ArchiverManager;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.codehaus.plexus.context.Context;
-import org.codehaus.plexus.context.ContextException;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
-
-/**
- * Compile all xml templates, matched given pattern to Java classes. Sources
- * will be created in {@link AbstractCDKMojo#outputJavaDirectory}
- *
- * @goal compile
- * @requiresDependencyResolution compile
- * @phase generate-sources
- * @author shura
- *
- */
-public class CompileMojo extends AbstractCDKMojo implements Contextualizable {
-
- /**
- * Project executed by first compile lifecycle.
- *
- * @parameter expression="${executedProject}"
- * @readonly
- */
- private MavenProject executedProject;
-
- /**
- * The reactor projects.
- *
- * @parameter expression="${project.parent}"
- * @readonly
- */
- private MavenProject parentProject;
- /**
- * @parameter default-value=${project.groupId}
- */
- private String defaultPackage;
-
- /**
- * A list of inclusion filters for the compiler. By default, include all
- * files in templates directory.
- *
- * @parameter
- */
- private String[] includes;
-
- /**
- * A list of exclusion filters for the compiler. None by default.
- *
- * @parameter
- */
- private String[] excludes;
-
- /**
- * The local repository.
- *
- * @parameter expression="${localRepository}"
- */
- private ArtifactRepository localRepository;
-
- /**
- * To look up Archiver/UnArchiver implementations
- *
- * @component
- */
- private ArchiverManager archiverManager;
-
- /**
- * Project builder
- *
- * @component
- */
- private MavenProjectBuilder mavenProjectBuilder;
- private PlexusContainer container;
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.maven.plugin.Mojo#execute()
- */
- public void execute() throws MojoExecutionException, MojoFailureException {
-
- // VelocityTemplates.init();
- try {
- List components = container
- .lookupList("org.ajax4jsf.templatecompiler.elements.ElementsFactory");
- for (Iterator iter = components.iterator(); iter.hasNext();) {
- Object element = iter.next();
- System.out.println(element.getClass().getName());
-
- }
- System.out.println("Components Map");
- Map componentsMap = container
- .lookupMap("org.ajax4jsf.templatecompiler.elements.ElementsFactory");
- for (Iterator iter = componentsMap.entrySet().iterator(); iter
- .hasNext();) {
- Map.Entry element = (Map.Entry) iter.next();
- System.out.println(element.getKey() + ":"
- + element.getValue().getClass().getName());
- }
- } catch (ComponentLookupException e) {
- throw new MojoExecutionException(
- "Error lookup ElementFactory components");
- }
- Parent parentModel = project.getModel().getParent();
- if (null != parentModel) {
- String relativePath = parentModel.getRelativePath();
- File parentPom = new File(project.getFile().getParentFile(), relativePath);
- if (parentPom.isDirectory()) {
- parentPom = new File(parentPom, "pom.xml");
- }
- if (parentPom.exists()) {
- try {
- parentProject = mavenProjectBuilder.build(parentPom,
- localRepository, null);
- } catch (ProjectBuildingException e) {
- throw new MojoExecutionException("Error get parent project for a components library",e);
- }
- } else {
- throw new MojoFailureException("Parent project pom file "+parentPom.getAbsolutePath()+" is not found for a components library");
- }
- }else {
- throw new MojoFailureException("Components library project must have parent pom with components modules");
- }
- getLog().info("Parent Project object :\n" + toLog(parentProject) + "\n");
- getLog().info("Project object :\n" + toLog(project) + "\n");
- getLog().info("Project object Model :\n" + toLog(project.getModel()) + "\n");
- getLog().info("Project object Parent Model :\n" + toLog(project.getModel().getParent()) + "\n");
-
- getLog().info(
- "Executed Project object :\n" + toLog(executedProject) + "\n");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable#contextualize(org.codehaus.plexus.context.Context)
- */
- public void contextualize(Context context) throws ContextException {
- this.container = (PlexusContainer) context
- .get(PlexusConstants.PLEXUS_KEY);
-
- }
-
- private void logBean(Object bean) {
- StringBuffer content = new StringBuffer();
- }
-
- /**
- * Convert any Java Object to JavaScript representation ( as possible ).
- *
- * @param obj
- * @return
- * @throws MojoExecutionException
- */
- public String toLog(Object obj) throws MojoExecutionException {
- if (null == obj) {
- return "null";
- } else if (obj.getClass().isArray()) {
- StringBuffer ret = new StringBuffer("[");
- boolean first = true;
- for (int i = 0; i < Array.getLength(obj); i++) {
- Object element = Array.get(obj, i);
- if (!first) {
- ret.append(',');
- }
- ret.append(toLog(element));
- first = false;
- }
- return ret.append("]\n").toString();
- } else if (obj instanceof Collection) {
- // Collections put as JavaScript array.
- Collection collection = (Collection) obj;
- StringBuffer ret = new StringBuffer("[");
- boolean first = true;
- for (Iterator iter = collection.iterator(); iter.hasNext();) {
- Object element = iter.next();
- if (!first) {
- ret.append(',');
- }
- ret.append(toLog(element));
- first = false;
- }
- return ret.append("]\n").toString();
- } else if (obj instanceof Map) {
- // Maps put as JavaScript hash.
- Map map = (Map) obj;
-
- StringBuffer ret = new StringBuffer("{");
- boolean first = true;
- for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
- Object key = (Object) iter.next();
- if (!first) {
- ret.append(',');
- }
- ret.append(key);
- ret.append(":");
- ret.append(toLog(map.get(key)));
- first = false;
- }
- return ret.append("}\n").toString();
- } else if (obj instanceof Number || obj instanceof Boolean) {
- // numbers and boolean put as-is, without conversion
- return obj.toString();
- } else if (obj instanceof String) {
- // all other put as encoded strings.
- StringBuffer ret = new StringBuffer();
- addEncodedString(ret, obj);
- return ret.append("\n").toString();
- }
- // All other objects threaded as Java Beans.
- try {
- StringBuffer ret = new StringBuffer("{");
- PropertyDescriptor[] propertyDescriptors = PropertyUtils
- .getPropertyDescriptors(obj);
- boolean first = true;
- for (int i = 0; i < propertyDescriptors.length; i++) {
- PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
- String key = propertyDescriptor.getName();
- if ("class".equals(key)
- || propertyDescriptor.getReadMethod() == null) {
- continue;
- }
- if (!first) {
- ret.append(",\n\t");
- }
- addEncodedString(ret, key);
- ret.append(":");
- try {
- ret.append(String.valueOf(PropertyUtils.getProperty(obj,
- key)));
-
- } catch (InvocationTargetException e) {
- ret.append("Not ACCESIBLE");
- }// ret.append(toLog(PropertyUtils.getProperty(obj, key)));
- first = false;
- }
- return ret.append("}\n").toString();
- } catch (Exception e) {
- throw new MojoExecutionException(
- "Error in conversion Java Object to String", e);
- }
- }
-
- public void addEncodedString(StringBuffer buff, Object obj) {
- buff.append("'");
- buff.append(obj);
- buff.append("'");
-
- }
-
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CompileMojo.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,294 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+import java.beans.PropertyDescriptor;
+import java.io.File;
+import java.lang.reflect.Array;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.model.Parent;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+
+/**
+ * Compile all xml templates, matched given pattern to Java classes. Sources
+ * will be created in {@link AbstractCDKMojo#outputJavaDirectory}
+ *
+ * @goal compile
+ * @requiresDependencyResolution compile
+ * @phase generate-sources
+ * @author shura
+ *
+ */
+public class CompileMojo extends AbstractCDKMojo implements Contextualizable {
+
+ /**
+ * Project executed by first compile lifecycle.
+ *
+ * @parameter expression="${executedProject}"
+ * @readonly
+ */
+ private MavenProject executedProject;
+
+ /**
+ * The reactor projects.
+ *
+ * @parameter expression="${project.parent}"
+ * @readonly
+ */
+ private MavenProject parentProject;
+ /**
+ * @parameter default-value=${project.groupId}
+ */
+ private String defaultPackage;
+
+ /**
+ * A list of inclusion filters for the compiler. By default, include all
+ * files in templates directory.
+ *
+ * @parameter
+ */
+ private String[] includes;
+
+ /**
+ * A list of exclusion filters for the compiler. None by default.
+ *
+ * @parameter
+ */
+ private String[] excludes;
+
+ /**
+ * The local repository.
+ *
+ * @parameter expression="${localRepository}"
+ */
+ private ArtifactRepository localRepository;
+
+ /**
+ * To look up Archiver/UnArchiver implementations
+ *
+ * @component
+ */
+ private ArchiverManager archiverManager;
+
+ /**
+ * Project builder
+ *
+ * @component
+ */
+ private MavenProjectBuilder mavenProjectBuilder;
+ private PlexusContainer container;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.maven.plugin.Mojo#execute()
+ */
+ public void execute() throws MojoExecutionException, MojoFailureException {
+
+ // VelocityTemplates.init();
+ try {
+ List components = container
+ .lookupList("org.richfaces.templatecompiler.elements.ElementsFactory");
+ for (Iterator iter = components.iterator(); iter.hasNext();) {
+ Object element = iter.next();
+ System.out.println(element.getClass().getName());
+
+ }
+ System.out.println("Components Map");
+ Map componentsMap = container
+ .lookupMap("org.richfaces.templatecompiler.elements.ElementsFactory");
+ for (Iterator iter = componentsMap.entrySet().iterator(); iter
+ .hasNext();) {
+ Map.Entry element = (Map.Entry) iter.next();
+ System.out.println(element.getKey() + ":"
+ + element.getValue().getClass().getName());
+ }
+ } catch (ComponentLookupException e) {
+ throw new MojoExecutionException(
+ "Error lookup ElementFactory components");
+ }
+ Parent parentModel = project.getModel().getParent();
+ if (null != parentModel) {
+ String relativePath = parentModel.getRelativePath();
+ File parentPom = new File(project.getFile().getParentFile(), relativePath);
+ if (parentPom.isDirectory()) {
+ parentPom = new File(parentPom, "pom.xml");
+ }
+ if (parentPom.exists()) {
+ try {
+ parentProject = mavenProjectBuilder.build(parentPom,
+ localRepository, null);
+ } catch (ProjectBuildingException e) {
+ throw new MojoExecutionException("Error get parent project for a components library",e);
+ }
+ } else {
+ throw new MojoFailureException("Parent project pom file "+parentPom.getAbsolutePath()+" is not found for a components library");
+ }
+ }else {
+ throw new MojoFailureException("Components library project must have parent pom with components modules");
+ }
+ getLog().info("Parent Project object :\n" + toLog(parentProject) + "\n");
+ getLog().info("Project object :\n" + toLog(project) + "\n");
+ getLog().info("Project object Model :\n" + toLog(project.getModel()) + "\n");
+ getLog().info("Project object Parent Model :\n" + toLog(project.getModel().getParent()) + "\n");
+
+ getLog().info(
+ "Executed Project object :\n" + toLog(executedProject) + "\n");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable#contextualize(org.codehaus.plexus.context.Context)
+ */
+ public void contextualize(Context context) throws ContextException {
+ this.container = (PlexusContainer) context
+ .get(PlexusConstants.PLEXUS_KEY);
+
+ }
+
+ private void logBean(Object bean) {
+ StringBuffer content = new StringBuffer();
+ }
+
+ /**
+ * Convert any Java Object to JavaScript representation ( as possible ).
+ *
+ * @param obj
+ * @return
+ * @throws MojoExecutionException
+ */
+ public String toLog(Object obj) throws MojoExecutionException {
+ if (null == obj) {
+ return "null";
+ } else if (obj.getClass().isArray()) {
+ StringBuffer ret = new StringBuffer("[");
+ boolean first = true;
+ for (int i = 0; i < Array.getLength(obj); i++) {
+ Object element = Array.get(obj, i);
+ if (!first) {
+ ret.append(',');
+ }
+ ret.append(toLog(element));
+ first = false;
+ }
+ return ret.append("]\n").toString();
+ } else if (obj instanceof Collection) {
+ // Collections put as JavaScript array.
+ Collection collection = (Collection) obj;
+ StringBuffer ret = new StringBuffer("[");
+ boolean first = true;
+ for (Iterator iter = collection.iterator(); iter.hasNext();) {
+ Object element = iter.next();
+ if (!first) {
+ ret.append(',');
+ }
+ ret.append(toLog(element));
+ first = false;
+ }
+ return ret.append("]\n").toString();
+ } else if (obj instanceof Map) {
+ // Maps put as JavaScript hash.
+ Map map = (Map) obj;
+
+ StringBuffer ret = new StringBuffer("{");
+ boolean first = true;
+ for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
+ Object key = (Object) iter.next();
+ if (!first) {
+ ret.append(',');
+ }
+ ret.append(key);
+ ret.append(":");
+ ret.append(toLog(map.get(key)));
+ first = false;
+ }
+ return ret.append("}\n").toString();
+ } else if (obj instanceof Number || obj instanceof Boolean) {
+ // numbers and boolean put as-is, without conversion
+ return obj.toString();
+ } else if (obj instanceof String) {
+ // all other put as encoded strings.
+ StringBuffer ret = new StringBuffer();
+ addEncodedString(ret, obj);
+ return ret.append("\n").toString();
+ }
+ // All other objects threaded as Java Beans.
+ try {
+ StringBuffer ret = new StringBuffer("{");
+ PropertyDescriptor[] propertyDescriptors = PropertyUtils
+ .getPropertyDescriptors(obj);
+ boolean first = true;
+ for (int i = 0; i < propertyDescriptors.length; i++) {
+ PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
+ String key = propertyDescriptor.getName();
+ if ("class".equals(key)
+ || propertyDescriptor.getReadMethod() == null) {
+ continue;
+ }
+ if (!first) {
+ ret.append(",\n\t");
+ }
+ addEncodedString(ret, key);
+ ret.append(":");
+ try {
+ ret.append(String.valueOf(PropertyUtils.getProperty(obj,
+ key)));
+
+ } catch (InvocationTargetException e) {
+ ret.append("Not ACCESIBLE");
+ }// ret.append(toLog(PropertyUtils.getProperty(obj, key)));
+ first = false;
+ }
+ return ret.append("}\n").toString();
+ } catch (Exception e) {
+ throw new MojoExecutionException(
+ "Error in conversion Java Object to String", e);
+ }
+ }
+
+ public void addEncodedString(StringBuffer buff, Object obj) {
+ buff.append("'");
+ buff.append(obj);
+ buff.append("'");
+
+ }
+
+}
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateComponentMojo.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateComponentMojo.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateComponentMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,149 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.mojo;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.maven.model.Plugin;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.velocity.VelocityContext;
-
-/**
- * @author shura
- * @goal create
- *
- */
-public class CreateComponentMojo extends AbstractCDKMojo {
-
- private static final String TEMPLATES_PREFIX = "/component/";
-
- private static final String CONFIG_TEMPLATE = TEMPLATES_PREFIX+"config.xml";
-
- private static final String CLASS_TEMPLATE = TEMPLATES_PREFIX+"UIClass.java";
-
- private static final String RENDERER_TEMPLATE = TEMPLATES_PREFIX+"template.jspx";
-
- /**
- * @parameter expression="${name}"
- * @required
- */
- private String name ;
-
- /**
- * @parameter expression="${markup}"
- */
- private String markup ;
-
- /**
- * @parameter expression="${baseClass}" default-value="javax.faces.component.UIComponentBase"
- */
- private String baseClass ;
-
- /**
- * Directory where the output Java Files will be located.
- *
- * @parameter expression="${project.build.plugins}"
- * @required
- * @readonly
- */
- private List plugins ;
-
- /* (non-Javadoc)
- * @see org.apache.maven.plugin.Mojo#execute()
- */
- public void execute() throws MojoExecutionException, MojoFailureException {
- if(project.getFile()!= null){
- boolean found= false;
- Plugin plugin = null;
- // Search for this plugin in project pom
- for (Iterator iter = plugins.iterator(); iter.hasNext();) {
- plugin = (Plugin) iter.next();
- if("maven-cdk-plugin".equals(plugin.getArtifactId())) {
-
- String groupId;
- if ("3.1.0".compareTo(plugin.getVersion()) > 0) {
- groupId = "org.ajax4jsf.cdk";
- } else {
- groupId = "org.richfaces.cdk";
- }
-
- if (groupId.equals(plugin.getGroupId())) {
- found = true;
- break;
- }
- }
- }
- if(found){
- try {
- createComponent(plugin);
- } catch (Exception e) {
- throw new MojoExecutionException("Error on create component",e);
- }
- } else {
- throw new MojoFailureException("This project is not configured for JSF components generation");
- }
- } else {
- throw new MojoFailureException("Goal 'create' must be run in existing project directory");
- }
-
- }
-
- /**
- * @param plugin
- * @throws Exception
- */
- private void createComponent(Plugin plugin) throws Exception {
- checkLibraryConfig();
- String className = Character.toUpperCase(name.charAt(0))+name.substring(1);
- VelocityContext context = new VelocityContext();
- context.put("name", name);
- context.put("className", className);
- String basePackage = baseClass.substring(0, baseClass.lastIndexOf('.'));
- String baseClassName = baseClass.substring(baseClass.lastIndexOf('.')+1);
- context.put("baseClass", baseClass);
- context.put("basePackage", basePackage);
- context.put("baseClassName", baseClassName);
- String prefix = library.getPrefix();
- context.put("package", prefix);
- context.put("prefix", prefix);
- String path = prefix.replace('.', '/');
- context.put("path", path);
- if(null == markup){
- markup = library.getRenderkits()[0].getMarkup();
- }
- context.put("markup", markup);
- String markupName = Character.toUpperCase(markup.charAt(0))+markup.substring(1);
- context.put("markupName", markupName);
- // Create component configuration file.
- File configFile = new File(componentConfigDirectory,name+".xml");
- writeParsedTemplate(CONFIG_TEMPLATE, context, configFile);
- File classFile = new File(project.getBuild().getSourceDirectory()+"/"+path+"/component/UI"+className+".java");
- writeParsedTemplate(CLASS_TEMPLATE, context, classFile);
- File templFile = new File(templatesDirectory,path+"/"+markup+className+".jspx");
- writeParsedTemplate(RENDERER_TEMPLATE, context, templFile);
- }
-
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateComponentMojo.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateComponentMojo.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateComponentMojo.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateComponentMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,148 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.maven.model.Plugin;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.velocity.VelocityContext;
+
+/**
+ * @author shura
+ * @goal create
+ *
+ */
+public class CreateComponentMojo extends AbstractCDKMojo {
+
+ private static final String TEMPLATES_PREFIX = "/component/";
+
+ private static final String CONFIG_TEMPLATE = TEMPLATES_PREFIX+"config.xml";
+
+ private static final String CLASS_TEMPLATE = TEMPLATES_PREFIX+"UIClass.java";
+
+ private static final String RENDERER_TEMPLATE = TEMPLATES_PREFIX+"template.jspx";
+
+ /**
+ * @parameter expression="${name}"
+ * @required
+ */
+ private String name ;
+
+ /**
+ * @parameter expression="${markup}"
+ */
+ private String markup ;
+
+ /**
+ * @parameter expression="${baseClass}" default-value="javax.faces.component.UIComponentBase"
+ */
+ private String baseClass ;
+
+ /**
+ * Directory where the output Java Files will be located.
+ *
+ * @parameter expression="${project.build.plugins}"
+ * @required
+ * @readonly
+ */
+ private List plugins ;
+
+ /* (non-Javadoc)
+ * @see org.apache.maven.plugin.Mojo#execute()
+ */
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ if(project.getFile()!= null){
+ boolean found= false;
+ Plugin plugin = null;
+ // Search for this plugin in project pom
+ for (Iterator iter = plugins.iterator(); iter.hasNext();) {
+ plugin = (Plugin) iter.next();
+ if("maven-cdk-plugin".equals(plugin.getArtifactId())) {
+
+ String groupId;
+ if ("3.1.0".compareTo(plugin.getVersion()) > 0) {
+ groupId = "org.richfaces.cdk";
+ } else {
+ groupId = "org.richfaces.cdk";
+ }
+
+ if (groupId.equals(plugin.getGroupId())) {
+ found = true;
+ break;
+ }
+ }
+ }
+ if(found){
+ try {
+ createComponent(plugin);
+ } catch (Exception e) {
+ throw new MojoExecutionException("Error on create component",e);
+ }
+ } else {
+ throw new MojoFailureException("This project is not configured for JSF components generation");
+ }
+ } else {
+ throw new MojoFailureException("Goal 'create' must be run in existing project directory");
+ }
+
+ }
+
+ /**
+ * @param plugin
+ * @throws Exception
+ */
+ private void createComponent(Plugin plugin) throws Exception {
+ checkLibraryConfig();
+ String className = Character.toUpperCase(name.charAt(0))+name.substring(1);
+ VelocityContext context = new VelocityContext();
+ context.put("name", name);
+ context.put("className", className);
+ String basePackage = baseClass.substring(0, baseClass.lastIndexOf('.'));
+ String baseClassName = baseClass.substring(baseClass.lastIndexOf('.')+1);
+ context.put("baseClass", baseClass);
+ context.put("basePackage", basePackage);
+ context.put("baseClassName", baseClassName);
+ String prefix = library.getPrefix();
+ context.put("package", prefix);
+ context.put("prefix", prefix);
+ String path = prefix.replace('.', '/');
+ context.put("path", path);
+ if(null == markup){
+ markup = library.getRenderkits()[0].getMarkup();
+ }
+ context.put("markup", markup);
+ String markupName = Character.toUpperCase(markup.charAt(0))+markup.substring(1);
+ context.put("markupName", markupName);
+ // Create component configuration file.
+ File configFile = new File(componentConfigDirectory,name+".xml");
+ writeParsedTemplate(CONFIG_TEMPLATE, context, configFile);
+ File classFile = new File(project.getBuild().getSourceDirectory()+"/"+path+"/component/UI"+className+".java");
+ writeParsedTemplate(CLASS_TEMPLATE, context, classFile);
+ File templFile = new File(templatesDirectory,path+"/"+markup+className+".jspx");
+ writeParsedTemplate(RENDERER_TEMPLATE, context, templFile);
+ }
+
+}
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateSkinMojo.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,434 +0,0 @@
-package org.ajax4jsf.builder.mojo;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-import org.aja4jsf.builder.model.Resource;
-import org.aja4jsf.builder.model.ResourceConfig;
-import org.aja4jsf.builder.model.io.xpp3.ResourceConfigXpp3Reader;
-import org.aja4jsf.builder.model.io.xpp3.ResourceConfigXpp3Writer;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.velocity.VelocityContext;
-
-/**
- * This mojo is intended to create new skin add-on within existing project.
- * New resources are added to the project, and existing resource config is modified to include new files.
- * <p><b>Usage</b> <tt>mvn cdk:add-skin -Dname=<skinName> -Dpackage=<skinPackage>. </tt></p>
- * This adds new skin named <skinName> to project resources/META-INF/skins folder.<br/>
- * Skin resources - XCSS files are placed in <skinPackage>.<skinName> package within project resources directory.<br/>
- * If <em>package</em> is not specified, it is set same as groupId.<br/>
- *
- * Following parameters can be used
- * <li><strong>name</strong> - name of the skin. <strong>Required.</strong></li>
- * <li><strong>package</strong> - base package of the skin. If not specified, <em>groupId</em> is used</li>
- * <li><strong>createExt</strong> - if set to true, extended skin files are added</li>
- * <li><strong>baseSkin</strong> - name of base skin</li>
- *
- * @goal add-skin
- * @requiresProject true
- *
- *
-
- * @author Maksim Kaszynski
- *
- */
-public class CreateSkinMojo extends AbstractCDKMojo {
-
- private static final String SRC_MAIN_RESOURCES = "src/main/resources";
-
- private static final String PROPERTIES = ".skin.properties";
-
- private static final String XCSS = ".xcss";
-
- private static final String EXT_XCSS = "-ext.xcss";
-
- private static final String SRC_MAIN_CONFIG_RESOURCES = "src/main/config/resources";
-
- private static final String META_INF_SKINS = "META-INF/skins/";
-
- /**
- * Name of base package of skin.
- * If it is not set, GroupId is used.
- * @parameter expression="${package}" default-value="${project.groupId}"
- */
- private String packageName;
-
-
- /**
- * Name of skin. Required parameter.
- * @parameter expression="${name}"
- * @required
- */
- private String skinName;
-
-
- /**
- * Name of base skin.
- * @parameter expression="${baseSkin}"
- */
- private String baseSkin;
-
- /**
- * If set to true, a set of extended classes is generated
- * @parameter expression="${createExt}"
- */
- private boolean createExt;
-
-
- /**
- * @parameter expression="${plugin.artifactId}"
- * @readonly
- */
- private String pluginArtifactId;
-
- /**
- * @parameter expression="${plugin.groupId}"
- * @readonly
- */
- private String pluginGroupId;
-
- /**
- * @parameter expression="${plugin.version}"
- * @readonly
- */
- private String pluginVersion;
-
- /** @component */
- private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory;
-
- /** @component */
- private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
-
- /**
- * @parameter expression="${localRepository}"
- * @readonly
- * */
- private org.apache.maven.artifact.repository.ArtifactRepository localRepository;
-
- /**
- *
- */
- private File pluginJarFile = null;
-
- /**
- *
- */
- private File resourceDir;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
-
- getLog().info("Executing " + project);
- getLog().info("Generating Skin " + skinName);
- String fullSkinName = packageName.replace('/', '.') + "." + skinName;
- String shortName = skinName;
- getLog().debug("Skin name is supposed to be " + shortName);
- getLog().debug("Root package " + packageName);
- getLog().debug("Skin package is " + fullSkinName);
-
-
- SkinInfo skinInfoTemplate = new SkinInfo();
- skinInfoTemplate.setShortName(shortName);
- skinInfoTemplate.setPackageName(fullSkinName.toLowerCase());
- skinInfoTemplate.setBaseClassResources(getArchetypeSkinTemplatesFromJar("skin/baseclasses"));
- skinInfoTemplate.setExtClassResources(getArchetypeSkinTemplatesFromJar("skin/extclasses"));
- skinInfoTemplate.setBaseSkin(baseSkin);
- skinInfoTemplate.setPropertyFile(new Resource("skin/skin.properties"));
- skinInfoTemplate.setMasterXcss(new Resource("skin/skin.xcss"));
- skinInfoTemplate.setExtendedXcss(new Resource("skin/skin.xcss"));
- skinInfoTemplate.setUseExt(createExt);
- generateSkin(skinInfoTemplate);
-
-
- getLog().info("Generating Skin successful");
-
- }
-
- private void copyJarResource(Resource template, Resource skinResource, File baseDir) throws Exception{
- File newFile = new File(baseDir, skinResource.getPath());
- if (newFile.exists()) {
- getLog().debug("File " + newFile + " already exists. Skipping.");
- } else {
- try {
- File dir = newFile.getParentFile();
- if (!dir.exists()) {
- dir.mkdirs();
- }
-
- InputStream inputStream = getClass().getClassLoader().getResourceAsStream(template.getPath());
- FileOutputStream fileOutputStream = new FileOutputStream(newFile);
- byte [] buffer = new byte[1024];
- int read = -1;
- while((read = inputStream.read(buffer)) != -1) {
- fileOutputStream.write(buffer, 0, read);
- }
- inputStream.close();
- fileOutputStream.close();
-
- } catch (Exception e) {
- throw new MojoExecutionException("Unable to write file " + newFile, e);
- }
- }
- }
-
- private void filterJarResource(Resource template, Resource skinResource, File baseDir, VelocityContext context) throws Exception{
- File newFile = new File(baseDir, skinResource.getPath());
- if (newFile.exists()) {
- getLog().debug("File " + newFile + " already exists. Skipping.");
- } else {
- try {
- writeParsedTemplate(template.getPath(), context, newFile);
- } catch (Exception e) {
- throw new MojoExecutionException("Unable to write file " + newFile, e);
- }
- }
- }
-
- private List<Resource> filterComponentSkinTemplates(List<Resource> jarTemplates, SkinInfo skinInfo, File resourceDir) throws MojoExecutionException {
- List<Resource> newResources = new ArrayList<Resource>(jarTemplates.size());
- for (Resource jarTemplate : jarTemplates) {
- Resource newResource = new Resource();
- String jarTemplateName = jarTemplate.getName();
- int indexOfSlash = jarTemplateName.lastIndexOf('/');
- if (indexOfSlash > 0) {
- jarTemplateName = jarTemplateName.substring(indexOfSlash + 1);
- }
- String resourceName = skinInfo.getPackageName().replace('.', '/') + "/css/" + jarTemplateName;
- newResource.setName(resourceName);
- newResource.setPath(resourceName);
- newResources.add(newResource);
- try {
- filterJarResource(jarTemplate, newResource, resourceDir, new VelocityContext());
- } catch (Exception e) {
- throw new MojoExecutionException("An exception occured while filtering resource " + jarTemplate + " into " + newResource, e);
- }
- }
- return newResources;
- }
-
-
- private SkinInfo cloneSkinInfo(SkinInfo skinInfo) throws MojoExecutionException {
- try {
- return (SkinInfo) skinInfo.clone();
- } catch(CloneNotSupportedException exception) {
- throw new MojoExecutionException("Dunno why.", exception);
- }
- }
-
- private void generateSkin(SkinInfo skinInfoTemplate) throws MojoExecutionException, MojoFailureException{
- resourceDir = new File(project.getBasedir(), SRC_MAIN_RESOURCES);
- getLog().debug("Resources directory is supposed to be" + resourceDir);
- checkAndCreateDirectory(resourceDir);
-
- String fullName = skinInfoTemplate.getPackageName();
- String packageFolder = fullName.replace('.', '/');
- getLog().debug("Relative path to package is " + packageFolder);
-
- VelocityContext velocityMasterContext = new VelocityContext();
- velocityMasterContext.put("mojo", this);
- velocityMasterContext.put("packagePath", packageFolder);
- velocityMasterContext.put("name", skinInfoTemplate.getShortName());
-
- if (baseSkin != null) {
- velocityMasterContext.put("baseSkin", baseSkin);
- }
-
- SkinInfo effectiveSkinInfo = cloneSkinInfo(skinInfoTemplate);
- List<Resource> allResources = new ArrayList<Resource>();
- velocityMasterContext.put("skinInfo", effectiveSkinInfo);
-
- //Copy basic classes, and list them
-
- List<Resource> baseClassResources = filterComponentSkinTemplates(skinInfoTemplate.getBaseClassResources(), skinInfoTemplate, resourceDir);
-
- effectiveSkinInfo.setBaseClassResources(baseClassResources);
- allResources.addAll(baseClassResources);
- velocityMasterContext.put("baseClassResources", baseClassResources);
-
- //Generate Master XCSS file
- Resource masterXcss = new Resource(META_INF_SKINS + effectiveSkinInfo.getShortName() + XCSS);
- effectiveSkinInfo.setMasterXcss(masterXcss);
- allResources.add(masterXcss);
- try {
- generateMasterXCSSFile(skinInfoTemplate.getMasterXcss(), effectiveSkinInfo.getMasterXcss(), effectiveSkinInfo.getBaseClassResources());
- } catch(Exception e) {
- throw new MojoExecutionException("Unable to generate master.xcss file " + masterXcss, e);
- }
-
- if (createExt) {
- //Copy Ext classes, if needed
- List<Resource> extClassResources = filterComponentSkinTemplates(skinInfoTemplate.getExtClassResources(), skinInfoTemplate, resourceDir);
- effectiveSkinInfo.setExtClassResources(extClassResources);
- allResources.addAll(extClassResources);
- velocityMasterContext.put("extClassResources", extClassResources);
-
- //Generate Master EXT XCSS file
- Resource masterExtXcss = new Resource(META_INF_SKINS + effectiveSkinInfo.getShortName() + EXT_XCSS);
- effectiveSkinInfo.setExtendedXcss(masterExtXcss);
- allResources.add(masterExtXcss);
- try {
- generateMasterXCSSFile(skinInfoTemplate.getExtendedXcss(), effectiveSkinInfo.getExtendedXcss(), effectiveSkinInfo.getExtClassResources());
-
- } catch(Exception e) {
- throw new MojoExecutionException("Unable to generate master.xcss file " + masterExtXcss, e);
- }
- }
-
- Resource properties = new Resource(META_INF_SKINS + effectiveSkinInfo.getShortName() + PROPERTIES);
- effectiveSkinInfo.setPropertyFile(properties);
- try {
- filterJarResource(skinInfoTemplate.getPropertyFile(), properties, resourceDir, velocityMasterContext);
- } catch (Exception e) {
- throw new MojoExecutionException("An exception occured while filtering resource " + skinInfoTemplate.getPropertyFile() + " into " + properties, e);
- }
-
-
- File resourceConfigDir = new File(project.getBasedir(), SRC_MAIN_CONFIG_RESOURCES);
- checkAndCreateDirectory(resourceConfigDir);
- File resourceConfigFile = new File(resourceConfigDir, effectiveSkinInfo.getShortName() + "-resources.xml");;
- try {
- addToResourceConfig(allResources, resourceConfigFile);
- } catch (Exception e) {
- throw new MojoExecutionException("Unable to register newly added resources in resource-config.xml", e);
- }
-
-
- packageArchetypeResourcesToBaseDir("src/main/java", effectiveSkinInfo, true);
- packageArchetypeResourcesToBaseDir("src/main/resources", effectiveSkinInfo, false);
- packageArchetypeResourcesToBaseDir("src/test/java", effectiveSkinInfo, true);
-
-
-
- }
-
- private List<Resource> packageArchetypeResourcesToBaseDir(String prefix, final SkinInfo skinInfo, boolean filter) throws MojoExecutionException{
- String archetypePrefix = "skin/archetype/" + prefix;
- List<Resource> archetypeResources = getArchetypeSkinTemplatesFromJar(archetypePrefix);
- List<Resource> filteredResources = new ArrayList<Resource>(archetypeResources.size());
- String newPrefix = prefix;
- String packageFolder = skinInfo.getPackageName().replace('.', '/');
- if (packageFolder != null) {
- newPrefix = prefix + "/" + packageFolder;
- }
-
-
- @SuppressWarnings("serial") VelocityContext velocityContext = new VelocityContext() {
- {
- put("skinInfo", skinInfo);
- }
- };
- for (Resource resource : archetypeResources) {
- String archetypePath = resource.getPath();
- String pathSuffix = archetypePath.substring(archetypePrefix.length());
- String newPath = newPrefix + pathSuffix;
-
- Resource newResource = new Resource(newPath);
-
- try {
- if (filter) {
- filterJarResource(resource, newResource, project.getBasedir(), velocityContext);
- } else {
- copyJarResource(resource, newResource, project.getBasedir());
- }
- } catch (Exception e) {
- throw new MojoExecutionException("Unable to process archetype file " + resource.getPath(), e);
- }
-
- filteredResources.add(newResource);
- }
- return filteredResources;
- }
-
- private void generateMasterXCSSFile(Resource template, Resource target, List<Resource> includedResources) throws Exception {
- VelocityContext context = new VelocityContext();
- context.put("mojo", this);
- context.put("includedResources", includedResources);
- filterJarResource(template, target, resourceDir, context);
- }
-
- private Resource fromJarEntry(JarEntry entry) {
- Resource resource = new Resource();
- resource.setName(entry.getName());
- resource.setPath(entry.getName());
- return resource;
- }
-
- private List<Resource> getArchetypeSkinTemplatesFromJar(String prefix) throws MojoExecutionException{
- try {
- if (pluginJarFile == null) {
- pluginJarFile = getPluginArtifactJar();
- }
- List <Resource> fileNames = new ArrayList<Resource>();
- JarFile jar = new JarFile(pluginJarFile);
- Enumeration<JarEntry> entries = jar.entries();
- while(entries.hasMoreElements()) {
- JarEntry jarEntry = entries.nextElement();
- String jarEntryName = jarEntry.getName();
- if(jarEntryName.startsWith(prefix) && !jarEntry.isDirectory()) {
- fileNames.add(fromJarEntry(jarEntry));
- }
- }
- return fileNames;
- } catch (Exception e) {
- throw new MojoExecutionException("Unable to list templates within Plugin Jar file");
- }
- }
-
- private File getPluginArtifactJar() throws ArtifactResolutionException, ArtifactNotFoundException {
- Artifact pluginArtifact =
- artifactFactory.createPluginArtifact(pluginGroupId, pluginArtifactId, VersionRange.createFromVersion(pluginVersion));
-
- resolver.resolve(pluginArtifact, Collections.emptyList(), localRepository);
-
- return pluginArtifact.getFile();
- }
-
- private void checkAndCreateDirectory(File directory) throws MojoExecutionException {
- getLog().debug("Checking directory " + directory + " for existence");
- if (!directory.exists()) {
- directory.mkdirs();
- getLog().debug("Directory " + directory + " created");
- }
- if (!directory.isDirectory()) {
- throw new MojoExecutionException("Directory " + directory.getAbsolutePath() + " is not a Directory");
- }
- }
-
- private void addToResourceConfig(List<Resource> resources, File resourceConfigFile) throws Exception{
- ResourceConfig resourceConfig = null;
-
- if (resourceConfigFile.exists()) {
- resourceConfig = new ResourceConfigXpp3Reader().read(new FileInputStream(resourceConfigFile));
- }
-
- if (resourceConfig == null) {
- resourceConfig = new ResourceConfig();
- resourceConfig.setResources(resources);
- } else {
- for (Resource resource : resources) {
- if (!resourceConfig.containsResource(resource)) {
- resourceConfig.addResource(resource);
- }
- }
- }
-
-
-
- new ResourceConfigXpp3Writer().write(new FileWriter(resourceConfigFile), resourceConfig);
-
- }
-
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateSkinMojo.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,437 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import org.aja4jsf.builder.model.Resource;
+import org.aja4jsf.builder.model.ResourceConfig;
+import org.aja4jsf.builder.model.io.xpp3.ResourceConfigXpp3Reader;
+import org.aja4jsf.builder.model.io.xpp3.ResourceConfigXpp3Writer;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.velocity.VelocityContext;
+
+/**
+ * This mojo is intended to create new skin add-on within existing project.
+ * New resources are added to the project, and existing resource config is modified to include new files.
+ * <p><b>Usage</b> <tt>mvn cdk:add-skin -Dname=<skinName> -Dpackage=<skinPackage>. </tt></p>
+ * This adds new skin named <skinName> to project resources/META-INF/skins folder.<br/>
+ * Skin resources - XCSS files are placed in <skinPackage>.<skinName> package within project resources directory.<br/>
+ * If <em>package</em> is not specified, it is set same as groupId.<br/>
+ *
+ * Following parameters can be used
+ * <li><strong>name</strong> - name of the skin. <strong>Required.</strong></li>
+ * <li><strong>package</strong> - base package of the skin. If not specified, <em>groupId</em> is used</li>
+ * <li><strong>createExt</strong> - if set to true, extended skin files are added</li>
+ * <li><strong>baseSkin</strong> - name of base skin</li>
+ *
+ * @goal add-skin
+ * @requiresProject true
+ *
+ *
+
+ * @author Maksim Kaszynski
+ *
+ */
+public class CreateSkinMojo extends AbstractCreateMojo {
+
+ private static final String PROPERTIES = ".skin.properties";
+
+ private static final String XCSS = ".xcss";
+
+ private static final String EXT_XCSS = "-ext.xcss";
+
+ private static final String SRC_MAIN_CONFIG_RESOURCES = "src/main/config/resources";
+
+ private static final String META_INF_SKINS = "META-INF/skins/";
+
+ /**
+ * Name of base package of skin.
+ * If it is not set, GroupId is used.
+ * @parameter expression="${package}" default-value="${project.groupId}"
+ */
+ private String packageName;
+
+
+ /**
+ * Name of skin. Required parameter.
+ * @parameter expression="${name}"
+ * @required
+ */
+ private String skinName;
+
+
+ /**
+ * Name of base skin.
+ * @parameter expression="${baseSkin}"
+ */
+ private String baseSkin;
+
+ /**
+ * If set to true, a set of extended classes is generated
+ * @parameter expression="${createExt}"
+ */
+ private boolean createExt;
+
+
+ /**
+ * @parameter expression="${plugin.artifactId}"
+ * @readonly
+ */
+ private String pluginArtifactId;
+
+ /**
+ * @parameter expression="${plugin.groupId}"
+ * @readonly
+ */
+ private String pluginGroupId;
+
+ /**
+ * @parameter expression="${plugin.version}"
+ * @readonly
+ */
+ private String pluginVersion;
+
+ /** @component */
+ private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory;
+
+ /** @component */
+ private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
+
+ /**
+ * @parameter expression="${localRepository}"
+ * @readonly
+ * */
+ private org.apache.maven.artifact.repository.ArtifactRepository localRepository;
+
+ /**
+ *
+ */
+ private File pluginJarFile = null;
+
+ /**
+ *
+ */
+ private File resourceDir;
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+
+ getLog().info("Executing " + project);
+ getLog().info("Generating Skin " + skinName);
+ String fullSkinName = packageName.replace('/', '.') + "." + skinName;
+ String shortName = skinName;
+ getLog().debug("Skin name is supposed to be " + shortName);
+ getLog().debug("Root package " + packageName);
+ getLog().debug("Skin package is " + fullSkinName);
+
+ //RF-4023
+ if (!isValidJavaName(skinName)){
+ throw new MojoExecutionException("Invalid skin name '" + skinName + "'. Please type another name.");
+ }
+
+ if (!isValidPackageName(packageName)) {
+ throw new MojoExecutionException("Invalid skin package '" + packageName + "'. Please type another package.");
+ }
+
+ SkinInfo skinInfoTemplate = new SkinInfo();
+ skinInfoTemplate.setShortName(shortName);
+ skinInfoTemplate.setPackageName(fullSkinName.toLowerCase());
+ skinInfoTemplate.setBaseClassResources(getArchetypeSkinTemplatesFromJar("skin/baseclasses"));
+ skinInfoTemplate.setExtClassResources(getArchetypeSkinTemplatesFromJar("skin/extclasses"));
+ skinInfoTemplate.setBaseSkin(baseSkin);
+ skinInfoTemplate.setPropertyFile(new Resource("skin/skin.properties"));
+ skinInfoTemplate.setMasterXcss(new Resource("skin/skin.xcss"));
+ skinInfoTemplate.setExtendedXcss(new Resource("skin/skin.xcss"));
+ skinInfoTemplate.setUseExt(createExt);
+ generateSkin(skinInfoTemplate);
+
+
+ getLog().info("Generating Skin successful");
+
+ }
+
+ private void copyJarResource(Resource template, Resource skinResource, File baseDir) throws Exception{
+ File newFile = new File(baseDir, skinResource.getPath());
+ if (newFile.exists()) {
+ getLog().debug("File " + newFile + " already exists. Skipping.");
+ } else {
+ try {
+ File dir = newFile.getParentFile();
+ if (!dir.exists()) {
+ dir.mkdirs();
+ }
+
+ InputStream inputStream = getClass().getClassLoader().getResourceAsStream(template.getPath());
+ FileOutputStream fileOutputStream = new FileOutputStream(newFile);
+ byte [] buffer = new byte[1024];
+ int read = -1;
+ while((read = inputStream.read(buffer)) != -1) {
+ fileOutputStream.write(buffer, 0, read);
+ }
+ inputStream.close();
+ fileOutputStream.close();
+
+ } catch (Exception e) {
+ throw new MojoExecutionException("Unable to write file " + newFile, e);
+ }
+ }
+ }
+
+ private List<Resource> filterComponentSkinTemplates(List<Resource> jarTemplates, SkinInfo skinInfo, File resourceDir) throws MojoExecutionException {
+ List<Resource> newResources = new ArrayList<Resource>(jarTemplates.size());
+ for (Resource jarTemplate : jarTemplates) {
+ Resource newResource = new Resource();
+ String jarTemplateName = jarTemplate.getName();
+ int indexOfSlash = jarTemplateName.lastIndexOf('/');
+ if (indexOfSlash > 0) {
+ jarTemplateName = jarTemplateName.substring(indexOfSlash + 1);
+ }
+ String resourceName = skinInfo.getPackageName().replace('.', '/') + "/css/" + jarTemplateName;
+ newResource.setName(resourceName);
+ newResource.setPath(resourceName);
+ newResources.add(newResource);
+ try {
+ filterJarResource(jarTemplate, newResource, resourceDir, new VelocityContext());
+ } catch (Exception e) {
+ throw new MojoExecutionException("An exception occured while filtering resource " + jarTemplate + " into " + newResource, e);
+ }
+ }
+ return newResources;
+ }
+
+
+ private SkinInfo cloneSkinInfo(SkinInfo skinInfo) throws MojoExecutionException {
+ try {
+ return (SkinInfo) skinInfo.clone();
+ } catch(CloneNotSupportedException exception) {
+ throw new MojoExecutionException("Dunno why.", exception);
+ }
+ }
+
+ private void generateSkin(SkinInfo skinInfoTemplate) throws MojoExecutionException, MojoFailureException{
+ resourceDir = new File(project.getBasedir(), SRC_MAIN_RESOURCES);
+ getLog().debug("Resources directory is supposed to be" + resourceDir);
+ checkAndCreateDirectory(resourceDir);
+
+ String fullName = skinInfoTemplate.getPackageName();
+ String packageFolder = fullName.replace('.', '/');
+ getLog().debug("Relative path to package is " + packageFolder);
+
+ VelocityContext velocityMasterContext = new VelocityContext();
+ velocityMasterContext.put("mojo", this);
+ velocityMasterContext.put("packagePath", packageFolder);
+ velocityMasterContext.put("name", skinInfoTemplate.getShortName());
+
+ if (baseSkin != null) {
+ velocityMasterContext.put("baseSkin", baseSkin);
+ }
+
+ SkinInfo effectiveSkinInfo = cloneSkinInfo(skinInfoTemplate);
+ List<Resource> allResources = new ArrayList<Resource>();
+ velocityMasterContext.put("skinInfo", effectiveSkinInfo);
+
+ //Copy basic classes, and list them
+
+ List<Resource> baseClassResources = filterComponentSkinTemplates(skinInfoTemplate.getBaseClassResources(), skinInfoTemplate, resourceDir);
+
+ effectiveSkinInfo.setBaseClassResources(baseClassResources);
+ allResources.addAll(baseClassResources);
+ velocityMasterContext.put("baseClassResources", baseClassResources);
+
+ //Generate Master XCSS file
+ Resource masterXcss = new Resource(META_INF_SKINS + effectiveSkinInfo.getShortName() + XCSS);
+ effectiveSkinInfo.setMasterXcss(masterXcss);
+ allResources.add(masterXcss);
+ try {
+ generateMasterXCSSFile(skinInfoTemplate.getMasterXcss(), effectiveSkinInfo.getMasterXcss(), effectiveSkinInfo.getBaseClassResources());
+ } catch(Exception e) {
+ throw new MojoExecutionException("Unable to generate master.xcss file " + masterXcss, e);
+ }
+
+ if (createExt) {
+ //Copy Ext classes, if needed
+ List<Resource> extClassResources = filterComponentSkinTemplates(skinInfoTemplate.getExtClassResources(), skinInfoTemplate, resourceDir);
+ effectiveSkinInfo.setExtClassResources(extClassResources);
+ allResources.addAll(extClassResources);
+ velocityMasterContext.put("extClassResources", extClassResources);
+
+ //Generate Master EXT XCSS file
+ Resource masterExtXcss = new Resource(META_INF_SKINS + effectiveSkinInfo.getShortName() + EXT_XCSS);
+ effectiveSkinInfo.setExtendedXcss(masterExtXcss);
+ allResources.add(masterExtXcss);
+ try {
+ generateMasterXCSSFile(skinInfoTemplate.getExtendedXcss(), effectiveSkinInfo.getExtendedXcss(), effectiveSkinInfo.getExtClassResources());
+
+ } catch(Exception e) {
+ throw new MojoExecutionException("Unable to generate master.xcss file " + masterExtXcss, e);
+ }
+ }
+
+ Resource properties = new Resource(META_INF_SKINS + effectiveSkinInfo.getShortName() + PROPERTIES);
+ effectiveSkinInfo.setPropertyFile(properties);
+ try {
+ filterJarResource(skinInfoTemplate.getPropertyFile(), properties, resourceDir, velocityMasterContext);
+ } catch (Exception e) {
+ throw new MojoExecutionException("An exception occured while filtering resource " + skinInfoTemplate.getPropertyFile() + " into " + properties, e);
+ }
+
+
+ File resourceConfigDir = new File(project.getBasedir(), SRC_MAIN_CONFIG_RESOURCES);
+ checkAndCreateDirectory(resourceConfigDir);
+ File resourceConfigFile = new File(resourceConfigDir, effectiveSkinInfo.getShortName() + "-resources.xml");;
+ try {
+ addToResourceConfig(allResources, resourceConfigFile);
+ } catch (Exception e) {
+ throw new MojoExecutionException("Unable to register newly added resources in resource-config.xml", e);
+ }
+
+
+ packageArchetypeResourcesToBaseDir("src/main/java", effectiveSkinInfo, true);
+ packageArchetypeResourcesToBaseDir("src/main/resources", effectiveSkinInfo, false);
+ packageArchetypeResourcesToBaseDir("src/test/java", effectiveSkinInfo, true);
+
+
+
+ }
+
+ private List<Resource> packageArchetypeResourcesToBaseDir(String prefix, final SkinInfo skinInfo, boolean filter) throws MojoExecutionException{
+ String archetypePrefix = "skin/archetype/" + prefix;
+ List<Resource> archetypeResources = getArchetypeSkinTemplatesFromJar(archetypePrefix);
+ List<Resource> filteredResources = new ArrayList<Resource>(archetypeResources.size());
+ String newPrefix = prefix;
+ String packageFolder = skinInfo.getPackageName().replace('.', '/');
+ if (packageFolder != null) {
+ newPrefix = prefix + "/" + packageFolder;
+ }
+
+
+ @SuppressWarnings("serial") VelocityContext velocityContext = new VelocityContext() {
+ {
+ put("skinInfo", skinInfo);
+ }
+ };
+ for (Resource resource : archetypeResources) {
+ String archetypePath = resource.getPath();
+ String pathSuffix = archetypePath.substring(archetypePrefix.length());
+ String newPath = newPrefix + pathSuffix;
+
+ Resource newResource = new Resource(newPath);
+
+ try {
+ if (filter) {
+ filterJarResource(resource, newResource, project.getBasedir(), velocityContext);
+ } else {
+ copyJarResource(resource, newResource, project.getBasedir());
+ }
+ } catch (Exception e) {
+ throw new MojoExecutionException("Unable to process archetype file " + resource.getPath(), e);
+ }
+
+ filteredResources.add(newResource);
+ }
+ return filteredResources;
+ }
+
+ private void generateMasterXCSSFile(Resource template, Resource target, List<Resource> includedResources) throws Exception {
+ VelocityContext context = new VelocityContext();
+ context.put("mojo", this);
+ context.put("includedResources", includedResources);
+ filterJarResource(template, target, resourceDir, context);
+ }
+
+ private Resource fromJarEntry(JarEntry entry) {
+ Resource resource = new Resource();
+ resource.setName(entry.getName());
+ resource.setPath(entry.getName());
+ return resource;
+ }
+
+ private List<Resource> getArchetypeSkinTemplatesFromJar(String prefix) throws MojoExecutionException{
+ try {
+ if (pluginJarFile == null) {
+ pluginJarFile = getPluginArtifactJar();
+ }
+ List <Resource> fileNames = new ArrayList<Resource>();
+ JarFile jar = new JarFile(pluginJarFile);
+ Enumeration<JarEntry> entries = jar.entries();
+ while(entries.hasMoreElements()) {
+ JarEntry jarEntry = entries.nextElement();
+ String jarEntryName = jarEntry.getName();
+ if(jarEntryName.startsWith(prefix) && !jarEntry.isDirectory()) {
+ fileNames.add(fromJarEntry(jarEntry));
+ }
+ }
+ return fileNames;
+ } catch (Exception e) {
+ throw new MojoExecutionException("Unable to list templates within Plugin Jar file");
+ }
+ }
+
+ private File getPluginArtifactJar() throws ArtifactResolutionException, ArtifactNotFoundException {
+ Artifact pluginArtifact =
+ artifactFactory.createPluginArtifact(pluginGroupId, pluginArtifactId, VersionRange.createFromVersion(pluginVersion));
+
+ resolver.resolve(pluginArtifact, Collections.emptyList(), localRepository);
+
+ return pluginArtifact.getFile();
+ }
+
+ private void addToResourceConfig(List<Resource> resources, File resourceConfigFile) throws Exception{
+ ResourceConfig resourceConfig = null;
+
+ if (resourceConfigFile.exists()) {
+ resourceConfig = new ResourceConfigXpp3Reader().read(new FileInputStream(resourceConfigFile));
+ }
+
+ if (resourceConfig == null) {
+ resourceConfig = new ResourceConfig();
+ resourceConfig.setResources(resources);
+ } else {
+ for (Resource resource : resources) {
+ if (!resourceConfig.containsResource(resource)) {
+ resourceConfig.addResource(resource);
+ }
+ }
+ }
+
+
+
+ new ResourceConfigXpp3Writer().write(new FileWriter(resourceConfigFile), resourceConfig);
+
+ }
+
+}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateThemeMojo.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateThemeMojo.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateThemeMojo.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateThemeMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,158 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+import java.io.File;
+import java.util.Locale;
+
+import org.aja4jsf.builder.model.Resource;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.velocity.VelocityContext;
+
+/**
+ * This mojo is intended to create new theme within existing project.
+ * <p><b>Usage</b> <tt>mvn cdk:add-theme -Dname=<themeName> [ -Dpackage=<themePackage> ]</tt></p>
+ * This adds new theme named <themeName> to project resources/META-INF/themes folder.<br/>
+ * If <em>package</em> is not specified, it is set same as groupId.<br/>
+ *
+ * Following parameters can be used
+ * <li><strong>name</strong> - name of the theme. <strong>Required.</strong></li>
+ * <li><strong>package</strong> - base package of the theme. If not specified, <em>groupId</em> is used</li>
+ *
+ * @goal add-theme
+ * @requiresProject true
+ *
+ * @author Nick Belaevski
+ */
+public class CreateThemeMojo extends AbstractCreateMojo {
+
+ private static final String XCSS = ".xcss";
+
+ private static final String META_INF_THEMES = "META-INF/themes/";
+
+ private static final String XCSS_THEMES_PACKAGE = "/renderkit/html/css";
+
+ private static final String THEME_PROPERTIES = ".theme.properties";
+
+ private static final String RENDERKIT_THEMES = "renderkit.html";
+
+ /**
+ * Name of base package of theme.
+ * If it is not set, GroupId is used.
+ * @parameter expression="${package}" default-value="${project.groupId}"
+ */
+ private String packageName;
+
+
+ /**
+ * Name of theme. Required parameter.
+ * @parameter expression="${name}"
+ * @required
+ */
+ private String themeName;
+
+ private String generateRendererName(String themeName) {
+ StringBuilder rendererTypeBuilder = new StringBuilder();
+ rendererTypeBuilder.append(Character.toUpperCase(themeName.charAt(0)));
+ rendererTypeBuilder.append(themeName.subSequence(1, themeName.length()));
+ rendererTypeBuilder.append("Renderer");
+ return rendererTypeBuilder.toString();
+ }
+
+ private void generateTheme(String packageName, String themeName) throws MojoExecutionException, MojoFailureException {
+ Resource themeProperties = new Resource("theme/themes/theme.properties");
+ Resource themeXCSS = new Resource("theme/css/theme.xcss");
+ Resource themeConfig = new Resource("theme/component/theme.xml");
+ Resource themeTemplate = new Resource("theme/template/theme.jspx");
+
+ File resourceDir = new File(project.getBasedir(), SRC_MAIN_RESOURCES);
+
+ String packagePath = packageName.replace('.', '/');
+ String xcssPackagePath = packagePath + XCSS_THEMES_PACKAGE;
+ String rendererName = generateRendererName(themeName);
+ String rendererType = packageName + '.' + rendererName;
+ String rendererClassName = packageName + '.' + RENDERKIT_THEMES + '.' + rendererName;
+
+ getLog().debug("Relative path to package is " + packagePath);
+
+ VelocityContext velocityMasterContext = new VelocityContext();
+ velocityMasterContext.put("packagePath", packagePath);
+ velocityMasterContext.put("xcssPackagePath", xcssPackagePath);
+ velocityMasterContext.put("name", themeName);
+ velocityMasterContext.put("rendererType", rendererType);
+ velocityMasterContext.put("rendererClassName", rendererClassName);
+
+ Resource properties = new Resource(META_INF_THEMES + themeName + THEME_PROPERTIES);
+ try {
+ filterJarResource(themeProperties, properties, resourceDir, velocityMasterContext);
+ } catch (Exception e) {
+ throw new MojoExecutionException("An exception occured while filtering resource " + themeProperties + " into " + properties, e);
+ }
+
+ Resource xcss = new Resource(xcssPackagePath + '/' + themeName + XCSS);
+ try {
+ filterJarResource(themeXCSS, xcss, resourceDir, velocityMasterContext);
+ } catch (Exception e) {
+ throw new MojoExecutionException("An exception occured while filtering resource " + themeXCSS + " into " + xcss, e);
+ }
+
+ File configDir = new File(project.getBasedir(), "src/main/config/component");
+ Resource config = new Resource(themeName + ".xml");
+ try {
+ filterJarResource(themeConfig, config, configDir, velocityMasterContext);
+ } catch (Exception e) {
+ throw new MojoExecutionException("An exception occured while filtering resource " + themeConfig + " into " + config, e);
+ }
+
+ File templateDir = new File(project.getBasedir(), "src/main/templates");
+ Resource template = new Resource(packagePath + '/' + themeName + ".jspx");
+ try {
+ filterJarResource(themeTemplate, template, templateDir, velocityMasterContext);
+ } catch (Exception e) {
+ throw new MojoExecutionException("An exception occured while filtering resource " + themeTemplate + " into " + template, e);
+ }
+ }
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ getLog().info("Executing " + project);
+ getLog().info("Generating Theme " + themeName);
+
+ String themePackageName = packageName.replace('/', '.').toLowerCase(Locale.US);
+ String shortName = themeName;
+ getLog().debug("Root package " + packageName);
+ getLog().debug("Theme package is " + themePackageName);
+
+ if (!isValidJavaName(themeName)){
+ throw new MojoExecutionException("Invalid theme name '" + themeName + "'. Please type another name.");
+ }
+
+ if (!isValidPackageName(packageName)) {
+ throw new MojoExecutionException("Invalid theme package '" + packageName + "'. Please type another package.");
+ }
+
+ generateTheme(themePackageName, shortName);
+
+ getLog().info("Generating Theme successful");
+ }
+
+}
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,324 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.mojo;
-
-import java.io.File;
-import java.io.FilenameFilter;
-
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ParsingException;
-import org.ajax4jsf.builder.generator.ComponentGenerator;
-import org.ajax4jsf.builder.generator.ComponentGenerator2;
-import org.ajax4jsf.builder.generator.ComponentTagGenerator;
-import org.ajax4jsf.builder.generator.ConverterGenerator;
-import org.ajax4jsf.builder.generator.ConverterTagGenerator;
-import org.ajax4jsf.builder.generator.FaceletsTaglibGenerator;
-import org.ajax4jsf.builder.generator.FacesConfigGenerator;
-import org.ajax4jsf.builder.generator.GeneratorException;
-import org.ajax4jsf.builder.generator.JSFGeneratorConfiguration;
-import org.ajax4jsf.builder.generator.ListenerGenerator;
-import org.ajax4jsf.builder.generator.ListenerTagGenerator;
-import org.ajax4jsf.builder.generator.RenderKitBean;
-import org.ajax4jsf.builder.generator.RendererGenerator;
-import org.ajax4jsf.builder.generator.ResourcesConfigGenerator;
-import org.ajax4jsf.builder.generator.TagHandlerGenerator;
-import org.ajax4jsf.builder.generator.TaglibGenerator;
-import org.ajax4jsf.builder.generator.ValidatorGenerator;
-import org.ajax4jsf.builder.generator.ValidatorTagGenerator;
-import org.ajax4jsf.builder.maven.MavenLogger;
-import org.ajax4jsf.builder.velocity.BuilderContext;
-import org.apache.maven.model.Resource;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.apache.velocity.Template;
-import org.apache.velocity.exception.ParseErrorException;
-import org.apache.velocity.exception.ResourceNotFoundException;
-
-/**
- * This plugin geterate JSF components and renderers source code, as well as
- * configuration files.
- *
- * @author shura
- * @goal generate
- * @requiresDependencyResolution compile
- * @phase generate-sources
- * @execute phase="compile"
- */
-public class GenerateMojo extends AbstractCDKMojo implements
- JSFGeneratorConfiguration {
-
- /**
- * Project executed by first compile lifecycle.
- *
- * @parameter expression="${executedProject}"
- * @readonly
- */
- protected MavenProject executedProject;
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.maven.plugin.Mojo#execute()
- */
- public void execute() throws MojoExecutionException, MojoFailureException {
- getLog().debug("GenerateMojo components");
-
- //FIXME: configure plexus component instead of programmatic property set.
-
- // velocity.getEngine().setProperty("velocimacro.library", getTemplatesPath() + "/VM_global_library.vm");
-
- if (null != executedProject) {
- Taglib taglib = checkLibraryConfig();
- ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
- // compile goal executed
- try {
- // Parse config files.
- ClassLoader generatiorLoader = createProjectClassLoader(executedProject);
- Thread.currentThread().setContextClassLoader(generatiorLoader);
- BuilderConfig config = createConfig(generatiorLoader);
- MavenLogger mavenLogger = new MavenLogger(getLog());
- // TODO - parse sources by qdox for JavaDoc comments ?
- // GenerateMojo components.
- ComponentGenerator2 compGenerator = new ComponentGenerator2(this,
- mavenLogger);
- compGenerator.createFiles(config);
- // GenerateMojo validators
- ValidatorGenerator validatorGenerator = new ValidatorGenerator(this, mavenLogger);
- validatorGenerator.createFiles(config);
- // GenerateMojo converters
- ConverterGenerator converterGenerator = new ConverterGenerator(this, mavenLogger);
- converterGenerator.createFiles(config);
- // GenerateMojo renderers
- RendererGenerator rendererGenerator = new RendererGenerator(
- this, mavenLogger);
- rendererGenerator.setSrcDir(templatesDirectory);
- rendererGenerator.createFiles(config);
- // GenerateMojo component test
-/*
- ComponentTestGenerator componentTestGenerator = new ComponentTestGenerator(this, mavenLogger);
- componentTestGenerator.setDestDir(outputTestsDirectory);
- componentTestGenerator.createFiles(config);
-*/
- // GenerateMojo tags
- ComponentTagGenerator componentTagGenerator = new ComponentTagGenerator(this, mavenLogger);
- componentTagGenerator.createFiles(config);
-
-// GenerateMojo tags for validators
- ValidatorTagGenerator validatorTagGenerator = new ValidatorTagGenerator(this, mavenLogger);
- validatorTagGenerator.createFiles(config);
-
-// GenerateMojo tags for converters
- ConverterTagGenerator converterTagGenerator = new ConverterTagGenerator(this, mavenLogger);
- converterTagGenerator.createFiles(config);
-
-
- ListenerTagGenerator listenerTagGenerator = new ListenerTagGenerator(this, mavenLogger);
- listenerTagGenerator.createFiles(config);
-
-
- // GenerateMojo tag test
-/*
- TagTestGenerator tagTestGenerator = new TagTestGenerator(this, mavenLogger);
- tagTestGenerator.setDestDir(outputTestsDirectory);
- tagTestGenerator.createFiles(config);
-*/
- // GenerateMojo tag handlers
- TagHandlerGenerator tagHandlerGenerator = new TagHandlerGenerator(
- this, mavenLogger);
- tagHandlerGenerator.createFiles(config);
- //Generate listeners
- ListenerGenerator listenerGenerator = new ListenerGenerator(this, mavenLogger);
- listenerGenerator.createFiles(config);
-
- JSFGeneratorConfiguration resourcesConfiguration = new JSFGeneratorConfiguration() {
-
- public ClassLoader getClassLoader() {
- return createProjectClassLoader(executedProject);
- }
-
- public File getDestDir() {
- return outputResourcesDirectory;
- }
-
- public String getKey() {
- return key;
- }
-
- public Template getTemplate(String name) throws GeneratorException {
- return GenerateMojo.this.getTemplate(name);
- }
-
- public String getTemplatesPath() {
- return GenerateMojo.this.getTemplatesPath();
- }
-
- };
- // GenerateMojo faces-config
- FacesConfigGenerator configGenerator = new FacesConfigGenerator(
- resourcesConfiguration, mavenLogger);
- configGenerator.setInclude(facesConfigInclude);
- configGenerator.setFacesconfig(new File(
- outputResourcesDirectory, "META-INF/faces-config.xml"));
- RenderKitBean renderKitBean = configGenerator.createRenderKit();
- renderKitBean.setRenderkitid("HTML_BASIC");
- configGenerator.createFiles(config);
- // GenerateMojo JSP taglib
- if (null != taglib) {
- TaglibGenerator taglibGenerator = new TaglibGenerator(
- resourcesConfiguration, mavenLogger);
- taglibGenerator.setUri(taglib.getUri());
- taglibGenerator.setShortname(taglib.getShortName());
- taglibGenerator.setListenerclass(taglib.getListenerClass());
- taglibGenerator.setDisplayname(taglib.getDisplayName());
- taglibGenerator.setListenerclass(taglib.getListenerClass());
- taglibGenerator.setValidatorclass(taglib.getValidatorClass());
- taglibGenerator.setTlibversion(taglib.getTlibVersion());
- taglibGenerator.setJspversion(taglib.getJspVersion());
- taglibGenerator.setInclude(taglibInclude);
- taglibGenerator.setTaglib(new File(
- outputResourcesDirectory, "META-INF/"+taglib.getShortName()
- + ".tld"));
- taglibGenerator.createFiles(config);
- // GenerateMojo Facelets taglib
- FaceletsTaglibGenerator faceletsTaglibGenerator = new FaceletsTaglibGenerator(
- resourcesConfiguration, mavenLogger);
- faceletsTaglibGenerator.setUri(taglib.getUri());
- faceletsTaglibGenerator.setShortname(taglib.getShortName());
- faceletsTaglibGenerator.setInclude(taglibInclude);
- faceletsTaglibGenerator.setTaglib(new File(
- outputResourcesDirectory, "META-INF/"+taglib.getShortName()
- + ".taglib.xml"));
- faceletsTaglibGenerator.createFiles(config);
- }
-
- // Generate resources configuration file resources-config.xml
- // for all images/scripts/css...
- ResourcesConfigGenerator resourcesConfigGenerator = new ResourcesConfigGenerator(resourcesConfiguration, mavenLogger);
- resourcesConfigGenerator.setInclude(resourcesInclude);
- resourcesConfigGenerator.setTemplates(templatesDirectory);
- resourcesConfigGenerator.setResourcesConfig(new File(
- outputResourcesDirectory, "META-INF/resources-config.xml"));
- resourcesConfigGenerator.createFiles(config);
-
- // Add generated sources and resources to project
- project.addCompileSourceRoot(outputJavaDirectory.getPath());
-// project.addCompileSourceRoot(outputTestsDirectory.getPath());
-
- Resource resource = new Resource();
- resource.setDirectory(outputResourcesDirectory.getPath());
-// resource.setTargetPath("META-INF");
- project.addResource(resource);
- } catch (Exception e) {
- getLog().error("Error on generate component", e);
- throw new MojoExecutionException(
- "Error in component generation", e);
- }
- Thread.currentThread().setContextClassLoader(contextCL);
- }
-
- }
-
- protected BuilderConfig createConfig(ClassLoader generatiorLoader)
- throws ParsingException {
- BuilderConfig builderConfig = new BuilderConfig(generatiorLoader,
- new MavenLogger(getLog()));
- // Get all *.xml config files
- FilenameFilter filter = new FilenameFilter() {
-
- public boolean accept(File dir, String name) {
-
- return name.toLowerCase().endsWith(".xml");
- }
-
- };
- boolean filesParsed = false;
- File [] directories = {
- componentConfigDirectory,
- validatorConfigDirectory,
- converterConfigDirectory
- };
-
- for (File directory : directories) {
- if (directory.exists()) {
- File[] files = directory.listFiles(filter);
- for (File file : files) {
- filesParsed = true;
- builderConfig.parseConfig(file);
- }
- }
- }
- if (!filesParsed) {
- getLog().warn("No component configuration files found -- probably a skin project");
- }
- /*
- if (!filesParsed) {
- throw new ParsingException("No config files found");
- }
- */
- builderConfig.checkComponentProperties();
- return builderConfig;
- }
-
- public File getDestDir() {
- // TODO Auto-generated method stub
- return outputJavaDirectory;
- }
-
- public String getKey() {
- // TODO Auto-generated method stub
- return key;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.builder.generator.JSFGeneratorConfiguration#getClassLoader()
- */
- public ClassLoader getClassLoader() {
- return createProjectClassLoader(executedProject);
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.JSFGeneratorConfiguration#getTemplate(java.lang.String)
- */
- public Template getTemplate(String name) throws GeneratorException {
- // TODO Auto-generated method stub
- try {
- return this.velocity.getEngine().getTemplate(name);
- } catch (ResourceNotFoundException e) {
- throw new GeneratorException(e.getLocalizedMessage());
- } catch (ParseErrorException e) {
- throw new GeneratorException(e.getLocalizedMessage());
- } catch (Exception e) {
- throw new GeneratorException(e.getLocalizedMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.builder.generator.JSFGeneratorConfiguration#getTemplatesPath()
- */
- public String getTemplatesPath() {
- return Library.JSF12.equals(library.getJsfVersion())?BuilderContext.TEMPLATES12_PATH:BuilderContext.TEMPLATES_PATH;
- }
-
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,339 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+import org.apache.maven.model.Resource;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.velocity.Template;
+import org.apache.velocity.exception.ParseErrorException;
+import org.apache.velocity.exception.ResourceNotFoundException;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.config.ParsingException;
+import org.richfaces.builder.generator.ComponentGenerator2;
+import org.richfaces.builder.generator.ComponentTagGenerator;
+import org.richfaces.builder.generator.ConverterGenerator;
+import org.richfaces.builder.generator.ConverterTagGenerator;
+import org.richfaces.builder.generator.FaceletsTaglibGenerator;
+import org.richfaces.builder.generator.FacesConfigGenerator;
+import org.richfaces.builder.generator.GeneratorException;
+import org.richfaces.builder.generator.JSFGeneratorConfiguration;
+import org.richfaces.builder.generator.ListenerGenerator;
+import org.richfaces.builder.generator.ListenerTagGenerator;
+import org.richfaces.builder.generator.RenderKitBean;
+import org.richfaces.builder.generator.RendererGenerator;
+import org.richfaces.builder.generator.ResourcesConfigGenerator;
+import org.richfaces.builder.generator.ResourcesConfigParser;
+import org.richfaces.builder.generator.ResourcesDependenciesGenerator;
+import org.richfaces.builder.generator.TagHandlerGenerator;
+import org.richfaces.builder.generator.TaglibGenerator;
+import org.richfaces.builder.generator.ValidatorGenerator;
+import org.richfaces.builder.generator.ValidatorTagGenerator;
+import org.richfaces.builder.maven.MavenLogger;
+import org.richfaces.builder.velocity.BuilderContext;
+
+/**
+ * This plugin geterate JSF components and renderers source code, as well as
+ * configuration files.
+ *
+ * @author shura
+ * @goal generate
+ * @requiresDependencyResolution compile
+ * @phase generate-sources
+ * @execute phase="compile"
+ */
+public class GenerateMojo extends AbstractCDKMojo implements
+ JSFGeneratorConfiguration {
+
+ /**
+ * Project executed by first compile lifecycle.
+ *
+ * @parameter expression="${executedProject}"
+ * @readonly
+ */
+ protected MavenProject executedProject;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.maven.plugin.Mojo#execute()
+ */
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ getLog().debug("GenerateMojo components");
+
+ //FIXME: configure plexus component instead of programmatic property set.
+
+ // velocity.getEngine().setProperty("velocimacro.library", getTemplatesPath() + "/VM_global_library.vm");
+
+ if (null != executedProject) {
+ Taglib taglib = checkLibraryConfig();
+ ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
+ // compile goal executed
+ try {
+ // Parse config files.
+ ClassLoader generatiorLoader = createProjectClassLoader(executedProject);
+ Thread.currentThread().setContextClassLoader(generatiorLoader);
+ BuilderConfig config = createConfig(generatiorLoader);
+ MavenLogger mavenLogger = new MavenLogger(getLog());
+ // TODO - parse sources by qdox for JavaDoc comments ?
+ // GenerateMojo components.
+ ComponentGenerator2 compGenerator = new ComponentGenerator2(this,
+ mavenLogger);
+ compGenerator.createFiles(config);
+ // GenerateMojo validators
+ ValidatorGenerator validatorGenerator = new ValidatorGenerator(this, mavenLogger);
+ validatorGenerator.createFiles(config);
+ // GenerateMojo converters
+ ConverterGenerator converterGenerator = new ConverterGenerator(this, mavenLogger);
+ converterGenerator.createFiles(config);
+ // GenerateMojo renderers
+ RendererGenerator rendererGenerator = new RendererGenerator(
+ this, mavenLogger);
+ rendererGenerator.setSrcDir(templatesDirectory);
+ rendererGenerator.createFiles(config);
+ // GenerateMojo component test
+/*
+ ComponentTestGenerator componentTestGenerator = new ComponentTestGenerator(this, mavenLogger);
+ componentTestGenerator.setDestDir(outputTestsDirectory);
+ componentTestGenerator.createFiles(config);
+*/
+ // GenerateMojo tags
+ ComponentTagGenerator componentTagGenerator = new ComponentTagGenerator(this, mavenLogger);
+ componentTagGenerator.createFiles(config);
+
+// GenerateMojo tags for validators
+ ValidatorTagGenerator validatorTagGenerator = new ValidatorTagGenerator(this, mavenLogger);
+ validatorTagGenerator.createFiles(config);
+
+// GenerateMojo tags for converters
+ ConverterTagGenerator converterTagGenerator = new ConverterTagGenerator(this, mavenLogger);
+ converterTagGenerator.createFiles(config);
+
+
+ ListenerTagGenerator listenerTagGenerator = new ListenerTagGenerator(this, mavenLogger);
+ listenerTagGenerator.createFiles(config);
+
+
+ // GenerateMojo tag test
+/*
+ TagTestGenerator tagTestGenerator = new TagTestGenerator(this, mavenLogger);
+ tagTestGenerator.setDestDir(outputTestsDirectory);
+ tagTestGenerator.createFiles(config);
+*/
+ // GenerateMojo tag handlers
+ TagHandlerGenerator tagHandlerGenerator = new TagHandlerGenerator(
+ this, mavenLogger);
+ tagHandlerGenerator.createFiles(config);
+ //Generate listeners
+ ListenerGenerator listenerGenerator = new ListenerGenerator(this, mavenLogger);
+ listenerGenerator.createFiles(config);
+
+ JSFGeneratorConfiguration resourcesConfiguration = new JSFGeneratorConfiguration() {
+
+ public ClassLoader getClassLoader() {
+ return createProjectClassLoader(executedProject);
+ }
+
+ public File getDestDir() {
+ return outputResourcesDirectory;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public Template getTemplate(String name) throws GeneratorException {
+ return GenerateMojo.this.getTemplate(name);
+ }
+
+ public String getTemplatesPath() {
+ return GenerateMojo.this.getTemplatesPath();
+ }
+
+ };
+ // GenerateMojo faces-config
+ FacesConfigGenerator configGenerator = new FacesConfigGenerator(
+ resourcesConfiguration, mavenLogger);
+ configGenerator.setInclude(facesConfigInclude);
+ configGenerator.setFacesconfig(new File(
+ outputResourcesDirectory, "META-INF/faces-config.xml"));
+ RenderKitBean renderKitBean = configGenerator.createRenderKit();
+ renderKitBean.setRenderkitid("HTML_BASIC");
+ configGenerator.createFiles(config);
+ // GenerateMojo JSP taglib
+ if (null != taglib) {
+ TaglibGenerator taglibGenerator = new TaglibGenerator(
+ resourcesConfiguration, mavenLogger);
+ taglibGenerator.setUri(taglib.getUri());
+ taglibGenerator.setShortname(taglib.getShortName());
+ taglibGenerator.setListenerclass(taglib.getListenerClass());
+ taglibGenerator.setDisplayname(taglib.getDisplayName());
+ taglibGenerator.setListenerclass(taglib.getListenerClass());
+ taglibGenerator.setValidatorclass(taglib.getValidatorClass());
+ taglibGenerator.setTlibversion(taglib.getTlibVersion());
+ taglibGenerator.setJspversion(taglib.getJspVersion());
+ taglibGenerator.setInclude(taglibInclude);
+ taglibGenerator.setTaglib(new File(
+ outputResourcesDirectory, "META-INF/"+taglib.getShortName()
+ + ".tld"));
+ taglibGenerator.createFiles(config);
+ // GenerateMojo Facelets taglib
+ FaceletsTaglibGenerator faceletsTaglibGenerator = new FaceletsTaglibGenerator(
+ resourcesConfiguration, mavenLogger);
+ faceletsTaglibGenerator.setUri(taglib.getUri());
+ faceletsTaglibGenerator.setShortname(taglib.getShortName());
+ faceletsTaglibGenerator.setInclude(taglibInclude);
+ faceletsTaglibGenerator.setTaglib(new File(
+ outputResourcesDirectory, "META-INF/"+taglib.getShortName()
+ + ".taglib.xml"));
+ faceletsTaglibGenerator.createFiles(config);
+ }
+
+ ResourcesConfigParser resourcesConfigParser = new ResourcesConfigParser(resourcesConfiguration, mavenLogger);
+ resourcesConfigParser.setTemplates(templatesDirectory);
+ resourcesConfigParser.parse(config);
+
+ if (taglib != null) {
+ ResourcesDependenciesGenerator resourcesDependenciesGenerator = new ResourcesDependenciesGenerator(resourcesConfiguration, mavenLogger);
+ resourcesDependenciesGenerator.setUri(taglib.getUri());
+ resourcesDependenciesGenerator.setDependencyFile(new File(outputResourcesDirectory,
+ "META-INF/" + taglib.getShortName() + ".component-dependencies.xml"));
+ resourcesDependenciesGenerator.setComponentDependencies(resourcesConfigParser.getComponentResourcesMap());
+ resourcesDependenciesGenerator.createFiles(config);
+ }
+
+ // Generate resources configuration file resources-config.xml
+ // for all images/scripts/css...
+ ResourcesConfigGenerator resourcesConfigGenerator = new ResourcesConfigGenerator(resourcesConfiguration, mavenLogger);
+ resourcesConfigGenerator.setResourcesConfigGeneratorBean(resourcesConfigParser.getResourcesConfigGeneratorBean());
+ resourcesConfigGenerator.setInclude(resourcesInclude);
+ resourcesConfigGenerator.setTemplates(templatesDirectory);
+ resourcesConfigGenerator.setResourcesConfig(new File(
+ outputResourcesDirectory, "META-INF/resources-config.xml"));
+ resourcesConfigGenerator.createFiles(config);
+
+ // Add generated sources and resources to project
+ project.addCompileSourceRoot(outputJavaDirectory.getPath());
+// project.addCompileSourceRoot(outputTestsDirectory.getPath());
+
+ Resource resource = new Resource();
+ resource.setDirectory(outputResourcesDirectory.getPath());
+// resource.setTargetPath("META-INF");
+ project.addResource(resource);
+ } catch (Exception e) {
+ getLog().error("Error on generate component", e);
+ throw new MojoExecutionException(
+ "Error in component generation", e);
+ }
+ Thread.currentThread().setContextClassLoader(contextCL);
+ }
+
+ }
+
+ protected BuilderConfig createConfig(ClassLoader generatiorLoader)
+ throws ParsingException {
+ BuilderConfig builderConfig = new BuilderConfig(generatiorLoader,
+ new MavenLogger(getLog()));
+ // Get all *.xml config files
+ FilenameFilter filter = new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+
+ return name.toLowerCase().endsWith(".xml");
+ }
+
+ };
+ boolean filesParsed = false;
+ File [] directories = {
+ componentConfigDirectory,
+ validatorConfigDirectory,
+ converterConfigDirectory
+ };
+
+ for (File directory : directories) {
+ if (directory.exists()) {
+ File[] files = directory.listFiles(filter);
+ for (File file : files) {
+ filesParsed = true;
+ builderConfig.parseConfig(file);
+ }
+ }
+ }
+ if (!filesParsed) {
+ getLog().warn("No component configuration files found -- probably a skin project");
+ }
+ /*
+ if (!filesParsed) {
+ throw new ParsingException("No config files found");
+ }
+ */
+ builderConfig.checkComponentProperties();
+ return builderConfig;
+ }
+
+ public File getDestDir() {
+ // TODO Auto-generated method stub
+ return outputJavaDirectory;
+ }
+
+ public String getKey() {
+ // TODO Auto-generated method stub
+ return key;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.builder.generator.JSFGeneratorConfiguration#getClassLoader()
+ */
+ public ClassLoader getClassLoader() {
+ return createProjectClassLoader(executedProject);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.builder.generator.JSFGeneratorConfiguration#getTemplate(java.lang.String)
+ */
+ public Template getTemplate(String name) throws GeneratorException {
+ // TODO Auto-generated method stub
+ try {
+ return this.velocity.getEngine().getTemplate(name);
+ } catch (ResourceNotFoundException e) {
+ throw new GeneratorException(e.getLocalizedMessage());
+ } catch (ParseErrorException e) {
+ throw new GeneratorException(e.getLocalizedMessage());
+ } catch (Exception e) {
+ throw new GeneratorException(e.getLocalizedMessage());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.builder.generator.JSFGeneratorConfiguration#getTemplatesPath()
+ */
+ public String getTemplatesPath() {
+ return Library.JSF12.equals(library.getJsfVersion())?BuilderContext.TEMPLATES12_PATH:BuilderContext.TEMPLATES_PATH;
+ }
+
+}
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateTestMojo.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,152 +0,0 @@
-package org.ajax4jsf.builder.mojo;
-
-import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.generator.ComponentTestGenerator;
-import org.ajax4jsf.builder.generator.TagTestGenerator;
-import org.ajax4jsf.builder.maven.MavenLogger;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.apache.velocity.Template;
-
-/**
- *
- * @author dbiatenia
- * @goal generate-tests
- * @requiresDependencyResolution test
- * @phase generate-test-sources
- * @execute phase="test-compile"
- */
-public class GenerateTestMojo extends GenerateMojo{
-
- public void execute() throws MojoExecutionException, MojoFailureException {
- getLog().debug("GenerateTestMojo tests");
- if (null != executedProject) {
- Taglib taglib = checkLibraryConfig();
- // compile goal executed
- try {
- // Parse config files.
- ClassLoader generatiorLoader = createProjectClassLoader(executedProject);
- BuilderConfig config = createConfig(generatiorLoader);
- MavenLogger mavenLogger = new MavenLogger(getLog());
- // TODO - parse sources by qdox for JavaDoc comments ?
- // GenerateMojo components.
-/*
- ComponentGenerator compGenerator = new ComponentGenerator(this,
- mavenLogger);
- compGenerator.createFiles(config);
-*/
- // GenerateMojo renderers
-/*
- RendererGenerator rendererGenerator = new RendererGenerator(
- this, mavenLogger);
- rendererGenerator.setSrcDir(templatesDirectory);
- rendererGenerator.createFiles(config);
-*/
- // GenerateMojo component test
- ComponentTestGenerator componentTestGenerator = new ComponentTestGenerator(this, mavenLogger);
- componentTestGenerator.setDestDir(outputTestsDirectory);
- componentTestGenerator.createFiles(config);
-
- // GenerateMojo tags
-/*
- TagGenerator tagGenerator = new TagGenerator(this, mavenLogger);
- tagGenerator.createFiles(config);
-*/
- // GenerateMojo tag test
- TagTestGenerator tagTestGenerator = new TagTestGenerator(this, mavenLogger);
- tagTestGenerator.setDestDir(outputTestsDirectory);
- tagTestGenerator.createFiles(config);
-
- // GenerateMojo tag handlers
-/*
- TagHandlerGenerator tagHandlerGenerator = new TagHandlerGenerator(
- this, mavenLogger);
- tagHandlerGenerator.createFiles(config);
- //Generate listeners
- ListenerGenerator listenerGenerator = new ListenerGenerator(this, mavenLogger);
- listenerGenerator.createFiles(config);
-*/
-/*
- JSFGeneratorConfiguration resourcesConfiguration = new JSFGeneratorConfiguration() {
-
- public ClassLoader getClassLoader() {
- return createProjectClassLoader(executedProject);
- }
-
- public File getDestDir() {
- return outputResourcesDirectory;
- }
-
- public String getKey() {
- return key;
- }
-
- public Template getTemplate(String name) throws GeneratorException {
- return GenerateTestMojo.this.getTemplate(name);
- }
-
- public String getTemplatesPath() {
- return GenerateTestMojo.this.getTemplatesPath();
- }
-
- };
- // GenerateMojo faces-config
- FacesConfigGenerator configGenerator = new FacesConfigGenerator(
- resourcesConfiguration, mavenLogger);
- configGenerator.setInclude(facesConfigInclude);
- configGenerator.setFacesconfig(new File(
- outputResourcesDirectory, "META-INF/faces-config.xml"));
- RenderKitBean renderKitBean = configGenerator.createRenderKit();
- renderKitBean.setRenderkitid("HTML_BASIC");
- configGenerator.createFiles(config);
- // GenerateMojo JSP taglib
- if (null != taglib) {
- TaglibGenerator taglibGenerator = new TaglibGenerator(
- resourcesConfiguration, mavenLogger);
- taglibGenerator.setUri(taglib.getUri());
- taglibGenerator.setShortname(taglib.getShortName());
- taglibGenerator.setListenerclass(taglib.getListenerClass());
- taglibGenerator.setDisplayname(taglib.getDisplayName());
- taglibGenerator.setListenerclass(taglib.getListenerClass());
- taglibGenerator.setValidatorclass(taglib.getValidatorClass());
- taglibGenerator.setTlibversion(taglib.getTlibVersion());
- taglibGenerator.setJspversion(taglib.getJspVersion());
- taglibGenerator.setInclude(taglibInclude);
- taglibGenerator.setTaglib(new File(
- outputResourcesDirectory, "META-INF/"+taglib.getShortName()
- + ".tld"));
- taglibGenerator.createFiles(config);
- // GenerateMojo Facelets taglib
- FaceletsTaglibGenerator faceletsTaglibGenerator = new FaceletsTaglibGenerator(
- resourcesConfiguration, mavenLogger);
- faceletsTaglibGenerator.setUri(taglib.getUri());
- faceletsTaglibGenerator.setShortname(taglib.getShortName());
- faceletsTaglibGenerator.setInclude(taglibInclude);
- faceletsTaglibGenerator.setTaglib(new File(
- outputResourcesDirectory, "META-INF/"+taglib.getShortName()
- + ".taglib.xml"));
- faceletsTaglibGenerator.createFiles(config);
- }
- // Generate resources configuration file resources-config.xml
- // for all images/scripts/css...
- // Add generated sources and resources to project
-*/
-// project.addCompileSourceRoot(outputJavaDirectory.getPath());
- project.addTestCompileSourceRoot(outputTestsDirectory.getPath());
-/*
- Resource resource = new Resource();
- resource.setDirectory(outputResourcesDirectory.getPath());
-// resource.setTargetPath("META-INF");
- project.addResource(resource);
-*/
- } catch (Exception e) {
- getLog().error("Error on generate component", e);
- throw new MojoExecutionException(
- "Error in component generation", e);
- }
- }
-
- }
-
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateTestMojo.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,171 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.richfaces.builder.config.BuilderConfig;
+import org.richfaces.builder.generator.ComponentTestGenerator;
+import org.richfaces.builder.generator.TagTestGenerator;
+import org.richfaces.builder.maven.MavenLogger;
+
+/**
+ *
+ * @author dbiatenia
+ * @goal generate-tests
+ * @requiresDependencyResolution test
+ * @phase generate-test-sources
+ * @execute phase="test-compile"
+ */
+public class GenerateTestMojo extends GenerateMojo{
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ getLog().debug("GenerateTestMojo tests");
+ if (null != executedProject) {
+ Taglib taglib = checkLibraryConfig();
+ // compile goal executed
+ try {
+ // Parse config files.
+ ClassLoader generatiorLoader = createProjectClassLoader(executedProject);
+ BuilderConfig config = createConfig(generatiorLoader);
+ MavenLogger mavenLogger = new MavenLogger(getLog());
+ // TODO - parse sources by qdox for JavaDoc comments ?
+ // GenerateMojo components.
+/*
+ ComponentGenerator compGenerator = new ComponentGenerator(this,
+ mavenLogger);
+ compGenerator.createFiles(config);
+*/
+ // GenerateMojo renderers
+/*
+ RendererGenerator rendererGenerator = new RendererGenerator(
+ this, mavenLogger);
+ rendererGenerator.setSrcDir(templatesDirectory);
+ rendererGenerator.createFiles(config);
+*/
+ // GenerateMojo component test
+ ComponentTestGenerator componentTestGenerator = new ComponentTestGenerator(this, mavenLogger);
+ componentTestGenerator.setDestDir(outputTestsDirectory);
+ componentTestGenerator.createFiles(config);
+
+ // GenerateMojo tags
+/*
+ TagGenerator tagGenerator = new TagGenerator(this, mavenLogger);
+ tagGenerator.createFiles(config);
+*/
+ // GenerateMojo tag test
+ TagTestGenerator tagTestGenerator = new TagTestGenerator(this, mavenLogger);
+ tagTestGenerator.setDestDir(outputTestsDirectory);
+ tagTestGenerator.createFiles(config);
+
+ // GenerateMojo tag handlers
+/*
+ TagHandlerGenerator tagHandlerGenerator = new TagHandlerGenerator(
+ this, mavenLogger);
+ tagHandlerGenerator.createFiles(config);
+ //Generate listeners
+ ListenerGenerator listenerGenerator = new ListenerGenerator(this, mavenLogger);
+ listenerGenerator.createFiles(config);
+*/
+/*
+ JSFGeneratorConfiguration resourcesConfiguration = new JSFGeneratorConfiguration() {
+
+ public ClassLoader getClassLoader() {
+ return createProjectClassLoader(executedProject);
+ }
+
+ public File getDestDir() {
+ return outputResourcesDirectory;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public Template getTemplate(String name) throws GeneratorException {
+ return GenerateTestMojo.this.getTemplate(name);
+ }
+
+ public String getTemplatesPath() {
+ return GenerateTestMojo.this.getTemplatesPath();
+ }
+
+ };
+ // GenerateMojo faces-config
+ FacesConfigGenerator configGenerator = new FacesConfigGenerator(
+ resourcesConfiguration, mavenLogger);
+ configGenerator.setInclude(facesConfigInclude);
+ configGenerator.setFacesconfig(new File(
+ outputResourcesDirectory, "META-INF/faces-config.xml"));
+ RenderKitBean renderKitBean = configGenerator.createRenderKit();
+ renderKitBean.setRenderkitid("HTML_BASIC");
+ configGenerator.createFiles(config);
+ // GenerateMojo JSP taglib
+ if (null != taglib) {
+ TaglibGenerator taglibGenerator = new TaglibGenerator(
+ resourcesConfiguration, mavenLogger);
+ taglibGenerator.setUri(taglib.getUri());
+ taglibGenerator.setShortname(taglib.getShortName());
+ taglibGenerator.setListenerclass(taglib.getListenerClass());
+ taglibGenerator.setDisplayname(taglib.getDisplayName());
+ taglibGenerator.setListenerclass(taglib.getListenerClass());
+ taglibGenerator.setValidatorclass(taglib.getValidatorClass());
+ taglibGenerator.setTlibversion(taglib.getTlibVersion());
+ taglibGenerator.setJspversion(taglib.getJspVersion());
+ taglibGenerator.setInclude(taglibInclude);
+ taglibGenerator.setTaglib(new File(
+ outputResourcesDirectory, "META-INF/"+taglib.getShortName()
+ + ".tld"));
+ taglibGenerator.createFiles(config);
+ // GenerateMojo Facelets taglib
+ FaceletsTaglibGenerator faceletsTaglibGenerator = new FaceletsTaglibGenerator(
+ resourcesConfiguration, mavenLogger);
+ faceletsTaglibGenerator.setUri(taglib.getUri());
+ faceletsTaglibGenerator.setShortname(taglib.getShortName());
+ faceletsTaglibGenerator.setInclude(taglibInclude);
+ faceletsTaglibGenerator.setTaglib(new File(
+ outputResourcesDirectory, "META-INF/"+taglib.getShortName()
+ + ".taglib.xml"));
+ faceletsTaglibGenerator.createFiles(config);
+ }
+ // Generate resources configuration file resources-config.xml
+ // for all images/scripts/css...
+ // Add generated sources and resources to project
+*/
+// project.addCompileSourceRoot(outputJavaDirectory.getPath());
+ project.addTestCompileSourceRoot(outputTestsDirectory.getPath());
+/*
+ Resource resource = new Resource();
+ resource.setDirectory(outputResourcesDirectory.getPath());
+// resource.setTargetPath("META-INF");
+ project.addResource(resource);
+*/
+ } catch (Exception e) {
+ getLog().error("Error on generate component", e);
+ throw new MojoExecutionException(
+ "Error in component generation", e);
+ }
+ }
+
+ }
+
+}
Modified: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Library.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Library.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Library.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.mojo;
+package org.richfaces.builder.mojo;
/**
* @author shura
Modified: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Renderkit.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Renderkit.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Renderkit.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.builder.mojo;
+package org.richfaces.builder.mojo;
/**
* @author shura
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/SkinInfo.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,87 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.mojo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.aja4jsf.builder.model.Resource;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SkinInfo implements Cloneable{
- private String shortName;
- private String packageName;
-
- private String baseSkin;
- private List<Resource> baseClassResources = new ArrayList<Resource>();
- private List<Resource> extClassResources = new ArrayList<Resource>();
- private Resource masterXcss;
- private Resource extendedXcss;
- private Resource propertyFile;
- private boolean useExt;
-
- public boolean isUseExt() {
- return useExt;
- }
- public void setUseExt(boolean useExt) {
- this.useExt = useExt;
- }
- public String getShortName() {
- return shortName;
- }
- public void setShortName(String shortName) {
- this.shortName = shortName;
- }
- public String getPackageName() {
- return packageName;
- }
- public void setPackageName(String packageName) {
- this.packageName = packageName;
- }
- public List<Resource> getBaseClassResources() {
- return baseClassResources;
- }
- public void setBaseClassResources(List<Resource> baseClassResources) {
- this.baseClassResources = baseClassResources;
- }
- public List<Resource> getExtClassResources() {
- return extClassResources;
- }
- public void setExtClassResources(List<Resource> extClassResources) {
- this.extClassResources = extClassResources;
- }
- public Resource getMasterXcss() {
- return masterXcss;
- }
- public void setMasterXcss(Resource masterXcss) {
- this.masterXcss = masterXcss;
- }
- public Resource getExtendedXcss() {
- return extendedXcss;
- }
- public void setExtendedXcss(Resource extendedXcss) {
- this.extendedXcss = extendedXcss;
- }
- public Resource getPropertyFile() {
- return propertyFile;
- }
- public void setPropertyFile(Resource propertyFile) {
- this.propertyFile = propertyFile;
- }
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
- public String getBaseSkin() {
- return baseSkin;
- }
- public void setBaseSkin(String baseSkin) {
- this.baseSkin = baseSkin;
- }
-
-
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/SkinInfo.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,105 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.aja4jsf.builder.model.Resource;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SkinInfo implements Cloneable{
+ private String shortName;
+ private String packageName;
+
+ private String baseSkin;
+ private List<Resource> baseClassResources = new ArrayList<Resource>();
+ private List<Resource> extClassResources = new ArrayList<Resource>();
+ private Resource masterXcss;
+ private Resource extendedXcss;
+ private Resource propertyFile;
+ private boolean useExt;
+
+ public boolean isUseExt() {
+ return useExt;
+ }
+ public void setUseExt(boolean useExt) {
+ this.useExt = useExt;
+ }
+ public String getShortName() {
+ return shortName;
+ }
+ public void setShortName(String shortName) {
+ this.shortName = shortName;
+ }
+ public String getPackageName() {
+ return packageName;
+ }
+ public void setPackageName(String packageName) {
+ this.packageName = packageName;
+ }
+ public List<Resource> getBaseClassResources() {
+ return baseClassResources;
+ }
+ public void setBaseClassResources(List<Resource> baseClassResources) {
+ this.baseClassResources = baseClassResources;
+ }
+ public List<Resource> getExtClassResources() {
+ return extClassResources;
+ }
+ public void setExtClassResources(List<Resource> extClassResources) {
+ this.extClassResources = extClassResources;
+ }
+ public Resource getMasterXcss() {
+ return masterXcss;
+ }
+ public void setMasterXcss(Resource masterXcss) {
+ this.masterXcss = masterXcss;
+ }
+ public Resource getExtendedXcss() {
+ return extendedXcss;
+ }
+ public void setExtendedXcss(Resource extendedXcss) {
+ this.extendedXcss = extendedXcss;
+ }
+ public Resource getPropertyFile() {
+ return propertyFile;
+ }
+ public void setPropertyFile(Resource propertyFile) {
+ this.propertyFile = propertyFile;
+ }
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+ public String getBaseSkin() {
+ return baseSkin;
+ }
+ public void setBaseSkin(String baseSkin) {
+ this.baseSkin = baseSkin;
+ }
+
+
+}
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Taglib.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Taglib.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Taglib.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,227 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.builder.mojo;
-
-import java.io.File;
-
-/**
- * @author shura
- *
- */
-public class Taglib {
-
- private String _taglib;
-
- private String _uri;
-
- private String _shortName;
-
- private String _listenerClass;
-
- private String _displayName;
-
- private String _tlibVersion = "1.2";
-
- private String _jspVersion ;
-
- private String _validatorClass = null;
-
- private String _includeModules = null;
-
- private String _excludeModules = null;
-
- private String _includeTags = null;
-
- private String _excludeTags = null;
- /**
- * @return the displayName
- */
- public String getDisplayName() {
- return this._displayName;
- }
-
- /**
- * @param displayName the displayName to set
- */
- public void setDisplayName(String displayName) {
- this._displayName = displayName;
- }
-
- /**
- * @return the listenerClass
- */
- public String getListenerClass() {
- return this._listenerClass;
- }
-
- /**
- * @param listenerClass the listenerClass to set
- */
- public void setListenerClass(String listenerClass) {
- this._listenerClass = listenerClass;
- }
-
- /**
- * @return the shortName
- */
- public String getShortName() {
- return this._shortName;
- }
-
- /**
- * @param shortName the shortName to set
- */
- public void setShortName(String shortName) {
- this._shortName = shortName;
- }
-
- /**
- * @return the taglib
- */
- public String getTaglib() {
- return this._taglib;
- }
-
- /**
- * @param taglib the taglib to set
- */
- public void setTaglib(String taglib) {
- this._taglib = taglib;
- }
-
- /**
- * @return the uri
- */
- public String getUri() {
- return this._uri;
- }
-
- /**
- * @param uri the uri to set
- */
- public void setUri(String uri) {
- this._uri = uri;
- }
-
- /**
- * @return the jspVersion
- */
- public String getJspVersion() {
- return this._jspVersion;
- }
-
- /**
- * @param jspVersion the jspVersion to set
- */
- public void setJspVersion(String jspVersion) {
- this._jspVersion = jspVersion;
- }
-
- /**
- * @return the tlibVersion
- */
- public String getTlibVersion() {
- return this._tlibVersion;
- }
-
- /**
- * @param tlibVersion the tlibVersion to set
- */
- public void setTlibVersion(String tlibVersion) {
- this._tlibVersion = tlibVersion;
- }
-
- /**
- * @return the validatorClass
- */
- public String getValidatorClass() {
- return this._validatorClass;
- }
-
- /**
- * @param validatorClass the validatorClass to set
- */
- public void setValidatorClass(String validatorClass) {
- this._validatorClass = validatorClass;
- }
-
- /**
- * @return the includeModules
- */
- public String getIncludeModules() {
- return _includeModules;
- }
-
- /**
- * @param includeModules the includeModules to set
- */
- public void setIncludeModules(String includeModules) {
- _includeModules = includeModules;
- }
-
- /**
- * @return the excludeModules
- */
- public String getExcludeModules() {
- return _excludeModules;
- }
-
- /**
- * @param excludeModules the excludeModules to set
- */
- public void setExcludeModules(String excludeModules) {
- _excludeModules = excludeModules;
- }
-
- /**
- * @return the includeTags
- */
- public String getIncludeTags() {
- return _includeTags;
- }
-
- /**
- * @param includeTags the includeTags to set
- */
- public void setIncludeTags(String includeTags) {
- _includeTags = includeTags;
- }
-
- /**
- * @return the excludeTags
- */
- public String getExcludeTags() {
- return _excludeTags;
- }
-
- /**
- * @param excludeTags the excludeTags to set
- */
- public void setExcludeTags(String excludeTags) {
- _excludeTags = excludeTags;
- }
-
- @Override
- public String toString() {
- return "Lib: "+getShortName()+", URL: "+getUri();
- }
-}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Taglib.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Taglib.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Taglib.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/Taglib.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,226 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.mojo;
+
+
+/**
+ * @author shura
+ *
+ */
+public class Taglib {
+
+ private String _taglib;
+
+ private String _uri;
+
+ private String _shortName;
+
+ private String _listenerClass;
+
+ private String _displayName;
+
+ private String _tlibVersion = null;
+
+ private String _jspVersion ;
+
+ private String _validatorClass = null;
+
+ private String _includeModules = null;
+
+ private String _excludeModules = null;
+
+ private String _includeTags = null;
+
+ private String _excludeTags = null;
+ /**
+ * @return the displayName
+ */
+ public String getDisplayName() {
+ return this._displayName;
+ }
+
+ /**
+ * @param displayName the displayName to set
+ */
+ public void setDisplayName(String displayName) {
+ this._displayName = displayName;
+ }
+
+ /**
+ * @return the listenerClass
+ */
+ public String getListenerClass() {
+ return this._listenerClass;
+ }
+
+ /**
+ * @param listenerClass the listenerClass to set
+ */
+ public void setListenerClass(String listenerClass) {
+ this._listenerClass = listenerClass;
+ }
+
+ /**
+ * @return the shortName
+ */
+ public String getShortName() {
+ return this._shortName;
+ }
+
+ /**
+ * @param shortName the shortName to set
+ */
+ public void setShortName(String shortName) {
+ this._shortName = shortName;
+ }
+
+ /**
+ * @return the taglib
+ */
+ public String getTaglib() {
+ return this._taglib;
+ }
+
+ /**
+ * @param taglib the taglib to set
+ */
+ public void setTaglib(String taglib) {
+ this._taglib = taglib;
+ }
+
+ /**
+ * @return the uri
+ */
+ public String getUri() {
+ return this._uri;
+ }
+
+ /**
+ * @param uri the uri to set
+ */
+ public void setUri(String uri) {
+ this._uri = uri;
+ }
+
+ /**
+ * @return the jspVersion
+ */
+ public String getJspVersion() {
+ return this._jspVersion;
+ }
+
+ /**
+ * @param jspVersion the jspVersion to set
+ */
+ public void setJspVersion(String jspVersion) {
+ this._jspVersion = jspVersion;
+ }
+
+ /**
+ * @return the tlibVersion
+ */
+ public String getTlibVersion() {
+ return this._tlibVersion;
+ }
+
+ /**
+ * @param tlibVersion the tlibVersion to set
+ */
+ public void setTlibVersion(String tlibVersion) {
+ this._tlibVersion = tlibVersion;
+ }
+
+ /**
+ * @return the validatorClass
+ */
+ public String getValidatorClass() {
+ return this._validatorClass;
+ }
+
+ /**
+ * @param validatorClass the validatorClass to set
+ */
+ public void setValidatorClass(String validatorClass) {
+ this._validatorClass = validatorClass;
+ }
+
+ /**
+ * @return the includeModules
+ */
+ public String getIncludeModules() {
+ return _includeModules;
+ }
+
+ /**
+ * @param includeModules the includeModules to set
+ */
+ public void setIncludeModules(String includeModules) {
+ _includeModules = includeModules;
+ }
+
+ /**
+ * @return the excludeModules
+ */
+ public String getExcludeModules() {
+ return _excludeModules;
+ }
+
+ /**
+ * @param excludeModules the excludeModules to set
+ */
+ public void setExcludeModules(String excludeModules) {
+ _excludeModules = excludeModules;
+ }
+
+ /**
+ * @return the includeTags
+ */
+ public String getIncludeTags() {
+ return _includeTags;
+ }
+
+ /**
+ * @param includeTags the includeTags to set
+ */
+ public void setIncludeTags(String includeTags) {
+ _includeTags = includeTags;
+ }
+
+ /**
+ * @return the excludeTags
+ */
+ public String getExcludeTags() {
+ return _excludeTags;
+ }
+
+ /**
+ * @param excludeTags the excludeTags to set
+ */
+ public void setExcludeTags(String excludeTags) {
+ _excludeTags = excludeTags;
+ }
+
+ @Override
+ public String toString() {
+ return "Lib: "+getShortName()+", URL: "+getUri();
+ }
+}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/velocity (from rev 14075, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/velocity)
Deleted: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/velocity/ResourceLoader.java
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/velocity/ResourceLoader.java 2009-05-07 17:35:57 UTC (rev 14075)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/velocity/ResourceLoader.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -1,58 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.builder.velocity;
-
-import java.io.InputStream;
-
-import org.apache.commons.collections.ExtendedProperties;
-import org.apache.velocity.exception.ResourceNotFoundException;
-import org.apache.velocity.runtime.resource.Resource;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class ResourceLoader extends
- org.apache.velocity.runtime.resource.loader.ResourceLoader {
-
- public void init( ExtendedProperties configuration)
- {
- rsvc.info("ClasspathResourceLoader : initialization starting.");
-
- rsvc.info("ClasspathResourceLoader : initialization complete.");
- }
-
- public synchronized InputStream getResourceStream( String name )
- throws ResourceNotFoundException
- {
- InputStream result = null;
-
- if (name == null || name.length() == 0)
- {
- throw new ResourceNotFoundException ("No template name provided");
- }
-
- try
- {
- ClassLoader classLoader = getClass().getClassLoader();
-
- result= classLoader.getResourceAsStream( name );
- }
- catch( Exception fnfe )
- {
- throw new ResourceNotFoundException( fnfe.getMessage() );
- }
-
- return result;
- }
-
- public boolean isSourceModified(Resource resource)
- {
- return false;
- }
-
- public long getLastModified(Resource resource)
- {
- return 0;
- }}
Copied: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/velocity/ResourceLoader.java (from rev 14245, branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/velocity/ResourceLoader.java)
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/velocity/ResourceLoader.java (rev 0)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/java/org/richfaces/builder/velocity/ResourceLoader.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -0,0 +1,76 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.builder.velocity;
+
+import java.io.InputStream;
+
+import org.apache.commons.collections.ExtendedProperties;
+import org.apache.velocity.exception.ResourceNotFoundException;
+import org.apache.velocity.runtime.resource.Resource;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ResourceLoader extends
+ org.apache.velocity.runtime.resource.loader.ResourceLoader {
+
+ public void init( ExtendedProperties configuration)
+ {
+ rsvc.info("ClasspathResourceLoader : initialization starting.");
+
+ rsvc.info("ClasspathResourceLoader : initialization complete.");
+ }
+
+ public synchronized InputStream getResourceStream( String name )
+ throws ResourceNotFoundException
+ {
+ InputStream result = null;
+
+ if (name == null || name.length() == 0)
+ {
+ throw new ResourceNotFoundException ("No template name provided");
+ }
+
+ try
+ {
+ ClassLoader classLoader = getClass().getClassLoader();
+
+ result= classLoader.getResourceAsStream( name );
+ }
+ catch( Exception fnfe )
+ {
+ throw new ResourceNotFoundException( fnfe.getMessage() );
+ }
+
+ return result;
+ }
+
+ public boolean isSourceModified(Resource resource)
+ {
+ return false;
+ }
+
+ public long getLastModified(Resource resource)
+ {
+ return 0;
+ }}
Modified: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/resources/META-INF/plexus/components.xml
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/resources/META-INF/plexus/components.xml 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/resources/META-INF/plexus/components.xml 2009-06-09 22:53:29 UTC (rev 14575)
@@ -15,7 +15,7 @@
</property>
<property>
<name>cdk.resource.loader.class</name>
- <value>org.ajax4jsf.builder.velocity.ResourceLoader</value>
+ <value>org.richfaces.builder.velocity.ResourceLoader</value>
</property>
<property>
<name>velocimacro.messages.on</name>
Modified: branches/jsf2.0/cdk/maven-cdk-plugin/src/main/resources/component/config.xml
===================================================================
--- branches/jsf2.0/cdk/maven-cdk-plugin/src/main/resources/component/config.xml 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/maven-cdk-plugin/src/main/resources/component/config.xml 2009-06-09 22:53:29 UTC (rev 14575)
@@ -19,12 +19,12 @@
<name>${name}</name>
<classname>${package}.taglib.${className}Tag</classname>
<superclass>
- org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ org.richfaces.webapp.taglib.HtmlComponentTagBase
</superclass>
</tag>
<!--
<taghandler>
- <classname>org.ajax4jsf.tag.TestHandler</classname>
+ <classname>org.richfaces.tag.TestHandler</classname>
</taghandler>
-->
&ui_component_attributes;
Modified: branches/jsf2.0/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java
===================================================================
--- branches/jsf2.0/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java 2009-06-09 17:01:35 UTC (rev 14574)
+++ branches/jsf2.0/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/generator/StyleAssembler.java 2009-06-09 22:53:29 UTC (rev 14575)
@@ -26,8 +26,6 @@
import java.io.InputStream;
import java.net.URL;
-import org.ajax4jsf.builder.config.ParsingException;
-import org.ajax4jsf.builder.xml.XMLBody;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugin.logging.SystemStreamLog;
import org.apache.velocity.Template;
@@ -35,6 +33,8 @@
import org.apache.velocity.app.VelocityEngine;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.velocity.VelocityComponent;
+import org.richfaces.builder.config.ParsingException;
+import org.richfaces.builder.xml.XMLBody;
/**
17 years, 1 month
JBoss Rich Faces SVN: r14574 - in branches/community/3.3.X/ui/inputnumber-spinner/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-06-09 13:01:35 -0400 (Tue, 09 Jun 2009)
New Revision: 14574
Modified:
branches/community/3.3.X/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js
branches/community/3.3.X/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
Log:
RF-7338
Modified: branches/community/3.3.X/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js
===================================================================
--- branches/community/3.3.X/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js 2009-06-09 16:31:39 UTC (rev 14573)
+++ branches/community/3.3.X/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js 2009-06-09 17:01:35 UTC (rev 14574)
@@ -4,36 +4,45 @@
Richfaces.Spinner = Class.create();
Richfaces.Spinner.prototype = {
- initialize: function( containers, options, data ,events, images) {
- this.content = $ (containers.edit);
- this.controls = $ (containers.buttons);
- this.fie = $ (containers.forIE);
- this.ch = options.chameleon;
+ //default values of options
+ cycled: true,
+ enableManualInput: true,
+ disabled: false,
+ required: false,
+ clientErrorMessage: null,
+ min:0,
+ max:100,
+ delta:1,
+ onup: null,
+ ondown: null,
+ onerr: null,
+
+ initialize: function(id, options) {
+ this.content = $(id +"Edit");
+ var buttonsId = id +"Buttons";
+ this.controls = $(buttonsId);
+ this.fie = $(id +"For");
this.items = new Array();
- this.table = $ (containers.buttons.substr(containers.buttons.indexOf("buttons")+7));
+ this.table = $(buttonsId.substr(buttonsId.indexOf("buttons")+7));
if (RichFaces.navigatorType() == RichFaces.FF ||
RichFaces.navigatorType() == RichFaces.NETSCAPE) {
if (!this.fie)
this.table.style.display = "-moz-inline-box";
}
- this.options = options;
- if (!options.disabled){
+ Object.extend(this, options);
+ if (!this.disabled){
this.buttonUp = null;
this.buttonDown = null;
}
- this.cycled = options.cycled;
- this.edited = options.edited;
+ this.cycled = this.cycled;
+ this.enableManualInput = this.enableManualInput;
var edit = this._getDirectChildrenByTag(this.content,'INPUT')[0];
- this.upClick = new Function(events.onup + ";return true;").bindAsEventListener(edit);
- this.downClick = new Function(events.ondown + ";return true;").bindAsEventListener(edit);
- this.error = new Function("event","clientErrorMessage",events.onerr + ";return true;").bind(edit);
+ this.upClick = new Function(this.onup + ";return true;").bindAsEventListener(edit);
+ this.downClick = new Function(this.ondown + ";return true;").bindAsEventListener(edit);
+ this.error = new Function("event","clientErrorMessage",this.onerr + ";return true;").bind(edit);
- this.data = data;
- this.max = null;
- this.min = null;
- this.delta = null;
- this.required = options.required;
+ this.required = this.required;
this._attachBehaviors();
this._load();
@@ -57,7 +66,7 @@
this.controls.edit.value = this.max;
}
} else {
- this.error(e,this.options.clientErrorMsg);
+ this.error(e,this.clientErrorMessage);
this.controls.fireEditEvent("error");
this.controls.edit.value = this.max;
return true;
@@ -80,7 +89,7 @@
this.controls.edit.value = this.max;
}
} else {
- this.error(e,this.options.clientErrorMsg);
+ this.error(e,this.clientErrorMessage);
this.controls.fireEditEvent("error");
this.controls.edit.value = this.min;
return true;
@@ -109,8 +118,8 @@
},
_load: function(){
- this.controls.edit.readOnly = this.edited ? "" : "readOnly";
- if (this.options.disabled) {
+ this.controls.edit.readOnly = this.enableManualInput ? "" : "readOnly";
+ if (this.disabled) {
this.controls.edit.readOnly = "readOnly";
Element.setStyle(this.controls.edit, {color: "gray"});
} else {
@@ -118,26 +127,16 @@
}
},
- _attachBehaviors: function(){
- this.max = this.data.max;
- this.min = this.data.min;
- this.delta = this.data.delta;
-
+ _attachBehaviors: function(){
var tbody = this._getDirectChildrenByTag(this.controls,'TBODY')[0];
var controls = this._getDirectChildrenByTag(tbody,'TR');
var buttonUp = this._getDirectChildrenByTag(controls[0],'TD')[0];
var buttonDown = this._getDirectChildrenByTag(controls[1],'TD')[0];
var edit = this._getDirectChildrenByTag(this.content,'INPUT')[0];
- if (this.ch=="false"){
- this.buttonUp = this._getDirectChildrenByTag(buttonUp,'INPUT')[0];
- this.buttonDown = this._getDirectChildrenByTag(buttonDown,'INPUT')[0];
- var upImg = null;
- var downImg = null;
- } else {
- var upImg = this._getDirectChildrenByTag(buttonUp,'INPUT')[0];
- var downImg = this._getDirectChildrenByTag(buttonDown,'INPUT')[0];
-
- }
+ this.buttonUp = this._getDirectChildrenByTag(buttonUp,'INPUT')[0];
+ this.buttonDown = this._getDirectChildrenByTag(buttonDown,'INPUT')[0];
+ var upImg = null;
+ var downImg = null;
this.controls = new Richfaces.Spinner.Controls( this, {button:buttonUp,img:upImg}, {button:buttonDown,img:downImg}, edit );
},
@@ -181,7 +180,7 @@
this.edit.value = this.prevEditValue;
this.previousMU = window.document.onmouseup;
this.previousMM = window.document.onmousemove;
- if (!spinner.options.disabled){
+ if (!spinner.disabled){
this._attachBehaviors();
this.edit.style.color = this.originalColor;
} else {
Modified: branches/community/3.3.X/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
===================================================================
--- branches/community/3.3.X/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2009-06-09 16:31:39 UTC (rev 14573)
+++ branches/community/3.3.X/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2009-06-09 17:01:35 UTC (rev 14574)
@@ -119,39 +119,22 @@
</tr>
</tbody>
</table>
+ <c:scriptObject var="options">
+ <c:scriptOption attributes="cycled, enableManualInput" defaultValue="true"/>
+ <c:scriptOption attributes="disabled, required, clientErrorMessage" />
+ <c:scriptOption name="min" value="#{component.attributes['minValue']}" defaultValue="0" />
+ <c:scriptOption name="max" value="#{component.attributes['maxValue']}" defaultValue="100" />
+ <c:scriptOption name="delta" value="#{component.attributes['step']}" defaultValue="1" />
+ <c:scriptOption name="onup" value="#{component.attributes['onupclick']}" />
+ <c:scriptOption name="ondown" value="#{component.attributes['ondownclick']}" />
+ <c:scriptOption name="onerr" value="#{component.attributes['onerror']}" />
+ </c:scriptObject>
<script type="text/javascript">
new Richfaces.Spinner(
- {
- edit:"#{clientId}Edit",
- buttons:"#{clientId}Buttons",
- forIE:"#{clientId}For"
- },
- {
- cycled:#{component.attributes['cycled']},
- edited:#{component.attributes['enableManualInput']},
- disabled:#{component.attributes['disabled']},
- chameleon:false,
- required: #{component.attributes['required']},
- clientErrorMsg: "#{component.attributes['clientErrorMessage']}"
- },
- {
- min:#{component.attributes['minValue']},
- max:#{component.attributes['maxValue']},
- delta:#{component.attributes['step']}
- },
- {
- onup:"#{component.attributes['onupclick']}",
- ondown:"#{component.attributes['ondownclick']}",
- onerr:"#{component.attributes['onerror']}"
- },
- {
- up:"#{upButton}",
- down:"#{downButton}",
- upP:"#{upButtonPressed}",
- downP:"#{downButtonPressed}",
- upH:"#{upButtonHovered}",
- downH:"#{downButtonHovered}"
- }
+ "#{clientId}"
+ <c:if test="#{not empty options}">
+ , <f:writeAsScript value="#{options}" />
+ </c:if>
);
</script>
</td>
17 years, 1 month