JBoss Rich Faces SVN: r16804 - root/cdk/trunk/plugins/generator.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-04-23 19:54:29 -0400 (Fri, 23 Apr 2010)
New Revision: 16804
Modified:
root/cdk/trunk/plugins/generator/pom.xml
Log:
CODING IN PROGRESS - issue RF-7750: Create a Bill Of Materials for CDK
https://jira.jboss.org/jira/browse/RF-7750
Modified: root/cdk/trunk/plugins/generator/pom.xml
===================================================================
--- root/cdk/trunk/plugins/generator/pom.xml 2010-04-23 17:35:13 UTC (rev 16803)
+++ root/cdk/trunk/plugins/generator/pom.xml 2010-04-23 23:54:29 UTC (rev 16804)
@@ -6,6 +6,7 @@
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-plugins</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.cdk</groupId>
@@ -13,21 +14,7 @@
<version>4.0.0-SNAPSHOT</version>
<name>Java Server Faces component generator</name>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>com.sun.xsom</groupId>
- <artifactId>xsom</artifactId>
- <version>20081112</version>
- </dependency>
- <dependency>
- <groupId>com.google.collections</groupId>
- <artifactId>google-collections</artifactId>
- <version>1.0</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
+
<build>
<plugins>
<plugin>
@@ -36,18 +23,10 @@
<!--<configuration>-->
<!--<mainClass>mypackage.boot.camel.CamelStartup</mainClass>-->
<!--</configuration>-->
- <dependencies>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-guice</artifactId>
- <version>2.2.0</version>
- </dependency>
- </dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
- <version>1.0</version>
<executions>
<execution>
<phase>generate-resources</phase>
@@ -74,23 +53,8 @@
</configuration>
</execution>
</executions>
- <dependencies>
- <dependency>
- <groupId>org.codehaus.groovy.maven.runtime</groupId>
- <artifactId>gmaven-runtime-1.6</artifactId>
- <version>1.0</version>
- </dependency>
- </dependencies>
</plugin>
<plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
@@ -123,81 +87,59 @@
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-guice</artifactId>
- <version>2.2.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.7</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
- <scope>test</scope>
- <version>1.3</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
- <version>2.3.9</version>
</dependency>
<dependency>
<groupId>org.richfaces.cdk</groupId>
<artifactId>annotations</artifactId>
- <version>4.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.cdk</groupId>
<artifactId>attributes</artifactId>
- <version>4.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.cdk</groupId>
<artifactId>xinclude</artifactId>
- <version>4.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
- <version>2.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
- <version>2.2</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>2.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
- <version>2.1</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
- <version>1.2</version>
</dependency>
<dependency>
<groupId>org.jboss.el</groupId>
<artifactId>jboss-el</artifactId>
- <version>1.0_02.CR4</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
- <version>2.9.1</version>
- <exclusions>
- <exclusion>
- <artifactId>xml-apis</artifactId>
- <groupId>xml-apis</groupId>
- </exclusion>
- </exclusions>
</dependency>
<!--
<dependency> <groupId>com.google.collections</groupId>
@@ -209,7 +151,6 @@
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
- <version>2.5.2</version>
</dependency>
<dependency>
<groupId>com.google.collections</groupId>
@@ -222,23 +163,14 @@
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
- <version>1.6.1</version>
- <exclusions>
- <exclusion>
- <artifactId>xml-apis</artifactId>
- <groupId>xml-apis</groupId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
- <version>2.0.9</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
- <version>2.0.9</version>
</dependency>
<!-- <dependency>
<groupId>com.google.code.guice</groupId>
@@ -254,22 +186,18 @@
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
- <version>2.0</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
- <version>2.0</version>
</dependency>
<!-- <dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-grapher</artifactId>
- <version>2.0</version>
</dependency>-->
<!-- <dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assisted-inject</artifactId>
- <version>2.0</version>
</dependency>-->
</dependencies>
</project>
\ No newline at end of file
14 years
JBoss Rich Faces SVN: r16803 - root/framework/trunk/impl/src/test/resources/javascript.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-04-23 13:35:13 -0400 (Fri, 23 Apr 2010)
New Revision: 16803
Modified:
root/framework/trunk/impl/src/test/resources/javascript/jquery-position-qunit.js
root/framework/trunk/impl/src/test/resources/javascript/richfaces-qunit.js
Log:
jquery position plugin qunits refactoring
Modified: root/framework/trunk/impl/src/test/resources/javascript/jquery-position-qunit.js
===================================================================
--- root/framework/trunk/impl/src/test/resources/javascript/jquery-position-qunit.js 2010-04-23 17:33:25 UTC (rev 16802)
+++ root/framework/trunk/impl/src/test/resources/javascript/jquery-position-qunit.js 2010-04-23 17:35:13 UTC (rev 16803)
@@ -3,25 +3,6 @@
var body = document.getElementsByTagName("body")[0];
- function appendDomElements(parent, html) {
- var element = document.createElement("div");
- element.innerHTML = html;
- var elements = [], e;
- while (e = element.firstChild) {
- elements.push(e);
- parent.appendChild(e);
- }
- return elements;
- }
-
- function removeDomElements(elements) {
- var element;
- while (elements.length>0) {
- element = elements.pop();
- element.parentNode.removeChild(element);
- }
- }
-
function testPositioning(element, left, top, comment) {
equals(element.style.left, left+"px", comment);
equals(element.style.top, top+"px", comment);
@@ -42,7 +23,7 @@
try {
- var elements = appendDomElements(body, '<div style="position:absolute; width:200px; height:200px; background-color:red" id="testElement">some text</div><div style="width:300px; height:300px; background-color:blue" id="testElement1">some text</div>');
+ var elements = RichFaces.QUnit.appendDomElements(body, '<div style="position:absolute; width:200px; height:200px; background-color:red" id="testElement">some text</div><div style="width:300px; height:300px; background-color:blue" id="testElement1">some text</div>');
var e = document.getElementById("testElement");
var e1 = jQuery("#testElement1");
@@ -72,7 +53,7 @@
e.style.left=e.style.top="0px";
} finally {
- removeDomElements(elements);
+ RichFaces.QUnit.removeDomElements(elements);
}
});
@@ -87,7 +68,7 @@
try {
- var elements = appendDomElements(body,
+ var elements = RichFaces.QUnit.appendDomElements(body,
'<form>'+
'<table id="parent" width="100%" cellspacing="0" cellpadding="10" border="1" style="position: relative;">'+
'<tbody>'+
@@ -113,7 +94,7 @@
testPositioning1(e, 300-Math.floor(offset.left), 300-Math.floor(offset.top), 300,300);
} finally {
- removeDomElements(elements);
+ RichFaces.QUnit.removeDomElements(elements);
}
});
@@ -126,7 +107,7 @@
try {
- var elements = appendDomElements(body,
+ var elements = RichFaces.QUnit.appendDomElements(body,
'<div style="height:350px;overflow-x:hidden;overflow-y:auto;width:300px">'+
'<div style="height:200px"></div>'+
'<table style="position:absolute; background-color:red" id="testElement">'+
@@ -147,7 +128,7 @@
testPositioning(e,500,500);
} finally {
- removeDomElements(elements);
+ RichFaces.QUnit.removeDomElements(elements);
}
});
@@ -156,7 +137,7 @@
expect(4);
try {
- var elements = appendDomElements(body,
+ var elements = RichFaces.QUnit.appendDomElements(body,
'<table width="400" align="center">'+
'<tr>'+
'<td>'+
@@ -174,7 +155,7 @@
testPositioning(e,300,300);
} finally {
- removeDomElements(elements);
+ RichFaces.QUnit.removeDomElements(elements);
}
});
@@ -183,7 +164,7 @@
expect(8);
try {
- var elements = appendDomElements(body,
+ var elements = RichFaces.QUnit.appendDomElements(body,
'<div style="position:absolute; top: 0px; bottom: 0px; left: 0px; right: 0px; overflow: auto;">'+
'<table style="position:absolute; background-color:red" id="testElement">'+
'<tr>'+
@@ -202,7 +183,7 @@
testPositioning(e,500,500);
} finally {
- removeDomElements(elements);
+ RichFaces.QUnit.removeDomElements(elements);
}
});
@@ -211,7 +192,7 @@
expect(8);
try {
- var elements = appendDomElements(body,
+ var elements = RichFaces.QUnit.appendDomElements(body,
'<div style="position:absolute; top: 0px; bottom: 0px; left: 0px; right: 0px; overflow: auto;">'+
'<div>'+
'<table style="position:absolute; background-color:red" id="testElement">'+
@@ -232,7 +213,7 @@
testPositioning(e,500,500);
} finally {
- removeDomElements(elements);
+ RichFaces.QUnit.removeDomElements(elements);
}
});
@@ -242,7 +223,7 @@
try {
- var elements = appendDomElements(body,
+ var elements = RichFaces.QUnit.appendDomElements(body,
'<div style="position:absolute; width:400px; top: 200px; left: 200px;">'+
'<table style="position:absolute; background-color:red" id="testElement">'+
'<tr>'+
@@ -261,7 +242,7 @@
testPositioning1(e,300,300,500,500);
} finally {
- removeDomElements(elements);
+ RichFaces.QUnit.removeDomElements(elements);
}
});
@@ -271,7 +252,7 @@
try {
- var elements = appendDomElements(body,
+ var elements = RichFaces.QUnit.appendDomElements(body,
'<div style="position:absolute; width:400px; top: 200px; left: 200px;">'+
'<div>'+
'<table style="position:absolute; background-color:red" id="testElement">'+
@@ -292,7 +273,7 @@
testPositioning1(e,300,300,500,500);
} finally {
- removeDomElements(elements);
+ RichFaces.QUnit.removeDomElements(elements);
}
});
@@ -301,7 +282,7 @@
try {
- var elements = appendDomElements(body,
+ var elements = RichFaces.QUnit.appendDomElements(body,
'<div id="testElement" style="position:absolute; width:400px; height: 400px, top: 200px; left: 200px;">some text</div>');
var e = document.getElementById("testElement");
@@ -309,7 +290,7 @@
testPositioning(e,200,200);
} finally {
- removeDomElements(elements);
+ RichFaces.QUnit.removeDomElements(elements);
}
});
Modified: root/framework/trunk/impl/src/test/resources/javascript/richfaces-qunit.js
===================================================================
--- root/framework/trunk/impl/src/test/resources/javascript/richfaces-qunit.js 2010-04-23 17:33:25 UTC (rev 16802)
+++ root/framework/trunk/impl/src/test/resources/javascript/richfaces-qunit.js 2010-04-23 17:35:13 UTC (rev 16803)
@@ -6,6 +6,23 @@
};
return {
+ appendDomElements: function (parent, html) {
+ var element = document.createElement("div");
+ element.innerHTML = html;
+ var elements = [], e;
+ while (e = element.firstChild) {
+ elements.push(e);
+ parent.appendChild(e);
+ }
+ return elements;
+ },
+ removeDomElements: function (elements) {
+ var element;
+ while (elements.length>0) {
+ element = elements.pop();
+ element.parentNode.removeChild(element);
+ }
+ },
run: function (f) {
jQuery(document).ready(f);
}
14 years
JBoss Rich Faces SVN: r16802 - root/framework/trunk/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-04-23 13:33:25 -0400 (Fri, 23 Apr 2010)
New Revision: 16802
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js
Log:
queue changes: named queue options were added (exept dom searching), clear function was added, small refactoring
Modified: root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js
===================================================================
--- root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-04-23 17:17:15 UTC (rev 16801)
+++ root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-04-23 17:33:25 UTC (rev 16802)
@@ -37,8 +37,9 @@
};
var QUEUE_MODE_PULL = 'pull';
- var QUEUE_MODE_PUSH = 'push';
- var defaultQueueOptions = {mode: QUEUE_MODE_PULL, requestDelay:0};
+ var QUEUE_MODE_PUSH = 'push';
+ var QUEUE_MODE = QUEUE_MODE_PULL;
+ var DEFAULT_QUEUE_ID = "org.richfaces.queue.global";
/**
* RichFaces Queue API container
@@ -47,12 +48,24 @@
* @static
* @name queue
* */
- richfaces.queue = function(opts){
+ richfaces.queue = (function(){
+
+ var defaultQueueOptions = {};
+ defaultQueueOptions[DEFAULT_QUEUE_ID] = {requestDelay:0, ignoreDupResponse:false, timeout:0};
var QueueEntry = function(queue, source, event, options) {
this.queue = queue;
this.source = source;
this.options = options || {};
+ this.queueOptions = {}
+ if (options.hasOwnProperty("queueId")) {
+ if (defaultQueueOptions[options.queueId]) {
+ this.queueOptions = defaultQueueOptions[options.queueId];
+ }
+ } else {
+ // TODO: find form options or use view options
+ this.queueOptions = defaultQueueOptions[DEFAULT_QUEUE_ID];
+ }
this.event = event;
//similarityGroupingId is mutable, thus we need special field for it
@@ -99,7 +112,10 @@
},
startTimer: function() {
- var delay = this.options.requestDelay || queueOptions.requestDelay || 0;
+ var delay = this.options.requestDelay;
+ if (typeof delay!="number") {
+ delay = this.queueOptions.requestDelay || 0;
+ }
log.debug("Queue will wait " + (delay || 0) + "ms before submit");
@@ -149,7 +165,6 @@
var log = richfaces.log;
var items = [];
- var queueOptions = opts || {};
var lastRequestedEntry;
//TODO: instance of this function will be created for each queue
@@ -172,7 +187,7 @@
jsf.ajax.addOnError(onError);
var submitFirst = function() {
- if (queueOptions.mode == QUEUE_MODE_PULL && lastRequestedEntry) {
+ if (QUEUE_MODE == QUEUE_MODE_PULL && lastRequestedEntry) {
log.debug("richfaces.queue: Waiting for previous submit results");
return;
}
@@ -183,14 +198,13 @@
if (items[0].getReadyToSubmit()) {
lastRequestedEntry = items.shift();
log.debug("richfaces.queue: will submit request NOW");
- //TODO: events counter should be submitted
+ //TODO: copy of event should be created otherwise IE will fail
+ var o = lastRequestedEntry.options;
//lastRequestedEntry.source.appendParameter("AJAX:EVENTS_COUNT", lastRequestedEntry.eventsCount);
- //var params = richfaces.processRequestParams(lastRequestedEntry.source, lastRequestedEntry.options);
- //TODO: copy of event should be created otherwise IE will fail
- //richfaces.ajax.request = jsf.ajax.request
- richfaces.ajax.request(lastRequestedEntry.source, lastRequestedEntry.event, lastRequestedEntry.options);
- if (lastRequestedEntry.options.queueonsubmit) {
- lastRequestedEntry.options.queueonsubmit.call(lastRequestedEntry);
+ o["AJAX:EVENTS_COUNT"] = lastRequestedEntry.eventsCount;
+ richfaces.ajax.request(lastRequestedEntry.source, lastRequestedEntry.event, o);
+ if (o.queueonsubmit) {
+ o.queueonsubmit.call(lastRequestedEntry);
}
}
};
@@ -237,7 +251,14 @@
* @function
* @name RichFaces.queue.submitFirst
* */
- submitFirst: submitFirst,
+ submitFirst: function () {
+ if (!isEmpty()) {
+ var entry = items[0];
+ entry.stopTimer();
+ entry.setReadyToSubmit(true);
+ submitFirst();
+ }
+ },
/**
* Create and push QueueEntry to the queue for ajax requests
@@ -283,9 +304,41 @@
},
+ /**
+ * Remove all QueueEntry from the queue
+ * @function
+ * @name RichFaces.queue.clear
+ * */
clear: function () {
//TODO: clear queue
+ var lastEntry = getLastEntry();
+ if (lastEntry) {
+ lastEntry.stopTimer();
+ }
+ items = [];
+ },
+
+ /**
+ * Set queue default options
+ * @function
+ * @name RichFaces.queue.setQueueOptions
+ *
+ * @param {string} [id] - Queue id for storing options
+ * @param {object} options - Queue options object
+ * */
+ setQueueOptions: function (id, options) {
+ var queueId = DEFAULT_QUEUE_ID;
+ if (typeof id == "string") {
+ queueId = id;
+ } else {
+ options = id;
+ }
+ if (defaultQueueOptions[queueId]) {
+ throw "Queue already registered";
+ } else {
+ defaultQueueOptions[queueId] = options;
+ }
}
}
- }(jQuery.extend({},defaultQueueOptions));
+ }());
}(jQuery, RichFaces, jsf));
\ No newline at end of file
14 years
JBoss Rich Faces SVN: r16801 - in root/ui-sandbox/trunk/components: componentcontrol and 14 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-04-23 13:17:15 -0400 (Fri, 23 Apr 2010)
New Revision: 16801
Added:
root/ui-sandbox/trunk/components/componentcontrol/
root/ui-sandbox/trunk/components/componentcontrol/pom.xml
root/ui-sandbox/trunk/components/componentcontrol/src/
root/ui-sandbox/trunk/components/componentcontrol/src/main/
root/ui-sandbox/trunk/components/componentcontrol/src/main/config/
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/BehaviorStateHelper.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/UIHashParameter.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ClientBehavior.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/renderkit/
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorRule.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/taglib/
root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/taglib/ComponentControlHandler.java
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/cc.taglib.xml
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/faces-config.xml
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/
root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js
Log:
initial commit ...
Added: root/ui-sandbox/trunk/components/componentcontrol/pom.xml
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/pom.xml (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/pom.xml 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,39 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>components</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.sandbox.ui.components</groupId>
+ <artifactId>componentControl</artifactId>
+ <name>RichFaces Component Control</name>
+ <packaging>jar</packaging>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ </dependency>
+
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/BehaviorStateHelper.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/BehaviorStateHelper.java (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/BehaviorStateHelper.java 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,31 @@
+package org.richfaces;
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.behavior.ClientBehavior;
+
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class BehaviorStateHelper extends PartialStateHolderHelper {
+
+ private ClientBehavior behavior;
+
+ public BehaviorStateHelper(ClientBehavior behavior) {
+ super(behavior);
+ this.behavior = behavior;
+ }
+
+ @Override
+ protected Object getValueExpressionValue(String name) {
+ Object retVal = null;
+ ValueExpression ve = behavior.getValueExpression(name);
+ if (ve != null) {
+ retVal = ve.getValue(FacesContext.getCurrentInstance().getELContext());
+ }
+ return retVal;
+ }
+}
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/UIHashParameter.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/UIHashParameter.java (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/UIHashParameter.java 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,70 @@
+package org.richfaces.component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.component.UIParameter;
+
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class UIHashParameter extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.HashParameter";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.HashParameter";
+
+ enum PropertyKeys {
+ name
+ }
+
+
+ public UIHashParameter() {
+ super();
+ setRendererType(null);
+ }
+
+ public String getName() {
+ return (String)getStateHelper().eval(PropertyKeys.name);
+ }
+
+ public void setName(String name) {
+ getStateHelper().put(PropertyKeys.name, name);
+ }
+
+ public Map<String, Object> getValue() {
+ List<UIComponent> children = getChildren();
+ Map <String, Object> parameters = new HashMap<String, Object>();
+
+ for(UIComponent child: children) {
+ if(child instanceof UIParameter) {
+ UIParameter parameter = (UIParameter)child;
+ parameters.put(parameter.getName(),(String)parameter.getValue());
+ }
+
+ if(child instanceof UIHashParameter) {
+ UIHashParameter hashParameter = (UIHashParameter)child;
+ String name = hashParameter.getName();
+ Map<String, Object> value = hashParameter.getValue();
+ if(name == null) {
+ throw new FacesException("attribute 'name' for the nested " + UIHashParameter.class.getName() + " component (id = '" +hashParameter.getClientId()+"') should not be 'null'");
+ }else {
+ parameters.put(name, value);
+ }
+ }
+ }
+
+ return parameters;
+ }
+
+ @Override
+ public String getFamily() {
+ return (COMPONENT_FAMILY);
+ }
+}
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ClientBehavior.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ClientBehavior.java (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ClientBehavior.java 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,165 @@
+package org.richfaces.component.behavior;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.StateHelper;
+import javax.faces.component.UIComponentBase;
+import javax.faces.component.behavior.ClientBehaviorBase;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.BehaviorStateHelper;
+
+
+/**
+ * @author Anton Belevich
+ *
+ * base class for the client behaviors
+ */
+public class ClientBehavior extends ClientBehaviorBase {
+
+ private StateHelper behaviorStateHelper = null;
+
+ private Map<String, ValueExpression> bindings;
+
+
+ public StateHelper getStateHelper() {
+ if(behaviorStateHelper == null) {
+ behaviorStateHelper = new BehaviorStateHelper(this);
+ }
+ return behaviorStateHelper;
+ }
+
+ public ValueExpression getValueExpression(String name) {
+ if (name == null) {
+ throw new NullPointerException();
+ }
+
+ return ((bindings == null) ? null : bindings.get(name));
+ }
+
+ public void setValueExpression(String name, ValueExpression valueExpression) {
+ if (name == null) {
+ throw new NullPointerException();
+ }
+
+ if (valueExpression != null) {
+
+ if (valueExpression.isLiteralText()) {
+ setLiteralValue(name, valueExpression);
+ } else {
+ if (bindings == null) {
+ bindings = new HashMap<String, ValueExpression>(6,1.0f);
+ }
+ bindings.put(name, valueExpression);
+ }
+
+ } else {
+ if (bindings != null) {
+ bindings.remove(name);
+ if (bindings.isEmpty()) {
+ bindings = null;
+ }
+ }
+ }
+ clearInitialState();
+ }
+
+ protected FacesContext getFacesContext() {
+ return FacesContext.getCurrentInstance();
+ }
+
+ public void setLiteralValue(String name, ValueExpression expression) {
+ assert(expression.isLiteralText());
+ ELContext context = getFacesContext().getELContext();
+
+ try {
+ setLiteral(name, expression.getValue(context));
+ } catch (ELException ele) {
+ throw new FacesException(ele);
+ }
+ }
+
+ public void setLiteral(String name, Object value) {
+ //TODO override this method
+ }
+
+ @Override
+ public Object saveState(FacesContext context) {
+ Object [] state = null;
+
+ Object parentState = super.saveState(context);
+ if(initialStateMarked()) {
+ if(parentState != null) {
+ state = new Object[] {parentState};
+ }
+ } else {
+ state = new Object[3];
+ state[0] = parentState;
+
+ Object attrs = null;
+ if(behaviorStateHelper != null) {
+ attrs = behaviorStateHelper.saveState(context);
+ }
+ state[1] = attrs;
+ state[2] = saveBindings(context, bindings);
+
+ }
+ return state;
+ }
+
+ @Override
+ public void restoreState(FacesContext context, Object state) {
+ if(state != null) {
+ Object [] stateObject = (Object[])state;
+ super.restoreState(context, stateObject[0]);
+ if(stateObject.length > 1) {
+ if(behaviorStateHelper != null) {
+ behaviorStateHelper.restoreState(context, stateObject[1]);
+ }
+ }
+ restoreBindings(context, stateObject[2]);
+ }
+ }
+
+ // Utility for saving bindings state
+ private static Object saveBindings(FacesContext context, Map<String, ValueExpression> bindings) {
+
+ if (bindings == null) {
+ return (null);
+ }
+
+ Object values[] = new Object[2];
+ values[0] = bindings.keySet().toArray(new String[bindings.size()]);
+
+ Object[] bindingValues = bindings.values().toArray();
+ for (int i = 0; i < bindingValues.length; i++) {
+ bindingValues[i] = UIComponentBase.saveAttachedState(context, bindingValues[i]);
+ }
+
+ values[1] = bindingValues;
+
+ return (values);
+ }
+
+ // Utility for restoring bindings from state
+ private static Map<String, ValueExpression> restoreBindings(FacesContext context, Object state) {
+
+ if (state == null) {
+ return (null);
+ }
+
+ Object values[] = (Object[]) state;
+ String names[] = (String[]) values[0];
+ Object states[] = (Object[]) values[1];
+ Map<String, ValueExpression> bindings = new HashMap<String, ValueExpression>(names.length);
+ for (int i = 0; i < names.length; i++) {
+ bindings.put(names[i], (ValueExpression) UIComponentBase.restoreAttachedState(context, states[i]));
+ }
+ return (bindings);
+ }
+}
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,87 @@
+package org.richfaces.component.behavior;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.FacesBehavior;
+
+@FacesBehavior(value="org.richfaces.behavior.ComponentControlBehavior")
+public class ComponentControlBehavior extends ClientBehavior {
+
+ public static final String BEHAVIOR_ID = "org.richfaces.behavior.ComponentControlBehavior";
+
+ public static final String LIST_TYPE = "list";
+
+
+ enum PropertyKeys {
+ event, target, parameters, operation, type
+ }
+
+ private List<UIComponent> children;
+
+
+ public List<UIComponent> getChildren() {
+ if(children == null) {
+ children = new ArrayList<UIComponent>();
+ }
+ return children;
+ }
+
+ public String getEvent() {
+ return (String)getStateHelper().eval(PropertyKeys.event);
+ }
+
+ public void setEvent(String eventName) {
+ getStateHelper().eval(PropertyKeys.event, eventName);
+ }
+
+ public String getType() {
+ return (String)getStateHelper().eval(PropertyKeys.type, LIST_TYPE);
+ }
+
+ public void setType(String type) {
+ getStateHelper().put(PropertyKeys.type, type);
+ }
+
+ public String getTarget() {
+ return (String)getStateHelper().eval(PropertyKeys.target);
+ }
+
+ public void setTarget(String target) {
+ getStateHelper().eval(PropertyKeys.target, target);
+ }
+
+ public String getOperation() {
+ return (String)getStateHelper().eval(PropertyKeys.operation);
+ }
+
+ public void setOperation(String operation) {
+ getStateHelper().eval(PropertyKeys.operation, operation);
+ }
+
+ @Override
+ public String getRendererType() {
+ return BEHAVIOR_ID;
+ }
+
+ @Override
+ public void setLiteral(String name, Object value) {
+ if(compare(PropertyKeys.operation, name)) {
+ setOperation((String)value);
+ } else if(compare(PropertyKeys.target, name)) {
+ setTarget((String)value);
+ }
+ }
+
+ private boolean compare(Serializable key, String name) {
+ boolean retValue = false;
+ if(key != null) {
+ String keyName = key.toString();
+ retValue = keyName.equals(name);
+ }
+ return retValue;
+ }
+
+}
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,99 @@
+package org.richfaces.renderkit;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIParameter;
+import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorContext;
+import javax.faces.render.ClientBehaviorRenderer;
+import javax.faces.render.FacesBehaviorRenderer;
+import javax.faces.render.RenderKitFactory;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.richfaces.component.UIHashParameter;
+import org.richfaces.component.behavior.ComponentControlBehavior;
+
+
+@FacesBehaviorRenderer(rendererType="org.richfaces.behavior.ComponentControlBehavior", renderKitId=RenderKitFactory.HTML_BASIC_RENDER_KIT)
+@ResourceDependencies( {@ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name= "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-queue.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(name = "script/component-control.js")
+})
+public class ComponentControlBehaviorRenderer extends ClientBehaviorRenderer{
+
+ private static final String FUNC_NAME = "RichFaces.ui.ComponentControl.execute";
+
+ private static final String API_FUNCTION = "operation";
+
+ private static final String API_ARGUMENTS = "args";
+
+
+ public static final String SEPARATOR = "\\.";
+
+
+
+ @Override
+ public String getScript(ClientBehaviorContext behaviorContext, ClientBehavior behavior) {
+ ComponentControlBehavior controlBehavior = (ComponentControlBehavior)behavior;
+ Map<String, Object> parameters = new HashMap<String, Object>();
+ //JSFunctionDefenition
+ String target = controlBehavior.getTarget();
+
+ String apiFunctionName = controlBehavior.getOperation();
+ parameters.put(API_FUNCTION, apiFunctionName);
+
+ List<Object> apiFunctionParams = createSignature(controlBehavior);
+ parameters.put(API_ARGUMENTS, apiFunctionParams.toArray());
+
+ JSFunction eventFunction = new JSFunction(FUNC_NAME);
+ eventFunction.addParameter(target);
+ eventFunction.addParameter(parameters);
+
+ return (eventFunction != null ? eventFunction.toScript() : null);
+ }
+
+ protected List<Object> createSignature(ComponentControlBehavior behavior) {
+ List<Object> elements = new ArrayList<Object>();
+ List<UIComponent> children = behavior.getChildren();
+
+ for(UIComponent child: children) {
+ if(child instanceof UIParameter) {
+ UIParameter parameter = (UIParameter)child;
+ Object value = parameter.getValue();
+
+ if(value != null) {
+ elements.add(value);
+ }
+ }
+
+ if(child instanceof UIHashParameter) {
+ UIHashParameter parameter = (UIHashParameter)child;
+ String name = parameter.getName();
+ Map<String, Object> value = parameter.getValue();
+
+ if(value != null) {
+ if(name != null) {
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put(name, value);
+ elements.add(map);
+ } else {
+ elements.add(value);
+ }
+ }
+ }
+ }
+ return elements;
+ }
+}
+
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorRule.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorRule.java (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorRule.java 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,74 @@
+package org.richfaces.tag;
+
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
+import org.richfaces.component.behavior.ClientBehavior;
+import org.richfaces.log.RichfacesLogger;
+import org.slf4j.Logger;
+
+public class BehaviorRule extends MetaRule {
+
+ private static Logger log = RichfacesLogger.CONNECTION.getLogger();
+
+ final static class LiteralAttributeMetadata extends Metadata {
+
+ private final String name;
+ private final String value;
+
+ public LiteralAttributeMetadata(String name, String value) {
+ this.value = value;
+ this.name = name;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((ClientBehavior) instance).setLiteral(this.name, this.value);
+ }
+ }
+
+ final static class ValueExpressionMetadata extends Metadata {
+
+ private final String name;
+
+ private final TagAttribute attr;
+
+ private final Class type;
+
+ public ValueExpressionMetadata(String name, Class type,
+ TagAttribute attr) {
+ this.name = name;
+ this.attr = attr;
+ this.type = type;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((ClientBehavior) instance).setValueExpression(this.name, this.attr.getValueExpression(ctx, this.type));
+ }
+
+ }
+
+ @Override
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
+ if(meta.isTargetInstanceOf(ClientBehavior.class)) {
+ if(!attribute.isLiteral()) {
+
+ Class type = meta.getPropertyType(name);
+ if (type == null) {
+ type = Object.class;
+ }
+ return new ValueExpressionMetadata(name, type, attribute);
+ } else if(meta.getWriteMethod(name) == null) {
+
+ if(log.isDebugEnabled()) {
+ log.debug(attribute + " Property '" + name + "' is not on type: " + meta.getTargetClass().getName());
+ }
+ return new LiteralAttributeMetadata(name, attribute.getValue());
+ }
+ }
+
+ return null;
+ }
+}
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/tag/BehaviorTagHandlerDelegate.java 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,128 @@
+package org.richfaces.tag;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIParameter;
+import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.view.AttachedObjectHandler;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.CompositeFaceletHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.FaceletHandler;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.TagHandlerDelegate;
+
+import org.richfaces.component.UIHashParameter;
+import org.richfaces.component.behavior.ComponentControlBehavior;
+
+
+public class BehaviorTagHandlerDelegate extends TagHandlerDelegate implements AttachedObjectHandler{
+
+ private TagHandlerDelegate tagHandlerDelegate;
+
+ private List<UIComponent> children;
+
+ public BehaviorTagHandlerDelegate(TagHandlerDelegate tagHandlerDelegate) {
+ this.tagHandlerDelegate = tagHandlerDelegate;
+ }
+
+ @Override
+ public void apply(FaceletContext ctx, UIComponent parent) throws IOException {
+ this.tagHandlerDelegate.apply(ctx, parent);
+ }
+
+ public void apply(FaceletContext ctx, UIComponent parent, FaceletHandler nextHandler) throws IOException {
+ apply(ctx, parent);
+ processAttachedObject(ctx, parent, nextHandler);
+ }
+
+ @Override
+ public MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset metaRuleset = this.tagHandlerDelegate.createMetaRuleset(type);
+ metaRuleset.addRule(new BehaviorRule());
+ return metaRuleset;
+ }
+
+ public void applyAttachedObject(FacesContext context, UIComponent parent) {
+ if(tagHandlerDelegate instanceof AttachedObjectHandler) {
+ ((AttachedObjectHandler)tagHandlerDelegate).applyAttachedObject(context, parent);
+ }
+ }
+
+ public String getFor() {
+ String retValue = null;
+ if(tagHandlerDelegate instanceof AttachedObjectHandler) {
+ retValue = ((AttachedObjectHandler)tagHandlerDelegate).getFor();
+ }
+ return retValue;
+ }
+
+
+ public void processNextHandler(FaceletContext ctx, FaceletHandler nextHandler, UIComponent parent) throws IOException {
+ if(nextHandler instanceof CompositeFaceletHandler) {
+ FaceletHandler [] children = ((CompositeFaceletHandler)nextHandler).getHandlers();
+ for (FaceletHandler handler: children) {
+ collectParameters(ctx, handler, parent);
+ }
+ } else {
+ collectParameters(ctx, nextHandler, parent);
+ }
+ }
+
+ private void processAttachedObject(FaceletContext ctx, UIComponent parent, FaceletHandler nextHandler) throws IOException{
+ ClientBehaviorHolder holder = (ClientBehaviorHolder)parent;
+ Map<String, List<ClientBehavior>> behaviors = holder.getClientBehaviors();
+ Set<Map.Entry<String,List<ClientBehavior>>> entries = behaviors.entrySet();
+
+ for(Map.Entry<String, List<ClientBehavior>>entry: entries) {
+ for(ClientBehavior behavior: entry.getValue()) {
+ if(behavior instanceof ComponentControlBehavior) {
+ processNextHandler(ctx, nextHandler, parent);
+ ((ComponentControlBehavior) behavior).getChildren().addAll(getChildren());
+ //reset collected children after save to the behavior;
+ children = null;
+ }
+ }
+ }
+ }
+
+ private void collectParameters(FaceletContext ctx, FaceletHandler handler, UIComponent parent) throws IOException {
+ ComponentHandler componentHandler = (ComponentHandler) handler;
+
+ ComponentConfig componentConfig = componentHandler.getComponentConfig();
+ String componentType = componentConfig.getComponentType();
+ if(isUIParameter(componentType)) {
+
+ FacesContext facesContext = ctx.getFacesContext();
+ UIComponent component = (UIComponent)facesContext.getApplication().createComponent(facesContext, componentType, null);
+ if((component instanceof UIParameter) || (component instanceof UIHashParameter)) {
+ componentHandler.setAttributes(ctx, component);
+ getChildren().add(component);
+ }
+
+ if(component instanceof UIHashParameter) {
+ componentHandler.applyNextHandler(ctx, component);
+ }
+ }
+ }
+
+ private boolean isUIParameter(String type) {
+ return (UIParameter.COMPONENT_TYPE.equals(type) || UIHashParameter.COMPONENT_TYPE.equals(type));
+ }
+
+ public List<UIComponent> getChildren() {
+ if(this.children == null) {
+ this.children = new ArrayList<UIComponent>();
+ }
+ return this.children;
+ }
+
+}
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/taglib/ComponentControlHandler.java
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/taglib/ComponentControlHandler.java (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/java/org/richfaces/taglib/ComponentControlHandler.java 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,40 @@
+package org.richfaces.taglib;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.BehaviorConfig;
+import javax.faces.view.facelets.BehaviorHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagHandlerDelegate;
+
+import org.richfaces.tag.BehaviorTagHandlerDelegate;
+
+public class ComponentControlHandler extends BehaviorHandler {
+
+ private BehaviorTagHandlerDelegate helper;
+
+
+ public ComponentControlHandler(BehaviorConfig config) {
+ super(config);
+ }
+
+ public BehaviorTagHandlerDelegate getBehaviorTagHandlerDelegate() {
+ return (BehaviorTagHandlerDelegate)getTagHandlerDelegate();
+ }
+
+ @Override
+ public void apply(FaceletContext ctx, UIComponent parent) throws IOException {
+ getBehaviorTagHandlerDelegate().apply(ctx, parent, nextHandler);
+ }
+
+ @Override
+ protected TagHandlerDelegate getTagHandlerDelegate() {
+ if(helper == null){
+ helper = new BehaviorTagHandlerDelegate(super.getTagHandlerDelegate());
+ }
+ return helper;
+ }
+
+}
+
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/cc.taglib.xml
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/cc.taglib.xml (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/cc.taglib.xml 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
+ version="2.0"
+ id="cc">
+ <namespace>http://richfaces.org/componentControl</namespace>
+ <tag>
+ <tag-name>componentControl</tag-name>
+ <behavior>
+ <behavior-id>org.richfaces.behavior.ComponentControlBehavior</behavior-id>
+ <handler-class>org.richfaces.taglib.ComponentControlHandler</handler-class>
+ </behavior>
+ </tag>
+ <tag>
+ <tag-name>hashParameter</tag-name>
+ <component>
+ <component-type>org.richfaces.HashParameter</component-type>
+ <handler-class>javax.faces.view.facelets.ComponentHandler</handler-class>
+ </component>
+
+ </tag>
+</facelet-taglib>
\ No newline at end of file
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/faces-config.xml
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/faces-config.xml (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/faces-config.xml 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<faces-config version="2.0" metadata-complete="false" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://richfaces.org/cdk/extensions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+<component>
+ <component-type>org.richfaces.HashParameter</component-type>
+ <component-class>org.richfaces.component.UIHashParameter</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+</faces-config>
\ No newline at end of file
Added: root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js
===================================================================
--- root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js (rev 0)
+++ root/ui-sandbox/trunk/components/componentcontrol/src/main/resources/META-INF/resources/script/component-control.js 2010-04-23 17:17:15 UTC (rev 16801)
@@ -0,0 +1,22 @@
+(function (jQuery, richfaces) {
+
+ richfaces = richfaces || {};
+ richfaces.ui.ComponentControl = richfaces.ui.ComponentControl || {};
+
+ jQuery.extend(richfaces.ui.ComponentControl, {
+
+ execute: function(id, parameters) {
+ richfaces.ui.ComponentControl.eachComponent();
+
+ },
+
+ eachComponent : function(forAttr, callback) {
+ jQuery(forAttr.replace(/:/g, "\\:").each(function() {
+ if (this.component) {
+ callback(this.component);
+ }
+ });
+ }
+ });
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
14 years
JBoss Rich Faces SVN: r16800 - root/framework/trunk/impl/src/main/java/org/richfaces/context.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-04-23 08:46:41 -0400 (Fri, 23 Apr 2010)
New Revision: 16800
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java
Log:
https://jira.jboss.org/jira/browse/RF-8617
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java 2010-04-23 12:43:22 UTC (rev 16799)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java 2010-04-23 12:46:41 UTC (rev 16800)
@@ -21,11 +21,11 @@
package org.richfaces.context;
+import javax.faces.component.UIComponent;
+
import org.ajax4jsf.component.AjaxClientBehavior;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import javax.faces.component.UIComponent;
-
/**
* @author akolonitsky
* @since Oct 13, 2009
@@ -33,7 +33,7 @@
class ExecuteComponentCallback extends ComponentCallback {
ExecuteComponentCallback(String behaviorEvent) {
- super(behaviorEvent, AjaxRendererUtils.ALL);
+ super(behaviorEvent, AjaxRendererUtils.THIS);
}
@Override
14 years
JBoss Rich Faces SVN: r16799 - in root: framework/trunk/impl/src/main/java/org/richfaces/resource and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-04-23 08:43:22 -0400 (Fri, 23 Apr 2010)
New Revision: 16799
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/AnimatedTestResource.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java
root/framework/trunk/impl/src/test/java/org/richfaces/resource/AbstractBaseResourceTest.java
root/framework/trunk/impl/src/test/java/org/richfaces/resource/CacheableResourceImpl.java
root/framework/trunk/impl/src/test/java/org/richfaces/resource/EmptyStreamResource.java
root/framework/trunk/impl/src/test/java/org/richfaces/resource/StateHolderResourceImpl.java
root/ui/trunk/components/core/src/main/java/org/richfaces/resource/MediaOutputResource.java
root/ui/trunk/components/core/src/main/java/org/richfaces/resource/PushResource.java
Log:
Dynamic CSS refactoring & fixes
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/resource/Java2Dresource.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -21,18 +21,8 @@
package org.ajax4jsf.resource;
-import org.ajax4jsf.util.HtmlColor;
-import org.ajax4jsf.util.HtmlDimensions;
-import org.ajax4jsf.util.NumericDataInputStream;
-import org.ajax4jsf.util.NumericDataOutputStream;
-import org.richfaces.resource.AbstractBaseResource;
-import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
-
-import javax.faces.component.StateHolder;
-import javax.faces.context.FacesContext;
-import javax.imageio.ImageIO;
-import java.awt.*;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.IndexColorModel;
import java.io.ByteArrayInputStream;
@@ -41,6 +31,18 @@
import java.io.InputStream;
import java.util.Map;
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
+import javax.imageio.ImageIO;
+
+import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.HtmlDimensions;
+import org.ajax4jsf.util.NumericDataInputStream;
+import org.ajax4jsf.util.NumericDataOutputStream;
+import org.richfaces.resource.AbstractBaseResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.3 $ $Date: 2007/02/01 15:31:57 $
@@ -53,11 +55,11 @@
super();
this.imageType = imageType;
}
-
+
public void populateParameters(Map<String, String> parameters){
-
+
}
-
+
public static enum ImageType {
GIF("gif") {
@Override
@@ -168,7 +170,7 @@
* @see org.richfaces.resource.AbstractBaseResource#getInputStream()
*/
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
Dimension dimension = getDimension();
int width = dimension.width;
int height = dimension.height;
@@ -186,10 +188,6 @@
try {
ImageIO.write(image, imageType.getFormatName(), baos);
- } catch (IOException e) {
-
- // TODO Auto-generated catch block
- e.printStackTrace();
} finally {
try {
baos.close();
@@ -234,7 +232,7 @@
public void setTransient(boolean newTransientValue) {
throw new UnsupportedOperationException();
}
-
+
protected String getValueParameter(FacesContext context, String name) {
SkinFactory skinFactory = SkinFactory.getInstance();
@@ -256,7 +254,7 @@
}
return param;
}
-
+
protected Integer getColorValueParameter(FacesContext context, String name, boolean useDefault) {
Skin skin;
if (useDefault) {
@@ -284,7 +282,7 @@
return Integer.valueOf(16);
}
}
-
+
protected Integer decodeColor(String value) {
if (value != null && value.length() != 0) {
return Integer.valueOf(HtmlColor.decode(value).getRGB());
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/AnimatedTestResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/AnimatedTestResource.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/AnimatedTestResource.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -21,7 +21,18 @@
package org.richfaces.resource;
-import org.w3c.dom.Node;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.GraphicsEnvironment;
+import java.awt.color.ColorSpace;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
@@ -31,15 +42,9 @@
import javax.imageio.metadata.IIOMetadata;
import javax.imageio.metadata.IIOMetadataNode;
import javax.imageio.stream.ImageOutputStream;
-import java.awt.*;
-import java.awt.color.ColorSpace;
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
+import org.w3c.dom.Node;
+
public class AnimatedTestResource extends TestResource2 {
private static final int DELAY_TIME = 50;
private static final int FRAMES_COUNT = 10;
@@ -82,7 +87,7 @@
}
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
Dimension dimension = getDimension();
BufferedImage image = new BufferedImage(dimension.width, dimension.height, ColorSpace.TYPE_RGB);
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -21,16 +21,8 @@
package org.richfaces.resource;
-import org.ajax4jsf.io.ByteBuffer;
-import org.ajax4jsf.io.FastBufferInputStream;
-import org.ajax4jsf.io.FastBufferOutputStream;
-import org.richfaces.log.RichfacesLogger;
import static org.richfaces.resource.ResourceUtils.secondToMillis;
-import org.richfaces.util.Util;
-import org.slf4j.Logger;
-import javax.faces.application.Resource;
-import javax.faces.context.FacesContext;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -43,6 +35,16 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import javax.faces.application.Resource;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.io.ByteBuffer;
+import org.ajax4jsf.io.FastBufferInputStream;
+import org.ajax4jsf.io.FastBufferOutputStream;
+import org.richfaces.log.RichfacesLogger;
+import org.richfaces.util.Util;
+import org.slf4j.Logger;
+
/**
* @author Nick Belaevski
* @since 4.0
@@ -177,7 +179,7 @@
}
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
return new FastBufferInputStream(content);
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -76,7 +76,6 @@
this.resourceDelegate = resource;
}
- @Override
public InputStream getInputStream() throws IOException {
FacesContext ctx = FacesContext.getCurrentInstance();
InputStream stream = null;
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -76,6 +76,8 @@
if (prefixes.isEmpty()) {
buffer.append('}');
buffer.append(NEW_LINE);
+ } else {
+ prefixes.remove(prefixes.size() - 1);
}
}
Modified: root/framework/trunk/impl/src/test/java/org/richfaces/resource/AbstractBaseResourceTest.java
===================================================================
--- root/framework/trunk/impl/src/test/java/org/richfaces/resource/AbstractBaseResourceTest.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/framework/trunk/impl/src/test/java/org/richfaces/resource/AbstractBaseResourceTest.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -24,6 +24,7 @@
package org.richfaces.resource;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
@@ -265,7 +266,7 @@
}
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
return inputStream;
}
@@ -379,7 +380,7 @@
}
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
throw new UnsupportedOperationException();
}
}
Modified: root/framework/trunk/impl/src/test/java/org/richfaces/resource/CacheableResourceImpl.java
===================================================================
--- root/framework/trunk/impl/src/test/java/org/richfaces/resource/CacheableResourceImpl.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/framework/trunk/impl/src/test/java/org/richfaces/resource/CacheableResourceImpl.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -24,6 +24,7 @@
package org.richfaces.resource;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Date;
@@ -44,7 +45,7 @@
* @see org.richfaces.resource.AbstractBaseResource#getInputStream()
*/
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(getContentToEcho());
}
Modified: root/framework/trunk/impl/src/test/java/org/richfaces/resource/EmptyStreamResource.java
===================================================================
--- root/framework/trunk/impl/src/test/java/org/richfaces/resource/EmptyStreamResource.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/framework/trunk/impl/src/test/java/org/richfaces/resource/EmptyStreamResource.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -24,6 +24,7 @@
package org.richfaces.resource;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.io.InputStream;
/**
@@ -34,7 +35,7 @@
protected InputStream EMPTY_STREAM = new ByteArrayInputStream(new byte[0]);
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
return EMPTY_STREAM;
}
}
Modified: root/framework/trunk/impl/src/test/java/org/richfaces/resource/StateHolderResourceImpl.java
===================================================================
--- root/framework/trunk/impl/src/test/java/org/richfaces/resource/StateHolderResourceImpl.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/framework/trunk/impl/src/test/java/org/richfaces/resource/StateHolderResourceImpl.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -24,6 +24,7 @@
package org.richfaces.resource;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
@@ -39,7 +40,7 @@
private Object state = "";
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
try {
return new ByteArrayInputStream(state.toString().getBytes("US-ASCII"));
} catch (UnsupportedEncodingException e) {
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/resource/MediaOutputResource.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/resource/MediaOutputResource.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/resource/MediaOutputResource.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -25,11 +25,11 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.io.InputStream;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
-
import javax.faces.component.StateHolder;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
@@ -55,7 +55,7 @@
private Object userData;
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
FacesContext facesContext = FacesContext.getCurrentInstance();
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/resource/PushResource.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/resource/PushResource.java 2010-04-23 07:09:12 UTC (rev 16798)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/resource/PushResource.java 2010-04-23 12:43:22 UTC (rev 16799)
@@ -21,16 +21,16 @@
package org.richfaces.resource;
-import org.richfaces.component.PushEventTracker;
-import org.richfaces.component.PushListenersManager;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import java.io.InputStream;
+import org.richfaces.component.PushEventTracker;
+import org.richfaces.component.PushListenersManager;
-import java.util.Map;
-
/**
* @author Nick Belaevski
* @since 4.0
@@ -45,7 +45,7 @@
}
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
return null;
}
14 years
JBoss Rich Faces SVN: r16798 - in root/docs/trunk/Component_Reference/en-US: extras and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-04-23 03:09:12 -0400 (Fri, 23 Apr 2010)
New Revision: 16798
Added:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-Tables_and_grids-richdataFilterSlider_example.xml_sample
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-Trees-richdataDefinitionList_example.xml_sample
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample
root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richdataFilterSlider-richdataFilterSlider_example.png
root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richdataList-richdataList_example.png
Modified:
root/docs/trunk/Component_Reference/en-US/Author_Group.xml
root/docs/trunk/Component_Reference/en-US/Book_Info.xml
root/docs/trunk/Component_Reference/en-US/Component_Reference.xml
root/docs/trunk/Component_Reference/en-US/Preface.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Common_features.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Containers.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functions.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Output_and_messages.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Resources.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Selection_and_ordering.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Tables_and_grids.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Trees.xml
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml
Log:
Worked on Tables and Grids
Modified: root/docs/trunk/Component_Reference/en-US/Author_Group.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Author_Group.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/Author_Group.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -1,7 +1,5 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "Component_Reference.ent">
-%BOOK_ENTITIES;
]>
<authorgroup>
<author>
@@ -15,47 +13,36 @@
</affiliation>
<email>serogers(a)redhat.com</email>
</author>
- <collab>
- <collabname>Svetlana Mukhina</collabname>
- <affiliation>
- <orgname>Exadel</orgname>
- <orgdiv>Documentation</orgdiv>
- </affiliation>
+ <collab><collabname>Svetlana Mukhina</collabname>
+ <affiliation>
+ <orgname>Exadel</orgname>
+ <orgdiv>Documentation</orgdiv>
+ </affiliation>
+ </collab><collab><collabname>Anastasiya Bogachuk</collabname>
+ <affiliation>
+ <orgname>Exadel</orgname>
+ <orgdiv>Documentation</orgdiv>
+ </affiliation>
+ </collab><collab><collabname>Gleb Galkin</collabname>
+ <affiliation>
+ <orgname>Exadel</orgname>
+ <orgdiv>Documentation</orgdiv>
+ </affiliation>
+ </collab><collab><collabname>Mikhail Sorokin</collabname>
+ <affiliation>
+ <orgname>Exadel</orgname>
+ <orgdiv>Documentation</orgdiv>
+ </affiliation>
+ </collab><collab><collabname>Alexander Tsebro</collabname>
+ <affiliation>
+ <orgname>Exadel</orgname>
+ <orgdiv>Documentation</orgdiv>
+ </affiliation>
+ </collab><collab><collabname>Olga Chikvina</collabname>
+ <affiliation>
+ <orgname>Exadel</orgname>
+ <orgdiv>Documentation</orgdiv>
+ </affiliation>
</collab>
- <collab>
- <collabname>Anastasiya Bogachuk</collabname>
- <affiliation>
- <orgname>Exadel</orgname>
- <orgdiv>Documentation</orgdiv>
- </affiliation>
- </collab>
- <collab>
- <collabname>Gleb Galkin</collabname>
- <affiliation>
- <orgname>Exadel</orgname>
- <orgdiv>Documentation</orgdiv>
- </affiliation>
- </collab>
- <collab>
- <collabname>Mikhail Sorokin</collabname>
- <affiliation>
- <orgname>Exadel</orgname>
- <orgdiv>Documentation</orgdiv>
- </affiliation>
- </collab>
- <collab>
- <collabname>Alexander Tsebro</collabname>
- <affiliation>
- <orgname>Exadel</orgname>
- <orgdiv>Documentation</orgdiv>
- </affiliation>
- </collab>
- <collab>
- <collabname>Olga Chikvina</collabname>
- <affiliation>
- <orgname>Exadel</orgname>
- <orgdiv>Documentation</orgdiv>
- </affiliation>
- </collab>
</authorgroup>
Modified: root/docs/trunk/Component_Reference/en-US/Book_Info.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Book_Info.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/Book_Info.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -11,14 +11,13 @@
<pubsnumber>1</pubsnumber>
<abstract>
<para>
-This book details each component in the RichFaces &VERSION;
-framework, including examples of their use in applications.
-</para>
+ This book details each component in the RichFaces &VERSION; framework, including examples of their use in applications.
+ </para>
</abstract>
<corpauthor>
<inlinemediaobject>
<imageobject>
- <imagedata fileref="./images/rf_logo.png" format="PNG" scalefit="1" />
+ <imagedata fileref="./images/rf_logo.png" format="PNG" scalefit="1" width="444" />
</imageobject>
<textobject>
<phrase>Logo</phrase>
@@ -29,7 +28,7 @@
<year>&YEAR;</year>
<holder>&HOLDER;</holder>
</copyright>
- <!-- FOR PUBLICAN --><xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK: --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- FOR PUBLICAN --><xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK: --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</xi:fallback>
</xi:include>
<xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: root/docs/trunk/Component_Reference/en-US/Component_Reference.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Component_Reference.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/Component_Reference.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -3,9 +3,9 @@
]>
<book status="draft">
<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!--
+ <!--
<xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- --><xi:include href="chap-Component_Reference-Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ --><xi:include href="chap-Component_Reference-Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chap-Component_Reference-Common_Ajax_attributes.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chap-Component_Reference-Common_features.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<part id="part-Component_Reference-a4j_tag_library">
Modified: root/docs/trunk/Component_Reference/en-US/Preface.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Preface.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/Preface.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -3,23 +3,13 @@
]>
<preface id="pref-Component_Reference-Preface">
<title>Preface</title>
- <!--FOR JDOCBOOK-->
- <xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
- <!--FOR PUBLICAN-->
- <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- </xi:fallback>
+ <!-- FOR JDOCBOOK --><xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR PUBLICAN --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ </xi:fallback>
</xi:include>
- <!--PUBLICAN'S ORIGINAL XINCLUDES-->
- <xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
- <!--FOR JDOCBOOK-->
- <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- </xi:fallback>
- </xi:include>
- </xi:fallback>
+ <!-- PUBLICAN'S ORIGINAL XINCLUDES --><xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ </xi:fallback>
</xi:include>
+ </xi:fallback>
+ </xi:include>
</preface>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Actions.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -200,7 +200,7 @@
</para>
</section>
- <section id="sect-Component_Reference-Functionality_extension-a4jcomponentControl">
+ <section id="sect-Component_Reference-Actions-a4jcomponentControl">
<title><sgmltag><a4j:componentControl></sgmltag></title>
<remark>The following reference data is taken from the old <sgmltag><rich:componentControl></sgmltag> reference. The details may be different now that the component is part of the <classname>a4j</classname> tag library.</remark>
<itemizedlist>
@@ -238,10 +238,12 @@
</para>
<example id="exam-Component_Reference-a4jcomponentControl-a4jcomponentControl_basic_usage">
<title>a4j:componentControl basic usage</title>
+
<programlisting language="XML" role="XML"><h:commandButton value="Show Modal Panel">
<!--componentControl is attached to the commandButton-->
<a4j:componentControl for="ccModalPanelID" event="onclick" operation="show"/>
-</h:commandButton></programlisting>
+</h:commandButton>
+</programlisting>
<para>
The example contains a single command button, which when clicked shows the modal panel with the identifier <literal>ccModalPanelID</literal>.
</para>
@@ -251,7 +253,9 @@
</para>
<example id="exam-Component_Reference-a4jcomponentControl-Attaching_a4jcomponentControl_to_a_component">
<title>Attaching <sgmltag><a4j:componentControl></sgmltag> to a component</title>
-<programlisting language="XML" role="XML"><rich:componentControl attachTo="doExpandCalendarID" event="onclick" operation="Expand" for="ccCalendarID" /></programlisting>
+
+<programlisting language="XML" role="XML"><rich:componentControl attachTo="doExpandCalendarID" event="onclick" operation="Expand" for="ccCalendarID" />
+</programlisting>
<para>
In the example, the <literal>onclick</literal> event of the component with the identifier <literal>ccCalendarID</literal> will trigger the <literal>Expand</literal> operation for the component with the identifier <literal>doExpandCalendarID</literal>.
</para>
@@ -265,15 +269,19 @@
<varlistentry>
<term>The <varname>params</varname> attribute</term>
<listitem>
-<programlisting language="XML" role="XML"><rich:componentControl name="func" event="onRowClick" for="menu" operation="show" params="#{car.model}"/></programlisting>
+
+<programlisting language="XML" role="XML"><rich:componentControl name="func" event="onRowClick" for="menu" operation="show" params="#{car.model}"/>
+</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><sgmltag><f:param></sgmltag> elements</term>
<listitem>
+
<programlisting language="XML" role="XML"><rich:componentControl event="onRowClick" for="menu" operation="show">
<f:param value="#{car.model}" name="model"/>
-</rich:componentControl></programlisting>
+</rich:componentControl>
+</programlisting>
</listitem>
</varlistentry>
</variablelist>
@@ -462,7 +470,7 @@
</para>
</section>
- <section id="sect-Component_Reference-Actions-a4jajax">
+ <section id="sect-Component_Reference-Actions-a4jsupport">
<title><sgmltag><a4j:support></sgmltag></title>
<itemizedlist>
<listitem>
@@ -497,12 +505,14 @@
</note>
<example id="exam-Component_Reference-a4jsupport-a4jsupport_example">
<title><sgmltag><a4j:support></sgmltag> example</title>
- <programlisting language="XML" role="XML"><h:panelGrid columns="2">
+
+<programlisting language="XML" role="XML"><h:panelGrid columns="2">
<h:inputText id="myinput" value="#{userBean.name}">
<a4j:support event="onkeyup" reRender="outtext" />
</h:inputText>
<h:outputText id="outtext" value="#{userBean.name}" />
-</h:panelGrid></programlisting>
+</h:panelGrid>
+</programlisting>
</example>
</section>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Common_features.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Common_features.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Common_features.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -6,7 +6,7 @@
<para>
This chapter covers those attributes and features that are common to many of the components in the tag libraries.
</para>
- <section id="sect-Component_Reference-Common_features-Positioning_in_popup_components">
+ <section id="sect-Component_Reference-Common_features-Positioning_and_appearance_of_components">
<title>Positioning and appearance of components</title>
<para>
A number of attributes relating to positioning and appearance are common to several components.
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Containers.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Containers.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Containers.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -186,7 +186,9 @@
</listitem>
</itemizedlist>
<para>
- The <sgmltag><a4j:page></sgmltag> component encodes a full HTML-page structure using only one tag. It renders complete <sgmltag><!DOCTYPE></sgmltag>, <sgmltag><html></sgmltag>, <sgmltag><head></sgmltag>, <sgmltag><title></sgmltag>, and <sgmltag><body></sgmltag> tags using the specified attributes and facets. Additionally, the <sgmltag><a4j:page></sgmltag> component solves an incompatibility issue between early versions of <productname>MyFaces</productname> and the <productname>Ajax4jsf</productname> framework.
+ The <sgmltag><a4j:page></sgmltag> component encodes a full HTML-page structure using only one tag. It renders complete <sgmltag><!DOCTYPE></sgmltag>, <sgmltag><html></sgmltag>, <sgmltag><head></sgmltag>, <sgmltag><title></sgmltag>, and <sgmltag><body></sgmltag> tags using the specified attributes and facets. Additionally, the <sgmltag><a4j:page></sgmltag> component solves an incompatibility issue between early versions of <productname>MyFaces</productname>
+ and the <productname>Ajax4jsf</productname>
+ framework.
</para>
<para>
The <varname>pageTitle</varname> attribute is rendered as a <sgmltag><title></sgmltag> element. The component uses the <literal>head</literal> facet to define the contents of the HTML <sgmltag><head></sgmltag> element. The <literal>format</literal> facet defines the page layout format for encoding the <sgmltag><!DOCTYPE></sgmltag> element. There rest of the contents of the <sgmltag><a4j:page></sgmltag> component are rendered as part of the <sgmltag><body></sgmltag> element.
@@ -196,14 +198,21 @@
<para>
An <sgmltag><a4j:page></sgmltag> component can be defined as follows:
</para>
-<programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-a4jpage-a4jpage_rendering-0.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-a4jpage-a4jpage_rendering-0.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
<para>
This definition will render on an XHTML page as follows:
</para>
-<programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-a4jpage-a4jpage_rendering-1.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-a4jpage-a4jpage_rendering-1.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
</example>
<para>
- When using the <productname>Ajax4jsf</productname> framework with <productname>MyFaces</productname> version 1.2.2 and lower, the <sgmltag><f:view></sgmltag> JSP tag does not receive control for encoding contents during the <literal>RENDER_RESPONSE</literal> phase. As a result, Ajax fails to receive control and send responses. The <sgmltag><a4j:page></sgmltag> component solves this problem by wrapping the Ajax areas to be updated. Later versions of <productname>MyFaces</productname> do not have this problem, and as such do not require the use of the <sgmltag><a4j:page></sgmltag> component.
+ When using the <productname>Ajax4jsf</productname>
+ framework with <productname>MyFaces</productname>
+ version 1.2.2 and lower, the <sgmltag><f:view></sgmltag> JSP tag does not receive control for encoding contents during the <literal>RENDER_RESPONSE</literal> phase. As a result, Ajax fails to receive control and send responses. The <sgmltag><a4j:page></sgmltag> component solves this problem by wrapping the Ajax areas to be updated. Later versions of <productname>MyFaces</productname>
+ do not have this problem, and as such do not require the use of the <sgmltag><a4j:page></sgmltag> component.
</para>
</section>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functions.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functions.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Functions.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -6,7 +6,7 @@
<para>
Read this chapter for details on special functions for use with particular components. Using JavaServer Faces Expression Language (<acronym>JSF</acronym> <acronym>EL</acronym>), these functions can be accessed through the <varname>data</varname> attribute of components. Refer to <xref linkend="sect-Component_Reference-Events_and_JavaScript_interactions-data" /> for details on the <varname>data</varname> attribute.
</para>
- <section id="sect-Component_Reference-Functions-richclientID">
+ <section id="sect-Component_Reference-Functions-richclientId">
<title><function>rich:clientId</function></title>
<para>
The <function>rich:clientId('id')</function> function returns the client identifier related to the passed component identifier (<code>'id'</code>). If the specified component identifier is not found, <literal>null</literal> is returned instead.
@@ -34,10 +34,12 @@
</para>
<example id="exam-Component_Reference-richfindComponent-richfindComponent_example">
<title><function>rich:findComponent</function> example</title>
+
<programlisting language="XML" role="XML"><h:inputText id="myInput">
<a4j:support event="onkeyup" reRender="outtext"/>
</h:inputText>
-<h:outputText id="outtext" value="#{rich:findComponent('myInput').value}" /></programlisting>
+<h:outputText id="outtext" value="#{rich:findComponent('myInput').value}" />
+</programlisting>
</example>
</section>
@@ -51,7 +53,9 @@
<para>
The <function>rich:isUserInRole(Object)</function> function can be used in conjunction with the <varname>rendered</varname> attribute of a component to only display certain controls to authorized users.
</para>
-<programlisting language="XML" role="XML"><rich:editor value="#{bean.text}" rendered="#{rich:isUserInRole('admin')}" /></programlisting>
+
+<programlisting language="XML" role="XML"><rich:editor value="#{bean.text}" rendered="#{rich:isUserInRole('admin')}" />
+</programlisting>
</example>
</section>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Output_and_messages.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Output_and_messages.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Output_and_messages.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -104,7 +104,9 @@
</variablelist>
<example id="exam-Component_Reference-richmessage-richmessage_example">
<title>rich:message example</title>
- <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richmessage-richmessage_example.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-richmessage-richmessage_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
</example>
</section>
@@ -206,7 +208,9 @@
</variablelist>
<example id="exam-Component_Reference-richmessages-richmessages_example">
<title>rich:messages example</title>
- <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richmessages-richmessages_example.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-richmessages-richmessages_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
</example>
</section>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Processing_management.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -226,7 +226,7 @@
<title>Updating a common <sgmltag><a4j:status></sgmltag> component</title>
<programlisting language="XML" role="XML">
-<xi:include parse="text" href="extras/exam-Component_Reference-a4jstatus-Updating_a_common_a4jstatus_component.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="extras/exam-Component_Reference-a4jstatus-Updating_a_common_a4jstatus_component.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
</example>
</section>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Resources.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Resources.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Resources.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -47,7 +47,7 @@
</para>
<mediaobject>
<imageobject>
- <imagedata fileref="images/figu-Component_Reference-a4jloadBundle-Create_resource_bundles.png" format="PNG" />
+ <imagedata fileref="images/figu-Component_Reference-a4jloadBundle-Create_resource_bundles.png" format="PNG" width="444" />
</imageobject>
<textobject>
<para>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Selection_and_ordering.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Selection_and_ordering.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Selection_and_ordering.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -6,30 +6,28 @@
<para>
This chapter describes those components used for the selection and ordering of objects in lists.
</para>
-
- <section id="sect-Component_Reference-Trees-richlistShuttle">
+ <section id="sect-Component_Reference-Selection_and_ordering-richlistShuttle">
<title><sgmltag><rich:listShuttle></sgmltag></title>
<para>
The <sgmltag><rich:listShuttle></sgmltag> component is used for moving select items from one list into another. Items can optionally be re-ordered. It supports selection of multiple items, keyboard usage, and a customizable look and feel.
</para>
<para>
-
</para>
</section>
- <section id="sect-Component_Reference-Trees-richorderingList">
+ <section id="sect-Component_Reference-Selection_and_ordering-richorderingList">
<title><sgmltag><rich:orderingList></sgmltag></title>
<para>
Incomplete
</para>
</section>
- <section id="sect-Component_Reference-Trees-richpickList">
+ <section id="sect-Component_Reference-Selection_and_ordering-richpickList">
<title><sgmltag><rich:pickList></sgmltag></title>
<para>
Incomplete
</para>
</section>
-
+
</chapter>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Tables_and_grids.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -39,7 +39,7 @@
The <sgmltag><rich:column></sgmltag> component facilitates columns in a table or other <classname>UIData</classname> component. It supports merging columns and rows, sorting, filtering, and customized skinning.
</para>
<para>
- In general usage, the <sgmltag><rich:column></sgmltag> component is used in the same was as the JavaServer Faces (<acronym>JSF</acronym>) <sgmltag><h:column></sgmltag> component. It requires no extra attributes for basic usage, as shown in <xref linkend="exam-Component_Reference-richcolumn-Basic_column_example" /> and the resulting <xref linkend="figu-Component_Reference-richcolumn-Basic_column_example" />.
+ In general usage, the <sgmltag><rich:column></sgmltag> component is used in the same was as the JavaServer Faces (<acronym>JSF</acronym>) <sgmltag><h:column></sgmltag> component. It requires no extra attributes for basic usage, as shown in <xref linkend="exam-Component_Reference-richcolumn-Basic_column_example" />.
</para>
<example id="exam-Component_Reference-richcolumn-Basic_column_example">
<title>Basic column example</title>
@@ -65,16 +65,23 @@
</rich:dataTable>
</programlisting>
</example>
- <figure id="figu-Component_Reference-richcolumn-Basic_column_example">
- <title>Basic column example</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-richcolumn-Basic_column_example.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </figure>
+ <blockquote>
+ <figure id="figu-Component_Reference-richcolumn-Basic_column_example">
+ <title>Basic column example</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-richcolumn-Basic_column_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ The result of the basic column example, displaying a table with a header row and four columns.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
<para>
- Columns can be merged by using the <varname>colspan</varname> attribute to specify how many normal columns to span. The <varname>colspan</varname> attribute is used in conjunction with the <varname>breakBefore</varname> attribute on the next column to determine how the merged columns are laid out. <xref linkend="exam-Component_Reference-richcolumn-Column_spanning_example" /> and the resulting <xref linkend="figu-Component_Reference-richcolumn-Column_spanning_example" /> show the first column spanning a width of three columns, with the others broken onto the following line.
+ Columns can be merged by using the <varname>colspan</varname> attribute to specify how many normal columns to span. The <varname>colspan</varname> attribute is used in conjunction with the <varname>breakBefore</varname> attribute on the next column to determine how the merged columns are laid out. <xref linkend="exam-Component_Reference-richcolumn-Column_spanning_example" />.
</para>
<example id="exam-Component_Reference-richcolumn-Column_spanning_example">
<title>Column spanning example</title>
@@ -96,14 +103,21 @@
</rich:dataTable>
</programlisting>
</example>
- <figure id="figu-Component_Reference-richcolumn-Column_spanning_example">
- <title>Column spanning example</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-richcolumn-Column_spanning_example.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </figure>
+ <blockquote>
+ <figure id="figu-Component_Reference-richcolumn-Column_spanning_example">
+ <title>Column spanning example</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-richcolumn-Column_spanning_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ The result of the column spanning example, showing the first column (the state flag column) spanning a width of three columns, with the others broken onto the following line.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
<para>
Similarly, the <varname>rowspan</varname> attribute can be used to merge and span rows. Again the <varname>breakBefore</varname> attribute needs to be used on related <sgmltag><rich:column></sgmltag> components to define the layout. <xref linkend="exam-Component_Reference-richcolumn-Row_spanning_example" /> and the resulting <xref linkend="figu-Component_Reference-richcolumnGroup-Complex_headers_using_column_groups" /> show the first column of the table spanning three rows.
</para>
@@ -129,14 +143,21 @@
</rich:dataTable>
</programlisting>
</example>
- <figure id="figu-Component_Reference-richcolumn-Row_spanning_example">
- <title>Row spanning example</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-richcolumn-Row_spanning_example.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </figure>
+ <blockquote>
+ <figure id="figu-Component_Reference-richcolumn-Row_spanning_example">
+ <title>Row spanning example</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-richcolumn-Row_spanning_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ The result of the row spanning example, showing the first column of the table spanning three rows.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
<para>
For details on filtering and sorting columns, refer to <xref linkend="sect-Component_Reference-Tables_and_grids-Table_filtering" /> and <xref linkend="sect-Component_Reference-Tables_and_grids-Table_sorting" />.
</para>
@@ -216,14 +237,21 @@
</rich:dataTable>
</programlisting>
</example>
- <figure id="figu-Component_Reference-richcolumnGroup-Complex_headers_using_column_groups">
- <title>Complex headers using column groups</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-richcolumnGroup-Complex_headers_using_column_groups.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </figure>
+ <blockquote>
+ <figure id="figu-Component_Reference-richcolumnGroup-Complex_headers_using_column_groups">
+ <title>Complex headers using column groups</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-richcolumnGroup-Complex_headers_using_column_groups.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A table with a complex header, where three of the columns are grouped together under a common title.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
</section>
<section id="sect-Component_Reference-Tables_and_grids-richcolumns">
@@ -270,6 +298,7 @@
</para>
<example id="exam-Component_Reference-richcolumns-Using_richcolumns_and_richcolumn_together">
<title>Using <sgmltag><rich:columns></sgmltag> and <sgmltag><rich:column></sgmltag> together</title>
+
<programlisting language="XML" role="XML">
<rich:dataTable value="#{dataTableScrollerBean.model}" var="model" width="500px" rows="5">
<f:facet name="header">
@@ -301,11 +330,65 @@
</para>
</section>
- <section id="sect-Component_Reference-Trees-richdataDefinitionList">
+ <section id="sect-Component_Reference-Tables_and_grids-richdataDefinitionList">
<title><sgmltag><rich:dataDefinitionList></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ component-type: <classname>org.richfaces.DataDefinitionList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-class: <classname>org.richfaces.component.html.HtmlDataDefinitionList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-family: <classname>org.richfaces.DataDefinitionList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ renderer-type: <classname>org.richfaces.DataDefinitionListRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ tag-class: <classname>org.richfaces.taglib.DataDefinitionListTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
- Incomplete
+ The <sgmltag><rich:dataDefinitionList></sgmltag> component renders a list of items with definitions. The component uses a data model for managing the list items, which can be updated dynamically.
</para>
+ <para>
+ The <varname>var</varname> attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the <varname>value</varname> attribute by using EL (Expression Lanugage). The <varname>first</varname> attribute specifies which item in the data model to show first, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute is used for a floating tool-tip. <xref linkend="exam-Component_Reference-richdataDefinitionList-richdataDefinitionList_example" /> shows a simple example using the <sgmltag><rich:dataDefinitionList></sgmltag> component.
+ </para>
+ <example id="exam-Component_Reference-richdataDefinitionList-richdataDefinitionList_example">
+ <title><sgmltag><rich:dataDefinitionList></sgmltag> example</title>
+
+<programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Trees-richdataDefinitionList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ <blockquote>
+ <figure id="figu-Component_Reference-richdataDefinitionList_example-richdataDefinitionList_example">
+ <title><sgmltag><rich:dataDefinitionList></sgmltag> example</title>
+ <mediaobject>
+ <imageobject role="html">
+ <imagedata fileref="images/figu-Component_Reference-Trees-richdataDefinitionList_example.png" format="PNG" />
+ </imageobject>
+ <imageobject role="fo">
+ <imagedata fileref="images/figu-Component_Reference-Trees-richdataDefinitionList_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A list of cars with their price and mileage displayed as a data definition.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
+ </example>
</section>
<section id="sect-Component_Reference-Tables_and_grids-richdataFilterSlider">
@@ -349,6 +432,27 @@
<para>
The event defined with the <varname>submitOnSlide</varname> attribute is triggered when the handle value on the slider is changed.
</para>
+ <example id="exam-Component_Reference-richdataFilterSlider-richdataFilterSlider_example">
+ <title><sgmltag><rich:dataFilterSlider></sgmltag> example</title>
+
+<programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-Tables_and_grids-richdataFilterSlider_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ <blockquote>
+ <figure id="figu-Component_Reference-richdataFilterSlider-richdataFilterSlider_example">
+ <title><sgmltag><rich:dataFilterSlider></sgmltag> example</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-richdataFilterSlider-richdataFilterSlider_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A table of car details, filtered using a slider.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
+ </example>
</section>
<section id="sect-Component_Reference-Tables_and_grids-richdataGrid">
@@ -391,7 +495,7 @@
</imageobject>
<textobject>
<para>
- The rich:dataGrid component displaying four elements in two columns, with a <literal>header</literal> facet, and <literal>footer</literal> facet containing a data scroller component.
+ The <sgmltag><rich:dataGrid></sgmltag> component displaying four elements in two columns, with a <literal>header</literal> facet, and <literal>footer</literal> facet containing a data-scrolling component.
</para>
</textobject>
</mediaobject>
@@ -401,24 +505,25 @@
</para>
<example id="exam-Component_Reference-richdataGrid-richdataGrid_example">
<title><sgmltag><rich:dataGrid></sgmltag> example</title>
+
<programlisting language="XML" role="XML">
-<xi:include parse="text" href="extras/exam-Component_Reference-richdataGrid-richdataGrid_example.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<xi:include href="extras/exam-Component_Reference-richdataGrid-richdataGrid_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
- <blockquote>
- <figure id="figu-Component_Reference-richdataGrid-richdataGrid_example">
- <title>rich:dataGrid example</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/figu-Component_Reference-richdataGrid-richdataGrid_example.png" format="PNG" />
- </imageobject>
- <textobject>
- <para>
- The result of the <sgmltag><rich:dataGrid></sgmltag> example, with the <literal>header</literal> facet, <literal>footer</literal> facet, and first element annotated.
- </para>
- </textobject>
- </mediaobject>
- </figure>
- </blockquote>
+ <blockquote>
+ <figure id="figu-Component_Reference-richdataGrid_example-richdataGrid_example">
+ <title><sgmltag><rich:dataGrid></sgmltag> example</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-richdataGrid-richdataGrid_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ The result of the <sgmltag><rich:dataGrid></sgmltag> example, with the <literal>header</literal> facet, <literal>footer</literal> facet, and first element annotated.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
</example>
<para>
The <sgmltag><rich:dataGrid></sgmltag> component can be used with the <sgmltag><rich:dataScroller></sgmltag> component to display multiple pages of grids. Refer to <xref linkend="sect-Component_Reference-Tables_and_grids-richdataScroller" /> for details on the <sgmltag><rich:dataScroller></sgmltag> component.
@@ -428,6 +533,7 @@
</para>
<example id="exam-Component_Reference-richdataGrid-ajaxKeys_example">
<title><varname>ajaxKeys</varname> example</title>
+
<programlisting language="XML" role="XML">
<rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}" binding="#{listBean.dataGrid}" id="grid" elements="4" columns="2">
...
@@ -438,14 +544,94 @@
</example>
</section>
- <section id="sect-Component_Reference-Trees-richdataList">
+ <section id="sect-Component_Reference-Tables_and_grids-richdataList">
<title><sgmltag><rich:dataList></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ component-type: <classname>org.richfaces.DataList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-class: <classname>org.richfaces.component.html.HtmlDataList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ component-family: <classname>org.richfaces.DataList</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ renderer-type: <classname>org.richfaces.DataListRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ tag-class: <classname>org.richfaces.taglib.DataListTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
- Incomplete
+ The <sgmltag><rich:dataList></sgmltag> component renders an unordered list of items. The component uses a data model for managing the list items, which can be updated dynamically.
</para>
+ <para>
+ The <varname>type</varname> attribute refers to the appearance of the bullet points. The values of the attribute correspond to the <varname>type</varname> parameter for the <sgmltag><ul></sgmltag> HTML element:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><literal>circle</literal></term>
+ <listitem>
+ <para>
+ Displays an unfilled circle as a bullet point.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>disc</literal></term>
+ <listitem>
+ <para>
+ Displays a filled disc as a bullet point.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>square</literal></term>
+ <listitem>
+ <para>
+ Displays a square as a bullet point.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ The <varname>var</varname> attribute names a variable for iterating through the items in the data model. The items to iterate through are determined with the <varname>value</varname> attribute by using EL (Expression Lanugage). The <varname>first</varname> attribute specifies which item in the data model to show first, and the <varname>rows</varname> attribute specifies the number of items to list. The <varname>title</varname> attribute is used for a floating tool-tip. <xref linkend="exam-Component_Reference-richdataDefinitionList-richdataDefinitionList_example" /> shows a simple example using the <sgmltag><rich:dataDefinitionList></sgmltag> component.
+ </para>
+ <example id="exam-Component_Reference-richdataList-richdataList_example">
+ <title><sgmltag><rich:dataList></sgmltag> example</title>
+
+<programlisting language="XML" role="XML"><xi:include href="extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ <blockquote>
+ <figure id="figu-Component_Reference-richdataList_example-richdataList_example">
+ <title><sgmltag><rich:dataList></sgmltag> example</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-richdataList-richdataList_example.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A list of cars displayed in a list with bullet points.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
+ </example>
</section>
- <section id="sect-Component_Reference-Trees-richdataOrderedList">
+ <section id="sect-Component_Reference-Tables_and_grids-richdataOrderedList">
<title><sgmltag><rich:dataOrderedList></sgmltag></title>
<para>
Incomplete
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Trees.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Trees.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Trees.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -6,7 +6,6 @@
<para>
Incomplete
</para>
-
<section id="sect-Component_Reference-Trees-richchangeExpandListener">
<title><sgmltag><rich:changeExpandListener></sgmltag></title>
<para>
Modified: root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml 2010-04-23 00:12:50 UTC (rev 16797)
+++ root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Validation.xml 2010-04-23 07:09:12 UTC (rev 16798)
@@ -63,16 +63,16 @@
<para>
The validation is performed using the <classname>ValidationBean</classname> class:
</para>
-
+
<programlisting language="Java" role="JAVA">
<xi:include href="extras/exam-Component_Reference-ValidationBean.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
<blockquote>
- <figure id="figu-Component_Reference-richajaxValidator-richajaxValidator_example_result">
+ <figure id="figu-Component_Reference-Using_richajaxValidator_with_Hibernate_Validator-richajaxValidator_example_result">
<title><sgmltag><rich:ajaxValidator></sgmltag> example result</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/figu-Component_Reference-richajaxValidator-richajaxValidator_example_result.png" format="PNG" />
+ <imagedata fileref="images/figu-Component_Reference-richajaxValidator-richajaxValidator_example_result.png" format="PNG" width="444" />
</imageobject>
<textobject>
<para>
@@ -137,11 +137,11 @@
<xi:include href="extras/exam-Component_Reference-ValidationBean.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
<blockquote>
- <figure id="figu-Component_Reference-richbeanValidator-richbeanValidator_example_result">
+ <figure id="figu-Component_Reference-richbeanValidator_example-richbeanValidator_example_result">
<title><sgmltag><rich:beanValidator></sgmltag> example result</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/figu-Component_Reference-richbeanValidator-richbeanValidator_example_result.png" format="PNG" />
+ <imagedata fileref="images/figu-Component_Reference-richbeanValidator-richbeanValidator_example_result.png" format="PNG" width="444" />
</imageobject>
<textobject>
<para>
@@ -206,11 +206,11 @@
<xi:include href="extras/exam-Component_Reference-ValidationBean.js" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
<blockquote>
- <figure id="figu-Component_Reference-richgraphValidator-richgraphValidator_example_result">
+ <figure id="figu-Component_Reference-richgraphValidator_example-richgraphValidator_example_result">
<title><sgmltag><rich:graphValidator></sgmltag> example result</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/figu-Component_Reference-richgraphValidator-richgraphValidator_example_result.png" format="PNG" />
+ <imagedata fileref="images/figu-Component_Reference-richgraphValidator-richgraphValidator_example_result.png" format="PNG" width="444" />
</imageobject>
<textobject>
<para>
@@ -231,11 +231,11 @@
<xi:include href="extras/exam-Component_Reference-richgraphValidator-Using_the_value_attribute.xml_sample" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
<blockquote>
- <figure id="figu-Component_Reference-richgraphValidator-Result_from_using_the_value_attribute">
+ <figure id="figu-Component_Reference-Using_the_value_attribute-Result_from_using_the_value_attribute">
<title>Result from using the <varname>value</varname> attribute</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/figu-Component_Reference-richgraphValidator-Result_from_using_the_value_attribute.png" format="PNG" />
+ <imagedata fileref="images/figu-Component_Reference-richgraphValidator-Result_from_using_the_value_attribute.png" format="PNG" width="444" />
</imageobject>
<textobject>
<para>
Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-Tables_and_grids-richdataFilterSlider_example.xml_sample
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-Tables_and_grids-richdataFilterSlider_example.xml_sample (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-Tables_and_grids-richdataFilterSlider_example.xml_sample 2010-04-23 07:09:12 UTC (rev 16798)
@@ -0,0 +1,12 @@
+<rich:dataFilterSlider sliderListener="#{mybean.doSlide}"
+ startRange="0"
+ endRange="50000"
+ increment="10000"
+ handleValue="1"
+ for="carIndex"
+ forValRef="inventoryList.carInventory"
+ filterBy="getMileage" />
+
+<h:dataTable id="carIndex">
+ ...
+</h:dataTable>
Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-Trees-richdataDefinitionList_example.xml_sample
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-Trees-richdataDefinitionList_example.xml_sample (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-Trees-richdataDefinitionList_example.xml_sample 2010-04-23 07:09:12 UTC (rev 16798)
@@ -0,0 +1,11 @@
+<h:form>
+ <rich:dataDefinitionList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" first="4" title="Cars">
+ <f:facet name="term">
+ <h:outputText value="#{car.make} #{car.model}"></h:outputText>
+ </f:facet>
+ <h:outputText value="Price:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.price}" /><br/>
+ <h:outputText value="Mileage:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.mileage}" /><br/>
+ </rich:dataDefinitionList>
+</h:form>
Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-richdataList-richdataList_example.xml_sample 2010-04-23 07:09:12 UTC (rev 16798)
@@ -0,0 +1,9 @@
+<h:form>
+ <rich:dataList var="car" value="#{dataTableScrollerBean.allCars}" rows="5" type="disc" title="Car Store">
+ <h:outputText value="#{car.make} #{car.model}"/><br/>
+ <h:outputText value="Price:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.price} "/><br/>
+ <h:outputText value="Mileage:" styleClass="label"></h:outputText>
+ <h:outputText value="#{car.mileage} "/><br/>
+ </rich:dataList>
+</h:form>
Added: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richdataFilterSlider-richdataFilterSlider_example.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richdataFilterSlider-richdataFilterSlider_example.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richdataList-richdataList_example.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richdataList-richdataList_example.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years
JBoss Rich Faces SVN: r16797 - in root/framework/trunk/impl/src/main/java/org/richfaces/resource: css and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-04-22 20:12:50 -0400 (Thu, 22 Apr 2010)
New Revision: 16797
Added:
root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/
root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/AbstractCSSVisitor.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java
Removed:
root/framework/trunk/impl/src/main/java/org/richfaces/resource/CSSCompiler.java
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java
Log:
Dynamic CSS refactoring & fixes
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2010-04-22 15:59:04 UTC (rev 16796)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/AbstractBaseResource.java 2010-04-23 00:12:50 UTC (rev 16797)
@@ -21,17 +21,9 @@
package org.richfaces.resource;
-import org.ajax4jsf.resource.InternetResource;
-import org.richfaces.context.SingletonsContext;
-import org.richfaces.log.RichfacesLogger;
import static org.richfaces.resource.ResourceUtils.millisToSecond;
import static org.richfaces.resource.ResourceUtils.secondToMillis;
-import org.richfaces.util.Util;
-import org.slf4j.Logger;
-import javax.faces.FacesException;
-import javax.faces.component.StateHolder;
-import javax.faces.context.FacesContext;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -44,6 +36,16 @@
import java.util.Map;
import java.util.Map.Entry;
+import javax.faces.FacesException;
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.InternetResource;
+import org.richfaces.context.SingletonsContext;
+import org.richfaces.log.RichfacesLogger;
+import org.richfaces.util.Util;
+import org.slf4j.Logger;
+
/**
* @author Nick Belaevski
* @since 4.0
@@ -184,9 +186,6 @@
}
@Override
- public abstract InputStream getInputStream();
-
- @Override
public String getRequestPath() {
// TODO - cache resource request path in request scope
Deleted: root/framework/trunk/impl/src/main/java/org/richfaces/resource/CSSCompiler.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/CSSCompiler.java 2010-04-22 15:59:04 UTC (rev 16796)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/CSSCompiler.java 2010-04-23 00:12:50 UTC (rev 16797)
@@ -1,280 +0,0 @@
-package org.richfaces.resource;
-
-import com.steadystate.css.parser.CSSOMParser;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
-import org.w3c.css.sac.InputSource;
-import org.w3c.dom.css.CSSImportRule;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-import org.w3c.dom.css.CSSStyleDeclaration;
-import org.w3c.dom.css.CSSStyleRule;
-import org.w3c.dom.css.CSSStyleSheet;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.application.Resource;
-import javax.faces.context.FacesContext;
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Pattern;
-
-public final class CSSCompiler {
-
- private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
- private static final String INVALID_RESOURCE_FORMAT_COLON_ERROR =
- "Invalid resource format. Property ''{0}'' contains more than one colon (:).";
- private static final String INVALID_RESOURCE_FORMAT_NO_LIBRARY_NAME_ERROR =
- "Invalid resource format. Property ''{0}'' cannot be parsed to extract resource name and library name.";
- private static final String INVALID_RESOURCE_FORMAT_ERROR =
- "Invalid resource format. Property ''{0}'' cannot be parsed.";
-
- private CSSCompiler() {
- }
-
- public static InputStream parse(Resource resource) throws IOException {
- FacesContext ctx = FacesContext.getCurrentInstance();
- InputStream stream = new BufferedInputStream(
- new ELEvaluatingInputStream(ctx,
- resource,
- resource.getInputStream()));
- StringBuilder main = new StringBuilder();
- try {
- InputSource source = new InputSource(new InputStreamReader(stream));
- CSSOMParser parser = new CSSOMParser();
- // parse and create a stylesheet composition
- CSSStyleSheet stylesheet = parser.parseStyleSheet(source, null, null);
-
- // now iterate through the dom and inspect.
-
- CSSRuleList ruleList = stylesheet.getCssRules();
- for (int i = 0; i < ruleList.getLength(); i++) {
- CSSRule rule = ruleList.item(i);
- if (rule instanceof CSSImportRule) {
- main.append(rule.getCssText());
- main.append("\r\n");
- } else if (rule instanceof CSSStyleRule) {
- CSSStyleRule styleRule = (CSSStyleRule) rule;
- boolean needAppendSelector = false;
- StringBuilder selector = new StringBuilder();
- selector.append(styleRule.getSelectorText());
- CSSStyleDeclaration styleDeclaration = styleRule.getStyle();
- selector.append("{" + "\r\n");
- for (int j = 0; j < styleDeclaration.getLength(); j++) {
- String property = styleDeclaration.item(j);
- String value = styleDeclaration.getPropertyCSSValue(property).getCssText();
- if (value.startsWith("\"")) {
- //Remove quotas
- value = value.substring(1, value.length() - 1);
- }
- if (value != null && value.trim().length() > 0 && !value.equals("\"\"")) {
- //One of properties of selector is not empty
- needAppendSelector = true;
- selector.append("\t" + property + ":");
- selector.append(value + ";" + "\r\n");
- }
- }
- selector.append("}" + "\r\n");
- if (needAppendSelector) {
- main.append(selector);
- }
- }// end of StyleRule instance test
- } // end of ruleList loop
-
- if (stream != null) {
- stream.close();
- }
- new ByteArrayInputStream(main.toString().getBytes());
- return new ByteArrayInputStream(main.toString().getBytes("US-ASCII"));
- } catch (IOException ioe) {
- LOGGER.warn("IO Error: " + ioe + "while evaluating dynamic CSS");
- } catch (Exception e) {
- LOGGER.warn("Error: " + e + "while evaluating dynamic CSS");
- }
- return null;
- }
-
- private static final class ELEvaluatingInputStream extends InputStream {
-
- // Premature optimization is the root of all evil. Blah blah.
- private List<Integer> buf = new ArrayList<Integer>(1024);
- private boolean failedExpressionTest = false;
- private boolean writingExpression = false;
- private InputStream inner;
- private FacesContext ctx;
- private Resource info;
-
- private int nextRead = -1;
- // ---------------------------------------------------- Constructors
-
-
- public ELEvaluatingInputStream(FacesContext ctx,
- Resource info,
- InputStream inner) {
-
- this.inner = inner;
- this.info = info;
- this.ctx = ctx;
-
- }
-
-
- // ------------------------------------------------ Methods from InputStream
-
-
- @Override
- public int read() throws IOException {
- int i;
- char c;
-
- if (failedExpressionTest) {
- i = nextRead;
- nextRead = -1;
- failedExpressionTest = false;
- } else if (writingExpression) {
- if (0 < buf.size()) {
- i = buf.remove(0);
- } else {
- writingExpression = false;
- i = inner.read();
- }
- } else {
- // Read a character.
- i = inner.read();
- c = (char) i;
- // If it *might* be an expression...
- if (c == '#') {
- // read another character.
- i = inner.read();
- c = (char) i;
- // If it's '{', assume we have an expression.
- if (c == '{') {
- // read it into the buffer, and evaluate it into the
- // same buffer.
- readExpressionIntoBufferAndEvaluateIntoBuffer();
- // set the flag so that we need to return content
- // from the buffer.
- writingExpression = true;
- // Make sure to swallow the '{'.
- i = this.read();
- } else {
- // It's not an expression, we need to return '#',
- i = (int) '#';
- // then return whatever we just read, on the
- // *next* read;
- nextRead = (int) c;
- failedExpressionTest = true;
- }
- }
- }
-
- return i;
- }
-
- private void readExpressionIntoBufferAndEvaluateIntoBuffer()
- throws IOException {
-
- int i;
- char c;
- do {
- i = inner.read();
- c = (char) i;
- if (c == '}') {
- evaluateExpressionIntoBuffer();
- } else {
- buf.add(i);
- }
- } while (c != '}' && i != -1);
- }
-
- /*
- * At this point, we know that getBuf() returns a List<Integer>
- * that contains the bytes of the expression.
- * Turn it into a String, turn the String into a ValueExpression,
- * evaluate it, store the toString() of it in
- * expressionResult;
- */
- private void evaluateExpressionIntoBuffer() {
- char [] chars = new char[buf.size()];
- int len = buf.size();
- for (int i = 0; i < len; i++) {
- chars[i] = (char) (int) buf.get(i);
- }
- String expressionBody = new String(chars);
-
- // If this expression contains a ":"
- int colon = expressionBody.indexOf(":");
- if (-1 != colon) {
- // Make sure it contains only one ":"
- if (!isPropertyValid(expressionBody)) {
- String message = MessageFormat.format(INVALID_RESOURCE_FORMAT_COLON_ERROR,
- expressionBody);
- throw new ELException(message);
- }
- String[] parts = split(expressionBody, ":");
- if (null == parts[0] || null == parts[1]) {
- String message = MessageFormat.format(INVALID_RESOURCE_FORMAT_NO_LIBRARY_NAME_ERROR,
- expressionBody);
- throw new ELException(message);
-
- }
- try {
- int mark = parts[0].indexOf("[") + 2;
- char quoteMark = parts[0].charAt(mark - 1);
- parts[0] = parts[0].substring(mark, colon);
- if (parts[0].equals("this")) {
- parts[0] = info.getLibraryName();
- mark = parts[1].indexOf("]") - 1;
- parts[1] = parts[1].substring(0, mark);
- expressionBody = "resource[" + quoteMark + parts[0] +
- ":" + parts[1] + quoteMark + "]";
- }
- } catch (Exception e) {
- String message = MessageFormat.format(INVALID_RESOURCE_FORMAT_ERROR,
- expressionBody);
- throw new ELException(message);
-
- }
- }
- ELContext elContext = ctx.getELContext();
- ValueExpression ve =
- ctx.getApplication().getExpressionFactory().
- createValueExpression(elContext, "#{" + expressionBody +
- "}", String.class);
- Object value = ve.getValue(elContext);
- String expressionResult = ((value != null) ? value.toString() : "");
- buf.clear();
- int expressionResultLen = expressionResult.length();
- for (int i = 0; i < expressionResultLen; i++) {
- buf.add((int) expressionResult.charAt(i));
- }
- }
-
-
- private String[] split(String expressionBody, String toSplit) {
- return Pattern.compile(expressionBody).split(toSplit, 0);
- }
-
-
- @Override
- public void close() throws IOException {
- inner.close();
- super.close();
-
- }
-
-
- private boolean isPropertyValid(String property) {
- int idx = property.indexOf(':');
- return (property.indexOf(':', idx + 1) == -1);
- }
-
- }
-}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java 2010-04-22 15:59:04 UTC (rev 16796)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/CompiledCSSResource.java 2010-04-23 00:12:50 UTC (rev 16797)
@@ -21,18 +21,36 @@
*/
package org.richfaces.resource;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ValueExpression;
import javax.faces.application.ProjectStage;
import javax.faces.application.Resource;
import javax.faces.context.FacesContext;
-import org.richfaces.application.ServiceTracker;
import org.richfaces.log.RichfacesLogger;
+import org.richfaces.resource.css.CSSVisitorImpl;
+import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
import org.slf4j.Logger;
+import org.w3c.css.sac.CSSException;
+import org.w3c.css.sac.CSSParseException;
+import org.w3c.css.sac.ErrorHandler;
+import org.w3c.css.sac.InputSource;
+import org.w3c.dom.css.CSSStyleSheet;
+import com.steadystate.css.parser.CSSOMParser;
+
/**
* @author amarkhel
* Class, that represented dynamic CSS resource.
@@ -40,9 +58,18 @@
public class CompiledCSSResource extends AbstractBaseResource {
private static final String SKIN = "?skin=";
- private static final String TEXT_CSS = "text/css";
+
private static final Logger LOGGER = RichfacesLogger.RESOURCE.getLogger();
+ private static final String INVALID_RESOURCE_FORMAT_COLON_ERROR =
+ "Invalid resource format. Property ''{0}'' contains more than one colon (:).";
+ private static final String INVALID_RESOURCE_FORMAT_NO_LIBRARY_NAME_ERROR =
+ "Invalid resource format. Property ''{0}'' cannot be parsed to extract resource name and library name.";
+ private static final String INVALID_RESOURCE_FORMAT_ERROR =
+ "Invalid resource format. Property ''{0}'' cannot be parsed.";
+ private static final String NULL_STYLESHEET =
+ "Parsed stylesheet for ''{0}'':''{1}'' resource is null.";
+
private Resource resourceDelegate;
public CompiledCSSResource(Resource resource) {
@@ -50,19 +77,55 @@
}
@Override
- public InputStream getInputStream() {
+ public InputStream getInputStream() throws IOException {
+ FacesContext ctx = FacesContext.getCurrentInstance();
InputStream stream = null;
+ CSSStyleSheet styleSheet = null;
try {
- stream = CSSCompiler.parse(resourceDelegate);
- } catch (IOException ioe) {
- LOGGER.warn("IO Error: " + ioe + "while loading dynamic CSS");
+ stream = new BufferedInputStream(
+ new ELEvaluatingInputStream(ctx,
+ resourceDelegate,
+ resourceDelegate.getInputStream()));
+
+ InputSource source = new InputSource(new InputStreamReader(stream));
+ CSSOMParser parser = new CSSOMParser();
+ ErrorHandlerImpl errorHandler = new ErrorHandlerImpl(resourceDelegate,
+ ctx.isProjectStage(ProjectStage.Production));
+
+ parser.setErrorHandler(errorHandler);
+
+ // parse and create a stylesheet composition
+ styleSheet = parser.parseStyleSheet(source, null, null);
+ } finally {
+ if (stream != null) {
+ try {
+ stream.close();
+ } catch (IOException e) {
+ LOGGER.warn(e.getMessage(), e);
+ }
+ }
}
- return stream;
+
+ if (styleSheet != null) {
+ //TODO nick - handle encoding
+ CSSVisitorImpl cssVisitor = new CSSVisitorImpl();
+ cssVisitor.visitStyleSheet(styleSheet);
+
+ String cssText = cssVisitor.getCSSText();
+
+ return new ByteArrayInputStream(cssText.getBytes("US-ASCII"));
+ } else {
+ if (!ctx.isProjectStage(ProjectStage.Production)) {
+ LOGGER.info(MessageFormat.format(NULL_STYLESHEET, resourceDelegate.getLibraryName(),
+ resourceDelegate.getResourceName()));
+ }
+ return null;
+ }
}
@Override
public String getContentType() {
- return TEXT_CSS;
+ return "text/css";
}
public Resource getResourceDelegate() {
@@ -80,23 +143,264 @@
@Override
public String getRequestPath() {
- StringBuilder b = new StringBuilder();
+ //TODO nick - review
String path = resourceDelegate.getRequestPath();
+
+ StringBuilder b = new StringBuilder(path.length() + SKIN.length() + 8 /* hash code max length */);
b.append(path);
b.append(SKIN);
- b.append(getSkinHashCode());
+ b.append(Integer.toHexString(getSkinHashCode()));
+
return b.toString();
}
private int getSkinHashCode() {
- return ((SkinFactory) ServiceTracker.getService(FacesContext.getCurrentInstance(), SkinFactory.class)).getSkin(FacesContext.getCurrentInstance()).hashCode();
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ Skin skin = SkinFactory.getInstance().getSkin(facesContext);
+ return skin.hashCode(facesContext);
}
@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
+ //TODO nick - review
+ //return resourceDelegate.userAgentNeedsUpdate(context);
+
if (context.isProjectStage(ProjectStage.Development)) {
return true;
}
return super.userAgentNeedsUpdate(context);
}
+
+ private static final class ErrorHandlerImpl implements ErrorHandler {
+
+ //TODO nick - sort out logging between stages
+ private boolean productionStage;
+
+ private Resource resource;
+
+ private String resourceLocator;
+
+ public ErrorHandlerImpl(Resource resource, boolean productionStage) {
+ super();
+ this.resource = resource;
+ this.productionStage = productionStage;
+ }
+
+ private String getResourceLocator() {
+ if (resourceLocator == null) {
+ String libraryName = resource.getLibraryName();
+ String resourceName = resource.getResourceName();
+
+ if (libraryName != null && libraryName.length() != 0) {
+ resourceLocator = libraryName + '/' + resourceName;
+ } else {
+ resourceLocator = resourceName;
+ }
+ }
+
+ return resourceLocator;
+ }
+
+ private void logException(CSSParseException e) {
+ String formattedMessage = MessageFormat.format("Problem parsing ''{0}'' resource: {1}",
+ getResourceLocator(),
+ e.getMessage());
+
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug(formattedMessage, e);
+ } else {
+ LOGGER.warn(formattedMessage);
+ }
+ }
+
+ public void error(CSSParseException e) throws CSSException {
+ logException(e);
+ }
+
+ public void fatalError(CSSParseException e) throws CSSException {
+ logException(e);
+ }
+
+ public void warning(CSSParseException e) throws CSSException {
+ logException(e);
+ }
+
+ }
+
+ private static final class ELEvaluatingInputStream extends InputStream {
+
+ // Premature optimization is the root of all evil. Blah blah.
+ private List<Integer> buf = new ArrayList<Integer>(1024);
+ private boolean failedExpressionTest = false;
+ private boolean writingExpression = false;
+ private InputStream inner;
+ private FacesContext ctx;
+ private Resource info;
+
+ private int nextRead = -1;
+ // ---------------------------------------------------- Constructors
+
+
+ public ELEvaluatingInputStream(FacesContext ctx,
+ Resource info,
+ InputStream inner) {
+
+ this.inner = inner;
+ this.info = info;
+ this.ctx = ctx;
+
+ }
+
+
+ // ------------------------------------------------ Methods from InputStream
+
+
+ @Override
+ public int read() throws IOException {
+ int i;
+ char c;
+
+ if (failedExpressionTest) {
+ i = nextRead;
+ nextRead = -1;
+ failedExpressionTest = false;
+ } else if (writingExpression) {
+ if (0 < buf.size()) {
+ i = buf.remove(0);
+ } else {
+ writingExpression = false;
+ i = inner.read();
+ }
+ } else {
+ // Read a character.
+ i = inner.read();
+ c = (char) i;
+ // If it *might* be an expression...
+ if (c == '#') {
+ // read another character.
+ i = inner.read();
+ c = (char) i;
+ // If it's '{', assume we have an expression.
+ if (c == '{') {
+ // read it into the buffer, and evaluate it into the
+ // same buffer.
+ readExpressionIntoBufferAndEvaluateIntoBuffer();
+ // set the flag so that we need to return content
+ // from the buffer.
+ writingExpression = true;
+ // Make sure to swallow the '{'.
+ i = this.read();
+ } else {
+ // It's not an expression, we need to return '#',
+ i = (int) '#';
+ // then return whatever we just read, on the
+ // *next* read;
+ nextRead = (int) c;
+ failedExpressionTest = true;
+ }
+ }
+ }
+
+ return i;
+ }
+
+ private void readExpressionIntoBufferAndEvaluateIntoBuffer()
+ throws IOException {
+
+ int i;
+ char c;
+ do {
+ i = inner.read();
+ c = (char) i;
+ if (c == '}') {
+ evaluateExpressionIntoBuffer();
+ } else {
+ buf.add(i);
+ }
+ } while (c != '}' && i != -1);
+ }
+
+ /*
+ * At this point, we know that getBuf() returns a List<Integer>
+ * that contains the bytes of the expression.
+ * Turn it into a String, turn the String into a ValueExpression,
+ * evaluate it, store the toString() of it in
+ * expressionResult;
+ */
+ private void evaluateExpressionIntoBuffer() {
+ char [] chars = new char[buf.size()];
+ int len = buf.size();
+ for (int i = 0; i < len; i++) {
+ chars[i] = (char) (int) buf.get(i);
+ }
+ String expressionBody = new String(chars);
+
+ // If this expression contains a ":"
+ int colon = expressionBody.indexOf(":");
+ if (-1 != colon) {
+ // Make sure it contains only one ":"
+ if (!isPropertyValid(expressionBody)) {
+ String message = MessageFormat.format(INVALID_RESOURCE_FORMAT_COLON_ERROR,
+ expressionBody);
+ throw new ELException(message);
+ }
+ String[] parts = split(expressionBody, ":");
+ if (null == parts[0] || null == parts[1]) {
+ String message = MessageFormat.format(INVALID_RESOURCE_FORMAT_NO_LIBRARY_NAME_ERROR,
+ expressionBody);
+ throw new ELException(message);
+
+ }
+ try {
+ int mark = parts[0].indexOf("[") + 2;
+ char quoteMark = parts[0].charAt(mark - 1);
+ parts[0] = parts[0].substring(mark, colon);
+ if (parts[0].equals("this")) {
+ parts[0] = info.getLibraryName();
+ mark = parts[1].indexOf("]") - 1;
+ parts[1] = parts[1].substring(0, mark);
+ expressionBody = "resource[" + quoteMark + parts[0] +
+ ":" + parts[1] + quoteMark + "]";
+ }
+ } catch (Exception e) {
+ String message = MessageFormat.format(INVALID_RESOURCE_FORMAT_ERROR,
+ expressionBody);
+ throw new ELException(message);
+
+ }
+ }
+ ELContext elContext = ctx.getELContext();
+ ValueExpression ve =
+ ctx.getApplication().getExpressionFactory().
+ createValueExpression(elContext, "#{" + expressionBody +
+ "}", String.class);
+ Object value = ve.getValue(elContext);
+ String expressionResult = ((value != null) ? value.toString() : "");
+ buf.clear();
+ int expressionResultLen = expressionResult.length();
+ for (int i = 0; i < expressionResultLen; i++) {
+ buf.add((int) expressionResult.charAt(i));
+ }
+ }
+
+
+ private String[] split(String expressionBody, String toSplit) {
+ return Pattern.compile(expressionBody).split(toSplit, 0);
+ }
+
+
+ @Override
+ public void close() throws IOException {
+ inner.close();
+ super.close();
+
+ }
+
+
+ private boolean isPropertyValid(String property) {
+ int idx = property.indexOf(':');
+ return (property.indexOf(':', idx + 1) == -1);
+ }
+
+ }
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-04-22 15:59:04 UTC (rev 16796)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/ResourceHandlerImpl.java 2010-04-23 00:12:50 UTC (rev 16797)
@@ -21,15 +21,15 @@
package org.richfaces.resource;
-import org.ajax4jsf.cache.Cache;
-import org.ajax4jsf.cache.CacheManager;
-import org.ajax4jsf.resource.Java2Dresource;
-import org.richfaces.context.AttributesContext;
-import org.richfaces.context.SingletonsContext;
-import org.richfaces.log.RichfacesLogger;
-import org.richfaces.util.RequestStateManager.BooleanRequestStateVariable;
-import org.richfaces.util.Util;
-import org.slf4j.Logger;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.text.MessageFormat;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
import javax.faces.application.ProjectStage;
import javax.faces.application.Resource;
@@ -40,16 +40,17 @@
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.Date;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Map.Entry;
+import org.ajax4jsf.cache.Cache;
+import org.ajax4jsf.cache.CacheManager;
+import org.ajax4jsf.resource.Java2Dresource;
+import org.richfaces.context.AttributesContext;
+import org.richfaces.context.SingletonsContext;
+import org.richfaces.log.RichfacesLogger;
+import org.richfaces.util.Util;
+import org.richfaces.util.RequestStateManager.BooleanRequestStateVariable;
+import org.slf4j.Logger;
+
/**
* @author Nick Belaevski
* @since 4.0
@@ -469,7 +470,7 @@
result = createHandlerDependentResource(resourceName, params);
} else {
result = defaultHandler.createResource(resourceName, libraryName, contentType);
- if (resourceName.indexOf(".ecss") != -1) {
+ if (result != null && resourceName.endsWith(".ecss")) {
result = new CompiledCSSResource(result);
}
}
@@ -497,9 +498,10 @@
@Override
public String getRendererTypeForResourceName(String resourceName) {
- if (resourceName.indexOf(".ecss") != -1) {
+ if (resourceName.endsWith(".ecss")) {
return "javax.faces.resource.Stylesheet";
}
+
return defaultHandler.getRendererTypeForResourceName(resourceName);
}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java 2010-04-22 15:59:04 UTC (rev 16796)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/Xcss2EcssConverter.java 2010-04-23 00:12:50 UTC (rev 16797)
@@ -1,21 +1,20 @@
package org.richfaces.resource;
import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
-import java.io.IOException;
-import java.net.URLDecoder;
+import java.net.URLEncoder;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.Attributes;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.ParserConfigurationException;
-
public final class Xcss2EcssConverter {
private Xcss2EcssConverter() {
@@ -132,7 +131,7 @@
ecssContent.append(name);
ecssContent.append("=");
try {
- ecssContent.append(URLDecoder.decode(value, "UTF-8"));
+ ecssContent.append(URLEncoder.encode(value, "UTF-8"));
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Added: root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/AbstractCSSVisitor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/AbstractCSSVisitor.java (rev 0)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/AbstractCSSVisitor.java 2010-04-23 00:12:50 UTC (rev 16797)
@@ -0,0 +1,153 @@
+/*
+ * 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.css;
+
+import org.w3c.dom.css.CSSCharsetRule;
+import org.w3c.dom.css.CSSFontFaceRule;
+import org.w3c.dom.css.CSSImportRule;
+import org.w3c.dom.css.CSSMediaRule;
+import org.w3c.dom.css.CSSPageRule;
+import org.w3c.dom.css.CSSRule;
+import org.w3c.dom.css.CSSRuleList;
+import org.w3c.dom.css.CSSStyleDeclaration;
+import org.w3c.dom.css.CSSStyleRule;
+import org.w3c.dom.css.CSSStyleSheet;
+import org.w3c.dom.css.CSSUnknownRule;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public abstract class AbstractCSSVisitor {
+
+ public void visitStyleSheet(CSSStyleSheet styleSheet) {
+ startStyleSheet(styleSheet);
+
+ CSSRuleList rules = styleSheet.getCssRules();
+ int length = rules.getLength();
+ for (int i = 0; i < length; i++) {
+ CSSRule rule = rules.item(i);
+ visitRule(rule);
+ }
+
+ endStyleSheet(styleSheet);
+ }
+
+ public void visitRule(CSSRule rule) {
+ switch (rule.getType()) {
+ case CSSRule.UNKNOWN_RULE:
+ visitUnknownRule((CSSUnknownRule) rule);
+ break;
+
+ case CSSRule.STYLE_RULE:
+ visitStyleRule((CSSStyleRule) rule);
+ break;
+
+ case CSSRule.CHARSET_RULE:
+ visitCharsetRule((CSSCharsetRule) rule);
+ break;
+
+ case CSSRule.IMPORT_RULE:
+ visitImportRule((CSSImportRule) rule);
+ break;
+
+ case CSSRule.MEDIA_RULE:
+ visitMediaRule((CSSMediaRule) rule);
+ break;
+
+ case CSSRule.FONT_FACE_RULE:
+ visitFontFaceRule((CSSFontFaceRule) rule);
+ break;
+
+ case CSSRule.PAGE_RULE:
+ visitPageRule((CSSPageRule) rule);
+ break;
+
+ default:
+ throw new IllegalArgumentException();
+ }
+ }
+
+ protected abstract void startStyleSheet(CSSStyleSheet styleSheet);
+
+ protected abstract void endStyleSheet(CSSStyleSheet styleSheet);
+
+ public abstract void visitUnknownRule(CSSUnknownRule rule);
+
+ public void visitStyleRule(CSSStyleRule rule) {
+ startStyleRule(rule);
+ CSSStyleDeclaration style = rule.getStyle();
+ visitStyleDeclaration(style);
+ endStyleRule(rule);
+ }
+
+ protected abstract void startStyleRule(CSSStyleRule rule);
+
+ protected abstract void endStyleRule(CSSStyleRule rule);
+
+ public abstract void visitCharsetRule(CSSCharsetRule rule);
+
+ public abstract void visitImportRule(CSSImportRule rule);
+
+ public void visitMediaRule(CSSMediaRule rule) {
+ startMediaRule(rule);
+
+ CSSRuleList rules = rule.getCssRules();
+ int length = rules.getLength();
+ for (int i = 0; i < length; i++) {
+ CSSRule childRule = rules.item(i);
+ visitRule(childRule);
+ }
+
+
+ endMediaRule(rule);
+ }
+
+ protected abstract void startMediaRule(CSSMediaRule rule);
+
+ protected abstract void endMediaRule(CSSMediaRule rule);
+
+ public void visitFontFaceRule(CSSFontFaceRule rule) {
+ startFontRule(rule);
+ CSSStyleDeclaration style = rule.getStyle();
+ visitStyleDeclaration(style);
+ endFontRule(rule);
+ }
+
+ protected abstract void startFontRule(CSSFontFaceRule rule);
+
+ protected abstract void endFontRule(CSSFontFaceRule rule);
+
+ public void visitPageRule(CSSPageRule rule) {
+ startPageRule(rule);
+ CSSStyleDeclaration style = rule.getStyle();
+ visitStyleDeclaration(style);
+ endPageRule(rule);
+ }
+
+ protected abstract void startPageRule(CSSPageRule rule);
+
+ protected abstract void endPageRule(CSSPageRule rule);
+
+ public abstract void visitStyleDeclaration(CSSStyleDeclaration styleDeclaration);
+
+}
Added: root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java (rev 0)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/css/CSSVisitorImpl.java 2010-04-23 00:12:50 UTC (rev 16797)
@@ -0,0 +1,190 @@
+/*
+ * 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.css;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.w3c.dom.css.CSSCharsetRule;
+import org.w3c.dom.css.CSSFontFaceRule;
+import org.w3c.dom.css.CSSImportRule;
+import org.w3c.dom.css.CSSMediaRule;
+import org.w3c.dom.css.CSSPageRule;
+import org.w3c.dom.css.CSSRule;
+import org.w3c.dom.css.CSSStyleDeclaration;
+import org.w3c.dom.css.CSSStyleRule;
+import org.w3c.dom.css.CSSStyleSheet;
+import org.w3c.dom.css.CSSUnknownRule;
+import org.w3c.dom.stylesheets.MediaList;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public final class CSSVisitorImpl extends AbstractCSSVisitor {
+
+ private static final String NEW_LINE = "\r\n";
+
+ private String encoding;
+
+ private StringBuilder buffer = new StringBuilder();
+
+ private List<String> prefixes = new ArrayList<String>(2);
+
+ private void appendCSSText(CSSRule rule) {
+ String cssText = rule.getCssText().trim();
+
+ //TODO nick - escape values
+ if (cssText.length() != 0) {
+ buffer.append(cssText);
+ buffer.append(NEW_LINE);
+ }
+ }
+
+ private void flushPrefixes() {
+ if (!prefixes.isEmpty()) {
+ for (String prefix : prefixes) {
+ buffer.append(prefix);
+ buffer.append(" {");
+ buffer.append(NEW_LINE);
+ }
+
+ prefixes.clear();
+ }
+ }
+
+ private void flushSuffix() {
+ if (prefixes.isEmpty()) {
+ buffer.append('}');
+ buffer.append(NEW_LINE);
+ }
+ }
+
+ @Override
+ public void visitUnknownRule(CSSUnknownRule rule) {
+ appendCSSText(rule);
+ }
+
+ @Override
+ public void visitCharsetRule(CSSCharsetRule rule) {
+ encoding = rule.getEncoding();
+
+ appendCSSText(rule);
+ }
+
+ @Override
+ public void visitImportRule(CSSImportRule rule) {
+ //TODO nick - process imported stylesheet?
+ appendCSSText(rule);
+ }
+
+ @Override
+ protected void startFontRule(CSSFontFaceRule rule) {
+ prefixes.add("@font-face");
+ }
+
+ @Override
+ protected void endFontRule(CSSFontFaceRule rule) {
+ flushSuffix();
+ }
+
+ @Override
+ protected void startMediaRule(CSSMediaRule rule) {
+ MediaList mediaList = rule.getMedia();
+ String mediaText = mediaList.getMediaText();
+ prefixes.add("@media " + mediaText);
+ }
+
+ @Override
+ protected void endMediaRule(CSSMediaRule rule) {
+ flushSuffix();
+ }
+
+ @Override
+ protected void startPageRule(CSSPageRule rule) {
+ String selectorText = rule.getSelectorText();
+
+ //TODO nick - multiple selectors?
+ prefixes.add("@page " + selectorText);
+ }
+
+ @Override
+ protected void endPageRule(CSSPageRule rule) {
+ flushSuffix();
+ }
+
+ @Override
+ protected void startStyleRule(CSSStyleRule rule) {
+ String selectorText = rule.getSelectorText();
+ prefixes.add(selectorText);
+ }
+
+ @Override
+ protected void endStyleRule(CSSStyleRule rule) {
+ flushSuffix();
+ }
+
+ @Override
+ protected void startStyleSheet(CSSStyleSheet styleSheet) {
+ }
+
+ @Override
+ protected void endStyleSheet(CSSStyleSheet styleSheet) {
+ }
+
+ @Override
+ public void visitStyleDeclaration(CSSStyleDeclaration styleDeclaration) {
+ for (int j = 0; j < styleDeclaration.getLength(); j++) {
+ String propertyName = styleDeclaration.item(j);
+
+ String value = styleDeclaration.getPropertyValue(propertyName).trim();
+ String priority = styleDeclaration.getPropertyPriority(propertyName);
+
+ if (value.length() != 0 && !value.equals("\"\"") && !value.equals("''")) {
+ flushPrefixes();
+
+ //One of properties of selector is not empty
+ buffer.append('\t');
+ buffer.append(propertyName);
+ buffer.append(": ");
+
+ buffer.append(value);
+
+ if (priority != null && priority.length() != 0) {
+ buffer.append(" !");
+ buffer.append(priority);
+ }
+
+ buffer.append(";");
+ buffer.append(NEW_LINE);
+ }
+ }
+ }
+
+ public String getEncoding() {
+ return encoding;
+ }
+
+ public String getCSSText() {
+ return buffer.toString();
+ }
+}
14 years
JBoss Rich Faces SVN: r16796 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-04-22 11:59:04 -0400 (Thu, 22 Apr 2010)
New Revision: 16796
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
Log:
RF-7826 Migrate A1 components to new CDK
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2010-04-22 10:50:04 UTC (rev 16795)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributesProcessorImpl.java 2010-04-22 15:59:04 UTC (rev 16796)
@@ -133,21 +133,21 @@
private String getPimitiveDefaultValue(String typeName) {
if (isInstace(boolean.class, typeName)) {
- return String.valueOf(false);
+ return "false";
} else if (isInstace(int.class, typeName)) {
- return String.valueOf(Integer.MIN_VALUE);
+ return "Integer.MIN_VALUE";
} else if (isInstace(long.class, typeName)) {
- return String.valueOf(Long.MIN_VALUE);
+ return "Long.MIN_VALUE";
} else if (isInstace(byte.class, typeName)) {
- return String.valueOf(Byte.MIN_VALUE);
+ return "Byte.MIN_VALUE";
} else if (isInstace(short.class, typeName)) {
- return String.valueOf(Short.MIN_VALUE);
+ return "Short.MIN_VALUE";
} else if (isInstace(float.class, typeName)) {
- return String.valueOf(Float.MIN_VALUE);
+ return "Float.MIN_VALUE";
} else if (isInstace(double.class, typeName)) {
- return String.valueOf(Double.MIN_VALUE);
+ return "Double.MIN_VALUE";
} else if (isInstace(char.class, typeName)) {
- return String.valueOf(Character.MIN_VALUE);
+ return "Character.MIN_VALUE";
}
return null;
14 years
JBoss Rich Faces SVN: r16795 - root/ui/trunk/components/core/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-04-22 06:50:04 -0400 (Thu, 22 Apr 2010)
New Revision: 16795
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAttachQueue.java
Log:
RF-7826 Migrate A1 components to new CDK
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAttachQueue.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAttachQueue.java 2010-04-22 10:17:07 UTC (rev 16794)
+++ root/ui/trunk/components/core/src/main/java/org/richfaces/component/AbstractAttachQueue.java 2010-04-22 10:50:04 UTC (rev 16795)
@@ -33,7 +33,7 @@
*/
@JsfComponent(
tag = @Tag(name = "attachQueue",
- handler = "org.richfaces.taglib.html.facelets.AttachQueueHandler",
+ handler = "org.richfaces.view.facelets.html.AttachQueueHandler",
generate = false, type = TagType.Facelets)
)
public abstract class AbstractAttachQueue extends UIComponentBase {
14 years