JBoss Rich Faces SVN: r12293 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-01-15 11:35:41 -0500 (Thu, 15 Jan 2009)
New Revision: 12293
Modified:
trunk/docs/userguide/en/src/main/docbook/included/editor.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/editor.xml
trunk/docs/userguide/en/src/main/docbook/included/queue.xml
Log:
https://jira.jboss.org/jira/browse/RF-5704 - mistakes were corrected
Modified: trunk/docs/userguide/en/src/main/docbook/included/editor.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/editor.desc.xml 2009-01-15 16:34:46 UTC (rev 12292)
+++ trunk/docs/userguide/en/src/main/docbook/included/editor.desc.xml 2009-01-15 16:35:41 UTC (rev 12293)
@@ -32,10 +32,10 @@
<listitem><para>Seam text support</para></listitem>
<listitem><para>Manageable global configurations</para></listitem>
<listitem><para>Possibility to use custom plug-ins</para></listitem>
- <listitem><para>Support of all TinyMCE's parameters through <f:param></para></listitem>
+ <listitem><para>Support of all TinyMCE's parameters through <emphasis role="bold"><property><f:param></property></emphasis></para></listitem>
</itemizedlist>
</section>
</section>
-
\ No newline at end of file
+
Modified: trunk/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2009-01-15 16:34:46 UTC (rev 12292)
+++ trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2009-01-15 16:35:41 UTC (rev 12293)
@@ -75,9 +75,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
-<programlisting role="XML"><![CDATA[
- <rich:editor value="#{bean.editorValue}" />
-]]></programlisting>
+<programlisting role="XML"><![CDATA[<rich:editor value="#{bean.editorValue}" />]]></programlisting>
<para>
Implementation of <emphasis role="bold"><property><rich:editor></property></emphasis> provides three ways to define the properties of the component:
</para>
@@ -106,7 +104,7 @@
<para>
Another useful property that is implemented at attribute level is <emphasis><property>"viewMode"</property></emphasis>.
The attribute switches between "visual" and "source" modes, toggling between modes is performed setting the attribute to "visual" and "source" respectively.
- Implementation of <emphasis role="bold"><property><rich:editor></property></emphasis> also implies that you can change the modes dynamically setting the value of the <property>"viewMode"</property> attribute using EL-expression.
+ Implementation of <emphasis role="bold"><property><rich:editor></property></emphasis> also implies that you can change the modes dynamically setting the value of the <emphasis><property>"viewMode"</property></emphasis> attribute using EL-expression.
</para>
<para>
@@ -265,7 +263,7 @@
</listitem>
<listitem>
<para>
- Use the <property>"customPlugins"</property> attribute to specify the .properties file with a plugin name and a path to it.
+ Use the <emphasis><property>"customPlugins"</property></emphasis> attribute to specify the .properties file with a plugin name and a path to it.
</para>
<para>
If your .properties file is named "myPlugins", then your will have this code on the page.
@@ -306,7 +304,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:editor value="#{bean.editorValue}"onchange="myCustomOnChangeHandler()" ... />
+<rich:editor value="#{bean.editorValue}" onchange="myCustomOnChangeHandler()" />
...]]></programlisting>
</listitem>
<listitem>
@@ -321,7 +319,7 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}">
- <f:param name="onchange" value="myCustomOnChangeHandler">
+ <f:param name="onchange" value="myCustomOnChangeHandler" />
</rich:editor>
...]]></programlisting>
</listitem>
@@ -331,7 +329,7 @@
component has a build-in converter that renders HTML code generated by the editor
to Seam text (you can read more Seam text <ulink url="http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/text.html">here</ulink>.), it also interprets Seam text
passed to the <emphasis role="bold"> <property><rich:editor></property></emphasis> and renders it to HTML.
- The converter can be enable with the <emphasis><property>"seamTest"</property></emphasis> attribute.</para>
+ The converter can be enable with the <emphasis><property>"useSeamText"</property></emphasis> attribute.</para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
@@ -1330,4 +1328,4 @@
</emphasis> usage and sources for the given example. </para>
</section>
-</section>
\ No newline at end of file
+</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/queue.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/queue.xml 2009-01-15 16:34:46 UTC (rev 12292)
+++ trunk/docs/userguide/en/src/main/docbook/included/queue.xml 2009-01-15 16:35:41 UTC (rev 12293)
@@ -45,9 +45,10 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[<h:form>
- ...
- <a4j:queue/>
- ...
+ <a4j:queue />
+ <h:inputText value="#{bean.a}">
+ <a4j:support event="onkeyup" />
+ </h:inputText>
</h:form>
]]></programlisting>
</section>
@@ -101,18 +102,18 @@
</para>
<programlisting role="XML"><![CDATA[...
<h:form>
-<a4j:queue size="2" requestDelay="500" sizeExceededBehavior="dropNext" onsizeexceeded="alert('The size of the queue is exceeded')" />
-<h:inputText value="#{bean.a}" >
-<a4j:support event="onkeyup" />
-</h:inputText>
-<h:inputText value="#{bean.b}" >
-<a4j:support event="onblur" />
-<h:selectBooleanCheckbox value="#{bean.check}" id="checkboxID" >
-<a4j:support id="checkboxSupport" event="onchange" />
-</h:selectBooleanCheckbox>
+ <a4j:queue size="2" requestDelay="500" sizeExceededBehavior="dropNext" onsizeexceeded="alert('The size of the queue is exceeded')" />
+ <h:inputText value="#{bean.a}">
+ <a4j:support event="onkeyup" />
+ </h:inputText>
+ <h:inputText value="#{bean.b}">
+ <a4j:support event="onblur" />
+ </h:inputText>
+ <h:selectBooleanCheckbox value="#{bean.check}" id="checkboxID">
+ <a4j:support id="checkboxSupport" event="onchange" />
+ </h:selectBooleanCheckbox>
</h:form>
...]]></programlisting>
-
<para>
In this example if the queue has more than 2 requests waiting to be processed the next event will be dropped and a message (the <emphasis><property>"onsizeexceeded"</property></emphasis> attribute fires a JavaScript function ) saying that the queues is exceeded will be displayed.
</para>
@@ -127,34 +128,31 @@
</para>
<programlisting role="XML"><![CDATA[...
<h:form>
-<a4j:queue requestDelay="500" ignoreDupResponses="true" />
-<h:inputText value="#{bean.a}" >
-<a4j:support event="onkeyup" />
+ <a4j:queue requestDelay="500" ignoreDupResponses="true" />
+ <h:inputText value="#{bean.a}">
+ <a4j:support event="onkeyup" />
+ </h:inputText>
</h:form>
...]]></programlisting>
-
-
<para>In this example, the requests are glued together and only the last one is submitted.</para>
-
-
<para>Another key attribute that easies revers load is <emphasis><property
>"timeout"</property></emphasis>.
The attribute specifies the amount of time an item can be in the queue before the sent event is be aborted and dropped from the queue.
</para>
- <para>
- <emphasis role="bold"> Example: </emphasis>
- </para>
<para>If the request is sent and response is not returned within the
time frame defined in this attribute - the request is aborted, and the next one is sent.
</para>
-
+ <para>
+ <emphasis role="bold"> Example: </emphasis>
+ </para>
<programlisting role="XML"><![CDATA[...
<h:form>
-<a4j:queue timeout="1000" />
-<h:inputText value="#{bean.a}" >
-<a4j:support event="onkeyup" />
+ <a4j:queue timeout="1000" />
+ <h:inputText value="#{bean.a}" >
+ <a4j:support event="onkeyup" />
+ </h:inputText>
</h:form>
...]]></programlisting>
@@ -178,13 +176,13 @@
</para>
<programlisting role="XML"><![CDATA[...
<h:form >
-<a4j:queue oncomplete="alert(request.queue.getSize())" requestDelay="1000" />
-
-<h:inputText value="#{bean.a}" >
-<a4j:support event="onkeyup" />
-<h:selectBooleanCheckbox value="#{bean.check}" >
-<a4j:support event="onchange"/>
-</h:selectBooleanCheckbox>
+ <a4j:queue oncomplete="alert(request.queue.getSize())" requestDelay="1000" />
+ <h:inputText value="#{bean.a}">
+ <a4j:support event="onkeyup" />
+ </h:inputText>
+ <h:selectBooleanCheckbox value="#{bean.check}">
+ <a4j:support event="onchange"/>
+ </h:selectBooleanCheckbox>
</h:form>
...]]></programlisting>
@@ -210,7 +208,6 @@
<row>
<entry>Function</entry>
<entry>Description</entry>
-
</row>
</thead>
<tbody>
@@ -223,12 +220,7 @@
<row>
<entry>getMaximumSize()</entry>
<entry>Returns the maximum size to the queue, specified in the "size" attribute</entry>
-
</row>
-
-
-
-
</tbody>
</tgroup>
</table>
17 years, 3 months
JBoss Rich Faces SVN: r12292 - tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-01-15 11:34:46 -0500 (Thu, 15 Jan 2009)
New Revision: 12292
Modified:
tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/editor.desc.xml
tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/editor.xml
tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/queue.xml
Log:
https://jira.jboss.org/jira/browse/RF-5704 - mistakes were corrected
Modified: tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/editor.desc.xml
===================================================================
--- tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/editor.desc.xml 2009-01-15 16:34:01 UTC (rev 12291)
+++ tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/editor.desc.xml 2009-01-15 16:34:46 UTC (rev 12292)
@@ -32,7 +32,7 @@
<listitem><para>Seam text support</para></listitem>
<listitem><para>Manageable global configurations</para></listitem>
<listitem><para>Possibility to use custom plug-ins</para></listitem>
- <listitem><para>Support of all TinyMCE's parameters through <f:param></para></listitem>
+ <listitem><para>Support of all TinyMCE's parameters through <emphasis role="bold"><property><f:param></property></emphasis></para></listitem>
</itemizedlist>
Modified: tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/editor.xml 2009-01-15 16:34:01 UTC (rev 12291)
+++ tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/editor.xml 2009-01-15 16:34:46 UTC (rev 12292)
@@ -75,9 +75,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
-<programlisting role="XML"><![CDATA[
- <rich:editor value="#{bean.editorValue}" />
-]]></programlisting>
+<programlisting role="XML"><![CDATA[<rich:editor value="#{bean.editorValue}" />]]></programlisting>
<para>
Implementation of <emphasis role="bold"><property><rich:editor></property></emphasis> provides three ways to define the properties of the component:
</para>
@@ -106,7 +104,7 @@
<para>
Another useful property that is implemented at attribute level is <emphasis><property>"viewMode"</property></emphasis>.
The attribute switches between "visual" and "source" modes, toggling between modes is performed setting the attribute to "visual" and "source" respectively.
- Implementation of <emphasis role="bold"><property><rich:editor></property></emphasis> also implies that you can change the modes dynamically setting the value of the <property>"viewMode"</property> attribute using EL-expression.
+ Implementation of <emphasis role="bold"><property><rich:editor></property></emphasis> also implies that you can change the modes dynamically setting the value of the <emphasis><property>"viewMode"</property></emphasis> attribute using EL-expression.
</para>
<para>
@@ -265,7 +263,7 @@
</listitem>
<listitem>
<para>
- Use the <property>"customPlugins"</property> attribute to specify the .properties file with a plugin name and a path to it.
+ Use the <emphasis><property>"customPlugins"</property></emphasis> attribute to specify the .properties file with a plugin name and a path to it.
</para>
<para>
If your .properties file is named "myPlugins", then your will have this code on the page.
@@ -306,7 +304,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:editor value="#{bean.editorValue}"onchange="myCustomOnChangeHandler()" ... />
+<rich:editor value="#{bean.editorValue}" onchange="myCustomOnChangeHandler()" />
...]]></programlisting>
</listitem>
<listitem>
@@ -321,7 +319,7 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:editor value="#{bean.editorValue}">
- <f:param name="onchange" value="myCustomOnChangeHandler">
+ <f:param name="onchange" value="myCustomOnChangeHandler" />
</rich:editor>
...]]></programlisting>
</listitem>
@@ -331,7 +329,7 @@
component has a build-in converter that renders HTML code generated by the editor
to Seam text (you can read more Seam text <ulink url="http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/text.html">here</ulink>.), it also interprets Seam text
passed to the <emphasis role="bold"> <property><rich:editor></property></emphasis> and renders it to HTML.
- The converter can be enable with the <emphasis><property>"seamTest"</property></emphasis> attribute.</para>
+ The converter can be enable with the <emphasis><property>"useSeamText"</property></emphasis> attribute.</para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
Modified: tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/queue.xml
===================================================================
--- tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/queue.xml 2009-01-15 16:34:01 UTC (rev 12291)
+++ tags/3.3.0.GA/docs/userguide/en/src/main/docbook/included/queue.xml 2009-01-15 16:34:46 UTC (rev 12292)
@@ -45,9 +45,10 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[<h:form>
- ...
- <a4j:queue/>
- ...
+ <a4j:queue />
+ <h:inputText value="#{bean.a}">
+ <a4j:support event="onkeyup" />
+ </h:inputText>
</h:form>
]]></programlisting>
</section>
@@ -101,18 +102,18 @@
</para>
<programlisting role="XML"><![CDATA[...
<h:form>
-<a4j:queue size="2" requestDelay="500" sizeExceededBehavior="dropNext" onsizeexceeded="alert('The size of the queue is exceeded')" />
-<h:inputText value="#{bean.a}" >
-<a4j:support event="onkeyup" />
-</h:inputText>
-<h:inputText value="#{bean.b}" >
-<a4j:support event="onblur" />
-<h:selectBooleanCheckbox value="#{bean.check}" id="checkboxID" >
-<a4j:support id="checkboxSupport" event="onchange" />
-</h:selectBooleanCheckbox>
+ <a4j:queue size="2" requestDelay="500" sizeExceededBehavior="dropNext" onsizeexceeded="alert('The size of the queue is exceeded')" />
+ <h:inputText value="#{bean.a}">
+ <a4j:support event="onkeyup" />
+ </h:inputText>
+ <h:inputText value="#{bean.b}">
+ <a4j:support event="onblur" />
+ </h:inputText>
+ <h:selectBooleanCheckbox value="#{bean.check}" id="checkboxID">
+ <a4j:support id="checkboxSupport" event="onchange" />
+ </h:selectBooleanCheckbox>
</h:form>
...]]></programlisting>
-
<para>
In this example if the queue has more than 2 requests waiting to be processed the next event will be dropped and a message (the <emphasis><property>"onsizeexceeded"</property></emphasis> attribute fires a JavaScript function ) saying that the queues is exceeded will be displayed.
</para>
@@ -127,34 +128,31 @@
</para>
<programlisting role="XML"><![CDATA[...
<h:form>
-<a4j:queue requestDelay="500" ignoreDupResponses="true" />
-<h:inputText value="#{bean.a}" >
-<a4j:support event="onkeyup" />
+ <a4j:queue requestDelay="500" ignoreDupResponses="true" />
+ <h:inputText value="#{bean.a}">
+ <a4j:support event="onkeyup" />
+ </h:inputText>
</h:form>
...]]></programlisting>
-
-
<para>In this example, the requests are glued together and only the last one is submitted.</para>
-
-
<para>Another key attribute that easies revers load is <emphasis><property
>"timeout"</property></emphasis>.
The attribute specifies the amount of time an item can be in the queue before the sent event is be aborted and dropped from the queue.
</para>
- <para>
- <emphasis role="bold"> Example: </emphasis>
- </para>
<para>If the request is sent and response is not returned within the
time frame defined in this attribute - the request is aborted, and the next one is sent.
</para>
-
+ <para>
+ <emphasis role="bold"> Example: </emphasis>
+ </para>
<programlisting role="XML"><![CDATA[...
<h:form>
-<a4j:queue timeout="1000" />
-<h:inputText value="#{bean.a}" >
-<a4j:support event="onkeyup" />
+ <a4j:queue timeout="1000" />
+ <h:inputText value="#{bean.a}" >
+ <a4j:support event="onkeyup" />
+ </h:inputText>
</h:form>
...]]></programlisting>
@@ -178,13 +176,13 @@
</para>
<programlisting role="XML"><![CDATA[...
<h:form >
-<a4j:queue oncomplete="alert(request.queue.getSize())" requestDelay="1000" />
-
-<h:inputText value="#{bean.a}" >
-<a4j:support event="onkeyup" />
-<h:selectBooleanCheckbox value="#{bean.check}" >
-<a4j:support event="onchange"/>
-</h:selectBooleanCheckbox>
+ <a4j:queue oncomplete="alert(request.queue.getSize())" requestDelay="1000" />
+ <h:inputText value="#{bean.a}">
+ <a4j:support event="onkeyup" />
+ </h:inputText>
+ <h:selectBooleanCheckbox value="#{bean.check}">
+ <a4j:support event="onchange"/>
+ </h:selectBooleanCheckbox>
</h:form>
...]]></programlisting>
@@ -210,7 +208,6 @@
<row>
<entry>Function</entry>
<entry>Description</entry>
-
</row>
</thead>
<tbody>
@@ -223,12 +220,7 @@
<row>
<entry>getMaximumSize()</entry>
<entry>Returns the maximum size to the queue, specified in the "size" attribute</entry>
-
</row>
-
-
-
-
</tbody>
</tgroup>
</table>
17 years, 3 months
JBoss Rich Faces SVN: r12291 - in trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd: mojo and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-01-15 11:34:01 -0500 (Thu, 15 Jan 2009)
New Revision: 12291
Added:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/DefaultRichHandler.java
Removed:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/AbstractRichHandler.java
Modified:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/RichComponentsHandler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ScriptsHandler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/RichResourceSelector.java
Log:
Deleted: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/AbstractRichHandler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/AbstractRichHandler.java 2009-01-15 16:24:34 UTC (rev 12290)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/AbstractRichHandler.java 2009-01-15 16:34:01 UTC (rev 12291)
@@ -1,27 +0,0 @@
-package org.richfaces.cdk.rd.handler;
-
-import java.util.Set;
-
-import org.apache.maven.plugin.logging.Log;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public abstract class AbstractRichHandler extends DefaultHandler {
-
- private Log log;
-
- @Override
- public void fatalError(SAXParseException e) throws SAXException {
- }
-
- public abstract Set getResults();
-
- public Log getLog() {
- return log;
- }
-
- public void setLog(Log log) {
- this.log = log;
- }
-}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/DefaultRichHandler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/DefaultRichHandler.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/DefaultRichHandler.java 2009-01-15 16:34:01 UTC (rev 12291)
@@ -0,0 +1,39 @@
+package org.richfaces.cdk.rd.handler;
+
+import java.util.Set;
+
+import org.apache.maven.plugin.logging.Log;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public abstract class DefaultRichHandler extends DefaultHandler {
+
+ private Log log;
+
+ private Set result;
+
+ public Set getResult() {
+ return result;
+ }
+
+ public void setResult(Set result) {
+ this.result = result;
+ }
+
+ @Override
+ public void fatalError(SAXParseException e) throws SAXException {
+ }
+
+ public Log getLog() {
+ return log;
+ }
+
+ public void setLog(Log log) {
+ this.log = log;
+ }
+}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/RichComponentsHandler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/RichComponentsHandler.java 2009-01-15 16:24:34 UTC (rev 12290)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/RichComponentsHandler.java 2009-01-15 16:34:01 UTC (rev 12291)
@@ -12,10 +12,9 @@
* @author Anton Belevich
*
*/
-public class RichComponentsHandler extends AbstractRichHandler {
+public class RichComponentsHandler extends DefaultRichHandler {
- private Set components = new HashSet();
-
+
private Set <PrefixMapping> prefixList = new HashSet<PrefixMapping>();
private Set <String> userNamespaces = new HashSet<String>();
@@ -34,7 +33,7 @@
String qname = prefix.getPrefix();
if(uri.equals(prefixUri) && name.startsWith(qname)) {
- components.add(localName);
+ getResult().add(localName);
}
}
}
@@ -49,11 +48,7 @@
}
}
-
- public Set getResults() {
- return components;
- }
-
+
public void addNamespaces(Collection <String>namespaces) {
this.userNamespaces.addAll(namespaces);
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ScriptsHandler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ScriptsHandler.java 2009-01-15 16:24:34 UTC (rev 12290)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ScriptsHandler.java 2009-01-15 16:34:01 UTC (rev 12291)
@@ -6,7 +6,7 @@
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
-public class ScriptsHandler extends AbstractRichHandler {
+public class ScriptsHandler extends DefaultRichHandler {
private Set result = new HashSet();
@@ -18,7 +18,7 @@
@Override
- public Set getResults() {
+ public Set getResult() {
return result;
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java 2009-01-15 16:24:34 UTC (rev 12290)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java 2009-01-15 16:34:01 UTC (rev 12291)
@@ -47,7 +47,7 @@
import org.apache.maven.project.MavenProjectBuilder;
import org.codehaus.plexus.util.DirectoryScanner;
import org.richfaces.cdk.rd.JarResourceScanner;
-import org.richfaces.cdk.rd.handler.AbstractRichHandler;
+import org.richfaces.cdk.rd.handler.DefaultRichHandler;
import org.richfaces.cdk.rd.handler.RichComponentsHandler;
import org.richfaces.cdk.rd.handler.ScriptsHandler;
import org.richfaces.cdk.rd.selector.ResourceSelector;
@@ -204,7 +204,7 @@
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
try {
SAXParser saxParser = saxParserFactory.newSAXParser();
- AbstractRichHandler handler = new ScriptsHandler(components);
+ DefaultRichHandler handler = new ScriptsHandler(components);
handler.setLog(getLog());
RichResourceSelector selector = new RichResourceSelector(saxParser,handler);
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/RichResourceSelector.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/RichResourceSelector.java 2009-01-15 16:24:34 UTC (rev 12290)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/RichResourceSelector.java 2009-01-15 16:34:01 UTC (rev 12291)
@@ -7,7 +7,7 @@
import javax.xml.parsers.SAXParser;
-import org.richfaces.cdk.rd.handler.AbstractRichHandler;
+import org.richfaces.cdk.rd.handler.DefaultRichHandler;
import org.xml.sax.SAXException;
/**
@@ -18,9 +18,9 @@
private SAXParser parser;
- private AbstractRichHandler handler;
+ private DefaultRichHandler handler;
- public RichResourceSelector(SAXParser parser, AbstractRichHandler handler) {
+ public RichResourceSelector(SAXParser parser, DefaultRichHandler handler) {
this.parser = parser;
this.handler = handler;
}
@@ -44,7 +44,7 @@
public Set getResult() {
- return handler.getResults();
+ return handler.getResult();
}
}
17 years, 3 months
JBoss Rich Faces SVN: r12290 - trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-01-15 11:24:34 -0500 (Thu, 15 Jan 2009)
New Revision: 12290
Modified:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java
Log:
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java 2009-01-15 16:18:08 UTC (rev 12289)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java 2009-01-15 16:24:34 UTC (rev 12290)
@@ -24,7 +24,6 @@
import java.io.File;
import java.io.IOException;
import java.util.Collections;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
17 years, 3 months
JBoss Rich Faces SVN: r12289 - trunk/sandbox/cdk/maven-resource-dependency-plugin.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-01-15 11:18:08 -0500 (Thu, 15 Jan 2009)
New Revision: 12289
Modified:
trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml
Log:
add commons-vfs
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml 2009-01-15 16:17:15 UTC (rev 12288)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml 2009-01-15 16:18:08 UTC (rev 12289)
@@ -14,7 +14,8 @@
<packaging>maven-plugin</packaging>
<version>3.3.1-SNAPSHOT</version>
<name>maven-resource-dependency-plugin</name>
-
+
+
<dependencies>
<dependency>
@@ -33,13 +34,64 @@
<version>1.0-beta-1</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
- </dependency>
-
+ </dependency>
+ <dependency>
+ <groupId>commons-vfs</groupId>
+ <artifactId>commons-vfs</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-net</groupId>
+ <artifactId>commons-net</artifactId>
+ <version>1.4.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.1</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>2.0.2</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jsch</artifactId>
+ <version>0.1.23</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.0.b2</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>oro</groupId>
+ <artifactId>oro</artifactId>
+ <version>2.0.8</version>
+ <optional>true</optional>
+ </dependency>
+
</dependencies>
</project>
17 years, 3 months
JBoss Rich Faces SVN: r12288 - trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-01-15 11:17:15 -0500 (Thu, 15 Jan 2009)
New Revision: 12288
Added:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java
Log:
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/JarResourceScanner.java 2009-01-15 16:17:15 UTC (rev 12288)
@@ -0,0 +1,82 @@
+package org.richfaces.cdk.rd;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileType;
+import org.codehaus.plexus.util.SelectorUtils;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class JarResourceScanner {
+
+ private FileObject baseFile;
+
+ private Set result = new HashSet();
+
+ private String [] patterns;
+
+ public String[] getPatterns() {
+ return patterns;
+ }
+
+ public void setPatterns(String[] patterns) {
+ if(patterns == null) {
+ patterns = new String[] {"**"};
+ }
+
+ if(patterns.length < 1) {
+ patterns = new String[] {"**"};
+ }
+
+ this.patterns = patterns;
+ }
+
+ public FileObject getBaseFile() {
+ return baseFile;
+ }
+
+ public void setBaseFile(FileObject baseFile) {
+ this.baseFile = baseFile;
+ }
+
+ protected boolean isAcceptable(FileObject fileObject) {
+ for (int i = 0; i < patterns.length; i++) {
+ if(SelectorUtils.matchPath(patterns[i], fileObject.getName().getPath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected void walk(FileObject file) throws IOException{
+ FileObject [] children = file.getChildren();
+ for(FileObject child : children) {
+ if(child.getType() != FileType.FILE) {
+ walk(child);
+ } else {
+ if(isAcceptable(child)) {
+ result.add(child);
+ }
+ }
+ }
+ }
+
+ public void doScan() throws IOException{
+ if(baseFile != null && baseFile.exists()) {
+ walk(baseFile);
+ }
+ }
+
+ public Set getResult() {
+ return result;
+ }
+
+ public void setResult(Set result) {
+ this.result = result;
+ }
+}
17 years, 3 months
JBoss Rich Faces SVN: r12287 - in trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd: elements and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-01-15 11:15:42 -0500 (Thu, 15 Jan 2009)
New Revision: 12287
Added:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/AbstractRichHandler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/RichComponentsHandler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ScriptsHandler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/ResourceSelector.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/RichResourceSelector.java
Removed:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentsScanner.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsHandler.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsScanner.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/Element.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/RichElement.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/filter/
Modified:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/PrefixMapping.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java
Log:
Deleted: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentsScanner.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentsScanner.java 2009-01-15 14:52:02 UTC (rev 12286)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentsScanner.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -1,16 +0,0 @@
-package org.richfaces.cdk.rd;
-
-import java.io.File;
-import java.util.Set;
-
-/**
- * @author Anton Belevich
- *
- */
-public interface ComponentsScanner {
-
- public void doScan(File file) throws Exception;
-
- public Set <String> getResult();
-
-}
Deleted: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsHandler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsHandler.java 2009-01-15 14:52:02 UTC (rev 12286)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsHandler.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -1,63 +0,0 @@
-package org.richfaces.cdk.rd;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.richfaces.cdk.rd.elements.Element;
-import org.richfaces.cdk.rd.elements.PrefixMapping;
-import org.richfaces.cdk.rd.elements.RichElement;
-import org.richfaces.cdk.rd.filter.ComponentFilter;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * @author Anton Belevich
- *
- */
-public class RichComponentsHandler extends DefaultHandler {
-
- private ComponentFilter filter;
-
- private Set <String> components = new HashSet<String>();
-
-
- public RichComponentsHandler() {
- }
-
-
- public ComponentFilter getFilter() {
- return filter;
- }
-
- public void setFilter(ComponentFilter filter) {
- this.filter = filter;
- }
-
- @Override
- public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException {
- Element element = new RichElement(uri, localName, name, attributes);
- if(filter.accept(element)) {
- components.add(localName);
- }
- }
-
- @Override
- public void startPrefixMapping(String prefix, String uri) throws SAXException {
- System.out.println("Process mapping: prefix: " + prefix + " uri: " + uri );
- if (filter != null && filter.getNamespaces().contains(uri)) {
- PrefixMapping prefixMapping = new PrefixMapping(prefix, uri);
- filter.addPrefixMapping(prefixMapping);
- }
-
- }
-
- public Set <String> getComponents() {
- return components;
- }
-
- public void setComponents(Set<String> components) {
- this.components = components;
- }
-
-}
Deleted: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsScanner.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsScanner.java 2009-01-15 14:52:02 UTC (rev 12286)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsScanner.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -1,41 +0,0 @@
-package org.richfaces.cdk.rd;
-
-import java.io.File;
-import java.util.Set;
-
-import javax.xml.parsers.SAXParser;
-
-/**
- * @author Anton Belevich
- *
- */
-public class RichComponentsScanner implements ComponentsScanner {
-
- private SAXParser parser;
-
- private RichComponentsHandler handler;
-
- public RichComponentsScanner(SAXParser parser, RichComponentsHandler handler) {
- this.parser = parser;
- this.handler = handler;
- }
-
-
- public SAXParser getParser() {
- return parser;
- }
-
- public void setParser(SAXParser parser) {
- this.parser = parser;
- }
-
- public void doScan(File file) throws Exception {
-// TODO: check file, handler
- parser.parse(file, handler);
- }
-
- public Set <String> getResult() {
- return handler.getComponents();
- }
-
-}
Deleted: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/Element.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/Element.java 2009-01-15 14:52:02 UTC (rev 12286)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/Element.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -1,27 +0,0 @@
-package org.richfaces.cdk.rd.elements;
-
-import org.xml.sax.Attributes;
-
-/**
- * @author Anton Belevich
- *
- */
-public interface Element {
-
- public String getUri();
-
- public void setUri(String uri);
-
- public String getLocalName();
-
- public void setLocalName(String localName);
-
- public String getName();
-
- public void setName(String name);
-
- public Attributes getAttributes();
-
- public void setAttributes(Attributes attributes);
-
-}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/PrefixMapping.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/PrefixMapping.java 2009-01-15 14:52:02 UTC (rev 12286)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/PrefixMapping.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -9,15 +9,18 @@
private String prefix;
private String uri;
+
public PrefixMapping() {
}
+
public PrefixMapping(String prefix , String uri) {
this.prefix = prefix;
this.uri = uri;
}
+
public String getPrefix() {
return prefix;
}
@@ -33,5 +36,4 @@
public void setUri(String uri) {
this.uri = uri;
}
-
}
Deleted: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/RichElement.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/RichElement.java 2009-01-15 14:52:02 UTC (rev 12286)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/elements/RichElement.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -1,62 +0,0 @@
-package org.richfaces.cdk.rd.elements;
-
-import org.xml.sax.Attributes;
-
-/**
- * @author Anton Belevich
- *
- */
-public class RichElement implements Element {
-
- private String uri;
-
- private String localName;
-
- private String name;
-
- private Attributes attributes;
-
-
- public RichElement(String uri, String localName, String name, Attributes attributes) {
-
- this.uri = uri;
-
- this.localName = localName;
-
- this.name = name;
-
- this.attributes = attributes;
- }
-
- public String getUri() {
- return uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
- public String getLocalName() {
- return localName;
- }
-
- public void setLocalName(String localName) {
- this.localName = localName;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/AbstractRichHandler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/AbstractRichHandler.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/AbstractRichHandler.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -0,0 +1,27 @@
+package org.richfaces.cdk.rd.handler;
+
+import java.util.Set;
+
+import org.apache.maven.plugin.logging.Log;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public abstract class AbstractRichHandler extends DefaultHandler {
+
+ private Log log;
+
+ @Override
+ public void fatalError(SAXParseException e) throws SAXException {
+ }
+
+ public abstract Set getResults();
+
+ public Log getLog() {
+ return log;
+ }
+
+ public void setLog(Log log) {
+ this.log = log;
+ }
+}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/RichComponentsHandler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/RichComponentsHandler.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/RichComponentsHandler.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -0,0 +1,73 @@
+package org.richfaces.cdk.rd.handler;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.richfaces.cdk.rd.elements.PrefixMapping;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class RichComponentsHandler extends AbstractRichHandler {
+
+ private Set components = new HashSet();
+
+ private Set <PrefixMapping> prefixList = new HashSet<PrefixMapping>();
+
+ private Set <String> userNamespaces = new HashSet<String>();
+
+ public static String RICH_DEFAULT = "http://richfaces.org/rich";
+
+ public static String A4J_DEFAULT = "http://richfaces.org/a4j";
+
+
+
+ @Override
+ public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException {
+ for (PrefixMapping prefix: prefixList) {
+
+ String prefixUri = prefix.getUri();
+ String qname = prefix.getPrefix();
+
+ if(uri.equals(prefixUri) && name.startsWith(qname)) {
+ components.add(localName);
+ }
+ }
+ }
+
+ @Override
+ public void startPrefixMapping(String prefix, String uri) throws SAXException {
+ getLog().info("Process mapping: prefix: " + prefix + " uri: " + uri );
+
+ if (userNamespaces != null && userNamespaces.contains(uri)) {
+ PrefixMapping prefixMapping = new PrefixMapping(prefix, uri);
+ addPrefixMapping(prefixMapping);
+ }
+
+ }
+
+ public Set getResults() {
+ return components;
+ }
+
+ public void addNamespaces(Collection <String>namespaces) {
+ this.userNamespaces.addAll(namespaces);
+ }
+
+ public Collection <String> getNamespaces() {
+ if(userNamespaces.isEmpty() || !(userNamespaces.contains(RICH_DEFAULT) && userNamespaces.contains(A4J_DEFAULT))) {
+ userNamespaces.add(RICH_DEFAULT);
+ userNamespaces.add(A4J_DEFAULT);
+ }
+ return this.userNamespaces;
+ }
+
+ public void addPrefixMapping(PrefixMapping prefixMapping) {
+ prefixList.add(prefixMapping);
+ }
+
+}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ScriptsHandler.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ScriptsHandler.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/handler/ScriptsHandler.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -0,0 +1,54 @@
+package org.richfaces.cdk.rd.handler;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class ScriptsHandler extends AbstractRichHandler {
+
+ private Set result = new HashSet();
+
+ private Set lookUpResources;
+
+ private boolean collect = false;
+
+ private String temp;
+
+
+ @Override
+ public Set getResults() {
+ return result;
+ }
+
+ public ScriptsHandler(Set lookUpResources) {
+ this.lookUpResources = lookUpResources;
+ }
+
+ @Override
+ public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException {
+ }
+
+ @Override
+ public void characters(char[] ch, int start, int length) throws SAXException {
+ temp = new String(ch,start,length);
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String name) throws SAXException {
+
+ if(name.equalsIgnoreCase("name")) {
+ if(lookUpResources.contains(temp)) {
+ collect = true;
+ } else {
+ collect = false;
+ }
+ }
+
+ if(name.equalsIgnoreCase("script") && collect) {
+ result.add(temp);
+ }
+ }
+
+}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java 2009-01-15 14:52:02 UTC (rev 12286)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -22,21 +22,39 @@
package org.richfaces.cdk.rd.mojo;
import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystemManager;
+import org.apache.commons.vfs.VFS;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
import org.codehaus.plexus.util.DirectoryScanner;
-import org.richfaces.cdk.rd.ComponentsScanner;
-import org.richfaces.cdk.rd.RichComponentsHandler;
-import org.richfaces.cdk.rd.RichComponentsScanner;
-import org.richfaces.cdk.rd.filter.ComponentFilter;
-import org.richfaces.cdk.rd.filter.RichComponentFilter;
+import org.richfaces.cdk.rd.JarResourceScanner;
+import org.richfaces.cdk.rd.handler.AbstractRichHandler;
+import org.richfaces.cdk.rd.handler.RichComponentsHandler;
+import org.richfaces.cdk.rd.handler.ScriptsHandler;
+import org.richfaces.cdk.rd.selector.ResourceSelector;
+import org.richfaces.cdk.rd.selector.RichResourceSelector;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotSupportedException;
/**
* @author Anton Belevich
@@ -54,7 +72,35 @@
*/
protected MavenProject project;
+ /**
+ *
+ * @component
+ */
+ protected MavenProjectBuilder builder;
+
+
+ /**
+ * Used to look up Artifacts in the remote repository.
+ *
+ * @component
+ */
+ private org.apache.maven.artifact.factory.ArtifactFactory factory;
+
/**
+ * Used to look up Artifacts in the remote repository.
+ *
+ * @component
+ */
+ private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
+
+ /**
+ * The local repository.
+ *
+ * @parameter expression="${localRepository}"
+ */
+ private ArtifactRepository localRepository;
+
+ /**
* outputScriptDirectory
* @parameter
*/
@@ -87,54 +133,162 @@
public void execute() throws MojoExecutionException {
try {
- Set <String> result = findComponents(webSourceDirectory);
- for (String component: result) {
- System.out.println("find: " + component);
+
+ Set <String> components = findComponents(webSourceDirectory);
+ Artifact richfaces = getUIArifact(project);
+ FileObject jarRichfaces = resolveArtifact(richfaces);
+ FileObject [] richConfigs = resolveConfigsFromJar(jarRichfaces);
+ Set result = selectScriptResources(richConfigs,components);
+
+ for (Iterator iterator = result.iterator(); iterator.hasNext();) {
+ getLog().info("collect: " + iterator.next());
}
- mergeScripts(result);
-
} catch (Exception e) {
throw new MojoExecutionException(e.getMessage(),e);
}
}
- public Set <String> findComponents (File webSourceDir) throws Exception{
+ public Set findComponents (File webSourceDir) {
+ ResourceSelector richSelector = null;
+
DirectoryScanner scanner = new DirectoryScanner();
scanner.setBasedir(webSourceDir);
scanner.setIncludes(new String []{"**/*.xhtml"});
scanner.addDefaultExcludes();
scanner.scan();
-
String [] collectedFiles = scanner.getIncludedFiles();
+
+ try {
+ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+ saxParserFactory.setNamespaceAware(true);
+ SAXParser saxParser = saxParserFactory.newSAXParser();
+ saxParser.setProperty("http://apache.org/xml/features/continue-after-fatal-error", true);
+
+ RichComponentsHandler handler = new RichComponentsHandler();
+ handler.setLog(getLog());
+ handler.addNamespaces(namespaces);
+
+ richSelector = new RichResourceSelector(saxParser,handler);
+ for(String processFile : collectedFiles) {
+ File file = new File(webSourceDir,processFile);
+ if(file.exists()) {
+ getLog().info("process file: " + file.getName());
+ richSelector.select(file);
+ }
+ }
+
+ } catch (SAXNotSupportedException e) {
+ getLog().error(e);
+ } catch (SAXException e) {
+ getLog().error(e);
+ } catch (ParserConfigurationException e) {
+ getLog().error(e);
+ } catch (IOException e) {
+ getLog().error(e);
+ }
+
+ Set result = null;
+ if (richSelector != null) {
+ result = richSelector.getResult();
+ }
+
+ return result;
+ }
+
+
+ public Set selectScriptResources (FileObject[] richConfigs, Set components) {
+ Set result = null;
+
SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
- saxParserFactory.setNamespaceAware(true);
- SAXParser saxParser = saxParserFactory.newSAXParser();
-
- ComponentFilter filter = new RichComponentFilter();
- filter.addNamespaces(namespaces);
-
- RichComponentsHandler handler = new RichComponentsHandler();
- handler.setFilter(filter);
-
- ComponentsScanner richScanner = new RichComponentsScanner(saxParser,handler);
+ try {
+ SAXParser saxParser = saxParserFactory.newSAXParser();
+ AbstractRichHandler handler = new ScriptsHandler(components);
+ handler.setLog(getLog());
+ RichResourceSelector selector = new RichResourceSelector(saxParser,handler);
+
+ for (FileObject dependency: richConfigs) {
+ selector.select(dependency.getContent().getInputStream());
+ }
+
+ result = selector.getResult();
- for(String processFile : collectedFiles) {
- File file = new File(webSourceDir,processFile);
- if(file.exists()) {
- getLog().info("process file: " + file.getName());
- richScanner.doScan(file);
- }
+ }catch(SAXException e) {
+ getLog().error(e);
+ }catch(ParserConfigurationException e) {
+ getLog().error(e);
+ }catch (IOException e) {
+ getLog().error(e);
}
-
- return richScanner.getResult();
+
+ return result;
+ }
+
+ protected Artifact getUIArifact (MavenProject project) {
+ Model model = project.getModel();
+ List <Dependency> dependencyList = model.getDependencies();
+
+ Artifact artifact = null;
+
+ for(Dependency dependency : dependencyList) {
+ if(dependency.getArtifactId().equals("richfaces-ui") && dependency.getVersion().equals(model.getVersion()) && dependency.getType().equals("jar")) {
+ String groupId = dependency.getGroupId();
+ String artifactId = dependency.getArtifactId();
+ String version = dependency.getVersion();
+ String scope = dependency.getScope();
+ String type = dependency.getType();
+ artifact = factory.createArtifact(groupId, artifactId, version, scope, type);
+ break;
+ }
+ }
+
+ return artifact;
}
+
+ protected FileObject resolveArtifact(Artifact artifact) {
+ FileObject jarFileObject = null;
- public void mergeScripts(Set <String> components) throws Exception{
+ if(artifact != null) {
+ try {
+ resolver.resolve(artifact, Collections.EMPTY_LIST, localRepository);
+ getLog().info("artifact " + artifact.getFile().getAbsolutePath() + " is resolved");
+ } catch (ArtifactResolutionException e) {
+ getLog().error("Error with resolve artifact " + artifact, e);
+ } catch (ArtifactNotFoundException e) {
+ getLog().error("Not found artifact " + artifact, e);
+ }
+
+ File file = artifact.getFile();
+ try {
+ FileSystemManager manager = VFS.getManager();
+ jarFileObject = manager.resolveFile("jar://" + file.getAbsolutePath());
+ } catch (IOException e) {
+ getLog().error(e);
+ }
+ }
+ return jarFileObject;
+ }
+
+ public FileObject [] resolveConfigsFromJar(FileObject jarFileObject) throws MojoExecutionException{
+ FileObject [] result = new FileObject[0];
+ try {
+ JarResourceScanner jarScanner = new JarResourceScanner();
+ jarScanner.setBaseFile(jarFileObject);
+ jarScanner.setPatterns(new String[]{ "**/*.component-dependencies.xml"});
+ jarScanner.doScan();
+ result = (FileObject [])jarScanner.getResult().toArray(new FileObject[jarScanner.getResult().size()]);
+
+ } catch (IOException e) {
+ getLog().error(e);
+ }
+ return result;
}
+
+ public void mergeScripts(Set <String> components) throws Exception{
+ }
}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/ResourceSelector.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/ResourceSelector.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/ResourceSelector.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -0,0 +1,25 @@
+package org.richfaces.cdk.rd.selector;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Set;
+
+import javax.xml.parsers.SAXParser;
+
+import org.xml.sax.SAXException;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public interface ResourceSelector {
+
+ public void select(File file) throws IOException, SAXException;
+
+ public void select(InputStream fileInputStream) throws IOException, SAXException;
+
+ public Set getResult();
+
+ public void setParser(SAXParser parser);
+}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/RichResourceSelector.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/RichResourceSelector.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/selector/RichResourceSelector.java 2009-01-15 16:15:42 UTC (rev 12287)
@@ -0,0 +1,50 @@
+package org.richfaces.cdk.rd.selector;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Set;
+
+import javax.xml.parsers.SAXParser;
+
+import org.richfaces.cdk.rd.handler.AbstractRichHandler;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class RichResourceSelector implements ResourceSelector {
+
+ private SAXParser parser;
+
+ private AbstractRichHandler handler;
+
+ public RichResourceSelector(SAXParser parser, AbstractRichHandler handler) {
+ this.parser = parser;
+ this.handler = handler;
+ }
+
+
+ public SAXParser getParser() {
+ return parser;
+ }
+
+ public void setParser(SAXParser parser) {
+ this.parser = parser;
+ }
+
+ public void select(File file) throws IOException, SAXException {
+ parser.parse(file, handler);
+ }
+
+ public void select(InputStream fileInputStream) throws IOException, SAXException {
+ parser.parse(fileInputStream, handler);
+ }
+
+
+ public Set getResult() {
+ return handler.getResults();
+ }
+
+}
17 years, 3 months
JBoss Rich Faces SVN: r12286 - trunk/ui/inplaceSelect/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2009-01-15 09:52:02 -0500 (Thu, 15 Jan 2009)
New Revision: 12286
Modified:
trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
Log:
https://jira.jboss.org/jira/browse/RF-4302
ShowValueInView - description is corrected
Modified: trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
===================================================================
--- trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2009-01-15 14:38:41 UTC (rev 12285)
+++ trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2009-01-15 14:52:02 UTC (rev 12286)
@@ -86,7 +86,7 @@
<name>showValueInView</name>
<classname>boolean</classname>
<description>
- If true show the SelectItem labels in the InplaceSelect's pull-down list but display the value in the field in view mode once an item is selected.
+ If "true", shows the SelectItem labels in the InplaceSelect&s pull-down list, but displays the value in the field in view mode once an item is selected.
Default value is "false"
</description>
<defaultvalue>false</defaultvalue>
17 years, 3 months
JBoss Rich Faces SVN: r12285 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/tabPanel and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-01-15 09:38:41 -0500 (Thu, 15 Jan 2009)
New Revision: 12285
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/testDisabledTab.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java
Log:
RF-5548
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java 2009-01-15 14:34:23 UTC (rev 12284)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java 2009-01-15 14:38:41 UTC (rev 12285)
@@ -51,6 +51,8 @@
private String switchType = "server";
private String selectedTab = "tab1";
+
+ private boolean disabled;
private Map<String, String> inputs = new HashMap<String, String>();
@@ -69,6 +71,8 @@
content = "content";
selectedTab = "tab1";
immediate = false;
+ disabled = false;
+ inputs.clear();
}
public void initAjaxCoreTest() {
@@ -293,6 +297,20 @@
public void setImmediate(boolean immediate) {
this.immediate = immediate;
}
+
+ /**
+ * @return the disabled
+ */
+ public boolean isDisabled() {
+ return disabled;
+ }
+
+ /**
+ * @param disabled the disabled to set
+ */
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/testDisabledTab.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/testDisabledTab.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/testDisabledTab.xhtml 2009-01-15 14:38:41 UTC (rev 12285)
@@ -0,0 +1,46 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="style">
+ .link {margin: 0px 5px}
+ </ui:define>
+ <ui:define name="component">
+ <h:form id="control">
+ <h:inputText id="selected" value="#{panelBean.selectedTab}"></h:inputText>
+ <h:commandButton id="apply" value="Apply"></h:commandButton>
+ </h:form>
+<h:form id="_form">
+ <rich:tabPanel id="panel1" switchType="ajax" selectedTab="#{panelBean.selectedTab}">
+ <rich:tab label="tab1"
+ id="tab1"
+ actionListener="#{panelBean.actionListener}"
+ switchType="server"
+ disabled="true"
+ >
+ <h:outputText value="Tab one" /><br/>
+ <h:inputText id="tab1_input" value="#{panelBean.inputs['tab1']}"></h:inputText>
+ </rich:tab>
+ <rich:tab label="tab2"
+ id="tab2"
+ actionListener="#{panelBean.actionListener}"
+ reRender="_value, _inputs"
+ disabled="true"
+ >
+ <h:outputText value="Tab two" />
+ <h:inputText id="tab2_input" value="#{panelBean.inputs['tab2']}"></h:inputText>
+ </rich:tab>
+ </rich:tabPanel><br/>
+
+ <h:outputText value="#{panelBean.value}" id="_value"></h:outputText><br/>
+ <h:outputText value="#{panelBean.inputs}" id="_inputs"></h:outputText><br/>
+ <h:commandLink id="submit" value="Submit"></h:commandLink><br/>
+
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-15 14:34:23 UTC (rev 12284)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-01-15 14:38:41 UTC (rev 12285)
@@ -1380,7 +1380,11 @@
StringBuffer b = new StringBuffer("document.getElementById('");
b.append(id);
b.append("').onclick");
- return runScript(b.toString());
+ String onclick = runScript(b.toString());
+ if (onclick != null && ("null".equals(onclick) || "undefined".equals(onclick))) {
+ onclick = null;
+ }
+ return onclick;
}
public String getHTMLById(String id) {
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java 2009-01-15 14:34:23 UTC (rev 12284)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java 2009-01-15 14:38:41 UTC (rev 12285)
@@ -29,9 +29,13 @@
import org.testng.Assert;
import org.testng.annotations.Test;
+import com.thoughtworks.selenium.SeleniumException;
+
public class TabPanelTest extends SeleniumTestBase {
private static final String FORM_ID = "_form:";
+
+ private static final String CONTROLS_FORM_ID = "control:";
private static final String RESET_METHOD = "#{panelBean.reset}";
@@ -42,8 +46,12 @@
private final static String INIT_IMMEDIATE_TEST_URL = "pages/tabPanel/immediateTabPanelTest.xhtml";
private final static String TAB_FACET_TEST_URL = "pages/tabPanel/tabFacetTest.xhtml";
+
+ private final static String DISABLED_TAB_URL = "pages/tabPanel/testDisabledTab.xhtml";
private static Map<String, String> params = new HashMap<String, String>();
+
+ private static final String [] DISABLED_TAB_CLASSES = new String [] { "dr-tbpnl-tb", "rich-tab-header", "dr-tbpnl-tb-dsbl", "rich-tab-disabled"};
static {
params.put("parameter1", "value1");
@@ -170,6 +178,68 @@
AssertNotPresent(tabId2);
AssertNotPresent(tabId4);
}
+
+ @Test
+ public void testDisabledTabs(Template template) {
+ renderPage(DISABLED_TAB_URL, template, RESET_METHOD);
+
+
+ String parentId = getParentId();
+ String selectedTabInputId = parentId + CONTROLS_FORM_ID + "selected";
+ String applyButtonId = parentId + CONTROLS_FORM_ID + "apply";
+ String submitButtonId = parentId + FORM_ID + "submit";
+ String tabId1 = parentId + FORM_ID + "tab1_lbl";
+ String tabId2 = parentId + FORM_ID + "tab2_lbl";
+ String tab1_shifted = parentId + FORM_ID + "tab1_shifted";
+ String tab2_shifted = parentId + FORM_ID + "tab2_shifted";
+ String _inputsId = parentId + FORM_ID + "_inputs";
+ String tabInputId = parentId + FORM_ID + "tab2_input";
+
+
+ // Check css classes for disabled tabs
+ assertClassNames(tabId1, DISABLED_TAB_CLASSES, "Tab1 has not been disabled", true);
+ String onclick = getElementOnclickAttr(tab1_shifted);
+ if (onclick != null) {
+ Assert.fail("Onclick should not be rendered for disabled tab. But was: " + onclick);
+ }
+
+ assertClassNames(tabId2, DISABLED_TAB_CLASSES, "Tab2 has not been disabled", true);
+ onclick = getElementOnclickAttr(tab2_shifted);
+ if (onclick != null) {
+ Assert.fail("Onclick should not be rendered for disabled tab. But was: " + onclick);
+ }
+
+ // Check that tab panel does not switch to disabled tab
+ boolean tabSwitched = true;
+
+ try {
+ clickById(tabId2);
+ waitForAjaxCompletion(3000);
+ }catch (SeleniumException e) {
+ tabSwitched = false;
+ }
+
+ if (tabSwitched) {
+ Assert.fail("Tab panel was switched to dislabled tab2");
+ }
+
+ // Check that disabled tabs can be switched on server side
+ AssertValueEquals(selectedTabInputId, "tab1", "First tab should be selected now");
+ AssertTextEquals(parentId + FORM_ID + "tab1", "Tab one", "Content of disabled tab has not been rendered");
+ setValueById(selectedTabInputId, "tab2");
+ clickCommandAndWait(applyButtonId);
+
+ AssertValueEquals(selectedTabInputId, "tab2", "The second tab should be selected now");
+ AssertTextEquals(parentId + FORM_ID + "tab2", "Tab two", "Content of disabled tab has not been rendered");
+
+
+ // Check that children inputs does not update the model in case of disabled tab
+ setValueById(tabInputId, "Some text");
+ clickCommandAndWait(submitButtonId);
+ AssertValueEquals(tabInputId, "", "Text for the inputs should not be applied to model in case of disabled tab");
+ AssertTextEquals(_inputsId, "{}", "Text for the inputs should not be applied to model in case of disabled tab");
+
+ }
private void testListener(String parentId) {
@@ -196,15 +266,13 @@
// Set input for the first tab
setValueById(tabId1 + "_input", "text1");
- clickById(tabId2 + "_lbl");
- waitForAjaxCompletion();
- checkDecodes(parentId, "text1", "", "");
+ clickAjaxCommandAndWait(tabId2 + "_lbl");
+ checkDecodes(parentId, "text1", null, null);
// Set input for the second and 4th tabs
setValueById(tabId2 + "_input", "text2");
setValueById(tabId4 + "_input", "text4");
- clickById(tabId1 + "_lbl");
- waitForPageToLoad();
+ clickCommandAndWait(tabId1 + "_lbl");
checkDecodes(parentId, "text1", "text2", "text4");
// Reset model. Swtich to tyhe first tab
@@ -215,7 +283,7 @@
setValueById(tabId4 + "_input", "text");
submit(parentId);
AssertVisible(tabId4, "Tab4 (client) should be kept as active after form submition");
- checkDecodes(parentId, "", "", "text");
+ checkDecodes(parentId, null, null, "text");
// Switch to 2nd tab
clickById(tabId2 + "_lbl");
@@ -223,7 +291,7 @@
setValueById(tabId4 + "_input", "text4");
setValueById(tabId2 + "_input", "text2");
ajaxSubmit(parentId);
- checkDecodes(parentId, "", "text2", "text4");
+ checkDecodes(parentId, null, "text2", "text4");
}
@@ -231,15 +299,15 @@
String inputsId = parentId + FORM_ID + "_inputs";
String inputs = getTextById(inputsId);
- if (!inputs.contains("tab1=" + input1)) {
+ if (input1 != null && !inputs.contains("tab1=" + input1)) {
Assert.fail("Decode or update model for the first tab processed incorrect. The model should contain ['"
+ input1 + "'] value submitted from the tab");
}
- if (!inputs.contains("tab2=" + input2)) {
+ if (input2 != null && !inputs.contains("tab2=" + input2)) {
Assert.fail("Decode or update model for the second tab processed incorrect. The model should contain ['"
+ input2 + "'] value submitted from the tab");
}
- if (!inputs.contains("tab4=" + input4)) {
+ if (input4 != null && !inputs.contains("tab4=" + input4)) {
Assert.fail("Decode or update model for the 4th tab processed incorrect. The model should contain ['"
+ input4 + "'] value submitted from the tab");
}
17 years, 3 months
JBoss Rich Faces SVN: r12284 - in trunk/test-applications/seleniumTest/richfaces: src/main/webapp/WEB-INF and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-01-15 09:34:23 -0500 (Thu, 15 Jan 2009)
New Revision: 12284
Modified:
trunk/test-applications/seleniumTest/richfaces/pom.xml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/web.xml
Log:
https://jira.jboss.org/jira/browse/RF-5745
Modified: trunk/test-applications/seleniumTest/richfaces/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/pom.xml 2009-01-15 14:16:44 UTC (rev 12283)
+++ trunk/test-applications/seleniumTest/richfaces/pom.xml 2009-01-15 14:34:23 UTC (rev 12284)
@@ -15,7 +15,10 @@
<version>3.3.1-SNAPSHOT</version>
<build>
<finalName>richfaces</finalName>
- </build>
+ </build>
+ <properties>
+ <seamVersion>2.1.1.GA</seamVersion>
+ </properties>
<profiles>
<profile>
<id>default</id>
@@ -129,8 +132,39 @@
</plugins>
</build>
</profile>
- </profiles>
+ </profiles>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${seamVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ui</artifactId>
+ <version>${seamVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.6.0.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
<repositories>
+ <repository>
+ <releases/>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.org</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
<repository>
<releases>
<enabled>false</enabled>
@@ -140,6 +174,6 @@
</snapshots>
<id>snapshots.jboss.org</id>
<url>http://snapshots.jboss.org/maven2</url>
- </repository>
- </repositories>
+ </repository>
+ </repositories>
</project>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/web.xml 2009-01-15 14:16:44 UTC (rev 12283)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/web.xml 2009-01-15 14:34:23 UTC (rev 12284)
@@ -3,6 +3,9 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Archetype Created Web Application</display-name>
+
+ <!-- Facelets -->
+
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>2</param-value>
@@ -12,27 +15,12 @@
<param-value>true</param-value>
</context-param>
<context-param>
- <param-name>com.sun.faces.validateXml</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>com.sun.faces.verifyObjects</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>server</param-value>
- </context-param>
- <!--
- <context-param>
- <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
- <param-value>com.sun.facelets.FaceletViewHandler</param-value>
- </context-param>
- -->
- <context-param>
<param-name>facelets.VIEW_MAPPINGS</param-name>
<param-value>*.xhtml</param-value>
- </context-param>
+ </context-param>
+
+ <!-- Richfaces -->
+
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>false</param-value>
@@ -92,16 +80,36 @@
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
+
+ <!-- Seam -->
+
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <!-- JSF -->
+
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
- <servlet>
- <servlet-name>Auto Test Servlet</servlet-name>
- <servlet-class>org.ajax4jsf.autotest.AutoTestServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/NEKO/*</url-pattern>
@@ -114,15 +122,36 @@
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/NONE/*</url-pattern>
</servlet-mapping>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <!-- Auto test servlet -->
+
+ <servlet>
+ <servlet-name>Auto Test Servlet</servlet-name>
+ <servlet-class>org.ajax4jsf.autotest.AutoTestServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
<servlet-mapping>
<servlet-name>Auto Test Servlet</servlet-name>
<url-pattern>/autotest/*</url-pattern>
</servlet-mapping>
- <error-page>
- <exception-type>javax.servlet.ServletException</exception-type>
- <location>/faces/error.xhtml</location>
- </error-page>
+
+ <error-page>
+ <exception-type>javax.servlet.ServletException</exception-type>
+ <location>/faces/error.xhtml</location>
+ </error-page>
<login-config>
<auth-method>BASIC</auth-method>
- </login-config>
+ </login-config>
</web-app>
17 years, 3 months