Author: nbelaevski
Date: 2010-10-27 12:01:55 -0400 (Wed, 27 Oct 2010)
New Revision: 19701
Added:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-extensions.xsd
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/add-attributes-to-script-hash.ftl
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/script-object.ftl
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/script-option.ftl
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/AddAttributesToScriptHashTest.java
Modified:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-composite.xsd
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-jstl-core.xsd
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-template.xsd
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/xhtml-el.xsd
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/component.ftl
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/class.ftl
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/util.ftl
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/write-boolean-attribute.ftl
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/model/TemplateParserTest.java
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/ELParserTest.java
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/FreeMarkerTemplateStatementTest.java
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/WriteAttributesSetTest.java
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/Html5Attributes.java
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/templates/testComponent.xml
Log:
Merged revisions
19156-19157,19159-19160,19176,19186-19187,19190,19194,19196,19199,19203-19204,19231-19234,19248-19249,19255-19256,19258-19262,19276,19279-19281,19283,19285,19291-19299,19307,19312,19315,19318-19319,19325,19341-19342,19345-19351,19353-19355,19358-19359,19364,19367-19369,19371,19374-19377,19379-19385,19387,19393-19394,19400,19402-19404,19418-19422,19426,19430-19431,19434-19441,19443-19444,19446,19468,19470,19477,19491,19498-19499,19501,19504,19506-19507,19517-19519,19525,19542-19543,19548,19550,19555,19557,19560-19561,19565-19566,19571-19573,19582-19585,19592-19593,19599,19601-19602,19613,19646,19657-19659,19665,19671-19674
via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
Modified:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-composite.xsd
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-composite.xsd 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-composite.xsd 2010-10-27
16:01:55 UTC (rev 19701)
@@ -19,10 +19,9 @@
<xs:schema
targetNamespace="http://jboss.org/schema/richfaces/cdk/jsf/composite...
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
-
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
- <xs:import schemaLocation="cdk-template.xsd"
namespace="http://jboss.org/schema/richfaces/cdk/core" />
<xs:annotation>
<xs:documentation>
@@ -308,7 +307,7 @@
<xs:complexType name="compositeImplementationType"
mixed="true">
<xs:choice>
- <xs:any minOccurs="0" maxOccurs="unbounded"
processContents="lax" />
+ <xs:any minOccurs="0" maxOccurs="unbounded"
processContents="lax" namespace="##other " />
</xs:choice>
</xs:complexType>
Copied:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-extensions.xsd (from
rev 19674, trunk/cdk/generator/src/main/resources/META-INF/schema/cdk-extensions.xsd)
===================================================================
--- branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-extensions.xsd
(rev 0)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-extensions.xsd 2010-10-27
16:01:55 UTC (rev 19701)
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
targetNamespace="http://jboss.org/schema/richfaces/cdk/ext"
xmlns="http://jboss.org/schema/richfaces/cdk/ext"
+ elementFormDefault="qualified">
+
+ <xs:simpleType name="beanAttribute">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="[a-zA-Z][a-zA-Z_]*" />
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:attributeGroup name="attrs">
+ <xs:attributeGroup ref="coreattrs" />
+ <xs:attributeGroup ref="i18n" />
+ <xs:attributeGroup ref="events" />
+ </xs:attributeGroup>
+ <xs:attributeGroup name="coreattrs">
+ <xs:annotation>
+ <xs:documentation>
+ core attributes common to most elements
+ id
+ document-wide unique id
+ class space separated list of classes
+ style
+ associated style info
+ title advisory title/amplification
+ </xs:documentation>
+ </xs:annotation>
+ <xs:attribute ref="id" />
+ <xs:attribute ref="style" />
+ <xs:attribute ref="title" />
+ </xs:attributeGroup>
+
+ <xs:attribute name="id" type="beanAttribute" />
+ <xs:attribute name="style" type="beanAttribute" />
+ <xs:attribute name="title" type="beanAttribute" />
+
+ <xs:attributeGroup name="i18n">
+ <xs:annotation>
+ <xs:documentation>
+ internationalization attributes
+ lang language code
+ (backwards compatible)
+ xml:lang language code (as per XML 1.0 spec)
+ dir direction for weak/neutral text
+ </xs:documentation>
+ </xs:annotation>
+ <xs:attribute ref="lang" />
+ </xs:attributeGroup>
+ <xs:attribute name="lang" type="beanAttribute" />
+
+ <xs:attributeGroup name="classGroup">
+ <xs:attribute ref="class" />
+ </xs:attributeGroup>
+ <xs:attribute name="class" type="beanAttribute" />
+
+ <xs:attributeGroup name="events">
+ <xs:annotation>
+ <xs:documentation>
+ attributes for common UI events
+ onclick a pointer
+ button was clicked
+ ondblclick a pointer button was double clicked
+ onmousedown a pointer button was pressed down
+ onmouseup a pointer
+ button was released
+ onmousemove a pointer was moved onto the element
+ onmouseout a pointer was moved away from the element
+ onkeypress a key
+ was pressed and released
+ onkeydown a key was pressed down
+ onkeyup a
+ key was released
+ </xs:documentation>
+ </xs:annotation>
+ <xs:attribute ref="onclick" />
+ <xs:attribute ref="ondblclick" />
+ <xs:attribute ref="onmousedown" />
+ <xs:attribute ref="onmouseup" />
+ <xs:attribute ref="onmouseover" />
+ <xs:attribute ref="onmousemove" />
+ <xs:attribute ref="onmouseout" />
+ <xs:attribute ref="onkeypress" />
+ <xs:attribute ref="onkeydown" />
+ <xs:attribute ref="onkeyup" />
+ </xs:attributeGroup>
+ <xs:attribute name="onclick" type="beanAttribute" />
+ <xs:attribute name="ondblclick" type="beanAttribute" />
+ <xs:attribute name="onmousedown" type="beanAttribute" />
+ <xs:attribute name="onmouseup" type="beanAttribute" />
+ <xs:attribute name="onmouseover" type="beanAttribute" />
+ <xs:attribute name="onmousemove" type="beanAttribute" />
+ <xs:attribute name="onmouseout" type="beanAttribute" />
+ <xs:attribute name="onkeypress" type="beanAttribute" />
+ <xs:attribute name="onkeydown" type="beanAttribute" />
+ <xs:attribute name="onkeyup" type="beanAttribute" />
+
+ <xs:attributeGroup name="focus">
+ <xs:annotation>
+ <xs:documentation>
+ attributes for elements that can get the focus
+ accesskey accessibility key character
+ tabindex position in tabbing
+ order
+ onfocus the element got the focus
+ onblur the element lost the
+ focus
+ </xs:documentation>
+ </xs:annotation>
+ <xs:attribute ref="accesskey" />
+ <xs:attribute ref="tabindex" />
+ <xs:attribute ref="onfocus" />
+ <xs:attribute ref="onblur" />
+ </xs:attributeGroup>
+ <xs:attribute name="accesskey" type="beanAttribute" />
+ <xs:attribute name="tabindex" type="beanAttribute" />
+ <xs:attribute name="onfocus" type="beanAttribute" />
+ <xs:attribute name="onblur" type="beanAttribute" />
+
+ <xs:attribute name="align" type="beanAttribute" />
+ <xs:attribute name="charset"
type="beanAttribute"></xs:attribute>
+ <xs:attribute name="type"
type="beanAttribute"></xs:attribute>
+ <xs:attribute name="name"
type="beanAttribute"></xs:attribute>
+ <xs:attribute name="href"
type="beanAttribute"></xs:attribute>
+ <xs:attribute name="hreflang"
type="beanAttribute"></xs:attribute>
+ <xs:attribute name="rel"
type="beanAttribute"></xs:attribute>
+ <xs:attribute name="rev"
type="beanAttribute"></xs:attribute>
+ <xs:attribute name="shape"
type="beanAttribute"></xs:attribute>
+ <xs:attribute name="coords"
type="beanAttribute"></xs:attribute>
+ <xs:attribute name="target"
type="beanAttribute"></xs:attribute>
+
+ <xs:attribute name="cite" type="beanAttribute" />
+
+ <xs:attribute name="size" type="beanAttribute" />
+ <xs:attribute name="color" type="beanAttribute" />
+ <xs:attribute name="face" type="beanAttribute" />
+
+ <xs:attribute name="action" type="beanAttribute" />
+ <xs:attribute name="method"></xs:attribute>
+ <xs:attribute name="enctype" type="beanAttribute" />
+ <xs:attribute name="onsubmit" type="beanAttribute" />
+ <xs:attribute name="onreset" type="beanAttribute" />
+ <xs:attribute name="accept" type="beanAttribute" />
+ <xs:attribute name="accept-charset" type="beanAttribute" />
+
+ <xs:attribute name="for" type="beanAttribute" />
+
+ <xs:attribute name="value" type="beanAttribute" />
+
+ <xs:attribute name="disabled" type="beanAttribute" />
+ <xs:attribute name="readonly" type="beanAttribute" />
+ <xs:attribute name="nowrap" type="beanAttribute" />
+ <xs:attribute name="compact" type="beanAttribute" />
+ <xs:attribute name="checked" type="beanAttribute" />
+ <xs:attribute name="valign" type="beanAttribute" />
+ <xs:attribute name="char" type="beanAttribute" />
+ <xs:attribute name="charoff" type="beanAttribute" />
+ <xs:attribute name="codebase" type="beanAttribute" />
+ <xs:attribute name="alt" type="beanAttribute" />
+ <xs:attribute name="clear" type="beanAttribute" />
+ <xs:attribute name="span" type="beanAttribute" />
+ <xs:attribute name="profile" type="beanAttribute" />
+ <xs:attribute name="width" type="beanAttribute" />
+ <xs:attribute name="src" type="beanAttribute" />
+ <xs:attribute name="maxlength" type="beanAttribute" />
+ <xs:attribute name="media" type="beanAttribute" />
+ <xs:attribute name="http-equiv" type="beanAttribute" />
+ <xs:attribute name="archive" type="beanAttribute" />
+ <xs:attribute name="nohref" type="beanAttribute" />
+ <xs:attribute name="longdesc" type="beanAttribute" />
+ <xs:attribute name="usemap" type="beanAttribute" />
+ <xs:attribute name="required" type="beanAttribute" />
+ <xs:attribute name="rows" type="beanAttribute" />
+ <xs:attribute name="cols" type="beanAttribute" />
+ <xs:attribute name="bgcolor" type="beanAttribute" />
+ <xs:attribute name="code" type="beanAttribute" />
+ <xs:attribute name="height" type="beanAttribute" />
+ <xs:attribute name="onselect" type="beanAttribute" />
+ <xs:attribute name="onchange" type="beanAttribute" />
+ <xs:attribute name="object" type="beanAttribute" />
+ <xs:attribute name="border" type="beanAttribute" />
+ <xs:attribute name="content" type="beanAttribute" />
+ <xs:attribute name="hspace" type="beanAttribute" />
+ <xs:attribute name="vspace" type="beanAttribute" />
+ <xs:attribute name="scheme" type="beanAttribute" />
+
+</xs:schema>
\ No newline at end of file
Modified:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-jstl-core.xsd
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-jstl-core.xsd 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-jstl-core.xsd 2010-10-27
16:01:55 UTC (rev 19701)
@@ -26,7 +26,6 @@
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://jboss.org/schema/richfaces/cdk/jstl/core"
xmlns="http://jboss.org/schema/richfaces/cdk/jstl/core"
-
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
@@ -35,8 +34,29 @@
</xs:documentation>
</xs:annotation>
- <xs:import schemaLocation="cdk-template.xsd"
namespace="http://jboss.org/schema/richfaces/cdk/core" />
+ <xs:simpleType name="elStrictExpression">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="#\{[^\}]+\}" />
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType name="literalExpression">
+ <xs:restriction base="xs:string">
+ <!-- TODO -->
+ <xs:pattern value=".*" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="elMixedExpression">
+ <xs:restriction base="xs:string">
+ <xs:pattern value=".*#\{[^\}]+\}.*" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="elFreeformExpression">
+ <xs:restriction base="xs:string" />
+ </xs:simpleType>
+
<xs:complexType name="arbitraryContent" mixed="true">
<xs:choice>
<xs:any minOccurs="0" maxOccurs="unbounded" />
@@ -47,7 +67,7 @@
<xs:complexContent>
<xs:extension base="arbitraryContent">
<xs:attribute name="test" form="unqualified"
use="required"
- type="cdk:elStrictExpression">
+ type="elStrictExpression">
<xs:annotation>
<xs:documentation>
<p>The test condition that determines whether or not the body content should
be processed.</p>
@@ -111,14 +131,14 @@
<xs:complexType>
<xs:complexContent>
<xs:extension base="arbitraryContent">
- <xs:attribute name="items" type="cdk:elStrictExpression">
+ <xs:attribute name="items" type="elStrictExpression">
<xs:annotation>
<xs:documentation>
<p>Collection of items to iterate over.</p>
</xs:documentation>
</xs:annotation>
</xs:attribute>
- <xs:attribute name="var" type="cdk:literalExpression">
+ <xs:attribute name="var" type="literalExpression">
<xs:annotation>
<xs:documentation>
<p>Name of the exported scoped variable for the current item of the
iteration.
Modified:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-template.xsd
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-template.xsd 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/cdk-template.xsd 2010-10-27
16:01:55 UTC (rev 19701)
@@ -28,7 +28,9 @@
targetNamespace="http://jboss.org/schema/richfaces/cdk/core"
xmlns="http://jboss.org/schema/richfaces/cdk/core"
elementFormDefault="qualified" attributeFormDefault="unqualified"
xmlns:xhtml="http://jboss.org/schema/richfaces/cdk/xhtml-el"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
-
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite">
+
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+
xmlns:x="http://jboss.org/schema/richfaces/cdk/ext">
<xs:annotation>
<xs:documentation>
@@ -36,33 +38,12 @@
</xs:documentation>
</xs:annotation>
- <xs:import schemaLocation="web-facesuicomponent_2_0.xsd"
namespace="http://java.sun.com/xml/ns/javaee" />
+ <xs:import
schemaLocation="http://java.sun.com/xml/ns/javaee/web-facesuicompone...
namespace="http://java.sun.com/xml/ns/javaee" />
<xs:import schemaLocation="cdk-composite.xsd"
namespace="http://jboss.org/schema/richfaces/cdk/jsf/composite" />
<xs:import schemaLocation="cdk-jstl-core.xsd"
namespace="http://jboss.org/schema/richfaces/cdk/jstl/core" />
+ <xs:import schemaLocation="cdk-extensions.xsd"
namespace="http://jboss.org/schema/richfaces/cdk/ext" />
- <xs:simpleType name="elStrictExpression">
- <xs:restriction base="xs:string">
- <xs:pattern value="#\{[^\}]+\}" />
- </xs:restriction>
- </xs:simpleType>
- <xs:simpleType name="literalExpression">
- <xs:restriction base="xs:string">
- <!-- TODO -->
- <xs:pattern value=".*" />
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="elMixedExpression">
- <xs:restriction base="xs:string">
- <xs:pattern value=".*#\{[^\}]+\}.*" />
- </xs:restriction>
- </xs:simpleType>
-
- <xs:simpleType name="elFreeformExpression">
- <xs:restriction base="xs:string" />
- </xs:simpleType>
-
<xs:simpleType name="resourceDependencyTargets">
<xs:restriction base="xs:string">
<xs:enumeration value="body" />
@@ -145,8 +126,45 @@
</xs:simpleType>
</xs:attribute>
+ <xs:attribute name="passThrough">
+ <xs:annotation>
+ <xs:documentation>
+ <p>Enables pass-through rendering of attributes. Allows to define
whitespace-separated list of attributes
+ to include. If component attribute name is different from default, the
exact name can be added after colon.</p>
+ <p>
+ Examples:
+
+ <ul>
+ <li><code><![CDATA[<div
cdk:passThrough="title style"></code>]]></code></li>
+ <li><code><![CDATA[<div
cdk:passThrough="title:headTitle style">]]></code></li>
+ </ul>
+
+ <span class="usage">
+ Attributes already defined on the tag are automatically excluded
from pass-through
+ rendering.
+ </span>
+ </p>
+ <p>If "disabled" attribute of the component is true (i.e.
boolean true or "true"), then
+ attributes that have associated behavior events are not
encoded.</p>
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction>
+ <xs:simpleType>
+ <xs:list>
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN" />
+ </xs:simpleType>
+ </xs:list>
+ </xs:simpleType>
+ <xs:minLength value="0" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
<xs:attributeGroup name="core.attrs">
<xs:attribute ref="passThroughWithExclusions" />
+ <xs:attribute ref="passThrough" />
</xs:attributeGroup>
<xs:element name="root">
@@ -260,10 +278,11 @@
</li>
<li>
all content declared inside
<code><![CDATA[<cdk:body>]]></code> tag is compiled into
- statements of <code>encodeChildren(...)</code> method.
+ statements of <code>encodeChildren(...)</code> method. If content of
body element is empty,
+ no encodeChildren(...) method will be generated unless 'enforce'
attribute set to true.
</li>
<li>
- all content declared before
<code><![CDATA[<cdk:body>]]></code> tag is compiled into
+ all content declared after
<code><![CDATA[<cdk:body>]]></code> tag is compiled into
statements of <code>encodeEnd(...)</code> method
</li>
</ul>
@@ -344,6 +363,39 @@
]]></pre>
<br /><br />
+ If you want to disable default encodeChildren method, use
enforce attribute:
+ <pre><![CDATA[
+ ...
+ <cc:implementation>
+ <div id="myId">
+ <cdk:body enforce="true"/>
+ </div>
+ </cc:implementation>
+ ...
+ ]]></pre>
+ produces the following code (unsignificant details are
ommitted):
+ <pre><![CDATA[
+ ...
+
+ encodeBegin(...) {
+ ...
+ writer.startElement("div", cc);
+ writer.writeAttribute("id",
"myId", null);
+ }
+
+ encodeChildren(...) {
+ // empty method.
+ }
+
+ encodeEnd(...) {
+ ...
+ writer.endElement("div");
+ }
+
+ ...
+ ]]></pre>
+
+ <br /><br />
The following code snippet:
<pre><![CDATA[
...
@@ -374,11 +426,14 @@
<xs:choice>
<xs:any minOccurs="0" maxOccurs="unbounded" />
</xs:choice>
+ <xs:attribute name="enforce"
type="xs:boolean"/>
</xs:complexType>
</xs:element>
<xs:element ref="c:if" />
<xs:element ref="c:choose" />
<xs:element ref="call" />
+ <xs:element ref="switch" />
+ <xs:element ref="object" />
</xs:choice>
</xs:group>
@@ -426,7 +481,7 @@
<xs:complexType mixed="true">
<xs:simpleContent>
<xs:extension base="xs:string">
- <xs:attribute name="name" form="unqualified"
type="literalExpression" use="required">
+ <xs:attribute name="name" form="unqualified"
type="c:literalExpression" use="required">
<xs:annotation>
<xs:documentation>
<p>Name of the variable, corresponding to Java identifier
syntax.</p>
@@ -461,12 +516,13 @@
<xs:annotation>
<xs:documentation>
<p>Variable type name. CDK automatically resolves simple names for
primitive types,
- JSF API classes and objects from java.lang.* or java.util.*.</p>
+ JSF API classes and objects from java.lang.* or java.util.*.
+ For parametrised types you can use java generics syntax </p>
<p>Examples:
<ul>
<li><code><![CDATA[<cdk:object
type="java.lang.String" ...>]]></code></li>
<li><code><![CDATA[<cdk:object type="float"
...>]]></code></li>
- <li><code><![CDATA[<cdk:object type="List"
...>]]></code></li>
+ <li><code><![CDATA[<cdk:object
type="List<String>" ...>]]></code></li>
<li><code><![CDATA[<cdk:object type="UIComponent"
...>]]></code></li>
</ul>
</p>
@@ -475,24 +531,6 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
- <xs:attribute name="type-arguments" form="unqualified"
type="xs:string">
- <xs:annotation>
- <xs:documentation>
- <p>Comma-separated list of generic type arguments for usage with types like
- java.util.List or java.util.Map.</p>
- <p>Examples:
- <ul>
- <li>
- <code><![CDATA[<cdk:object name="map"
type="Map" type-arguments="String, Object" />]]></code>
- </li>
- <li>
- <code><![CDATA[<cdk:object name="list"
type="List" type-arguments="UIComponent" />]]></code>
- </li>
- </ul>
- </p>
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
@@ -541,7 +579,42 @@
</xs:complexType>
</xs:element>
</xs:sequence>
- <xs:attribute name="key" use="required"
form="unqualified" type="elStrictExpression" />
+ <xs:attribute name="key" use="required"
form="unqualified" type="c:elStrictExpression" />
</xs:complexType>
</xs:element>
+
+ <xs:element name="import">
+ <xs:complexType>
+ <xs:attribute type="xs:string" use="required"
name="package" />
+ <xs:attribute type="xs:NMTOKENS" name="names" />
+ <xs:attribute type="xs:boolean" name="static" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="scriptObject">
+ <xs:complexType>
+ <xs:attribute type="xs:string" name="name"
use="required" />
+ <xs:attribute type="c:elStrictExpression" name="base"
/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="scriptOption">
+ <xs:complexType>
+ <xs:attribute type="xs:NMTOKENS" name="attributes"
/>
+ <xs:attribute type="xs:NMTOKENS" name="variables"
/>
+ <xs:attribute type="xs:string" name="name" />
+ <xs:attribute type="c:elFreeformExpression"
name="value" />
+ <xs:attribute type="c:literalExpression"
name="defaultValue" />
+ <xs:attribute name="wrapper">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="noop" />
+ <xs:enumeration value="asArray" />
+ <xs:enumeration value="eventHandler" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+
</xs:schema>
Modified: branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/xhtml-el.xsd
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/xhtml-el.xsd 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/schema/xhtml-el.xsd 2010-10-27
16:01:55 UTC (rev 19701)
@@ -18,9 +18,10 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://jboss.org/schema/richfaces/cdk/xhtml-el"
xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
elementFormDefault="qualified"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
-
xmlns:cdk-addinfo="http://jboss.org/schema/richfaces/cdk/additional-...
+
xmlns:cdk-addinfo="http://jboss.org/schema/richfaces/cdk/additional-...
+
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+
xmlns:x="http://jboss.org/schema/richfaces/cdk/ext">
- <xs:import schemaLocation="cdk-template.xsd"
namespace="http://jboss.org/schema/richfaces/cdk/core" />
<xs:annotation>
<xs:documentation>
@@ -80,6 +81,10 @@
</xs:documentation>
</xs:annotation>
+ <xs:import schemaLocation="cdk-template.xsd"
namespace="http://jboss.org/schema/richfaces/cdk/core" />
+ <xs:import schemaLocation="cdk-jstl-core.xsd"
namespace="http://jboss.org/schema/richfaces/cdk/jstl/core" />
+ <xs:import schemaLocation="cdk-extensions.xsd"
namespace="http://jboss.org/schema/richfaces/cdk/ext" />
+
<xs:annotation>
<xs:documentation>
================== Imported Names
@@ -93,7 +98,7 @@
media type, as per [RFC2045]
</xs:documentation>
</xs:annotation>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
<xs:simpleType name="ContentTypes">
@@ -103,7 +108,7 @@
[RFC2045]
</xs:documentation>
</xs:annotation>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
<xs:simpleType name="Charset">
@@ -112,7 +117,7 @@
a character encoding, as per [RFC2045]
</xs:documentation>
</xs:annotation>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
<xs:simpleType name="Charsets">
@@ -122,7 +127,7 @@
per [RFC2045]
</xs:documentation>
</xs:annotation>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
<xs:simpleType name="LanguageCode">
@@ -131,7 +136,7 @@
a language code, as per [RFC3066]
</xs:documentation>
</xs:annotation>
- <xs:union memberTypes="xs:language cdk:elMixedExpression" />
+ <xs:union memberTypes="xs:language c:elMixedExpression" />
</xs:simpleType>
<xs:simpleType name="Character">
@@ -148,7 +153,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -165,7 +170,7 @@
one or more digits
</xs:documentation>
</xs:annotation>
- <xs:union memberTypes="simpleType.Number cdk:elMixedExpression" />
+ <xs:union memberTypes="simpleType.Number c:elMixedExpression" />
</xs:simpleType>
<xs:simpleType name="tabindexNumber">
@@ -188,7 +193,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elMixedExpression" />
+ <xs:restriction base="c:elMixedExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -199,7 +204,7 @@
space-separated list of link types
</xs:documentation>
</xs:annotation>
- <xs:union memberTypes="xs:NMTOKENS cdk:elMixedExpression" />
+ <xs:union memberTypes="xs:NMTOKENS c:elMixedExpression" />
</xs:simpleType>
<xs:simpleType name="MediaDesc">
@@ -215,7 +220,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -226,7 +231,7 @@
a Uniform Resource Identifier, see [RFC2396]
</xs:documentation>
</xs:annotation>
- <xs:union memberTypes="xs:anyURI cdk:elMixedExpression" />
+ <xs:union memberTypes="xs:anyURI c:elMixedExpression" />
</xs:simpleType>
<xs:simpleType name="UriList">
@@ -236,7 +241,7 @@
Identifiers
</xs:documentation>
</xs:annotation>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
<xs:simpleType name="Datetime">
@@ -245,7 +250,7 @@
date and time information. ISO date format
</xs:documentation>
</xs:annotation>
- <xs:union memberTypes="xs:dateTime cdk:elMixedExpression" />
+ <xs:union memberTypes="xs:dateTime c:elMixedExpression" />
</xs:simpleType>
<xs:simpleType name="Script">
@@ -254,7 +259,7 @@
script expression
</xs:documentation>
</xs:annotation>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
<xs:simpleType name="StyleSheet">
@@ -263,7 +268,7 @@
style sheet data
</xs:documentation>
</xs:annotation>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
<xs:simpleType name="Text">
@@ -272,7 +277,7 @@
used for titles etc.
</xs:documentation>
</xs:annotation>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
<xs:simpleType name="FrameTarget">
@@ -288,7 +293,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -306,7 +311,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -324,7 +329,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -335,7 +340,7 @@
integer representing length in pixels
</xs:documentation>
</xs:annotation>
- <xs:union memberTypes="xs:nonNegativeInteger cdk:elMixedExpression" />
+ <xs:union memberTypes="xs:nonNegativeInteger c:elMixedExpression" />
</xs:simpleType>
<xs:annotation>
@@ -355,7 +360,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -373,7 +378,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -395,7 +400,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -428,26 +433,26 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
<!-- TODO: add constraints -->
<xs:simpleType name="ID">
- <xs:union memberTypes="xs:ID cdk:elMixedExpression" />
+ <xs:union memberTypes="xs:ID c:elMixedExpression" />
</xs:simpleType>
<xs:simpleType name="IDREF">
- <xs:union memberTypes="xs:IDREF cdk:elMixedExpression" />
+ <xs:union memberTypes="xs:IDREF c:elMixedExpression" />
</xs:simpleType>
<xs:simpleType name="IDREFS">
- <xs:union memberTypes="xs:IDREFS cdk:elMixedExpression" />
+ <xs:union memberTypes="xs:IDREFS c:elMixedExpression" />
</xs:simpleType>
<xs:simpleType name="NMTOKEN">
- <xs:union memberTypes="xs:NMTOKEN cdk:elMixedExpression" />
+ <xs:union memberTypes="xs:NMTOKEN c:elMixedExpression" />
</xs:simpleType>
<xs:simpleType name="NMTOKENS">
- <xs:union memberTypes="xs:NMTOKENS cdk:elMixedExpression" />
+ <xs:union memberTypes="xs:NMTOKENS c:elMixedExpression" />
</xs:simpleType>
<xs:annotation>
@@ -466,6 +471,7 @@
</xs:appinfo>
</xs:annotation>
</xs:attribute>
+ <xs:attribute ref="x:class"/>
</xs:attributeGroup>
<xs:attributeGroup name="coreattrs">
@@ -484,6 +490,7 @@
<xs:attribute name="id" type="ID" />
<xs:attribute name="style" type="StyleSheet" />
<xs:attribute name="title" type="Text" />
+ <xs:attributeGroup ref="x:coreattrs" />
</xs:attributeGroup>
<xs:simpleType name="simpleType.dir">
@@ -509,9 +516,10 @@
<xs:attribute ref="xml:lang" />
<xs:attribute name="dir">
<xs:simpleType>
- <xs:union memberTypes="simpleType.dir cdk:elMixedExpression" />
+ <xs:union memberTypes="simpleType.dir c:elMixedExpression" />
</xs:simpleType>
</xs:attribute>
+ <xs:attributeGroup ref="x:i18n" />
</xs:attributeGroup>
<xs:attributeGroup name="events">
@@ -543,6 +551,7 @@
<xs:attribute name="onkeypress" type="Script" />
<xs:attribute name="onkeydown" type="Script" />
<xs:attribute name="onkeyup" type="Script" />
+ <xs:attributeGroup ref="x:events" />
</xs:attributeGroup>
<xs:attributeGroup name="focus">
@@ -561,6 +570,7 @@
<xs:attribute name="tabindex" type="tabindexNumber" />
<xs:attribute name="onfocus" type="Script" />
<xs:attribute name="onblur" type="Script" />
+ <xs:attributeGroup ref="x:focus" />
</xs:attributeGroup>
<xs:attributeGroup name="attrs">
@@ -588,11 +598,12 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
+ <xs:attribute ref="x:align"/>
</xs:attributeGroup>
<xs:annotation>
@@ -868,7 +879,19 @@
<xs:attribute default="rect" name="shape"
type="Shape"></xs:attribute>
<xs:attribute name="coords"
type="Coords"></xs:attribute>
<xs:attribute name="target"
type="FrameTarget"></xs:attribute>
- <xs:attributeGroup ref="cdk:core.attrs" />
+
+ <xs:attribute ref="x:charset" ></xs:attribute>
+ <xs:attribute ref="x:type" ></xs:attribute>
+ <xs:attribute ref="x:name" ></xs:attribute>
+ <xs:attribute ref="x:href" ></xs:attribute>
+ <xs:attribute ref="x:hreflang" ></xs:attribute>
+ <xs:attribute ref="x:rel" ></xs:attribute>
+ <xs:attribute ref="x:rev" ></xs:attribute>
+ <xs:attribute ref="x:shape" ></xs:attribute>
+ <xs:attribute ref="x:coords" ></xs:attribute>
+ <xs:attribute ref="x:target" ></xs:attribute>
+
+ <xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:group name="a.children">
@@ -1126,7 +1149,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -1144,7 +1167,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -1331,7 +1354,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -1346,11 +1369,12 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
+ <xs:attribute ref="x:compact" />
</xs:attributeGroup>
<xs:element name="ul" type="ul.content">
@@ -1380,7 +1404,7 @@
first list item in an ordered list.
</xs:documentation>
</xs:annotation>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
<xs:element name="ol" type="ol.content">
@@ -1413,7 +1437,7 @@
LIStyle is constrained to: "(ULStyle|OLStyle)"
</xs:documentation>
</xs:annotation>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
<xs:element name="li">
@@ -1640,14 +1664,14 @@
<xs:attributeGroup ref="events" />
<xs:attribute name="lang" type="LanguageCode" />
<xs:attribute ref="xml:lang" />
- <xs:attribute name="dir" use="required">
+ <xs:attribute name="dir" use="optional">
<xs:annotation>
<xs:appinfo>
<cdk-addinfo:default-value>ltr</cdk-addinfo:default-value>
</xs:appinfo>
</xs:annotation>
<xs:simpleType>
- <xs:union memberTypes="simpleType.dir cdk:elMixedExpression" />
+ <xs:union memberTypes="simpleType.dir c:elMixedExpression" />
</xs:simpleType>
</xs:attribute>
</xs:extension>
@@ -1824,6 +1848,7 @@
<xs:extension base="Inline">
<xs:attributeGroup ref="attrs" />
<xs:attribute name="cite" type="URI" />
+ <xs:attribute ref="x:cite" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
@@ -2001,6 +2026,10 @@
<xs:attribute name="size" />
<xs:attribute name="color" type="Color" />
<xs:attribute name="face" />
+
+ <xs:attribute ref="x:size" />
+ <xs:attribute ref="x:color" />
+ <xs:attribute ref="x:face" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
@@ -2098,7 +2127,7 @@
<xs:complexContent>
<xs:extension base="form.content">
<xs:attributeGroup ref="attrs" />
- <xs:attribute name="action" use="required"
type="URI" />
+ <xs:attribute name="action" use="optional"
type="URI" />
<xs:attribute name="method" default="get">
<xs:simpleType>
<xs:union>
@@ -2109,7 +2138,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -2121,6 +2150,16 @@
<xs:attribute name="accept" type="ContentTypes" />
<xs:attribute name="accept-charset" type="Charsets" />
<xs:attribute name="target" type="FrameTarget" />
+
+ <xs:attribute ref="x:action" />
+ <xs:attribute ref="x:method" ></xs:attribute>
+ <xs:attribute ref="x:enctype" />
+ <xs:attribute ref="x:onsubmit" />
+ <xs:attribute ref="x:onreset" />
+ <xs:attribute ref="x:accept" />
+ <xs:attribute ref="x:accept-charset" />
+ <xs:attribute ref="x:target" />
+
</xs:extension>
</xs:complexContent>
</xs:complexType>
@@ -2141,6 +2180,12 @@
<xs:attribute name="accesskey" type="Character" />
<xs:attribute name="onfocus" type="Script" />
<xs:attribute name="onblur" type="Script" />
+
+ <xs:attribute ref="x:for" />
+ <xs:attribute ref="x:accesskey" />
+ <xs:attribute ref="x:onfocus" />
+ <xs:attribute ref="x:onblur" />
+
</xs:extension>
</xs:complexContent>
</xs:complexType>
@@ -2163,7 +2208,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -2178,11 +2223,12 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
+ <xs:attribute ref="x:checked" />
</xs:attributeGroup>
<xs:attributeGroup name="disabledGroup">
@@ -2195,11 +2241,12 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
+ <xs:attribute ref="x:disabled"></xs:attribute>
</xs:attributeGroup>
<xs:attributeGroup name="readonlyGroup">
@@ -2212,11 +2259,12 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
+ <xs:attribute ref="x:readonly"></xs:attribute>
</xs:attributeGroup>
<xs:element name="input" type="input.content">
@@ -2286,7 +2334,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -2334,11 +2382,16 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
+
+ <xs:attribute ref="x:name" />
+ <xs:attribute ref="x:value" />
+ <xs:attribute ref="x:type" />
+
</xs:extension>
</xs:complexContent>
</xs:complexType>
@@ -2392,7 +2445,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -2419,7 +2472,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -2439,7 +2492,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -2466,13 +2519,18 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="char" type="Character" />
<xs:attribute name="charoff" type="Length" />
+
+ <xs:attribute ref="x:align"/>
+ <xs:attribute ref="x:char"/>
+ <xs:attribute ref="x:charoff"/>
+
</xs:attributeGroup>
<xs:attributeGroup name="cellvalign">
@@ -2493,11 +2551,12 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
+ <xs:attribute ref="x:valign"/>
</xs:attributeGroup>
<xs:element name="table" type="table.content">
@@ -2514,7 +2573,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elFreeformExpression" />
+ <xs:restriction base="c:elFreeformExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -2607,7 +2666,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elMixedExpression" />
+ <xs:restriction base="c:elMixedExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -2629,11 +2688,12 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elMixedExpression" />
+ <xs:restriction base="c:elMixedExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
+ <xs:attribute ref="x:nowrap" />
</xs:attributeGroup>
<xs:element name="th">
@@ -2711,12 +2771,24 @@
<xs:attribute name="object"
type="xs:anySimpleType"></xs:attribute>
<xs:attribute name="alt" type="Text"></xs:attribute>
<xs:attribute name="name"
type="NMTOKEN"></xs:attribute>
- <xs:attribute use="required" name="width"
type="Length"></xs:attribute>
- <xs:attribute use="required" name="height"
type="Length"></xs:attribute>
+ <xs:attribute use="optional" name="width"
type="Length"></xs:attribute>
+ <xs:attribute use="optional" name="height"
type="Length"></xs:attribute>
<xs:attribute name="align"
type="ImgAlign"></xs:attribute>
<xs:attribute name="hspace"
type="Pixels"></xs:attribute>
<xs:attribute name="vspace"
type="Pixels"></xs:attribute>
<xs:attributeGroup ref="cdk:core.attrs" />
+
+ <xs:attribute ref="x:codebase" ></xs:attribute>
+ <xs:attribute ref="x:archive" ></xs:attribute>
+ <xs:attribute ref="x:code" ></xs:attribute>
+ <xs:attribute ref="x:object" ></xs:attribute>
+ <xs:attribute ref="x:alt" ></xs:attribute>
+ <xs:attribute ref="x:name" ></xs:attribute>
+ <xs:attribute ref="x:width" ></xs:attribute>
+ <xs:attribute ref="x:height" ></xs:attribute>
+ <xs:attribute ref="x:align" ></xs:attribute>
+ <xs:attribute ref="x:hspace" ></xs:attribute>
+ <xs:attribute ref="x:vspace" ></xs:attribute>
</xs:complexType>
<xs:group name="applet.children">
@@ -2753,28 +2825,47 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction
base="cdk:elMixedExpression"></xs:restriction>
+ <xs:restriction base="c:elMixedExpression"></xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
- <xs:attribute use="required" name="alt"
type="Text"></xs:attribute>
+
+ <xs:attribute use="optional" name="alt"
type="Text"></xs:attribute>
<xs:attribute name="target"
type="FrameTarget"></xs:attribute>
<xs:attributeGroup ref="cdk:core.attrs" />
+
+ <xs:attribute ref="x:alt" ></xs:attribute>
+ <xs:attribute ref="x:target" ></xs:attribute>
+ <xs:attribute ref="x:shape" ></xs:attribute>
+ <xs:attribute ref="x:coords" ></xs:attribute>
+ <xs:attribute ref="x:href" ></xs:attribute>
+ <xs:attribute ref="x:nohref"></xs:attribute>
+
</xs:complexType>
<xs:complexType name="base.content">
<xs:group ref="cdk:structural" minOccurs="0"
maxOccurs="unbounded" />
<xs:attribute name="id" type="ID"></xs:attribute>
<xs:attribute name="href" type="URI"></xs:attribute>
<xs:attribute name="target"
type="FrameTarget"></xs:attribute>
+
+ <xs:attribute ref="x:id" ></xs:attribute>
+ <xs:attribute ref="x:href" ></xs:attribute>
+ <xs:attribute ref="x:target" ></xs:attribute>
+
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:complexType name="basefont.content">
<xs:group ref="cdk:structural" minOccurs="0"
maxOccurs="unbounded" />
<xs:attribute name="id" type="ID" />
- <xs:attribute use="required" name="size"
type="xs:anySimpleType" />
+ <xs:attribute use="optional" name="size"
type="xs:anySimpleType" />
<xs:attribute name="color" type="Color" />
<xs:attribute name="face" type="xs:anySimpleType" />
+
+ <xs:attribute ref="x:id" />
+ <xs:attribute ref="x:size" />
+ <xs:attribute ref="x:color" />
+ <xs:attribute ref="x:face" />
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:complexType name="br.content">
@@ -2792,11 +2883,12 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction
base="cdk:elMixedExpression"></xs:restriction>
+ <xs:restriction base="c:elMixedExpression"></xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
+ <xs:attribute ref="x:clear" />
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:complexType name="col.content">
@@ -2806,6 +2898,10 @@
<xs:attribute name="width"
type="MultiLength"></xs:attribute>
<xs:attributeGroup ref="cellhalign"></xs:attributeGroup>
<xs:attributeGroup ref="cellvalign"></xs:attributeGroup>
+
+ <xs:attribute ref="x:span" />
+ <xs:attribute ref="x:width" />
+
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:complexType name="colgroup.content">
@@ -2815,6 +2911,9 @@
<xs:attribute name="width" type="MultiLength" />
<xs:attributeGroup ref="cellhalign" />
<xs:attributeGroup ref="cellvalign" />
+
+ <xs:attribute ref="x:span" />
+ <xs:attribute ref="x:width" />
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:group name="colgroup.children">
@@ -2885,6 +2984,9 @@
<xs:attributeGroup ref="i18n"></xs:attributeGroup>
<xs:attribute name="id" type="ID"></xs:attribute>
<xs:attribute name="profile"
type="URI"></xs:attribute>
+
+ <xs:attribute ref="x:id" />
+ <xs:attribute ref="x:profile" />
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
@@ -2923,7 +3025,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction
base="cdk:elMixedExpression"></xs:restriction>
+ <xs:restriction base="c:elMixedExpression"></xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -2937,19 +3039,24 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction
base="cdk:elMixedExpression"></xs:restriction>
+ <xs:restriction base="c:elMixedExpression"></xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="size"
type="Pixels"></xs:attribute>
<xs:attribute name="width"
type="Length"></xs:attribute>
+
+ <xs:attribute ref="x:size" />
+ <xs:attribute ref="x:width" />
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:complexType name="html.content">
<xs:group ref="html.children" />
<xs:attributeGroup ref="i18n"></xs:attributeGroup>
<xs:attribute name="id" type="ID"></xs:attribute>
+
+ <xs:attribute ref="x:id" />
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:group name="html.children">
@@ -2962,8 +3069,8 @@
<xs:complexType name="img.content">
<xs:group ref="cdk:structural" minOccurs="0"
maxOccurs="unbounded" />
<xs:attributeGroup ref="attrs"></xs:attributeGroup>
- <xs:attribute use="required" name="src"
type="URI"></xs:attribute>
- <xs:attribute use="required" name="alt"
type="Text">
+ <xs:attribute use="optional" name="src"
type="URI"></xs:attribute>
+ <xs:attribute use="optional" name="alt"
type="Text">
<xs:annotation>
<xs:appinfo>
<cdk-addinfo:default-value></cdk-addinfo:default-value>
@@ -2986,7 +3093,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction
base="cdk:elMixedExpression"></xs:restriction>
+ <xs:restriction base="c:elMixedExpression"></xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -2995,6 +3102,18 @@
<xs:attribute name="border"
type="Length"></xs:attribute>
<xs:attribute name="hspace"
type="Pixels"></xs:attribute>
<xs:attribute name="vspace"
type="Pixels"></xs:attribute>
+
+ <xs:attribute ref="x:src" ></xs:attribute>
+ <xs:attribute ref="x:alt" ></xs:attribute>
+ <xs:attribute ref="x:name" ></xs:attribute>
+ <xs:attribute ref="x:longdesc" ></xs:attribute>
+ <xs:attribute ref="x:height" ></xs:attribute>
+ <xs:attribute ref="x:width" ></xs:attribute>
+ <xs:attribute ref="x:usemap" ></xs:attribute>
+ <xs:attribute ref="x:align" ></xs:attribute>
+ <xs:attribute ref="x:border" ></xs:attribute>
+ <xs:attribute ref="x:hspace" ></xs:attribute>
+ <xs:attribute ref="x:vspace" ></xs:attribute>
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:complexType name="input.content">
@@ -3018,6 +3137,20 @@
<xs:attribute name="onchange"
type="Script"></xs:attribute>
<xs:attribute name="accept"
type="ContentTypes"></xs:attribute>
<xs:attribute name="align"
type="ImgAlign"></xs:attribute>
+
+ <xs:attribute ref="x:type" ></xs:attribute>
+ <xs:attribute ref="x:name" ></xs:attribute>
+ <xs:attribute ref="x:value" ></xs:attribute>
+ <xs:attribute ref="x:size" ></xs:attribute>
+ <xs:attribute ref="x:maxlength" ></xs:attribute>
+ <xs:attribute ref="x:src" ></xs:attribute>
+ <xs:attribute ref="x:alt" ></xs:attribute>
+ <xs:attribute ref="x:usemap" ></xs:attribute>
+ <xs:attribute ref="x:onselect" ></xs:attribute>
+ <xs:attribute ref="x:onchange" ></xs:attribute>
+ <xs:attribute ref="x:accept" ></xs:attribute>
+ <xs:attribute ref="x:align" ></xs:attribute>
+
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:complexType name="isindex.content">
@@ -3038,6 +3171,15 @@
<xs:attribute name="rev"
type="LinkTypes"></xs:attribute>
<xs:attribute name="media"
type="MediaDesc"></xs:attribute>
<xs:attribute name="target"
type="FrameTarget"></xs:attribute>
+
+ <xs:attribute ref="x:charset" ></xs:attribute>
+ <xs:attribute ref="x:href" ></xs:attribute>
+ <xs:attribute ref="x:hreflang" ></xs:attribute>
+ <xs:attribute ref="x:type" ></xs:attribute>
+ <xs:attribute ref="x:rel" ></xs:attribute>
+ <xs:attribute ref="x:rev" ></xs:attribute>
+ <xs:attribute ref="x:media" ></xs:attribute>
+ <xs:attribute ref="x:target" ></xs:attribute>
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:complexType name="map.content">
@@ -3045,10 +3187,15 @@
<xs:attributeGroup ref="i18n"></xs:attributeGroup>
<xs:attributeGroup ref="events"></xs:attributeGroup>
<xs:attributeGroup ref="classGroup" />
- <xs:attribute use="required" name="id" type="ID"
/>
+ <xs:attribute use="optional" name="id" type="ID"
/>
<xs:attribute name="style" type="StyleSheet" />
<xs:attribute name="title" type="Text" />
<xs:attribute name="name" type="xs:anySimpleType" />
+
+ <xs:attribute ref="x:id" />
+ <xs:attribute ref="x:style" />
+ <xs:attribute ref="x:title" />
+ <xs:attribute ref="x:name" />
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
@@ -3091,9 +3238,16 @@
<xs:attribute name="id" type="ID"></xs:attribute>
<xs:attribute name="http-equiv"
type="xs:anySimpleType"></xs:attribute>
<xs:attribute name="name"
type="xs:anySimpleType"></xs:attribute>
- <xs:attribute use="required" name="content"
type="xs:anySimpleType">
+ <xs:attribute use="optional" name="content"
type="xs:anySimpleType">
</xs:attribute>
<xs:attribute name="scheme"
type="xs:anySimpleType"></xs:attribute>
+
+ <xs:attribute ref="x:id" ></xs:attribute>
+ <xs:attribute ref="x:http-equiv" ></xs:attribute>
+ <xs:attribute ref="x:name" ></xs:attribute>
+ <xs:attribute ref="x:content" >
+ </xs:attribute>
+ <xs:attribute ref="x:scheme" ></xs:attribute>
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:complexType name="object.content" mixed="true">
@@ -3108,7 +3262,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction
base="cdk:elMixedExpression"></xs:restriction>
+ <xs:restriction base="c:elMixedExpression"></xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -3172,7 +3326,7 @@
<xs:group ref="optgroup.children" />
<xs:attributeGroup ref="attrs"></xs:attributeGroup>
<xs:attributeGroup ref="disabledGroup" />
- <xs:attribute use="required" name="label"
type="Text"></xs:attribute>
+ <xs:attribute use="optional" name="label"
type="Text"></xs:attribute>
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
@@ -3196,7 +3350,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction
base="cdk:elMixedExpression"></xs:restriction>
+ <xs:restriction base="c:elMixedExpression"></xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -3208,7 +3362,7 @@
<xs:complexType name="param.content">
<xs:group ref="cdk:structural" minOccurs="0"
maxOccurs="unbounded" />
<xs:attribute name="id" type="ID"></xs:attribute>
- <xs:attribute use="required" name="name"
type="xs:anySimpleType">
+ <xs:attribute use="optional" name="name"
type="xs:anySimpleType">
</xs:attribute>
<xs:attribute name="value"
type="xs:anySimpleType"></xs:attribute>
<xs:attribute default="data" name="valuetype">
@@ -3222,7 +3376,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction
base="cdk:elMixedExpression"></xs:restriction>
+ <xs:restriction base="c:elMixedExpression"></xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -3234,7 +3388,7 @@
<xs:group ref="cdk:structural" minOccurs="0"
maxOccurs="unbounded" />
<xs:attribute name="id" type="ID"></xs:attribute>
<xs:attribute name="charset"
type="Charset"></xs:attribute>
- <xs:attribute use="required" name="type"
type="ContentType"></xs:attribute>
+ <xs:attribute use="optional" name="type"
type="ContentType"></xs:attribute>
<xs:attribute name="language"
type="xs:anySimpleType"></xs:attribute>
<xs:attribute name="src" type="URI"></xs:attribute>
<xs:attribute name="defer">
@@ -3246,7 +3400,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction
base="cdk:elMixedExpression"></xs:restriction>
+ <xs:restriction base="c:elMixedExpression"></xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -3269,7 +3423,7 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
- <xs:restriction base="cdk:elMixedExpression" />
+ <xs:restriction base="c:elMixedExpression" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
@@ -3295,7 +3449,7 @@
<xs:group ref="cdk:structural" minOccurs="0"
maxOccurs="unbounded" />
<xs:attributeGroup ref="i18n"></xs:attributeGroup>
<xs:attribute name="id" type="ID"></xs:attribute>
- <xs:attribute use="required" name="type"
type="ContentType"></xs:attribute>
+ <xs:attribute use="optional" name="type"
type="ContentType"></xs:attribute>
<xs:attribute name="media"
type="MediaDesc"></xs:attribute>
<xs:attribute name="title" type="Text"></xs:attribute>
<xs:attribute fixed="preserve"
ref="xml:space"></xs:attribute>
@@ -3357,11 +3511,17 @@
<xs:attributeGroup ref="focus"></xs:attributeGroup>
<xs:attributeGroup ref="disabledGroup" />
<xs:attribute name="name"
type="xs:anySimpleType"></xs:attribute>
- <xs:attribute use="required" name="rows"
type="Number"></xs:attribute>
- <xs:attribute use="required" name="cols"
type="Number"></xs:attribute>
+ <xs:attribute use="optional" name="rows"
type="Number"></xs:attribute>
+ <xs:attribute use="optional" name="cols"
type="Number"></xs:attribute>
<xs:attributeGroup ref="readonlyGroup" />
<xs:attribute name="onselect"
type="Script"></xs:attribute>
<xs:attribute name="onchange"
type="Script"></xs:attribute>
+
+ <xs:attribute ref="x:name" ></xs:attribute>
+ <xs:attribute ref="x:rows" ></xs:attribute>
+ <xs:attribute ref="x:cols" ></xs:attribute>
+ <xs:attribute ref="x:onselect" ></xs:attribute>
+ <xs:attribute ref="x:onchange" ></xs:attribute>
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
<xs:complexType name="tfoot.content">
@@ -3398,6 +3558,7 @@
<xs:group ref="cdk:structural" minOccurs="0"
maxOccurs="unbounded" />
<xs:attributeGroup ref="i18n"></xs:attributeGroup>
<xs:attribute name="id" type="ID"></xs:attribute>
+ <xs:attribute ref="x:id"></xs:attribute>
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
@@ -3407,6 +3568,8 @@
<xs:attributeGroup ref="cellhalign"></xs:attributeGroup>
<xs:attributeGroup ref="cellvalign"></xs:attributeGroup>
<xs:attribute name="bgcolor"
type="Color"></xs:attribute>
+
+ <xs:attribute ref="x:bgcolor"></xs:attribute>
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
@@ -3425,6 +3588,8 @@
<xs:attributeGroup ref="attrs" />
<xs:attribute name="type" type="ULStyle" />
<xs:attributeGroup ref="compactGroup" />
+
+ <xs:attribute ref="x:type"></xs:attribute>
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
Modified:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/component.ftl
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/component.ftl 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/component.ftl 2010-10-27
16:01:55 UTC (rev 19701)
@@ -18,7 +18,6 @@
import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.component.StateHelper;
-import org.richfaces.component.PartialStateHolderHelper;
import ${baseClass};
<#include "_attributes_import.ftl">
Copied:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/add-attributes-to-script-hash.ftl
(from rev 19674,
trunk/cdk/generator/src/main/resources/META-INF/templates/java/add-attributes-to-script-hash.ftl)
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/add-attributes-to-script-hash.ftl
(rev 0)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/add-attributes-to-script-hash.ftl 2010-10-27
16:01:55 UTC (rev 19701)
@@ -0,0 +1,5 @@
+<(a)util.require "ADD_TO_SCRIPT_HASH_ATTRIBUTES"/>
+
+<(a)util.attributesField "${fieldName}" attributes />
+
+${ADD_TO_SCRIPT_HASH_ATTRIBUTES}(${parent.name}, ${facesContextVariable},
${componentVariable}, ${fieldName}, <#if
wrapper?exists>ScriptHashVariableWrapper.${wrapper}<#else>null</#if>);
\ No newline at end of file
Modified:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/class.ftl
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/class.ftl 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/class.ftl 2010-10-27
16:01:55 UTC (rev 19701)
@@ -1,7 +1,7 @@
package ${package.name};
<#list imports as import><#if !import.default >
-import ${import.name};
+import<#if import.static> static</#if> ${import.name};
</#if></#list>
<@renderCommonJavaElementStuff element=.data_model />class ${simpleName} <#if
superClass.name != 'java.lang.Object'>extends ${superClass.simpleName}
</#if>{
Copied:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/script-object.ftl
(from rev 19674,
trunk/cdk/generator/src/main/resources/META-INF/templates/java/script-object.ftl)
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/script-object.ftl
(rev 0)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/script-object.ftl 2010-10-27
16:01:55 UTC (rev 19701)
@@ -0,0 +1,4 @@
+${type} ${name} = new ${implementationType}(<#if base?exists>${base}</#if>);
+<#list statements as subStatement>
+${subStatement.code}
+</#list>
\ No newline at end of file
Copied:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/script-option.ftl
(from rev 19674,
trunk/cdk/generator/src/main/resources/META-INF/templates/java/script-option.ftl)
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/script-option.ftl
(rev 0)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/script-option.ftl 2010-10-27
16:01:55 UTC (rev 19701)
@@ -0,0 +1,2 @@
+<(a)util.require "ADD_TO_SCRIPT_HASH" />
+${ADD_TO_SCRIPT_HASH}(${parent.name}, "${name}", ${value}, <#if
defaultValue?exists>${defaultValue}<#else>null</#if>, <#if
wrapper?exists>ScriptHashVariableWrapper.${wrapper}<#else>null</#if>);
Modified:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/util.ftl
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/util.ftl 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/util.ftl 2010-10-27
16:01:55 UTC (rev 19701)
@@ -3,3 +3,10 @@
<#macro import name>${addImport(name)}</#macro>
<#macro concat seq delimiter=","><#list seq as item><#nested
item/><#if item_has_next>${delimiter}</#if></#list></#macro>
+<#macro attributesField fieldName attributes>
+ <@require "CREATE_ATTRIBUTES"/>
+ <@constant "Attributes"
"${fieldName}">${CREATE_ATTRIBUTES}()<#list attributes as attribute>
+
.${attribute.builderMethod}("${attribute.name}","${attribute.componentAttribute}"<#list
attribute.behaviors as behavior>,"${behavior}"</#list>)
+ <#if attribute.defaultValue?exists
>.defaultValue(${attribute.defaultValue})</#if>
+ </#list></@constant>
+</#macro>
Modified:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl 2010-10-27
16:01:55 UTC (rev 19701)
@@ -1,7 +1,6 @@
-<(a)util.require "RENDER_ATTRIBUTES_SET"/><(a)util.require
"CREATE_ATTRIBUTES"/>
-<(a)util.constant "Attributes"
"${fieldName}">${CREATE_ATTRIBUTES}()<#list attributes as attribute>
-
.${attribute.builderMethod}("${attribute.name}","${attribute.componentAttribute}"<#list
attribute.behaviors as behavior>,"${behavior}"</#list>)
- <#if attribute.defaultValue?exists
>.defaultValue("${attribute.defaultValue}")</#if>
-</#list></(a)util.constant>
+<(a)util.require "RENDER_ATTRIBUTES_SET"/>
+
+<(a)util.attributesField "${fieldName}" attributes />
+
${RENDER_ATTRIBUTES_SET}(${facesContextVariable}, ${componentVariable},
${fieldName});
\ No newline at end of file
Modified:
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/write-boolean-attribute.ftl
===================================================================
---
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/write-boolean-attribute.ftl 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/main/resources/META-INF/templates/java/write-boolean-attribute.ftl 2010-10-27
16:01:55 UTC (rev 19701)
@@ -1,12 +1,16 @@
-<#if value.literal && value == "true">
+<#if value.literal >
+ <#if value == '"true"' || value ==
'"${attributeName}"' >
${responseWriterVariable}.writeAttribute("${attributeName}","${attributeName}",null);
+ </#if>
<#else>
<#if value.type == "boolean" >
if(${value}) {
<#elseif value.type == "Boolean" >
if(Boolean.TRUE.equals(${value})) {
+ <#elseif value.type == "String" >
+ if("${attributeName}".equals(${value}) || Boolean.valueOf(${value}) ) {
<#else>
- if(Boolean.valueOf(String.valueOf(${value}))) {
+ if(null != ${value} && ( Boolean.valueOf(${value}.toString()) ||
"${attributeName}".equals(${value}.toString())) ) {
</#if>
${responseWriterVariable}.writeAttribute("${attributeName}","${attributeName}",null);
}
Modified:
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/model/TemplateParserTest.java
===================================================================
---
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/model/TemplateParserTest.java 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/model/TemplateParserTest.java 2010-10-27
16:01:55 UTC (rev 19701)
@@ -23,8 +23,14 @@
package org.richfaces.cdk.templatecompiler.model;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import java.util.Arrays;
+import java.util.Iterator;
import java.util.List;
import org.junit.Test;
@@ -32,6 +38,8 @@
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.xmlconfig.JaxbTestBase;
+import com.google.common.collect.Iterables;
+
/**
* <p class="changed_added_4_0">
* </p>
@@ -230,7 +238,11 @@
+
"<cdk:component-family>org.richfaces.TreeFamily</cdk:component-family>"
+
"<cdk:renderer-type>org.richfaces.TreeRenderer</cdk:renderer-type>"
+ "<cdk:renderkit-id>RF4_XHTML</cdk:renderkit-id>"
- +
"<cdk:renders-children>false</cdk:renders-children>" +
TEMPLATE_MIDDLE + TEMPLATE_EPILOG);
+ +
"<cdk:renders-children>false</cdk:renders-children>"
+ + "<cdk:import package=\"com.foo\" names=\"Bar
Fooz\" />"
+ + "<cdk:import package=\"net.foo\"
names=\"Field\" static=\"true\" />"
+ + "<cdk:import package=\"org.foo\"
names=\"*\" />"
+ + TEMPLATE_MIDDLE + TEMPLATE_EPILOG);
CompositeInterface interfaceSection = template.getInterface();
assertNotNull(interfaceSection);
@@ -242,6 +254,28 @@
assertEquals("RF4_XHTML", interfaceSection.getRenderKitId());
assertEquals(Boolean.FALSE, interfaceSection.getRendersChildren());
+ List<ClassImport> classImports = interfaceSection.getClassImports();
+
+ ClassImport importElement;
+
+ Iterator<ClassImport> children = classImports.iterator();
+
+ importElement = children.next();
+ assertEquals("com.foo", importElement.getPackage());
+ assertEquals(Arrays.asList("Bar", "Fooz"),
importElement.getNames());
+ assertFalse(importElement.isStatic());
+
+ importElement = children.next();
+ assertEquals("net.foo", importElement.getPackage());
+ assertEquals(Arrays.asList("Field"), importElement.getNames());
+ assertTrue(importElement.isStatic());
+
+ importElement = children.next();
+ assertEquals("org.foo", importElement.getPackage());
+ assertEquals(Arrays.asList("*"), importElement.getNames());
+ assertFalse(importElement.isStatic());
+
+ assertFalse(children.hasNext());
}
@Test
@@ -397,4 +431,51 @@
assertNotNull(template.getInterface());
assertNotNull(template.getImplementation());
}
+
+ @Test
+ public void testScriptObject() throws Exception {
+ Template template =
+ unmarshal(Template.class, TEMPLATE_PROLOG + TEMPLATE_MIDDLE
+ + "<cdk:scriptObject name=\"hash\"
base=\"#{getBaseOptions(context)}\">"
+ + "<cdk:scriptOption name=\"name\"
value=\"#{value}\" />"
+ + "<cdk:scriptOption name=\"delay\"
value=\"#{delay}\" defaultValue=\"100\" />"
+ + "<cdk:scriptOption name=\"rowClasses\"
value=\"#{rowClasses}\" wrapper=\"asArray\" />"
+ + "<cdk:scriptOption attributes=\"min max\"
/>"
+ + "<cdk:scriptOption variables=\"allowHeader
allowFooter\" />"
+ + "</cdk:scriptObject>" +
+
+ TEMPLATE_EPILOG);
+
+ CompositeImplementation implementation = template.getImplementation();
+ assertNotNull(implementation);
+
+ CdkScriptObjectElement scriptObject = (CdkScriptObjectElement)
Iterables.getOnlyElement(implementation.getChildren());
+ assertEquals("hash", scriptObject.getName());
+ assertEquals("#{getBaseOptions(context)}", scriptObject.getBase());
+
+ CdkScriptOptionElement scriptOption;
+ Iterator<Object> children = scriptObject.getChildren().iterator();
+
+ scriptOption = (CdkScriptOptionElement) children.next();
+ assertEquals("name", scriptOption.getName());
+ assertEquals("#{value}", scriptOption.getValue());
+
+ scriptOption = (CdkScriptOptionElement) children.next();
+ assertEquals("delay", scriptOption.getName());
+ assertEquals("#{delay}", scriptOption.getValue());
+ assertEquals("100", scriptOption.getDefaultValue());
+
+ scriptOption = (CdkScriptOptionElement) children.next();
+ assertEquals("rowClasses", scriptOption.getName());
+ assertEquals("#{rowClasses}", scriptOption.getValue());
+ assertEquals("asArray", scriptOption.getWrapper());
+
+ scriptOption = (CdkScriptOptionElement) children.next();
+ assertEquals(Arrays.asList("min", "max"),
scriptOption.getAttributes());
+
+ scriptOption = (CdkScriptOptionElement) children.next();
+ assertEquals(Arrays.asList("allowHeader", "allowFooter"),
scriptOption.getVariables());
+
+ assertFalse(children.hasNext());
+ }
}
Modified:
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/ELParserTest.java
===================================================================
---
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/ELParserTest.java 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/parser/el/test/ELParserTest.java 2010-10-27
16:01:55 UTC (rev 19701)
@@ -21,9 +21,14 @@
package org.richfaces.cdk.templatecompiler.parser.el.test;
-import static org.junit.Assert.*;
-import static org.easymock.EasyMock.*;
-import static org.richfaces.cdk.templatecompiler.statements.HelperMethod.*;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static
org.richfaces.cdk.templatecompiler.statements.HelperMethod.EMPTINESS_CHECK;
+import static org.richfaces.cdk.templatecompiler.statements.HelperMethod.EQUALS_CHECK;
+import static
org.richfaces.cdk.templatecompiler.statements.HelperMethod.TO_BOOLEAN_CONVERSION;
+import static
org.richfaces.cdk.templatecompiler.statements.HelperMethod.TO_STRING_CONVERSION;
import java.util.HashMap;
import java.util.List;
@@ -668,4 +673,12 @@
assertEquals("\"Literal\"",parseExpression.getCode());
assertEquals(String.class.getName(), parseExpression.getType().getRawName());
}
+
+ @Test
+ public void testToScriptArgs() throws Exception {
+ TypedTemplateStatement parseExpression =
parseExpression("#{toScriptArgs(clientId, bean)}");
+
+ assertTrue(Iterables.contains(parseExpression.getRequiredMethods(),
HelperMethod.TO_SCRIPT_ARGS));
+ assertEquals("toScriptArgs(clientId,bean)",
parseExpression.getCode());
+ }
}
Copied:
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/AddAttributesToScriptHashTest.java
(from rev 19674,
trunk/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/AddAttributesToScriptHashTest.java)
===================================================================
---
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/AddAttributesToScriptHashTest.java
(rev 0)
+++
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/AddAttributesToScriptHashTest.java 2010-10-27
16:01:55 UTC (rev 19701)
@@ -0,0 +1,92 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.templatecompiler.statements;
+
+import java.util.Collections;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.cdk.CdkClassLoader;
+import org.richfaces.cdk.CdkTestRunner;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.PropertyBase;
+import org.richfaces.cdk.model.PropertyModel;
+import org.richfaces.cdk.templatecompiler.builder.model.JavaField;
+import org.richfaces.cdk.templatecompiler.el.types.TypesFactory;
+import org.richfaces.cdk.templatecompiler.el.types.TypesFactoryImpl;
+
+import com.google.common.collect.Iterables;
+import com.google.inject.Binder;
+import com.google.inject.Inject;
+
+/**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)RunWith(CdkTestRunner.class)
+public class AddAttributesToScriptHashTest extends FreeMarkerTestBase {
+
+ @Inject
+ private TypesFactory typesFactory;
+
+ @Inject
+ private ScriptObjectStatement parentStatement;
+
+ @Inject
+ private AddAttributesToScriptHashStatement statement;
+
+ @Override
+ public void configure(Binder binder) {
+ super.configure(binder);
+ binder.bind(TypesFactory.class).to(TypesFactoryImpl.class);
+ binder.bind(CdkClassLoader.class).toInstance(createClassLoader());
+ }
+
+ /**
+ * Test method for {@link
org.richfaces.cdk.templatecompiler.statements.FreeMarkerTemplateStatementBase#getCode()}.
+ */
+ @Test
+ public void testGetCode() {
+ statement.setParent(parentStatement);
+ parentStatement.setObject("hash", null);
+
+ PropertyBase property = new PropertyModel();
+ property.setName("bar");
+ property.setDefaultValue("deflt");
+ property.setType(ClassName.get(String.class));
+
+ controller.replay();
+ statement.setAttributes(Collections.singleton("bar"),
Collections.singleton(property));
+ String code = statement.getCode();
+ controller.verify();
+ verifyCode(code, "!attributes()", "!defaultValue(",
"!if(", "");
+ verifyHelpers(statement, HelperMethod.CREATE_ATTRIBUTES,
HelperMethod.ADD_TO_SCRIPT_HASH_ATTRIBUTES);
+ JavaField javaField = Iterables.getOnlyElement(statement.getRequiredFields());
+ verifyCode(javaField.getValue().getCode(), "attributes()",
"generic(", "defaultValue(");
+ }
+
+}
Modified:
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/FreeMarkerTemplateStatementTest.java
===================================================================
---
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/FreeMarkerTemplateStatementTest.java 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/FreeMarkerTemplateStatementTest.java 2010-10-27
16:01:55 UTC (rev 19701)
@@ -1,7 +1,7 @@
package org.richfaces.cdk.templatecompiler.statements;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
import java.util.Collections;
@@ -15,7 +15,7 @@
import org.richfaces.cdk.generate.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.templatecompiler.builder.model.JavaField;
import org.richfaces.cdk.templatecompiler.builder.model.JavaImport;
-import org.richfaces.cdk.templatecompiler.builder.model.RuntimeImport;
+import org.richfaces.cdk.templatecompiler.builder.model.JavaImportImpl;
import org.richfaces.cdk.templatecompiler.el.types.TypesFactory;
import com.google.common.collect.Iterables;
@@ -64,7 +64,7 @@
public void testGetRequiredImports() {
freeMarkerStatement.addImport("foo.Bar");
expect(statement.getRequiredImports()).andStubReturn(
- Collections.<JavaImport> singleton(new
RuntimeImport("foo.baz")));
+ Collections.<JavaImport> singleton(new
JavaImportImpl("foo.baz")));
expect(renderer.renderTemplate("foo.ftl",
freeMarkerStatement)).andReturn(FOO_CODE);
controller.replay();
freeMarkerStatement.addStatement(statement);
Modified:
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/WriteAttributesSetTest.java
===================================================================
---
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/WriteAttributesSetTest.java 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/WriteAttributesSetTest.java 2010-10-27
16:01:55 UTC (rev 19701)
@@ -55,7 +55,7 @@
*/
@Test
public void testGetCode() {
- WriteAttributesSetStatement.PassThrough passThrough = new
WriteAttributesSetStatement.PassThrough();
+ PassThrough passThrough = new PassThrough();
passThrough.name = QName.valueOf("foo");
passThrough.type = "String";
passThrough.componentAttribute = "bar";
Modified:
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
===================================================================
---
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-10-27
16:01:55 UTC (rev 19701)
@@ -63,6 +63,7 @@
description=@Description(displayName="Test HTML5
abbreviation",largeIcon="large.gif",smallIcon="spall.png"),
tag=(a)Tag(name="abbr",generate=true,handler="org.richfaces.cdk.test.facelets.AbbrTagHandler"),
generate="org.richfaces.cdk.test.component.html.HtmlTestAbbr",
+
attributes={"core-props.xml","events-props.xml","i18n-props.xml"},
interfaces=Html5Attributes.class,
renderer=(a)JsfRenderer(type="org.richfaces.cdk.test.HtmlAbbrRenderer")),
@RendererSpecificComponent(type =
"org.richfaces.cdk.test.TestHtmlDfn",
Modified:
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/Html5Attributes.java
===================================================================
---
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/Html5Attributes.java 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/Html5Attributes.java 2010-10-27
16:01:55 UTC (rev 19701)
@@ -48,7 +48,7 @@
/**
* @return
*/
- @Attribute(events=@EventName("ondrag"))
+ @Attribute(events=@EventName("drag"))
public abstract DraggableState getDraggable();
/**
Modified:
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/templates/testComponent.xml
===================================================================
---
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/templates/testComponent.xml 2010-10-27
15:58:37 UTC (rev 19700)
+++
branches/RF-7817/cdk/maven-cdk-plugin/src/it/annotated-component/src/main/templates/testComponent.xml 2010-10-27
16:01:55 UTC (rev 19701)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<cdk:root
xmlns="http://www.w3.org/1999/xhtml"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+<cdk:root
xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
xmlns:x="http://jboss.org/schema/richfaces/cdk/ext">
<cc:interface>
@@ -37,7 +37,9 @@
</cc:interface>
<cc:implementation>
- <div id="#{clientId}" cdk:passThroughWithExclusions="id dir
lang">
+ <div id="#{clientId}" cdk:passThroughWithExclusions="id dir
lang" >
+ <input readonly="readonly"/>
+ <a x:onclick="onBodyClick" onclick=""
href="/root/"/>
<c:if test="#{component.attributes['ifTest'] != null}">if
content</c:if>
<c:choose>
<c:when test="#{component.attributes['anotherTest'] !=
null}">when content</c:when>
@@ -51,7 +53,7 @@
<ul x:style="listStyle" x:class="listClass"
cdk:passThrough="id title:listTitle onclick:onlistclick
ondblclick:onlistdblclick">
<c:forEach items="#{component.children}" var="iterationVar">
<li>forEach content
<cdk:call>iterationVar.encodeAll(facesContext)</cdk:call></li>
- </c:forEach>
+ </c:forEach>
</ul>
</div>
</cc:implementation>