Author: artdaw
Date: 2008-08-12 10:24:08 -0400 (Tue, 12 Aug 2008)
New Revision: 10054
Added:
trunk/docs/cdkguide/en/src/main/docbook/includes/ui_conf.xml
trunk/docs/cdkguide/en/src/main/resources/examples/inputDate_skeleton.xml
Modified:
trunk/docs/cdkguide/en/src/main/docbook/includes/register.xml
trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml
trunk/docs/cdkguide/en/src/main/docbook/includes/ui.xml
trunk/docs/cdkguide/en/src/main/docbook/master.xml
Log:
https://jira.jboss.org/jira/browse/RF-3692 - 'Extending a UIInput',
'Configuring component' sections were added.
Modified: trunk/docs/cdkguide/en/src/main/docbook/includes/register.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/includes/register.xml 2008-08-12 14:21:17 UTC
(rev 10053)
+++ trunk/docs/cdkguide/en/src/main/docbook/includes/register.xml 2008-08-12 14:24:08 UTC
(rev 10054)
@@ -96,6 +96,11 @@
<name>org.mycompany.renderkit.html.images.inputDate</name>
</resource>
...]]></programlisting>
+ <para>
+ With the help of the <emphasis
role="bold"><property><cacheable></property></emphasis>
element
+ you could manage whether the resource is cached or not.
+ If the value of this element is "true", the resource is cached on
the server and also on the client sides.
+ </para>
<!--programlisting role="XML"><![CDATA[...
<resource>
Modified: trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml 2008-08-12 14:21:17 UTC
(rev 10053)
+++ trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml 2008-08-12 14:24:08 UTC
(rev 10054)
@@ -123,7 +123,7 @@
...]]></programlisting>
<para>
How to register all resources is explained in the
- <property>"Component resources registration"</property>
chapter.
+ <link linkend="register">"Component resources
registration"</link> chapter.
</para>
<important>
<title>Important:</title>
@@ -158,6 +158,6 @@
</para>
</note>
<para>
- All the Template tags you could find in the <property>"Template tags
overview"</property> chapter.
+ All the Template tags you could find in the <link
linkend="temptags">"Template tags overview"</link>
chapter.
</para>
</section>
\ No newline at end of file
Modified: trunk/docs/cdkguide/en/src/main/docbook/includes/ui.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/includes/ui.xml 2008-08-12 14:21:17 UTC (rev
10053)
+++ trunk/docs/cdkguide/en/src/main/docbook/includes/ui.xml 2008-08-12 14:24:08 UTC (rev
10054)
@@ -3,15 +3,68 @@
<?dbhtml filename="uicomponent.html"?>
<sectioninfo>
<keywordset>
- <keyword>uicomponent</keyword>
+ <keyword>ui</keyword>
<keyword>component</keyword>
<keyword>CDK</keyword>
<keyword>Guide</keyword>
</keywordset>
</sectioninfo>
-<title>Configuring component</title>
-<para>
-UI Component generation
-</para>
+ <title>Extending a UIInput.</title>
+ <para>
+ The base class for all JSF components is <code>UIComponent</code>.
+ When you develop <emphasis
role="bold"><property><inputDate></property></emphasis>
component
+ you could see that you subclass <code>UIComponentBase</code> at first.
+ This class extends <code>UIComponent</code>, and provides default
implementations of the all of the abstract methods of
<code>UIComponent</code>.
+ </para>
+ <para>
+ You could proceed to the
<property>src/main/java/org/mycompany/component</property> directory
+ and find a <property>UIInputDate.java</property> there:
+ </para>
+ <programlisting role="JAVA"><![CDATA[package
org.mycompany.component;
+import javax.faces.component.UIComponentBase;
+/**
+ * JSF component class
+ *
+ */
+public abstract class UIInputDate extends UIComponentBase {
+ public static final String COMPONENT_TYPE = "org.mycompany.InputDate";
+ public static final String COMPONENT_FAMILY = "org.mycompany.InputDate";
+}]]></programlisting>
+ <para>
+ The <emphasis
role="bold"><property><inputDate></property></emphasis>
is a simple
+ input component therefore you should import
<code>javax.faces.component.UIInput</code> class and extend it:
+ </para>
+ <programlisting role="JAVA"><![CDATA[package
org.mycompany.component;
+import javax.faces.component.UIInput;
+/**
+ * JSF component class
+ *
+ */
+public abstract class UIInputDate extends UIInput {
+ public static final String COMPONENT_TYPE = "org.mycompany.InputDate";
+ public static final String COMPONENT_FAMILY = "org.mycompany.InputDate";
+}]]></programlisting>
+ <para>
+ Each component is associated with a <property>component type</property>,
+ which is used as "JSF recognized" name of the <emphasis
role="bold"><property><inputDate></property></emphasis>
component.
+ We will refer to this later in our tag handler.
+ </para>
+ <para>
+ The <property>component class</property> is the actual class path address
of our <emphasis
role="bold"><property><inputDate></property></emphasis>
component.
+ </para>
+ <para>
+ As it was mentioned before, the <emphasis
role="bold"><property><inputDate></property></emphasis>
component has some attributes
+ that are bound to the properties in the <code>UIInputDate</code> class
+ (for example <property>title</property>,
<property>title</property>, <property>name</property>,
<property>type</property>, etc.).
+ The next thing to do is to save the component state
+ by overriding <code>saveState()</code> and
<code>restoreState()</code> component methods.
+ But you do not have to do it in the <code>UIInputDate</code> class by
hand!
+ </para>
+ <para>
+ You should configure the <emphasis
role="bold"><property><inputDate></property></emphasis>
component
+ in the <property>inputDate.xml</property>,
+ and the <property>CDK</property> factory will generate the complete
<code>UIInputDate</code> class.
+ How to configure the component is explained in the <link
linkend="ui_conf">"Configuring component"</link>
chapter.
+ </para>
</section>
Added: trunk/docs/cdkguide/en/src/main/docbook/includes/ui_conf.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/includes/ui_conf.xml
(rev 0)
+++ trunk/docs/cdkguide/en/src/main/docbook/includes/ui_conf.xml 2008-08-12 14:24:08 UTC
(rev 10054)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="ui_conf" xreflabel="ui_conf">
+ <?dbhtml filename="ui_conf.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>ui</keyword>
+ <keyword>component</keyword>
+ <keyword>CDK</keyword>
+ <keyword>Guide</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Configuring component.</title>
+ <para>
+ Well, it is almost the final step in the component creation process - component
configuration.
+ </para>
+ <para>
+ There is <property>inputDate.xml</property> file in the
<property>src/main/config/component</property> directory that is used
+ by <property>CDK</property> factory for generating not only the complete
<code>UIInputDate</code> class,
+ but also a TLD file, a tag handler and a descriptor for JSP and Facelets.
+ </para>
+ <para>
+ Please, open the <ulink
url="examples/inputDate_skeleton.xml">inputDate.xml</ulink> in your
favorite text editor
+ and take a look at the skeleton.
+ </para>
+</section>
+
Property changes on: trunk/docs/cdkguide/en/src/main/docbook/includes/ui_conf.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/docs/cdkguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/master.xml 2008-08-12 14:21:17 UTC (rev
10053)
+++ trunk/docs/cdkguide/en/src/main/docbook/master.xml 2008-08-12 14:24:08 UTC (rev
10054)
@@ -16,6 +16,7 @@
<!ENTITY pcreate SYSTEM "includes/pcreate.xml">
<!ENTITY ccreate SYSTEM "includes/ccreate.xml">
<!ENTITY ui SYSTEM "includes/ui.xml">
+<!ENTITY ui_conf SYSTEM "includes/ui_conf.xml">
<!ENTITY protoui SYSTEM "includes/protoui.xml">
<!ENTITY template SYSTEM "includes/template.xml">
<!ENTITY skin SYSTEM "includes/skin.xml">
@@ -148,6 +149,7 @@
</section>
®ister;
&ui;
+ &ui_conf;
&taghandler;
</chapter>
&test;
Added: trunk/docs/cdkguide/en/src/main/resources/examples/inputDate_skeleton.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/resources/examples/inputDate_skeleton.xml
(rev 0)
+++ trunk/docs/cdkguide/en/src/main/resources/examples/inputDate_skeleton.xml 2008-08-12
14:24:08 UTC (rev 10054)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"http://labs.jboss.com/jbossrichfaces/component-config.dtd">
+
+<components>
+ <component>
+ <name>org.mycompany.InputDate</name>
+ <family>org.mycompany.InputDate</family>
+ <classname>org.mycompany.component.html.HtmlInputDate</classname>
+ <superclass>org.mycompany.component.UIInputDate</superclass>
+ <description>
+ <![CDATA[
+ ]]>
+ </description>
+ <renderer generate="true" override="true">
+ <name>org.mycompany.InputDateRenderer</name>
+ <template>org/mycompany/htmlInputDate.jspx</template>
+ </renderer>
+ <tag>
+ <name>inputDate</name>
+ <classname>org.mycompany.taglib.InputDateTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+ </tag>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.tag.TestHandler</classname>
+ </taghandler>
+ -->
+ &ui_component_attributes;
+ <!--
+ <property>
+ <name>param</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"default"</defaultvalue>
+ </property>
+ -->
+ </component>
+</components>
Property changes on:
trunk/docs/cdkguide/en/src/main/resources/examples/inputDate_skeleton.xml
___________________________________________________________________
Name: svn:executable
+ *