JBoss Rich Faces SVN: r16443 - in root/cdk/trunk/plugins/generator/src: main/java/org/richfaces/cdk/parser/el and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-02-11 12:35:12 -0500 (Thu, 11 Feb 2010)
New Revision: 16443
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/emptiness-check-method.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java
Log:
https://jira.jboss.org/jira/browse/RF-7732
Fixes in code generation
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java 2010-02-11 17:02:58 UTC (rev 16442)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java 2010-02-11 17:35:12 UTC (rev 16443)
@@ -22,16 +22,7 @@
package org.richfaces.cdk.generate.taglib;
-import java.io.File;
-
-import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.Output;
-import org.richfaces.cdk.Outputs;
-import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
-import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ValidatorModel;
-import org.richfaces.cdk.model.Visitable;
import com.google.inject.Inject;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java 2010-02-11 17:02:58 UTC (rev 16442)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELVisitor.java 2010-02-11 17:35:12 UTC (rev 16443)
@@ -27,6 +27,7 @@
import org.jboss.el.parser.ELParser;
import org.jboss.el.parser.Node;
import org.richfaces.cdk.parser.el.node.ITreeNode;
+import org.richfaces.cdk.parser.el.types.TypesFactory;
/**
* Entry point for parsing EL expressions. @see parse() method.
@@ -99,7 +100,12 @@
this.setUseConversionToString(true);
}
- parsedExpression = this.visit(ret, contextMap);
+ if (ret != null && ret.jjtGetNumChildren() > 0) {
+ parsedExpression = this.visit(ret, contextMap);
+ } else {
+ parsedExpression = StringUtils.getEscapedString("");
+ variableType = TypesFactory.getType(String.class);
+ }
}
private String visit(Node node, Map<String, Type> context) throws ParsingException {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java 2010-02-11 17:02:58 UTC (rev 16442)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java 2010-02-11 17:35:12 UTC (rev 16443)
@@ -27,6 +27,7 @@
import java.util.List;
import javax.faces.render.RenderKitFactory;
+import javax.faces.render.Renderer;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
@@ -53,7 +54,7 @@
private String javaClass;
- private String baseClass;
+ private String baseClass = Renderer.class.getName();
private String rendererType;
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/emptiness-check-method.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/emptiness-check-method.ftl 2010-02-11 17:02:58 UTC (rev 16442)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/emptiness-check-method.ftl 2010-02-11 17:35:12 UTC (rev 16443)
@@ -1 +1 @@
-return object != null;
\ No newline at end of file
+return object == null;
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java 2010-02-11 17:02:58 UTC (rev 16442)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java 2010-02-11 17:35:12 UTC (rev 16443)
@@ -500,6 +500,13 @@
assertEquals(Object.class, visitor.getVariableType().getRawType());
}
+ @Test
+ public void testEmptyString() throws Exception {
+ parseExpression("");
+ assertEquals("\"\"", visitor.getParsedExpression());
+ assertEquals(String.class, visitor.getVariableType().getRawType());
+ }
+
private void parseExpression(String expression) throws ParsingException {
Map<String, Type> contextMap = new HashMap<String, Type>();
14 years, 11 months
JBoss Rich Faces SVN: r16442 - branches/community/3.3.X/ui/editor/src/main/java/org/richfaces/convert/seamtext.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-02-11 12:02:58 -0500 (Thu, 11 Feb 2010)
New Revision: 16442
Modified:
branches/community/3.3.X/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java
Log:
Fix RF-8364
Modified: branches/community/3.3.X/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java
===================================================================
--- branches/community/3.3.X/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java 2010-02-11 12:38:42 UTC (rev 16441)
+++ branches/community/3.3.X/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java 2010-02-11 17:02:58 UTC (rev 16442)
@@ -137,7 +137,7 @@
case '*': case '|': case '^' : case '+':
case '=': case '#': case '\\': case '~':
case '[': case ']': case '`' : case '_':
- case '<': case '>': case '&':
+ case '<': case '>': case '&': case '"':
if (localStart != -1) {
out(text, localStart, start - localStart);
localStart = -1;
14 years, 11 months
JBoss Rich Faces SVN: r16441 - root/examples-sandbox/trunk/javascripts-draft.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-02-11 07:38:42 -0500 (Thu, 11 Feb 2010)
New Revision: 16441
Added:
root/examples-sandbox/trunk/javascripts-draft/position-test-markup-draft.txt
Log:
markup templates for position testing - draft (not all templates, only based on calendar jirra bugs)
Added: root/examples-sandbox/trunk/javascripts-draft/position-test-markup-draft.txt
===================================================================
--- root/examples-sandbox/trunk/javascripts-draft/position-test-markup-draft.txt (rev 0)
+++ root/examples-sandbox/trunk/javascripts-draft/position-test-markup-draft.txt 2010-02-11 12:38:42 UTC (rev 16441)
@@ -0,0 +1,101 @@
+/*
+ https://jira.jboss.org/jira/browse/RF-645
+ Calendar: incorrectly positioned popup in richfaces-demo
+ IE7
+*/
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
+<form>
+<table width="100%" cellspacing="0" cellpadding="10" border="1" style="position: relative;">
+<tbody>
+<tr>
+<td>
+ <table style="position:absolute; background-color:red" id="testElement">
+ <tr>
+ <td style="width:200px;height:200px">some text</td>
+ </tr>
+ </table>
+</td>
+</tr>
+</tbody>
+</table>
+</form>
+
+/*
+ https://jira.jboss.org/jira/browse/RF-1314
+ Calendar positioning bug.
+*/
+
+<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">
+ <tr>
+ <td style="width:200px;height:200px">some text</td>
+ </tr>
+ </table>
+ <div style="position:absolute; width:200px; height:200px; background-color:red" id="testElement1">some text</div>
+<div style="height:200px"></div>
+</div>
+
+// -----
+
+<table width="400" align="center">
+<tr>
+<td>
+ <table style="position:absolute; background-color:red" id="testElement">
+ <tr>
+ <td style="width:200px;height:200px">some text</td>
+ </tr>
+ </table>
+</td>
+</tr>
+</table>
+
+// -----
+
+<div style="position:absolute; top: 0px; bottom: 0px; left: 0px; right: 0px; overflow: auto;">
+ <table style="position:absolute; background-color:red" id="testElement">
+ <tr>
+ <td style="width:200px;height:200px">some text</td>
+ </tr>
+ </table>
+ <div style="position:absolute; width:200px; height:200px; background-color:red" id="testElement1">some text</div>
+</div>
+
+// ----
+
+<div style="position:absolute; top: 0px; bottom: 0px; left: 0px; right: 0px; overflow: auto;">
+<div>
+ <table style="position:absolute; background-color:red" id="testElement">
+ <tr>
+ <td style="width:200px;height:200px">some text</td>
+ </tr>
+ </table>
+ <div style="position:absolute; width:200px; height:200px; background-color:red" id="testElement1">some text</div>
+</div>
+</div>
+
+// ----
+
+<div style="position:absolute; width:400px; top: 200px; left: 200px;">
+ <table style="position:absolute; background-color:red" id="testElement">
+ <tr>
+ <td style="width:200px;height:200px">some text</td>
+ </tr>
+ </table>
+ <div style="position:absolute; width:200px; height:200px; background-color:red" id="testElement1">some text</div>
+</div>
+
+// ----
+
+<div style="position:absolute; width:400px; top: 200px; left: 200px;">
+<div>
+ <table style="position:absolute; background-color:red" id="testElement">
+ <tr>
+ <td style="width:200px;height:200px">some text</td>
+ </tr>
+ </table>
+ <div style="position:absolute; width:200px; height:200px; background-color:red" id="testElement1">some text</div>
+</div>
+</div>
+
14 years, 11 months
JBoss Rich Faces SVN: r16440 - in root/docs/trunk/Developer_Guide/en-US: extras and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-02-11 01:12:43 -0500 (Thu, 11 Feb 2010)
New Revision: 16440
Added:
root/docs/trunk/Developer_Guide/en-US/extras/
root/docs/trunk/Developer_Guide/en-US/extras/exam-Developer_Guide-Advanced_features-Example_filter_configuration.xml_sample
Modified:
root/docs/trunk/Developer_Guide/en-US/chap-Developer_Guide-Advanced_features.xml
Log:
Worked on Advanced Features
Modified: root/docs/trunk/Developer_Guide/en-US/chap-Developer_Guide-Advanced_features.xml
===================================================================
--- root/docs/trunk/Developer_Guide/en-US/chap-Developer_Guide-Advanced_features.xml 2010-02-10 16:35:58 UTC (rev 16439)
+++ root/docs/trunk/Developer_Guide/en-US/chap-Developer_Guide-Advanced_features.xml 2010-02-11 06:12:43 UTC (rev 16440)
@@ -37,36 +37,336 @@
<section id="sect-Developer_Guide-Advanced_features-Filters">
<title>Filters</title>
<para>
- Incomplete
+ RichFaces uses a filter to correct the code received on an Ajax request. During a regular JSF request, a browser makes corrections independently. For Ajax requests, a filter is needed to prevent layout destruction. This is because a received code could differ from a code validated by a browser, and a browser does not make any corrections. Refer to <xref linkend="sect-Developer_Guide-Architecture-Ajax_Filter" /> for further details on how the Ajax filter works.
</para>
+ <para>
+ <xref linkend="exam-Developer_guide-Advanced_features-Example_filter" /> shows how to set a filter in the <filename>web.xml</filename> file of an application.
+ </para>
+ <example id="exam-Developer_guide-Advanced_features-Example_filter">
+ <title>Example filter</title>
+<programlisting language="XML" role="XML">
+...
+<filter>
+ <display-name>RichFaces Filter</display-name>
+ <filter-name>richfaces</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+</filter>
+...
+</programlisting>
+ </example>
+ <para>
+ Different types of filters can be configured for pages in the same application. There are three filter types:
+ <variablelist>
+ <varlistentry>
+ <term><literal>TIDY</literal></term>
+ <listitem>
+ <para>
+ The <literal>TIDY</literal> filter type is based on the <emphasis>Tidy</emphasis> parser. It is recommended for applications with complicated or non-standard markup. All necessary code corrections are made by the filter when a response comes from the server.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>NEKO</literal></term>
+ <listitem>
+ <para>
+ The <literal>NEKO</literal> filter type replaces the "Fast Filter", and is based on the <emphasis>Neko</emphasis> parser. This filter considerably accelerates all Ajax request processing. However, the filter code is not strictly verified: if it is used with application markup that is non-standard or incorrect, it may cause errors and corrupt the application layout.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>NONE</literal></term>
+ <listitem>
+ <para>
+ No correction is performed.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>
+ <xref linkend="exam-Developer_Guide-Advanced_features-Example_filter_configuration" /> shows how to configure a filter through the <filename>web.xml</filename> file.
+ </para>
+ <example id="exam-Developer_Guide-Advanced_features-Example_filter_configuration">
+ <title>Example filter configuration</title>
+<programlisting language="XML" role="XML">
+<xi:include parse="text" href="extras/exam-Developer_Guide-Advanced_features-Example_filter_configuration.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ </example>
+ <para>
+ The <parameter>ORDER</parameter> parameter specifies the order in which particular filter types are used for code correction: first <literal>NONE</literal>, then <literal>NEKO</literal>, then <literal>TIDY</literal>. Two sets of pages are specified as using specific filter types:
+ <variablelist>
+ <varlistentry>
+ <term><code>/pages/performance\.xhtml,/pages/default.*\.xhtml</code></term>
+ <listitem>
+ <para>
+ These pages do not use a filter for correction, as they are specified as using <literal>NONE</literal>. If a page is not covered by this set, it is checked against the next set (the set using the <literal>NEKO</literal> filter).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><code>/pages/repeat\.xhtml</code></term>
+ <listitem>
+ <para>
+ These pages use the <literal>NEKO</literal> filter for correction. If a page is not covered by this set, it uses the <literal>TIDY</literal> filter for code correction as specified with the <parameter>ORDER</parameter> parameter.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
</section>
<section id="sect-Developer_Guide-Advanced_features-Scripts_and_styles">
- <title>Scripts and styles</title>
+ <title>Script and style loading</title>
<para>
- Incomplete
+ Scripts and styles are normally loaded into a RichFaces application on demand. The default loading strategy can be altered to suit certain applications by specifying the strategy in the <filename>web.xml</filename> file.
</para>
+ <formalpara>
+ <title><code>org.richfaces.LoadScriptStrategy</code></title>
+ <para>
+ The script-loading strategy is specified as follows:
+<programlisting language="XML" role="XML">
+...
+<context-param>
+ <param-name>org.richfaces.LoadScriptStrategy</param-name>
+ <param-value>ALL</param-value>
+</context-param>
+...
+</programlisting>
+ </para>
+ <para>
+ The <sgmltag><param-value></sgmltag> element can be set to one of three values:
+ <variablelist>
+ <varlistentry>
+ <term><literal>ALL</literal></term>
+ <listitem>
+ <para>
+ All scripts are loaded when the application starts.
+ </para>
+ <note>
+ <title>JavaScript file compression</title>
+ <para>
+ When <code>org.richfaces.LoadScriptStrategy</code> is set to <literal>ALL</literal>, JavaScript file compression is turned off.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>DEFAULT</literal></term>
+ <listitem>
+ <para>
+ Scripts are loaded as required. If not otherwise specified, this is the normal script-loading behavior.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>NONE</literal></term>
+ <listitem>
+ <para>
+ No scripts are loaded. This can be useful for including scripts manually.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </formalpara>
+ <formalpara>
+ <title><code>org.richfaces.LoadStyleStrategy</code></title>
+ <para>
+ The style-loading strategy is specified as follows:
+<programlisting language="XML" role="XML">
+...
+<context-param>
+ <param-name>org.richfaces.LoadStyleStrategy</param-name>
+ <param-value>ALL</param-value>
+</context-param>
+...
+</programlisting>
+ </para>
+ <para>
+ The <sgmltag><param-value></sgmltag> element can be set to one of three values:
+ <variablelist>
+ <varlistentry>
+ <term><literal>ALL</literal></term>
+ <listitem>
+ <para>
+ All styles from a single integrated style sheet are loaded when the application starts.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>DEFAULT</literal></term>
+ <listitem>
+ <para>
+ Styles are loaded as required. If not otherwise specified, this is the normal style-loading behavior.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>NONE</literal></term>
+ <listitem>
+ <para>
+ No styles are loaded. The default plain skin resets all color and font parameters to <literal>null</literal>. Any pre-defined styles for RichFaces are not used.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </formalpara>
</section>
<section id="sect-Developer_Guide-Advanced_features-Error_handling">
<title>Error handling</title>
<para>
- Incomplete
+ RichFaces allows standard handlers to be defined for processing different application exceptions. Custom JavaScript can be executed when these exceptions occur.
</para>
+ <para>
+ To define handlers for application exceptions, add the following code to your <filename>web.xml</filename> file:
+<programlisting language="XML" role="XML">
+<context-param>
+ <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
+ <param-value>true</param-value>
+</context-param>
+</programlisting>
+ </para>
+ <section id="sect-Developer_Guide-Advanced_features-Handling_request_errors">
+ <title>Handling request errors</title>
+ <para>
+ To execute custom JavaScript code on the client when an error occurs during an Ajax request, redefine the standard <methodname>A4J.AJAX.onError</methodname> method, as shown in <xref linkend="exam-Developer_Guide-Advanced_features-Example_request_error" />.
+ <example id="exam-Developer_Guide-Advanced_features-Example_request_error">
+ <title>Example request error</title>
+<programlisting language="Java" role="JAVA">
+A4J.AJAX.onError = function(req, status, message){
+ window.alert("Custom onError handler "+message);
+}
+</programlisting>
+ </example>
+ The function accepts three parameters:
+ <variablelist>
+ <varlistentry>
+ <term><parameter>req</parameter></term>
+ <listitem>
+ <para>
+ A string of parameters from the request that caused the error.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>status</parameter></term>
+ <listitem>
+ <para>
+ The error number returned by the server.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>message</parameter></term>
+ <listitem>
+ <para>
+ A default message for the error.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </section>
+ <section id="sect-Developer_Guide-Advanced_features-Handling_session_expiration_errors">
+ <title>Handling session expiration errors</title>
+ <para>
+ Redefine the <methodname>A4J.AJAX.onExpired</methodname> method to handle the expiration of a user's session, as shown in <xref linkend="exam-Developer_Guide-Advanced_features-Example_session_expiration_error" />.
+ <example id="exam-Developer_Guide-Advanced_features-Example_session_expiration_error">
+ <title>Example session expiration error</title>
+<programlisting language="Java" role="JAVA">
+A4J.AJAX.onExpired = function(loc, expiredMsg){
+ if(window.confirm("Custom onExpired handler "+expiredMsg+" for a location: "+loc)){
+ return loc;
+ } else {
+ return false;
+ }
+}
+</programlisting>
+ </example>
+ The function accepts two parameters:
+ <variablelist>
+ <varlistentry>
+ <term><parameter>loc</parameter></term>
+ <listitem>
+ <para>
+ The URL of the current page, which can be updated on demand.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>expiredMsg</parameter></term>
+ <listitem>
+ <para>
+ A default message for the session expiration error.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </section>
+ <note>
+ <title>MyFaces compatibility</title>
+ <para>
+ Custom error handlers for the <methodname>onError</methodname> and <methodname>onExpire</methodname> events do not work under MyFaces. MyFaces handles exceptions through its internal debug page. Use the following code in the <filename>web.xml</filename> file to prevent this behavior in MyFaces:
+<programlisting language="XML" role="XML">
+<context-param>
+ <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
+ <param-value>false</param-value>
+</context-param>
+</programlisting>
+ </para>
+ </note>
</section>
- <section id="sect-Developer_Guide-Advanced_features-Managing_states">
+ <section id="sect-Developer_Guide-Advanced_features-Managing_states" status="draft">
<title>Managing states</title>
<para>
- Incomplete
+ JavaServer Faces (<acronym>JSF</acronym>) has an advanced navigation mechanism that allows you to define navigation from one view to another. Navigation typically happens in a web application when a user moves from one page to another, but there is no switch mechanism between certain logical states in the same view. The RichFaces State API allows sets of states to be defined for the views, as well as any properties associated with these states.
</para>
</section>
<section id="sect-Developer_Guide-Advanced_features-User_roles">
<title>User roles</title>
<para>
- Incomplete
+ To check whether the logged-in user belongs to a certain user role, use the <function>rich:isUserInRole(Object)</function> function in RichFaces. The example demonstrates the function's use to render controls only for users with administrator privileges.
</para>
+ <example id="exam-Developer_Guide-Advanced_features-User_role_example">
+ <title>User role example</title>
+ <para>
+ Certain controls only need to be rendered for administrators.
+ <procedure>
+ <step>
+ <title>Create <literal>admin</literal> role</title>
+ <para>
+ Create the <literal>admin</literal> role in the <filename>web.xml</filename> file:
+<programlisting language="XML" role="XML">
+<security-role>
+ <role-name>admin</role-name>
+</security-role>
+</programlisting>
+ </para>
+ </step>
+ <step>
+ <title>Implement authorization for users</title>
+ <para>
+ Assign the <literal>admin</literal> role to users when they log in to the application as administrators.
+ </para>
+ </step>
+ <step>
+ <title>Use the <function>rich:isUserInRole(Object)</function> function</title>
+ <para>
+ The <function>rich:isUserInRole(Object)</function> function can be used with the <varname>rendered</varname> attribute of any component:
+<programlisting language="XML" role="XML">
+<rich:editor value="#{bean.text}" rendered="#{rich:isUserInRole('admin')}" />
+</programlisting>
+ </para>
+ </step>
+ </procedure>
+ </para>
+
+ </example>
</section>
</chapter>
Added: root/docs/trunk/Developer_Guide/en-US/extras/exam-Developer_Guide-Advanced_features-Example_filter_configuration.xml_sample
===================================================================
--- root/docs/trunk/Developer_Guide/en-US/extras/exam-Developer_Guide-Advanced_features-Example_filter_configuration.xml_sample (rev 0)
+++ root/docs/trunk/Developer_Guide/en-US/extras/exam-Developer_Guide-Advanced_features-Example_filter_configuration.xml_sample 2010-02-11 06:12:43 UTC (rev 16440)
@@ -0,0 +1,26 @@
+...
+<context-param>
+ <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
+ <param-value>NONE,NEKO,TIDY</param-value>
+</context-param>
+<context-param>
+ <param-name>org.ajax4jsf.xmlparser.NONE</param-name>
+ <param-value>/pages/performance\.xhtml,/pages/default.*\.xhtml</param-value>
+</context-param>
+<context-param>
+ <param-name>org.ajax4jsf.xmlparser.NEKO</param-name>
+ <param-value>/pages/repeat\.xhtml</param-value>
+</context-param>
+<filter>
+ <display-name>RichFaces Filter</display-name>
+ <filter-name>richfaces</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+</filter>
+<filter-mapping>
+ <filter-name>richfaces</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+</filter-mapping>
+...
14 years, 11 months
JBoss Rich Faces SVN: r16439 - branches/community/3.3.X/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-02-10 11:35:58 -0500 (Wed, 10 Feb 2010)
New Revision: 16439
Modified:
branches/community/3.3.X/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
RF-8356
Modified: branches/community/3.3.X/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- branches/community/3.3.X/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2010-02-10 00:39:52 UTC (rev 16438)
+++ branches/community/3.3.X/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2010-02-10 16:35:58 UTC (rev 16439)
@@ -956,11 +956,14 @@
ClickInput: function(event){
//alert("event rabotaet dsds ");
- Event.stop(event || window.event);
- return false;
+ var fixedEvent = event || window.event;
+ Event.extend(fixedEvent);
+ fixedEvent.stopPropagation();
+ fixedEvent.stopped = true;
+ return false;
},
-
+
MouseoutInInput: function(event){
var ClickInputb = this.ClickInput.bindAsEventListener(this);
Event.stopObserving(Event.element(event), "click", this.ClickInput);
14 years, 11 months
JBoss Rich Faces SVN: r16438 - in root/cdk/trunk/plugins: generator/src/main/java/org/richfaces/cdk/apt and 16 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-02-09 19:39:52 -0500 (Tue, 09 Feb 2010)
New Revision: 16438
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Output.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Outputs.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Sources.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ComponentTagGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/component.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibTestBase.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTagGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/TaglibGeneratorTest.xml
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTagGeneratorTest.xml
Removed:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolder.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolderImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGenerator.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/freemarker/
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTaglibGeneratorTest.xml
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Source.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/validator.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/RunnerTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/AnnotationProcessorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ModelBeanTest.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
Log:
https://jira.jboss.org/jira/browse/RF-8360
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Generator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -65,9 +65,9 @@
private Charset charset = Charset.defaultCharset();
- private Map<StandardOutputFolders, FileManager> outputFolders = Maps.newEnumMap(StandardOutputFolders.class);
+ private Map<Outputs, FileManager> outputFolders = Maps.newEnumMap(Outputs.class);
- private Map<StandardSources,FileManager> sources = Maps.newEnumMap(StandardSources.class);
+ private Map<Sources,FileManager> sources = Maps.newEnumMap(Sources.class);
private LibraryBuilder libraryBuilder;
@@ -76,11 +76,11 @@
public Generator() {
EmptyFileManager emptyFileManager = new EmptyFileManager();
- for (StandardSources source : StandardSources.values()) {
+ for (Sources source : Sources.values()) {
sources.put(source, emptyFileManager);
}
- for (StandardOutputFolders output : StandardOutputFolders.values()) {
+ for (Outputs output : Outputs.values()) {
outputFolders.put(output, emptyFileManager);
}
}
@@ -94,11 +94,11 @@
this.log = log;
}
- public void addOutputFolder(StandardOutputFolders type, File outputFolder) {
+ public void addOutputFolder(Outputs type, File outputFolder) {
this.outputFolders.put(type, new OutputFileManager(outputFolder));
}
- public void addSources(StandardSources type, Iterable<File> files, Iterable<File> folders){
+ public void addSources(Sources type, Iterable<File> files, Iterable<File> folders){
this.sources.put(type, new SourceFileManager(files, folders));
}
@@ -150,10 +150,10 @@
bind(Logger.class).toInstance(log);
bind(Locale.class).toInstance(locale);
bind(Charset.class).toInstance(charset);
- for (Map.Entry<StandardOutputFolders, FileManager> entry : outputFolders.entrySet()) {
- bind(FileManager.class).annotatedWith(new OutputFolderImpl(entry.getKey())).toInstance(entry.getValue());
+ for (Map.Entry<Outputs, FileManager> entry : outputFolders.entrySet()) {
+ bind(FileManager.class).annotatedWith(new OutputImpl(entry.getKey())).toInstance(entry.getValue());
}
- for (Map.Entry<StandardSources, FileManager> entry : sources.entrySet()) {
+ for (Map.Entry<Sources, FileManager> entry : sources.entrySet()) {
bind(FileManager.class).annotatedWith(new SourceImpl(entry.getKey())).toInstance(entry.getValue());
}
bind(NamingConventions.class).to(RichFacesConventions.class);
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Output.java (from rev 16436, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolder.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Output.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Output.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.cdk;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import com.google.inject.BindingAnnotation;
+
+/**
+ * @author asmirnov
+ * @version $Id$
+ *
+ */
+(a)Retention(RetentionPolicy.RUNTIME)
+@BindingAnnotation
+public @interface Output {
+ public Outputs value();
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Output.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolder.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolder.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolder.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -1,39 +0,0 @@
-/*
- * 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.cdk;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-import com.google.inject.BindingAnnotation;
-
-/**
- * @author asmirnov
- * @version $Id$
- *
- */
-(a)Retention(RetentionPolicy.RUNTIME)
-@BindingAnnotation
-public @interface OutputFolder {
- public StandardOutputFolders value();
-}
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolderImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolderImpl.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolderImpl.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -1,41 +0,0 @@
-package org.richfaces.cdk;
-
-import java.lang.annotation.Annotation;
-
-
-public class OutputFolderImpl implements OutputFolder {
-
- private final StandardOutputFolders value;
-
- public OutputFolderImpl(OutputFolder value) {
- this.value = value.value();
- }
-
- public OutputFolderImpl(StandardOutputFolders value) {
- this.value = value;
- }
-
- @Override
- public StandardOutputFolders value() {
- return value;
- }
-
- public int hashCode() {
- // This is specified in java.lang.Annotation.
- return (127 * "value".hashCode()) ^ value.hashCode();
- }
-
- public boolean equals(Object o) {
- if (!(o instanceof OutputFolder)) {
- return false;
- }
-
- OutputFolder other = (OutputFolder) o;
- return value.equals(other.value());
- }
-
- @Override
- public Class<? extends Annotation> annotationType() {
- return OutputFolder.class;
- }
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputImpl.java (from rev 16436, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputFolderImpl.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputImpl.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputImpl.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,41 @@
+package org.richfaces.cdk;
+
+import java.lang.annotation.Annotation;
+
+
+public class OutputImpl implements Output {
+
+ private final Outputs value;
+
+ public OutputImpl(Output value) {
+ this.value = value.value();
+ }
+
+ public OutputImpl(Outputs value) {
+ this.value = value;
+ }
+
+ @Override
+ public Outputs value() {
+ return value;
+ }
+
+ public int hashCode() {
+ // This is specified in java.lang.Annotation.
+ return (127 * "value".hashCode()) ^ value.hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (!(o instanceof Output)) {
+ return false;
+ }
+
+ Output other = (Output) o;
+ return value.equals(other.value());
+ }
+
+ @Override
+ public Class<? extends Annotation> annotationType() {
+ return Output.class;
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/OutputImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Outputs.java (from rev 16436, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Outputs.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Outputs.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,46 @@
+/*
+ * $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;
+
+
+/**
+ * <p class="changed_added_4_0">This enumeration defines standard types of output folders.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public enum Outputs implements OutputType {
+ JAVA_CLASSES, RESOURCES, TEST_JAVA_CLASSES, TEST_RESOURCES, DOCUMENTATION;
+
+ @Override
+ public OutputType getFolderType() {
+ return null;
+ }
+
+ @Override
+ public String getName() {
+ return name();
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Outputs.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Source.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Source.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Source.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -38,5 +38,5 @@
@BindingAnnotation
@Implementation(SourceImpl.class)
public @interface Source {
- public StandardSources value();
+ public Sources value();
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceImpl.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/SourceImpl.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -5,18 +5,18 @@
public class SourceImpl implements Source {
- private final StandardSources value;
+ private final Sources value;
public SourceImpl(Source value) {
this.value = value.value();
}
- public SourceImpl(StandardSources value) {
+ public SourceImpl(Sources value) {
this.value = value;
}
@Override
- public StandardSources value() {
+ public Sources value() {
return value;
}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Sources.java (from rev 16436, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Sources.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Sources.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,39 @@
+/*
+ * $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;
+
+
+/**
+ * <p class="changed_added_4_0">This enumeration defines standard types for project sources.</p>
+ *
+ * @author asmirnov(a)exadel.com
+ */
+public enum Sources implements SourceType {
+ JAVA_SOURCES, FACES_CONFIGS, RENDERER_TEMPLATES;
+
+ @Override
+ public String getName() {
+ return name();
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/Sources.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputFolders.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -1,46 +0,0 @@
-/*
- * $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;
-
-
-/**
- * <p class="changed_added_4_0">This enumeration defines standard types of output folders.</p>
- * @author asmirnov(a)exadel.com
- *
- */
-public enum StandardOutputFolders implements OutputType {
- JAVA_CLASSES, RESOURCES, TEST_JAVA_CLASSES, TEST_RESOURCES, DOCUMENTATION;
-
- @Override
- public OutputType getFolderType() {
- return null;
- }
-
- @Override
- public String getName() {
- return name();
- }
-}
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -1,68 +0,0 @@
-/*
- * $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;
-
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-public enum StandardOutputs implements OutputType {
- COMPONENT_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- VALIDATOR_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- CONVERTER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- BEHAVIOR_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- RENDERER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- EVENT_LISTENER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- EVENT_SOURCE_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- TAG_HANDLER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
- FACES_CONFIG(StandardOutputFolders.RESOURCES),
- TAG_LIBRARY(StandardOutputFolders.RESOURCES),
- JBDS_RENDERERS(StandardOutputFolders.JAVA_CLASSES),
- XML_SCHEMA(StandardOutputFolders.RESOURCES),
- COMPONENT_TEST(StandardOutputFolders.TEST_JAVA_CLASSES);
-
- private final OutputType folderType;
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param folderType
- */
- private StandardOutputs(OutputType folderType) {
- this.folderType = folderType;
- }
-
- @Override
- public String getName() {
- return name();
- }
-
- @Override
- public OutputType getFolderType() {
- return folderType;
- }
-}
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardSources.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -1,39 +0,0 @@
-/*
- * $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;
-
-
-/**
- * <p class="changed_added_4_0">This enumeration defines standard types for project sources.</p>
- *
- * @author asmirnov(a)exadel.com
- */
-public enum StandardSources implements SourceType {
- JAVA_SOURCES, FACES_CONFIGS, RENDERER_TEMPLATES;
-
- @Override
- public String getName() {
- return name();
- }
-}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -44,10 +44,10 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.OutputFolder;
+import org.richfaces.cdk.Output;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardOutputFolders;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.Sources;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList;
@@ -100,11 +100,11 @@
private CdkClassLoader classPathLoader;
@Inject
- @OutputFolder(StandardOutputFolders.JAVA_CLASSES)
+ @Output(Outputs.JAVA_CLASSES)
private FileManager outputFolder;
@Inject
- @Source(StandardSources.JAVA_SOURCES)
+ @Source(Sources.JAVA_SOURCES)
private FileManager sourceFolders;
@Inject
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/BehaviorClassGenerator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -27,8 +27,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.model.BehaviorModel;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -49,7 +49,7 @@
* @see org.richfaces.cdk.CdkWriter#init(org.richfaces.cdk.CdkContext)
*/
@Inject
- public BehaviorClassGenerator(Configuration configuration, ComponentLibrary library, @OutputFolder(StandardOutputFolders.JAVA_CLASSES) FileManager output) {
+ public BehaviorClassGenerator(Configuration configuration, ComponentLibrary library, @Output(Outputs.JAVA_CLASSES) FileManager output) {
super(configuration, library, output);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ComponentClassGenerator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -30,8 +30,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
@@ -53,7 +53,7 @@
* @see org.richfaces.cdk.CdkWriter#init(org.richfaces.cdk.CdkContext)
*/
@Inject
- public ComponentClassGenerator(Configuration configuration, ComponentLibrary library, @OutputFolder(StandardOutputFolders.JAVA_CLASSES) FileManager output) {
+ public ComponentClassGenerator(Configuration configuration, ComponentLibrary library, @Output(Outputs.JAVA_CLASSES) FileManager output) {
super(configuration, library, output);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -27,8 +27,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConverterModel;
@@ -46,7 +46,7 @@
@Inject
public ConverterClassGenerator(Configuration configuration, ComponentLibrary library,
- @OutputFolder(StandardOutputFolders.JAVA_CLASSES) FileManager output) {
+ @Output(Outputs.JAVA_CLASSES) FileManager output) {
super(configuration, library, output);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ValidatorClassGenerator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -27,8 +27,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ValidatorModel;
@@ -45,7 +45,7 @@
public class ValidatorClassGenerator extends FreeMarkerRenderer<ValidatorModel, ComponentLibrary> implements CdkWriter {
@Inject
- public ValidatorClassGenerator(Configuration configuration, ComponentLibrary library, @OutputFolder(StandardOutputFolders.JAVA_CLASSES) FileManager output) {
+ public ValidatorClassGenerator(Configuration configuration, ComponentLibrary library, @Output(Outputs.JAVA_CLASSES) FileManager output) {
super(configuration, library, output);
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ComponentTagGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ComponentTagGenerator.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ComponentTagGenerator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,49 @@
+/*
+ * $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.generate.taglib;
+
+import org.richfaces.cdk.model.ComponentModel;
+
+import com.google.inject.Inject;
+
+import freemarker.template.Configuration;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class ComponentTagGenerator extends TagGeneratorBase<ComponentModel> {
+
+ @Inject
+ public ComponentTagGenerator(Configuration configuration) {
+ super(configuration);
+ }
+
+ @Override
+ protected String getTemplateName() {
+ return "taglib/component.ftl";
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ComponentTagGenerator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGenerator.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGenerator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -30,8 +30,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.LibraryVisitor;
import org.richfaces.cdk.model.Visitable;
@@ -63,7 +63,7 @@
@Inject
public TaglibGenerator(Configuration configuration, ComponentLibrary library,
- @OutputFolder(StandardOutputFolders.RESOURCES) FileManager output,
+ @Output(Outputs.RESOURCES) FileManager output,
Map<Class<? extends Visitable>, TagGenerator<? extends Visitable>> tagGenerators) {
this.library = library;
this.output = output;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibModule.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -24,6 +24,7 @@
package org.richfaces.cdk.generate.taglib;
import org.richfaces.cdk.CdkWriter;
+import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.ValidatorModel;
import org.richfaces.cdk.model.Visitable;
@@ -47,7 +48,8 @@
Multibinder<CdkWriter> setBinder = Multibinder.newSetBinder(binder(),CdkWriter.class);
setBinder.addBinding().to(TaglibGenerator.class);
MapBinder<Class<? extends Visitable>, TagGenerator<? extends Visitable>> mapBinder = MapBinder.newMapBinder(binder(), new TypeLiteral<Class<? extends Visitable>>(){}, new TypeLiteral<TagGenerator<? extends Visitable>>(){});
- mapBinder.addBinding(ValidatorModel.class).to(ValidatorTaglibGenerator.class);
+ mapBinder.addBinding(ValidatorModel.class).to(ValidatorTagGenerator.class);
+ mapBinder.addBinding(ComponentModel.class).to(ComponentTagGenerator.class);
}
}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java (from rev 16436, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGenerator.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTagGenerator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , 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.cdk.generate.taglib;
+
+import java.io.File;
+
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ValidatorModel;
+import org.richfaces.cdk.model.Visitable;
+
+import com.google.inject.Inject;
+
+import freemarker.template.Configuration;
+
+/**
+ * @author akolonitsky
+ * @since Jan 18, 2010
+ */
+public class ValidatorTagGenerator extends TagGeneratorBase<ValidatorModel>{
+
+
+
+
+ @Inject
+ public ValidatorTagGenerator(Configuration configuration) {
+ super(configuration);
+ }
+
+ @Override
+ protected String getTemplateName() {
+ return "taglib/validator.ftl";
+ }
+
+}
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGenerator.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGenerator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright , 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.cdk.generate.taglib;
-
-import java.io.File;
-
-import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
-import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
-import org.richfaces.cdk.model.ComponentLibrary;
-import org.richfaces.cdk.model.ValidatorModel;
-import org.richfaces.cdk.model.Visitable;
-
-import com.google.inject.Inject;
-
-import freemarker.template.Configuration;
-
-/**
- * @author akolonitsky
- * @since Jan 18, 2010
- */
-public class ValidatorTaglibGenerator extends TagGeneratorBase<ValidatorModel>{
-
-
-
-
- @Inject
- public ValidatorTaglibGenerator(Configuration configuration) {
- super(configuration);
- }
-
- @Override
- protected String getTemplateName() {
- return "taglib/validator.ftl";
- }
-
-}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -218,6 +218,7 @@
return tagLibrary;
}
+
// Utility methods.
/**
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -33,8 +33,8 @@
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.Property;
@@ -72,7 +72,7 @@
*/
@Inject
public RendererClassGenerator(ComponentLibrary library,
- @OutputFolder(StandardOutputFolders.JAVA_CLASSES) FileManager output, Logger log,
+ @Output(Outputs.JAVA_CLASSES) FileManager output, Logger log,
TemplateVisitorFactory<RendererClassVisitor> visitorFactory, FreeMarkerRenderer renderer) {
this.library = library;
this.output = output;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -37,7 +37,7 @@
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.ModelBuilder;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.EventName;
@@ -89,7 +89,7 @@
* @param sources
*/
@Inject
- public RendererTemplateParser(ComponentLibrary library, JAXB jaxbBinding, Logger log, @Source(StandardSources.RENDERER_TEMPLATES) FileManager sources,FragmentParser fragmentParser) {
+ public RendererTemplateParser(ComponentLibrary library, JAXB jaxbBinding, Logger log, @Source(Sources.RENDERER_TEMPLATES) FileManager sources,FragmentParser fragmentParser) {
this.library = library;
this.jaxbBinding = jaxbBinding;
this.log = log;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/CdkEntityResolver.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -33,7 +33,7 @@
import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.ext.EntityResolver2;
@@ -93,9 +93,9 @@
@Inject
private CdkClassLoader loader;
- @Inject @Source(StandardSources.FACES_CONFIGS)
+ @Inject @Source(Sources.FACES_CONFIGS)
private FileManager facesConfigFolders;
- @Inject @Source(StandardSources.RENDERER_TEMPLATES)
+ @Inject @Source(Sources.RENDERER_TEMPLATES)
private FileManager rendererTemplatesFolders;
/*
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigGenerator.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -30,8 +30,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.xmlconfig.model.FacesConfigAdapter;
@@ -54,7 +54,7 @@
private JAXB jaxbBinding;
@Inject
private ComponentLibrary library;
- @Inject @OutputFolder(StandardOutputFolders.RESOURCES)
+ @Inject @Output(Outputs.RESOURCES)
private FileManager outputFileManager;
private FacesConfigAdapter libraryAdapter;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigParser.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -29,7 +29,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.ModelBuilder;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.xmlconfig.model.FacesConfigAdapter;
import org.richfaces.cdk.xmlconfig.model.FacesConfigBean;
@@ -51,7 +51,7 @@
private JAXB jaxbBinding;
@Inject
private ComponentLibrary library;
- @Inject @Source(StandardSources.FACES_CONFIGS)
+ @Inject @Source(Sources.FACES_CONFIGS)
private FileManager configFiles;
Added: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/component.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/component.ftl (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/component.ftl 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,17 @@
+ <tag>
+ <tag-name>${type}</tag-name>
+ <component>
+ <component-type>${type}</component-type>
+ <renderer-type>${renderers[0].type}</renderer-type>
+ </component>
+
+ <#list attributes as attribute>
+ <attribute>
+ <#if attribute.description?exists>
+ <description>${attribute.description}</description>
+ </#if>
+ <name>${attribute.name}</name>
+ <type>${attribute.type}</type>
+ </attribute>
+ </#list>
+ </tag>
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/validator.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/validator.ftl 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/taglib/validator.ftl 2010-02-10 00:39:52 UTC (rev 16438)
@@ -1,7 +1,3 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<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">
<tag>
<tag-name>${validatorClass}</tag-name>
<validator>
@@ -9,7 +5,7 @@
<handler-class>${validatorClass}</handler-class>
</validator>
- <#list generatedAttributes as attribute>
+ <#list attributes as attribute>
<attribute>
<#if attribute.description?exists>
<description>${attribute.description}</description>
@@ -18,5 +14,4 @@
<type>${attribute.type}</type>
</attribute>
</#list>
- </tag>
-</facelet-taglib>
\ No newline at end of file
+ </tag>
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/RunnerTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/RunnerTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/RunnerTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -13,7 +13,7 @@
private Logger log;
@Stub
- @Source(StandardSources.JAVA_SOURCES)
+ @Source(Sources.JAVA_SOURCES)
FileManager sources;
@Test
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/AnnotationProcessorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/AnnotationProcessorTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/AnnotationProcessorTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -36,7 +36,7 @@
import org.richfaces.cdk.Source;
import org.richfaces.cdk.SourceFileManager;
import org.richfaces.cdk.SourceImpl;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.annotations.Family;
import org.richfaces.cdk.model.ComponentModel;
@@ -51,7 +51,7 @@
public abstract class AnnotationProcessorTest extends CdkTestBase {
@Inject
- @Source(StandardSources.JAVA_SOURCES)
+ @Source(Sources.JAVA_SOURCES)
protected FileManager sources;
@Mock
@@ -67,7 +67,7 @@
for (String src : sources()) {
sourceFiles.add(getJavaFile(src));
}
- binder.bind(FileManager.class).annotatedWith(new SourceImpl(StandardSources.JAVA_SOURCES)).toInstance(
+ binder.bind(FileManager.class).annotatedWith(new SourceImpl(Sources.JAVA_SOURCES)).toInstance(
new SourceFileManager(sourceFiles, this.testSourceDirectory));
} catch (Exception e) {
throw new RuntimeException(e);
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/CdkProcessorTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -41,8 +41,8 @@
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.ModelBuilder;
import org.richfaces.cdk.ModelValidator;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.Stub;
import com.google.common.collect.ImmutableList;
@@ -72,7 +72,7 @@
private CdkProcessor processor;
@Stub
- @OutputFolder(StandardOutputFolders.JAVA_CLASSES)
+ @Output(Outputs.JAVA_CLASSES)
private FileManager output;
@Inject
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/TaskFactoryTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -44,8 +44,8 @@
import org.richfaces.cdk.CdkTestRunner;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.Stub;
import com.google.common.collect.ImmutableList;
@@ -72,7 +72,7 @@
Processor processor;
@Stub
- @OutputFolder(StandardOutputFolders.JAVA_CLASSES)
+ @Output(Outputs.JAVA_CLASSES)
private FileManager output;
/**
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -35,8 +35,8 @@
import org.richfaces.cdk.CdkTestBase;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
import org.richfaces.cdk.freemarker.CdkConfiguration;
import org.richfaces.cdk.freemarker.LibraryModelWrapper;
import org.richfaces.cdk.model.ClassDescription;
@@ -68,7 +68,7 @@
protected ObjectWrapper wrapper;
@Mock
- @OutputFolder(StandardOutputFolders.RESOURCES)
+ @Output(Outputs.RESOURCES)
protected FileManager output;
protected static Property addAttribute(ModelElementBase model, String attributeName, Class<?> type, boolean generate) {
Added: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , 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.cdk.generate.taglib;
+
+import static org.easymock.EasyMock.*;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URISyntaxException;
+import java.util.Set;
+
+import javax.faces.component.UIOutput;
+
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.Validator;
+import org.easymock.EasyMock;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.cdk.As;
+import org.richfaces.cdk.CdkTestBase;
+import org.richfaces.cdk.CdkTestRunner;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Mock;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.freemarker.CdkConfiguration;
+import org.richfaces.cdk.freemarker.LibraryModelWrapper;
+import org.richfaces.cdk.generate.taglib.ValidatorTagGenerator;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ComponentModel;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.ValidatorModel;
+import org.richfaces.cdk.model.Visitable;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.EntityResolver2;
+
+import com.google.inject.Binder;
+import com.google.inject.Inject;
+import com.google.inject.TypeLiteral;
+import com.google.inject.multibindings.MapBinder;
+
+import freemarker.template.Configuration;
+import freemarker.template.ObjectWrapper;
+
+/**
+ * @author akolonitsky
+ * @since Jan 18, 2010
+ */
+(a)RunWith(CdkTestRunner.class)
+public class TaglibGeneratorTest extends TaglibTestBase {
+
+ @Inject
+ private TaglibGenerator generator;
+
+ @Mock
+ private TagGenerator<ComponentModel> mockComponentGenerator;
+
+
+ @Override
+ public void configure(Binder binder) {
+ MapBinder<Class<? extends Visitable>, TagGenerator<? extends Visitable>> mapBinder = MapBinder.newMapBinder(binder, new TypeLiteral<Class<? extends Visitable>>(){}, new TypeLiteral<TagGenerator<? extends Visitable>>(){});
+// mockComponentGenerator = createMock(TagGenerator.class);
+ mapBinder.addBinding(ComponentModel.class).to(new TypeLiteral<TagGenerator<ComponentModel>>(){});
+ }
+ /**
+ * Test method for
+ * {@link org.richfaces.cdk.generate.java.ComponentClassGenerator#getOutputFile(org.richfaces.cdk.model.ComponentModel)}
+ * .
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testGetOutputFileComponent() throws Exception {
+ final StringWriter outputWriter = new StringWriter();
+ expect(output.createOutput(eq("META-INF/test.taglib.xml"), anyLong())).andReturn(outputWriter);
+ ComponentModel componentModel = new ComponentModel();
+ library.getTagLibrary().setShortName("test");
+ library.getComponents().add(componentModel);
+ mockComponentGenerator.generate(componentModel, outputWriter);expectLastCall();
+ replay(output, resolver,mockComponentGenerator);
+ generator.render();
+
+ System.out.println(outputWriter);
+ verify(output, resolver,mockComponentGenerator);
+
+ checkXmlStructure(outputWriter);
+
+ // TODO validate xml by xsd
+ // validateXml(output);
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibTestBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibTestBase.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibTestBase.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , 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.cdk.generate.taglib;
+
+import static org.easymock.EasyMock.*;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URISyntaxException;
+import java.util.Set;
+
+import javax.faces.component.UIOutput;
+
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.Validator;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.cdk.As;
+import org.richfaces.cdk.CdkTestBase;
+import org.richfaces.cdk.CdkTestRunner;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Mock;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.freemarker.CdkConfiguration;
+import org.richfaces.cdk.freemarker.LibraryModelWrapper;
+import org.richfaces.cdk.generate.taglib.ValidatorTagGenerator;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.ValidatorModel;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.EntityResolver2;
+
+import com.google.inject.Inject;
+
+import freemarker.template.Configuration;
+import freemarker.template.ObjectWrapper;
+
+/**
+ * @author akolonitsky
+ * @since Jan 18, 2010
+ */
+(a)RunWith(CdkTestRunner.class)
+public class TaglibTestBase extends CdkTestBase {
+
+
+ @Inject
+ protected ComponentLibrary library;
+
+ @Inject
+ @As(CdkConfiguration.class)
+ protected Configuration configuration;
+
+ @Inject
+ @As(LibraryModelWrapper.class)
+ protected ObjectWrapper wrapper;
+
+ @Mock
+ protected EntityResolver2 resolver;
+
+ @Mock
+ @Output(Outputs.RESOURCES)
+ protected FileManager output;
+
+ protected EventName createEvent(String name, boolean defaultEvent) {
+ EventName event = new EventName();
+ event.setName(name);
+ event.setDefaultEvent(defaultEvent);
+ return event;
+ }
+
+ protected Property createAttribute( Class<?> type, boolean generate) {
+ Property attribute = new Property();
+ attribute.setType(new ClassDescription(type));
+ attribute.setGenerate(generate);
+ return attribute;
+ }
+
+ // TODO move it in other class
+ protected void validateXml(StringWriter facesConfig) throws SAXException, IOException, URISyntaxException {
+ InputSource is = new InputSource(new StringReader(facesConfig.toString()));
+ Validator validator = new Validator(is);
+ validator.useXMLSchema(true);
+ InputSource source =
+ new InputSource(getJavaFile("META-INF/schema/web-facelettaglibrary_2_0.xsd").toURI().toString());
+ validator.setJAXP12SchemaSource(source);
+
+ validator.assertIsValid();
+ }
+
+ protected void checkXmlStructure(StringWriter writer) throws SAXException, IOException {
+ Class<?> testClass = this.getClass();
+ InputStream expectedFacesConfigFile = testClass.getResourceAsStream(testClass.getSimpleName() + ".xml");
+ if (expectedFacesConfigFile == null) {
+ return;
+ }
+
+ Diff xmlDiff = new Diff(new StringReader(writer.toString()), new InputStreamReader(expectedFacesConfigFile));
+
+ Assert.assertTrue("XML was not similar", xmlDiff.similar());
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/TaglibTestBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTagGeneratorTest.java (from rev 16436, root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGeneratorTest.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTagGeneratorTest.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTagGeneratorTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , 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.cdk.generate.taglib;
+
+import static org.easymock.EasyMock.*;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URISyntaxException;
+import java.util.Set;
+
+import javax.faces.component.UIOutput;
+
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.Validator;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.cdk.As;
+import org.richfaces.cdk.CdkTestBase;
+import org.richfaces.cdk.CdkTestRunner;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Mock;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.freemarker.CdkConfiguration;
+import org.richfaces.cdk.freemarker.LibraryModelWrapper;
+import org.richfaces.cdk.generate.taglib.ValidatorTagGenerator;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.ValidatorModel;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.EntityResolver2;
+
+import com.google.inject.Inject;
+
+import freemarker.template.Configuration;
+import freemarker.template.ObjectWrapper;
+
+/**
+ * @author akolonitsky
+ * @since Jan 18, 2010
+ */
+(a)RunWith(CdkTestRunner.class)
+public class ValidatorTagGeneratorTest extends TaglibTestBase {
+
+ @Inject
+ private ValidatorTagGenerator generator;
+
+
+ /**
+ * Test method for
+ * {@link org.richfaces.cdk.generate.java.ComponentClassGenerator#getOutputFile(org.richfaces.cdk.model.ComponentModel)}
+ * .
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testGetOutputFileComponent() throws Exception {
+ final StringWriter outputWriter = new StringWriter();
+
+ ValidatorModel validator = new ValidatorModel("foo.bar", new ClassDescription(UIOutput.class));
+ validator.setGenerate(true);
+
+ Property attribute1 = createAttribute( Object.class, true);
+ validator.getAttributes().put("testValue", attribute1);
+ Property attribute2 = createAttribute( boolean.class, true);
+ validator.getAttributes().put("testFlag", attribute2);
+ Property attribute = createAttribute(String.class, false);
+ validator.getAttributes().put("id", attribute);
+
+ Set<EventName> eventNames = attribute.getEventNames();
+ eventNames.add(createEvent("id", false));
+ eventNames.add(createEvent("action", true));
+
+ library.getValidators().add(validator);
+ replay(output, resolver);
+ generator.generate(validator, outputWriter);
+
+ System.out.println(outputWriter);
+ verify(output, resolver);
+
+ checkXmlStructure(outputWriter);
+
+ // TODO validate xml by xsd
+ // validateXml(output);
+ }
+}
Deleted: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGeneratorTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/taglib/ValidatorTaglibGeneratorTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -1,166 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright , 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.cdk.generate.taglib;
-
-import static org.easymock.EasyMock.*;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.net.URISyntaxException;
-import java.util.Set;
-
-import javax.faces.component.UIOutput;
-
-import org.custommonkey.xmlunit.Diff;
-import org.custommonkey.xmlunit.Validator;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.richfaces.cdk.As;
-import org.richfaces.cdk.CdkTestBase;
-import org.richfaces.cdk.CdkTestRunner;
-import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.Mock;
-import org.richfaces.cdk.OutputFolder;
-import org.richfaces.cdk.StandardOutputFolders;
-import org.richfaces.cdk.freemarker.CdkConfiguration;
-import org.richfaces.cdk.freemarker.LibraryModelWrapper;
-import org.richfaces.cdk.generate.taglib.ValidatorTaglibGenerator;
-import org.richfaces.cdk.model.ClassDescription;
-import org.richfaces.cdk.model.ComponentLibrary;
-import org.richfaces.cdk.model.EventName;
-import org.richfaces.cdk.model.Property;
-import org.richfaces.cdk.model.ValidatorModel;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.ext.EntityResolver2;
-
-import com.google.inject.Inject;
-
-import freemarker.template.Configuration;
-import freemarker.template.ObjectWrapper;
-
-/**
- * @author akolonitsky
- * @since Jan 18, 2010
- */
-(a)RunWith(CdkTestRunner.class)
-public class ValidatorTaglibGeneratorTest extends CdkTestBase {
-
- @Inject
- private ValidatorTaglibGenerator generator;
-
- @Inject
- private ComponentLibrary library;
-
- @Inject
- @As(CdkConfiguration.class)
- private Configuration configuration;
-
- @Inject
- @As(LibraryModelWrapper.class)
- ObjectWrapper wrapper;
-
- @Mock
- private EntityResolver2 resolver;
-
- @Mock
- @OutputFolder(StandardOutputFolders.RESOURCES)
- private FileManager output;
-
- /**
- * Test method for
- * {@link org.richfaces.cdk.generate.java.ComponentClassGenerator#getOutputFile(org.richfaces.cdk.model.ComponentModel)}
- * .
- *
- * @throws Exception
- */
- @Test
- public void testGetOutputFileComponent() throws Exception {
- final StringWriter outputWriter = new StringWriter();
-
- ValidatorModel validator = new ValidatorModel("foo.bar", new ClassDescription(UIOutput.class));
- validator.setGenerate(true);
-
- addAttribute(validator, "testValue", Object.class, true);
- addAttribute(validator, "testFlag", boolean.class, true);
- Property attribute = addAttribute(validator, "id", String.class, false);
-
- Set<EventName> eventNames = attribute.getEventNames();
- eventNames.add(getEvent("id", false));
- eventNames.add(getEvent("action", true));
-
- library.getValidators().add(validator);
- replay(output, resolver);
- generator.generate(validator, outputWriter);
-
- System.out.println(outputWriter);
- verify(output, resolver);
-
- checkXmlStructure(outputWriter);
-
- // TODO validate xml by xsd
- // validateXml(output);
- }
-
- private EventName getEvent(String name, boolean defaultEvent) {
- EventName event = new EventName();
- event.setName(name);
- event.setDefaultEvent(defaultEvent);
- return event;
- }
-
- private Property addAttribute(ValidatorModel validator, String attributeName, Class<?> type, boolean generate) {
- Property attribute = validator.addAttribute(attributeName);
- attribute.setType(new ClassDescription(type));
- attribute.setGenerate(generate);
- return attribute;
- }
-
- // TODO move it in other class
- protected void validateXml(StringWriter facesConfig) throws SAXException, IOException, URISyntaxException {
- InputSource is = new InputSource(new StringReader(facesConfig.toString()));
- Validator validator = new Validator(is);
- validator.useXMLSchema(true);
- InputSource source =
- new InputSource(getJavaFile("META-INF/schema/web-facelettaglibrary_2_0.xsd").toURI().toString());
- validator.setJAXP12SchemaSource(source);
-
- validator.assertIsValid();
- }
-
- protected void checkXmlStructure(StringWriter writer) throws SAXException, IOException {
- Class<?> testClass = this.getClass();
- InputStream expectedFacesConfigFile = testClass.getResourceAsStream(testClass.getSimpleName() + ".xml");
- if (expectedFacesConfigFile == null) {
- return;
- }
-
- Diff xmlDiff = new Diff(new StringReader(writer.toString()), new InputStreamReader(expectedFacesConfigFile));
-
- Assert.assertTrue("XML was not similar", xmlDiff.similar());
- }
-}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -45,7 +45,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.EventName;
@@ -82,7 +82,7 @@
private EntityResolver2 resolver;
@Mock
- @Source(StandardSources.RENDERER_TEMPLATES)
+ @Source(Sources.RENDERER_TEMPLATES)
private FileManager templatesSource;
private RenderKitModel getRenderkitFromModel(String renderkitId) {
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/CdkResolverTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -14,7 +14,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.annotations.Component;
import org.xml.sax.InputSource;
@@ -31,11 +31,11 @@
private CdkEntityResolver entityResolver;
@Mock
- @Source(StandardSources.FACES_CONFIGS)
+ @Source(Sources.FACES_CONFIGS)
private FileManager facesConfigSource;
@Mock
- @Source(StandardSources.RENDERER_TEMPLATES)
+ @Source(Sources.RENDERER_TEMPLATES)
private FileManager templatesSource;
@Override
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FacesConfigTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -37,7 +37,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.FacetModel;
@@ -73,11 +73,11 @@
JAXB jaxbBinding;
@Mock
- @Source(StandardSources.RENDERER_TEMPLATES)
+ @Source(Sources.RENDERER_TEMPLATES)
private FileManager templatesSource;
@Mock
- @Source(StandardSources.FACES_CONFIGS)
+ @Source(Sources.FACES_CONFIGS)
private FileManager configSource;
@Override
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/FragmentParserTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -38,7 +38,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.Property;
import org.xml.sax.ext.EntityResolver2;
@@ -68,11 +68,11 @@
JAXB binder;
@Mock
- @Source(StandardSources.RENDERER_TEMPLATES)
+ @Source(Sources.RENDERER_TEMPLATES)
private FileManager templatesSource;
@Mock
- @Source(StandardSources.FACES_CONFIGS)
+ @Source(Sources.FACES_CONFIGS)
private FileManager configSource;
@Override
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ModelBeanTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ModelBeanTest.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/xmlconfig/testmodel/ModelBeanTest.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -40,7 +40,7 @@
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.Source;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Sources;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.xmlconfig.CdkEntityResolver;
import org.richfaces.cdk.xmlconfig.FacesConfigGenerator;
@@ -71,11 +71,11 @@
EntityResolver2 resolver;
@Mock
- @Source(StandardSources.RENDERER_TEMPLATES)
+ @Source(Sources.RENDERER_TEMPLATES)
FileManager templatesSource;
@Mock
- @Source(StandardSources.FACES_CONFIGS)
+ @Source(Sources.FACES_CONFIGS)
FileManager configSource;
@Override
Copied: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib (from rev 16436, root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/freemarker)
Added: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/TaglibGeneratorTest.xml
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/TaglibGeneratorTest.xml (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/TaglibGeneratorTest.xml 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<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">
+
+</facelet-taglib>
Property changes on: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/TaglibGeneratorTest.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTagGeneratorTest.xml
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTagGeneratorTest.xml (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTagGeneratorTest.xml 2010-02-10 00:39:52 UTC (rev 16438)
@@ -0,0 +1,16 @@
+ <tag>
+ <tag-name>javax.faces.component.UIOutput</tag-name>
+ <validator>
+ <validator-id>foo.bar</validator-id>
+ <handler-class>javax.faces.component.UIOutput</handler-class>
+ </validator>
+
+ <attribute>
+ <name>testValue</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <name>testFlag</name>
+ <type>boolean</type>
+ </attribute>
+ </tag>
Deleted: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTaglibGeneratorTest.xml
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/freemarker/ValidatorTaglibGeneratorTest.xml 2010-02-09 16:52:15 UTC (rev 16436)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/taglib/ValidatorTaglibGeneratorTest.xml 2010-02-10 00:39:52 UTC (rev 16438)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<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">
- <tag>
- <tag-name>javax.faces.component.UIOutput</tag-name>
- <validator>
- <validator-id>foo.bar</validator-id>
- <handler-class>javax.faces.component.UIOutput</handler-class>
- </validator>
-
- <attribute>
- <name>testValue</name>
- <type>java.lang.Object</type>
- </attribute>
- <attribute>
- <name>testFlag</name>
- <type>boolean</type>
- </attribute>
- </tag>
-</facelet-taglib>
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2010-02-10 00:00:27 UTC (rev 16437)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2010-02-10 00:39:52 UTC (rev 16438)
@@ -45,8 +45,8 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.Generator;
import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.StandardOutputFolders;
-import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.Sources;
/**
* <p class="changed_added_4_0">
@@ -199,17 +199,17 @@
}
- generator.addSources(StandardSources.JAVA_SOURCES, findJavaFiles(), folders);
+ generator.addSources(Sources.JAVA_SOURCES, findJavaFiles(), folders);
// TODO - detect templates and configs directories.
- generator.addSources(StandardSources.RENDERER_TEMPLATES, findTemplateFiles(), null);
- generator.addSources(StandardSources.FACES_CONFIGS, findFacesConfigFiles(), null);
+ generator.addSources(Sources.RENDERER_TEMPLATES, findTemplateFiles(), null);
+ generator.addSources(Sources.FACES_CONFIGS, findFacesConfigFiles(), null);
// Setup output folders.
- setOutput(generator, outputJavaDirectory, StandardOutputFolders.JAVA_CLASSES);
- setOutput(generator, outputResourcesDirectory, StandardOutputFolders.RESOURCES);
- setOutput(generator, outputTestDirectory, StandardOutputFolders.TEST_JAVA_CLASSES);
- setOutput(generator, outputTestResourcesDirectory, StandardOutputFolders.TEST_RESOURCES);
+ setOutput(generator, outputJavaDirectory, Outputs.JAVA_CLASSES);
+ setOutput(generator, outputResourcesDirectory, Outputs.RESOURCES);
+ setOutput(generator, outputTestDirectory, Outputs.TEST_JAVA_CLASSES);
+ setOutput(generator, outputTestResourcesDirectory, Outputs.TEST_RESOURCES);
// configure CDK workers.
setupPlugins(generator);
@@ -264,7 +264,7 @@
* @param directory
* @param type
*/
- private static void setOutput(Generator generator, File directory, StandardOutputFolders type) {
+ private static void setOutput(Generator generator, File directory, Outputs type) {
if (!directory.exists()) {
directory.mkdirs();
}
14 years, 11 months
JBoss Rich Faces SVN: r16437 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-02-09 19:00:27 -0500 (Tue, 09 Feb 2010)
New Revision: 16437
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml
Log:
Updated tech reqs as per Jira RFPL-210
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml 2010-02-09 16:52:15 UTC (rev 16436)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml 2010-02-10 00:00:27 UTC (rev 16437)
@@ -81,13 +81,13 @@
<title>Supported JavaServer Faces Implementations and Frameworks</title>
<itemizedlist>
- <listitem><para>Sun JSF-RI - 1.2_12</para></listitem>
+ <listitem><para>Sun JSF-RI - 1.2_x (1.2_14 recommended), 2.x</para></listitem>
- <listitem><para>MyFaces 1.2.5</para></listitem>
+ <listitem><para>MyFaces 1.2.x (1.2.5 recommended), 2.x</para></listitem>
- <listitem><para>Facelets 1.1.1 - 1.2</para></listitem>
+ <listitem><para>Facelets 1.1.x</para></listitem>
- <listitem><para>Seam 1.2. - 2.1.0</para></listitem>
+ <listitem><para>Seam 2.x</para></listitem>
</itemizedlist>
</section>
@@ -101,13 +101,13 @@
<listitem><para>BEA WebLogic 9.1 - 10.0</para></listitem>
- <listitem><para>Resin 3.1</para></listitem>
+ <listitem><para>Resin 3.1.x</para></listitem>
<listitem><para>Jetty 6.1.x</para></listitem>
- <listitem><para>Sun Application Server 9 (J2EE 1.5)</para></listitem>
+ <listitem><para>Sun Application Server 9 (J5EE)</para></listitem>
- <listitem><para>Glassfish (J2EE 5)</para></listitem>
+ <listitem><para>Glassfish V2, V3</para></listitem>
<listitem><para>JBoss 4.2.x - 5</para></listitem>
@@ -130,7 +130,7 @@
<listitem><para>Firefox 3.0 and higher</para></listitem>
- <listitem><para>Opera 8.5 and higher</para></listitem>
+ <listitem><para>Opera 9.5 and higher</para></listitem>
</itemizedlist>
@@ -138,16 +138,16 @@
<title>Windows environments</title>
+ <listitem><para>Firefox 3.0 and higher</para></listitem>
+
+ <listitem><para>Google Chrome</para></listitem>
+
<listitem><para>Internet Explorer 6.0 and higher</para></listitem>
- <listitem><para>Firefox 3.0 and higher</para></listitem>
-
- <listitem><para>Opera 8.5 and higher</para></listitem>
+ <listitem><para>Opera 9.5 and higher</para></listitem>
<listitem><para>Safari 3.0 and higher</para></listitem>
- <listitem><para>Google Chrome</para></listitem>
-
</itemizedlist>
<itemizedlist>
14 years, 11 months
JBoss Rich Faces SVN: r16436 - branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-02-09 11:52:15 -0500 (Tue, 09 Feb 2010)
New Revision: 16436
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller/DataScrollerBean.java
Log:
Fix RF-8357
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller/DataScrollerBean.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller/DataScrollerBean.java 2010-02-09 16:50:25 UTC (rev 16435)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller/DataScrollerBean.java 2010-02-09 16:52:15 UTC (rev 16436)
@@ -21,7 +21,7 @@
public List<SelectItem> getPagesToScroll() {
List<SelectItem> list = new ArrayList<SelectItem>();
- for (int i = 1; i <= size / getRows()+1; i++) {
+ for (int i = 1; i <= size / getRows(); i++) {
if (Math.abs(i - scrollerPage) < 5) {
SelectItem item = new SelectItem(i);
list.add(item);
14 years, 11 months
JBoss Rich Faces SVN: r16435 - in branches/community/3.3.X/samples/richfaces-demo/src/main: webapp/WEB-INF and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-02-09 11:50:25 -0500 (Tue, 09 Feb 2010)
New Revision: 16435
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
Log:
Fix RF-8351
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java 2010-02-09 16:30:18 UTC (rev 16434)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java 2010-02-09 16:50:25 UTC (rev 16435)
@@ -18,6 +18,8 @@
import javax.faces.event.ValueChangeEvent;
import javax.servlet.http.HttpServletRequest;
+import org.ajax4jsf.model.KeepAlive;
+@KeepAlive
public class ComponentNavigator {
private String lastCompId = null;
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-02-09 16:30:18 UTC (rev 16434)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-02-09 16:50:25 UTC (rev 16435)
@@ -194,7 +194,7 @@
<managed-bean>
<managed-bean-name>componentNavigator</managed-bean-name>
<managed-bean-class>org.richfaces.demo.common.ComponentNavigator</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
+ <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>report</managed-bean-name>
14 years, 11 months
JBoss Rich Faces SVN: r16434 - in branches/community/3.3.X/examples/photoalbum/source: ejb and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-02-09 11:30:18 -0500 (Tue, 09 Feb 2010)
New Revision: 16434
Added:
branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered/
branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered/components.properties
Removed:
branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered/components.properties
Modified:
branches/community/3.3.X/examples/photoalbum/source/ear/pom.xml
branches/community/3.3.X/examples/photoalbum/source/ejb/pom.xml
branches/community/3.3.X/examples/photoalbum/source/web/META-INF/MANIFEST.MF
branches/community/3.3.X/examples/photoalbum/source/web/pom.xml
Log:
Revert changes RF-8331
Modified: branches/community/3.3.X/examples/photoalbum/source/ear/pom.xml
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ear/pom.xml 2010-02-09 15:58:13 UTC (rev 16433)
+++ branches/community/3.3.X/examples/photoalbum/source/ear/pom.xml 2010-02-09 16:30:18 UTC (rev 16434)
@@ -30,12 +30,12 @@
<version>${project.version}</version>
<type>ejb</type>
</dependency>
- <dependency>
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
- </dependency>
- <dependency>
+ </dependency>
+ <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>${seamVersion}</version>
Modified: branches/community/3.3.X/examples/photoalbum/source/ejb/pom.xml
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ejb/pom.xml 2010-02-09 15:58:13 UTC (rev 16433)
+++ branches/community/3.3.X/examples/photoalbum/source/ejb/pom.xml 2010-02-09 16:30:18 UTC (rev 16434)
@@ -140,4 +140,4 @@
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
Copied: branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered (from rev 16308, branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered)
Deleted: branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered/components.properties
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered/components.properties 2010-01-15 16:36:26 UTC (rev 16308)
+++ branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered/components.properties 2010-02-09 16:30:18 UTC (rev 16434)
@@ -1,4 +0,0 @@
-#
-#Mon Sep 15 14:29:32 EEST 2008
-jndiPattern=photoalbum-ear-${project.version}/#{ejbName}/local
-embeddedEjb=false
Copied: branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered/components.properties (from rev 16308, branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered/components.properties)
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered/components.properties (rev 0)
+++ branches/community/3.3.X/examples/photoalbum/source/ejb/src/main/resources-filtered/components.properties 2010-02-09 16:30:18 UTC (rev 16434)
@@ -0,0 +1,4 @@
+#
+#Mon Sep 15 14:29:32 EEST 2008
+jndiPattern=photoalbum-ear-${project.version}/#{ejbName}/local
+embeddedEjb=false
Modified: branches/community/3.3.X/examples/photoalbum/source/web/META-INF/MANIFEST.MF
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/web/META-INF/MANIFEST.MF 2010-02-09 15:58:13 UTC (rev 16433)
+++ branches/community/3.3.X/examples/photoalbum/source/web/META-INF/MANIFEST.MF 2010-02-09 16:30:18 UTC (rev 16434)
@@ -1,7 +1,8 @@
Manifest-Version: 1.0
-Class-Path: commons-digester-1.8.1.jar jboss-seam-debug-2.1.1.GA.jar j
- boss-seam-jul-2.1.1.GA.jar jboss-seam-remoting-2.1.1.GA.jar jboss-sea
- m-ui-2.1.1.GA.jar jhighlight-1.0.jar jsf-facelets-1.1.15.B1.jar junit
- -3.8.jar metadata-extractor-2.4.0-beta1.jar richfaces-impl-3.3.2-SNAP
- SHOT.jar richfaces-ui-3.3.2-SNAPSHOT.jar
+Class-Path: commons-beanutils-1.8.0.jar commons-collections-3.2.jar co
+ mmons-digester-1.8.1.jar commons-logging-1.0.4.jar jboss-seam-debug-2
+ .1.1.GA.jar jboss-seam-jul-2.1.1.GA.jar jboss-seam-remoting-2.1.1.GA.
+ jar jboss-seam-ui-2.1.1.GA.jar jhighlight-1.0.jar jsf-facelets-1.1.15
+ .B1.jar junit-3.8.jar metadata-extractor-2.4.0-beta1.jar richfaces-im
+ pl-3.3.3-SNAPSHOT.jar richfaces-ui-3.3.3-SNAPSHOT.jar
Modified: branches/community/3.3.X/examples/photoalbum/source/web/pom.xml
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/web/pom.xml 2010-02-09 15:58:13 UTC (rev 16433)
+++ branches/community/3.3.X/examples/photoalbum/source/web/pom.xml 2010-02-09 16:30:18 UTC (rev 16434)
@@ -264,6 +264,7 @@
<goals>
<goal>export</goal>
</goals>
+
<configuration>
<connectionType>connection</connectionType>
<developerConnectionUrl>scm:svn:http://anonsvn.jboss.org/repos/richfaces/branches/examples-data/p...</developerConnectionUrl>
14 years, 11 months