Author: manaRH
Date: 2008-06-24 12:20:32 -0400 (Tue, 24 Jun 2008)
New Revision: 8410
Added:
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/messages.properties
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/backport-util-concurrent.jar
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Authenticator.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/AuthenticatorAction.java
branches/Seam_1_2_1_AP/examples/icefaces/view/css/date.css
branches/Seam_1_2_1_AP/examples/icefaces/view/css/trailblazer_main.css
branches/Seam_1_2_1_AP/examples/icefaces/view/display.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/edit.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/hotelview.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-next.png
branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-prev.png
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/build.xml
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/commons-fileupload.jar
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces-comps.jar
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces-facelets.jar
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces.jar
branches/Seam_1_2_1_AP/examples/icefaces/resources/import.sql
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Booking.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingList.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePassword.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePasswordAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Hotel.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBooking.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBookingAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearching.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearchingAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Register.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/RegisterAction.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/User.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingTest.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/ChangePasswordTest.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/LoginTest.java
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml
branches/Seam_1_2_1_AP/examples/icefaces/view/book.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/confirm.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/css/screen.css
branches/Seam_1_2_1_AP/examples/icefaces/view/home.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/hotel.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/main.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/password.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/register.xhtml
branches/Seam_1_2_1_AP/examples/icefaces/view/template.xhtml
Log:
JBPAPP-801, JBPAPP-477 - rewriten whole icefaces example
Modified: branches/Seam_1_2_1_AP/examples/icefaces/build.xml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/build.xml 2008-06-24 11:19:18 UTC (rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/build.xml 2008-06-24 16:20:32 UTC (rev 8410)
@@ -14,7 +14,7 @@
<property name="src.test.dir" value="src"/>
<property name="test.classpath"
value="test.eejb.classpath"/>
<property name="tomcat.conf"
value="eejb.conf"/>
-
+ <property name="example.commons.lib" value="yes"/>
<property name="example.commons-digester.lib"
value="yes"/>
<import file="../../build.xml"/>
Added:
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/messages.properties
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/messages.properties
(rev 0)
+++
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/messages.properties 2008-06-24
16:20:32 UTC (rev 8410)
@@ -0,0 +1,74 @@
+javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected
type
+javax.faces.component.UIInput.REQUIRED=value is required
+javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted
information
+javax.faces.component.UISelectOne.INVALID=value is not valid
+javax.faces.component.UISelectMany.INVALID=value is not valid
+
+javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number
+javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal
number consisting of zero or more digits, optionally followed by a decimal point and
fraction, eg. {1}
+javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be a number
+javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed
integer number consisting of zero or more digits
+javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false
+javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any
value other than true will evaluate to false)
+javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255
+javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255
+javax.faces.converter.CharacterConverter.CHARACTER=value must be a character
+javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII
character
+javax.faces.convert.DateTimeConverter.CONVERSION = Conversion Error
+javax.faces.convert.DateTimeConverter.CONVERSION_detail = "{1}": Specified
value is not a valid date/time.
+javax.faces.converter.DateTimeConverter.DATE=value must be a date
+javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1}
+javax.faces.converter.DateTimeConverter.TIME=value must be a time
+javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1}
+javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time
+javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time,
eg. {1}
+javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be
specified to convert the value
+javax.faces.converter.DoubleConverter.DOUBLE=value must be a number
+javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between
4.9E-324 and 1.7976931348623157E308
+javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum
+javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or
from the enum that contains the constant {1}
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or
from the enum, but no enum class provided
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an
enum or from the enum, but no enum class provided
+javax.faces.converter.FloatConverter.FLOAT=value must be a number
+javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45
and 3.4028235E38
+javax.faces.converter.IntegerConverter.INTEGER=value must be a number
+javax.faces.converter.IntegerConverter.INTEGER_detail=value must be a number between
-2147483648 and 2147483647
+javax.faces.converter.LongConverter.LONG=value must be a number
+javax.faces.converter.LongConverter.LONG_detail=must be a number between
-9223372036854775808 and 9223372036854775807
+javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount
+javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount,
eg. {1}
+javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount
+javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount,
eg. {1}
+javax.faces.converter.NumberConverter.NUMBER=value must be a number
+javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number
+javax.faces.converter.NumberConverter.PATTERN=value must be a number
+javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number
+javax.faces.converter.ShortConverter.SHORT=value must be a number
+javax.faces.converter.ShortConverter.SHORT_detail=value must be a number between -32768
and 32767
+
+#JSF 1.1:
+javax.faces.convert.BigDecimalConverter.CONVERSION = value must be a number
+javax.faces.convert.BigDecimalConverter.CONVERSION_detail = value must be a number
+javax.faces.convert.BigIntegerConverter.CONVERSION = value must be an integre
+javax.faces.convert.BigIntegerConverter.CONVERSION_detail = value must be a number
+javax.faces.convert.BooleanConverter.CONVERSION = value must be true or false
+javax.faces.convert.BooleanConverter.CONVERSION_detail = value must be true or false
+javax.faces.convert.ByteConverter.CONVERSION = value must be a byte
+javax.faces.convert.ByteConverter.CONVERSION_detail = value must be a byte
+javax.faces.convert.CharacterConverter.CONVERSION = value must be a character
+javax.faces.convert.CharacterConverter.CONVERSION_detail = value must be a character
+javax.faces.convert.DateTimeConverter.CONVERSION = value must be a datetime
+javax.faces.convert.DateTimeConverter.CONVERSION_detail = value must be a datetime
+javax.faces.convert.DoubleConverter.CONVERSION = value must be a number
+javax.faces.convert.DoubleConverter.CONVERSION_detail = value must be a number
+javax.faces.convert.FloatConverter.CONVERSION = value must be a number
+javax.faces.convert.FloatConverter.CONVERSION_detail = value must be a number
+javax.faces.convert.IntegerConverter.CONVERSION = value must be an integer
+javax.faces.convert.IntegerConverter.CONVERSION_detail = value must be an integer
+javax.faces.convert.LongConverter.CONVERSION = value must be an integer
+javax.faces.convert.LongConverter.CONVERSION_detail = value must be a long integer
+javax.faces.convert.NumberConverter.CONVERSION = value must be a number
+javax.faces.convert.NumberConverter.CONVERSION_detail = value must be a number
+javax.faces.convert.ShortConverter.CONVERSION = value must be an integer
+javax.faces.convert.ShortConverter.CONVERSION_detail = value must be a short integer
+
Property changes on:
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/classes/messages.properties
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added:
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/backport-util-concurrent.jar
===================================================================
(Binary files differ)
Property changes on:
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/backport-util-concurrent.jar
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/commons-fileupload.jar
===================================================================
(Binary files differ)
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces-comps.jar
===================================================================
(Binary files differ)
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces-facelets.jar
===================================================================
(Binary files differ)
Modified: branches/Seam_1_2_1_AP/examples/icefaces/resources/WEB-INF/lib/icefaces.jar
===================================================================
(Binary files differ)
Modified: branches/Seam_1_2_1_AP/examples/icefaces/resources/import.sql
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/resources/import.sql 2008-06-24 11:19:18 UTC
(rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/resources/import.sql 2008-06-24 16:20:32 UTC
(rev 8410)
@@ -1,22 +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, name, address, city, state, zip, country) values (1, 'Marriott
Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA',
'30305', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (2,
'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA',
'30305', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (3, 'W
Hotel', 'Union Square, Manhattan', 'NY', 'NY',
'10011', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (4, 'W
Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY',
'10011', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (5, 'Hotel
Rouge', '1315 16th Street NW', 'Washington', 'DC',
'20036', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (6, '70 Park
Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011',
'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (8, 'Conrad
Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131',
'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (9, 'Sea
Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI',
'54703', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (10, 'Super 8
Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire',
'WI', '54701', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (11, 'Marriot
Downtown', '55 Fourth Street', 'San Francisco', 'CA',
'94103', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (12, 'Hilton
Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona',
'Catalunya', '08019', 'Spain')
-insert into Hotel (id, name, address, city, state, zip, country) values (13, 'Hilton
Tel Aviv', 'Independence Park', 'Tel Aviv', '',
'63405', 'Israel')
-insert into Hotel (id, name, address, city, state, zip, country) values (14,
'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo',
'', '105', 'Japan')
-insert into Hotel (id, name, address, city, state, zip, country) values (15, 'Hotel
Beaulac', ' Esplanade L�opold-Robert 2', 'Neuchatel', '',
'2000', 'Switzerland')
-insert into Hotel (id, name, address, city, state, zip, country) values (16, 'Conrad
Treasury Place', 'William & George Streets', 'Brisbane',
'QLD', '4001', 'Australia')
-insert into Hotel (id, name, address, city, state, zip, country) values (17, 'Ritz
Carlton', '1228 Sherbrooke St', 'West Montreal', 'Quebec',
'H3G1H6', 'Canada')
-insert into Hotel (id, name, address, city, state, zip, country) values (18, 'Ritz
Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA',
'30326', 'USA')
-insert into Hotel (id, name, address, city, state, zip, country) values (19,
'Swissotel', '68 Market Street', 'Sydney', 'NSW',
'2000', 'Australia')
-insert into Hotel (id, name, address, city, state, zip, country) values (20, 'Meli�
White House', 'Albany Street', 'Regents Park London', '',
'NW13UP', 'Great Britain')
-insert into Hotel (id, name, address, city, state, zip, country) values (21, 'Hotel
Allegro', '171 West Randolph Street', 'Chicago', 'IL',
'60601', 'USA')
+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:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Authenticator.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Authenticator.java
(rev 0)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Authenticator.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -0,0 +1,9 @@
+package org.jboss.seam.example.booking;
+
+import javax.ejb.Local;
+
+@Local
+public interface Authenticator
+{
+ boolean authenticate();
+}
Property changes on:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Authenticator.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/AuthenticatorAction.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/AuthenticatorAction.java
(rev 0)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/AuthenticatorAction.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -0,0 +1,39 @@
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.util.List;
+
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+
+@Stateless
+@Name("authenticator")
+public class AuthenticatorAction implements Authenticator
+{
+ @PersistenceContext EntityManager em;
+
+ @Out(required=false, scope = SESSION)
+ private User user;
+
+ public boolean authenticate()
+ {
+ List results = em.createQuery("select u from User u where
u.username=#{identity.username} and u.password=#{identity.password}")
+ .getResultList();
+
+ if ( results.size()==0 )
+ {
+ return false;
+ }
+ else
+ {
+ user = (User) results.get(0);
+ return true;
+ }
+ }
+
+}
Property changes on:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/AuthenticatorAction.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Booking.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Booking.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Booking.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,7 +1,8 @@
-//$Id: Booking.java,v 1.11 2006/10/25 15:31:57 gavin Exp $
+//$Id: Booking.java 3028 2006-12-16 14:38:42Z gavin $
package org.jboss.seam.example.booking;
import java.io.Serializable;
+import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.Date;
@@ -42,7 +43,19 @@
this.hotel = hotel;
this.user = user;
}
+
+ @Transient
+ public BigDecimal getTotal()
+ {
+ return hotel.getPrice().multiply( new BigDecimal( getNights() ) );
+ }
+ @Transient
+ public int getNights()
+ {
+ return (int) ( checkoutDate.getTime() - checkinDate.getTime() ) / 1000 / 60 / 60 /
24;
+ }
+
@Id @GeneratedValue
public Long getId()
{
@@ -112,7 +125,7 @@
public String getDescription()
{
DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
- return hotel.getName() +
+ return hotel==null ? null : hotel.getName() +
", " + df.format( getCheckinDate() ) +
" to " + df.format( getCheckoutDate() );
}
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingList.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingList.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingList.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: BookingList.java,v 1.2 2006/11/20 18:03:01 gavin Exp $
+//$Id: BookingList.java 3036 2006-12-17 01:07:25Z gavin $
package org.jboss.seam.example.booking;
import javax.ejb.Local;
@@ -7,6 +7,7 @@
public interface BookingList
{
public void getBookings();
- public String cancel();
+ public Booking getBooking();
+ public void cancel();
public void destroy();
}
\ No newline at end of file
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/BookingListAction.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,39 +1,34 @@
-//$Id: BookingListAction.java,v 1.2 2006/11/20 18:03:01 gavin Exp $
+//$Id: BookingListAction.java 3830 2007-02-13 03:49:42Z sbryzak2 $
package org.jboss.seam.example.booking;
-
import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
import static org.jboss.seam.ScopeType.SESSION;
-
import java.io.Serializable;
import java.util.List;
-
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.ejb.TransactionAttribute;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.datamodel.DataModel;
import org.jboss.seam.annotations.datamodel.DataModelSelection;
+import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.core.FacesMessages;
import org.jboss.seam.log.Log;
-
@Stateful
@Scope(SESSION)
@Name("bookingList")
-@LoggedIn
+(a)Restrict("#{identity.loggedIn}")
@TransactionAttribute(REQUIRES_NEW)
public class BookingListAction implements BookingList, Serializable
{
-
+ private static final long serialVersionUID = 1L;
@PersistenceContext
private EntityManager em;
@@ -43,7 +38,6 @@
@DataModel
private List<Booking> bookings;
@DataModelSelection
- @Out(required=false)
private Booking booking;
@Logger
@@ -58,17 +52,20 @@
.getResultList();
}
- public String cancel()
+ public void cancel()
{
- log.info("Cancel booking: #0 for #{user.username}", booking.getId());
+ log.info("Cancel booking: #{bookingList.booking.id} for
#{user.username}");
Booking cancelled = em.find(Booking.class, booking.getId());
if (cancelled!=null) em.remove( cancelled );
getBookings();
- FacesMessages.instance().add("Booking cancelled for confirmation number
#{booking.id}");
- return "main";
+ FacesMessages.instance().add("Booking cancelled for confirmation number
#{bookingList.booking.id}");
}
+ public Booking getBooking()
+ {
+ return booking;
+ }
+
@Destroy @Remove
public void destroy() {}
-
}
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePassword.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePassword.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePassword.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: ChangePassword.java,v 1.2 2005/09/10 16:23:35 gavin Exp $
+//$Id: ChangePassword.java 3036 2006-12-17 01:07:25Z gavin $
package org.jboss.seam.example.booking;
import javax.ejb.Local;
@@ -6,8 +6,8 @@
@Local
public interface ChangePassword
{
- public String changePassword();
- public String cancel();
+ public void changePassword();
+ public boolean isChanged();
public String getVerify();
public void setVerify(String verify);
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePasswordAction.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePasswordAction.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/ChangePasswordAction.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,27 +1,23 @@
-//$Id: ChangePasswordAction.java,v 1.15 2006/04/27 23:04:47 gavin Exp $
+//$Id: ChangePasswordAction.java 3830 2007-02-13 03:49:42Z sbryzak2 $
package org.jboss.seam.example.booking;
-
import static org.jboss.seam.ScopeType.EVENT;
-
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.core.FacesMessages;
-
@Stateful
@Scope(EVENT)
@Name("changePassword")
-@LoggedIn
+(a)Restrict("#{identity.loggedIn}")
public class ChangePasswordAction implements ChangePassword
{
-
@In @Out
private User user;
@@ -30,39 +26,40 @@
private String verify;
- public String changePassword()
+ private boolean changed;
+
+ @In
+ private FacesMessages facesMessages;
+
+ public void changePassword()
{
if ( user.getPassword().equals(verify) )
{
user = em.merge(user);
- FacesMessages.instance().add("Password updated");
- return "main";
+ facesMessages.add("Password updated");
+ changed = true;
}
else
{
- FacesMessages.instance().add("verify", "Re-enter new
password");
+ facesMessages.addToControl("verify", "Re-enter new
password");
revertUser();
verify=null;
- return null;
}
}
- public String cancel()
+ public boolean isChanged()
{
- revertUser();
- return "main";
+ return changed;
}
-
+
private void revertUser()
{
user = em.find(User.class, user.getUsername());
}
-
public String getVerify()
{
return verify;
}
-
public void setVerify(String verify)
{
this.verify = verify;
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Hotel.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Hotel.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Hotel.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,8 +1,10 @@
-//$Id: Hotel.java,v 1.10 2006/10/25 15:31:57 gavin Exp $
+//$Id: Hotel.java 3009 2006-12-15 13:26:33Z gavin $
package org.jboss.seam.example.booking;
import java.io.Serializable;
+import java.math.BigDecimal;
+import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@@ -22,6 +24,7 @@
private String state;
private String zip;
private String country;
+ private BigDecimal price;
@Id @GeneratedValue
public Long getId()
@@ -88,12 +91,21 @@
{
return country;
}
-
public void setCountry(String country)
{
this.country = country;
}
+ @Column(precision=6, scale=2)
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ public void setPrice(BigDecimal price)
+ {
+ this.price = price;
+ }
+
@Override
public String toString()
{
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBooking.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBooking.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBooking.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: HotelBooking.java,v 1.11 2006/09/28 01:16:05 gavin Exp $
+//$Id: HotelBooking.java 3036 2006-12-17 01:07:25Z gavin $
package org.jboss.seam.example.booking;
import javax.ejb.Local;
@@ -6,15 +6,17 @@
@Local
public interface HotelBooking
{
- public String selectHotel(Hotel selectedHotel);
+ public void selectHotel(Hotel selectedHotel);
- public String bookHotel();
+ public void bookHotel();
- public String setBookingDetails();
+ public void setBookingDetails();
+ public boolean isBookingValid();
- public String confirm();
- public String cancel();
+ public void confirm();
+ public void cancel();
+
public void destroy();
}
\ No newline at end of file
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBookingAction.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBookingAction.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelBookingAction.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,15 +1,11 @@
-//$Id: HotelBookingAction.java,v 1.2 2006/11/20 09:22:11 gavin Exp $
+//$Id: HotelBookingAction.java 4306 2007-03-09 01:18:21Z gavin $
package org.jboss.seam.example.booking;
-
import static javax.persistence.PersistenceContextType.EXTENDED;
-
import java.util.Calendar;
-
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.End;
@@ -17,13 +13,13 @@
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.core.Events;
import org.jboss.seam.core.FacesMessages;
import org.jboss.seam.log.Log;
-
@Stateful
@Name("hotelBooking")
-@LoggedIn
+(a)Restrict("#{identity.loggedIn}")
public class HotelBookingAction implements HotelBooking
{
@@ -33,8 +29,7 @@
@In
private User user;
- @In(required=false)
- @Out(required=false)
+ @In(required=false) @Out
private Hotel hotel;
@In(required=false)
@@ -50,65 +45,59 @@
@Logger
private Log log;
+ private boolean bookingValid;
+
@Begin
- public String selectHotel(Hotel selectedHotel)
+ public void selectHotel(Hotel selectedHotel)
{
hotel = em.merge(selectedHotel);
- return "hotel";
}
- public String bookHotel()
+ public void bookHotel()
{
booking = new Booking(hotel, user);
Calendar calendar = Calendar.getInstance();
booking.setCheckinDate( calendar.getTime() );
calendar.add(Calendar.DAY_OF_MONTH, 1);
booking.setCheckoutDate( calendar.getTime() );
-
- return "book";
}
-
- public String setBookingDetails()
+ public void setBookingDetails()
{
- if (booking==null || hotel==null) return "main";
-
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -1);
if ( booking.getCheckinDate().before( calendar.getTime() ) )
{
- facesMessages.add("Check in date must be a future date");
- return null;
+ facesMessages.addToControl("checkinDate", "Check in date must be
a future date");
+ bookingValid=false;
}
else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
{
- facesMessages.add("Check out date must be later than check in date");
- return null;
+ facesMessages.addToControl("checkoutDate", "Check out date must
be later than check in date");
+ bookingValid=false;
}
else
{
- return "confirm";
+ bookingValid=true;
}
}
-
+
+ public boolean isBookingValid()
+ {
+ return bookingValid;
+ }
+
@End
- public String confirm()
+ public void confirm()
{
- if (booking==null || hotel==null) return "main";
em.persist(booking);
facesMessages.add("Thank you, #{user.name}, your confimation number for
#{hotel.name} is #{booking.id}");
log.info("New booking: #{booking.id} for #{user.username}");
- events.raiseEvent("bookingConfirmed");
- return "confirmed";
+ events.raiseTransactionSuccessEvent("bookingConfirmed");
}
@End
- public String cancel()
- {
- System.out.println("Cancelling hotel booking. ");
- return "main";
- }
+ public void cancel() {}
@Destroy @Remove
public void destroy() {}
-
}
\ No newline at end of file
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearching.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearching.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearching.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,11 +1,8 @@
-//$Id: HotelSearching.java,v 1.3 2006/11/20 16:54:53 gavin Exp $
+//$Id: HotelSearching.java 4127 2007-02-25 19:09:39Z gavin $
package org.jboss.seam.example.booking;
-import java.util.List;
-
import javax.ejb.Local;
import javax.faces.event.ValueChangeEvent;
-import javax.faces.model.SelectItem;
@Local
public interface HotelSearching
@@ -15,15 +12,16 @@
public String getSearchString();
public void setSearchString(String searchString);
- public void handleSearchStringChange(ValueChangeEvent e);
- public void handlePageSizeChange(ValueChangeEvent e);
- public SelectItem[] getPageSizes();
- public List<SelectItem> getCities();
- public String find();
- public String nextPage();
+ public String getSearchPattern();
+
+ public void find();
+ public void nextPage();
public boolean isNextPageAvailable();
+
+ public void handleSearchStringChange(ValueChangeEvent e);
+ public void handlePageSizeChange(ValueChangeEvent e);
public void destroy();
-}
+}
\ No newline at end of file
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearchingAction.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearchingAction.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/HotelSearchingAction.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,25 +1,24 @@
-//$Id: HotelSearchingAction.java,v 1.4 2006/11/20 18:03:01 gavin Exp $
+//$Id: HotelSearchingAction.java 4127 2007-02-25 19:09:39Z gavin $
package org.jboss.seam.example.booking;
-
import java.util.List;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.faces.event.ValueChangeEvent;
-import javax.faces.model.SelectItem;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.datamodel.DataModel;
-
+import org.jboss.seam.annotations.security.Restrict;
@Stateful
@Name("hotelSearch")
@Scope(ScopeType.SESSION)
-@LoggedIn
+(a)Restrict("#{identity.loggedIn}")
public class HotelSearchingAction implements HotelSearching
{
@@ -33,83 +32,68 @@
@DataModel
private List<Hotel> hotels;
- public String find()
+ public void find()
{
page = 0;
- queryHotels();
- return "main";
+ queryHotels();
}
-
- public String nextPage()
+ public void nextPage()
{
page++;
queryHotels();
- return "main";
}
-
+
+ public void handleSearchStringChange(ValueChangeEvent e) {
+ page = 0;
+ setSearchString( (String) e.getNewValue() );
+ queryHotels();
+ }
+
+ public void handlePageSizeChange(ValueChangeEvent e) {
+ page=0;
+ setPageSize( (Integer) e.getNewValue() );
+ queryHotels();
+ }
+
private void queryHotels()
{
- hotels = em.createQuery("select h from Hotel h where lower(h.name) like
:search or lower(h.city) like :search or lower(h.zip) like :search or lower(h.address)
like :search")
- .setParameter( "search", getSearchPattern() )
+ hotels = em.createQuery("select h from Hotel h where lower(h.name) like
#{pattern} or lower(h.city) like #{pattern} or lower(h.zip) like #{pattern} or
lower(h.address) like #{pattern}")
.setMaxResults(pageSize)
.setFirstResult( page * pageSize )
.getResultList();
+
}
-
- private String getSearchPattern()
- {
- return searchString==null ? "%" :
searchString.toLowerCase().replace('*', '%') + '%';
- }
public boolean isNextPageAvailable()
{
- return hotels!=null && hotels.size()==pageSize;
+ return (hotels!=null && hotels.size()==pageSize);
}
- public SelectItem[] getPageSizes() {
- return new SelectItem[] {
- new SelectItem("5"),
- new SelectItem("10"),
- new SelectItem("20")
- };
- }
-
public int getPageSize() {
return pageSize;
}
-
+
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
-
+
+ @Factory(value="pattern", scope=ScopeType.EVENT)
+ public String getSearchPattern()
+ {
+ return searchString==null ?
+ "%" : '%' + searchString.toLowerCase().replace('*',
'%') + '%';
+ }
+
public String getSearchString()
{
return searchString;
}
-
+
public void setSearchString(String searchString)
{
this.searchString = searchString;
}
-
- public void handleSearchStringChange(ValueChangeEvent e) {
- page = 0;
- setSearchString( (String) e.getNewValue() );
- queryHotels();
- }
- public List<SelectItem> getCities() {
- return em.createQuery("select distinct new
javax.faces.model.SelectItem(h.city) from Hotel h where lower(h.city) like :search order
by h.city")
- .setParameter("search", getSearchPattern())
- .getResultList();
- }
-
- public void handlePageSizeChange(ValueChangeEvent e) {
- setPageSize( (Integer) e.getNewValue() );
- queryHotels();
- }
-
@Destroy @Remove
public void destroy() {}
-
-}
+}
\ No newline at end of file
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Register.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Register.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/Register.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: Register.java,v 1.1 2005/08/23 09:17:39 gavin Exp $
+//$Id: Register.java 3069 2006-12-19 01:38:51Z gavin $
package org.jboss.seam.example.booking;
import javax.ejb.Local;
@@ -6,9 +6,11 @@
@Local
public interface Register
{
- public String register();
+ public void register();
+ public void invalid();
public String getVerify();
public void setVerify(String verify);
+ public boolean isRegistered();
public void destroy();
}
\ No newline at end of file
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/RegisterAction.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/RegisterAction.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/RegisterAction.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,27 +1,21 @@
-//$Id: RegisterAction.java,v 1.1 2006/11/20 05:19:01 gavin Exp $
+//$Id: RegisterAction.java 4127 2007-02-25 19:09:39Z gavin $
package org.jboss.seam.example.booking;
-
import static org.jboss.seam.ScopeType.EVENT;
-
import java.util.List;
-
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.core.FacesMessages;
-
@Stateful
@Scope(EVENT)
@Name("register")
public class RegisterAction implements Register
{
-
@In
private User user;
@@ -29,42 +23,49 @@
private EntityManager em;
@In
- private transient FacesMessages facesMessages;
+ private FacesMessages facesMessages;
private String verify;
- public String register()
+ private boolean registered;
+
+ public void register()
{
if ( user.getPassword().equals(verify) )
{
- List existing = em.createQuery("select u.username from User u where
u.username=:username")
- .setParameter("username", user.getUsername())
+ List existing = em.createQuery("select u.username from User u where
u.username=#{user.username}")
.getResultList();
if (existing.size()==0)
{
em.persist(user);
facesMessages.add("Successfully registered as #{user.username}");
- return "login";
+ registered = true;
}
else
{
- facesMessages.add("Username #{user.username} already exists");
- return null;
+ facesMessages.addToControl("username", "Username
#{user.username} already exists");
}
}
else
{
- facesMessages.add("verify", "Re-enter your password");
+ facesMessages.addToControl("verify", "Re-enter your
password");
verify=null;
- return null;
}
}
-
+
+ public void invalid()
+ {
+ facesMessages.add("Please try again");
+ }
+
+ public boolean isRegistered()
+ {
+ return registered;
+ }
public String getVerify()
{
return verify;
}
-
public void setVerify(String verify)
{
this.verify = verify;
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/User.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/User.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/User.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: User.java,v 1.5 2006/10/25 15:31:57 gavin Exp $
+//$Id: User.java 2352 2006-10-25 15:31:57Z gavin $
package org.jboss.seam.example.booking;
import static org.jboss.seam.ScopeType.SESSION;
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingTest.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingTest.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/BookingTest.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: BookingTest.java,v 1.39 2006/10/26 21:10:41 gavin Exp $
+//$Id: BookingTest.java 3831 2007-02-13 04:00:57Z sbryzak2 $
package org.jboss.seam.example.booking.test;
import java.util.Calendar;
@@ -26,13 +26,15 @@
public void testBookHotel() throws Exception
{
- new FacesRequest()
- {
+ new FacesRequest() {
+
@Override
protected void invokeApplication() throws Exception
{
- Contexts.getSessionContext().set("loggedIn", true);
Contexts.getSessionContext().set("user", new User("Gavin
King", "foobar", "gavin"));
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ invokeMethod("#{identity.login}");
}
}.run();
@@ -48,7 +50,7 @@
@Override
protected void invokeApplication()
{
- assert
invokeMethod("#{hotelSearch.find}").equals("main");
+ assert invokeMethod("#{hotelSearch.find}")==null;
}
@Override
@@ -63,16 +65,19 @@
}.run();
- String id = new NonFacesRequest("/hotel.xhtml") {
-
+ String id = new FacesRequest("/hotel.xhtml") {
+
@Override
- protected void renderResponse()
- {
+ protected void invokeApplication() throws Exception {
HotelBooking hotelBooking = (HotelBooking)
getInstance("hotelBooking");
DataModel hotels = (DataModel)
Contexts.getSessionContext().get("hotels");
assert hotels.getRowCount()==1;
- String outcome = hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
- assert "hotel".equals(outcome);
+ hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
+ }
+
+ @Override
+ protected void renderResponse()
+ {
Hotel hotel = (Hotel)
Contexts.getConversationContext().get("hotel");
assert hotel.getCity().equals("NY");
assert hotel.getZip().equals("10011");
@@ -86,7 +91,7 @@
@Override
protected void invokeApplication()
{
- assert
invokeMethod("#{hotelBooking.bookHotel}").equals("book");
+ invokeMethod("#{hotelBooking.bookHotel}");
}
@Override
@@ -191,7 +196,7 @@
@Override
protected void invokeApplication()
{
- assert
invokeMethod("#{hotelBooking.setBookingDetails}").equals("confirm");
+ invokeMethod("#{hotelBooking.setBookingDetails}");
}
@Override
@@ -207,18 +212,12 @@
@Override
protected void invokeApplication()
{
- assert
invokeMethod("#{hotelBooking.confirm}").equals("confirmed");
+ invokeMethod("#{hotelBooking.confirm}");
}
-
- @Override
- protected void renderResponse()
- {
- assert !Manager.instance().isLongRunningConversation();
- }
}.run();
- new NonFacesRequest("/confirmed.xhtml") {
+ new NonFacesRequest("/main.xhtml") {
@Override
protected void renderResponse()
@@ -241,7 +240,7 @@
{
ListDataModel bookings = (ListDataModel)
Contexts.getSessionContext().get("bookings");
bookings.setRowIndex(0);
- assert
invokeMethod("#{bookingList.cancel}").equals("main");
+ invokeMethod("#{bookingList.cancel}");
}
@Override
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/ChangePasswordTest.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/ChangePasswordTest.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/ChangePasswordTest.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,4 +1,4 @@
-//$Id: ChangePasswordTest.java,v 1.13 2006/10/26 21:10:41 gavin Exp $
+//$Id: ChangePasswordTest.java 3831 2007-02-13 04:00:57Z sbryzak2 $
package org.jboss.seam.example.booking.test;
import org.jboss.seam.contexts.Contexts;
@@ -19,8 +19,10 @@
@Override
protected void invokeApplication() throws Exception
{
- Contexts.getSessionContext().set("loggedIn", true);
Contexts.getSessionContext().set("user", new User("Gavin
King", "foobar", "gavin"));
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ invokeMethod("#{identity.login}");
}
}.run();
@@ -41,7 +43,7 @@
assert getValue("#{user.username}").equals("gavin");
assert getValue("#{user.password}").equals("foobar");
assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
+ assert getValue("#{identity.loggedIn}").equals(true);
}
@@ -69,7 +71,7 @@
assert getValue("#{user.username}").equals("gavin");
assert getValue("#{user.password}").equals("foobar");
assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
+ assert getValue("#{identity.loggedIn}").equals(true);
}
}.run();
@@ -86,7 +88,7 @@
@Override
protected void invokeApplication()
{
- assert
invokeMethod("#{changePassword.changePassword}").equals("main");
+ invokeMethod("#{changePassword.changePassword}");
}
@Override
@@ -96,7 +98,7 @@
assert getValue("#{user.username}").equals("gavin");
assert getValue("#{user.password}").equals("xxxyyy");
assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
+ assert getValue("#{identity.loggedIn}").equals(true);
}
@@ -115,7 +117,7 @@
@Override
protected void invokeApplication()
{
- assert
invokeMethod("#{changePassword.changePassword}").equals("main");
+ invokeMethod("#{changePassword.changePassword}");
}
@Override
@@ -125,7 +127,7 @@
assert getValue("#{user.username}").equals("gavin");
assert getValue("#{user.password}").equals("foobar");
assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
+ assert getValue("#{identity.loggedIn}").equals(true);
}
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/LoginTest.java
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/LoginTest.java 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/LoginTest.java 2008-06-24
16:20:32 UTC (rev 8410)
@@ -1,8 +1,7 @@
-//$Id: LoginTest.java,v 1.21 2006/10/26 18:34:08 gavin Exp $
+//$Id: LoginTest.java 3831 2007-02-13 04:00:57Z sbryzak2 $
package org.jboss.seam.example.booking.test;
import org.jboss.seam.Seam;
-import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Manager;
import org.jboss.seam.mock.SeamTest;
import org.testng.annotations.Test;
@@ -20,16 +19,8 @@
protected void invokeApplication()
{
assert !isSessionInvalid();
- assert
invokeMethod("#{hotelSearch.find}").equals("login");
+ assert getValue("#{identity.loggedIn}").equals(false);
}
-
- @Override
- protected void renderResponse()
- {
- assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn")==null;
-
- }
}.run();
@@ -39,14 +30,14 @@
protected void updateModelValues() throws Exception
{
assert !isSessionInvalid();
- setValue("#{user.username}", "gavin");
- setValue("#{user.password}", "foobar");
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
}
@Override
protected void invokeApplication()
{
- assert invokeMethod("#{login.login}").equals("main");
+ invokeMethod("#{identity.login}");
}
@Override
@@ -56,8 +47,7 @@
assert getValue("#{user.username}").equals("gavin");
assert getValue("#{user.password}").equals("foobar");
assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
-
+ assert getValue("#{identity.loggedIn}").equals(true);
}
}.run();
@@ -68,16 +58,8 @@
protected void invokeApplication()
{
assert !isSessionInvalid();
- assert
invokeMethod("#{hotelSearch.find}").equals("main");
+ assert getValue("#{identity.loggedIn}").equals(true);
}
-
- @Override
- protected void renderResponse()
- {
- assert !Manager.instance().isLongRunningConversation();
- assert Contexts.getSessionContext().get("loggedIn").equals(true);
-
- }
}.run();
@@ -88,13 +70,14 @@
{
assert !Manager.instance().isLongRunningConversation();
assert !isSessionInvalid();
- assert invokeMethod("#{logout.logout}").equals("login");
+ invokeMethod("#{identity.logout}");
assert Seam.isSessionInvalid();
}
@Override
protected void renderResponse()
{
+ assert getValue("#{identity.loggedIn}").equals(false);
assert Seam.isSessionInvalid();
}
Modified:
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml
===================================================================
---
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml 2008-06-24
11:19:18 UTC (rev 8409)
+++
branches/Seam_1_2_1_AP/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml 2008-06-24
16:20:32 UTC (rev 8410)
@@ -20,16 +20,4 @@
</classes>
</test>
- <!--test name="Switch Conversation">
- <classes>
- <class
name="org.jboss.seam.example.booking.test.SwitchConversationTest"/>
- </classes>
- </test-->
-
- <test name="Booking Unit">
- <classes>
- <class
name="org.jboss.seam.example.booking.test.BookingUnitTest"/>
- </classes>
- </test>
-
</suite>
\ No newline at end of file
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/book.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/book.xhtml 2008-06-24 11:19:18 UTC (rev
8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/book.xhtml 2008-06-24 16:20:32 UTC (rev
8410)
@@ -7,157 +7,102 @@
xmlns:ice="http://www.icesoft.com/icefaces/component"
template="template.xhtml">
+<ice:outputStyle href="./xmlhttp/css/xp/xp.css"/>
+
<!-- content -->
<ui:define name="content">
<div class="section">
<h1>Book Hotel</h1>
</div>
<div class="section">
- <h:form id="booking">
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
+ <ui:include src="hotelview.xhtml"/>
+
+ <div style="clear:both"/>
+
+ <ice:form id="booking">
<fieldset>
- <div class="entry">
- <div class="label">Name:</div>
- <div class="output">#{hotel.name}</div>
- </div>
- <div class="entry">
- <div class="label">Address:</div>
- <div class="output">#{hotel.address}</div>
- </div>
- <div class="entry">
- <div class="label">City, State:</div>
- <div class="output">#{hotel.city}, #{hotel.state}</div>
- </div>
- <div class="entry">
- <div class="label">Zip:</div>
- <div class="output">#{hotel.zip}</div>
- </div>
- <div class="entry">
- <div class="label">Country:</div>
- <div class="output">#{hotel.country}</div>
- </div>
-
- <s:validateAll>
-
- <f:facet name="aroundInvalidField">
- <s:span styleClass="errors"/>
- </f:facet>
-
- <div class="entry">
- <div class="label"><h:outputLabel
for="checkinDate">Check In Date:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:selectInputDate id="checkinDate"
value="#{booking.checkinDate}" renderAsPopup="true"
partialSubmit="true"/>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
- <div class="entry">
- <div class="label"><h:outputLabel
for="checkoutDate">Check Out Date:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:selectInputDate id="checkoutDate"
value="#{booking.checkoutDate}" renderAsPopup="true"
partialSubmit="true"/>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
-
- <div class="entry">
- <div class="label"><h:outputLabel for="beds">Room
Preference:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <h:selectOneMenu id="beds" value="#{booking.beds}">
- <f:selectItem itemLabel="One king-size bed"
itemValue="1"/>
- <f:selectItem itemLabel="Two double beds"
itemValue="2"/>
- <f:selectItem itemLabel="Three beds" itemValue="3"/>
- </h:selectOneMenu>
- <br/>
- </s:decorate>
- </div>
- </div>
-
- <div class="entry">
- <div class="label"><h:outputLabel
for="smoking">Smoking Preference:</h:outputLabel></div>
- <div id="radio" class="input">
- <s:decorate>
- <h:selectOneRadio id="smoking" value="#{booking.smoking}"
layout="pageDirection">
- <f:selectItem itemLabel="Smoking" itemValue="true"/>
- <f:selectItem itemLabel="Non Smoking"
itemValue="false"/>
- </h:selectOneRadio>
- <br/>
- </s:decorate>
- </div>
- </div>
-
- <div id="ccdiv" class="entry">
- <div class="label"><h:outputLabel
for="creditCard">Credit Card #:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputText id="creditCard" value="#{booking.creditCard}"
partialSubmit="true" required="true"/>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
-
- <div id="cndiv" class="entry">
- <div class="label"><h:outputLabel
for="creditCardName">Credit Card Name:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputText id="creditCardName"
value="#{booking.creditCardName}" partialSubmit="true"
required="true"/>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
-
- <div class="entry">
- <div class="label"><h:outputLabel
for="creditCardExpiryMonth">Credit Card
Expiry:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <h:selectOneMenu id="creditCardExpiryMonth"
value="#{booking.creditCardExpiryMonth}">
- <f:selectItem itemLabel="Jan" itemValue="1"/>
- <f:selectItem itemLabel="Feb" itemValue="2"/>
- <f:selectItem itemLabel="Mar" itemValue="3"/>
- <f:selectItem itemLabel="Apr" itemValue="4"/>
- <f:selectItem itemLabel="May" itemValue="5"/>
- <f:selectItem itemLabel="Jun" itemValue="6"/>
- <f:selectItem itemLabel="Jul" itemValue="7"/>
- <f:selectItem itemLabel="Aug" itemValue="8"/>
- <f:selectItem itemLabel="Sep" itemValue="9"/>
- <f:selectItem itemLabel="Oct" itemValue="10"/>
- <f:selectItem itemLabel="Nov" itemValue="11"/>
- <f:selectItem itemLabel="Dec" itemValue="12"/>
- </h:selectOneMenu>
- <h:selectOneMenu id="creditCardExpiryYear"
value="#{booking.creditCardExpiryYear}">
- <f:selectItem itemLabel="2005" itemValue="2005"/>
- <f:selectItem itemLabel="2006" itemValue="2006"/>
- <f:selectItem itemLabel="2007" itemValue="2007"/>
- <f:selectItem itemLabel="2008" itemValue="2008"/>
- <f:selectItem itemLabel="2009" itemValue="2009"/>
- </h:selectOneMenu>
- <br/>
- </s:decorate>
- </div>
- </div>
-
- </s:validateAll>
+ <s:decorate id="checkinDateDecorate" template="edit.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <ice:selectInputDate id="checkinDate"
value="#{booking.checkinDate}" renderAsPopup="true"
partialSubmit="true">
+ <f:convertDateTime type="date" dateStyle="medium" />
+ </ice:selectInputDate>
+ </s:decorate>
- <div class="entry errors">
- <h:messages globalOnly="true"/>
+ <s:decorate id="checkoutDateDecorate" template="edit.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <ice:selectInputDate id="checkoutDate"
value="#{booking.checkoutDate}" renderAsPopup="true"
partialSubmit="true">
+ <f:convertDateTime type="date" dateStyle="medium" />
+ </ice:selectInputDate>
+ </s:decorate>
+
+ <s:decorate id="bedsDecorate" template="edit.xhtml">
+ <ui:define name="label">Room Preference:</ui:define>
+ <h:selectOneMenu id="beds" value="#{booking.beds}">
+ <f:selectItem itemLabel="One king-size bed"
itemValue="1"/>
+ <f:selectItem itemLabel="Two double beds" itemValue="2"/>
+ <f:selectItem itemLabel="Three beds" itemValue="3"/>
+ </h:selectOneMenu>
+ </s:decorate>
+
+ <s:decorate id="smokingDecorate" template="edit.xhtml">
+ <ui:define name="label">Smoking Preference:</ui:define>
+ <ice:selectOneRadio id="smoking" value="#{booking.smoking}"
+ layout="pageDirection"
styleClass="radio">
+ <f:selectItem itemLabel="Smoking" itemValue="true"/>
+ <f:selectItem itemLabel="Non Smoking" itemValue="false"/>
+ </ice:selectOneRadio>
+ </s:decorate>
+
+ <s:decorate id="creditCardDecorate" template="edit.xhtml">
+ <ui:define name="label">Credit Card #:</ui:define>
+ <ice:inputText id="creditCard" value="#{booking.creditCard}"
partialSubmit="true" required="true"/>
+ </s:decorate>
+
+ <s:decorate id="creditCardNameDecorate"
template="edit.xhtml">
+ <ui:define name="label">Credit Card Name:</ui:define>
+ <ice:inputText id="creditCardName"
value="#{booking.creditCardName}" partialSubmit="true"
required="true"/>
+ </s:decorate>
+
+ <s:decorate id="creditCardExpiryDecorate"
template="edit.xhtml">
+ <ui:define name="label">Credit Card Expiry:</ui:define>
+ <ice:selectOneMenu id="creditCardExpiryMonth"
+ value="#{booking.creditCardExpiryMonth}">
+ <f:selectItem itemLabel="Jan" itemValue="1" />
+ <f:selectItem itemLabel="Feb" itemValue="2" />
+ <f:selectItem itemLabel="Mar" itemValue="3" />
+ <f:selectItem itemLabel="Apr" itemValue="4" />
+ <f:selectItem itemLabel="May" itemValue="5" />
+ <f:selectItem itemLabel="Jun" itemValue="6" />
+ <f:selectItem itemLabel="Jul" itemValue="7" />
+ <f:selectItem itemLabel="Aug" itemValue="8" />
+ <f:selectItem itemLabel="Sep" itemValue="9" />
+ <f:selectItem itemLabel="Oct" itemValue="10" />
+ <f:selectItem itemLabel="Nov" itemValue="11" />
+ <f:selectItem itemLabel="Dec" itemValue="12" />
+ </ice:selectOneMenu>
+ <ice:selectOneMenu id="creditCardExpiryYear"
+ value="#{booking.creditCardExpiryYear}">
+ <f:selectItem itemLabel="2007" itemValue="2007" />
+ <f:selectItem itemLabel="2008" itemValue="2008" />
+ <f:selectItem itemLabel="2009" itemValue="2009" />
+ <f:selectItem itemLabel="2010" itemValue="2010" />
+ <f:selectItem itemLabel="2011" itemValue="2011" />
+ </ice:selectOneMenu>
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:commandButton id="proceed" value="Proceed"
action="#{hotelBooking.setBookingDetails}"/>
+  
+ <s:button id="cancel" value="Cancel"
action="#{hotelBooking.cancel}"/>
</div>
- <div class="entry">
- <div class="label"> </div>
- <div class="input">
- <h:commandButton id="proceed" value="Proceed"
action="#{hotelBooking.setBookingDetails}"
styleClass="button"/> 
- <s:button id="cancel" value="Cancel"
action="#{hotelBooking.cancel}" styleClass="button"/>
- </div>
- </div>
</fieldset>
- </h:form>
+ </ice:form>
</div>
</ui:define>
@@ -172,7 +117,7 @@
</p>
<p>
<a href="#"
onclick="window.open('exp/workspaceExp.html','exp','width=752,height=500,scrollbars=yes');">
- How does the workspace list work?
+ How does the workspace list work?
</a>
</p>
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/confirm.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/confirm.xhtml 2008-06-24 11:19:18 UTC
(rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/confirm.xhtml 2008-06-24 16:20:32 UTC
(rev 8410)
@@ -3,60 +3,54 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:s="http://jboss.com/products/seam/taglib"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
+
<div class="section">
<h1>Confirm Hotel Booking</h1>
</div>
+
<div class="section">
- <h:form id="confirm">
- <fieldset>
- <div class="entry">
- <div class="label">Name:</div>
- <div class="output">#{hotel.name}</div>
- </div>
- <div class="entry">
- <div class="label">Address:</div>
- <div class="output">#{hotel.address}</div>
- </div>
- <div class="entry">
- <div class="label">City, State:</div>
- <div class="output">#{hotel.city}, #{hotel.state}</div>
- </div>
- <div class="entry">
- <div class="label">Zip:</div>
- <div class="output">#{hotel.zip}</div>
- </div>
- <div class="entry">
- <div class="label">Country:</div>
- <div class="output">#{hotel.country}</div>
- </div>
- <div class="entry">
- <div class="label">Check In Date:</div>
- <div class="output"><h:outputText
value="#{booking.checkinDate}"/></div>
- </div>
- <div class="entry">
- <div class="label">Check Out Date:</div>
- <div class="output"><h:outputText
value="#{booking.checkoutDate}"/></div>
- </div>
- <div class="entry">
- <div class="label">Credit Card #:</div>
- <div class="output">#{booking.creditCard}</div>
- </div>
- <div class="entry">
- <div class="label"> </div>
- <div class="input">
- <h:commandButton id="confirm" value="Confirm"
action="#{hotelBooking.confirm}" styleClass="button"/> 
- <h:commandButton id="revise" value="Revise"
action="back" styleClass="button"/> 
- <h:commandButton id="cancel" value="Cancel"
action="#{hotelBooking.cancel}" styleClass="button"/>
- </div>
- </div>
- </fieldset>
- </h:form>
+
+ <ui:include src="hotelview.xhtml"/>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Total Payment:</ui:define>
+ <h:outputText value="#{booking.total}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <h:outputText value="#{booking.checkinDate}"/>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <h:outputText value="#{booking.checkoutDate}"/>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Credit Card #:</ui:define>
+ #{booking.creditCard}
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:form id="confirm">
+ <h:commandButton id="confirm" value="Confirm"
action="#{hotelBooking.confirm}"/>
+  
+ <s:button id="revise" value="Revise"
view="/book.xhtml"/>
+  
+ <h:commandButton id="cancel" value="Cancel"
action="#{hotelBooking.cancel}"/>
+ </h:form>
+ </div>
+
</div>
+
</ui:define>
<!-- sidebar -->
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/css/date.css
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/css/date.css
(rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/css/date.css 2008-06-24 16:20:32 UTC
(rev 8410)
@@ -0,0 +1,185 @@
+div.seam-date
+{
+ margin-top: 5px;
+ border: 1px solid #AAAAAA;
+ background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+ background-color: #FFFFFF;
+ color: #505050;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+table.seam-date td {
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: 11px;
+}
+
+.seam-date-monthNames
+{
+ width: 70px;
+ border: 1px solid #dddddd;
+ border-right: 3px solid #444444;
+ border-bottom: 3px solid #444444;
+ background-color: #ffffff;
+ font-size: 12px;
+ cursor: pointer;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: normal;
+}
+
+a.seam-date-monthNameLink, a.seam-date-monthNameLink:visited
+{
+ text-align: center;
+ display: block;
+ color: #555555;
+}
+
+a.seam-date-monthNameLink:hover
+{
+ background-color: #CCCCCC;
+ color: red;
+}
+
+.seam-date-years
+{
+ height: 10em;
+ overflow: auto;
+ width: 60px;
+ border: 1px solid #dddddd;
+ border-right: 3px solid #444444;
+ border-bottom: 3px solid #444444;
+ background-color: #ffffff;
+ font-size: 12px;
+ cursor: pointer;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: normal;
+}
+
+a.seam-date-yearLink, a.seam-date-yearLink:visited
+{
+ text-align: center;
+ display: block;
+ color: #555555;
+}
+
+a.seam-date-yearLink:hover
+{
+ background-color: #CCCCCC;
+ color: red;
+}
+
+tr.seam-date-header
+{
+ padding: 2px 0px 2px 0px;
+}
+
+td.seam-date-header
+{
+ padding: 0px 8px 0px 8px;
+ text-align: center;
+ color: gray;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 12px;
+}
+
+td.seam-date-header-prevMonth
+{
+ background-image: url("../img/cal-prev.png");
+ background-repeat: no-repeat;
+ background-position: center;
+ padding: 0px 2px 0px 2px;
+ width: 17px;
+ height: 16px;
+ margin-left: 2px;
+}
+
+td.seam-date-header-nextMonth
+{
+ background-image: url("../img/cal-next.png");
+ background-repeat: no-repeat;
+ background-position: center;
+ padding: 0px 2px 0px 2px;
+ width: 17px;
+ height: 16px;
+ margin-right: 2px;
+}
+
+tr.seam-date-headerDays
+{
+ color: white;
+ font-weight: normal;
+}
+
+tr.seam-date-headerDays > td
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ color: white;
+ text-align: center;
+ width: 26px;
+}
+
+tr.seam-date-footer
+{
+ background-color: white;
+ color: #505050;
+ font-weight: bold;
+}
+
+tr.seam-date-footer > td
+{
+ text-align: center;
+}
+
+td.seam-date-inMonth
+{
+ background-color: white;
+ color: black;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-outMonth
+{
+ background-color: white;
+ color: #999999;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-selected
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ color: black;
+ font-weight: normal;
+}
+
+td.seam-date-dayOff-inMonth
+{
+ background-color: #efefef;
+ color: black;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-dayOff-outMonth
+{
+ background-color: #efefef;
+ color: #999999;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-hover
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ cursor: pointer;
+ color: red;
+}
\ No newline at end of file
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/css/date.css
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/css/screen.css
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/css/screen.css 2008-06-24 11:19:18 UTC
(rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/css/screen.css 2008-06-24 16:20:32 UTC
(rev 8410)
@@ -1,6 +1,6 @@
/* Setup defaults since variable in browsers
----------------------------------------------- */
-body, div, dd, dt, dl, img, ul, ol, li, p, h1, h2, h3, h4, h5, form, hr, fieldset {
+body, div, span, dd, dt, dl, img, ul, ol, li, p, h1, h2, h3, h4, h5, form, hr, fieldset
{
margin: 0;
padding: 0;
}
@@ -24,7 +24,7 @@
margin-left: auto;
margin-right: auto;
}
-label {
+.label {
font-weight: bold;
color: #5E5147;
}
@@ -34,16 +34,13 @@
margin: 5px 0;
background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
}
-input[type="image"] {
- border: none;
- background: transparent;
-}
select {
border: 1px solid #C3BBB6;
padding: 4px;
margin: 5px 0;
background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
-}ol, ul {
+}
+ol, ul {
margin: 10px 0px 10px 6px;
}
li {
@@ -97,7 +94,7 @@
}
/* General
----------------------------------------------- */
-.button {
+input[type="submit"], input[type="button"] {
font-weight: bold;
color: #fff;
border: 1px solid #5D1414;
@@ -114,23 +111,27 @@
}
.entry .label {
float: left;
- padding-top: 10px;
padding-right: 5px;
font-weight: bold;
width: 150px;
text-align: right;
}
.entry .output {
- float: left;
- width: 250px;
+ float: right;
+ width: 360px;
padding-top: 10px;
text-align: left;
}
.entry .input {
- float: left;
- width: 250px;
+ float: right;
+ width: 360px;
text-align: left;
}
+.entry .error {
+ float: right;
+ width: 360px;
+ text-align: left;
+}
/* Sidebar
----------------------------------------------- */
.notes {
@@ -143,6 +144,12 @@
text-align: center;
color: #600;
}
+.errors div {
+ text-align: left;
+}
+.errors span {
+ text-align: left;
+}
.errors input {
border: 1px solid #600;
}
@@ -152,6 +159,7 @@
.buttonBox {
text-align: center;
padding: 5px 0;
+ clear: both;
}
#sidebar p {
font-size: small;
@@ -225,10 +233,10 @@
float: left;
width: 66%;
}
-#radio table {
+#content table.radio {
border: 0px;
}
-#radio table tr td {
+#content table.radio tbody tr td {
border: 0px;
border-left: 0px;
border-bottom: 0px;
@@ -253,13 +261,6 @@
color: #C7B299;
text-decoration: none;
}
-.connectionStatus {
- display: inline;
-}
-.connectionStatus div {
- display: inline;
-}
-
/* Homepage Modifications
----------------------------------------------- */
#pgHome #container {
@@ -271,10 +272,6 @@
#pgHome #content {
margin-top: 183px;
}
-#pgHome .button {
- height: 30px;
-}
-
/*
----------- Calendar Component classes
*/
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/css/trailblazer_main.css
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/css/trailblazer_main.css
(rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/css/trailblazer_main.css 2008-06-24
16:20:32 UTC (rev 8410)
@@ -0,0 +1,148 @@
+* {
+ margin: 0px;
+ padding: 0px;
+ border: none;
+}
+
+body {
+ font: 1em verdana, arial, sans-serif;
+ background: #CCCCCC;
+}
+
+div#main {
+ margin-left: 0px;
+ width: 751px;
+ background: #ecefdf;
+}
+
+div#top,div#pictures{
+}
+
+div#pictures img {
+ float:left;
+}
+
+img#head1 {
+ margin-right: 3px;
+}
+
+img#head2 {
+ margin-right: 4px;
+}
+
+div.trail {
+ clear:both;
+ margin-left: 50px;
+ margin-top: 0px;
+ margin-right: 50px
+}
+
+div.foot {
+ margin-left: 50px;
+ margin-right: 50px;
+ margin-top: 50px;
+ text-align: center;
+ font-size: .5em;
+ height: 36px;
+}
+
+div.trail h1 {
+ margin-top: -30px;
+ margin-left: -50px;
+ font-size: 1.2em;
+ font-weight: bold;
+ padding-left: .4em;
+}
+
+div.trail h2 {
+ float: left;
+ font-size: 1em;
+ font-weight: bold;
+ padding-left: .4em;
+}
+
+div.trail h3 {
+ float: left;
+ font-size: .8em;
+ font-weight: bold;
+ margin-left: -1.4em;
+ margin-bottom: 1em;
+}
+
+
+div.trail p {
+ clear: both;
+ margin-top: 20px;
+ font-size: .8em;
+ text-decoration: none;
+}
+
+div#next_trail {
+ margin-left: 36px;
+}
+
+div.numbox {
+ border: thin solid black;
+ margin-left: -.8em;
+ float: left;
+ background: #ffffff;
+ padding: .2em .35em .3em;
+ font-style: normal;
+ font-weight: bold;
+ font-size: 1.4em;
+}
+
+div.figure {
+ text-align: center;
+ font-size: .6em;
+ margin-top: 30px;
+}
+
+div.figure img {
+ display: block;
+ margin-right: auto;
+ margin-left: auto;
+}
+
+code {
+ font: 1.1em "Courier New", Courier, mono;
+}
+
+code.block {
+ white-space: pre;
+ font: 10pt "Courier New", Courier, mono;
+ display: block;
+ border-style: dashed;
+ border-width: thin;
+ padding: .5em;
+ background: #ffffff;
+ margin: 20px;
+}
+
+div.foot_image {
+ float: left;
+ height: 86px;
+}
+
+a:active {
+ color : #666666;
+ text-decoration: none;
+}
+
+a:hover {
+ color : #000000;
+ background-color : #D6E0FE;
+ text-decoration: none;
+}
+
+a:link {
+ color : #005EB6;
+ text-decoration: none;
+}
+
+a:visited {
+ color : #888888;
+ text-decoration: none;
+}
+
+
Property changes on:
branches/Seam_1_2_1_AP/examples/icefaces/view/css/trailblazer_main.css
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/display.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/display.xhtml
(rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/display.xhtml 2008-06-24 16:20:32 UTC
(rev 8410)
@@ -0,0 +1,16 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <div class="entry">
+ <span class="label">
+ <ui:insert name="label"/>
+ </span>
+ <span class="input">
+ <ui:insert/>
+ </span>
+ </div>
+
+</ui:composition>
\ No newline at end of file
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/display.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/edit.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/edit.xhtml (rev
0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/edit.xhtml 2008-06-24 16:20:32 UTC (rev
8410)
@@ -0,0 +1,20 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <div class="entry">
+ <s:label styleClass="label
#{invalid?'errors':''}">
+ <ui:insert name="label"/>
+ <s:span styleClass="required"
rendered="#{required}">*</s:span>
+ </s:label>
+ <span class="input #{invalid?'errors':''}">
+ <s:validateAll>
+ <ui:insert/>
+ </s:validateAll>
+ </span>
+ <s:message styleClass="error errors"/>
+ </div>
+
+</ui:composition>
\ No newline at end of file
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/edit.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/home.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/home.xhtml 2008-06-24 11:19:18 UTC (rev
8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/home.xhtml 2008-06-24 16:20:32 UTC (rev
8410)
@@ -2,7 +2,8 @@
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core">
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:s="http://jboss.com/products/seam/taglib">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>JBoss Suites: Seam Framework</title>
@@ -20,16 +21,16 @@
<fieldset>
<div>
<h:outputLabel for="username">Login Name</h:outputLabel>
- <h:inputText id="username" value="#{user.username}"
style="width: 175px;"/>
+ <h:inputText id="username" value="#{identity.username}"
style="width: 175px;"/>
<div class="errors"><h:message
for="username"/></div>
</div>
<div>
<h:outputLabel for="password">Password</h:outputLabel>
- <h:inputSecret id="password" value="#{user.password}"
style="width: 175px;"/>
+ <h:inputSecret id="password" value="#{identity.password}"
style="width: 175px;"/>
</div>
<div class="errors"><h:messages
globalOnly="true"/></div>
- <div class="buttonBox"><h:commandButton id="login"
action="#{login.login}" value="Account Login"
styleClass="button"/></div>
- <div class="notes"><h:commandLink id="register"
action="register">Register New User</h:commandLink></div>
+ <div class="buttonBox"><h:commandButton id="login"
action="#{identity.login}" value="Account Login"/></div>
+ <div class="notes"><s:link id="register"
view="/register.xhtml" value="Register New User"/></div>
</fieldset>
</h:form>
</div>
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/hotel.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/hotel.xhtml 2008-06-24 11:19:18 UTC (rev
8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/hotel.xhtml 2008-06-24 16:20:32 UTC (rev
8410)
@@ -3,48 +3,30 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:s="http://jboss.com/products/seam/taglib"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
+
<div class="section">
<h1>View Hotel</h1>
</div>
+
<div class="section">
- <div class="entry">
- <div class="label">Name:</div>
- <div class="output">#{hotel.name}</div>
+ <ui:include src="hotelview.xhtml"/>
+
+ <div class="buttonBox">
+ <h:form id="hotel">
+ <h:commandButton id="bookHotel"
action="#{hotelBooking.bookHotel}" value="Book Hotel"/>
+  
+ <h:commandButton id="cancel" action="#{hotelBooking.cancel}"
value="Back to Search"/>
+ </h:form>
</div>
- <div class="entry">
- <div class="label">Address:</div>
- <div class="output">#{hotel.address}</div>
- </div>
- <div class="entry">
- <div class="label">City:</div>
- <div class="output">#{hotel.city}</div>
- </div>
- <div class="entry">
- <div class="label">State:</div>
- <div class="output">#{hotel.state}</div>
- </div>
- <div class="entry">
- <div class="label">Zip:</div>
- <div class="output">#{hotel.zip}</div>
- </div>
- <div class="entry">
- <div class="label">Country:</div>
- <div class="output">#{hotel.country}</div>
- </div>
+
+
</div>
-<div class="section">
- <h:form id="hotel">
- <fieldset class="buttonBox">
- <h:commandButton id="bookHotel"
action="#{hotelBooking.bookHotel}" value="Book Hotel"
styleClass="button"/> 
- <h:commandButton id="cancel" action="#{hotelBooking.cancel}"
value="Back to Search" styleClass="button"/>
- </fieldset>
- </h:form>
-</div>
+
</ui:define>
<!-- sidebar -->
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/hotelview.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/hotelview.xhtml
(rev 0)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/hotelview.xhtml 2008-06-24 16:20:32 UTC
(rev 8410)
@@ -0,0 +1,44 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Name:</ui:define>
+ #{hotel.name}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Address:</ui:define>
+ #{hotel.address}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">City:</ui:define>
+ #{hotel.city}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">State:</ui:define>
+ #{hotel.state}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Zip:</ui:define>
+ #{hotel.zip}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Country:</ui:define>
+ #{hotel.country}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Nightly rate:</ui:define>
+ <h:outputText value="#{hotel.name}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+
+</ui:composition>
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/hotelview.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-next.png
===================================================================
(Binary files differ)
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-next.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-prev.png
===================================================================
(Binary files differ)
Property changes on: branches/Seam_1_2_1_AP/examples/icefaces/view/img/cal-prev.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/main.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/main.xhtml 2008-06-24 11:19:18 UTC (rev
8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/main.xhtml 2008-06-24 16:20:32 UTC (rev
8410)
@@ -11,32 +11,35 @@
<ui:define name="content">
<div class="section">
- <h:form id="main">
<span class="errors">
<h:messages globalOnly="true"/>
</span>
- <h1>Search Hotels</h1>
+ <h1>Search Hotels</h1>
+
+ <h:form id="searchCriteria">
<fieldset>
- <ice:selectInputText id="searchString"
+ <ice:selectInputText id="searchString"
valueChangeListener="#{hotelSearch.handleSearchStringChange}"
value="#{hotelSearch.searchString}"
- style="display: inline; width: 165px;">
- <f:selectItems value="#{hotelSearch.cities}"/>
- </ice:selectInputText>
+ style="display: inline; width: 165px;"/> 
+ <ice:commandButton id="findHotels" value="Find Hotels"
action="#{hotelSearch.find}" />
<ice:outputConnectionStatus activeLabel="requesting..."
styleClass="connectionStatus"/>
<br/>
<h:outputLabel for="pageSize">Maximum
results:</h:outputLabel> 
- <ice:selectOneMenu id="pageSize"
+ <ice:selectOneMenu id="pageSize"
value="#{hotelSearch.pageSize}"
valueChangeListener="#{hotelSearch.handlePageSizeChange}"
partialSubmit="true">
- <f:selectItems value="#{hotelSearch.pageSizes}"/>
+ <f:selectItem itemLabel="5" itemValue="5"/>
+ <f:selectItem itemLabel="10"
itemValue="10"/>
+ <f:selectItem itemLabel="20"
itemValue="20"/>
</ice:selectOneMenu>
+
</fieldset>
+ </h:form>
- </h:form>
</div>
<div class="section">
@@ -63,6 +66,7 @@
<s:link id="viewHotel" value="View Hotel"
action="#{hotelBooking.selectHotel(hot)}"/>
</h:column>
</ice:dataTable>
+ <s:link value="More results" action="#{hotelSearch.nextPage}"
rendered="#{hotelSearch.nextPageAvailable}"/>
</div>
<div class="section">
@@ -86,11 +90,11 @@
</h:column>
<h:column>
<f:facet name="header">Check in date</f:facet>
- <h:outputText value="#{book.checkinDate}"
onmouseovereffect="#{highlight}"/>
+ <ice:outputText value="#{book.checkinDate}"
onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Check out date</f:facet>
- <h:outputText value="#{book.checkoutDate}"
onmouseovereffect="#{highlight}"/>
+ <ice:outputText value="#{book.checkinDate}"
onmouseovereffect="#{highlight}"/>
</h:column>
<h:column>
<f:facet name="header">Confirmation number</f:facet>
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/password.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/password.xhtml 2008-06-24 11:19:18 UTC
(rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/password.xhtml 2008-06-24 16:20:32 UTC
(rev 8410)
@@ -8,59 +8,42 @@
<!-- content -->
<ui:define name="content">
+
<div class="section">
<h1>Change Your Password</h1>
</div>
+
<div class="section">
+
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
<h:form id="setpassword">
- <f:facet name="aroundInvalidField">
- <s:span styleClass="errors"/>
- </f:facet>
- <f:facet name="afterInvalidField">
- <s:div styleClass="errors">
- <s:message/>
- </s:div>
- </f:facet>
-
<fieldset>
- <div class="entry">
- <div class="label"><h:outputLabel
for="password">Password:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <h:inputSecret id="password" value="#{user.password}"
required="true">
- <s:validate/>
- </h:inputSecret>
- </s:decorate>
- </div>
- </div>
+ <s:decorate template="edit.xhtml">
+ <ui:define name="label">Password:</ui:define>
+ <h:inputSecret id="password" value="#{user.password}"
required="true"/>
+ </s:decorate>
- <div class="entry">
- <div class="label"><h:outputLabel
for="verify">Verify:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <h:inputSecret id="verify" value="#{changePassword.verify}"
required="true"/>
- </s:decorate>
- </div>
- </div>
+ <s:decorate template="edit.xhtml">
+ <ui:define name="label">Verify:</ui:define>
+ <h:inputSecret id="verify" value="#{changePassword.verify}"
required="true"/>
+ </s:decorate>
- <div class="entry errors">
- <h:messages globalOnly="true"/>
+ <div class="buttonBox">
+ <h:commandButton id="change" value="Change"
action="#{changePassword.changePassword}"/>
+  
+ <s:button id="cancel" value="Cancel"
view="/main.xhtml"/>
</div>
- <div class="entry">
- <div class="label"> </div>
- <div class="input">
- <h:commandButton id="change" value="Change"
action="#{changePassword.changePassword}"
styleClass="button"/> 
- <s:link id="cancel" value="Cancel"
action="#{changePassword.cancel}" linkStyle="button"
buttonClass="button"/>
- </div>
- </div>
-
</fieldset>
</h:form>
</div>
+
</ui:define>
<!-- sidebar -->
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/register.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/register.xhtml 2008-06-24 11:19:18 UTC
(rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/register.xhtml 2008-06-24 16:20:32 UTC
(rev 8410)
@@ -3,19 +3,24 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ice="http://www.icesoft.com/icefaces/component"
-
xmlns:s="http://jboss.com/products/seam/taglib">
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ice="http://www.icesoft.com/icefaces/component">
<head>
- <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
<title>JBoss Suites: Seam Framework</title>
<link href="css/screen.css" rel="stylesheet"
type="text/css" />
</head>
+
<body id="pgHome">
+
<div id="document">
+
<div id="header">
<div id="title"><img src="img/hdr.title.gif"
alt="JBoss Suites: seam framework demo"/></div>
</div>
+
<div id="container">
+
<div id="sidebar">
<h1>Integrated multi-layer validation</h1>
<p>
@@ -33,88 +38,60 @@
</a>
</p>
</div>
+
<div id="content">
+
<div class="section">
<h1>Register</h1>
</div>
+
<div class="section">
- <h:form id="register">
- <fieldset>
-
- <s:validateAll>
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
- <f:facet name="aroundInvalidField">
- <s:span styleClass="errors"/>
- </f:facet>
-
- <div id="undiv" class="entry">
- <div class="label"><h:outputLabel
for="username">Username:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputText id="username" value="#{user.username}"
required="true" partialSubmit="true" >
- </ice:inputText>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
-
- <div id="rndiv" class="entry">
- <div class="label"><h:outputLabel for="name">Real
Name:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputText id="name" value="#{user.name}"
required="true" partialSubmit="true">
- </ice:inputText>
- <br/>
- <s:message/>
- </s:decorate>
- </div>
- </div>
-
- <div id="pw1div" class="entry">
- <div class="label"><h:outputLabel
for="password">Password:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputSecret id="password" value="#{user.password}"
redisplay="true" required="true" partialSubmit="true" />
- <br/>
- <h:message for="password"/>
- </s:decorate>
- </div>
- </div>
-
- <div id="pw2div" class="entry">
- <div class="label"><h:outputLabel
for="verify">Verify Password:</h:outputLabel></div>
- <div class="input">
- <s:decorate>
- <ice:inputSecret id="verify" value="#{register.verify}"
redisplay="true" required="true" partialSubmit="true"/>
- <br/>
- <h:message for="verify"/>
- </s:decorate>
- </div>
- </div>
-
- </s:validateAll>
+ <h:form id="registration">
+ <fieldset>
+ <s:validateAll>
+ <s:decorate id="usernameDecorate" template="edit.xhtml">
+ <ui:define name="label">Username:</ui:define>
+ <ice:inputText id="username" value="#{user.username}"
required="true" partialSubmit="true" />
+ </s:decorate>
- <div class="entry errors">
- <h:messages globalOnly="true"/>
- </div>
+ <s:decorate id="nameDecorate" template="edit.xhtml">
+ <ui:define name="label">Real Name:</ui:define>
+ <ice:inputText id="name" value="#{user.name}"
required="true" partialSubmit="true" />
+ </s:decorate>
- <div class="entry">
- <div class="label"> </div>
- <div class="input">
- <h:commandButton id="register" value="Register"
action="#{register.register}" styleClass="button"/> 
- <s:link id="cancel" value="Cancel" action="login"
linkStyle="button" buttonClass="button"/>
- </div>
- </div>
+ <s:decorate id="passwordDecorate" template="edit.xhtml">
+ <ui:define name="label">Password:</ui:define>
+ <ice:inputSecret id="password" value="#{user.password}"
redisplay="true" required="true" partialSubmit="true" />
+ </s:decorate>
+ <s:decorate id="verifyDecorate" template="edit.xhtml">
+ <ui:define name="label">Verify Password:</ui:define>
+ <ice:inputSecret id="verify" value="#{register.verify}"
redisplay="true" required="true" partialSubmit="true"/>
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:commandButton id="register" value="Register"
action="#{register.register}"/> 
+ <s:button id="cancel" value="Cancel"
view="/home.xhtml"/>
+ </div>
+ </s:validateAll>
</fieldset>
</h:form>
- </div>
+ </div>
+
</div>
+
</div>
+
<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and
Facelets</div>
+
</div>
+
</body>
+
</html>
Modified: branches/Seam_1_2_1_AP/examples/icefaces/view/template.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/icefaces/view/template.xhtml 2008-06-24 11:19:18 UTC
(rev 8409)
+++ branches/Seam_1_2_1_AP/examples/icefaces/view/template.xhtml 2008-06-24 16:20:32 UTC
(rev 8410)
@@ -1,11 +1,14 @@
<!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:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html">
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:s="http://jboss.com/products/seam/taglib">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
<title>JBoss Suites: Seam Framework</title>
<link href="css/screen.css" rel="stylesheet"
type="text/css" />
+ <link href="css/date.css" rel="stylesheet"
type="text/css" />
+ <link rel="stylesheet" type="text/css"
href="./xmlhttp/css/xp/xp.css" />
</head>
<body>
@@ -13,12 +16,10 @@
<div id="header">
<div id="title"><img src="img/hdr.title.gif"
alt="JBoss Suites: seam framework demo"/></div>
<div id="status">
- <h:form id="navigation">
- Welcome #{user.name}
- | <h:outputLink id="main"
value="main.seam">Search</h:outputLink>
- | <h:outputLink id="password"
value="password.seam">Settings</h:outputLink>
- | <h:commandLink id="logout"
action="#{logout.logout}">Logout</h:commandLink>
- </h:form>
+ Welcome #{user.name}
+ | <s:link id="search" view="/main.xhtml"
value="Search" propagation="none"/>
+ | <s:link id="settings" view="/password.xhtml"
value="Settings" propagation="none"/>
+ | <s:link id="logout" action="#{identity.logout}"
value="Logout"/>
</div>
</div>
<div id="container">