JBoss Rich Faces SVN: r17156 - in root/ui-sandbox: componentcontrol/trunk/parent and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-05-20 07:34:03 -0400 (Thu, 20 May 2010)
New Revision: 17156
Modified:
root/ui-sandbox/componentcontrol/trunk/parent/pom.xml
root/ui-sandbox/componentcontrol/trunk/pom.xml
root/ui-sandbox/datascroller/trunk/parent/pom.xml
root/ui-sandbox/datascroller/trunk/pom.xml
root/ui-sandbox/tables/trunk/parent/pom.xml
root/ui-sandbox/tables/trunk/pom.xml
Log:
add checkstyle to sandbox
Modified: root/ui-sandbox/componentcontrol/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/parent/pom.xml 2010-05-20 11:25:16 UTC (rev 17155)
+++ root/ui-sandbox/componentcontrol/trunk/parent/pom.xml 2010-05-20 11:34:03 UTC (rev 17156)
@@ -36,6 +36,10 @@
<name>Richfaces UI Components: Component Control Parent Module</name>
<packaging>pom</packaging>
+ <properties>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
@@ -142,6 +146,18 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-build-checkstyle
+ </artifactId>
+ <version>${richfaces.checkstyle.version}
+ </version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
</project>
Modified: root/ui-sandbox/componentcontrol/trunk/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/pom.xml 2010-05-20 11:25:16 UTC (rev 17155)
+++ root/ui-sandbox/componentcontrol/trunk/pom.xml 2010-05-20 11:34:03 UTC (rev 17156)
@@ -42,18 +42,4 @@
<!--module>api</module-->
<module>ui</module>
</modules>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- </plugin>
-
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
</project>
\ No newline at end of file
Modified: root/ui-sandbox/datascroller/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/parent/pom.xml 2010-05-20 11:25:16 UTC (rev 17155)
+++ root/ui-sandbox/datascroller/trunk/parent/pom.xml 2010-05-20 11:34:03 UTC (rev 17156)
@@ -36,6 +36,10 @@
<name>Richfaces UI Components: Datascroller Parent Module</name>
<packaging>pom</packaging>
+ <properties>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
@@ -113,6 +117,18 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-build-checkstyle
+ </artifactId>
+ <version>${richfaces.checkstyle.version}
+ </version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
</project>
Modified: root/ui-sandbox/datascroller/trunk/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/pom.xml 2010-05-20 11:25:16 UTC (rev 17155)
+++ root/ui-sandbox/datascroller/trunk/pom.xml 2010-05-20 11:34:03 UTC (rev 17156)
@@ -42,18 +42,4 @@
<module>api</module>
<module>ui</module>
</modules>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- </plugin>
-
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
</project>
\ No newline at end of file
Modified: root/ui-sandbox/tables/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/tables/trunk/parent/pom.xml 2010-05-20 11:25:16 UTC (rev 17155)
+++ root/ui-sandbox/tables/trunk/parent/pom.xml 2010-05-20 11:34:03 UTC (rev 17156)
@@ -36,6 +36,10 @@
<name>Richfaces UI Components: Tables Parent</name>
<packaging>pom</packaging>
+ <properties>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
@@ -142,6 +146,58 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-build-checkstyle</artifactId>
+ <version>${richfaces.checkstyle.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>release</id>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <javadocVersion>1.5</javadocVersion>
+ <aggregate>true</aggregate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-javadoc</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>aggregate-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>aggregate</goal>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
Modified: root/ui-sandbox/tables/trunk/pom.xml
===================================================================
--- root/ui-sandbox/tables/trunk/pom.xml 2010-05-20 11:25:16 UTC (rev 17155)
+++ root/ui-sandbox/tables/trunk/pom.xml 2010-05-20 11:34:03 UTC (rev 17156)
@@ -41,18 +41,4 @@
<module>impl</module>
<module>ui</module>
</modules>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- </plugin>
-
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
</project>
\ No newline at end of file
14 years, 1 month
JBoss Rich Faces SVN: r17155 - root/core/trunk/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-05-20 07:25:16 -0400 (Thu, 20 May 2010)
New Revision: 17155
Modified:
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
ajahttps://jira.jboss.org/browse/RF-8258
clear on onunload added
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-05-20 10:51:00 UTC (rev 17154)
+++ root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-05-20 11:25:16 UTC (rev 17155)
@@ -52,8 +52,8 @@
}
//dom cleaner
- richfaces.cleanDom = function(id) {
- var e = document.getElementById(id);
+ richfaces.cleanDom = function(source) {
+ var e = (typeof source == "string") ? document.getElementById(source) : jQuery('body').get(0);
if (e) {
var elements = e.getElementsByTagName("*");
if (elements.length) {
@@ -733,11 +733,11 @@
};
}()));
- richfaces.ajax.onComplete = function (data) {
+ var ajaxOnComplete = function (data) {
var type = data.type;
var responseXML = data.responseXML;
- if (data.type == 'event' && data.status == "complete" && responseXML) {
+ if (data.type == 'event' && data.status == 'complete' && responseXML) {
var partialResponse = jQuery(responseXML).children("partial-response");
if (partialResponse && partialResponse.length) {
var elements = partialResponse.children('changes').children('update, delete');
@@ -749,7 +749,12 @@
};
// move this code to somewhere
if (typeof jsf != 'undefined') {
- jsf.ajax.addOnEvent(richfaces.ajax.onComplete);
+ jsf.ajax.addOnEvent(ajaxOnComplete);
}
+ if (window.addEventListener) {
+ window.addEventListener("unload", richfaces.cleanDom, false);
+ } else {
+ window.attachEvent("onunload", richfaces.cleanDom);
+ }
}(jQuery, RichFaces));
14 years, 1 month
JBoss Rich Faces SVN: r17154 - root/core/trunk/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-05-20 06:51:00 -0400 (Thu, 20 May 2010)
New Revision: 17154
Modified:
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
ajahttps://jira.jboss.org/browse/RF-8258
bug fix
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-05-20 09:13:40 UTC (rev 17153)
+++ root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-05-20 10:51:00 UTC (rev 17154)
@@ -54,14 +54,17 @@
//dom cleaner
richfaces.cleanDom = function(id) {
var e = document.getElementById(id);
- var elements = e.getElementsByTagName("*");
- jQuery.cleanData(elements);
- jQuery.cleanData([e]);
- jQuery.each(elements, function(index) {
- richfaces.invokeMethod(this, "destroy");
- });
- richfaces.invokeMethod(e, "destroy");
-
+ if (e) {
+ var elements = e.getElementsByTagName("*");
+ if (elements.length) {
+ jQuery.cleanData(elements);
+ jQuery.cleanData([e]);
+ jQuery.each(elements, function(index) {
+ richfaces.invokeMethod(this, "destroy");
+ });
+ richfaces.invokeMethod(e, "destroy");
+ }
+ }
}
//form.js
@@ -734,12 +737,12 @@
var type = data.type;
var responseXML = data.responseXML;
- if (type == 'complete' && responseXML) {
+ if (data.type == 'event' && data.status == "complete" && responseXML) {
var partialResponse = jQuery(responseXML).children("partial-response");
if (partialResponse && partialResponse.length) {
var elements = partialResponse.children('changes').children('update, delete');
jQuery.each(elements, function () {
- richfaces.cleanDom(this.id);
+ richfaces.cleanDom(jQuery(this).attr('id'));
});
}
}
14 years, 1 month
JBoss Rich Faces SVN: r17153 - in root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces: commandButton and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-05-20 05:13:40 -0400 (Thu, 20 May 2010)
New Revision: 17153
Removed:
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/ajax.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandButton.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/jsFunction.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/log.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/mediaOutput.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/push.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status.xhtml
Modified:
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandButton/commandButton.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink/commandLink.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/jsFunction/jsFunction.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/log/log.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel/compositemessages.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel/simple.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/push/push.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/referencedusage.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/simple.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/viewusage.xhtml
Log:
https://jira.jboss.org/browse/RF-8663
Deleted: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/ajax.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/ajax.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/ajax.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j">
-
-<ui:composition template="/templates/component-sample.xhtml">
-
- <fieldset><legend>#{demoNavigator.currentSample.name}</legend> <ui:include
- src="#{demoNavigator.sampleURI}" /></fieldset>
-</ui:composition>
-
-</html>
\ No newline at end of file
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandButton/commandButton.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandButton/commandButton.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandButton/commandButton.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -13,6 +13,10 @@
}
-->
</style>
+ <p>
+ The combination similar to h:commandButton with f:ajax. Inherits all
+ a4j:ajax special options.
+ </p>
<h:form>
<h:panelGrid columns="3">
<h:outputText value="Name:" />
Deleted: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandButton.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandButton.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandButton.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -1,20 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
-<ui:composition template="/templates/main.xhtml">
- <ui:define name="body">
- <p>
- The combination similar to h:commandButton with f:ajax. Inherits all
- a4j:ajax special options.
- </p>
- <fieldset>
- <legend>commandButton Sample</legend>
- <ui:include src="/richfaces/button/usage.xhtml" />
- </fieldset>
- </ui:define>
-</ui:composition>
-
-</html>
\ No newline at end of file
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink/commandLink.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink/commandLink.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink/commandLink.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -12,7 +12,11 @@
font-weight: bold;
}
-->
- </style>
+ </style>
+ <p>
+ The combination similar to h:commandLink with f:ajax. Inherits all
+ a4j:ajax special options.
+ </p>
<h:form>
<h:panelGrid columns="3">
<h:outputText value="Name:" />
Deleted: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -1,20 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
-<ui:composition template="/templates/main.xhtml">
- <ui:define name="body">
- <p>
- The combination similar to h:commandLink with f:ajax. Inherits all
- a4j:ajax special options.
- </p>
- <fieldset>
- <legend>commandLink Sample</legend>
- <ui:include src="/richfaces/link/usage.xhtml" />
- </fieldset>
- </ui:define>
-</ui:composition>
-
-</html>
\ No newline at end of file
Deleted: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -1,17 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:rich="http://java.sun.com/jsf/composite/rich">
-
-<ui:composition template="/templates/main.xhtml">
- <ui:define name="body">
- <rich:toolBar items="#{viewController.tableToolBarItems}" />
- <p></p>
- <fieldset><legend>Table Edit Sample</legend> <ui:include
- src="/richfaces/dataTable/simpleTable.xhtml" /></fieldset>
- </ui:define>
-</ui:composition>
-
-</html>
\ No newline at end of file
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/jsFunction/jsFunction.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/jsFunction/jsFunction.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/jsFunction/jsFunction.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -6,6 +6,14 @@
xmlns:a4j="http://richfaces.org/a4j">
<ui:composition>
+
+ <p><b>a4j:jsFunction</b> component also designed to send Ajax requests, but allows to perform
+ an the requests from a Javascript code directly. The component sends a request using
+ a standard JSF approach, so the JSF form is required. The following example
+ shows how the part of a page is re-rendered when a user hovers over the names.
+ </p>
+
+
<table width="400">
<tbody>
<tr>
Deleted: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/jsFunction.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/jsFunction.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/jsFunction.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -1,24 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
-<ui:composition template="/templates/main.xhtml">
- <ui:define name="body">
-
- <p><b>a4j:jsFunction</b> component also designed to send Ajax requests, but allows to perform
- an the requests from a Javascript code directly. The component sends a request using
- a standard JSF approach, so the JSF form is required. The following example
- shows how the part of a page is re-rendered when a user hovers over the names.
- </p>
-
-
- <fieldset>
- <legend>JS Function Sample</legend>
- <ui:include src="/richfaces/jsFunction/usage.xhtml" />
- </fieldset>
- </ui:define>
-</ui:composition>
-
-</html>
\ No newline at end of file
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/log/log.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/log/log.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/log/log.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -6,6 +6,11 @@
xmlns:a4j="http://richfaces.org/a4j">
<ui:composition>
+ <p>
+ Log component allows you to inspect client side activities
+ during an Ajax request. It shows reuqest data, response data, DOM
+ tree changes on update and other useful debug information.
+ </p>
<h:form>
<h:inputText value="#{userBean.name}" />
<a4j:commandButton value="Submit" render="out"/>
Deleted: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/log.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/log.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/log.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -1,21 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
-<ui:composition template="/templates/main.xhtml">
- <ui:define name="body">
- <p>
- Log component allows you to inspect client side activities
- during an Ajax request. It shows reuqest data, response data, DOM
- tree changes on update and other useful debug information.
- </p>
- <fieldset>
- <legend>log Sample</legend>
- <ui:include src="/richfaces/log/usage.xhtml" />
- </fieldset>
- </ui:define>
-</ui:composition>
-
-</html>
\ No newline at end of file
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/mediaOutput/imgUsage.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -6,6 +6,29 @@
xmlns:a4j="http://richfaces.org/a4j">
<ui:composition>
+ <p>a4j:mediaOutput allows to generate images, video, sounds and other binary
+ resources defined by a user on-the-fly.
+ </p>
+ <p><b>createContent</b> attribute references to the method that will be used
+ for content creating. The method accepts two parameters. The first parameter
+ has an OutputStream type. It is a reference to the steam that should be used for output.
+ The second parameter is a reference to a 'value' attribute of the component.
+ </p>
+ <p>
+ <b>value</b> attribute references to data that can be used as input data for a content
+ creator method. The data should be serializable because it is encoded to the URL
+ of the resource.
+ </p>
+ <p>
+ <b>mimeType</b> attribute defines the type of output content. It is used to define
+ the corresponded type in the header of an HTTP response.
+ </p>
+ <p>
+ <b>cacheable</b> attribute is a flag that defines the caching strategy. If 'cacheable'
+ is set to false, the response will not be cached. If it is set to true, it will be cached
+ and the serialized value of 'value' attribute plays the role of a cache key.
+ </p>
+
<p>Dynamically generated JPEG file:</p>
<a4j:mediaOutput element="img" cacheable="false" session="true"
Deleted: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/mediaOutput.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/mediaOutput.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/mediaOutput.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -1,44 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
-<ui:composition template="/templates/main.xhtml">
- <ui:define name="body">
- <p>a4j:mediaOutput allows to generate images, video, sounds and other binary
- resources defined by a user on-the-fly.
- </p>
- <p><b>createContent</b> attribute references to the method that will be used
- for content creating. The method accepts two parameters. The first parameter
- has an OutputStream type. It is a reference to the steam that should be used for output.
- The second parameter is a reference to a 'value' attribute of the component.
- </p>
- <p>
- <b>value</b> attribute references to data that can be used as input data for a content
- creator method. The data should be serializable because it is encoded to the URL
- of the resource.
- </p>
- <p>
- <b>mimeType</b> attribute defines the type of output content. It is used to define
- the corresponded type in the header of an HTTP response.
- </p>
- <p>
- <b>cacheable</b> attribute is a flag that defines the caching strategy. If 'cacheable'
- is set to false, the response will not be cached. If it is set to true, it will be cached
- and the serialized value of 'value' attribute plays the role of a cache key.
- </p>
- <fieldset>
- <legend>Image output</legend>
- <ui:include src="/richfaces/mediaOutput/imgUsage.xhtml" />
- </fieldset>
- <ui:remove>
- <fieldset>
- <legend>Flash output</legend>
- <ui:include src="/richfaces/mediaOutput/flashUsage.xhtml" />
- </fieldset>
- </ui:remove>
- </ui:define>
-</ui:composition>
-
-</html>
\ No newline at end of file
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel/compositemessages.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel/compositemessages.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel/compositemessages.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -7,6 +7,11 @@
xmlns:rich="http://java.sun.com/jsf/composite/rich">
<ui:composition>
+ <p>
+ Next sample shows how you could simply create composite component from
+ standard h:messages and a4j:outputPanel in order to get them updated
+ for any ajax request without render definition.
+ </p>
<h:form>
<rich:panel id="psnel">
<f:facet name="header">
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel/simple.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel/simple.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel/simple.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -14,7 +14,22 @@
padding: 0px 30px 0px 0px;
vertical-align: top;
}
- </style>
+ </style>
+ <p>
+ <b>a4j:outputPanel</b> component designed to provide next features:
+ <ul>
+ <li><b>Automaticall updates</b> of the child content on Ajax requests</li>
+ <li>Wrapper component for <b>conditional rendering of nested elements</b> via Ajax</li>
+ <li><b>Configurable layouts</b>:
+ <ul>
+ <li>inline - rendered as span element</li>
+ <li>block - rendered as div element</li>
+ <li>none - special layout for nested components confitional rendering cases</li>
+ </ul>
+ </li>
+ <li></li>
+ </ul>
+ </p>
<h:panelGrid columns="2" width="100%" columnClasses="col">
<f:verbatim>
Deleted: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/outputPanel.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -1,40 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
-<ui:composition template="/templates/main.xhtml">
- <ui:define name="body">
- <p>
- <b>a4j:outputPanel</b> component designed to provide next features:
- <ul>
- <li><b>Automaticall updates</b> of the child content on Ajax requests</li>
- <li>Wrapper component for <b>conditional rendering of nested elements</b> via Ajax</li>
- <li><b>Configurable layouts</b>:
- <ul>
- <li>inline - rendered as span element</li>
- <li>block - rendered as div element</li>
- <li>none - special layout for nested components confitional rendering cases</li>
- </ul>
- </li>
- <li></li>
- </ul>
- </p>
- <fieldset>
- <legend>Sample</legend>
- <ui:include src="/richfaces/outputPanel/usage.xhtml" />
- </fieldset>
- <p>
- Next sample shows how you could simply create composite component from
- standard h:messages and a4j:outputPanel in order to get them updated
- for any ajax request without render definition.
- </p>
- <fieldset>
- <legend>Sample</legend>
- <ui:include src="/richfaces/outputPanel/compositemessages.xhtml" />
- </fieldset>
- </ui:define>
-</ui:composition>
-
-</html>
\ No newline at end of file
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/push/push.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/push/push.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/push/push.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -6,6 +6,16 @@
xmlns:a4j="http://richfaces.org/a4j">
<ui:composition>
+ <p>The <b><a4j:push></b> periodically perform AJAX request to
+ server, to simulate 'push' data.</p>
+ <p><b><a4j:push></b> makes request to
+ minimal code only (not to JSF tree) in order to check the presence of
+ messages in the queue. If the message exists the complete request will
+ be performed. The component doesn't poll registered beans but
+ registers EventListener which receives messages about events.</p>
+ <p>Attribute '<b>interval</b>' is used as for poll component. It
+ specifies the interval in ms. for call push request. Simple example of
+ usage:</p>
<h:form>
<h:dataTable value="#{choicesBean.choices}" var="choice" id="choiceVotes">
<f:facet name="header">
Deleted: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/push.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/push.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/push.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
- <ui:composition template="/templates/main.xhtml">
- <ui:define name="body">
- <p>The <b><a4j:push></b> periodically perform AJAX request to
- server, to simulate 'push' data.</p>
- <p><b><a4j:push></b> makes request to
- minimal code only (not to JSF tree) in order to check the presence of
- messages in the queue. If the message exists the complete request will
- be performed. The component doesn't poll registered beans but
- registers EventListener which receives messages about events.</p>
- <p>Attribute '<b>interval</b>' is used as for poll component. It
- specifies the interval in ms. for call push request. Simple example of
- usage:</p>
- <fieldset>
- <legend>
- Push Sample
- </legend>
- <ui:include src="/richfaces/push/usage.xhtml" />
- </fieldset>
- </ui:define>
- </ui:composition>
-
-</html>
\ No newline at end of file
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/referencedusage.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/referencedusage.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/referencedusage.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -6,6 +6,9 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://java.sun.com/jsf/composite/rich">
<ui:composition>
+ <p>
+ Example of status which referenced from the components
+ </p>
<h:panelGrid columns="3" width="300px;">
<rich:panel>
<f:facet name="header">
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/simple.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/simple.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/simple.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -6,7 +6,10 @@
xmlns:rich="http://java.sun.com/jsf/composite/rich"
xmlns:a4j="http://richfaces.org/a4j">
- <ui:composition>
+ <ui:composition>
+ <p>
+ Example of form scoped status
+ </p>
<h:form>
<rich:panel id="psnel">
<f:facet name="header">
Modified: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/viewusage.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/viewusage.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status/viewusage.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -6,7 +6,21 @@
xmlns:rich="http://java.sun.com/jsf/composite/rich"
xmlns:a4j="http://richfaces.org/a4j">
- <ui:composition>
+ <ui:composition>
+ <p>a4j:status is an indicator of an Ajax request. It has two states - start and stop. The start
+ state indicates that an Ajax request is in progress. When Ajax Response comes back,
+ the component switches to the stop stage.
+ </p>
+ <p> Status could be defined:
+ <ul>
+ <li>Default for View</li>
+ <li>Default for form</li>
+ <li>Referenced explicity from the component which sends request</li>
+ </ul>
+ </p>
+ <p>
+ Example of View scoped status
+ </p>
<h:panelGrid columns="3">
<h:form>
<rich:panel id="psnel">
Deleted: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status.xhtml 2010-05-20 02:20:02 UTC (rev 17152)
+++ root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/status.xhtml 2010-05-20 09:13:40 UTC (rev 17153)
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
- <ui:composition template="/templates/main.xhtml">
- <ui:define name="body">
- <p>a4j:status is an indicator of an Ajax request. It has two states - start and stop. The start
- state indicates that an Ajax request is in progress. When Ajax Response comes back,
- the component switches to the stop stage.
- </p>
- <p> Status could be defined:
- <ul>
- <li>Default for View</li>
- <li>Default for form</li>
- <li>Referenced explicity from the component which sends request</li>
- </ul>
- </p>
- <p>
- Example of View scoped status
- </p>
- <fieldset>
- <legend>Default view status sample</legend>
- <ui:include src="/richfaces/status/viewusage.xhtml" />
- </fieldset>
- <p>
- Example of form scoped status
- </p>
- <fieldset>
- <legend>Default form status sample</legend>
- <ui:include src="/richfaces/status/usage.xhtml" />
- </fieldset>
- <p>
- Example of status which referenced from the components
- </p>
- <fieldset>
- <legend>Referenced status sample</legend>
- <ui:include src="/richfaces/status/referencedusage.xhtml" />
- </fieldset>
- </ui:define>
- </ui:composition>
-</html>
\ No newline at end of file
14 years, 1 month
JBoss Rich Faces SVN: r17152 - root/build/resources/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-19 22:20:02 -0400 (Wed, 19 May 2010)
New Revision: 17152
Added:
root/build/resources/trunk/checkout.sh
Log:
Initial script for checking out richfaces modules
Added: root/build/resources/trunk/checkout.sh
===================================================================
--- root/build/resources/trunk/checkout.sh (rev 0)
+++ root/build/resources/trunk/checkout.sh 2010-05-20 02:20:02 UTC (rev 17152)
@@ -0,0 +1,208 @@
+#!/bin/sh
+
+usage()
+{
+cat << EOF
+usage: $0 options
+
+This script will check out RichFaces 4.0 modules. By default this will checkout only the primary project modules.
+
+MODULE OPTIONS
+ -c Include cdk modules
+ -t Include tests, and docs modules
+ -e Include examples, and archetype modules
+ -s Include sandbox modules
+ -a Include all of the above
+
+BASIC OPTIONS:
+ -h Show this message
+ -d Destination directory, otherwise the PWD is used
+ -r Checkout in readonly mode from anonsvn
+ -v Be more verbose
+EOF
+}
+
+work()
+{
+
+if [ "$READONLY" -eq "1" ]
+then
+ SVNBASE="http://anonsvn.jboss.org/repos/richfaces/root"
+else
+ SVNBASE="https://svn.jboss.org/repos/richfaces/root"
+fi
+
+if [ "$VERBOSE" -eq "0" ]
+then
+ SVNARGS="--quiet"
+fi
+
+if [ -d $DESTINATION ]
+then
+ echo "Checking out to $DESTINATION"
+else
+ echo "Creating directory $DESTINATION to checkout to"
+ mkdir $DESTINATION
+fi
+
+FINAL_LIST=( ${MAIN_MODULE_ARRAY[@]} )
+
+if [ "$INCL_CDK" -eq "1" ]
+then
+ FINAL_LIST=( ${FINAL_LIST[@]} ${CDK_MODULE_ARRAY[@]} )
+fi
+
+if [ "$INCL_DOCS_TESTS" -eq "1" ]
+then
+ FINAL_LIST=( ${FINAL_LIST[@]} ${DOC_QE_MODULE_ARRAY[@]} )
+fi
+
+if [ "$INCL_EXAMPLES_ARCHETYPE" -eq "1" ]
+then
+ FINAL_LIST=( ${FINAL_LIST[@]} ${EXAMPLE_ARCHETYPE_MODULE_ARRAY[@]} )
+fi
+
+if [ "$INCL_SANDBOX" -eq "1" ]
+then
+ FINAL_LIST=( ${FINAL_LIST[@]} ${SANDBOX_MODULE_ARRAY[@]} )
+fi
+
+for module in "${FINAL_LIST[@]}"
+do
+ url="$SVNBASE/$module/trunk"
+ moduledir=$DESTINATION/$module/trunk
+
+ echo
+ echo =================================
+
+ if [ -d $moduledir ]
+ then
+ echo "Updating $module"
+ svncmd="svn up $SVNARGS $DESTINATION/$module"
+ else
+ echo "Checking out $module"
+ svncmd="svn co $SVNARGS $url $DESTINATION/$module"
+ fi
+
+ echo =================================
+
+ $svncmd
+
+done
+
+}
+
+DESTINATION=`pwd`
+READONLY=0
+VERBOSE=0
+SVNBASE=
+SVNARGS=
+WORK=1
+INCL_CDK=0
+INCL_DOCS_TESTS=0
+INCL_EXAMPLES_ARCHETYPE=0
+INCL_SANDBOX=0
+
+# Listing of all modules to be checked out
+# $1 = path to module ( before trunk/tag/branch )
+MAIN_MODULE_ARRAY=(
+ "build/parent"
+ "build/bom"
+ "build/resources"
+ "commons"
+ "core"
+ "dist"
+ "ui/core"
+ "ui/dist"
+ # other ui modules when in place
+ # "ui/inputs"
+ )
+
+CDK_MODULE_ARRAY=(
+ "cdk"
+ "cdk-sandbox"
+ )
+
+DOC_QE_MODULE_ARRAY=(
+ "docs"
+ "tests"
+ )
+
+EXAMPLE_ARCHETYPE_MODULE_ARRAY=(
+ # For each example
+ # "examples/<example>"
+ "examples/dist"
+ "examples/core-demo"
+ "examples/repeater-demo"
+ "examples/richfaces-showcase"
+
+ # For each archetype
+ # "archetype/<archetype>"
+ # TODO - populate after we have archetypes
+ )
+
+SANDBOX_MODULE_ARRAY=(
+ # For each example in sandbox
+ # "examples-sandbox/<example>"
+
+ # For each component in sandbox
+ # "ui-sandbox/<component>"
+ "ui-sandbox/calendar"
+ "ui-sandbox/componentcontrol"
+ "ui-sandbox/datafilterslider"
+ "ui-sandbox/datascroller"
+ "ui-sandbox/drag-drop"
+ "ui-sandbox/fileupload"
+ "ui-sandbox/numberinputs"
+ "ui-sandbox/selects"
+ "ui-sandbox/tables"
+ "ui-sandbox/togglepanels"
+ "ui-sandbox/tree"
+ "ui-sandbox/tree-model"
+ )
+
+while getopts "tecsahrd:v" OPTION
+do
+ case $OPTION in
+ t)
+ INCL_DOCS_TESTS=1
+ ;;
+ e)
+ INCL_EXAMPLES_ARCHETYPE=1
+ ;;
+ c)
+ INCL_CDK=1
+ ;;
+ s)
+ INCL_SANDBOX=1
+ ;;
+ a)
+ INCL_CDK=1
+ INCL_DOCS_TESTS=1
+ INCL_EXAMPLES_ARCHETYPE=1
+ INCL_SANDBOX=1
+ ;;
+ h)
+ usage
+ WORK=0
+ ;;
+ d)
+ DESTINATION=$OPTARG
+ ;;
+ r)
+ READONLY=1
+ ;;
+ v)
+ VERBOSE=1
+ ;;
+ [?])
+ usage;
+ WORK=0
+ ;;
+ esac
+done
+
+if [ "$WORK" -eq "1" ] || [ "$#" -eq "0" ]
+then
+ work;
+fi
\ No newline at end of file
Property changes on: root/build/resources/trunk/checkout.sh
___________________________________________________________________
Name: svn:executable
+ *
14 years, 1 month
JBoss Rich Faces SVN: r17151 - in root/core/trunk: impl/src/main/java/org/richfaces/renderkit/html and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-19 20:10:53 -0400 (Wed, 19 May 2010)
New Revision: 17151
Added:
root/core/trunk/api/src/main/java/org/richfaces/resource/DynamicResource.java
root/core/trunk/impl/src/main/java/org/richfaces/resource/LegacyResourceCodec.java
Removed:
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.Base2WayGradient.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.BaseGradient.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.CustomizeableGradient.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.GradientA.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.ButtonGradientImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.ButtonInverseGradientImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.HeaderGradientImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.HeaderInverseGradientImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.InputGradientImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.MenuGradientImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.MenuInverseGradientImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.TabGradientImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.TabInverseGradientImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.BaseControlBackgroundImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.ButtonBackgroundImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.GradientAlignment.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.GradientType.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.InputBackgroundImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.StandardButtonBgImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.StandardButtonPressedBgImage.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.resource.AnimatedTestResource.resource.properties
root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.resource.TestResource2.resource.properties
root/core/trunk/impl/src/test/resources/META-INF/org.richfaces.resource.CacheableResourceImpl.resource.properties
root/core/trunk/impl/src/test/resources/META-INF/org.richfaces.resource.NonCacheableResourceImpl.resource.properties
root/core/trunk/impl/src/test/resources/META-INF/org.richfaces.resource.StateHolderResourceImpl.resource.properties
root/core/trunk/impl/src/test/resources/META-INF/org.richfaces.resource.VersionedResourceImpl.resource.properties
Modified:
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java
root/core/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
root/core/trunk/impl/src/main/java/org/richfaces/resource/DefaultResourceCodec.java
root/core/trunk/impl/src/main/java/org/richfaces/resource/ResourceCodec.java
root/core/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
root/core/trunk/impl/src/main/java/org/richfaces/resource/TestResource2.java
root/core/trunk/impl/src/main/java/org/richfaces/util/Util.java
root/core/trunk/impl/src/test/java/org/richfaces/resource/AbstractBaseResourceTest.java
root/core/trunk/impl/src/test/java/org/richfaces/resource/CacheableResourceImpl.java
root/core/trunk/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java
root/core/trunk/impl/src/test/java/org/richfaces/resource/StateHolderResourceImpl.java
root/core/trunk/impl/src/test/java/org/richfaces/resource/VersionedResourceImpl.java
root/core/trunk/impl/src/test/resources/resources/full.css
root/core/trunk/impl/src/test/resources/resources/importedEL.css
root/core/trunk/impl/src/test/resources/resources/resource.css
Log:
https://jira.jboss.org/browse/RF-8665
Added: root/core/trunk/api/src/main/java/org/richfaces/resource/DynamicResource.java
===================================================================
--- root/core/trunk/api/src/main/java/org/richfaces/resource/DynamicResource.java (rev 0)
+++ root/core/trunk/api/src/main/java/org/richfaces/resource/DynamicResource.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.resource;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+(a)Retention(RetentionPolicy.RUNTIME)
+(a)Target(ElementType.TYPE)
+@Inherited
+public @interface DynamicResource {
+
+}
Modified: root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -21,14 +21,6 @@
package org.richfaces.renderkit.html;
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.util.NumericDataInputStream;
-import org.ajax4jsf.util.NumericDataOutputStream;
-import org.richfaces.renderkit.html.images.GradientType;
-import org.richfaces.renderkit.html.images.GradientType.BiColor;
-import org.richfaces.skin.Skin;
-
-import javax.faces.context.FacesContext;
import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics2D;
@@ -37,10 +29,21 @@
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.Java2Dresource;
+import org.ajax4jsf.util.NumericDataInputStream;
+import org.ajax4jsf.util.NumericDataOutputStream;
+import org.richfaces.renderkit.html.images.GradientType;
+import org.richfaces.renderkit.html.images.GradientType.BiColor;
+import org.richfaces.resource.DynamicResource;
+import org.richfaces.skin.Skin;
+
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
* created 02.02.2007
*/
+@DynamicResource
public class BaseGradient extends Java2Dresource {
protected Integer headerBackgroundColor;
Modified: root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/CustomizeableGradient.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -21,14 +21,6 @@
package org.richfaces.renderkit.html;
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.util.NumericDataInputStream;
-import org.richfaces.renderkit.html.images.GradientAlignment;
-import org.richfaces.renderkit.html.images.GradientType;
-import org.richfaces.renderkit.html.images.GradientType.BiColor;
-import org.richfaces.skin.Skin;
-
-import javax.faces.context.FacesContext;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GradientPaint;
@@ -38,10 +30,21 @@
import java.awt.geom.Rectangle2D;
import java.util.Map;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.Java2Dresource;
+import org.ajax4jsf.util.NumericDataInputStream;
+import org.richfaces.renderkit.html.images.GradientAlignment;
+import org.richfaces.renderkit.html.images.GradientType;
+import org.richfaces.renderkit.html.images.GradientType.BiColor;
+import org.richfaces.resource.DynamicResource;
+import org.richfaces.skin.Skin;
+
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
* created 02.02.2007
*/
+@DynamicResource
public class CustomizeableGradient extends Java2Dresource {
private static final String BASE_COLOR = "baseColor";
Modified: root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/CancelControlIcon.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -20,23 +20,26 @@
*/
package org.richfaces.renderkit.html.images;
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.util.HtmlColor;
-import org.ajax4jsf.util.NumericDataInputStream;
-
-import javax.faces.context.FacesContext;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.Java2Dresource;
+import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.NumericDataInputStream;
+import org.richfaces.resource.DynamicResource;
+
/**
* implementation of the default CANCEL icon renderer
*
* @author Anton Belevich
* @since 3.2.0
*/
+@DynamicResource
public class CancelControlIcon extends Java2Dresource {
protected static final String ALTERNATE_COLOR = "#ED6161";
Modified: root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/OneColorBasedResource.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -21,11 +21,14 @@
package org.richfaces.renderkit.html.images;
+import java.awt.Color;
+import java.awt.Dimension;
+
import org.ajax4jsf.resource.Java2Dresource;
import org.ajax4jsf.resource.ResourceContext;
+import org.richfaces.resource.DynamicResource;
-import java.awt.*;
-
+@DynamicResource
public abstract class OneColorBasedResource extends Java2Dresource {
private Dimension dimension;
Modified: root/core/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -204,7 +204,7 @@
String resourceVersion = getVersion();
String resourceUri = ResourceHandlerImpl.RICHFACES_RESOURCE_IDENTIFIER
- + resourceCodec.encodeResource(resourceName, resourceData, resourceVersion);
+ + resourceCodec.encodeResource(context, resourceName, resourceData, resourceVersion);
resourceUri = Util.encodeResourceURL(context, resourceUri);
Modified: root/core/trunk/impl/src/main/java/org/richfaces/resource/DefaultResourceCodec.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/resource/DefaultResourceCodec.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/main/java/org/richfaces/resource/DefaultResourceCodec.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -21,31 +21,109 @@
package org.richfaces.resource;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
import org.richfaces.util.Util;
final class DefaultResourceCodec implements ResourceCodec {
+
+ private static final String RESOURCE_VERSION_PARAM = "v";
+
+ private static final String RESOURCE_DATA_BYTES_ARRAY_PARAM = "db";
+
+ private static final String RESOURCE_DATA_OBJECT_PARAM = "do";
+
private static final ResourceCodec CODEC = new DefaultResourceCodec();
private DefaultResourceCodec() {
}
- public String decodeResourceName(String resourceKey) {
- return Util.getResourceName(resourceKey);
+ public String decodeResourceName(FacesContext context, String requestPath) {
+ return requestPath;
}
- public Object decodeResourceData(String resourceKey) {
- return Util.getResourceData(resourceKey);
+ public Object decodeResourceData(FacesContext context, String requestPath) {
+ Map<String, String> paramMap = context.getExternalContext().getRequestParameterMap();
+
+ String encodedData = paramMap.get(RESOURCE_DATA_BYTES_ARRAY_PARAM);
+ if (encodedData != null) {
+ return Util.decodeBytesData(encodedData);
+ } else {
+ encodedData = paramMap.get(RESOURCE_DATA_OBJECT_PARAM);
+ if (encodedData != null) {
+ return Util.decodeObjectData(encodedData);
+ }
+ }
+
+ return null;
}
public static ResourceCodec getInstance() {
return CODEC;
}
- public String decodeResourceVersion(String resourceKey) {
- return Util.getResourceVersion(resourceKey);
+ public String decodeResourceVersion(FacesContext context, String requestPath) {
+ return context.getExternalContext().getRequestParameterMap().get(RESOURCE_VERSION_PARAM);
}
- public String encodeResource(String resourceName, Object resourceData, String resourceVersion) {
- return Util.encodeResourceData(resourceName, resourceData, resourceVersion);
+ public String encodeResource(FacesContext context, String resourceName, Object resourceData, String resourceVersion) {
+ boolean parameterAppended = false;
+
+ StringBuilder sb = new StringBuilder();
+ sb.append(resourceName);
+
+ if (resourceVersion != null && resourceVersion.length() != 0) {
+ if (!parameterAppended) {
+ sb.append('?');
+ parameterAppended = true;
+ }
+
+ sb.append(RESOURCE_VERSION_PARAM);
+ sb.append('=');
+ sb.append(Util.encodeURIQueryPart(resourceVersion));
+ }
+
+ if (resourceData != null) {
+ String encodedDataString = null;
+ boolean isBytesArray = false;
+
+ if (resourceData instanceof byte[]) {
+ isBytesArray = true;
+ encodedDataString = Util.encodeBytesData((byte[]) resourceData);
+ } else {
+ encodedDataString = Util.encodeObjectData(resourceData);
+ }
+
+ if (encodedDataString != null) {
+ if (!parameterAppended) {
+ sb.append('?');
+ parameterAppended = true;
+ } else {
+ sb.append('&');
+ }
+
+ sb.append(isBytesArray ? RESOURCE_DATA_BYTES_ARRAY_PARAM : RESOURCE_DATA_OBJECT_PARAM);
+ sb.append('=');
+ sb.append(Util.encodeURIQueryPart(encodedDataString));
+ }
+ }
+
+ return sb.toString();
}
+
+ public String getResourceKey(FacesContext context, String requestPath) {
+ Map<String, String> paramMap = context.getExternalContext().getRequestParameterMap();
+
+ String resourceDataString = paramMap.get(RESOURCE_DATA_BYTES_ARRAY_PARAM);
+ if (resourceDataString == null) {
+ resourceDataString = paramMap.get(RESOURCE_DATA_OBJECT_PARAM);
+ }
+
+ String resourceVersionString = paramMap.get(RESOURCE_VERSION_PARAM);
+
+ return encodeResource(context, decodeResourceName(context, requestPath),
+ resourceDataString, resourceVersionString);
+ }
}
Added: root/core/trunk/impl/src/main/java/org/richfaces/resource/LegacyResourceCodec.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/resource/LegacyResourceCodec.java (rev 0)
+++ root/core/trunk/impl/src/main/java/org/richfaces/resource/LegacyResourceCodec.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -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.resource;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.util.Util;
+
+final class LegacyResourceCodec implements ResourceCodec {
+
+ private static final ResourceCodec CODEC = new LegacyResourceCodec();
+
+ private LegacyResourceCodec() {
+ }
+
+ public String decodeResourceName(FacesContext context, String requestPath) {
+ return Util.legacyDecodeResourceName(requestPath);
+ }
+
+ public Object decodeResourceData(FacesContext context, String requestPath) {
+ return Util.legacyDecodeResourceData(requestPath);
+ }
+
+ public static ResourceCodec getInstance() {
+ return CODEC;
+ }
+
+ public String decodeResourceVersion(FacesContext context, String requestPath) {
+ return Util.legacyDecodeResourceVersion(requestPath);
+ }
+
+ public String encodeResource(FacesContext context, String resourceName, Object resourceData, String resourceVersion) {
+ return Util.legacyEncodeResourceData(resourceName, resourceData, resourceVersion);
+ }
+
+ public String getResourceKey(FacesContext context, String requestPath) {
+ return requestPath;
+ }
+}
+
Modified: root/core/trunk/impl/src/main/java/org/richfaces/resource/ResourceCodec.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/resource/ResourceCodec.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/main/java/org/richfaces/resource/ResourceCodec.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -3,16 +3,21 @@
*/
package org.richfaces.resource;
+import javax.faces.context.FacesContext;
+
/**
* @author Nick Belaevski
* @since 4.0
*/
public interface ResourceCodec {
- public String encodeResource(String resourceName, Object resourceData, String resourceVersion);
+
+ public String encodeResource(FacesContext context, String resourceName, Object resourceData, String resourceVersion);
- public String decodeResourceName(String resourceKey);
+ public String decodeResourceName(FacesContext context, String requestPath);
- public Object decodeResourceData(String resourceKey);
+ public Object decodeResourceData(FacesContext context, String requestPath);
- public String decodeResourceVersion(String resourceKey);
+ public String decodeResourceVersion(FacesContext context, String requestPath);
+
+ public String getResourceKey(FacesContext context, String requestPath);
}
Modified: root/core/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -44,6 +44,7 @@
import org.ajax4jsf.cache.Cache;
import org.ajax4jsf.cache.CacheManager;
import org.ajax4jsf.resource.Java2Dresource;
+import org.richfaces.application.ServiceTracker;
import org.richfaces.context.AttributesContext;
import org.richfaces.context.SingletonsContext;
import org.richfaces.log.RichfacesLogger;
@@ -60,7 +61,6 @@
public static final String RESOURCE_CACHE_NAME = ResourceHandlerImpl.class.getName() + ":CACHE";
public static final String HANDLER_START_TIME_ATTRIBUTE = ResourceHandlerImpl.class.getName() + ":StartTime";
- private static final String RESOURCE_CODEC_ATTRIBUTE_NAME = ResourceHandlerImpl.class.getName() + ":ResourceCodec";
private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
// TODO - review - do we need this?
@@ -110,19 +110,12 @@
protected static void setResourceCodec(ResourceCodec codec) {
FacesContext facesContext = FacesContext.getCurrentInstance();
- Map<String, Object> applicationMap = facesContext.getExternalContext().getApplicationMap();
- Object oldCodec = applicationMap.put(RESOURCE_CODEC_ATTRIBUTE_NAME, codec);
-
- if ((oldCodec != null) && (codec != null) && !oldCodec.equals(codec)
- && facesContext.isProjectStage(ProjectStage.Development)) {
- LOGGER.warn("Resource codec should be typically set once per application lifetime");
- }
+
+ ServiceTracker.setService(facesContext, ResourceCodec.class, codec);
}
public static ResourceCodec getResourceCodec(FacesContext context) {
- Map<String, Object> applicationMap = context.getExternalContext().getApplicationMap();
- ResourceCodec resourceCodec = (ResourceCodec) applicationMap.get(RESOURCE_CODEC_ATTRIBUTE_NAME);
-
+ ResourceCodec resourceCodec = ServiceTracker.getService(context, ResourceCodec.class);
if (resourceCodec == null) {
resourceCodec = DefaultResourceCodec.getInstance();
}
@@ -130,7 +123,7 @@
return resourceCodec;
}
- protected static String getResourceKey(FacesContext context) {
+ protected static String getResourcePathFromRequest(FacesContext context) {
String resourceName = Util.decodeResourceURL(context);
if (resourceName != null) {
@@ -140,7 +133,6 @@
return null;
}
} else {
-
LOGGER.warn("Resource key not found" + resourceName);
return null;
}
@@ -150,14 +142,14 @@
Boolean resourceRequest = BooleanRequestStateVariable.ResourceRequest.get(context);
if (resourceRequest == null) {
- String resourceKey = getResourceKey(context);
+ String resourcePath = getResourcePathFromRequest(context);
// TODO handle exclusions
- resourceRequest = (resourceKey != null) && (resourceKey.length() > 0);
+ resourceRequest = (resourcePath != null) && (resourcePath.length() > 0);
BooleanRequestStateVariable.ResourceRequest.set(context, resourceRequest);
if (LOGGER.isDebugEnabled() && resourceRequest) {
- LOGGER.debug(MessageFormat.format("Resource request detected: {0}", resourceKey));
+ LOGGER.debug(MessageFormat.format("Resource request detected: {0}", resourcePath));
}
}
@@ -222,15 +214,20 @@
@Override
public void handleResourceRequest(FacesContext context) throws IOException {
if (isThisHandlerResourceRequest(context)) {
- String resourceKey = getResourceKey(context);
+ ResourceCodec resourceCodec = ResourceHandlerImpl.getResourceCodec(context);
+ String resourcePath = getResourcePathFromRequest(context);
+
+ assert (resourcePath != null) && (resourcePath.length() != 0);
+
+ String resourceKey = resourceCodec.getResourceKey(context, resourcePath);
+
assert (resourceKey != null) && (resourceKey.length() != 0);
Resource resource = lookupInCache(context, resourceKey);
if (resource == null) {
- ResourceCodec resourceCodec = ResourceHandlerImpl.getResourceCodec(context);
- String resourceName = resourceCodec.decodeResourceName(resourceKey);
+ String resourceName = resourceCodec.decodeResourceName(context, resourcePath);
if ((resourceName == null) || (resourceName.length() == 0)) {
logMissingResource(context, resourceKey);
@@ -239,14 +236,16 @@
return;
}
- if (isResourceExists(resourceName)) {
- Map<String, String> params = Util.parseResourceParameters(resourceKey);
- resource = createHandlerDependentResource(resourceName, params);
- }
- if (resource == null && resourceName.lastIndexOf(".ecss") != -1) {
+ if (resourceName.lastIndexOf(".ecss") != -1) {
resource = new CompiledCSSResource(resourceName);
}
+
if (resource == null) {
+ resource = createHandlerDependentResource(resourceName,
+ context.getExternalContext().getRequestParameterMap());
+ }
+
+ if (resource == null) {
logMissingResource(context, resourceName);
sendResourceNotFound(context);
@@ -256,7 +255,7 @@
if (resource instanceof VersionedResource) {
VersionedResource versionedResource = (VersionedResource) resource;
String existingVersion = versionedResource.getVersion();
- String requestedVersion = resourceCodec.decodeResourceVersion(resourceKey);
+ String requestedVersion = resourceCodec.decodeResourceVersion(context, resourcePath);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(
@@ -277,7 +276,7 @@
if (resource instanceof StateHolder) {
StateHolder stateHolder = (StateHolder) resource;
- Object decodedData = resourceCodec.decodeResourceData(resourceKey);
+ Object decodedData = resourceCodec.decodeResourceData(context, resourcePath);
if (LOGGER.isDebugEnabled()) {
if (decodedData != null) {
@@ -401,29 +400,6 @@
}
}
- protected static boolean isResourceExists(String resourceName) {
- boolean result = false;
- ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
-
- if (contextClassLoader != null) {
-
- // TODO resource marker extension name?
- URL resourceMarkerUrl = contextClassLoader.getResource("META-INF/" + resourceName + ".resource.properties");
-
- result = resourceMarkerUrl != null;
-
- if (LOGGER.isDebugEnabled()) {
- if (result) {
- LOGGER.debug(MessageFormat.format("Marker file for {0} resource found in classpath", resourceName));
- } else {
- LOGGER.debug(MessageFormat.format("Marker file for {0} resource does not exist", resourceName));
- }
- }
- }
-
- return result;
- }
-
/**
* Should be called only if {@link #isResourceExists(String)} returns <code>true</code>
*
@@ -437,9 +413,40 @@
if (contextClassLoader != null) {
try {
- Class<?> resourceClass = Class.forName(resourceName, false, contextClassLoader);
+ Class<?> loadedClass = Class.forName(resourceName, false, contextClassLoader);
+
+ Class<? extends Resource> resourceClass = loadedClass.asSubclass(Resource.class);
+
+ boolean legitimateResource = false;
+
+ DynamicResource annotation = resourceClass.getAnnotation(DynamicResource.class);
+ legitimateResource = (annotation != null);
+ if (legitimateResource) {
+ LOGGER.debug(
+ MessageFormat.format("Dynamic resource annotation is present on resource class {0}", resourceName));
+ } else {
+ LOGGER.debug(
+ MessageFormat.format("Dynamic resource annotation is not present on resource class {0}", resourceName));
+ }
+
+ if (!legitimateResource) {
+ // TODO resource marker extension name?
+ URL resourceMarkerUrl = contextClassLoader.getResource("META-INF/" + resourceName + ".resource.properties");
- if (Resource.class.isAssignableFrom(resourceClass)) {
+ legitimateResource = resourceMarkerUrl != null;
+
+ if (LOGGER.isDebugEnabled()) {
+ if (legitimateResource) {
+ LOGGER.debug(
+ MessageFormat.format("Marker file for {0} resource found in classpath", resourceName));
+ } else {
+ LOGGER.debug(
+ MessageFormat.format("Marker file for {0} resource does not exist", resourceName));
+ }
+ }
+ }
+
+ if (legitimateResource) {
resource = (Resource) resourceClass.newInstance();
resource.setResourceName(resourceName);
if (resource instanceof Java2Dresource) {
@@ -451,11 +458,11 @@
LOGGER.debug(MessageFormat.format("Successfully created instance of {0} resource",
resourceName));
}
- } else {
- throw new ClassCastException(resourceClass.getName());
}
- } catch (Throwable t) {
- logResourceProblem(FacesContext.getCurrentInstance(), t, "Error creating resource {0}", resourceName);
+ } catch (Exception e) {
+ logResourceProblem(FacesContext.getCurrentInstance(), e, "Error creating resource {0}", resourceName);
+ } catch (LinkageError e) {
+ logResourceProblem(FacesContext.getCurrentInstance(), e, "Error creating resource {0}", resourceName);
}
}
@@ -467,13 +474,16 @@
Resource result = null;
Map<String, String> params = Util.parseResourceParameters(resourceName);
resourceName = extractParametersFromResourceName(resourceName);
- if ((resourceName != null) && ((libraryName == null) || (libraryName.length() == 0))
- && isResourceExists(resourceName)) {
- result = createHandlerDependentResource(resourceName, params);
- } else if (resourceName.lastIndexOf(".ecss") != -1) {
+ if (resourceName.lastIndexOf(".ecss") != -1) {
result = new CompiledCSSResource(resourceName);
} else {
- result = defaultHandler.createResource(resourceName, libraryName, contentType);
+ if ((resourceName != null) && ((libraryName == null) || (libraryName.length() == 0))) {
+ result = createHandlerDependentResource(resourceName, params);
+ }
+
+ if (result == null) {
+ result = defaultHandler.createResource(resourceName, libraryName, contentType);
+ }
}
return result;
Modified: root/core/trunk/impl/src/main/java/org/richfaces/resource/TestResource2.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/resource/TestResource2.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/main/java/org/richfaces/resource/TestResource2.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -21,6 +21,13 @@
package org.richfaces.resource;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+
+import javax.faces.context.FacesContext;
+
import org.ajax4jsf.resource.Java2Dresource;
import org.ajax4jsf.util.HtmlColor;
import org.ajax4jsf.util.NumericDataInputStream;
@@ -29,9 +36,7 @@
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
-import javax.faces.context.FacesContext;
-import java.awt.*;
-
+@DynamicResource
public class TestResource2 extends Java2Dresource {
private static final int MASK_FOR_COLOR_WITHOUT_ALPHA_CHANNEL = 0x00FFFFFF;
Modified: root/core/trunk/impl/src/main/java/org/richfaces/util/Util.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/util/Util.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/main/java/org/richfaces/util/Util.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -41,15 +41,6 @@
package org.richfaces.util;
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.util.base64.Codec;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-
-import javax.faces.FacesException;
-import javax.faces.application.ViewHandler;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -61,9 +52,12 @@
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetEncoder;
import java.text.Format;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -77,6 +71,16 @@
import java.util.zip.Deflater;
import java.util.zip.Inflater;
+import javax.faces.FacesException;
+import javax.faces.application.ViewHandler;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.util.base64.Codec;
+import org.richfaces.log.RichfacesLogger;
+import org.slf4j.Logger;
+
/**
* @author Nick Belaevski
* @since 4.0
@@ -205,41 +209,96 @@
}
}
- public static String encodeResourceData(String resourceName, Object storeData, String resourceVersion) {
+ public static byte[] decodeBytesData(String encodedData) {
+ byte[] objectArray = null;
+
+ try {
+ byte[] dataArray = encodedData.getBytes("ISO-8859-1");
+
+ objectArray = decrypt(dataArray);
+ } catch (UnsupportedEncodingException e1) {
+
+ // default encoding always presented.
+ }
+
+ return objectArray;
+ }
+
+ public static Object decodeObjectData(String encodedData) {
+ byte[] objectArray = decodeBytesData(encodedData);
+
+ try {
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(objectArray));
+
+ return in.readObject();
+ } catch (StreamCorruptedException e) {
+ RESOURCE_LOGGER.error(Messages.getMessage(Messages.STREAM_CORRUPTED_ERROR), e);
+ } catch (IOException e) {
+ RESOURCE_LOGGER.error(Messages.getMessage(Messages.DESERIALIZE_DATA_INPUT_ERROR), e);
+ } catch (ClassNotFoundException e) {
+ RESOURCE_LOGGER.error(Messages.getMessage(Messages.DATA_CLASS_NOT_FOUND_ERROR), e);
+ }
+
+ return null;
+ }
+
+ public static String encodeBytesData(byte[] data) {
+ if (data != null) {
+ try {
+ byte[] dataArray = encrypt(data);
+
+ return new String(dataArray, "ISO-8859-1");
+ } catch (Exception e) {
+ RESOURCE_LOGGER.error(Messages.getMessage(Messages.QUERY_STRING_BUILDING_ERROR), e);
+ }
+ }
+
+ return null;
+ }
+
+ public static String encodeObjectData(Object data) {
+ if (data != null) {
+ try {
+ ByteArrayOutputStream dataStream = new ByteArrayOutputStream(1024);
+ ObjectOutputStream objStream = new ObjectOutputStream(dataStream);
+
+ objStream.writeObject(data);
+ objStream.flush();
+ objStream.close();
+ dataStream.close();
+
+ return encodeBytesData(dataStream.toByteArray());
+ } catch (Exception e) {
+ RESOURCE_LOGGER.error(Messages.getMessage(Messages.QUERY_STRING_BUILDING_ERROR), e);
+ }
+ }
+
+ return null;
+ }
+
+ public static String legacyEncodeResourceData(String resourceName, Object storeData, String resourceVersion) {
StringBuilder uri = new StringBuilder(); // ResourceServlet.DEFAULT_SERVLET_PATH).append("/");
uri.append(resourceName);
// append serialized data as Base-64 encoded request string.
if (storeData != null) {
- try {
- byte[] objectData;
-
- if (storeData instanceof byte[]) {
- objectData = (byte[]) storeData;
+ String encodedData;
+ if (storeData instanceof byte[]) {
+ encodedData = encodeBytesData((byte[]) storeData);
+
+ if (encodedData != null) {
uri.append(DATA_BYTES_SEPARATOR);
- } else {
- ByteArrayOutputStream dataSteram = new ByteArrayOutputStream(1024);
- ObjectOutputStream objStream = new ObjectOutputStream(dataSteram);
+ uri.append(encodedData);
+ }
+
+ } else {
+ encodedData = encodeObjectData(storeData);
- objStream.writeObject(storeData);
- objStream.flush();
- objStream.close();
- dataSteram.close();
- objectData = dataSteram.toByteArray();
+ if (encodedData != null) {
uri.append(DATA_SEPARATOR);
+ uri.append(encodedData);
}
-
- byte[] dataArray = encrypt(objectData);
-
- uri.append(new String(dataArray, "ISO-8859-1"));
-
- // / byte[] objectData = dataSteram.toByteArray();
- // / uri.append("?").append(new
- // String(Base64.encodeBase64(objectData),
- // / "ISO-8859-1"));
- } catch (Exception e) {
- RESOURCE_LOGGER.error(Messages.getMessage(Messages.QUERY_STRING_BUILDING_ERROR), e);
}
}
@@ -263,7 +322,7 @@
return uri.toString(); // context.getExternalContext().encodeResourceURL(resourceURL);
}
- public static String getResourceName(String resourceUri) {
+ public static String legacyDecodeResourceName(String resourceUri) {
String resourceName = resourceUri;
Matcher matcher = DATA_SEPARATOR_PATTERN.matcher(resourceName);
@@ -282,7 +341,7 @@
return resourceName;
}
- public static String getResourceVersion(String resourceUri) {
+ public static String legacyDecodeResourceVersion(String resourceUri) {
int idx = resourceUri.indexOf(VERSION_SEPARATOR);
if (idx > 0) {
@@ -292,7 +351,7 @@
return null;
}
- public static Object getResourceData(String resourceUri) {
+ public static Object legacyDecodeResourceData(String resourceUri) {
Object data = null;
Matcher matcher = DATA_SEPARATOR_PATTERN.matcher(resourceUri);
@@ -305,31 +364,11 @@
}
String dataString = matcher.group(DATA_SEPARATOR_DATA_GROUP_INDEX);
- byte[] objectArray = null;
- try {
- byte[] dataArray = dataString.getBytes("ISO-8859-1");
-
- objectArray = decrypt(dataArray);
- } catch (UnsupportedEncodingException e1) {
-
- // default encoding always presented.
- }
-
if ("B".equals(matcher.group(DATA_SEPARATOR_TYPE_GROUP_INDEX))) {
- data = objectArray;
+ data = decodeBytesData(dataString);
} else {
- try {
- ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(objectArray));
-
- data = in.readObject();
- } catch (StreamCorruptedException e) {
- RESOURCE_LOGGER.error(Messages.getMessage(Messages.STREAM_CORRUPTED_ERROR), e);
- } catch (IOException e) {
- RESOURCE_LOGGER.error(Messages.getMessage(Messages.DESERIALIZE_DATA_INPUT_ERROR), e);
- } catch (ClassNotFoundException e) {
- RESOURCE_LOGGER.error(Messages.getMessage(Messages.DATA_CLASS_NOT_FOUND_ERROR), e);
- }
+ data = decodeObjectData(dataString);
}
return data;
@@ -344,7 +383,18 @@
resourcePath = mapping + url;
}
} else {
- resourcePath += mapping;
+ int paramsSeparator = resourcePath.indexOf(QUESTION_SIGN);
+ if (paramsSeparator >= 0) {
+ StringBuilder resourcePathBuilder = new StringBuilder(resourcePath.length() + mapping.length());
+
+ resourcePathBuilder.append(resourcePath.substring(0, paramsSeparator));
+ resourcePathBuilder.append(mapping);
+ resourcePathBuilder.append(resourcePath.substring(paramsSeparator));
+
+ resourcePath = resourcePathBuilder.toString();
+ } else {
+ resourcePath += mapping;
+ }
}
ViewHandler viewHandler = context.getApplication().getViewHandler();
@@ -416,4 +466,83 @@
buffer.clear();
}
}
+
+ private static boolean isLegalURIQueryChar(char c) {
+ //http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html
+
+ //alphanum
+ if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9')) {
+ return true;
+ }
+
+ //reserved
+ //if (c == ';' || c == '/' || c == '?' || c == ':' || c == '@' || c == '&' || c == '=' || c == '+' || c == ',' || c == '$' ) {
+ // return true;
+ //}
+
+ //mark
+ if (c == '-' || c == '_' || c == '.' || c == '!' || c == '~' || c == '*' || c == '\'' || c == '(' || c == ')') {
+ return true;
+ }
+
+ return false;
+ }
+
+ private static final String escapeURIByte(int b) {
+ if (0x10 <= b) {
+ return "%" + Integer.toHexString(b);
+ } else {
+ return "%0" + Integer.toHexString(b);
+ }
+ }
+
+ public static String encodeURIQueryPart(String s) {
+ StringBuilder builder = new StringBuilder();
+
+ int start = 0;
+ int idx = 0;
+
+ int length = s.length();
+ CharsetEncoder encoder = null;
+ ByteBuffer byteBuffer = null;
+ CharBuffer buffer = null;
+
+ for (; idx < length; idx++) {
+ char c = s.charAt(idx);
+
+ if (!isLegalURIQueryChar(c)) {
+ builder.append(s.substring(start, idx));
+
+ if (encoder == null) {
+ encoder = Charset.forName("UTF-8").newEncoder();
+ }
+ if (buffer == null) {
+ buffer = CharBuffer.allocate(1);
+ byteBuffer = ByteBuffer.allocate(6); //max bytes size in UTF-8
+ } else {
+ byteBuffer.limit(6);
+ }
+
+ buffer.put(0, c);
+
+ buffer.rewind();
+ byteBuffer.rewind();
+ encoder.encode(buffer, byteBuffer, true);
+
+ byteBuffer.flip();
+
+ int limit = byteBuffer.limit();
+ for (int i = 0; i < limit; i++) {
+ int b = (0xFF & byteBuffer.get());
+ builder.append(escapeURIByte(b));
+ }
+
+ start = idx + 1;
+ }
+ }
+
+ builder.append(s.substring(start, idx));
+
+ return builder.toString();
+ }
}
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.Base2WayGradient.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.BaseGradient.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.CustomizeableGradient.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.GradientA.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.ButtonGradientImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.ButtonInverseGradientImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.HeaderGradientImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.HeaderInverseGradientImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.InputGradientImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.MenuGradientImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.MenuInverseGradientImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.TabGradientImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.gradientimages.TabInverseGradientImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.BaseControlBackgroundImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.ButtonBackgroundImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.GradientAlignment.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.GradientType.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.InputBackgroundImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.StandardButtonBgImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.renderkit.html.images.StandardButtonPressedBgImage.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.resource.AnimatedTestResource.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/main/resources/META-INF/org.richfaces.resource.TestResource2.resource.properties
===================================================================
Modified: root/core/trunk/impl/src/test/java/org/richfaces/resource/AbstractBaseResourceTest.java
===================================================================
--- root/core/trunk/impl/src/test/java/org/richfaces/resource/AbstractBaseResourceTest.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/test/java/org/richfaces/resource/AbstractBaseResourceTest.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -127,12 +127,15 @@
Object resourceState = new Object();
ResourceCodec resourceCodec = EasyMock.createMock(ResourceCodec.class);
- EasyMock.expect(resourceCodec.encodeResource(EasyMock.eq("org.richfaces.resource.MockStateAwareResource"),
- EasyMock.same(resourceState), EasyMock.eq("4_0_alpha"))).andReturn("Resource0/4_0_alpha/data");
- EasyMock.expect(resourceCodec.encodeResource(EasyMock.eq("org.richfaces.resource.MockStateAwareResource"),
- EasyMock.eq(null), EasyMock.eq("4_0_alpha"))).andReturn("Resource1/4_0_alpha");
- EasyMock.expect(resourceCodec.encodeResource(EasyMock.eq("org.richfaces.resource.MockResource"),
- EasyMock.eq(null), EasyMock.eq("4_0_alpha"))).andReturn("Resource2/4_0_alpha");
+ EasyMock.expect(resourceCodec.encodeResource(EasyMock.same(facesContext),
+ EasyMock.eq("org.richfaces.resource.MockStateAwareResource"),
+ EasyMock.same(resourceState), EasyMock.eq("4_0_alpha"))).andReturn("Resource0/4_0_alpha/data");
+ EasyMock.expect(resourceCodec.encodeResource(EasyMock.same(facesContext),
+ EasyMock.eq("org.richfaces.resource.MockStateAwareResource"),
+ EasyMock.eq(null), EasyMock.eq("4_0_alpha"))).andReturn("Resource1/4_0_alpha");
+ EasyMock.expect(resourceCodec.encodeResource(EasyMock.same(facesContext),
+ EasyMock.eq("org.richfaces.resource.MockResource"),
+ EasyMock.eq(null), EasyMock.eq("4_0_alpha"))).andReturn("Resource2/4_0_alpha");
EasyMock.replay(resourceCodec);
ResourceHandlerImpl.setResourceCodec(resourceCodec);
Modified: root/core/trunk/impl/src/test/java/org/richfaces/resource/CacheableResourceImpl.java
===================================================================
--- root/core/trunk/impl/src/test/java/org/richfaces/resource/CacheableResourceImpl.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/test/java/org/richfaces/resource/CacheableResourceImpl.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -38,6 +38,7 @@
* @author Nick Belaevski
* @since 4.0
*/
+@DynamicResource
public class CacheableResourceImpl extends AbstractBaseResource {
/*
Modified: root/core/trunk/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java
===================================================================
--- root/core/trunk/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -34,6 +34,7 @@
import java.util.TimeZone;
import javax.faces.application.ResourceHandler;
+import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletResponse;
import org.easymock.classextension.EasyMock;
@@ -219,16 +220,19 @@
ResourceCodec mockedCodec = EasyMock.createNiceMock(ResourceCodec.class);
- EasyMock.expect(mockedCodec.decodeResourceName(EasyMock.eq("StateHolderResource/DATA/1"))).andReturn(
- "org.richfaces.resource.StateHolderResourceImpl");
- EasyMock.expect(mockedCodec.decodeResourceData(EasyMock.eq("StateHolderResource/DATA/1"))).andReturn(
- "test text");
- EasyMock.expect(mockedCodec.decodeResourceVersion(EasyMock.eq("StateHolderResource/DATA/1"))).andReturn(null);
+ EasyMock.expect(mockedCodec.decodeResourceName(EasyMock.<FacesContext>notNull(),
+ EasyMock.eq("StateHolderResource"))).andReturn("org.richfaces.resource.StateHolderResourceImpl");
+ EasyMock.expect(mockedCodec.decodeResourceData(EasyMock.<FacesContext>notNull(),
+ EasyMock.eq("StateHolderResource"))).andReturn("test text");
+ EasyMock.expect(mockedCodec.decodeResourceVersion(EasyMock.<FacesContext>notNull(),
+ EasyMock.eq("StateHolderResource"))).andReturn(null);
+ EasyMock.expect(mockedCodec.getResourceKey(EasyMock.<FacesContext>notNull(),
+ EasyMock.eq("StateHolderResource"))).andReturn("StateHolderResource.jsf?do=1");
EasyMock.replay(mockedCodec);
ResourceHandlerImpl.setResourceCodec(mockedCodec);
WebRequestSettings settings =
- new WebRequestSettings(new URL("http://localhost/rfRes/StateHolderResource/DATA/1.jsf"));
+ new WebRequestSettings(new URL("http://localhost/rfRes/StateHolderResource.jsf?do=1"));
WebResponse resourceResponse = webClient.loadWebResponse(settings);
assertEquals(HttpServletResponse.SC_OK, resourceResponse.getStatusCode());
@@ -242,11 +246,11 @@
assertEquals(HttpServletResponse.SC_OK, resourceResponse.getStatusCode());
settings = new WebRequestSettings(
- new URL("http://localhost/rfRes/org.richfaces.resource.VersionedResourceImpl/VER1_..."));
+ new URL("http://localhost/rfRes/org.richfaces.resource.VersionedResourceImpl.jsf?v..."));
resourceResponse = webClient.loadWebResponse(settings);
assertEquals(HttpServletResponse.SC_OK, resourceResponse.getStatusCode());
settings = new WebRequestSettings(
- new URL("http://localhost/rfRes/org.richfaces.resource.VersionedResourceImpl/VER1_..."));
+ new URL("http://localhost/rfRes/org.richfaces.resource.VersionedResourceImpl.jsf?v..."));
resourceResponse = webClient.loadWebResponse(settings);
assertEquals(HttpServletResponse.SC_NOT_FOUND, resourceResponse.getStatusCode());
}
@@ -262,9 +266,9 @@
new WebRequestSettings(new URL(resourceName));
WebResponse resourceResponse = webClient.loadWebResponse(settings);
- assertEquals(HttpServletResponse.SC_OK, resourceResponse.getStatusCode());
+ assertEquals(resource, HttpServletResponse.SC_OK, resourceResponse.getStatusCode());
String expected = readFileAsString(getResourceExpectedOutputFileName(resource));
- assertEquals(expected.trim(), resourceResponse.getContentAsString().trim());
+ assertEquals(resource, expected.trim(), resourceResponse.getContentAsString().trim());
}
}
Modified: root/core/trunk/impl/src/test/java/org/richfaces/resource/StateHolderResourceImpl.java
===================================================================
--- root/core/trunk/impl/src/test/java/org/richfaces/resource/StateHolderResourceImpl.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/test/java/org/richfaces/resource/StateHolderResourceImpl.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -36,6 +36,7 @@
* @author Nick Belaevski
* @since 4.0
*/
+@DynamicResource
public class StateHolderResourceImpl extends AbstractBaseResource implements StateHolder {
private Object state = "";
Modified: root/core/trunk/impl/src/test/java/org/richfaces/resource/VersionedResourceImpl.java
===================================================================
--- root/core/trunk/impl/src/test/java/org/richfaces/resource/VersionedResourceImpl.java 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/test/java/org/richfaces/resource/VersionedResourceImpl.java 2010-05-20 00:10:53 UTC (rev 17151)
@@ -27,6 +27,7 @@
* @author Nick Belaevski
* @since 4.0
*/
+@DynamicResource
public class VersionedResourceImpl extends EmptyStreamResource {
@Override
public String getVersion() {
Deleted: root/core/trunk/impl/src/test/resources/META-INF/org.richfaces.resource.CacheableResourceImpl.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/test/resources/META-INF/org.richfaces.resource.NonCacheableResourceImpl.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/test/resources/META-INF/org.richfaces.resource.StateHolderResourceImpl.resource.properties
===================================================================
Deleted: root/core/trunk/impl/src/test/resources/META-INF/org.richfaces.resource.VersionedResourceImpl.resource.properties
===================================================================
Modified: root/core/trunk/impl/src/test/resources/resources/full.css
===================================================================
--- root/core/trunk/impl/src/test/resources/resources/full.css 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/test/resources/resources/full.css 2010-05-20 00:10:53 UTC (rev 17151)
@@ -22,5 +22,5 @@
padding: 10px !important;
border: 1px solid green;
background-image: url(image.png);
- background: red url(/rfRes/org.richfaces.renderkit.html.images.ButtonBackgroundImage/DATB/eAF79urt!-Pnr!xn4mZgYAAAREsHMw__.jsf);
+ background: red url(/rfRes/org.richfaces.renderkit.html.images.ButtonBackgroundImage.jsf?db=eAF79urt!-Pnr!xn4mZgYAAAREsHMw__);
}
Modified: root/core/trunk/impl/src/test/resources/resources/importedEL.css
===================================================================
--- root/core/trunk/impl/src/test/resources/resources/importedEL.css 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/test/resources/resources/importedEL.css 2010-05-20 00:10:53 UTC (rev 17151)
@@ -22,5 +22,5 @@
padding: 10px !important;
border: 1px solid green;
background-image: url(image.png);
- background: red url(/rfRes/org.richfaces.renderkit.html.images.ButtonBackgroundImage/DATB/eAF79urt!-Pnr!xn4mZgYAAAREsHMw__.jsf);
+ background: red url(/rfRes/org.richfaces.renderkit.html.images.ButtonBackgroundImage.jsf?db=eAF79urt!-Pnr!xn4mZgYAAAREsHMw__);
}
\ No newline at end of file
Modified: root/core/trunk/impl/src/test/resources/resources/resource.css
===================================================================
--- root/core/trunk/impl/src/test/resources/resources/resource.css 2010-05-19 23:16:19 UTC (rev 17150)
+++ root/core/trunk/impl/src/test/resources/resources/resource.css 2010-05-20 00:10:53 UTC (rev 17151)
@@ -1,3 +1,3 @@
body {
- background: red url(/rfRes/org.richfaces.renderkit.html.images.ButtonBackgroundImage/DATB/eAF79urt!-Pnr!xn4mZgYAAAREsHMw__.jsf);
+ background: red url(/rfRes/org.richfaces.renderkit.html.images.ButtonBackgroundImage.jsf?db=eAF79urt!-Pnr!xn4mZgYAAAREsHMw__);
}
\ No newline at end of file
14 years, 1 month
JBoss Rich Faces SVN: r17150 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-05-19 19:16:19 -0400 (Wed, 19 May 2010)
New Revision: 17150
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FunctionAdapter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FunctionBean.java
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java
Log:
OPEN - issue RF-8363: Functions support
https://jira.jboss.org/browse/RF-8363
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java 2010-05-19 23:04:01 UTC (rev 17149)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java 2010-05-19 23:16:19 UTC (rev 17150)
@@ -242,6 +242,7 @@
* @return the functions
*/
@XmlElement(name = "function", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ @XmlJavaTypeAdapter(FunctionAdapter.class)
public List<FunctionModel> getFunctions() {
return this.functions;
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FunctionAdapter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FunctionAdapter.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FunctionAdapter.java 2010-05-19 23:16:19 UTC (rev 17150)
@@ -0,0 +1,45 @@
+/*
+ * $Id: FunctionAdapter.java 16722 2010-04-06 00:29:33Z alexsmirnov $
+ *
+ * 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.xmlconfig.model;
+
+import org.richfaces.cdk.model.FunctionModel;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class FunctionAdapter extends AdapterBase<FunctionBean, FunctionModel> {
+
+ @Override
+ protected Class<? extends FunctionBean> getBeanClass(FunctionModel prop) {
+ return FunctionBean.class;
+ }
+
+ @Override
+ protected Class<? extends FunctionModel> getModelClass(FunctionBean bean) {
+ return FunctionModel.class;
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FunctionAdapter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FunctionBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FunctionBean.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FunctionBean.java 2010-05-19 23:16:19 UTC (rev 17150)
@@ -0,0 +1,87 @@
+package org.richfaces.cdk.xmlconfig.model;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.ComponentLibrary;
+
+@XmlType(name = "functionType", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+public class FunctionBean extends DescriptionGroupBean {
+
+ private String name;
+
+ private String signature;
+
+ private TagType type;
+
+ private ClassName functionClass;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the name
+ */
+ @XmlElement(name = "function-name", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public String getName() {
+ return this.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 signature
+ */
+ @XmlElement(name = "function-signature", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public String getSignature() {
+ return this.signature;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param signature the signature to set
+ */
+ public void setSignature(String signature) {
+ this.signature = signature;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the type
+ */
+ public TagType getType() {
+ return this.type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param type the type to set
+ */
+ public void setType(TagType type) {
+ this.type = type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the functionClass
+ */
+ @XmlElement(name = "function-class", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public ClassName getFunctionClass() {
+ return this.functionClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param functionClass the functionClass to set
+ */
+ public void setFunctionClass(ClassName functionClass) {
+ this.functionClass = functionClass;
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FunctionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 1 month
JBoss Rich Faces SVN: r17149 - in root/cdk/trunk/plugins: generator/src/main/java/org/richfaces/cdk/apt and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-05-19 19:04:01 -0400 (Wed, 19 May 2010)
New Revision: 17149
Added:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Function.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/FunctionProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FunctionModel.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/functions/
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/functions/TestFunctions.java
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagLibrary.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/TagLibProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EmptyVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Taglib.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java
Log:
DONE - issue RF-8363: Functions support
https://jira.jboss.org/browse/RF-8363
Added: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Function.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Function.java (rev 0)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Function.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -0,0 +1,53 @@
+/*
+ * $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.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <p class="changed_added_4_0">This annotation defines static method or all public static methods in the annotated class as EL functions.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)Retention(RetentionPolicy.CLASS)
+@Target( { ElementType.METHOD })
+public @interface Function {
+
+ public Description description() default @Description();
+
+ /**
+ * <p class="changed_added_4_0">Function n</p>
+ * @return
+ */
+ public String name() default "";
+
+ /**
+ * <p class="changed_added_4_0">Tag library for include given function</p>
+ * @return
+ */
+ public TagType type() default TagType.Facelets;
+}
Property changes on: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Function.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagLibrary.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagLibrary.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagLibrary.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -45,6 +45,19 @@
public String uri();
/**
+ * <p class="changed_added_4_0">Library short name ( default prefix )</p>
+ * @return
+ */
+ public String shortName();
+
+
+ /**
+ * <p class="changed_added_4_0">Default preffix for package names and JSF ids in the library</p>
+ * @return
+ */
+ public String preffix() default "";
+
+ /**
* <p class="changed_added_4_0">Implementation version of the generated taglib.</p>
* @return
*/
@@ -75,12 +88,6 @@
public String jspVersion() default "2.0";
- /**
- * <p class="changed_added_4_0">Library short name ( default prefix )</p>
- * @return
- */
- public String shortName();
-
public static final class NONE {}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -35,6 +35,7 @@
import org.richfaces.cdk.apt.processors.ConverterProcessor;
import org.richfaces.cdk.apt.processors.DescriptionProcessor;
import org.richfaces.cdk.apt.processors.DescriptionProcessorImpl;
+import org.richfaces.cdk.apt.processors.FunctionProcessor;
import org.richfaces.cdk.apt.processors.RendererProcessor;
import org.richfaces.cdk.apt.processors.TagLibProcessor;
import org.richfaces.cdk.apt.processors.ValidatorProcessor;
@@ -61,6 +62,7 @@
setBinder.addBinding().to(ConverterProcessor.class);
setBinder.addBinding().to(ValidatorProcessor.class);
setBinder.addBinding().to(TagLibProcessor.class);
+ setBinder.addBinding().to(FunctionProcessor.class);
bind(Processor.class).to(CdkProcessor.class);
bind(AttributesProcessor.class).to(AttributesProcessorImpl.class);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -41,6 +41,9 @@
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic.Kind;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
import java.util.Collections;
import java.util.Set;
@@ -94,12 +97,15 @@
}
// parse non-java sources
for (ModelBuilder builder : builders) {
+ log.debug("Run builder "+builder.getClass().getName());
builder.build();
}
// validator should be called even if previvous phases finish with errors, to collect all possible problems.
+ log.debug("Validate model");
validator.verify(library);
} else if (0 == log.getErrorCount()) {
// processing over, generate files.
+ log.debug("Generate output files");
builder.generate();
}
@@ -107,25 +113,72 @@
}
protected void processAnnotation(CdkAnnotationProcessor processor, RoundEnvironment environment) {
+ Class<? extends Annotation> processedAnnotation = processor.getProcessedAnnotation();
+ log.debug("Process all elements annotated with "+processedAnnotation.getName());
+ Target target = processedAnnotation.getAnnotation(Target.class);
try {
Set<? extends Element> rootElements = environment.getRootElements();
for (Element element : rootElements) {
- if ((ElementKind.CLASS.equals(element.getKind()) || ElementKind.PACKAGE.equals(element.getKind()))
- && null != element.getAnnotation(processor.getProcessedAnnotation())){
- try {
- processor.process(element, library);
- } catch (CdkProcessingException e) {
- sendError(element, e);
+ if (isAppropriateTarget(element, target)){
+ processElement(processor, processedAnnotation, element);
+ } else {
+ for (Element enclosedElement : element.getEnclosedElements()) {
+ if (isAppropriateTarget(enclosedElement, target)){
+ processElement(processor, processedAnnotation, enclosedElement);
+ }
}
}
}
} catch (Exception e) {
processingEnv.getMessager().printMessage(Kind.ERROR,
- "Errorr processing annotation " + processor.getProcessedAnnotation() + ": " + e);
- e.printStackTrace();
+ "Errorr processing annotation " + processedAnnotation + ": " + e);
}
}
+ private void processElement(CdkAnnotationProcessor processor, Class<? extends Annotation> processedAnnotation,
+ Element element) {
+ if (null != element.getAnnotation(processedAnnotation)) {
+ try {
+ log.debug("Process "+element.getSimpleName()+" annotated with "+processedAnnotation.getName());
+ processor.process(element, library);
+ } catch (CdkProcessingException e) {
+ sendError(element, e);
+ }
+ }
+ }
+
+ private boolean isAppropriateTarget(Element element,Target target){
+ boolean match = false;
+ ElementKind kind = element.getKind();
+ if(null != target){
+ for(ElementType targetType : target.value()){
+ switch (targetType) {
+ case TYPE:
+ match |= ElementKind.CLASS.equals(kind)||ElementKind.INTERFACE.equals(kind)||ElementKind.ENUM.equals(kind);
+ break;
+ case PACKAGE:
+ match |= ElementKind.PACKAGE.equals(kind);
+ break;
+ case METHOD:
+ match |= ElementKind.METHOD.equals(kind);
+ break;
+ case FIELD:
+ match |= ElementKind.FIELD.equals(kind);
+ break;
+ default:
+ break;
+ }
+ }
+ } else {
+ // Annotation without @Target match any element.
+ match =
+ ElementKind.CLASS.equals(kind) || ElementKind.INTERFACE.equals(kind) || ElementKind.ENUM.equals(kind)
+ || ElementKind.PACKAGE.equals(kind) || ElementKind.METHOD.equals(kind)
+ || ElementKind.FIELD.equals(kind);
+ }
+ return match;
+ }
+
protected void sendError(Element componentElement, CdkProcessingException e) {
// rise error and continue.
processingEnv.getMessager().printMessage(javax.tools.Diagnostic.Kind.ERROR, e.getMessage(), componentElement);
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/FunctionProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/FunctionProcessor.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/FunctionProcessor.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -0,0 +1,114 @@
+/*
+ * $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.apt.processors;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
+
+import org.richfaces.cdk.CdkProcessingException;
+import org.richfaces.cdk.annotations.Function;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.FunctionModel;
+import org.richfaces.cdk.util.Strings;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class FunctionProcessor extends ProcessorBase implements CdkAnnotationProcessor {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.apt.processors.CdkAnnotationProcessor#getProcessedAnnotation()
+ */
+ @Override
+ public Class<? extends Annotation> getProcessedAnnotation() {
+ return Function.class;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.cdk.apt.processors.CdkAnnotationProcessor#process(javax.lang.model.element.Element, org.richfaces.cdk.model.ComponentLibrary)
+ */
+ @Override
+ public void process(Element element, ComponentLibrary library) throws CdkProcessingException {
+ switch (element.getKind()) {
+ case METHOD:
+ ExecutableElement methodElement = (ExecutableElement) element;
+ // Only public static methods can be registered as functions.
+ // TODO - move to validator.
+ Set<Modifier> modifiers = methodElement.getModifiers();
+ if(!modifiers.contains(Modifier.PUBLIC)){
+ throw new CdkProcessingException("Only public method can be registered as EL function "+methodElement.getSimpleName());
+ }
+ if(!modifiers.contains(Modifier.STATIC)){
+ throw new CdkProcessingException("Only static method can be registered as EL function "+methodElement.getSimpleName());
+ }
+ Function function = methodElement.getAnnotation(Function.class);
+ FunctionModel model = new FunctionModel();
+ if(!Strings.isEmpty(function.name())){
+ model.setName(function.name());
+ } else {
+ model.setName(methodElement.getSimpleName().toString());
+ }
+ model.setType(function.type());
+ setDescription(model, function.description(), getDocComment(methodElement));
+ // Calculate method signature
+ StringBuilder signature = new StringBuilder();
+ signature.append(methodElement.getReturnType()).append(" ");
+ signature.append(methodElement.getSimpleName()).append("(");
+ boolean first = true;
+ for(VariableElement parameter :methodElement.getParameters()){
+ if(!first){
+ signature.append(",");
+ }
+ signature.append(parameter.asType());
+ first = false;
+ }
+ signature.append(")");
+ model.setSignature(signature.toString());
+ Element declaringClass = methodElement.getEnclosingElement();
+ if(ElementKind.CLASS.equals(declaringClass.getKind())){
+ model.setFunctionClass(ClassName.parseName(((TypeElement)declaringClass).getQualifiedName().toString()));
+ }
+ library.getFunctions().add(model);
+ break;
+ case CLASS:
+ // TODO - process all public static methods in the class.
+ break;
+
+ default:
+ break;
+ }
+
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/FunctionProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/TagLibProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/TagLibProcessor.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/TagLibProcessor.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -26,6 +26,7 @@
import java.lang.annotation.Annotation;
import javax.lang.model.element.Element;
+import javax.lang.model.element.PackageElement;
import org.richfaces.cdk.CdkProcessingException;
import org.richfaces.cdk.annotations.TagLibrary;
@@ -54,7 +55,10 @@
@Override
public void process(Element element, ComponentLibrary library) throws CdkProcessingException {
TagLibrary tagLibrary = element.getAnnotation(TagLibrary.class);
- Taglib taglibModel = new Taglib();
+ Taglib taglibModel = library.getTaglib();
+ if(null == taglibModel){
+ taglibModel = new Taglib();
+ }
taglibModel.setUri(tagLibrary.uri());
String shortName = tagLibrary.shortName();
if(!Strings.isEmpty(shortName)){
@@ -68,6 +72,18 @@
if(!Strings.isEmpty(tlibVersion)){
taglibModel.setTlibVersion(tlibVersion);
}
+ // Default prefix for library
+ String preffix = tagLibrary.preffix();
+ if(!Strings.isEmpty(preffix)){
+ library.setPrefix(preffix);
+ } else if (Strings.isEmpty(library.getPrefix())) {
+ // record package name to use in NamingConventions
+ PackageElement packageElement = (PackageElement) element;
+ preffix = packageElement.getQualifiedName().toString();
+ if(!Strings.isEmpty(preffix)){
+ library.setPrefix(preffix);
+ }
+ }
library.setTaglib(taglibModel);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -31,7 +31,9 @@
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.ConverterModel;
+import org.richfaces.cdk.model.DescriptionGroup;
import org.richfaces.cdk.model.EmptyVisitor;
+import org.richfaces.cdk.model.FunctionModel;
import org.richfaces.cdk.model.ListenerModel;
import org.richfaces.cdk.model.ModelElement;
import org.richfaces.cdk.model.PropertyBase;
@@ -40,6 +42,7 @@
import org.richfaces.cdk.model.TagModel;
import org.richfaces.cdk.model.ValidatorModel;
import org.richfaces.cdk.model.RendererModel.Type;
+import org.richfaces.cdk.util.Strings;
import java.util.List;
@@ -256,7 +259,41 @@
return null;
}
+
+ @Override
+ public void visitFunction(FunctionModel model) {
+ if(TagType.Facelets.equals(model.getType())||TagType.All.equals(model.getType())){
+ Element functionElement = faceletTaglib.addElement("function");
+ addDescription(functionElement, model);
+ functionElement.addElement("function-name").addText(model.getName());
+ functionElement.addElement("function-class").addText(model.getFunctionClass().toString());
+ functionElement.addElement("function-signature").addText(model.getSignature());
+ }
+ }
+ /**
+ * <p class="changed_added_4_0">Add common description elements.</p>
+ * @param parant
+ * @param model
+ */
+ private void addDescription(Element parent, DescriptionGroup model){
+ if(!Strings.isEmpty(model.getDescription())){
+ parent.addElement("description").addText(model.getDescription());
+ }
+ if(!Strings.isEmpty(model.getDisplayname())){
+ parent.addElement("display-name").addText(model.getDisplayname());
+ }
+ if(null != model.getIcon()){
+ Element iconElement = parent.addElement("icon");
+ if(!Strings.isEmpty(model.getIcon().getSmallIcon())){
+ iconElement.addElement("small-icon").addText(model.getIcon().getSmallIcon());
+ }
+ if(!Strings.isEmpty(model.getIcon().getLargeIcon())){
+ iconElement.addElement("large-icon").addText(model.getIcon().getLargeIcon());
+ }
+
+ }
+ }
public void visitListener(ListenerModel model) {
// TODO
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -74,6 +74,8 @@
private final ModelCollection<ListenerModel> listeners = ModelCollection.<ListenerModel> create();
+ private final ModelCollection<FunctionModel> functions = ModelCollection.<FunctionModel> create();
+
private long lastModified = Long.MIN_VALUE;
/**
@@ -111,6 +113,7 @@
listeners.accept(visitor);
events.accept(visitor);
behaviors.accept(visitor);
+ functions.accept(visitor);
}
/**
@@ -279,6 +282,14 @@
}
/**
+ * <p class="changed_added_4_0"></p>
+ * @return the functions
+ */
+ public ModelCollection<FunctionModel> getFunctions() {
+ return this.functions;
+ }
+
+ /**
* <p class="changed_added_4_0">
* </p>
*
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EmptyVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EmptyVisitor.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EmptyVisitor.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -76,7 +76,13 @@
public void visitListener(ListenerModel model) {
// Do nothing.
}
+
+ @Override
+ public void visitFunction(FunctionModel model) {
+ // Do nothing
+ }
+ @SuppressWarnings("unchecked")
public void visit(ModelElement model) {
// Do nothing.
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FunctionModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FunctionModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FunctionModel.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -0,0 +1,158 @@
+/*
+ * $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.model;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.cdk.util.ComparatorUtils;
+
+/**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@XmlType(name = "function-configType", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+public class FunctionModel extends DescriptionGroupBase implements Named, ModelElement<FunctionModel> {
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ */
+ private static final long serialVersionUID = -358069932548425030L;
+
+ private String name;
+
+ private String signature;
+
+ private TagType type;
+
+ private ClassName functionClass;
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the name
+ */
+ @Merge
+ public String getName() {
+ return this.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 signature
+ */
+ @Merge
+ public String getSignature() {
+ return this.signature;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param signature
+ * the signature to set
+ */
+ public void setSignature(String signature) {
+ this.signature = signature;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the type
+ */
+ @Merge
+ public TagType getType() {
+ return this.type;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param type
+ * the type to set
+ */
+ public void setType(TagType type) {
+ this.type = type;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the functionClass
+ */
+ @Merge
+ public ClassName getFunctionClass() {
+ return this.functionClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param functionClass
+ * the functionClass to set
+ */
+ public void setFunctionClass(ClassName functionClass) {
+ this.functionClass = functionClass;
+ }
+
+ @Override
+ public void merge(FunctionModel other) {
+ ComponentLibrary.merge(this, other);
+ }
+
+ @Override
+ public boolean same(FunctionModel other) {
+ return ComparatorUtils.nullSafeEquals(getName(), other.getName());
+ }
+
+ @Override
+ public void accept(Visitor visitor) {
+ visitor.visitFunction(this);
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FunctionModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Taglib.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Taglib.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Taglib.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -35,7 +35,7 @@
* @author asmirnov
*
*/
-@XmlType(name = "taflib-configType", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+@XmlType(name = "taglib-configType", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
public class Taglib {
private String tlibVersion = null;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitor.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitor.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -50,6 +50,8 @@
void visitRender(RendererModel model);
void visitListener(ListenerModel model);
+
+ void visitFunction(FunctionModel model);
void visit(ModelElement model);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -38,6 +38,7 @@
import org.richfaces.cdk.model.ConverterModel;
import org.richfaces.cdk.model.EventModel;
import org.richfaces.cdk.model.Extensible;
+import org.richfaces.cdk.model.FunctionModel;
import org.richfaces.cdk.model.RenderKitModel;
import org.richfaces.cdk.model.Taglib;
import org.richfaces.cdk.model.ValidatorModel;
@@ -200,6 +201,8 @@
private Taglib taglib;
private List<EventModel> events = Lists.newArrayList();
+
+ private List<FunctionModel> functions = Lists.newArrayList();
@XmlElement(name = "faces-event", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
@XmlJavaTypeAdapter(EventAdapter.class)
@@ -233,5 +236,22 @@
public Taglib getTaglib() {
return taglib;
}
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the functions
+ */
+ @XmlElement(name = "function", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public List<FunctionModel> getFunctions() {
+ return this.functions;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param functions the functions to set
+ */
+ public void setFunctions(List<FunctionModel> functions) {
+ this.functions = functions;
+ }
}
}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java 2010-05-19 20:30:27 UTC (rev 17148)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -127,6 +127,7 @@
expect(element.getKind()).andReturn(ElementKind.CLASS);
TestAnnotation2 testAnnotation2 = createNiceMock(TestAnnotation2.class);
expect(element.getAnnotation(TestAnnotation2.class)).andReturn(testAnnotation2);
+ expect(element.getSimpleName()).andStubReturn(new TestName("foo"));
cdkProcessor.process(element, library);
expectLastCall();
validator.verify(library);
@@ -140,6 +141,7 @@
public void testProcessOver() throws Exception {
expect(roundEnv.processingOver()).andReturn(true);
expect(log.getErrorCount()).andReturn(0);
+ log.debug((CharSequence) anyObject());expectLastCall().asStub();
builder.generate();
expectLastCall();
replay(log, element, roundEnv, builder, validator, cdkProcessor);
Added: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/functions/TestFunctions.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/functions/TestFunctions.java (rev 0)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/functions/TestFunctions.java 2010-05-19 23:04:01 UTC (rev 17149)
@@ -0,0 +1,65 @@
+/*
+ * $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.test.functions;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.richfaces.cdk.annotations.Description;
+import org.richfaces.cdk.annotations.Function;
+import org.richfaces.cdk.annotations.TagType;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class TestFunctions {
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param param
+ * @return
+ */
+ @Function
+ public static boolean testBoolean(String param){
+ return false;
+ }
+
+ @Function(description=@Description(displayName="test string",value="Long, long description"))
+ public static String testString(List<String> param, char delim){
+ return null;
+ }
+
+ @Function(name="test")
+ public static Collection<Integer> testCollection(String param,String...strings ){
+ return null;
+ }
+
+ @Function(type=TagType.Jsp)
+ public static boolean testJSPBoolean(String param){
+ return false;
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/functions/TestFunctions.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 1 month
JBoss Rich Faces SVN: r17148 - in root: commons/trunk/parent and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-19 16:30:27 -0400 (Wed, 19 May 2010)
New Revision: 17148
Modified:
root/cdk/trunk/parent/pom.xml
root/commons/trunk/parent/pom.xml
root/core/trunk/parent/pom.xml
Log:
Updated based on richfaces-checkstyle release
Modified: root/cdk/trunk/parent/pom.xml
===================================================================
--- root/cdk/trunk/parent/pom.xml 2010-05-19 20:10:18 UTC (rev 17147)
+++ root/cdk/trunk/parent/pom.xml 2010-05-19 20:30:27 UTC (rev 17148)
@@ -22,6 +22,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
</properties>
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/cdk/trunk/root</connection>
@@ -122,7 +123,7 @@
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-build-checkstyle</artifactId>
- <version>${project.version}</version>
+ <version>${richfaces.checkstyle.version}</version>
</dependency>
</dependencies>
<executions>
Modified: root/commons/trunk/parent/pom.xml
===================================================================
--- root/commons/trunk/parent/pom.xml 2010-05-19 20:10:18 UTC (rev 17147)
+++ root/commons/trunk/parent/pom.xml 2010-05-19 20:30:27 UTC (rev 17148)
@@ -37,7 +37,7 @@
<properties>
<richfaces.commons.version>4.0.0-SNAPSHOT</richfaces.commons.version>
- <richfaces.checkstyle.version>4.0.0-SNAPSHOT</richfaces.checkstyle.version>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
</properties>
<dependencyManagement>
Modified: root/core/trunk/parent/pom.xml
===================================================================
--- root/core/trunk/parent/pom.xml 2010-05-19 20:10:18 UTC (rev 17147)
+++ root/core/trunk/parent/pom.xml 2010-05-19 20:30:27 UTC (rev 17148)
@@ -39,7 +39,7 @@
<properties>
<richfaces.core.version>4.0.0-SNAPSHOT</richfaces.core.version>
- <richfaces.checkstyle.version>4.0.0-SNAPSHOT</richfaces.checkstyle.version>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
</properties>
<dependencyManagement>
14 years, 1 month
JBoss Rich Faces SVN: r17147 - root/build/resources/trunk/checkstyle.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-19 16:10:18 -0400 (Wed, 19 May 2010)
New Revision: 17147
Modified:
root/build/resources/trunk/checkstyle/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: root/build/resources/trunk/checkstyle/pom.xml
===================================================================
--- root/build/resources/trunk/checkstyle/pom.xml 2010-05-19 20:10:12 UTC (rev 17146)
+++ root/build/resources/trunk/checkstyle/pom.xml 2010-05-19 20:10:18 UTC (rev 17147)
@@ -16,7 +16,7 @@
Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
-<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">
+<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.richfaces</groupId>
@@ -26,7 +26,7 @@
<groupId>org.richfaces</groupId>
<artifactId>richfaces-build-checkstyle</artifactId>
- <version>1</version>
+ <version>2-SNAPSHOT</version>
<name>Richfaces Checkstyle</name>
<description>Contains the checkstyle settings for the RichFaces project</description>
@@ -46,9 +46,9 @@
<!-- SCM and distribution management -->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/build/resources/tag...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/build/resources/tags/r...</developerConnection>
- <url>scm:svn:https://svn.jboss.org/repos/richfaces/root/build/resources/tags/r...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/build/resources/tru...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/build/resources/trunk/...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
14 years, 1 month