Author: alexsmirnov
Date: 2007-05-01 22:10:44 -0400 (Tue, 01 May 2007)
New Revision: 148
Added:
trunk/samples/seamIntegration/
trunk/samples/seamIntegration/pom.xml
trunk/samples/seamIntegration/src/
trunk/samples/seamIntegration/src/main/
trunk/samples/seamIntegration/src/main/java/
trunk/samples/seamIntegration/src/main/java/org/
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/Bean.java
trunk/samples/seamIntegration/src/main/resources/
trunk/samples/seamIntegration/src/main/resources/hibernate.cfg.xml
trunk/samples/seamIntegration/src/main/resources/import.sql
trunk/samples/seamIntegration/src/main/resources/logging.properties
trunk/samples/seamIntegration/src/main/resources/seam.properties
trunk/samples/seamIntegration/src/main/webapp/
trunk/samples/seamIntegration/src/main/webapp/WEB-INF/
trunk/samples/seamIntegration/src/main/webapp/WEB-INF/components.xml
trunk/samples/seamIntegration/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/seamIntegration/src/main/webapp/WEB-INF/faces-config.xml.l4t
trunk/samples/seamIntegration/src/main/webapp/WEB-INF/web.xml
trunk/samples/seamIntegration/src/main/webapp/index.jsp
trunk/samples/seamIntegration/src/main/webapp/pages/
trunk/samples/seamIntegration/src/main/webapp/pages/index.jsp
trunk/samples/seamIntegration/src/main/webapp/pages/index.xhtml
trunk/samples/seamIntegration/src/main/webapp/pages/repeater.xhtml
trunk/samples/seamIntegration/src/test/
trunk/samples/seamIntegration/src/test/java/
trunk/samples/seamIntegration/src/test/java/org/
trunk/samples/seamIntegration/src/test/java/org/ajax4jsf/
trunk/samples/seamIntegration/src/test/java/org/ajax4jsf/BeanTest.java
trunk/samples/useCases/src/main/webapp/pages/ajaxdata.xhtml
Modified:
trunk/cdk/generator/src/main/resources/META-INF/templates/tag.vm
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxViewHandler.java
trunk/framework/src/main/java/org/ajax4jsf/framework/util/javascript/JSEncoder.java
trunk/framework/src/main/java/org/ajax4jsf/framework/util/javascript/ScriptUtils.java
trunk/framework/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java
trunk/samples/createProject.sh
trunk/samples/pom.xml
trunk/samples/useCases/src/main/java/org/ajax4jsf/Bean.java
Log:
Create sample for Jboss Seam ajax support.
Fixed issues : AJSF-10 , 15 , 18 , 45, 48
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates/tag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates/tag.vm 2007-05-02 01:26:49
UTC (rev 147)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates/tag.vm 2007-05-02 02:10:44
UTC (rev 148)
@@ -84,7 +84,7 @@
#if( !$prop.existintag )
#if(!$prop.el)
if(isValueReference(this._${prop.name})){
- throw new IllegalArgumentException("Component ${component.name} with Id " +
component.getClientId(getFacesContext() +" not allowed EL expression for property
${prop.name}")
+ throw new IllegalArgumentException("Component ${component.name} with Id " +
component.getClientId(getFacesContext()) +" not allowed EL expression for property
${prop.name}");
}
#end
#if($prop.name == "action")
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxViewHandler.java
===================================================================
---
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxViewHandler.java 2007-05-02
01:26:49 UTC (rev 147)
+++
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxViewHandler.java 2007-05-02
02:10:44 UTC (rev 148)
@@ -178,6 +178,7 @@
}
actionURL = externalContext.encodeActionURL(actionURL);
externalContext.redirect(actionURL);
+ context.responseComplete();
} catch (IOException e) {
throw new FacesException(
"Error on redirect for reload expired page", e);
Modified:
trunk/framework/src/main/java/org/ajax4jsf/framework/util/javascript/JSEncoder.java
===================================================================
---
trunk/framework/src/main/java/org/ajax4jsf/framework/util/javascript/JSEncoder.java 2007-05-02
01:26:49 UTC (rev 147)
+++
trunk/framework/src/main/java/org/ajax4jsf/framework/util/javascript/JSEncoder.java 2007-05-02
02:10:44 UTC (rev 148)
@@ -73,6 +73,7 @@
(c == 0x27) || // [']
(c == 0x5c) || // [\]
(c == 0x03) || // [esc]
+ (c == ']') || // ] - to avoid conflicts in CDATA
(c < 0x20) || // See <
http://www.w3.org/TR/REC-xml#charsets>
((c > 0xd7ff) && (c < 0xe000)) || (c > 0xfffd)|| (c >
0xff)) {
return (false);
Modified:
trunk/framework/src/main/java/org/ajax4jsf/framework/util/javascript/ScriptUtils.java
===================================================================
---
trunk/framework/src/main/java/org/ajax4jsf/framework/util/javascript/ScriptUtils.java 2007-05-02
01:26:49 UTC (rev 147)
+++
trunk/framework/src/main/java/org/ajax4jsf/framework/util/javascript/ScriptUtils.java 2007-05-02
02:10:44 UTC (rev 148)
@@ -66,7 +66,7 @@
ret.append(toScript(element));
first = false;
}
- return ret.append(']').toString();
+ return ret.append("] ").toString();
} else if (obj instanceof Collection) {
// Collections put as JavaScript array.
Collection collection = (Collection) obj;
@@ -80,7 +80,7 @@
ret.append(toScript(element));
first = false;
}
- return ret.append(']').toString();
+ return ret.append("] ").toString();
} else if (obj instanceof Map) {
// Maps put as JavaScript hash.
Map map = (Map) obj;
@@ -97,7 +97,7 @@
ret.append(toScript(map.get(key)));
first = false;
}
- return ret.append('}').toString();
+ return ret.append("} ").toString();
} else if (obj instanceof Number || obj instanceof Boolean) {
// numbers and boolean put as-is, without conversion
return obj.toString();
@@ -127,7 +127,7 @@
ret.append(toScript(PropertyUtils.getProperty(obj, key)));
first = false;
}
- return ret.append('}').toString();
+ return ret.append("} ").toString();
} catch (Exception e) {
throw new FacesException(
"Error in conversion Java Object to JavaScript", e);
Modified:
trunk/framework/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java
===================================================================
---
trunk/framework/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java 2007-05-02
01:26:49 UTC (rev 147)
+++
trunk/framework/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java 2007-05-02
02:10:44 UTC (rev 148)
@@ -122,12 +122,30 @@
*/
public void testArrayToScript() {
int[] obj = {1,2,3,4,5};
- assertEquals("[1,2,3,4,5]", ScriptUtils.toScript(obj));
+ assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
}
+ /**
+ * Test method for {@link
org.ajax4jsf.framework.util.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
+ public void testTwoDimentionalArrayToScript() {
+ int[][] obj = {{1,2},{3,4}};
+ assertEquals("[[1,2] ,[3,4] ] ", ScriptUtils.toScript(obj));
+ }
/**
* Test method for {@link
org.ajax4jsf.framework.util.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
+ public void testTwoDimentionalStringArrayToScript() {
+ String[][] obj =
{{"one","two"},{"three","four"}};
+ assertEquals("[['one','two'] ,['three','four'] ]
", ScriptUtils.toScript(obj));
+ HashMap map = new HashMap();
+ map.put("a", obj);
+ map.put("b", "c");
+ assertEquals("{'a':[['one','two']
,['three','four'] ] ,'b':'c'} ",
ScriptUtils.toScript(map));
+ }
+ /**
+ * Test method for {@link
org.ajax4jsf.framework.util.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
public void testListToScript() {
List obj = new ArrayList();
obj.add(new Integer(1));
@@ -135,7 +153,7 @@
obj.add(new Integer(3));
obj.add(new Integer(4));
obj.add(new Integer(5));
- assertEquals("[1,2,3,4,5]", ScriptUtils.toScript(obj));
+ assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
}
/**
@@ -148,14 +166,14 @@
obj.add(new Integer(3));
obj.add(new Integer(4));
obj.add(new Integer(5));
- assertEquals("[1,2,3,4,5]", ScriptUtils.toScript(obj));
+ assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
}
/**
* Test method for {@link
org.ajax4jsf.framework.util.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testObjectArrayToScript() {
Bean[] obj = {new Bean(1,true,"foo"),new Bean(2,false,"bar")};
- assertEquals("[{'bool':true,'foo':'foo',\'integer\':1},{'bool':false,'foo':'bar','integer':2}]",
ScriptUtils.toScript(obj));
+ assertEquals("[{'bool':true,'foo':'foo',\'integer\':1}
,{'bool':false,'foo':'bar','integer':2} ] ",
ScriptUtils.toScript(obj));
}
/**
@@ -164,7 +182,7 @@
public void testObjectListToScript() {
Bean[] array = {new Bean(1,true,"foo"),new Bean(2,false,"bar")};
List obj = Arrays.asList(array);
- assertEquals("[{'bool':true,'foo':'foo',\'integer\':1},{'bool':false,'foo':'bar','integer':2}]",
ScriptUtils.toScript(obj));
+ assertEquals("[{'bool':true,'foo':'foo',\'integer\':1}
,{'bool':false,'foo':'bar','integer':2} ] ",
ScriptUtils.toScript(obj));
}
/**
@@ -175,7 +193,7 @@
obj.put("a", "foo");
obj.put("b", "bar");
obj.put("c", "baz");
- assertEquals("{'a':'foo','b':'bar','c':'baz'}",
ScriptUtils.toScript(obj));
+ assertEquals("{'a':'foo','b':'bar','c':'baz'}
", ScriptUtils.toScript(obj));
}
/**
* Test method for {@link
org.ajax4jsf.framework.util.javascript.ScriptUtils#addEncodedString(java.lang.StringBuffer,
java.lang.Object)}.
Modified: trunk/samples/createProject.sh
===================================================================
--- trunk/samples/createProject.sh 2007-05-02 01:26:49 UTC (rev 147)
+++ trunk/samples/createProject.sh 2007-05-02 02:10:44 UTC (rev 148)
@@ -1,2 +1,2 @@
-#!/bin/sh
+#!/bin/sh
mvn archetype:create -e -DarchetypeGroupId=org.ajax4jsf.cdk
-DarchetypeArtifactId=maven-archetype-jsfwebapp -DarchetypeVersion=1.1.1-SNAPSHOT
-DartifactId=${1}
\ No newline at end of file
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2007-05-02 01:26:49 UTC (rev 147)
+++ trunk/samples/pom.xml 2007-05-02 02:10:44 UTC (rev 148)
@@ -14,6 +14,7 @@
<module>ajaxPortlet</module>
<module>tomahawkCompability</module>
<module>useCases</module>
+ <module>seamIntegration</module>
</modules>
<build>
<plugins>
Added: trunk/samples/seamIntegration/pom.xml
===================================================================
--- trunk/samples/seamIntegration/pom.xml (rev 0)
+++ trunk/samples/seamIntegration/pom.xml 2007-05-02 02:10:44 UTC (rev 148)
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<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>samples</artifactId>
+ <groupId>org.ajax4jsf</groupId>
+ <version>1.1.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.ajax4jsf</groupId>
+ <artifactId>seamIntegration</artifactId>
+ <packaging>war</packaging>
+ <name>seamIntegration Maven Webapp</name>
+ <build>
+ <finalName>seamIntegration</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.2.1.ga</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>3.2.3.ga</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>seam</artifactId>
+ <version>1.2.1.ga</version>
+ <systemPath>${seamHome}/jboss-seam.jar</systemPath>
+ <scope>system</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>seam-ui</artifactId>
+ <version>1.2.1.ga</version>
+ <systemPath>${seamHome}/jboss-seam-ui.jar</systemPath>
+ <scope>system</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.4.ga</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>el-impl</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>1.0</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/Bean.java
===================================================================
--- trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/Bean.java
(rev 0)
+++ trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/Bean.java 2007-05-02 02:10:44
UTC (rev 148)
@@ -0,0 +1,80 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf;
+
+import java.io.Serializable;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpSession;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/**
+ * @author $Autor$
+ *
+ */
+@Name("seamBean") @Scope(ScopeType.CONVERSATION) public class Bean implements
Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -4209339000953631111L;
+ private String text;
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ @Begin
+ public String start() {
+ return "start";
+ }
+
+ @End
+ public String stop() {
+ return "stop";
+ }
+
+ public String clearSession(){
+ ExternalContext externalContext =
FacesContext.getCurrentInstance().getExternalContext();
+ HttpSession session = (HttpSession) externalContext.getSession(false);
+ if(null != session){
+ session.setMaxInactiveInterval(10);
+ }
+ return null;
+ }
+}
\ No newline at end of file
Added: trunk/samples/seamIntegration/src/main/resources/hibernate.cfg.xml
===================================================================
--- trunk/samples/seamIntegration/src/main/resources/hibernate.cfg.xml
(rev 0)
+++ trunk/samples/seamIntegration/src/main/resources/hibernate.cfg.xml 2007-05-02 02:10:44
UTC (rev 148)
@@ -0,0 +1,17 @@
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory name="java:/bookingDatabase">
+ <property name="show_sql">false</property>
+ <property
name="connection.datasource">java:/DefaultDS</property>
+ <property name="hbm2ddl.auto">create-drop</property>
+ <property
name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
+ <property
name="transaction.flush_before_completion">true</property>
+ <property
name="connection.release_mode">after_statement</property>
+ <property
name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
+ <property
name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
+
+ </session-factory>
+</hibernate-configuration>
Added: trunk/samples/seamIntegration/src/main/resources/import.sql
===================================================================
--- trunk/samples/seamIntegration/src/main/resources/import.sql
(rev 0)
+++ trunk/samples/seamIntegration/src/main/resources/import.sql 2007-05-02 02:10:44 UTC
(rev 148)
@@ -0,0 +1,22 @@
+insert into Customer (username, password, name) values ('gavin',
'foobar', 'Gavin King')
+insert into Customer (username, password, name) values ('demo', 'demo',
'Demo User')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 120,
'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta',
'GA', '30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 180,
'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA',
'30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 450,
'W Hotel', 'Union Square, Manhattan', 'NY', 'NY',
'10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450,
'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY',
'10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 250,
'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC',
'20036', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 300,
'70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY',
'10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 300,
'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL',
'33131', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 80,
'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire',
'WI', '54703', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 90,
'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau
Claire', 'WI', '54701', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 160,
'Marriot Downtown', '55 Fourth Street', 'San Francisco',
'CA', '94103', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 200,
'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona',
'Catalunya', '08019', 'Spain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 210,
'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '',
'63405', 'Israel')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 240,
'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo',
'', '105', 'Japan')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 130,
'Hotel Beaulac', ' Esplanade L�opold-Robert 2', 'Neuchatel',
'', '2000', 'Switzerland')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 140,
'Conrad Treasury Place', 'William & George Streets',
'Brisbane', 'QLD', '4001', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 230,
'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal',
'Quebec', 'H3G1H6', 'Canada')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 460,
'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA',
'30326', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 220,
'Swissotel', '68 Market Street', 'Sydney', 'NSW',
'2000', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 250,
'Meli� White House', 'Albany Street', 'Regents Park London',
'', 'NW13UP', 'Great Britain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 210,
'Hotel Allegro', '171 West Randolph Street', 'Chicago',
'IL', '60601', 'USA')
Added: trunk/samples/seamIntegration/src/main/resources/logging.properties
===================================================================
--- trunk/samples/seamIntegration/src/main/resources/logging.properties
(rev 0)
+++ trunk/samples/seamIntegration/src/main/resources/logging.properties 2007-05-02
02:10:44 UTC (rev 148)
@@ -0,0 +1,22 @@
+handlers org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+org.apache.juli.FileHandler.level ALL
+org.apache.juli.FileHandler.directory ${catalina.base}/logs
+org.apache.juli.FileHandler.prefix ajax4jsf.
+
+java.util.logging.ConsoleHandler.level ALL
+java.util.logging.ConsoleHandler.formatter java.util.logging.SimpleFormatter
+
+facelets.level=ALL
+com.sun.faces.level=INFO
+org.apache.myfaces.level=ALL
+org.ajax4jsf.level=ALL
+javax.enterprise.resource.webcontainer.jsf.level=INFO
+com.exadel.level=ALL
+org.jboss.seam.level=FINE
+
\ No newline at end of file
Added: trunk/samples/seamIntegration/src/main/resources/seam.properties
===================================================================
Added: trunk/samples/seamIntegration/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/WEB-INF/components.xml
(rev 0)
+++ trunk/samples/seamIntegration/src/main/webapp/WEB-INF/components.xml 2007-05-02
02:10:44 UTC (rev 148)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components
xmlns="http://jboss.com/products/seam/components"
+
xmlns:core="http://jboss.com/products/seam/core"
+
xmlns:security="http://jboss.com/products/seam/security"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-1.2.xsd
+
http://jboss.com/products/seam/security
http://jboss.com/products/seam/security-1.2.xsd
+
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-1.2.xsd">
+
+ <core:init debug="true" />
+
+ <core:manager conversation-timeout="120000"
+ concurrent-request-timeout="500" conversation-id-parameter="cid"
+ conversation-is-long-running-parameter="clr" />
+ <!--
+ <core:hibernate-session-factory name="hibernateSessionFactory"/>
+ -->
+ <core:microcontainer installed="false" />
+
+</components>
Added: trunk/samples/seamIntegration/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++ trunk/samples/seamIntegration/src/main/webapp/WEB-INF/faces-config.xml 2007-05-02
02:10:44 UTC (rev 148)
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.1//EN"
+
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <lifecycle>
+ <phase-listener>
+ org.jboss.seam.jsf.SeamPhaseListener
+ </phase-listener>
+ </lifecycle>
+ <application>
+ <!-- el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver-->
+ </application>
+
+</faces-config>
Added: trunk/samples/seamIntegration/src/main/webapp/WEB-INF/faces-config.xml.l4t
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/WEB-INF/faces-config.xml.l4t
(rev 0)
+++ trunk/samples/seamIntegration/src/main/webapp/WEB-INF/faces-config.xml.l4t 2007-05-02
02:10:44 UTC (rev 148)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS ENTITY="JSFProcess"/>
Added: trunk/samples/seamIntegration/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ trunk/samples/seamIntegration/src/main/webapp/WEB-INF/web.xml 2007-05-02 02:10:44 UTC
(rev 148)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Archetype Created Web Application</display-name>
+ <context-param>
+ <param-name>facelets.REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.VIEW_MAPPINGS</param-name>
+ <param-value>*.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</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>
+ </filter-mapping>
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>
+ org.jboss.seam.servlet.SeamListener
+ </listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <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>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>
+ org.jboss.seam.servlet.ResourceServlet
+ </servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/samples/seamIntegration/src/main/webapp/index.jsp
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/index.jsp (rev
0)
+++ trunk/samples/seamIntegration/src/main/webapp/index.jsp 2007-05-02 02:10:44 UTC (rev
148)
@@ -0,0 +1,11 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+
+<head></head>
+
+ <body>
+ <jsp:forward page="/pages/index.jsf" />
+ </body>
+
+</html>
\ No newline at end of file
Added: trunk/samples/seamIntegration/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/pages/index.jsp
(rev 0)
+++ trunk/samples/seamIntegration/src/main/webapp/pages/index.jsp 2007-05-02 02:10:44 UTC
(rev 148)
@@ -0,0 +1,12 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ </f:view>
+ </body>
+</html>
Added: trunk/samples/seamIntegration/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/pages/index.xhtml
(rev 0)
+++ trunk/samples/seamIntegration/src/main/webapp/pages/index.xhtml 2007-05-02 02:10:44
UTC (rev 148)
@@ -0,0 +1,12 @@
+<!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:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+ >
+ <f:view>
+
+ </f:view>
+</html>
\ No newline at end of file
Added: trunk/samples/seamIntegration/src/main/webapp/pages/repeater.xhtml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/pages/repeater.xhtml
(rev 0)
+++ trunk/samples/seamIntegration/src/main/webapp/pages/repeater.xhtml 2007-05-02 02:10:44
UTC (rev 148)
@@ -0,0 +1,37 @@
+<!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:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+ <head><title>Simple repeater in seam</title></head>
+ <body>
+ <h1>Simple ajax repeater</h1>
+ <h:form>
+ <h:panelGrid columns="3" border="1">
+ <h:inputText value="#{seamBean.text}">
+ <a4j:support reRender="out,conversation"
event="onkeyup"></a4j:support>
+ </h:inputText>
+ <h:outputText id="out"
value="#{seamBean.text}"></h:outputText>
+ <h:outputText value="All form submit."></h:outputText>
+ <h:inputText value="#{bean.text}">
+ <a4j:support reRender="out,outs,conversation"
event="onkeyup"></a4j:support>
+ </h:inputText>
+ <h:outputText id="outs"
value="#{bean.text}"></h:outputText>
+ <h:outputText value="AJAX Single submit."></h:outputText>
+ <h:outputText id="conversation" value="Conversation ID:
#{conversation.id}"></h:outputText>
+ <a4j:commandButton action="#{seamBean.start}" value="Start
conversation" reRender="out,conversation"></a4j:commandButton>
+ <a4j:commandButton action="#{seamBean.stop}" value="Stop
conversation" reRender="out,conversation"></a4j:commandButton>
+ </h:panelGrid>
+ <a4j:commandButton action="#{seamBean.clearSession}" value="Set
session expiration to 10 sec"
reRender="out,conversation"></a4j:commandButton>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages></h:messages>
+ </a4j:outputPanel>
+ <a4j:status startText="Request..."
stopText=""></a4j:status>
+ <h2>Non-Ajax conversation</h2>
+ <h:commandButton action="#{seamBean.start}" value="Start
conversation" reRender="out,conversation"></h:commandButton>
+ <h:commandButton action="#{seamBean.stop}" value="Stop
conversation" reRender="out,conversation"></h:commandButton>
+ <h:commandButton value="Refresh"
reRender="out,conversation"></h:commandButton>
+ </h:form>
+ <a4j:log hotkey="M"></a4j:log>
+ </body>
+</html>
Added: trunk/samples/seamIntegration/src/test/java/org/ajax4jsf/BeanTest.java
===================================================================
--- trunk/samples/seamIntegration/src/test/java/org/ajax4jsf/BeanTest.java
(rev 0)
+++ trunk/samples/seamIntegration/src/test/java/org/ajax4jsf/BeanTest.java 2007-05-02
02:10:44 UTC (rev 148)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+*/
+public class BeanTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public BeanTest( String testName )
+ {
+ super( testName );
+ }
+
+ public void testStub() throws Exception {
+
+ }
+}
Modified: trunk/samples/useCases/src/main/java/org/ajax4jsf/Bean.java
===================================================================
--- trunk/samples/useCases/src/main/java/org/ajax4jsf/Bean.java 2007-05-02 01:26:49 UTC
(rev 147)
+++ trunk/samples/useCases/src/main/java/org/ajax4jsf/Bean.java 2007-05-02 02:10:44 UTC
(rev 148)
@@ -34,8 +34,12 @@
public class Bean {
private java.lang.String text;
+
+ private String[] array = {"one]","two]]>"};
- public java.lang.String getText() {
+ private String[][] array2 =
{{"one","two"},{"three","four"}};
+
+ public java.lang.String getText() {
return text;
}
@@ -68,5 +72,33 @@
}
return null;
}
+
+ /**
+ * @return the array
+ */
+ public String[] getArray() {
+ return array;
+ }
+
+ /**
+ * @param array the array to set
+ */
+ public void setArray(String[] array) {
+ this.array = array;
+ }
+
+ /**
+ * @return the array2
+ */
+ public String[][] getArray2() {
+ return array2;
+ }
+
+ /**
+ * @param array2 the array2 to set
+ */
+ public void setArray2(String[][] array2) {
+ this.array2 = array2;
+ }
}
\ No newline at end of file
Added: trunk/samples/useCases/src/main/webapp/pages/ajaxdata.xhtml
===================================================================
--- trunk/samples/useCases/src/main/webapp/pages/ajaxdata.xhtml
(rev 0)
+++ trunk/samples/useCases/src/main/webapp/pages/ajaxdata.xhtml 2007-05-02 02:10:44 UTC
(rev 148)
@@ -0,0 +1,33 @@
+<!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:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+ >
+ <head>
+ <title>AJAX Data transfer</title>
+ <script type="text/javascript">
+ function inspect(data){
+ LOG.info("Data is "+data);
+ }
+ </script>
+ </head>
+ <body>
+ <f:view>
+ <h1>Sample of the data transfer from server to client</h1>
+ <h:form>
+ <h:panelGrid columns="2">
+ <a4j:commandButton value="Send" oncomplete="inspect(data);"
data="#{bean.array}"></a4j:commandButton>
+ <h:outputText value="Data is String[]"></h:outputText>
+ <a4j:commandButton value="Send" oncomplete="inspect(data);"
data="#{bean.array2}"></a4j:commandButton>
+ <h:outputText value="Data is String[][]"></h:outputText>
+ <a4j:commandButton value="Send" oncomplete="inspect(data);"
data="#{bean}"></a4j:commandButton>
+ <h:outputText value="Data is JavaBean"></h:outputText>
+ </h:panelGrid>
+ </h:form>
+ <a4j:log popup='false' level="INFO"/>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file