JBoss Rich Faces SVN: r11130 - trunk/samples/extendedDataTable-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-11-13 04:51:33 -0500 (Thu, 13 Nov 2008)
New Revision: 11130
Modified:
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp
Log:
datascroller moved to table "footer" facet
Modified: trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp 2008-11-13 09:40:00 UTC (rev 11129)
+++ trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp 2008-11-13 09:51:33 UTC (rev 11130)
@@ -105,15 +105,16 @@
<h:outputText value="#{msg['patient.admissionDate']}" />
</f:facet>
<h:outputText value="#{patient.admissionDate}" />
- </rich:column>
- <a4j:support event="onselectionchange" action="#{extendedDataTableBean.takeSelection}" reRender="selectedPatients">
- </a4j:support>
+ </rich:column>
+ <f:facet name="footer">
+ <rich:datascroller
+ style="width: #{extendedDataTableControlBean.width}"
+ rendered="#{extendedDataTableControlBean.paginated}"
+ for="demoTable">
+ </rich:datascroller>
+ </f:facet>
+ <a4j:support event="onselectionchange" action="#{extendedDataTableBean.takeSelection}" reRender="selectedPatients" />
</extdt:extendedDataTable>
- <rich:datascroller
- style="width: #{extendedDataTableControlBean.width}"
- rendered="#{extendedDataTableControlBean.paginated}"
- for="demoTable">
- </rich:datascroller>
</h:form>
</rich:panel>
<rich:panel id="rightPanel">
16 years, 10 months
JBoss Rich Faces SVN: r11129 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/examples.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-11-13 04:40:00 -0500 (Thu, 13 Nov 2008)
New Revision: 11129
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/examples/simple.xhtml
Log:
add label attribute for columns
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/examples/simple.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/examples/simple.xhtml 2008-11-13 09:39:31 UTC (rev 11128)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/examples/simple.xhtml 2008-11-13 09:40:00 UTC (rev 11129)
@@ -12,25 +12,25 @@
<rich:extendedDataTable value="#{capitalsBean.capitals}" var="cap" id="table"
width="580px" height="400px" sortMode="#{extendedTableBean.sortMode}"
selectionMode="#{extendedTableBean.selectionMode}">
- <rich:column sortable="false">
+ <rich:column sortable="false" label="Flag">
<f:facet name="header">
<h:outputText value="Flag"/>
</f:facet>
<h:graphicImage value="#{cap.stateFlag}"/>
</rich:column>
- <rich:column sortable="true" sortBy="#{cap.state}" filterBy="#{cap.state}" filterEvent="onkeyup" width="170px">
+ <rich:column sortable="true" sortBy="#{cap.state}" filterBy="#{cap.state}" filterEvent="onkeyup" width="170px" label="State Name">
<f:facet name="header">
<h:outputText value="State Name"/>
</f:facet>
<h:outputText value="#{cap.state}"/>
</rich:column>
- <rich:column sortable="true" sortBy="#{cap.name}" filterBy="#{cap.state}" filterEvent="onkeyup" width="170px">
+ <rich:column sortable="true" sortBy="#{cap.name}" filterBy="#{cap.state}" filterEvent="onkeyup" width="170px" label="State Capital">
<f:facet name="header">
<h:outputText value="State Capital"/>
</f:facet>
<h:outputText value="#{cap.name}"/>
</rich:column>
- <rich:column sortable="false">
+ <rich:column sortable="false" label="Time Zone">
<f:facet name="header">
<h:outputText value="Time Zone"/>
</f:facet>
16 years, 10 months
JBoss Rich Faces SVN: r11128 - trunk/samples/extendedDataTable-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: piotr.buda
Date: 2008-11-13 04:39:31 -0500 (Thu, 13 Nov 2008)
New Revision: 11128
Modified:
trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp
Log:
Small sample changes
Modified: trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp 2008-11-13 09:10:02 UTC (rev 11127)
+++ trunk/samples/extendedDataTable-sample/src/main/webapp/pages/index.jsp 2008-11-13 09:39:31 UTC (rev 11128)
@@ -18,10 +18,6 @@
height: 100%;
}
- .rich-filter-input {
- width: 80%;
- }
-
.rightColumn {
width: 50%;
height: 100%;
@@ -149,7 +145,7 @@
>
<f:selectItems value="#{extendedDataTableControlBean.selectionModeSelectItems}"/>
</h:selectOneMenu>
- <h:outputLabel value="#{msg['table.paginated']}" for="paginatedChecxbox" />
+ <h:outputLabel value="#{msg['table.paginated']}" for="paginatedCheckbox" />
<h:selectBooleanCheckbox
id="paginatedCheckbox"
value="#{extendedDataTableControlBean.paginated}" />
16 years, 10 months
JBoss Rich Faces SVN: r11127 - trunk/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: piotr.buda
Date: 2008-11-13 04:10:02 -0500 (Thu, 13 Nov 2008)
New Revision: 11127
Modified:
trunk/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss
Log:
Added .rich-filter-input CSS class
Modified: trunk/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss
===================================================================
--- trunk/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss 2008-11-13 00:58:34 UTC (rev 11126)
+++ trunk/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss 2008-11-13 09:10:02 UTC (rev 11127)
@@ -269,6 +269,10 @@
overflow-y:auto;
}
+ .rich-filter-input {
+ width: 80%;
+ }
+
</f:verbatim>
<u:selector name=".extdt-menu-div-on" >
16 years, 10 months
JBoss Rich Faces SVN: r11126 - in branches/jsf2.0: framework/jsf-test and 21 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-11-12 19:58:34 -0500 (Wed, 12 Nov 2008)
New Revision: 11126
Added:
branches/jsf2.0/framework/jsf-test/src/test/resources/com/
branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/
branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/
branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/Messages.properties
branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
branches/jsf2.0/tests/
branches/jsf2.0/tests/ajax/
branches/jsf2.0/tests/ajax/pom.xml
branches/jsf2.0/tests/ajax/src/
branches/jsf2.0/tests/ajax/src/main/
branches/jsf2.0/tests/ajax/src/main/java/
branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/
branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/Bean.java
branches/jsf2.0/tests/ajax/src/main/resources/
branches/jsf2.0/tests/ajax/src/main/webapp/
branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/
branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/MANIFEST.MF
branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/
branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml
branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/lib/
branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml
branches/jsf2.0/tests/ajax/src/main/webapp/home.xhtml
branches/jsf2.0/tests/ajax/src/main/webapp/index.jsp
branches/jsf2.0/tests/ajax/src/main/webapp/resources/
branches/jsf2.0/tests/ajax/src/main/webapp/resources/anim-star-bkgrnd.gif
branches/jsf2.0/tests/ajax/src/main/webapp/resources/stylesheet.css
branches/jsf2.0/tests/ajax/src/test/
branches/jsf2.0/tests/ajax/src/test/java/
branches/jsf2.0/tests/ajax/src/test/java/org/
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/
branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java
branches/jsf2.0/tests/ajax/src/test/resources/
branches/jsf2.0/tests/pom.xml
Modified:
branches/jsf2.0/framework/jsf-test/pom.xml
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java
branches/jsf2.0/pom.xml
Log:
create JSF 2.0 ajax test
Modified: branches/jsf2.0/framework/jsf-test/pom.xml
===================================================================
--- branches/jsf2.0/framework/jsf-test/pom.xml 2008-11-12 20:27:42 UTC (rev 11125)
+++ branches/jsf2.0/framework/jsf-test/pom.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -16,7 +16,6 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
@@ -25,6 +24,11 @@
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0.0-b05</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
<artifactId>mojarra-jsf-impl</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
@@ -68,5 +72,35 @@
<artifactId>nekohtml</artifactId>
<version>1.9.9</version>
</dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>jstl</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.0</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java 2008-11-12 20:27:42 UTC (rev 11125)
+++ branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java 2008-11-13 00:58:34 UTC (rev 11126)
@@ -49,6 +49,7 @@
@Override
protected void setupWebContent() {
+ facesServer.addResource("/WEB-INF/faces-config.xml", "org/richfaces/test/faces-config.xml");
facesServer.addResource("/hello.xhtml", "org/richfaces/test/hello.xhtml");
facesServer.addResource("/response.xhtml", "org/richfaces/test/response.xhtml");
facesServer.addResource("/wave.med.gif", "org/richfaces/test/wave.med.gif");
Added: branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/Messages.properties
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/Messages.properties (rev 0)
+++ branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/Messages.properties 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1 @@
+error.unreachable.base: Unreachable Base
\ No newline at end of file
Property changes on: branches/jsf2.0/framework/jsf-test/src/test/resources/com/sun/el/Messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml (rev 0)
+++ branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,69 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
+
+ <!-- our NumberBean we created before -->
+ <managed-bean>
+ <managed-bean-name>HelloBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.test.HelloBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <!-- going from guess.xhtml to response.xhtml -->
+ <navigation-rule>
+ <from-view-id>/hello.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/response.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- going from response.xhtml to guess.xhtml -->
+ <navigation-rule>
+ <from-view-id>/response.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/hello.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
Property changes on: branches/jsf2.0/framework/jsf-test/src/test/resources/org/richfaces/test/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/jsf2.0/pom.xml
===================================================================
--- branches/jsf2.0/pom.xml 2008-11-12 20:27:42 UTC (rev 11125)
+++ branches/jsf2.0/pom.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -54,6 +54,7 @@
<module>cdk</module>
<module>framework</module>
<module>ui</module>
+ <module>tests</module>
</modules>
<repositories>
<repository>
Added: branches/jsf2.0/tests/ajax/pom.xml
===================================================================
--- branches/jsf2.0/tests/ajax/pom.xml (rev 0)
+++ branches/jsf2.0/tests/ajax/pom.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>tests</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.tests</groupId>
+ <artifactId>ajax</artifactId>
+ <packaging>war</packaging>
+ <name>ajax Maven Webapp</name>
+ <version>4.0.0-SNAPSHOT</version>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/main/webapp</directory>
+ </testResource>
+ </testResources>
+ <finalName>ajax</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <executions>
+ <execution>
+ <id>firefox</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>browser</name>
+ <value>firefox3</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>ie</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>browser</name>
+ <value>ie7</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ </dependencies>
+</project>
\ No newline at end of file
Property changes on: branches/jsf2.0/tests/ajax/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/Bean.java
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/Bean.java (rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/Bean.java 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,195 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can obtain
+ * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package declarativeajax;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIForm;
+import javax.faces.component.UIInput;
+import javax.faces.component.UIOutput;
+import javax.faces.component.UIPanel;
+import javax.faces.component.UISelectMany;
+import javax.faces.component.html.HtmlInputText;
+import javax.faces.component.html.HtmlSelectOneMenu;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.model.SelectItem;
+import javax.faces.model.ManagedBean;
+import javax.faces.model.SessionScoped;
+
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * <p>This bean has the methods that are used to illustrate
+ * the <code>JSF 2.0 declarative ajax</code>. * <p/>
+ *
+ */
+
+@ManagedBean(name="bean")
+@SessionScoped
+public class Bean {
+
+ private static final Logger LOGGER = Logger.getLogger("declarativeajax");
+
+ //
+ // Relationship Instance Variables
+ //
+
+ private Map<String,String> stateMap = null;
+
+ private List stateOptions = null;
+
+ //
+ // Constructors
+ //
+
+ public Bean() {
+ stateMap = new HashMap<String,String>();
+ stateMap.put("CA", "California");
+ stateMap.put("CT", "Connecticut");
+ stateMap.put("MA", "Massachusetts");
+ stateMap.put("NJ", "New Jersey");
+ stateMap.put("NY", "New York");
+
+ stateOptions = new ArrayList();
+ stateOptions.add(new SelectItem("CA","CA","CA"));
+ stateOptions.add(new SelectItem("CT","CT","CT"));
+ stateOptions.add(new SelectItem("MA","MA","MA"));
+ stateOptions.add(new SelectItem("NJ","NJ","NJ"));
+ stateOptions.add(new SelectItem("NY","NY","NY"));
+
+ }
+
+ public Collection getStateOptions() {
+ return stateOptions;
+ }
+
+
+ public void setStateOptions(Collection newOptions) {
+ stateOptions = new ArrayList(newOptions);
+ }
+
+ public void beanAction(ActionEvent event) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIForm form = (UIForm)context.getViewRoot().findComponent("form1");
+ UIInput name = (UIInput)form.findComponent("name");
+ name.setValue("");
+ UIInput address = (UIInput)form.findComponent("address");
+ address.setValue("");
+ UIInput city = (UIInput)form.findComponent("city");
+ city.setValue("");
+ UIInput zip = (UIInput)form.findComponent("zip");
+ zip.setValue("");
+ }
+
+ public void displayState(ValueChangeEvent event) {
+ String state = (String)((HtmlSelectOneMenu)event.getComponent()).getValue();
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIForm form = (UIForm)context.getViewRoot().findComponent("form1");
+ UIOutput output = (UIOutput)form.findComponent("stateout");
+ output.setValue((String)stateMap.get(state));
+ }
+
+ public void displayText(ValueChangeEvent event) {
+ String text = (String)((UIInput)event.getComponent()).getValue();
+ String label = (String)((UIInput)event.getComponent()).getAttributes().get("label");
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIForm form = (UIForm)context.getViewRoot().findComponent("form1");
+ UIOutput output = null;
+ if ((label!=null)&&label.equals("Name")) {
+ output = (UIOutput)form.findComponent("nameout");
+ output.setValue("You entered: "+text);
+ } else if ((label!=null)&&label.equals("Address")) {
+ output = (UIOutput)form.findComponent("addressout");
+ output.setValue("You entered: "+text);
+ } else if ((label!=null)&&label.equals("City")) {
+ output = (UIOutput)form.findComponent("cityout");
+ output.setValue("You entered: "+text);
+ } else if ((label!=null)&&label.equals("Zip")) {
+ output = (UIOutput)form.findComponent("zipout");
+ output.setValue("You entered: "+text);
+ }
+ }
+
+ public void displayRadio(ValueChangeEvent event) {
+ String text = (String)((UIInput)event.getComponent()).getValue();
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIForm form = (UIForm)context.getViewRoot().findComponent("form1");
+ UIOutput output = null;
+ if (text.equals("Java")) {
+ output = (UIOutput)form.findComponent("softwareLang");
+ output.setValue("Great choice!");
+ } else if (text.equals("C#")) {
+ output = (UIOutput)form.findComponent("softwareLang");
+ output.setValue("Pretty similar to Java..");
+ } else if (text.equals("C++")) {
+ output = (UIOutput)form.findComponent("softwareLang");
+ output.setValue("Great lower level OO language..");
+ } else if (text.equals("C")) {
+ output = (UIOutput)form.findComponent("softwareLang");
+ output.setValue("When you need a nice device driver...");
+ }
+ }
+
+ public void displayList(ValueChangeEvent event) {
+ String text = (String)((UIInput)event.getComponent()).getValue();
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIForm form = (UIForm)context.getViewRoot().findComponent("form1");
+ UIOutput output = null;
+ if (text.equals("10")) {
+ output = (UIOutput)form.findComponent("out1");
+ output.setValue("Really?");
+ } else if (text.equals("8")) {
+ output = (UIOutput)form.findComponent("out1");
+ output.setValue("Are you sure?");
+ } else if (text.equals("all")) {
+ output = (UIOutput)form.findComponent("out1");
+ output.setValue("Correct!");
+ }
+ }
+
+}
Property changes on: branches/jsf2.0/tests/ajax/src/main/java/declarativeajax/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/MANIFEST.MF 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
+ version="1.2">
+
+</faces-config>
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" >
+</web-app>
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/home.xhtml
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/home.xhtml (rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/home.xhtml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,155 @@
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html"/>
+
+<h:head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>Ajax Request</title>
+</h:head>
+
+<h:body>
+
+<!-- Ajaxify Individual Controls -->
+
+ <h:form id="form1" >
+ <h:panelGrid styleClass="title-panel">
+ <h:outputText value="D e c l a r a t i v e A j a x " styleClass="title-panel-text"/>
+ <h:outputText value="Powered By JavaServer Faces 2.0 " styleClass="title-panel-subtext"/>
+ </h:panelGrid>
+ <h:panelGrid border="1">
+ <h:panelGrid columns="3" >
+ <h:outputText value=""/>
+ <h:outputText value="Panel1 : Ajaxify Individual Controls"/>
+ <h:outputText value=""/>
+ </h:panelGrid>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name: "/>
+ <h:inputText id="name" required="true" label="Name" valueChangeListener="#{bean.displayText}">
+ <f:ajax />
+ </h:inputText>
+ <h:outputText id="nameout"/>
+ <h:outputText value="Address: "/>
+ <h:inputText id="address" required="true" label="Address" valueChangeListener="#{bean.displayText}">
+ <f:ajax />
+ </h:inputText>
+ <h:outputText id="addressout"/>
+ <h:outputText value="City: "/>
+ <h:inputText id="city" required="true" label="City" valueChangeListener="#{bean.displayText}">
+ <f:ajax />
+ </h:inputText>
+ <h:outputText id="cityout"/>
+ <h:outputText value="State: "/>
+ <h:selectOneMenu id="state" valueChangeListener="#{bean.displayState}">
+ <f:selectItems value="#{bean.stateOptions}" />
+ <f:ajax render="form1:stateout"/>
+ </h:selectOneMenu>
+ <h:outputText id="stateout" />
+ <h:outputText value="Zip: "/>
+ <h:inputText id="zip" required="true" label="Zip" valueChangeListener="#{bean.displayText}">
+ <f:ajax />
+ </h:inputText>
+ <h:outputText id="zipout"/>
+ <h:panelGrid>
+ <h:commandButton value="Submit">
+ <f:ajax />
+ </h:commandButton>
+ </h:panelGrid>
+ </h:panelGrid>
+ <h:panelGrid id="msgPanel">
+ <h:message for="form1:name"/>
+ <h:message for="form1:address"/>
+ <h:message for="form1:city"/>
+ <h:message for="form1:state"/>
+ <h:message for="form1:zip"/>
+ </h:panelGrid>
+ </h:panelGrid>
+
+<!-- Ajaxify Panel -->
+
+ <h:panelGrid border="1">
+ <f:ajax/>
+ <h:panelGrid columns="3" >
+ <h:outputText value=""/>
+ <h:outputText value="Panel2 : Ajaxify Panel"/>
+ <h:outputText value=""/>
+ </h:panelGrid>
+ <h:panelGrid columns="3">
+ <h:outputText value="Favorite programming language?"/>
+ <h:selectOneRadio layout="lineDirection" valueChangeListener="#{bean.displayRadio}">
+ <f:selectItem itemValue="Java" itemLabel="Java"/>
+ <f:selectItem itemValue="C#" itemLabel="C#"/>
+ <f:selectItem itemValue="C++" itemLabel="C++"/>
+ <f:selectItem itemValue="C" itemLabel="C"/>
+ </h:selectOneRadio>
+ <h:outputText id="softwareLang" />
+ </h:panelGrid>
+ <h:panelGrid columns="3">
+ <f:ajax/>
+ <h:outputText value="Some months have 30 days. Some have 31 days. How many months have 28 days?"/>
+ <h:selectOneListbox valueChangeListener="#{bean.displayList}">
+ <f:selectItem itemValue="10" itemLabel="10" />
+ <f:selectItem itemValue="8" itemLabel="8" />
+ <f:selectItem itemValue="all" itemLabel="All of them" />
+ </h:selectOneListbox>
+ <h:outputText id="out1"/>
+ </h:panelGrid>
+ </h:panelGrid>
+
+ <h:panelGrid border="1">
+ <h:panelGrid columns="3" >
+ <h:outputText value=""/>
+ <h:outputText value="Panel2 : Manipulate Other Components"/>
+ <h:outputText value=""/>
+ </h:panelGrid>
+ <h:panelGrid columns="1">
+ <h:commandButton value="Reset Text Fields" actionListener="#{bean.beanAction}">
+ <f:ajax execute="form1:name form1:address form1:city form1:zip"
+ render="form1:name form1:address form1:city form1:zip form1:msgPanel"/>
+ </h:commandButton>
+ </h:panelGrid>
+ </h:panelGrid>
+
+ <h:outputStylesheet name="stylesheet.css" />
+ </h:form>
+
+</h:body>
+
+</html>
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/home.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/index.jsp
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/index.jsp (rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/index.jsp 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/index.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/main/webapp/resources/anim-star-bkgrnd.gif
===================================================================
(Binary files differ)
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/resources/anim-star-bkgrnd.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/jsf2.0/tests/ajax/src/main/webapp/resources/stylesheet.css
===================================================================
--- branches/jsf2.0/tests/ajax/src/main/webapp/resources/stylesheet.css (rev 0)
+++ branches/jsf2.0/tests/ajax/src/main/webapp/resources/stylesheet.css 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,243 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can obtain
+ * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+.title-panel {
+ background-image: url(anim-star-bkgrnd.gif.jsf);
+ height: 80px;
+ width: 1380;
+}
+
+.title-panel-text {
+ color: white;
+ font-family: 'Georgia','Times New Roman','times',serif;
+ font-size: 24px;
+ font-weight: bold;
+}
+
+.title-panel-subtext {
+ color: white;
+ font-family: 'Georgia','Times New Roman','times',serif;
+ font-size: 14px;
+ font-style: italic
+}
+
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+td {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+th {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+.bodystyle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+.small {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9px;
+}
+
+.medium {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+.maintitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ color: #330066;
+}
+
+.subtitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ color: #93B629;
+}
+
+.subtitlebig {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ color: #93B629;
+ padding-top: 10;
+ padding-bottom: 10;
+}
+
+.big {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+}
+
+.xbig {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 24px;
+}
+
+.expanded {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ line-height: 24px;
+ letter-spacing: 2px;
+}
+
+.justified {
+ font-family: Arial, Helvetica, sans-serif;
+ text-align: justify;
+}
+
+.footer {
+ font-family: "Times New Roman", Times, serif;
+ font-size: 9px;
+ color: #999999;
+}
+
+.box1 {
+ padding: 3px;
+ border-width: medium;
+ border-style: solid;
+ border-color: #CCCCCC #666666 #666666 #CCCCCC;
+}
+
+.box2 {
+ font-style: italic;
+ word-spacing: 2pt;
+ padding: 3px;
+ border: 1px solid;
+}
+
+.align-left {
+ text-align: left;
+}
+
+.control-panel-border {
+ border: 5px outset red;
+}
+
+.x-button-border {
+ border: 3px outset blue;
+}
+
+.o-button-border {
+ border: 3px outset red;
+}
+
+.win-button-border {
+ border: 3px outset yellow;
+}
+
+.execute {
+ background-color: #bfefff;
+}
+
+.render {
+ border: 3px outset red;
+}
+
+.initial-render {
+ border: 3px outset green;
+}
+
+.execute-render {
+ border: 3px outset red;
+ background-color: #bfefff;
+}
+
+.keytitle {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ color: #330066;
+}
+
+.options-prompt {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ color: blue;
+}
+.options {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ color: red;
+}
+
+
+.panel-border {
+ border: 2px outset blue;
+ background-color: #c1cdcd;
+}
+
+.panel-background {
+ background-color: #7171A5;
+ border: 5px outset #71A5A5;
+ border-collapse: collapse;
+ font-family: sans-serif;
+ font-size: 14pt;
+ padding: 10px;
+}
+
+.package-selected {
+ background-color: #93B629;
+}
+
+.package-unselected {
+ background-color: #C0C0C0;
+}
+
+.option-unselected {
+ background-color: #FFFFFF;
+}
+
+.top-table {
+ padding: 0;
+ border: 0;
+ width: 660px;
+}
+
+.storeFrontCar {
+ padding: 0;
+ border: 0;
+}
+
+.validationMessage {
+ color: red;
+}
Property changes on: branches/jsf2.0/tests/ajax/src/main/webapp/resources/stylesheet.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java
===================================================================
--- branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java (rev 0)
+++ branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,50 @@
+/**
+ *
+ */
+package org.richfaces.test;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class SimpleAjaxTest extends AbstractFacesTest {
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @Override
+ protected void setupWebContent() {
+ facesServer.addResource("/WEB-INF/faces-config.xml", "/WEB-INF/faces-config.xml");
+ facesServer.addResource("/index.jsp", "/index.jsp");
+ facesServer.addResource("/home.xhtml", "/home.xhtml");
+ facesServer.addResource("/resources/stylesheet.css", "/resources/stylesheet.css");
+ facesServer.addResource("/resources/anim-star-bkgrnd.gif", "/resources/anim-star-bkgrnd.gif");
+ }
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ @Test
+ public void testRequest() throws Exception {
+ WebClient webClient = new LocalWebClient(facesServer);
+ HtmlPage page = webClient.getPage("http://localhost/hello.jsf");
+ System.out.println(page.asXml());
+
+ }
+}
Property changes on: branches/jsf2.0/tests/ajax/src/test/java/org/richfaces/test/SimpleAjaxTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/jsf2.0/tests/pom.xml
===================================================================
--- branches/jsf2.0/tests/pom.xml (rev 0)
+++ branches/jsf2.0/tests/pom.xml 2008-11-13 00:58:34 UTC (rev 11126)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>root</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>tests</artifactId>
+ <packaging>pom</packaging>
+ <name>RichFaces test projects</name>
+ <url>http://labs.jboss.com/jbossrichfaces/tests</url>
+ <properties>
+ <!-- -->
+ </properties>
+ <!-- Profile to run jetty, so the tomcat jars are included in the bundle. They are not included by default -->
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-source</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <index>true</index>
+ <manifest>
+ <addDefaultSpecificationEntries>
+ true
+ </addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries>
+ true
+ </addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <mode>development</mode>
+ <Build-Number>${buildNumber}</Build-Number>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>jsf-test</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <modules>
+ <module>ajax</module>
+ </modules>
+</project>
\ No newline at end of file
Property changes on: branches/jsf2.0/tests/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 10 months
JBoss Rich Faces SVN: r11125 - in branches/jsf2.0/framework/jsf-test/src: main/java/org/richfaces/test and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-11-12 15:27:42 -0500 (Wed, 12 Nov 2008)
New Revision: 11125
Added:
branches/jsf2.0/framework/jsf-test/src/main/resources/org/richfaces/test/ajax-web.xml
Removed:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/collections/
branches/jsf2.0/framework/jsf-test/src/main/resources/org/richfaces/test/faces-config.xml
Modified:
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebClient.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingConnection.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/FilterContainer.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServletContainer.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java
branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java
branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java
Log:
Merge trunk changes
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/AbstractFacesTest.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -20,9 +20,13 @@
import javax.faces.lifecycle.Lifecycle;
import javax.faces.lifecycle.LifecycleFactory;
import javax.faces.webapp.FacesServlet;
+import javax.servlet.Filter;
import org.junit.After;
import org.junit.Before;
+import org.richfaces.test.staging.FilterContainer;
+import org.richfaces.test.staging.RequestChain;
+import org.richfaces.test.staging.ServletContainer;
/**
* @author asmirnov
@@ -51,7 +55,7 @@
contextClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(
this.getClass().getClassLoader());
- InputStream stream = FacesServerTest.class
+ InputStream stream = this.getClass()
.getResourceAsStream("logging.properties");
if (null != stream) {
try {
@@ -67,24 +71,23 @@
}
}
facesServer = new StagingServer();
- facesServer.addServlet("*.jsf", new FacesServlet());
- facesServer.addResource("/WEB-INF/web.xml",
- "org/richfaces/test/web.xml");
- facesServer.addResource("/WEB-INF/faces-config.xml",
- "org/richfaces/test/faces-config.xml");
- facesServer.addInitParameter(
- StateManager.STATE_SAVING_METHOD_PARAM_NAME,
- StateManager.STATE_SAVING_METHOD_SERVER);
- facesServer.addInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME,
- ".xhtml");
- facesServer.addInitParameter("com.sun.faces.validateXml", "true");
- facesServer.addInitParameter("com.sun.faces.verifyObjects", "true");
+ setupFacesServlet();
+ setupFacesListener();
+ setupWebContent();
+ facesServer.init();
+ }
+
+ /**
+ *
+ */
+ protected void setupFacesListener() {
EventListener listener = null;
try {
Class<? extends EventListener> listenerClass = contextClassLoader
.loadClass("com.sun.faces.config.ConfigureListener")
.asSubclass(EventListener.class);
listener = listenerClass.newInstance();
+ setupSunFaces();
} catch (ClassNotFoundException e) {
// No JSF RI listener
Class<? extends EventListener> listenerClass;
@@ -94,6 +97,7 @@
"org.apache.myfaces.webapp.StartupServletContextListener")
.asSubclass(EventListener.class);
listener = listenerClass.newInstance();
+ setupMyFaces();
} catch (ClassNotFoundException e1) {
throw new TestException("No JSF listeners have been found", e1);
} catch (Exception e2) {
@@ -103,11 +107,51 @@
throw new TestException("Error instantiate JSF RI listener", e);
}
facesServer.addWebListener(listener);
- setupWebContent(facesServer);
- facesServer.init();
}
- protected void setupWebContent(StagingServer facesServer){
+ /**
+ * @throws InstantiationException
+ * @throws IllegalAccessException
+ */
+ protected void setupFacesServlet() {
+ ServletContainer facesServletContainer = new ServletContainer("*.jsf", new FacesServlet());
+ facesServletContainer.setName("Faces Servlet");
+ try {
+ // Check for an ajax4jsf filter.
+ Class<? extends Filter> ajaxFilterClass = contextClassLoader
+ .loadClass("org.ajax4jsf.Filter")
+ .asSubclass(Filter.class);
+ Filter ajaxFilter = ajaxFilterClass.newInstance();
+ FilterContainer filterContainer = new FilterContainer(ajaxFilter,facesServletContainer);
+ filterContainer.setName("ajax4jsf");
+ facesServer.addResource("/WEB-INF/web.xml",
+ "org/richfaces/test/ajax-web.xml");
+ facesServer.addServlet(filterContainer);
+ } catch (ClassNotFoundException e) {
+ // No Richfaces filter, uses servlet directly.
+ facesServer.addResource("/WEB-INF/web.xml",
+ "org/richfaces/test/web.xml");
+ facesServer.addServlet(facesServletContainer);
+ } catch (Exception e) {
+ throw new TestException(e);
+ }
+ facesServer.addInitParameter(
+ StateManager.STATE_SAVING_METHOD_PARAM_NAME,
+ StateManager.STATE_SAVING_METHOD_SERVER);
+ facesServer.addInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME,
+ ".xhtml");
+ }
+
+ protected void setupMyFaces() {
+ // Do nothing by default.
+ }
+
+ protected void setupSunFaces() {
+ facesServer.addInitParameter("com.sun.faces.validateXml", "true");
+ facesServer.addInitParameter("com.sun.faces.verifyObjects", "true");
+ }
+
+ protected void setupWebContent(){
}
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebClient.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebClient.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebClient.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -4,6 +4,7 @@
package org.richfaces.test;
import com.gargoylesoftware.htmlunit.BrowserVersion;
+import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.WebConnection;
@@ -24,6 +25,7 @@
public LocalWebClient(StagingServer server) {
super();
this.server = server;
+ setAjaxController(new NicelyResynchronizingAjaxController());
}
/**
@@ -32,6 +34,7 @@
public LocalWebClient(StagingServer server,BrowserVersion browserVersion) {
super(browserVersion);
this.server = server;
+ setAjaxController(new NicelyResynchronizingAjaxController());
}
/**
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -8,7 +8,9 @@
import javax.servlet.ServletException;
import org.apache.commons.httpclient.NameValuePair;
+import org.richfaces.test.staging.StagingHttpRequest;
+import com.gargoylesoftware.htmlunit.FormEncodingType;
import com.gargoylesoftware.htmlunit.WebConnection;
import com.gargoylesoftware.htmlunit.WebRequestSettings;
import com.gargoylesoftware.htmlunit.WebResponse;
@@ -29,6 +31,18 @@
for (NameValuePair param : settings.getRequestParameters()) {
connection.addRequestParameter(param.getName(), param.getValue());
}
+ HttpMethod httpMethod = HttpMethod.valueOf(settings.getHttpMethod().toString());
+ connection.setMethod(httpMethod);
+ StagingHttpRequest request = connection.getRequest();
+ request.setCharacterEncoding(settings.getCharset());
+ String body = settings.getRequestBody();
+ String contentType = settings.getEncodingType().getName();
+ request.setRequestBody(body);
+ request.setContentType(contentType);
+ request.addHeaders(settings.getAdditionalHeaders());
+ if(null != body && FormEncodingType.URL_ENCODED.getName().equals(contentType)){
+ connection.parseFormParameters(body);
+ }
try {
connection.execute();
} catch (ServletException e) {
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -8,8 +8,10 @@
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Map.Entry;
import org.apache.commons.httpclient.NameValuePair;
@@ -75,7 +77,12 @@
}
public List<NameValuePair> getResponseHeaders() {
- // TODO Auto-generated method stub
- return Collections.emptyList();
+ ArrayList<NameValuePair> headers = new ArrayList<NameValuePair>(10);
+ for (Entry<String, String[]> entry : serverConnection.getResponse().getHeaders().entrySet()) {
+ for (String value : entry.getValue()) {
+ headers.add(new NameValuePair(entry.getKey(),value));
+ }
+ };
+ return headers;
}
}
\ No newline at end of file
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingConnection.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingConnection.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingConnection.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -4,15 +4,18 @@
package org.richfaces.test;
import java.io.IOException;
+import java.io.InvalidClassException;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.logging.Logger;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
@@ -40,6 +43,8 @@
*/
public class StagingConnection {
+ private static final Logger log = ServerLogger.SERVER.getLogger();
+
private final StagingServer server;
final URL url;
@@ -63,7 +68,7 @@
private final String servletPath;
private boolean finished = false;
-
+
private boolean started = false;
private String queryString;
@@ -84,22 +89,37 @@
this.pathInfo);
this.request.setAttribute("javax.servlet.include.servlet_path",
this.servletPath);
- queryString = url.getQuery();
- if (null != queryString) {
- String[] queryParams = queryString.split("&");
- for (int i = 0; i < queryParams.length; i++) {
- String par = queryParams[i];
- int eqIndex = par.indexOf('=');
- if(eqIndex>=0){
- addRequestParameter(par.substring(0, eqIndex), par.substring(eqIndex+1));
- } else {
- addRequestParameter(par, null);
- }
- }
- }
+ setQueryString(url.getQuery());
+ if (null != getQueryString()) {
+ parseFormParameters(queryString);
+ }
}
+ public void parseFormParameters(String queryString) {
+ String[] queryParams = queryString.split("&");
+ for (int i = 0; i < queryParams.length; i++) {
+ try {
+ String par = queryParams[i];
+ int eqIndex = par.indexOf('=');
+ if (eqIndex >= 0) {
+ // TODO - decode url-decoded values.
+ String name = URLDecoder.decode(par.substring(0, eqIndex),
+ request.getCharacterEncoding());
+ String value = URLDecoder.decode(
+ par.substring(eqIndex + 1), request
+ .getCharacterEncoding());
+ addRequestParameter(name, value);
+ } else {
+ addRequestParameter(URLDecoder.decode(par, request
+ .getCharacterEncoding()), null);
+ }
+ } catch (UnsupportedEncodingException e) {
+ throw new TestException(e);
+ }
+ }
+ }
+
/**
* @return the finished
*/
@@ -114,8 +134,6 @@
return started;
}
-
-
private void checkStarted() {
if (!isFinished()) {
throw new IllegalStateException("request have not been started");
@@ -124,7 +142,8 @@
public void execute() throws ServletException, IOException {
if (isStarted() || isFinished()) {
- throw new IllegalStateException("request have already been executed");
+ throw new IllegalStateException(
+ "request have already been executed");
}
start();
this.servlet.execute(request, response);
@@ -137,6 +156,9 @@
}
public void start() {
+ log.fine("start " + getMethod() + " request processing for file "
+ + url.getFile());
+ log.fine("request parameters: " + requestParameters);
server.requestStarted(request);
started = true;
}
@@ -348,21 +370,21 @@
public HttpSession getSession(boolean create) {
return server.getSession(create);
}
-
+
@Override
public RequestDispatcher getRequestDispatcher(String path) {
RequestDispatcher dispatcher = null;
- if(!path.startsWith("/")){
+ if (!path.startsWith("/")) {
try {
- URL absoluteUrl = new URL(url,path);
+ URL absoluteUrl = new URL(url, path);
path = absoluteUrl.getFile();
} catch (MalformedURLException e) {
return null;
}
}
final RequestChain dispatchedServlet = server.getServlet(path);
- if(null != dispatchedServlet){
- dispatcher = new RequestDispatcher(){
+ if (null != dispatchedServlet) {
+ dispatcher = new RequestDispatcher() {
public void forward(ServletRequest request,
ServletResponse response) throws ServletException,
@@ -376,7 +398,7 @@
IOException {
dispatchedServlet.execute(request, response);
}
-
+
};
}
return dispatcher;
@@ -384,20 +406,20 @@
@Override
protected void attributeAdded(String name, Object o) {
- server.requestAttributeAdded(this,name,o);
-
+ server.requestAttributeAdded(this, name, o);
+
}
@Override
protected void attributeRemoved(String name, Object removed) {
- server.requestAttributeRemoved(this,name,removed);
-
+ server.requestAttributeRemoved(this, name, removed);
+
}
@Override
protected void attributeReplaced(String name, Object o) {
- server.requestAttributeReplaced(this,name,o);
-
+ server.requestAttributeReplaced(this, name, o);
+
}
}
@@ -437,4 +459,19 @@
return response.getErrorMessage();
}
+ /**
+ * @param queryString
+ * the queryString to set
+ */
+ public void setQueryString(String queryString) {
+ this.queryString = queryString;
+ }
+
+ /**
+ * @return the queryString
+ */
+ public String getQueryString() {
+ return queryString;
+ }
+
}
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -31,11 +31,10 @@
import org.richfaces.test.staging.ServerResource;
import org.richfaces.test.staging.ServerResourcePath;
import org.richfaces.test.staging.ServerResourcesDirectory;
-import org.richfaces.test.staging.RequestChain;
import org.richfaces.test.staging.ServletContainer;
-import org.richfaces.test.staging.StaticServlet;
import org.richfaces.test.staging.StagingHttpSession;
import org.richfaces.test.staging.StagingServletContext;
+import org.richfaces.test.staging.StaticServlet;
/**
@@ -200,7 +199,7 @@
return getSession(true);
}
- public HttpSession getSession(boolean create){
+ public synchronized HttpSession getSession(boolean create){
if(null == this.session && create){
this.session = new ServerHttpSession();
// inform session listeners.
@@ -262,6 +261,7 @@
}
});
session.destroy();
+ session = null;
}
// Inform listeners
final ServletContextEvent event = new ServletContextEvent(context);
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/FilterContainer.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/FilterContainer.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/FilterContainer.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -15,15 +15,17 @@
import javax.servlet.ServletResponse;
public class FilterContainer implements RequestChain {
-
+
private final Filter filter;
-
+
private final RequestChain next;
-
- private String name = "Default";
+ private String name = "Default";
+
private final Map<String, String> initParameters;
+ private boolean initialized = false;
+
/**
* @param filter
* @param next
@@ -34,23 +36,31 @@
this.initParameters = new HashMap<String, String>();
}
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
public void execute(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
- FilterChain chain = new FilterChain(){
+ FilterChain chain = new FilterChain() {
public void doFilter(ServletRequest request,
ServletResponse response) throws IOException,
ServletException {
next.execute(request, response);
-
+
}
-
+
};
filter.doFilter(request, response, chain);
-
+
}
-
- public void addInitParameter(String name, String value){
+
+ public void addInitParameter(String name, String value) {
initParameters.put(name, value);
}
@@ -59,32 +69,39 @@
}
public void destroy() {
- next.destroy();
- filter.destroy();
+ if (initialized) {
+ next.destroy();
+ filter.destroy();
+ initialized = false;
+ }
}
- public void init(final StagingServletContext context) throws ServletException {
- filter.init(new FilterConfig(){
+ public void init(final StagingServletContext context)
+ throws ServletException {
+ if (!initialized) {
+ filter.init(new FilterConfig() {
- public String getFilterName() {
- return name;
- }
+ public String getFilterName() {
+ return name;
+ }
- public String getInitParameter(String name) {
- return initParameters.get(name);
- }
+ public String getInitParameter(String name) {
+ return initParameters.get(name);
+ }
- @SuppressWarnings("unchecked")
- public Enumeration getInitParameterNames() {
- return Collections.enumeration(initParameters.keySet());
- }
+ @SuppressWarnings("unchecked")
+ public Enumeration getInitParameterNames() {
+ return Collections.enumeration(initParameters.keySet());
+ }
- public ServletContext getServletContext() {
- return context;
- }
-
- });
- next.init(context);
+ public ServletContext getServletContext() {
+ return context;
+ }
+
+ });
+ next.init(context);
+ initialized = true;
+ }
}
public String getPathInfo(String path) {
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServletContainer.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServletContainer.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/ServletContainer.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -19,31 +19,32 @@
import org.richfaces.test.ServerLogger;
-
/**
* @author asmirnov
- *
+ *
*/
public class ServletContainer implements RequestChain {
-
+
private static final Logger log = ServerLogger.SERVER.getLogger();
-
+
private final Servlet servlet;
-
+
private final boolean prefixMapped;
-
+
private final String mapping;
-
+
private final Map<String, String> initParameters;
-
+
private String name = "Default";
+ private boolean initialized = false;
+
/**
* @param mapping
* @param servlet
*/
public ServletContainer(String mapping, Servlet servlet) {
- if(null == mapping){
+ if (null == mapping) {
this.prefixMapped = true;
this.mapping = "";
} else if (mapping.startsWith("*")) {
@@ -51,18 +52,18 @@
this.mapping = mapping.substring(1);
} else if (mapping.endsWith("*")) {
this.prefixMapped = true;
- this.mapping = mapping.substring(0,mapping.length()-1);
+ this.mapping = mapping.substring(0, mapping.length() - 1);
} else {
- throw new IllegalArgumentException("Invalid mapping "+mapping);
+ throw new IllegalArgumentException("Invalid mapping " + mapping);
}
this.servlet = servlet;
this.initParameters = new HashMap<String, String>();
}
-
-
- public void addInitParameter(String name, String value){
+
+ public void addInitParameter(String name, String value) {
initParameters.put(name, value);
}
+
/**
* @return the name
*/
@@ -71,80 +72,96 @@
}
/**
- * @param name the name to set
+ * @param name
+ * the name to set
*/
public void setName(String name) {
this.name = name;
}
- /* (non-Javadoc)
- * @see org.richfaces.test.staging.RequestChain#isApplicable(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.richfaces.test.staging.RequestChain#isApplicable(java.lang.String)
*/
public boolean isApplicable(String path) {
- if(prefixMapped && path.startsWith(mapping)){
+ if (prefixMapped && path.startsWith(mapping)) {
return true;
- } else if(!prefixMapped && path.endsWith(mapping)){
+ } else if (!prefixMapped && path.endsWith(mapping)) {
return true;
} else {
return false;
}
}
- public String getServletPath(String path){
+ public String getServletPath(String path) {
if (!isApplicable(path)) {
return null;
}
- if(prefixMapped){
+ if (prefixMapped) {
return mapping;
} else {
return path;
}
}
-
+
public String getPathInfo(String path) {
if (!isApplicable(path)) {
return null;
}
- if(prefixMapped){
+ if (prefixMapped) {
return path.substring(mapping.length());
} else {
return null;
}
-
+
}
-
- public void init(final StagingServletContext context) throws ServletException {
- servlet.init(new ServletConfig(){
- public String getInitParameter(String name) {
- return initParameters.get(name);
- }
+ public void init(final StagingServletContext context)
+ throws ServletException {
+ if (!initialized) {
+ servlet.init(new ServletConfig() {
- @SuppressWarnings("unchecked")
- public Enumeration getInitParameterNames() {
- return Collections.enumeration(initParameters.keySet());
- }
+ public String getInitParameter(String name) {
+ return initParameters.get(name);
+ }
- public ServletContext getServletContext() {
- return context;
- }
+ @SuppressWarnings("unchecked")
+ public Enumeration getInitParameterNames() {
+ return Collections.enumeration(initParameters.keySet());
+ }
- public String getServletName() {
- return name;
- }
-
- });
+ public ServletContext getServletContext() {
+ return context;
+ }
+
+ public String getServletName() {
+ return name;
+ }
+
+ });
+ initialized = true;
+ }
}
- /* (non-Javadoc)
- * @see org.richfaces.test.staging.RequestChain#execute(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.richfaces.test.staging.RequestChain#execute(javax.servlet.ServletRequest
+ * , javax.servlet.ServletResponse)
*/
- public void execute(ServletRequest request, ServletResponse response) throws ServletException, IOException {
+ public void execute(ServletRequest request, ServletResponse response)
+ throws ServletException, IOException {
this.servlet.service(request, response);
-
+
}
public void destroy() {
- this.servlet.destroy();
+ if (initialized) {
+ this.servlet.destroy();
+ initialized = false;
+ }
}
}
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -4,28 +4,28 @@
package org.richfaces.test.staging;
import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
+import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
+import java.util.Set;
import java.util.logging.Logger;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletInputStream;
-import javax.servlet.ServletRequestListener;
-import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import org.richfaces.collections.collect.ImmutableCollection;
-import org.richfaces.collections.collect.ImmutableList;
-import org.richfaces.collections.collect.Multimap;
-import org.richfaces.collections.collect.Multimaps;
import org.richfaces.test.ServerLogger;
/**
@@ -41,8 +41,34 @@
public static final String LOCALHOST_IP = "127.0.0.1";
public static final String UTF8 = "UTF-8";
-
+ private String requestBody = null;
+ private String contentType;
+
+ private Map<String, Object> attributes = new HashMap<String, Object>();
+
+ private Map<String, String> headers = new HashMap<String, String>();
+
+ private Collection<Locale> locales = Arrays.asList(Locale.US,
+ Locale.GERMANY);
+
+ private String characterEncoding = UTF8;
+
+ /**
+ * @return the requestBody
+ */
+ public String getRequestBody() {
+ return requestBody;
+ }
+
+ /**
+ * @param requestBody
+ * the requestBody to set
+ */
+ public void setRequestBody(String requestBody) {
+ this.requestBody = requestBody;
+ }
+
/*
* (non-Javadoc)
*
@@ -63,7 +89,6 @@
return StagingServletContext.CONTEXT_PATH;
}
-
/*
* (non-Javadoc)
*
@@ -71,8 +96,14 @@
* javax.servlet.http.HttpServletRequest#getDateHeader(java.lang.String)
*/
public long getDateHeader(String name) {
- // TODO create headers support
- log.info("unimplemented request method getDateHeader");
+ String value = headers.get(name);
+ if(null != value){
+ try {
+ return DateFormat.getDateInstance(DateFormat.FULL, getLocale()).parse(value).getTime();
+ } catch (ParseException e) {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
return -1;
}
@@ -82,9 +113,7 @@
* @see javax.servlet.http.HttpServletRequest#getHeader(java.lang.String)
*/
public String getHeader(String name) {
- // TODO create headers support
- log.info("unimplemented request method getHeader");
- return null;
+ return headers.get(name);
}
/*
@@ -94,9 +123,7 @@
*/
@SuppressWarnings("unchecked")
public Enumeration getHeaderNames() {
- // TODO create headers support
- log.info("unimplemented request method getHeaderNames");
- return null;
+ return Collections.enumeration(headers.keySet());
}
/*
@@ -106,9 +133,15 @@
*/
@SuppressWarnings("unchecked")
public Enumeration getHeaders(String name) {
- // TODO create headers support
- log.info("unimplemented request method getHeaders");
- return Collections.enumeration(Collections.EMPTY_LIST);
+ Set<String> values;
+ String value = headers.get(name);
+ if (null != value) {
+ values = Collections.singleton(value);
+
+ } else {
+ values = Collections.emptySet();
+ }
+ return Collections.enumeration(values);
}
/*
@@ -117,11 +150,21 @@
* @see javax.servlet.http.HttpServletRequest#getIntHeader(java.lang.String)
*/
public int getIntHeader(String name) {
- // TODO create headers support
- log.info("unimplemented request method getIntHeader");
+ String value = headers.get(name);
+ if(null != value){
+ return Integer.parseInt(value);
+ }
return -1;
}
+ public void addHeader(String name, String value) {
+ headers.put(name, value);
+ }
+
+ public void addHeaders(Map<String, String> headers) {
+ this.headers.putAll(headers);
+ }
+
/*
* (non-Javadoc)
*
@@ -132,7 +175,6 @@
return null;
}
-
/*
* (non-Javadoc)
*
@@ -144,7 +186,6 @@
return null;
}
-
/*
* (non-Javadoc)
*
@@ -165,8 +206,6 @@
return StagingHttpSession.SESSION_ID;
}
-
-
/*
* (non-Javadoc)
*
@@ -228,8 +267,6 @@
return false;
}
- private Map<String, Object> attributes = new HashMap<String, Object>();
-
/*
* (non-Javadoc)
*
@@ -255,7 +292,7 @@
* @see javax.servlet.ServletRequest#getCharacterEncoding()
*/
public String getCharacterEncoding() {
- return UTF8;
+ return characterEncoding;
}
/*
@@ -264,7 +301,8 @@
* @see javax.servlet.ServletRequest#getContentLength()
*/
public int getContentLength() {
- return -1;
+ String body = getRequestBody();
+ return null == body ? -1 : body.length();
}
/*
@@ -273,18 +311,36 @@
* @see javax.servlet.ServletRequest#getContentType()
*/
public String getContentType() {
- log.info("unimplemented request method getContentType");
- return null;
+ return contentType;
}
+ /**
+ * @param contentType
+ * the contentType to set
+ */
+ public void setContentType(String contentType) {
+ this.contentType = contentType;
+ }
+
/*
* (non-Javadoc)
*
* @see javax.servlet.ServletRequest#getInputStream()
*/
public ServletInputStream getInputStream() throws IOException {
- // TODO implement post stream.
- log.info("unimplemented request method getInputStream");
+ String body = getRequestBody();
+ if(null != body){
+ final ByteArrayInputStream input = new ByteArrayInputStream(body.getBytes(getCharacterEncoding()));
+ return new ServletInputStream(){
+
+ @Override
+ public int read() throws IOException {
+ // TODO Auto-generated method stub
+ return input.read();
+ }
+
+ };
+ }
return null;
}
@@ -324,9 +380,6 @@
return Locale.US;
}
- private final ImmutableCollection<Locale> locales = ImmutableList.of(
- Locale.US, Locale.GERMANY);
-
/*
* (non-Javadoc)
*
@@ -337,8 +390,6 @@
return Collections.enumeration(locales);
}
- private String characterEncoding;
-
/*
* (non-Javadoc)
*
@@ -354,8 +405,10 @@
* @see javax.servlet.ServletRequest#getReader()
*/
public BufferedReader getReader() throws IOException {
- // TODO implements request buffer.
- log.info("unimplemented request method getReader");
+ String body = getRequestBody();
+ if(null != body){
+ return new BufferedReader(new StringReader(body));
+ }
return null;
}
@@ -450,8 +503,8 @@
public void removeAttribute(String name) {
// TODO - inform listeners
Object removed = attributes.remove(name);
- if(null != removed){
- attributeRemoved(name,removed);
+ if (null != removed) {
+ attributeRemoved(name, removed);
}
}
@@ -464,14 +517,14 @@
* java.lang.Object)
*/
public void setAttribute(String name, Object o) {
- if(null == o){
+ if (null == o) {
removeAttribute(name);
} else {
Object oldValue = attributes.put(name, o);
- if(null != oldValue){
- attributeReplaced(name,o);
+ if (null != oldValue) {
+ attributeReplaced(name, o);
} else {
- attributeAdded(name,o);
+ attributeAdded(name, o);
}
}
@@ -488,7 +541,7 @@
*/
public void setCharacterEncoding(String env)
throws UnsupportedEncodingException {
- this.characterEncoding=env;
+ this.characterEncoding = env;
}
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -7,9 +7,13 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.text.DateFormat;
import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.logging.Logger;
import javax.servlet.ServletOutputStream;
@@ -17,6 +21,7 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.httpclient.HttpStatus;
+import org.junit.internal.matchers.SubstringMatcher;
import org.richfaces.test.ServerLogger;
/**
@@ -52,6 +57,16 @@
private String encoding = StagingHttpRequest.UTF8;
+ private final Map<String, String[]> headers= new HashMap<String, String[]>();
+
+
+ /**
+ * @return the headers
+ */
+ public Map<String, String[]> getHeaders() {
+ return headers;
+ }
+
/*
* (non-Javadoc)
*
@@ -60,9 +75,8 @@
* long)
*/
public void addDateHeader(String name, long date) {
- log.info("unimplemented response method addDateHeader");
- // TODO Auto-generated method stub
-
+ // TODO - locale support ?
+ addHeader(name, new Date(date).toString());
}
/*
@@ -72,8 +86,16 @@
* java.lang.String)
*/
public void addHeader(String name, String value) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method addHeader");
+ String[] values = headers.get(name);
+ if (null == values) {
+ values = new String[1];
+ } else {
+ String[] newValues = new String[values.length + 1];
+ System.arraycopy(values, 0, newValues, 0, values.length);
+ values = newValues;
+ }
+ values[values.length - 1] = value;
+ headers.put(name, values);
}
@@ -85,9 +107,7 @@
* int)
*/
public void addIntHeader(String name, int value) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method addIntHeader");
-
+ addHeader(name, String.valueOf(value));
}
/*
@@ -97,9 +117,7 @@
* javax.servlet.http.HttpServletResponse#containsHeader(java.lang.String)
*/
public boolean containsHeader(String name) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method containsHeader");
- return false;
+ return headers.containsKey(name);
}
/*
@@ -181,8 +199,8 @@
* long)
*/
public void setDateHeader(String name, long date) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method setDateHeader");
+ // TODO - locale support ?
+ setHeader(name, new Date(date).toString());
}
/*
@@ -192,8 +210,7 @@
* java.lang.String)
*/
public void setHeader(String name, String value) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method setHeader");
+ headers.put(name, new String[]{value});
}
/*
@@ -204,8 +221,7 @@
* int)
*/
public void setIntHeader(String name, int value) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method setIntHeader");
+ setHeader(name, String.valueOf(value));
}
/*
@@ -399,7 +415,21 @@
* @see javax.servlet.ServletResponse#setContentType(java.lang.String)
*/
public void setContentType(String type) {
- contentType = type;
+ if(null == type){
+ throw new NullPointerException();
+ }
+ int i = type.indexOf(';');
+ if(i>=0){
+ setHeader("Content-Type", type);
+ contentType = type.substring(0, i).trim();
+ i=type.lastIndexOf('=');
+ if(i>=0){
+ setCharacterEncoding(type.substring(i+1).trim());
+ }
+ } else {
+ setHeader("Content-Type", type+";charset="+getCharacterEncoding());
+ contentType = type;
+ }
}
/*
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -9,6 +9,7 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
@@ -26,11 +27,11 @@
public static final String SESSION_ID = "1234567890";
- private final Map<String, Object> attributes = new HashMap<String, Object>();
+ private final Map<String, Object> attributes = new ConcurrentHashMap<String, Object>();
private final long creationTime;
- private int inactiveTime = DEFAULT_INACTIVE_TIME;
+ private volatile int inactiveTime = DEFAULT_INACTIVE_TIME;
private boolean valid;
Modified: branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -13,6 +13,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -36,7 +37,7 @@
public static final String CONTEXT_PATH = "";
private static final String APPLICATION_NAME = "stub";
- private final Map<String, Object> attributes = new HashMap<String, Object>();
+ private final Map<String, Object> attributes = new ConcurrentHashMap<String, Object>();
private Map<String,String> initParameters = new HashMap<String, String>();
/* (non-Javadoc)
Copied: branches/jsf2.0/framework/jsf-test/src/main/resources/org/richfaces/test/ajax-web.xml (from rev 11124, trunk/framework/jsf-test/src/main/resources/org/richfaces/test/ajax-web.xml)
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/resources/org/richfaces/test/ajax-web.xml (rev 0)
+++ branches/jsf2.0/framework/jsf-test/src/main/resources/org/richfaces/test/ajax-web.xml 2008-11-12 20:27:42 UTC (rev 11125)
@@ -0,0 +1,71 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name>Stub test</display-name>
+ <description>
+ Stub testing server
+ </description>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to validate the XML in your
+ faces-config.xml resources against the DTD. Default
+ value is false.
+ </description>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to verify that all of the application
+ objects you have configured (components, converters,
+ renderers, and validators) can be successfully created.
+ Default value is false.
+ </description>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ </servlet>
+
+
+ <!-- Faces Servlet Mapping -->
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+
+</web-app>
+
+
Property changes on: branches/jsf2.0/framework/jsf-test/src/main/resources/org/richfaces/test/ajax-web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Deleted: branches/jsf2.0/framework/jsf-test/src/main/resources/org/richfaces/test/faces-config.xml
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/main/resources/org/richfaces/test/faces-config.xml 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/main/resources/org/richfaces/test/faces-config.xml 2008-11-12 20:27:42 UTC (rev 11125)
@@ -1,69 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
-<!--
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the GNU
- General Public License Version 2 only ("GPL") or the Common Development
- and Distribution License("CDDL") (collectively, the "License"). You
- may not use this file except in compliance with the License. You can obtain
- a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
- or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
- language governing permissions and limitations under the License.
-
- When distributing the software, include this License Header Notice in each
- file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
- Sun designates this particular file as subject to the "Classpath" exception
- as provided by Sun in the GPL Version 2 section of the License file that
- accompanied this code. If applicable, add the following below the License
- Header, with the fields enclosed by brackets [] replaced by your own
- identifying information: "Portions Copyrighted [year]
- [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the CDDL or
- only the GPL Version 2, indicate your decision by adding "[Contributor]
- elects to include this software in this distribution under the [CDDL or GPL
- Version 2] license." If you don't indicate a single choice of license, a
- recipient has the option to distribute your version of this file under
- either the CDDL, the GPL Version 2 or to extend the choice of license to
- its licensees as provided above. However, if you add GPL Version 2 code
- and therefore, elected the GPL Version 2 license, then the option applies
- only if the new code is made subject to such option by the copyright
- holder.
--->
-
-<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- version="2.0">
-
- <!-- our NumberBean we created before -->
- <managed-bean>
- <managed-bean-name>HelloBean</managed-bean-name>
- <managed-bean-class>org.richfaces.test.HelloBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <!-- going from guess.xhtml to response.xhtml -->
- <navigation-rule>
- <from-view-id>/hello.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>success</from-outcome>
- <to-view-id>/response.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <!-- going from response.xhtml to guess.xhtml -->
- <navigation-rule>
- <from-view-id>/response.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>success</from-outcome>
- <to-view-id>/hello.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
-
-</faces-config>
Modified: branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java
===================================================================
--- branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java 2008-11-12 19:56:53 UTC (rev 11124)
+++ branches/jsf2.0/framework/jsf-test/src/test/java/org/richfaces/test/FacesServerTest.java 2008-11-12 20:27:42 UTC (rev 11125)
@@ -48,7 +48,7 @@
}
@Override
- protected void setupWebContent(StagingServer facesServer) {
+ protected void setupWebContent() {
facesServer.addResource("/hello.xhtml", "org/richfaces/test/hello.xhtml");
facesServer.addResource("/response.xhtml", "org/richfaces/test/response.xhtml");
facesServer.addResource("/wave.med.gif", "org/richfaces/test/wave.med.gif");
16 years, 10 months
JBoss Rich Faces SVN: r11124 - in trunk/framework/jsf-test/src/main/java/org/richfaces/test: staging and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-11-12 14:56:53 -0500 (Wed, 12 Nov 2008)
New Revision: 11124
Modified:
trunk/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java
trunk/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java
trunk/framework/jsf-test/src/main/java/org/richfaces/test/StagingConnection.java
trunk/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java
trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java
Log:
Most of the Servlet specs have been implemented
Modified: trunk/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java
===================================================================
--- trunk/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java 2008-11-12 18:35:56 UTC (rev 11123)
+++ trunk/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebConnection.java 2008-11-12 19:56:53 UTC (rev 11124)
@@ -8,7 +8,9 @@
import javax.servlet.ServletException;
import org.apache.commons.httpclient.NameValuePair;
+import org.richfaces.test.staging.StagingHttpRequest;
+import com.gargoylesoftware.htmlunit.FormEncodingType;
import com.gargoylesoftware.htmlunit.WebConnection;
import com.gargoylesoftware.htmlunit.WebRequestSettings;
import com.gargoylesoftware.htmlunit.WebResponse;
@@ -29,6 +31,18 @@
for (NameValuePair param : settings.getRequestParameters()) {
connection.addRequestParameter(param.getName(), param.getValue());
}
+ HttpMethod httpMethod = HttpMethod.valueOf(settings.getHttpMethod().toString());
+ connection.setMethod(httpMethod);
+ StagingHttpRequest request = connection.getRequest();
+ request.setCharacterEncoding(settings.getCharset());
+ String body = settings.getRequestBody();
+ String contentType = settings.getEncodingType().getName();
+ request.setRequestBody(body);
+ request.setContentType(contentType);
+ request.addHeaders(settings.getAdditionalHeaders());
+ if(null != body && FormEncodingType.URL_ENCODED.getName().equals(contentType)){
+ connection.parseFormParameters(body);
+ }
try {
connection.execute();
} catch (ServletException e) {
Modified: trunk/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java
===================================================================
--- trunk/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java 2008-11-12 18:35:56 UTC (rev 11123)
+++ trunk/framework/jsf-test/src/main/java/org/richfaces/test/LocalWebResponse.java 2008-11-12 19:56:53 UTC (rev 11124)
@@ -8,8 +8,10 @@
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Map.Entry;
import org.apache.commons.httpclient.NameValuePair;
@@ -75,7 +77,12 @@
}
public List<NameValuePair> getResponseHeaders() {
- // TODO Auto-generated method stub
- return Collections.emptyList();
+ ArrayList<NameValuePair> headers = new ArrayList<NameValuePair>(10);
+ for (Entry<String, String[]> entry : serverConnection.getResponse().getHeaders().entrySet()) {
+ for (String value : entry.getValue()) {
+ headers.add(new NameValuePair(entry.getKey(),value));
+ }
+ };
+ return headers;
}
}
\ No newline at end of file
Modified: trunk/framework/jsf-test/src/main/java/org/richfaces/test/StagingConnection.java
===================================================================
--- trunk/framework/jsf-test/src/main/java/org/richfaces/test/StagingConnection.java 2008-11-12 18:35:56 UTC (rev 11123)
+++ trunk/framework/jsf-test/src/main/java/org/richfaces/test/StagingConnection.java 2008-11-12 19:56:53 UTC (rev 11124)
@@ -4,9 +4,11 @@
package org.richfaces.test;
import java.io.IOException;
+import java.io.InvalidClassException;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
@@ -66,7 +68,7 @@
private final String servletPath;
private boolean finished = false;
-
+
private boolean started = false;
private String queryString;
@@ -87,22 +89,37 @@
this.pathInfo);
this.request.setAttribute("javax.servlet.include.servlet_path",
this.servletPath);
- queryString = url.getQuery();
- if (null != queryString) {
- String[] queryParams = queryString.split("&");
- for (int i = 0; i < queryParams.length; i++) {
- String par = queryParams[i];
- int eqIndex = par.indexOf('=');
- if(eqIndex>=0){
- addRequestParameter(par.substring(0, eqIndex), par.substring(eqIndex+1));
- } else {
- addRequestParameter(par, null);
- }
- }
- }
+ setQueryString(url.getQuery());
+ if (null != getQueryString()) {
+ parseFormParameters(queryString);
+ }
}
+ public void parseFormParameters(String queryString) {
+ String[] queryParams = queryString.split("&");
+ for (int i = 0; i < queryParams.length; i++) {
+ try {
+ String par = queryParams[i];
+ int eqIndex = par.indexOf('=');
+ if (eqIndex >= 0) {
+ // TODO - decode url-decoded values.
+ String name = URLDecoder.decode(par.substring(0, eqIndex),
+ request.getCharacterEncoding());
+ String value = URLDecoder.decode(
+ par.substring(eqIndex + 1), request
+ .getCharacterEncoding());
+ addRequestParameter(name, value);
+ } else {
+ addRequestParameter(URLDecoder.decode(par, request
+ .getCharacterEncoding()), null);
+ }
+ } catch (UnsupportedEncodingException e) {
+ throw new TestException(e);
+ }
+ }
+ }
+
/**
* @return the finished
*/
@@ -117,8 +134,6 @@
return started;
}
-
-
private void checkStarted() {
if (!isFinished()) {
throw new IllegalStateException("request have not been started");
@@ -127,7 +142,8 @@
public void execute() throws ServletException, IOException {
if (isStarted() || isFinished()) {
- throw new IllegalStateException("request have already been executed");
+ throw new IllegalStateException(
+ "request have already been executed");
}
start();
this.servlet.execute(request, response);
@@ -140,8 +156,9 @@
}
public void start() {
- log.fine("start "+getMethod()+" request processing for file "+url.getFile());
- log.fine("request parameters: "+requestParameters);
+ log.fine("start " + getMethod() + " request processing for file "
+ + url.getFile());
+ log.fine("request parameters: " + requestParameters);
server.requestStarted(request);
started = true;
}
@@ -353,21 +370,21 @@
public HttpSession getSession(boolean create) {
return server.getSession(create);
}
-
+
@Override
public RequestDispatcher getRequestDispatcher(String path) {
RequestDispatcher dispatcher = null;
- if(!path.startsWith("/")){
+ if (!path.startsWith("/")) {
try {
- URL absoluteUrl = new URL(url,path);
+ URL absoluteUrl = new URL(url, path);
path = absoluteUrl.getFile();
} catch (MalformedURLException e) {
return null;
}
}
final RequestChain dispatchedServlet = server.getServlet(path);
- if(null != dispatchedServlet){
- dispatcher = new RequestDispatcher(){
+ if (null != dispatchedServlet) {
+ dispatcher = new RequestDispatcher() {
public void forward(ServletRequest request,
ServletResponse response) throws ServletException,
@@ -381,7 +398,7 @@
IOException {
dispatchedServlet.execute(request, response);
}
-
+
};
}
return dispatcher;
@@ -389,20 +406,20 @@
@Override
protected void attributeAdded(String name, Object o) {
- server.requestAttributeAdded(this,name,o);
-
+ server.requestAttributeAdded(this, name, o);
+
}
@Override
protected void attributeRemoved(String name, Object removed) {
- server.requestAttributeRemoved(this,name,removed);
-
+ server.requestAttributeRemoved(this, name, removed);
+
}
@Override
protected void attributeReplaced(String name, Object o) {
- server.requestAttributeReplaced(this,name,o);
-
+ server.requestAttributeReplaced(this, name, o);
+
}
}
@@ -442,4 +459,19 @@
return response.getErrorMessage();
}
+ /**
+ * @param queryString
+ * the queryString to set
+ */
+ public void setQueryString(String queryString) {
+ this.queryString = queryString;
+ }
+
+ /**
+ * @return the queryString
+ */
+ public String getQueryString() {
+ return queryString;
+ }
+
}
Modified: trunk/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java
===================================================================
--- trunk/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java 2008-11-12 18:35:56 UTC (rev 11123)
+++ trunk/framework/jsf-test/src/main/java/org/richfaces/test/StagingServer.java 2008-11-12 19:56:53 UTC (rev 11124)
@@ -31,11 +31,10 @@
import org.richfaces.test.staging.ServerResource;
import org.richfaces.test.staging.ServerResourcePath;
import org.richfaces.test.staging.ServerResourcesDirectory;
-import org.richfaces.test.staging.RequestChain;
import org.richfaces.test.staging.ServletContainer;
-import org.richfaces.test.staging.StaticServlet;
import org.richfaces.test.staging.StagingHttpSession;
import org.richfaces.test.staging.StagingServletContext;
+import org.richfaces.test.staging.StaticServlet;
/**
@@ -200,7 +199,7 @@
return getSession(true);
}
- public HttpSession getSession(boolean create){
+ public synchronized HttpSession getSession(boolean create){
if(null == this.session && create){
this.session = new ServerHttpSession();
// inform session listeners.
@@ -262,6 +261,7 @@
}
});
session.destroy();
+ session = null;
}
// Inform listeners
final ServletContextEvent event = new ServletContextEvent(context);
Modified: trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java
===================================================================
--- trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java 2008-11-12 18:35:56 UTC (rev 11123)
+++ trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpRequest.java 2008-11-12 19:56:53 UTC (rev 11124)
@@ -4,16 +4,22 @@
package org.richfaces.test.staging;
import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
+import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
+import java.text.DateFormat;
+import java.text.ParseException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
+import java.util.Set;
import java.util.logging.Logger;
import javax.servlet.RequestDispatcher;
@@ -35,8 +41,34 @@
public static final String LOCALHOST_IP = "127.0.0.1";
public static final String UTF8 = "UTF-8";
-
+ private String requestBody = null;
+ private String contentType;
+
+ private Map<String, Object> attributes = new HashMap<String, Object>();
+
+ private Map<String, String> headers = new HashMap<String, String>();
+
+ private Collection<Locale> locales = Arrays.asList(Locale.US,
+ Locale.GERMANY);
+
+ private String characterEncoding = UTF8;
+
+ /**
+ * @return the requestBody
+ */
+ public String getRequestBody() {
+ return requestBody;
+ }
+
+ /**
+ * @param requestBody
+ * the requestBody to set
+ */
+ public void setRequestBody(String requestBody) {
+ this.requestBody = requestBody;
+ }
+
/*
* (non-Javadoc)
*
@@ -57,7 +89,6 @@
return StagingServletContext.CONTEXT_PATH;
}
-
/*
* (non-Javadoc)
*
@@ -65,8 +96,14 @@
* javax.servlet.http.HttpServletRequest#getDateHeader(java.lang.String)
*/
public long getDateHeader(String name) {
- // TODO create headers support
- log.info("unimplemented request method getDateHeader");
+ String value = headers.get(name);
+ if(null != value){
+ try {
+ return DateFormat.getDateInstance(DateFormat.FULL, getLocale()).parse(value).getTime();
+ } catch (ParseException e) {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
return -1;
}
@@ -76,9 +113,7 @@
* @see javax.servlet.http.HttpServletRequest#getHeader(java.lang.String)
*/
public String getHeader(String name) {
- // TODO create headers support
- log.info("unimplemented request method getHeader");
- return null;
+ return headers.get(name);
}
/*
@@ -88,9 +123,7 @@
*/
@SuppressWarnings("unchecked")
public Enumeration getHeaderNames() {
- // TODO create headers support
- log.info("unimplemented request method getHeaderNames");
- return null;
+ return Collections.enumeration(headers.keySet());
}
/*
@@ -100,9 +133,15 @@
*/
@SuppressWarnings("unchecked")
public Enumeration getHeaders(String name) {
- // TODO create headers support
- log.info("unimplemented request method getHeaders");
- return Collections.enumeration(Collections.EMPTY_LIST);
+ Set<String> values;
+ String value = headers.get(name);
+ if (null != value) {
+ values = Collections.singleton(value);
+
+ } else {
+ values = Collections.emptySet();
+ }
+ return Collections.enumeration(values);
}
/*
@@ -111,11 +150,21 @@
* @see javax.servlet.http.HttpServletRequest#getIntHeader(java.lang.String)
*/
public int getIntHeader(String name) {
- // TODO create headers support
- log.info("unimplemented request method getIntHeader");
+ String value = headers.get(name);
+ if(null != value){
+ return Integer.parseInt(value);
+ }
return -1;
}
+ public void addHeader(String name, String value) {
+ headers.put(name, value);
+ }
+
+ public void addHeaders(Map<String, String> headers) {
+ this.headers.putAll(headers);
+ }
+
/*
* (non-Javadoc)
*
@@ -126,7 +175,6 @@
return null;
}
-
/*
* (non-Javadoc)
*
@@ -138,7 +186,6 @@
return null;
}
-
/*
* (non-Javadoc)
*
@@ -159,8 +206,6 @@
return StagingHttpSession.SESSION_ID;
}
-
-
/*
* (non-Javadoc)
*
@@ -222,8 +267,6 @@
return false;
}
- private Map<String, Object> attributes = new HashMap<String, Object>();
-
/*
* (non-Javadoc)
*
@@ -258,7 +301,8 @@
* @see javax.servlet.ServletRequest#getContentLength()
*/
public int getContentLength() {
- return -1;
+ String body = getRequestBody();
+ return null == body ? -1 : body.length();
}
/*
@@ -267,18 +311,36 @@
* @see javax.servlet.ServletRequest#getContentType()
*/
public String getContentType() {
- log.info("unimplemented request method getContentType");
- return null;
+ return contentType;
}
+ /**
+ * @param contentType
+ * the contentType to set
+ */
+ public void setContentType(String contentType) {
+ this.contentType = contentType;
+ }
+
/*
* (non-Javadoc)
*
* @see javax.servlet.ServletRequest#getInputStream()
*/
public ServletInputStream getInputStream() throws IOException {
- // TODO implement post stream.
- log.info("unimplemented request method getInputStream");
+ String body = getRequestBody();
+ if(null != body){
+ final ByteArrayInputStream input = new ByteArrayInputStream(body.getBytes(getCharacterEncoding()));
+ return new ServletInputStream(){
+
+ @Override
+ public int read() throws IOException {
+ // TODO Auto-generated method stub
+ return input.read();
+ }
+
+ };
+ }
return null;
}
@@ -318,9 +380,6 @@
return Locale.US;
}
- private Collection<Locale> locales = Arrays.asList(
- Locale.US, Locale.GERMANY);
-
/*
* (non-Javadoc)
*
@@ -331,8 +390,6 @@
return Collections.enumeration(locales);
}
- private String characterEncoding = UTF8;
-
/*
* (non-Javadoc)
*
@@ -348,8 +405,10 @@
* @see javax.servlet.ServletRequest#getReader()
*/
public BufferedReader getReader() throws IOException {
- // TODO implements request buffer.
- log.info("unimplemented request method getReader");
+ String body = getRequestBody();
+ if(null != body){
+ return new BufferedReader(new StringReader(body));
+ }
return null;
}
@@ -444,8 +503,8 @@
public void removeAttribute(String name) {
// TODO - inform listeners
Object removed = attributes.remove(name);
- if(null != removed){
- attributeRemoved(name,removed);
+ if (null != removed) {
+ attributeRemoved(name, removed);
}
}
@@ -458,14 +517,14 @@
* java.lang.Object)
*/
public void setAttribute(String name, Object o) {
- if(null == o){
+ if (null == o) {
removeAttribute(name);
} else {
Object oldValue = attributes.put(name, o);
- if(null != oldValue){
- attributeReplaced(name,o);
+ if (null != oldValue) {
+ attributeReplaced(name, o);
} else {
- attributeAdded(name,o);
+ attributeAdded(name, o);
}
}
@@ -482,7 +541,7 @@
*/
public void setCharacterEncoding(String env)
throws UnsupportedEncodingException {
- this.characterEncoding=env;
+ this.characterEncoding = env;
}
Modified: trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java
===================================================================
--- trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java 2008-11-12 18:35:56 UTC (rev 11123)
+++ trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpResponse.java 2008-11-12 19:56:53 UTC (rev 11124)
@@ -7,9 +7,13 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
+import java.text.DateFormat;
import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.logging.Logger;
import javax.servlet.ServletOutputStream;
@@ -53,6 +57,16 @@
private String encoding = StagingHttpRequest.UTF8;
+ private final Map<String, String[]> headers= new HashMap<String, String[]>();
+
+
+ /**
+ * @return the headers
+ */
+ public Map<String, String[]> getHeaders() {
+ return headers;
+ }
+
/*
* (non-Javadoc)
*
@@ -61,9 +75,8 @@
* long)
*/
public void addDateHeader(String name, long date) {
- log.info("unimplemented response method addDateHeader");
- // TODO Auto-generated method stub
-
+ // TODO - locale support ?
+ addHeader(name, new Date(date).toString());
}
/*
@@ -73,8 +86,16 @@
* java.lang.String)
*/
public void addHeader(String name, String value) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method addHeader");
+ String[] values = headers.get(name);
+ if (null == values) {
+ values = new String[1];
+ } else {
+ String[] newValues = new String[values.length + 1];
+ System.arraycopy(values, 0, newValues, 0, values.length);
+ values = newValues;
+ }
+ values[values.length - 1] = value;
+ headers.put(name, values);
}
@@ -86,9 +107,7 @@
* int)
*/
public void addIntHeader(String name, int value) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method addIntHeader");
-
+ addHeader(name, String.valueOf(value));
}
/*
@@ -98,9 +117,7 @@
* javax.servlet.http.HttpServletResponse#containsHeader(java.lang.String)
*/
public boolean containsHeader(String name) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method containsHeader");
- return false;
+ return headers.containsKey(name);
}
/*
@@ -182,8 +199,8 @@
* long)
*/
public void setDateHeader(String name, long date) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method setDateHeader");
+ // TODO - locale support ?
+ setHeader(name, new Date(date).toString());
}
/*
@@ -193,8 +210,7 @@
* java.lang.String)
*/
public void setHeader(String name, String value) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method setHeader");
+ headers.put(name, new String[]{value});
}
/*
@@ -205,8 +221,7 @@
* int)
*/
public void setIntHeader(String name, int value) {
- // TODO Auto-generated method stub
- log.info("unimplemented response method setIntHeader");
+ setHeader(name, String.valueOf(value));
}
/*
@@ -405,12 +420,14 @@
}
int i = type.indexOf(';');
if(i>=0){
+ setHeader("Content-Type", type);
contentType = type.substring(0, i).trim();
i=type.lastIndexOf('=');
if(i>=0){
setCharacterEncoding(type.substring(i+1).trim());
}
} else {
+ setHeader("Content-Type", type+";charset="+getCharacterEncoding());
contentType = type;
}
}
Modified: trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java
===================================================================
--- trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java 2008-11-12 18:35:56 UTC (rev 11123)
+++ trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingHttpSession.java 2008-11-12 19:56:53 UTC (rev 11124)
@@ -9,6 +9,7 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
@@ -26,11 +27,11 @@
public static final String SESSION_ID = "1234567890";
- private final Map<String, Object> attributes = new HashMap<String, Object>();
+ private final Map<String, Object> attributes = new ConcurrentHashMap<String, Object>();
private final long creationTime;
- private int inactiveTime = DEFAULT_INACTIVE_TIME;
+ private volatile int inactiveTime = DEFAULT_INACTIVE_TIME;
private boolean valid;
Modified: trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java
===================================================================
--- trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java 2008-11-12 18:35:56 UTC (rev 11123)
+++ trunk/framework/jsf-test/src/main/java/org/richfaces/test/staging/StagingServletContext.java 2008-11-12 19:56:53 UTC (rev 11124)
@@ -13,6 +13,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -36,7 +37,7 @@
public static final String CONTEXT_PATH = "";
private static final String APPLICATION_NAME = "stub";
- private final Map<String, Object> attributes = new HashMap<String, Object>();
+ private final Map<String, Object> attributes = new ConcurrentHashMap<String, Object>();
private Map<String,String> initParameters = new HashMap<String, String>();
/* (non-Javadoc)
16 years, 10 months
JBoss Rich Faces SVN: r11123 - in trunk/sandbox/samples/editor-sample/src/main: webapp and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-11-12 13:35:56 -0500 (Wed, 12 Nov 2008)
New Revision: 11123
Added:
trunk/sandbox/samples/editor-sample/src/main/resources/myplugins.properties
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/editor_plugin.js
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/img/
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/img/smiley-cool.gif
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/js/
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/js/emotions.js
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/langs/
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/langs/en.js
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/langs/en_dlg.js
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/myemotions.htm
trunk/sandbox/samples/editor-sample/src/main/webapp/tiny_mce_popup.js
Modified:
trunk/sandbox/samples/editor-sample/src/main/resources/editorFull.properties
trunk/sandbox/samples/editor-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/editor-sample/src/main/webapp/pages/editor.jsp
Log:
custom plugins sample
Modified: trunk/sandbox/samples/editor-sample/src/main/resources/editorFull.properties
===================================================================
--- trunk/sandbox/samples/editor-sample/src/main/resources/editorFull.properties 2008-11-12 18:30:39 UTC (rev 11122)
+++ trunk/sandbox/samples/editor-sample/src/main/resources/editorFull.properties 2008-11-12 18:35:56 UTC (rev 11123)
@@ -3,6 +3,7 @@
theme_advanced_buttons2 = "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor"
theme_advanced_buttons3 = "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen"
theme_advanced_buttons4 = "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak"
+theme_advanced_buttons5 = "|,myemotions,|"
theme_advanced_toolbar_location = "top"
theme_advanced_toolbar_align = "left"
theme_advanced_statusbar_location = "bottom"
Added: trunk/sandbox/samples/editor-sample/src/main/resources/myplugins.properties
===================================================================
--- trunk/sandbox/samples/editor-sample/src/main/resources/myplugins.properties (rev 0)
+++ trunk/sandbox/samples/editor-sample/src/main/resources/myplugins.properties 2008-11-12 18:35:56 UTC (rev 11123)
@@ -0,0 +1 @@
+myemotions=/tiny-custom-plugins/myemotions/editor_plugin.js
\ No newline at end of file
Modified: trunk/sandbox/samples/editor-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/editor-sample/src/main/webapp/WEB-INF/web.xml 2008-11-12 18:30:39 UTC (rev 11122)
+++ trunk/sandbox/samples/editor-sample/src/main/webapp/WEB-INF/web.xml 2008-11-12 18:35:56 UTC (rev 11123)
@@ -36,10 +36,12 @@
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
+
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
+
<!--servlet>
<display-name>TinyMCE Loader Servlet</display-name>
<servlet-name>TinyMCELoaderServlet</servlet-name>
Modified: trunk/sandbox/samples/editor-sample/src/main/webapp/pages/editor.jsp
===================================================================
--- trunk/sandbox/samples/editor-sample/src/main/webapp/pages/editor.jsp 2008-11-12 18:30:39 UTC (rev 11122)
+++ trunk/sandbox/samples/editor-sample/src/main/webapp/pages/editor.jsp 2008-11-12 18:35:56 UTC (rev 11123)
@@ -31,9 +31,11 @@
rendered="#{editorBean.rendered}"
binding="#{editorBean.editor}"
theme="advanced"
- language="ru"
- plugins="safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template"
+ language="en"
+ plugins="safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,myemotions"
configuration="editorFull"
+ skin="richfaces"
+ customPlugins="myplugins"
/>
<h:outputText value="Editor value: #{editorBean.value}" />
Added: trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/editor_plugin.js
===================================================================
--- trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/editor_plugin.js (rev 0)
+++ trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/editor_plugin.js 2008-11-12 18:35:56 UTC (rev 11123)
@@ -0,0 +1,41 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+ tinymce.PluginManager.requireLangPack('myemotions');
+ tinymce.create('tinymce.plugins.MyEmotionsPlugin', {
+ init : function(ed, url) {
+ // Register commands
+ ed.addCommand('mceMyEmotion', function() {
+ ed.windowManager.open({
+ file : url + '/myemotions.htm',
+ width : 250 + parseInt(ed.getLang('myemotions.delta_width', 0)),
+ height : 160 + parseInt(ed.getLang('myemotions.delta_height', 0)),
+ inline : 1
+ }, {
+ plugin_url : url
+ });
+ });
+
+ // Register buttons
+ ed.addButton('myemotions', {title : 'myemotions.emotions_desc', cmd : 'mceMyEmotion', image : url + '/img/smiley-cool.gif'});
+ },
+
+ getInfo : function() {
+ return {
+ longname : 'MyEmotions',
+ author : '',
+ authorurl : '',
+ infourl : '',
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
+ };
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('myemotions', tinymce.plugins.MyEmotionsPlugin);
+})();
\ No newline at end of file
Added: trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/img/smiley-cool.gif
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/img/smiley-cool.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/js/emotions.js
===================================================================
--- trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/js/emotions.js (rev 0)
+++ trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/js/emotions.js 2008-11-12 18:35:56 UTC (rev 11123)
@@ -0,0 +1,21 @@
+tinyMCEPopup.requireLangPack();
+
+var MyEmotionsDialog = {
+ init : function(ed) {
+ tinyMCEPopup.resizeToInnerSize();
+ },
+
+ insert : function(file, title) {
+ var ed = tinyMCEPopup.editor, dom = ed.dom;
+ tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
+ src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
+ alt : ed.getLang(title),
+ title : ed.getLang(title),
+ border : 0
+ }));
+
+ tinyMCEPopup.close();
+ }
+};
+
+tinyMCEPopup.onInit.add(MyEmotionsDialog.init, MyEmotionsDialog);
Added: trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/langs/en.js
===================================================================
--- trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/langs/en.js (rev 0)
+++ trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/langs/en.js 2008-11-12 18:35:56 UTC (rev 11123)
@@ -0,0 +1,3 @@
+tinyMCE.addI18n('en.myemotions',{
+ desc : 'My Emotions'
+});
\ No newline at end of file
Added: trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/langs/en_dlg.js
===================================================================
--- trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/langs/en_dlg.js (rev 0)
+++ trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/langs/en_dlg.js 2008-11-12 18:35:56 UTC (rev 11123)
@@ -0,0 +1,5 @@
+tinyMCE.addI18n('en.myemotions_dlg',{
+title:"Insert emotion",
+desc:"Emotions",
+cool:"Cool",
+});
\ No newline at end of file
Added: trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/myemotions.htm
===================================================================
--- trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/myemotions.htm (rev 0)
+++ trunk/sandbox/samples/editor-sample/src/main/webapp/tiny-custom-plugins/myemotions/myemotions.htm 2008-11-12 18:35:56 UTC (rev 11123)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>{#myemotions_dlg.title}</title>
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+ <script type="text/javascript" src="js/emotions.js"></script>
+ <base target="_self" />
+</head>
+<body style="display: none">
+ <div align="center">
+ <div class="title">Custom Plugin: {#myemotions_dlg.title}:<br /><br /></div>
+
+ <div style="padding:30px">
+ <a href="javascript:MyEmotionsDialog.insert('smiley-cool.gif','myemotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#myemotions_dlg.cool}" title="{#myemotions_dlg.cool}" /></a> </div>
+ </div>
+</body>
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/editor-sample/src/main/webapp/tiny_mce_popup.js
===================================================================
--- trunk/sandbox/samples/editor-sample/src/main/webapp/tiny_mce_popup.js (rev 0)
+++ trunk/sandbox/samples/editor-sample/src/main/webapp/tiny_mce_popup.js 2008-11-12 18:35:56 UTC (rev 11123)
@@ -0,0 +1,294 @@
+// Some global instances
+var tinymce = null, tinyMCEPopup, tinyMCE;
+
+tinyMCEPopup = {
+ init : function() {
+ var t = this, w, ti, li, q, i, it;
+
+ li = ('' + document.location.search).replace(/^\?/, '').split('&');
+ q = {};
+ for (i=0; i<li.length; i++) {
+ it = li[i].split('=');
+ q[unescape(it[0])] = unescape(it[1]);
+ }
+
+ if (q.mce_rdomain)
+ document.domain = q.mce_rdomain;
+
+ // Find window & API
+ w = t.getWin();
+ tinymce = w.tinymce;
+ tinyMCE = w.tinyMCE;
+ t.editor = tinymce.EditorManager.activeEditor;
+ t.params = t.editor.windowManager.params;
+ t.features = t.editor.windowManager.features;
+
+ // Setup local DOM
+ t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document);
+
+ // Enables you to skip loading the default css
+ if (t.features.popup_css !== false)
+ t.dom.loadCSS(t.features.popup_css || t.editor.settings.popup_css);
+
+ // Setup on init listeners
+ t.listeners = [];
+ t.onInit = {
+ add : function(f, s) {
+ t.listeners.push({func : f, scope : s});
+ }
+ };
+
+ t.isWindow = !t.getWindowArg('mce_inline');
+ t.id = t.getWindowArg('mce_window_id');
+ t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window);
+ },
+
+ getWin : function() {
+ return window.dialogArguments || opener || parent || top;
+ },
+
+ getWindowArg : function(n, dv) {
+ var v = this.params[n];
+
+ return tinymce.is(v) ? v : dv;
+ },
+
+ getParam : function(n, dv) {
+ return this.editor.getParam(n, dv);
+ },
+
+ getLang : function(n, dv) {
+ return this.editor.getLang(n, dv);
+ },
+
+ execCommand : function(cmd, ui, val, a) {
+ a = a || {};
+ a.skip_focus = 1;
+
+ this.restoreSelection();
+ return this.editor.execCommand(cmd, ui, val, a);
+ },
+
+ resizeToInnerSize : function() {
+ var t = this, n, b = document.body, vp = t.dom.getViewPort(window), dw, dh;
+
+ dw = t.getWindowArg('mce_width') - vp.w;
+ dh = t.getWindowArg('mce_height') - vp.h;
+
+ if (t.isWindow)
+ window.resizeBy(dw, dh);
+ else
+ t.editor.windowManager.resizeBy(dw, dh, t.id);
+ },
+
+ executeOnLoad : function(s) {
+ this.onInit.add(function() {
+ eval(s);
+ });
+ },
+
+ storeSelection : function() {
+ this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark('simple');
+ },
+
+ restoreSelection : function() {
+ var t = tinyMCEPopup;
+
+ if (!t.isWindow && tinymce.isIE)
+ t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
+ },
+
+ requireLangPack : function() {
+ var u = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url');
+
+ if (u && this.editor.settings.language) {
+ u += '/langs/' + this.editor.settings.language + '_dlg.js';
+
+ if (!tinymce.ScriptLoader.isDone(u)) {
+ document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"></script>');
+ tinymce.ScriptLoader.markDone(u);
+ }
+ }
+ },
+
+ pickColor : function(e, element_id) {
+ this.execCommand('mceColorPicker', true, {
+ color : document.getElementById(element_id).value,
+ func : function(c) {
+ document.getElementById(element_id).value = c;
+
+ try {
+ document.getElementById(element_id).onchange();
+ } catch (ex) {
+ // Try fire event, ignore errors
+ }
+ }
+ });
+ },
+
+ openBrowser : function(element_id, type, option) {
+ tinyMCEPopup.restoreSelection();
+ this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
+ },
+
+ confirm : function(t, cb, s) {
+ this.editor.windowManager.confirm(t, cb, s, window);
+ },
+
+ alert : function(tx, cb, s) {
+ this.editor.windowManager.alert(tx, cb, s, window);
+ },
+
+ close : function() {
+ var t = this;
+
+ // To avoid domain relaxing issue in Opera
+ function close() {
+ t.editor.windowManager.close(window);
+ tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup
+ };
+
+ if (tinymce.isOpera)
+ t.getWin().setTimeout(close, 0);
+ else
+ close();
+ },
+
+ // Internal functions
+
+ _restoreSelection : function() {
+ var e = window.event.srcElement;
+
+ if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
+ tinyMCEPopup.restoreSelection();
+ },
+
+/* _restoreSelection : function() {
+ var e = window.event.srcElement;
+
+ // If user focus a non text input or textarea
+ if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
+ tinyMCEPopup.restoreSelection();
+ },*/
+
+ _onDOMLoaded : function() {
+ var t = this, ti = document.title, bm, h, nv;
+
+ // Translate page
+ if (t.features.translate_i18n !== false) {
+ h = document.body.innerHTML;
+
+ // Replace a=x with a="x" in IE
+ if (tinymce.isIE)
+ h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
+
+ document.dir = t.editor.getParam('directionality','');
+
+ if ((nv = t.editor.translate(h)) && nv != h)
+ document.body.innerHTML = nv;
+
+ if ((nv = t.editor.translate(ti)) && nv != ti)
+ document.title = ti = nv;
+ }
+
+ document.body.style.display = '';
+
+ // Restore selection in IE when focus is placed on a non textarea or input element of the type text
+ if (tinymce.isIE)
+ document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
+
+ t.restoreSelection();
+ t.resizeToInnerSize();
+
+ // Set inline title
+ if (!t.isWindow)
+ t.editor.windowManager.setTitle(window, ti);
+ else
+ window.focus();
+
+ if (!tinymce.isIE && !t.isWindow) {
+ tinymce.dom.Event._add(document, 'focus', function() {
+ t.editor.windowManager.focus(t.id)
+ });
+ }
+
+ // Patch for accessibility
+ tinymce.each(t.dom.select('select'), function(e) {
+ e.onkeydown = tinyMCEPopup._accessHandler;
+ });
+
+ // Call onInit
+ // Init must be called before focus so the selection won't get lost by the focus call
+ tinymce.each(t.listeners, function(o) {
+ o.func.call(o.scope, t.editor);
+ });
+
+ // Move focus to window
+ if (t.getWindowArg('mce_auto_focus', true)) {
+ window.focus();
+
+ // Focus element with mceFocus class
+ tinymce.each(document.forms, function(f) {
+ tinymce.each(f.elements, function(e) {
+ if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) {
+ e.focus();
+ return false; // Break loop
+ }
+ });
+ });
+ }
+
+ document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
+ },
+
+ _accessHandler : function(e) {
+ e = e || window.event;
+
+ if (e.keyCode == 13 || e.keyCode == 32) {
+ e = e.target || e.srcElement;
+
+ if (e.onchange)
+ e.onchange();
+
+ return tinymce.dom.Event.cancel(e);
+ }
+ },
+
+ _closeWinKeyHandler : function(e) {
+ e = e || window.event;
+
+ if (e.keyCode == 27)
+ tinyMCEPopup.close();
+ },
+
+ _wait : function() {
+ var t = this, ti;
+
+ if (tinymce.isIE && document.location.protocol != 'https:') {
+ // Fake DOMContentLoaded on IE
+ document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');
+ document.getElementById("__ie_onload").onreadystatechange = function() {
+ if (this.readyState == "complete") {
+ t._onDOMLoaded();
+ document.getElementById("__ie_onload").onreadystatechange = null; // Prevent leak
+ }
+ };
+ } else {
+ if (tinymce.isIE || tinymce.isWebKit) {
+ ti = setInterval(function() {
+ if (/loaded|complete/.test(document.readyState)) {
+ clearInterval(ti);
+ t._onDOMLoaded();
+ }
+ }, 10);
+ } else {
+ window.addEventListener('DOMContentLoaded', function() {
+ t._onDOMLoaded();
+ }, false);
+ }
+ }
+ }
+};
+
+tinyMCEPopup.init();
+tinyMCEPopup._wait(); // Wait for DOM Content Loaded
16 years, 10 months
JBoss Rich Faces SVN: r11121 - in trunk/test-applications/seleniumTest/richfaces/src/main: java/org/ajax4jsf/bean/tree/rich and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-11-12 12:37:24 -0500 (Wed, 12 Nov 2008)
New Revision: 11121
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Album.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/AudioLibrary.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Performer.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Song.java
trunk/test-applications/seleniumTest/richfaces/src/main/resources/rich-digester-rules.xml
trunk/test-applications/seleniumTest/richfaces/src/main/resources/swing-digester-rules.xml
Removed:
trunk/test-applications/seleniumTest/richfaces/src/main/resources/digester-rules.xml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/AudioLibrary.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java
trunk/test-applications/seleniumTest/richfaces/src/main/resources/audio-library.xml
Log:
swing implementation added
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java 2008-11-12 17:19:12 UTC (rev 11120)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java 2008-11-12 17:37:24 UTC (rev 11121)
@@ -110,8 +110,7 @@
public TreeNode<Object> getRichTreeNode() {
if (null == richRootNode) {
- URL rulesUrl = getClass().getResource("/digester-rules.xml");
- Digester digester = DigesterLoader.createDigester(rulesUrl);
+ Digester digester = DigesterLoader.createDigester(getClass().getResource("/rich-digester-rules.xml"));
AudioLibrary library = new AudioLibrary();
digester.push(library);
try {
@@ -129,6 +128,28 @@
return richRootNode;
}
+ private javax.swing.tree.TreeNode swingRootNode = null;
+
+ public javax.swing.tree.TreeNode getSwingTreeNode() {
+ if (null == swingRootNode) {
+ Digester digester = DigesterLoader.createDigester(getClass().getResource("/swing-digester-rules.xml"));
+ org.ajax4jsf.bean.tree.swing.AudioLibrary library = new org.ajax4jsf.bean.tree.swing.AudioLibrary();
+ digester.push(library);
+ try {
+ digester.parse(getClass().getResourceAsStream("/audio-library.xml"));
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SAXException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ swingRootNode = library;
+ }
+
+ return swingRootNode;
+ }
+
public String getNodeTitle() {
return nodeTitle;
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java 2008-11-12 17:19:12 UTC (rev 11120)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java 2008-11-12 17:37:24 UTC (rev 11121)
@@ -1,24 +1,17 @@
package org.ajax4jsf.bean.tree.rich;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
+import org.richfaces.model.TreeNodeImpl;
-import org.richfaces.model.TreeNode;
+public class Album extends TreeNodeImpl<Object> {
-public class Album implements TreeNode<Object> {
-
/**
* serial version ID
*/
- private static final long serialVersionUID = 443084062111349934L;
+ private static final long serialVersionUID = -1769541701902658524L;
private long id;
- private Map<Object, TreeNode<Object>> songs = new LinkedHashMap<Object, TreeNode<Object>>();
private String title;
private Integer year;
- private Performer performer;
public Album() {
setId(System.currentTimeMillis());
@@ -28,45 +21,16 @@
// TreeNode implementation
//
- public void addChild(Object identifier, TreeNode<Object> child) {
- songs.put(identifier, child);
- }
-
- public TreeNode<Object> getChild(Object id) {
- return songs.get(id);
- }
-
- public Iterator<Entry<Object, TreeNode<Object>>> getChildren() {
- return songs.entrySet().iterator();
- }
-
public Object getData() {
return this;
}
- public TreeNode<Object> getParent() {
- return performer;
- }
-
- public boolean isLeaf() {
- return songs.isEmpty();
- }
-
- public void removeChild(Object id) {
- songs.remove(id);
- }
-
public void setData(Object data) {
}
- public void setParent(TreeNode<Object> parent) {
- performer = (Performer) parent;
- }
-
//
// Album implementation
//
-
/**
* Gets value of id field.
* @return value of id field
@@ -117,9 +81,24 @@
public void addSong(Song song) {
addChild(song.getId(), song);
- song.setParent(this);
}
+ /**
+ * Gets value of performer field.
+ * @return value of performer field
+ */
+ public Performer getPerformer() {
+ return (Performer) getParent();
+ }
+
+ /**
+ * Set a new value for performer field.
+ * @param performer a new value for performer field
+ */
+ public void setPerformer(Performer performer) {
+ setParent(performer);
+ }
+
public String getType() {
return "album";
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/AudioLibrary.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/AudioLibrary.java 2008-11-12 17:19:12 UTC (rev 11120)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/AudioLibrary.java 2008-11-12 17:37:24 UTC (rev 11121)
@@ -1,65 +1,16 @@
package org.ajax4jsf.bean.tree.rich;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
+import org.richfaces.model.TreeNodeImpl;
-import org.richfaces.model.TreeNode;
+public class AudioLibrary extends TreeNodeImpl<Object> {
-public class AudioLibrary implements TreeNode<Object> {
-
/**
* serial version ID
*/
- private static final long serialVersionUID = -1429183678508376974L;
+ private static final long serialVersionUID = -5062513400012852149L;
- private Map<Object, TreeNode<Object>> performers = new LinkedHashMap<Object, TreeNode<Object>>();
-
-//
-// TreeNode implementation
-//
- public void addChild(Object identifier, TreeNode<Object> child) {
- performers.put(identifier, child);
- }
-
- public TreeNode<Object> getChild(Object id) {
- return performers.get(id);
- }
-
- public Iterator<Entry<Object, TreeNode<Object>>> getChildren() {
- return performers.entrySet().iterator();
- }
-
- public Object getData() {
- return this;
- }
-
- public TreeNode<Object> getParent() {
- return null;
- }
-
- public boolean isLeaf() {
- return performers.isEmpty();
- }
-
- public void removeChild(Object id) {
- performers.remove(id);
- }
-
- public void setData(Object data) {
- }
-
- public void setParent(TreeNode<Object> parent) {
- }
-
-//
-// AudioLibrary implementation
-//
-
public void addPerformer(Performer performer) {
addChild(performer.getId(), performer);
- performer.setParent(this);
}
public String getType() {
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java 2008-11-12 17:19:12 UTC (rev 11120)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java 2008-11-12 17:37:24 UTC (rev 11121)
@@ -1,23 +1,16 @@
package org.ajax4jsf.bean.tree.rich;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
+import org.richfaces.model.TreeNodeImpl;
-import org.richfaces.model.TreeNode;
+public class Performer extends TreeNodeImpl<Object> {
-public class Performer implements TreeNode<Object> {
-
/**
* serial version ID
*/
- private static final long serialVersionUID = -4258414186970822017L;
+ private static final long serialVersionUID = -1057006188458974576L;
private long id;
- private Map<Object, TreeNode<Object>> albums = new LinkedHashMap<Object, TreeNode<Object>>();
private String name;
- private AudioLibrary library;
public Performer() {
setId(System.currentTimeMillis());
@@ -26,43 +19,16 @@
//
// TreeNode implementation
//
- public void addChild(Object identifier, TreeNode<Object> child) {
- albums.put(identifier, child);
- }
- public TreeNode<Object> getChild(Object id) {
- return albums.get(id);
- }
-
- public Iterator<Entry<Object, TreeNode<Object>>> getChildren() {
- return albums.entrySet().iterator();
- }
-
public Object getData() {
return this;
}
- public TreeNode<Object> getParent() {
- return library;
- }
-
- public boolean isLeaf() {
- return albums.isEmpty();
- }
-
- public void removeChild(Object id) {
- albums.remove(id);
- }
-
public void setData(Object data) {
}
- public void setParent(TreeNode<Object> parent) {
- library = (AudioLibrary) parent;
- }
-
//
-// Band implementation
+// Performer implementation
//
/**
@@ -82,22 +48,6 @@
}
/**
- * Gets value of albums field.
- * @return value of albums field
- */
- public Map<Object, TreeNode<Object>> getAlbums() {
- return albums;
- }
-
- /**
- * Set a new value for albums field.
- * @param albums a new value for albums field
- */
- public void setAlbums(Map<Object, TreeNode<Object>> albums) {
- this.albums = albums;
- }
-
- /**
* Gets value of name field.
* @return value of name field
*/
@@ -115,9 +65,24 @@
public void addAlbum(Album album) {
addChild(album.getId(), album);
- album.setParent(this);
}
+ /**
+ * Gets value of library field.
+ * @return value of library field
+ */
+ public AudioLibrary getLibrary() {
+ return (AudioLibrary) getParent();
+ }
+
+ /**
+ * Set a new value for library field.
+ * @param library a new value for library field
+ */
+ public void setLibrary(AudioLibrary library) {
+ setLibrary(library);
+ }
+
public String getType() {
return "performer";
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java 2008-11-12 17:19:12 UTC (rev 11120)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java 2008-11-12 17:37:24 UTC (rev 11121)
@@ -1,12 +1,9 @@
package org.ajax4jsf.bean.tree.rich;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map.Entry;
-
import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeNodeImpl;
-public class Song implements TreeNode<Object> {
+public class Song extends TreeNodeImpl<Object> {
/**
* serial version ID
@@ -15,7 +12,6 @@
private long id;
private String title;
- private Album album;
public Song() {
setId(System.currentTimeMillis());
@@ -33,37 +29,21 @@
throw new UnsupportedOperationException("Songs do not have children");
}
- public Iterator<Entry<Object, TreeNode<Object>>> getChildren() {
- return new LinkedHashMap<Object, TreeNode<Object>>().entrySet().iterator();
+ public boolean isLeaf() {
+ return true;
}
public Object getData() {
return this;
}
- public TreeNode<Object> getParent() {
- return album;
- }
-
- public boolean isLeaf() {
- return true;
- }
-
- public void removeChild(Object id) {
- // TODO Auto-generated method stub
-
- }
-
public void setData(Object data) {
}
- public void setParent(TreeNode<Object> parent) {
- album = (Album) parent;
- }
-
//
// Song implementation
//
+
/**
* Gets value of id field.
* @return value of id field
@@ -96,6 +76,22 @@
this.title = title;
}
+ /**
+ * Gets value of album field.
+ * @return value of album field
+ */
+ public Album getAlbum() {
+ return (Album) getParent();
+ }
+
+ /**
+ * Set a new value for album field.
+ * @param album a new value for album field
+ */
+ public void setAlbum(Album album) {
+ setAlbum(album);
+ }
+
public String getType() {
return "song";
}
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Album.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Album.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Album.java 2008-11-12 17:37:24 UTC (rev 11121)
@@ -0,0 +1,66 @@
+package org.ajax4jsf.bean.tree.swing;
+
+import org.richfaces.model.SwingTreeNodeImpl;
+
+public class Album extends SwingTreeNodeImpl {
+
+ private String title;
+ private Integer year;
+
+ /**
+ * Gets value of title field.
+ * @return value of title field
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Set a new value for title field.
+ * @param title a new value for title field
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * Gets value of year field.
+ * @return value of year field
+ */
+ public Integer getYear() {
+ return year;
+ }
+
+ /**
+ * Set a new value for year field.
+ * @param year a new value for year field
+ */
+ public void setYear(Integer year) {
+ this.year = year;
+ }
+
+ public void addSong(Song song) {
+ addChild(song);
+ song.setParent(this);
+ }
+
+ /**
+ * Gets value of performer field.
+ * @return value of performer field
+ */
+ public Performer getPerformer() {
+ return (Performer) getParent();
+ }
+
+ /**
+ * Set a new value for performer field.
+ * @param performer a new value for performer field
+ */
+ public void setPerformer(Performer performer) {
+ setParent(performer);
+ }
+
+ public String getType() {
+ return "album";
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Album.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/AudioLibrary.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/AudioLibrary.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/AudioLibrary.java 2008-11-12 17:37:24 UTC (rev 11121)
@@ -0,0 +1,15 @@
+package org.ajax4jsf.bean.tree.swing;
+
+import org.richfaces.model.SwingTreeNodeImpl;
+
+public class AudioLibrary extends SwingTreeNodeImpl {
+
+ public void addPerformer(Performer performer) {
+ addChild(performer);
+ performer.setParent(this);
+ }
+
+ public String getType() {
+ return "library";
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/AudioLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Performer.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Performer.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Performer.java 2008-11-12 17:37:24 UTC (rev 11121)
@@ -0,0 +1,49 @@
+package org.ajax4jsf.bean.tree.swing;
+
+import org.richfaces.model.SwingTreeNodeImpl;
+
+public class Performer extends SwingTreeNodeImpl {
+
+ private String name;
+
+ /**
+ * Gets value of library field.
+ * @return value of library field
+ */
+ public AudioLibrary getLibrary() {
+ return (AudioLibrary) getParent();
+ }
+
+ /**
+ * Set a new value for library field.
+ * @param library a new value for library field
+ */
+ public void setLibrary(AudioLibrary library) {
+ setParent(library);
+ }
+
+ /**
+ * Gets value of name field.
+ * @return value of name field
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set a new value for name field.
+ * @param name a new value for name field
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void addAlbum(Album album) {
+ addChild(album);
+ album.setParent(this);
+ }
+
+ public String getType() {
+ return "performer";
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Performer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Song.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Song.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Song.java 2008-11-12 17:37:24 UTC (rev 11121)
@@ -0,0 +1,44 @@
+package org.ajax4jsf.bean.tree.swing;
+
+import org.richfaces.model.SwingTreeNodeImpl;
+
+public class Song extends SwingTreeNodeImpl {
+
+ private String title;
+
+ /**
+ * Gets value of album field.
+ * @return value of album field
+ */
+ public Album getAlbum() {
+ return (Album) getParent();
+ }
+
+ /**
+ * Set a new value for album field.
+ * @param album a new value for album field
+ */
+ public void setAlbum(Album album) {
+ setParent(album);
+ }
+
+ /**
+ * Gets value of title field.
+ * @return value of title field
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Set a new value for title field.
+ * @param title a new value for title field
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getType() {
+ return "song";
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/swing/Song.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/resources/audio-library.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/resources/audio-library.xml 2008-11-12 17:19:12 UTC (rev 11120)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/resources/audio-library.xml 2008-11-12 17:37:24 UTC (rev 11121)
@@ -1,19 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<audio-library>
<performer>
- <name>Performer</name>
+ <name>Britney Spears</name>
<album>
- <title>Album</title>
- <year>2008</year>
+ <title>Oops! ... I Did It Again</title>
+ <year>2000</year>
<song>
- <title>Song1</title>
- </song>
+ <title>Oops!... I Did It Again</title>
+ </song>
<song>
- <title>Song2</title>
- </song>
+ <title>Stronger</title>
+ </song>
<song>
- <title>Song3</title>
- </song>
+ <title>Don't Go Knockin' on My Door</title>
+ </song>
+ <song>
+ <title>(I Can't Get No) Satisfaction</title>
+ </song>
+ <song>
+ <title>What U See (Is What U Get)</title>
+ </song>
+ <song>
+ <title>Don't Let Me Be the Last to Know</title>
+ </song>
+ <song>
+ <title>Lucky</title>
+ </song>
</album>
</performer>
+ <performer>
+ <name>Christina Aguilera</name>
+ <album>
+ <title>Stripped</title>
+ <year>2002</year>
+ <song>
+ <title>Stripped (Intro)</title>
+ </song>
+ <song>
+ <title>Can't Hold Us Down</title>
+ </song>
+ <song>
+ <title>Walk Away</title>
+ </song>
+ <song>
+ <title>Fighter</title>
+ </song>
+ <song>
+ <title>Infatuation</title>
+ </song>
+ <song>
+ <title>Beautiful</title>
+ </song>
+ </album>
+ </performer>
</audio-library>
\ No newline at end of file
Deleted: trunk/test-applications/seleniumTest/richfaces/src/main/resources/digester-rules.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/resources/digester-rules.xml 2008-11-12 17:19:12 UTC (rev 11120)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/resources/digester-rules.xml 2008-11-12 17:37:24 UTC (rev 11121)
@@ -1,45 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!DOCTYPE digester-rules
- PUBLIC "-//Jakarta Apache //DTD digester-rules XML V1.0//EN"
- "http://jakarta.apache.org/commons/digester/dtds/digester-rules.dtd">
-<digester-rules>
- <pattern value="audio-library">
- <pattern value="performer">
- <object-create-rule classname="org.ajax4jsf.bean.tree.rich.Performer"/>
- <set-properties-rule/>
- <set-next-rule methodname="addPerformer"/>
- <bean-property-setter-rule pattern="name"/>
- <pattern value="album">
- <object-create-rule classname="org.ajax4jsf.bean.tree.rich.Album"/>
- <set-next-rule methodname="addAlbum"/>
- <set-properties-rule/>
- <bean-property-setter-rule pattern="title"/>
- <bean-property-setter-rule pattern="year"/>
- <pattern value="song">
- <object-create-rule classname="org.ajax4jsf.bean.tree.rich.Song"/>
- <set-next-rule methodname="addSong"/>
- <set-properties-rule/>
- <bean-property-setter-rule pattern="title"/>
- </pattern>
- </pattern>
- </pattern>
- </pattern>
-</digester-rules>
Copied: trunk/test-applications/seleniumTest/richfaces/src/main/resources/rich-digester-rules.xml (from rev 11111, trunk/test-applications/seleniumTest/richfaces/src/main/resources/digester-rules.xml)
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/resources/rich-digester-rules.xml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/resources/rich-digester-rules.xml 2008-11-12 17:37:24 UTC (rev 11121)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!DOCTYPE digester-rules
+ PUBLIC "-//Jakarta Apache //DTD digester-rules XML V1.0//EN"
+ "http://jakarta.apache.org/commons/digester/dtds/digester-rules.dtd">
+<digester-rules>
+ <pattern value="audio-library">
+ <pattern value="performer">
+ <object-create-rule classname="org.ajax4jsf.bean.tree.rich.Performer"/>
+ <set-properties-rule/>
+ <set-next-rule methodname="addPerformer"/>
+ <bean-property-setter-rule pattern="name"/>
+ <pattern value="album">
+ <object-create-rule classname="org.ajax4jsf.bean.tree.rich.Album"/>
+ <set-next-rule methodname="addAlbum"/>
+ <set-properties-rule/>
+ <bean-property-setter-rule pattern="title"/>
+ <bean-property-setter-rule pattern="year"/>
+ <pattern value="song">
+ <object-create-rule classname="org.ajax4jsf.bean.tree.rich.Song"/>
+ <set-next-rule methodname="addSong"/>
+ <set-properties-rule/>
+ <bean-property-setter-rule pattern="title"/>
+ </pattern>
+ </pattern>
+ </pattern>
+ </pattern>
+</digester-rules>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/resources/swing-digester-rules.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/resources/swing-digester-rules.xml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/resources/swing-digester-rules.xml 2008-11-12 17:37:24 UTC (rev 11121)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!DOCTYPE digester-rules
+ PUBLIC "-//Jakarta Apache //DTD digester-rules XML V1.0//EN"
+ "http://jakarta.apache.org/commons/digester/dtds/digester-rules.dtd">
+<digester-rules>
+ <pattern value="audio-library">
+ <pattern value="performer">
+ <object-create-rule classname="org.ajax4jsf.bean.tree.swing.Performer"/>
+ <set-properties-rule/>
+ <set-next-rule methodname="addPerformer"/>
+ <bean-property-setter-rule pattern="name"/>
+ <pattern value="album">
+ <object-create-rule classname="org.ajax4jsf.bean.tree.swing.Album"/>
+ <set-next-rule methodname="addAlbum"/>
+ <set-properties-rule/>
+ <bean-property-setter-rule pattern="title"/>
+ <bean-property-setter-rule pattern="year"/>
+ <pattern value="song">
+ <object-create-rule classname="org.ajax4jsf.bean.tree.swing.Song"/>
+ <set-next-rule methodname="addSong"/>
+ <set-properties-rule/>
+ <bean-property-setter-rule pattern="title"/>
+ </pattern>
+ </pattern>
+ </pattern>
+ </pattern>
+</digester-rules>
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/resources/swing-digester-rules.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
16 years, 10 months