JBoss Rich Faces SVN: r13291 - trunk/test-applications/richfaces-docs/web/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-03-30 09:38:07 -0400 (Mon, 30 Mar 2009)
New Revision: 13291
Modified:
trunk/test-applications/richfaces-docs/web/src/main/webapp/WEB-INF/faces-config.xml
Log:
RF-5768: Real World Demo Application Tutorial Update for 3.3.1 release
Modified: trunk/test-applications/richfaces-docs/web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/webapp/WEB-INF/faces-config.xml 2009-03-30 12:13:34 UTC (rev 13290)
+++ trunk/test-applications/richfaces-docs/web/src/main/webapp/WEB-INF/faces-config.xml 2009-03-30 13:38:07 UTC (rev 13291)
@@ -129,7 +129,7 @@
</managed-bean>
<managed-bean>
<managed-bean-name>shelf</managed-bean-name>
- <managed-bean-class>demo.Shelf</managed-bean-class>
+ <managed-bean-class>org.docs.tree.Shelf</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
15 years, 9 months
JBoss Rich Faces SVN: r13290 - trunk/ui/listShuttle/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-03-30 08:13:34 -0400 (Mon, 30 Mar 2009)
New Revision: 13290
Modified:
trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
Log:
ListShuttle: "rows" and "first" attributes should be hidden.
https://jira.jboss.org/jira/browse/RF-5936
Modified: trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
===================================================================
--- trunk/ui/listShuttle/src/main/config/component/listShuttle.xml 2009-03-30 11:58:28 UTC (rev 13289)
+++ trunk/ui/listShuttle/src/main/config/component/listShuttle.xml 2009-03-30 12:13:34 UTC (rev 13290)
@@ -66,7 +66,23 @@
&ui_input_attributes;
&html_style_attributes;
- &ui_data_attributes;
+ &ui_data_attributes;
+ <property hidden="true">
+ <name>first</name>
+ <classname>int</classname>
+ <description>
+ A zero-relative row number of the first row to display
+ </description>
+ </property>
+ <property hidden="true">
+ <name>rows</name>
+ <classname>int</classname>
+ <description>
+ A number of rows to display, or zero for all remaining
+ rows in the table
+ </description>
+ </property>
+
<property>
<name>sourceRequired</name>
<classname>boolean</classname>
15 years, 9 months
JBoss Rich Faces SVN: r13289 - trunk/test-applications/facelets/src/main/webapp/ComponentControl.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2009-03-30 07:58:28 -0400 (Mon, 30 Mar 2009)
New Revision: 13289
Modified:
trunk/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml
Log:
remove findComponent function test.
Modified: trunk/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml 2009-03-30 11:14:31 UTC (rev 13288)
+++ trunk/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml 2009-03-30 11:58:28 UTC (rev 13289)
@@ -110,16 +110,5 @@
</rich:contextMenu>
<rich:componentControl event="oncontextmenu"
attachTo="ccContextMenuPanelMenuID" for="ccContextMenuID"
- operation="show" params="expand:'show work'" />
- <br />
- <br />
- <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
- <h:panelGrid columns="2">
- <rich:column>
- <a4j:commandLink value="getOperation" reRender="findID"></a4j:commandLink>
- </rich:column>
- <rich:column id="findID">
- <h:outputText value="#{rich:findComponent('componentID').operation}" />
- </rich:column>
- </h:panelGrid>
+ operation="show" params="expand:'show work'" />
</f:subview>
\ No newline at end of file
15 years, 9 months
JBoss Rich Faces SVN: r13288 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2009-03-30 07:14:31 -0400 (Mon, 30 Mar 2009)
New Revision: 13288
Modified:
trunk/docs/userguide/en/src/main/docbook/included/tree.xml
Log:
RF-6582 - described "rowKeyConverter".
Modified: trunk/docs/userguide/en/src/main/docbook/included/tree.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2009-03-30 11:11:45 UTC (rev 13287)
+++ trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2009-03-30 11:14:31 UTC (rev 13288)
@@ -128,41 +128,41 @@
Data property of the current model <code>TreeNode</code> is exposed using
<emphasis><property>"var"</property></emphasis> attribute,
so if <code>var="station"</code> you can refer to that data using <code>#{station}</code> syntax.
- </para>
- <para>
- In the following example the <emphasis role="bold"><property><rich:tree></property></emphasis> is
- built from a simple <code>org.richfaces.model.TreeNode</code> model:
- </para>
- <programlisting role="JAVA"><![CDATA[...
-private TreeNodeImpl<String> stationRoot = new TreeNodeImpl<String>();
-private TreeNodeImpl<String> stationNodes = new TreeNodeImpl<String>();
-private String[] kickRadioFeed = { "Hall & Oates - Kiss On My List",
- "David Bowie - Let's Dance", "Lyn Collins - Think (About It)",
- "Kim Carnes - Bette Davis Eyes",
- "KC & the Sunshine Band - Give It Up" };
- ...
-stationRoot.setData("KickRadio");
-stationNodes.addChild(0, stationRoot);
-for (int i = 0; i < kickRadioFeed.length; i++){
- TreeNodeImpl<String> child = new TreeNodeImpl<String>();
- child.setData(kickRadioFeed[i]);
- stationRoot.addChild(i, child);
+ </para>
+ <para>
+ In the following example the <emphasis role="bold"><property><rich:tree></property></emphasis> is
+ built from a simple <code>org.richfaces.model.TreeNode</code> model:
+ </para>
+ <programlisting role="JAVA"><![CDATA[...
+private TreeNodeImpl<String> stationRoot = new TreeNodeImpl<String>();
+private TreeNodeImpl<String> stationNodes = new TreeNodeImpl<String>();
+private String[] kickRadioFeed = { "Hall & Oates - Kiss On My List",
+ "David Bowie - Let's Dance", "Lyn Collins - Think (About It)",
+ "Kim Carnes - Bette Davis Eyes",
+ "KC & the Sunshine Band - Give It Up" };
+ ...
+stationRoot.setData("KickRadio");
+stationNodes.addChild(0, stationRoot);
+for (int i = 0; i < kickRadioFeed.length; i++){
+ TreeNodeImpl<String> child = new TreeNodeImpl<String>();
+ child.setData(kickRadioFeed[i]);
+ stationRoot.addChild(i, child);
}
-...]]></programlisting>
-<para>
-As it is mentioned before you need to pass <code>#{stations.stationNodes}</code> property to the
-<emphasis><property>"value"</property></emphasis> attribute
-and define the <emphasis><property>"var"</property></emphasis> attribute in order to refer to the data:
-</para>
-<programlisting role="XML"><![CDATA[...
-<rich:tree value="#{stations.stationNodes}" var="station">
- <rich:treeNode>
- <h:outputText value="#{station}" />
- </rich:treeNode>
+...]]></programlisting>
+<para>
+As it is mentioned before you need to pass <code>#{stations.stationNodes}</code> property to the
+<emphasis><property>"value"</property></emphasis> attribute
+and define the <emphasis><property>"var"</property></emphasis> attribute in order to refer to the data:
+</para>
+<programlisting role="XML"><![CDATA[...
+<rich:tree value="#{stations.stationNodes}" var="station">
+ <rich:treeNode>
+ <h:outputText value="#{station}" />
+ </rich:treeNode>
</rich:tree>
-...]]></programlisting>
-<para>
- This is a result:
+...]]></programlisting>
+<para>
+ This is a result:
</para>
<figure>
<title>A simple <emphasis role="bold"><property><rich:tree></property></emphasis> from a <code>org.richfaces.model.TreeNode</code></title>
@@ -171,11 +171,11 @@
<imagedata fileref="images/treeModel.png"/>
</imageobject>
</mediaobject>
-</figure>
+</figure>
-<para>
-Implementation of the <emphasis role="bold"><property><rich:tree></property></emphasis> component
-provides another way to build a tree.
+<para>
+Implementation of the <emphasis role="bold"><property><rich:tree></property></emphasis> component
+provides another way to build a tree.
This approach implies using a <code>"XmlTreeDataBuilder"</code> class
(<ulink url="http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...">
org.richfaces.component.xml.XmlTreeDataBuilder
@@ -522,7 +522,7 @@
<property>"process"</property>
</emphasis> attribute usage you can find <link linkend="process"
>here</link>. </para>
- <tip>
+ <!--<tip>
<title>Tip:</title>
<para>
<emphasis>
@@ -530,7 +530,24 @@
</emphasis> support for the <emphasis role="bold">
<property><rich:tree></property>
</emphasis> is pending! </para>
- </tip>
+ </tip>-->
+ <para>
+ The value of <emphasis>
+ <property>"rowKeyConverter"</property>
+ </emphasis> can be:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para><code>org.richfaces.TreeRowKeyConverter</code> - it used for the simple tree.</para>
+ </listitem>
+ <listitem>
+ <para><code>org.richfaces.TreeAdaptorRowKeyConverter</code> used for tree with <emphasis role="bold"><property><rich:treeNodesAdaptor></property></emphasis></para>
+ </listitem>
+ <listitem>
+ <para>The <code>org.richfaces.TreeAdaptorIntegerRowKeyConverter</code> converter used for adaptor-based tree for implementing custom converters</para>
+ </listitem>
+ </itemizedlist>
+
</section>
<section id="tsebro" role="updated">
15 years, 9 months
JBoss Rich Faces SVN: r13287 - trunk/ui/tree/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2009-03-30 07:11:45 -0400 (Mon, 30 Mar 2009)
New Revision: 13287
Modified:
trunk/ui/tree/src/main/config/component/tree.xml
Log:
RF-696 - checked TofA. Added description for rowKeyConverter (tree).
Modified: trunk/ui/tree/src/main/config/component/tree.xml
===================================================================
--- trunk/ui/tree/src/main/config/component/tree.xml 2009-03-30 11:07:06 UTC (rev 13286)
+++ trunk/ui/tree/src/main/config/component/tree.xml 2009-03-30 11:11:45 UTC (rev 13287)
@@ -338,6 +338,7 @@
<property>
<name>rowKeyConverter</name>
+ <description>Converter for a row key object</description>
</property>
<property>
15 years, 9 months
JBoss Rich Faces SVN: r13286 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-03-30 07:07:06 -0400 (Mon, 30 Mar 2009)
New Revision: 13286
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ColumnsTest.java
Log:
fix rendered and filtering tests
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ColumnsTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ColumnsTest.java 2009-03-30 09:59:44 UTC (rev 13285)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ColumnsTest.java 2009-03-30 11:07:06 UTC (rev 13286)
@@ -81,9 +81,9 @@
String tableId = getParentId() + "_form:table";
- int headerCount = selenium.getXpathCount("//table[@id='"+tableId+"']/tbody/*").intValue();
+ int headerCount = selenium.getXpathCount("//table[@id='"+tableId+"']/thead/*").intValue();
int footerCount = selenium.getXpathCount("//table[@id='"+tableId+"']/tfoot/*").intValue();
- int dataCount = selenium.getXpathCount("//table[@id='"+tableId+"']/tbody/*").intValue();
+ int dataCount = selenium.getXpathCount("//table[@id='"+tableId+"']/tbody/tr/td/*").intValue();
if (headerCount != 0 || footerCount != 0 || dataCount != 0) {
Assert.fail("Rendered attribute does not work. No data and no facets should be output to client.");
@@ -201,7 +201,7 @@
for (int i = 0; i < columnsCount; i++) {
checkColumnsData(tableId, i, new String [] {String.valueOf(i)}, FEATURE.FILTERING, "Filterby does snot work.");
}
- AssertTextEquals("//table[@id='"+tableId+"']/thead/tr/th[1]", "0", "Filter value attribute does not work. Binding value was not changed.");
+ AssertTextEquals("//table[@id='"+tableId+"']/tbody/tr/td[1]", "0", "Filter value attribute does not work. Binding value was not changed.");
// Filter by the third column with '3' filter value
selenium.type(filterInputPath, "");
@@ -212,9 +212,9 @@
waitForAjaxCompletion();
for (int i = 0; i < columnsCount; i++) {
- checkColumnsData(tableId, i, new String [] {String.valueOf(i + 1)}, FEATURE.FILTERING, "Filterby does snot work.");
+ checkColumnsData(tableId, i, new String [] {String.valueOf(i + 1)}, FEATURE.FILTERING, "Filterby does not work.");
}
- AssertTextEquals("//table[@id='"+tableId+"']/thead/tr/th[3]", "3", "Filter value attribute does not work. Binding value was not changed.");
+ AssertTextEquals("//table[@id='"+tableId+"']/tbody/tr/td[3]", "3", "Filter value attribute does not work. Binding value was not changed.");
//<<<----------------
15 years, 9 months
JBoss Rich Faces SVN: r13285 - in trunk/test-applications/jsp/src/main: resources and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-03-30 05:59:44 -0400 (Mon, 30 Mar 2009)
New Revision: 13285
Added:
trunk/test-applications/jsp/src/main/java/util/data/Car.java
trunk/test-applications/jsp/src/main/java/util/data/CarProvider.java
trunk/test-applications/jsp/src/main/resources/org/richfaces/renderkit/calendar_en_US.properties
trunk/test-applications/jsp/src/main/resources/util/
trunk/test-applications/jsp/src/main/resources/util/data/
trunk/test-applications/jsp/src/main/resources/util/data/cars.xml
Log:
+ Car class
Added: trunk/test-applications/jsp/src/main/java/util/data/Car.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/data/Car.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/util/data/Car.java 2009-03-30 09:59:44 UTC (rev 13285)
@@ -0,0 +1,76 @@
+package util.data;
+
+public class Car {
+
+ private String make;
+
+ private String model;
+
+ private Integer price;
+
+ public Car() {
+ this.make = "";
+ this.model = "";
+ this.price = 0;
+ }
+
+ public Car(String mak, String mod, Integer pr) {
+ this.make = mak;
+ this.model = mod;
+ this.price = pr;
+ }
+
+ public String getMake() {
+ return make;
+ }
+
+ public void setMake(String make) {
+ this.make = make;
+ }
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public Integer getPrice() {
+ return price;
+ }
+
+ public void setPrice(Integer price) {
+ this.price = price;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((make == null) ? 0 : make.hashCode());
+ result = prime * result + ((model == null) ? 0 : model.hashCode());
+ result = prime * result + ((price == null) ? 0 : price.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Car) {
+ Car car = (Car) obj;
+ if (this.make.equals(car.make) && (this.model.equals(car.model))
+ && (this.price.equals(car.price))) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return this.make + ":" + this.model + ":" + this.price;
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/jsp/src/main/java/util/data/CarProvider.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/data/CarProvider.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/util/data/CarProvider.java 2009-03-30 09:59:44 UTC (rev 13285)
@@ -0,0 +1,111 @@
+package util.data;
+
+import java.util.ArrayList;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class CarProvider extends DefaultHandler {
+
+ private ArrayList<Car> allCars = null;
+
+ public CarProvider() {
+ if (allCars == null) {
+ allCars = new ArrayList<Car>();
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ SAXParser sp = spf.newSAXParser();
+ sp.parse(new InputSource(getClass().getResourceAsStream(
+ "cars.xml")), this);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public ArrayList<Car> getAllCars() {
+ return allCars;
+ }
+
+ private String element = "";
+ private String mak = "";
+ private String mod = "";
+ private Integer pr = 0;
+
+ public void startDocument() {
+ System.out.println("*** > Parser starts its work");
+ }
+
+ public void startElement(String namespaceURI, String localName,
+ String rawName, Attributes attrs) {
+ element = rawName;
+
+// System.out.print("<");
+// System.out.print(rawName);
+// if (attrs != null) {
+// int len = attrs.getLength();
+// for (int i = 0; i < len; i++) {
+// System.out.print(" ");
+// System.out.print(attrs.getQName(i));
+// System.out.print("=\"");
+// System.out.print(attrs.getValue(i));
+// System.out.print("\"");
+// }
+// }
+// System.out.print(">");
+ }
+
+ public void characters(char ch[], int start, int length) {
+ String text = new String(ch, start, length);
+// System.out.print(text);
+
+ if (element.equals("make")) {
+ element = "";
+ mak = text;
+ } else if (element.equals("model")) {
+ element = "";
+ mod = text;
+ } else if (element.equals("price")) {
+ try {
+ element = "";
+ Integer p = Integer.parseInt(text);
+ pr = p;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void endElement(String namespaceURI, String localName, String rawName) {
+// System.out.print("</");
+// System.out.print(rawName);
+// System.out.print(">");
+
+ if (rawName.equals("car")) {
+ allCars.add(new Car(mak, mod, pr));
+ }
+ }
+
+ public void endDocument() {
+ System.out.println("*** > Parser ends its work");
+ }
+
+ public void warning(SAXParseException ex) {
+ System.err.println("[Warning] : " + ex.getMessage());
+ }
+
+ public void error(SAXParseException ex) {
+ System.err.println("[Error] : " + ex.getMessage());
+ }
+
+ public void fatalError(SAXParseException ex) throws SAXException {
+ System.err.println("[Fatal Error] : " + ex.getMessage());
+ throw ex;
+ }
+}
Added: trunk/test-applications/jsp/src/main/resources/org/richfaces/renderkit/calendar_en_US.properties
===================================================================
--- trunk/test-applications/jsp/src/main/resources/org/richfaces/renderkit/calendar_en_US.properties (rev 0)
+++ trunk/test-applications/jsp/src/main/resources/org/richfaces/renderkit/calendar_en_US.properties 2009-03-30 09:59:44 UTC (rev 13285)
@@ -0,0 +1,6 @@
+RICH_CALENDAR_APPLY_LABEL=APPLY
+RICH_CALENDAR_TODAY_LABEL=TODAY
+RICH_CALENDAR_CLOSE_LABEL=CLOSE
+RICH_CALENDAR_OK_LABEL=OK
+RICH_CALENDAR_CLEAN_LABEL=CLEAN
+RICH_CALENDAR_CANCEL_LABEL=CANCEL
Added: trunk/test-applications/jsp/src/main/resources/util/data/cars.xml
===================================================================
--- trunk/test-applications/jsp/src/main/resources/util/data/cars.xml (rev 0)
+++ trunk/test-applications/jsp/src/main/resources/util/data/cars.xml 2009-03-30 09:59:44 UTC (rev 13285)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shop>
+ <car>
+ <make>Audi</make>
+ <model>A6</model>
+ <price>20000</price>
+ </car>
+ <car>
+ <make>Audi</make>
+ <model>Q7</model>
+ <price>48500</price>
+ </car>
+ <car>
+ <make>BMW</make>
+ <model>760Li</model>
+ <price>115400</price>
+ </car>
+ <car>
+ <make>Bentley</make>
+ <model>Arnage</model>
+ <price>240000</price>
+ </car>
+ <car>
+ <make>Bugatti</make>
+ <model>Veyron</model>
+ <price>1340000</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>S63 AMG</model>
+ <price>154200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>SLR</model>
+ <price>854200</price>
+ </car>
+ <car>
+ <make>Mazda</make>
+ <model>6</model>
+ <price>21300</price>
+ </car>
+ <car>
+ <make>Fiat</make>
+ <model>Punto</model>
+ <price>8200</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>GT-40</model>
+ <price>325100</price>
+ </car>
+ <car>
+ <make>Ferrari</make>
+ <model>Enzo</model>
+ <price>950000</price>
+ </car>
+ <car>
+ <make>Jaguar</make>
+ <model>XJ</model>
+ <price>75400</price>
+ </car>
+</shop>
\ No newline at end of file
15 years, 9 months
JBoss Rich Faces SVN: r13284 - in trunk/test-applications/facelets/src/main: java/util/converter and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-03-30 05:51:37 -0400 (Mon, 30 Mar 2009)
New Revision: 13284
Added:
trunk/test-applications/facelets/src/main/java/util/converter/CarsConverter.java
trunk/test-applications/facelets/src/main/java/util/data/Car.java
trunk/test-applications/facelets/src/main/java/util/data/CarProvider.java
trunk/test-applications/facelets/src/main/java/util/validator/
trunk/test-applications/facelets/src/main/java/util/validator/CarsValidator.java
trunk/test-applications/facelets/src/main/resources/util/
trunk/test-applications/facelets/src/main/resources/util/data/
trunk/test-applications/facelets/src/main/resources/util/data/cars.xml
Log:
+ Car class and its converter and validator
Added: trunk/test-applications/facelets/src/main/java/util/converter/CarsConverter.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/util/converter/CarsConverter.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/util/converter/CarsConverter.java 2009-03-30 09:51:37 UTC (rev 13284)
@@ -0,0 +1,26 @@
+package util.converter;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+
+import util.data.Car;
+
+public class CarsConverter implements Converter {
+
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String value) {
+ String[] str = value.split(":");
+ return new Car(str[0], str[1], Integer.parseInt(str[2]));
+ }
+
+ public String getAsString(FacesContext context, UIComponent component,
+ Object obj) {
+
+ if (obj instanceof Car) {
+ Car car = (Car) obj;
+ return car.toString();
+ } else throw new ConverterException("is not a class util.data.Car");
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/facelets/src/main/java/util/data/Car.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/util/data/Car.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/util/data/Car.java 2009-03-30 09:51:37 UTC (rev 13284)
@@ -0,0 +1,80 @@
+package util.data;
+
+import java.io.Serializable;
+
+public class Car implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+
+ private String make;
+
+ private String model;
+
+ private Integer price;
+
+ public Car() {
+ this.make = "";
+ this.model = "";
+ this.price = 0;
+ }
+
+ public Car(String mak, String mod, Integer pr) {
+ this.make = mak;
+ this.model = mod;
+ this.price = pr;
+ }
+
+ public String getMake() {
+ return make;
+ }
+
+ public void setMake(String make) {
+ this.make = make;
+ }
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public Integer getPrice() {
+ return price;
+ }
+
+ public void setPrice(Integer price) {
+ this.price = price;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((make == null) ? 0 : make.hashCode());
+ result = prime * result + ((model == null) ? 0 : model.hashCode());
+ result = prime * result + ((price == null) ? 0 : price.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Car) {
+ Car car = (Car) obj;
+ if (this.make.equals(car.make) && (this.model.equals(car.model))
+ && (this.price.equals(car.price))) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return this.make + ":" + this.model + ":" + this.price;
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/facelets/src/main/java/util/data/CarProvider.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/util/data/CarProvider.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/util/data/CarProvider.java 2009-03-30 09:51:37 UTC (rev 13284)
@@ -0,0 +1,111 @@
+package util.data;
+
+import java.util.ArrayList;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class CarProvider extends DefaultHandler {
+
+ private ArrayList<Car> allCars = null;
+
+ public CarProvider() {
+ if (allCars == null) {
+ allCars = new ArrayList<Car>();
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ SAXParser sp = spf.newSAXParser();
+ sp.parse(new InputSource(getClass().getResourceAsStream(
+ "cars.xml")), this);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public ArrayList<Car> getAllCars() {
+ return allCars;
+ }
+
+ private String element = "";
+ private String mak = "";
+ private String mod = "";
+ private Integer pr = 0;
+
+ public void startDocument() {
+ System.out.println("*** > Parser starts its work");
+ }
+
+ public void startElement(String namespaceURI, String localName,
+ String rawName, Attributes attrs) {
+ element = rawName;
+
+// System.out.print("<");
+// System.out.print(rawName);
+// if (attrs != null) {
+// int len = attrs.getLength();
+// for (int i = 0; i < len; i++) {
+// System.out.print(" ");
+// System.out.print(attrs.getQName(i));
+// System.out.print("=\"");
+// System.out.print(attrs.getValue(i));
+// System.out.print("\"");
+// }
+// }
+// System.out.print(">");
+ }
+
+ public void characters(char ch[], int start, int length) {
+ String text = new String(ch, start, length);
+// System.out.print(text);
+
+ if (element.equals("make")) {
+ element = "";
+ mak = text;
+ } else if (element.equals("model")) {
+ element = "";
+ mod = text;
+ } else if (element.equals("price")) {
+ try {
+ element = "";
+ Integer p = Integer.parseInt(text);
+ pr = p;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void endElement(String namespaceURI, String localName, String rawName) {
+// System.out.print("</");
+// System.out.print(rawName);
+// System.out.print(">");
+
+ if (rawName.equals("car")) {
+ allCars.add(new Car(mak, mod, pr));
+ }
+ }
+
+ public void endDocument() {
+ System.out.println("*** > Parser ends its work");
+ }
+
+ public void warning(SAXParseException ex) {
+ System.err.println("[Warning] : " + ex.getMessage());
+ }
+
+ public void error(SAXParseException ex) {
+ System.err.println("[Error] : " + ex.getMessage());
+ }
+
+ public void fatalError(SAXParseException ex) throws SAXException {
+ System.err.println("[Fatal Error] : " + ex.getMessage());
+ throw ex;
+ }
+}
Added: trunk/test-applications/facelets/src/main/java/util/validator/CarsValidator.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/util/validator/CarsValidator.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/util/validator/CarsValidator.java 2009-03-30 09:51:37 UTC (rev 13284)
@@ -0,0 +1,33 @@
+package util.validator;
+
+import java.util.ArrayList;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+import util.data.Car;
+
+public class CarsValidator implements Validator {
+
+ @SuppressWarnings("unchecked")
+ public void validate(FacesContext context, UIComponent component,
+ Object value) throws ValidatorException {
+
+ Object[] objArr = (Object[]) value;
+ ArrayList<Car> carsList = (ArrayList<Car>) objArr[0];
+ for (Car car : carsList) {
+ System.out.println("***> validator for " + car.getMake() + "-"
+ + car.getModel());
+
+ if (car.getPrice() > 10000000) {
+ throw new ValidatorException(new FacesMessage(
+ "Too much money!!! " + car.getMake() + "-"
+ + car.getModel()));
+ }
+ }
+ }
+
+}
Added: trunk/test-applications/facelets/src/main/resources/util/data/cars.xml
===================================================================
--- trunk/test-applications/facelets/src/main/resources/util/data/cars.xml (rev 0)
+++ trunk/test-applications/facelets/src/main/resources/util/data/cars.xml 2009-03-30 09:51:37 UTC (rev 13284)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shop>
+ <car>
+ <make>Audi</make>
+ <model>A6</model>
+ <price>20000</price>
+ </car>
+ <car>
+ <make>Audi</make>
+ <model>Q7</model>
+ <price>48500</price>
+ </car>
+ <car>
+ <make>BMW</make>
+ <model>760Li</model>
+ <price>115400</price>
+ </car>
+ <car>
+ <make>Bentley</make>
+ <model>Arnage</model>
+ <price>240000</price>
+ </car>
+ <car>
+ <make>Bugatti</make>
+ <model>Veyron</model>
+ <price>1340000</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>S63 AMG</model>
+ <price>154200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>SLR</model>
+ <price>854200</price>
+ </car>
+ <car>
+ <make>Mazda</make>
+ <model>6</model>
+ <price>21300</price>
+ </car>
+ <car>
+ <make>Fiat</make>
+ <model>Punto</model>
+ <price>8200</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>GT-40</model>
+ <price>325100</price>
+ </car>
+ <car>
+ <make>Ferrari</make>
+ <model>Enzo</model>
+ <price>950000</price>
+ </car>
+ <car>
+ <make>Jaguar</make>
+ <model>XJ</model>
+ <price>75400</price>
+ </car>
+</shop>
\ No newline at end of file
15 years, 9 months
JBoss Rich Faces SVN: r13283 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-03-30 05:16:34 -0400 (Mon, 30 Mar 2009)
New Revision: 13283
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
fix custom templates loading
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-03-30 09:14:38 UTC (rev 13282)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-03-30 09:16:34 UTC (rev 13283)
@@ -151,6 +151,12 @@
browser = firefox;
}
}
+
+ if(!useDefaultTemplates()) {
+ String processTemplates = getTestDependedTemplates();
+ Configurator.setTemplates(processTemplates);
+ }
+
synchronized (MUTEX) {
this.filterPrefix = filterPrefix;
selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
@@ -222,11 +228,7 @@
protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy, @Optional String templates) throws Exception {
Configurator.setLoadScriptStrategy(loadScriptStrategy);
Configurator.setLoadStyleStrategy(loadStyleStrategy);
- String processTemplates = templates;
- if(!useDefaultTemplates()) {
- processTemplates = getTestDependedTemplates();
- }
- Configurator.setTemplates(processTemplates);
+ Configurator.setTemplates(templates);
}
15 years, 9 months
JBoss Rich Faces SVN: r13282 - Reports/3.3.1 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2009-03-30 05:14:38 -0400 (Mon, 30 Mar 2009)
New Revision: 13282
Added:
trunk/test-applications/qa/Test Reports/3.3.1/RFTestReport3.3.1.BETA2.xls
Log:
Added: trunk/test-applications/qa/Test Reports/3.3.1/RFTestReport3.3.1.BETA2.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.3.1/RFTestReport3.3.1.BETA2.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 9 months