Seam SVN: r10228 - trunk/doc/Seam_Reference_Guide/en-US.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-03-29 15:33:08 -0400 (Sun, 29 Mar 2009)
New Revision: 10228
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Conversations.xml
Log:
document the onExpired handler in RichFaces
Modified: trunk/doc/Seam_Reference_Guide/en-US/Conversations.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Conversations.xml 2009-03-28 22:36:44 UTC (rev 10227)
+++ trunk/doc/Seam_Reference_Guide/en-US/Conversations.xml 2009-03-29 19:33:08 UTC (rev 10228)
@@ -1204,26 +1204,48 @@
<para>
ICEfaces, RichFaces Ajax and Seam Remoting can all handle HTTP error
- codes. Seam Remoting will pop up a dialog box showing the HTTP error
- and ICEfaces will indicate the error in its connection status
- component. RichFaces Ajax provides the most complete support for
- handling HTTP errors by providing a user definable callback. For
- example, to show the error message to the user:
+ codes. Seam Remoting will pop up a dialog box showing the HTTP
+ error. ICEfaces will indicate the error in its connection status
+ component. RichFaces provides the most complete support for handling
+ HTTP errors by providing a user definable callback. For example, to
+ show the error message to the user:
</para>
<programlisting><![CDATA[<script type="text/javascript">
A4J.AJAX.onError = function(req,status,message) {
- alert("message");
+ alert("An error occurred");
};
</script>]]></programlisting>
+
+ <para>
+ If instead of an error code, the server reports that the view has expired,
+ perhaps because the session timed out, you use a separate callback function
+ in RichFaces to handle this scenario.
+ </para>
+
+ <programlisting><![CDATA[<script type="text/javascript">
+ A4J.AJAX.onExpired = function(loc,message) {
+ alert("View expired");
+ };
+</script>]]></programlisting>
+
+ <para>
+ Alternatively, you can allow RichFaces handle the error, in which
+ case the user will be presented with a prompt that reads "View state
+ could't be restored - reload page?" You can customize this message
+ globally by setting the following message key in an application
+ resource bundle.
+ </para>
+
+ <programlisting><![CDATA[AJAX_VIEW_EXPIRED=View expired. Please reload the page.]]></programlisting>
</section>
<section>
- <title>RichFaces Ajax</title>
+ <title>RichFaces (Ajax4jsf)</title>
<para>
- RichFaces Ajax is the AJAX library most commonly used with Seam, and
+ RichFaces (Ajax4jsf) is the Ajax library most commonly used with Seam, and
provides all the controls discussed above:
</para>
15 years, 9 months
Seam SVN: r10227 - trunk/examples/metawidget.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-03-28 18:36:44 -0400 (Sat, 28 Mar 2009)
New Revision: 10227
Modified:
trunk/examples/metawidget/readme.txt
Log:
documentation
Modified: trunk/examples/metawidget/readme.txt
===================================================================
--- trunk/examples/metawidget/readme.txt 2009-03-28 19:54:58 UTC (rev 10226)
+++ trunk/examples/metawidget/readme.txt 2009-03-28 22:36:44 UTC (rev 10227)
@@ -2,12 +2,19 @@
===================
These examples demonstrate the use of the Metawidget user interface builder.
-These examples demonstrate the Metawidget JSF componenents, though Metawidget
-supports many other user interface platforms.
+While Metawidget supports many other user interface platforms, only the
+Metawidget JSF componenents are being used in these examples.
+The reason we are hosting metawidget examples are because the framework
+embraces the same declarative style of programming that Seam espouses. Through
+the use of annotations, you can control how the user interface is built and
+layed out, reducing a lot of boilerplate code that you are used to writing.
+
You can find information about Metawidget at the project homepage:
http://metawidget.sourceforge.net
Thanks to Richard Kennard for porting the original Seam examples to use the
Metawidget JSF components.
+
+Metawidget version: 0.7
15 years, 9 months
Seam SVN: r10226 - in trunk/examples: metawidget and 33 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-03-28 15:54:58 -0400 (Sat, 28 Mar 2009)
New Revision: 10226
Added:
trunk/examples/metawidget/
trunk/examples/metawidget/booking/
trunk/examples/metawidget/booking/build.properties
trunk/examples/metawidget/booking/build.xml
trunk/examples/metawidget/booking/readme.txt
trunk/examples/metawidget/booking/resources/
trunk/examples/metawidget/booking/resources/META-INF/
trunk/examples/metawidget/booking/resources/META-INF/application.xml
trunk/examples/metawidget/booking/resources/WEB-INF/
trunk/examples/metawidget/booking/resources/WEB-INF/inspector-config.xml
trunk/examples/metawidget/booking/src/
trunk/examples/metawidget/booking/src/org/
trunk/examples/metawidget/booking/src/org/jboss/
trunk/examples/metawidget/booking/src/org/jboss/seam/
trunk/examples/metawidget/booking/src/org/jboss/seam/example/
trunk/examples/metawidget/booking/src/org/jboss/seam/example/booking/
trunk/examples/metawidget/booking/src/org/jboss/seam/example/booking/Booking.java
trunk/examples/metawidget/booking/src/org/jboss/seam/example/booking/Hotel.java
trunk/examples/metawidget/booking/view/
trunk/examples/metawidget/booking/view/book.xhtml
trunk/examples/metawidget/booking/view/confirm.xhtml
trunk/examples/metawidget/booking/view/hotelview.xhtml
trunk/examples/metawidget/booking/view/main.xhtml
trunk/examples/metawidget/dvdstore/
trunk/examples/metawidget/dvdstore/build.properties
trunk/examples/metawidget/dvdstore/build.xml
trunk/examples/metawidget/dvdstore/readme.txt
trunk/examples/metawidget/dvdstore/resources/
trunk/examples/metawidget/dvdstore/resources/META-INF/
trunk/examples/metawidget/dvdstore/resources/META-INF/application.xml
trunk/examples/metawidget/dvdstore/resources/WEB-INF/
trunk/examples/metawidget/dvdstore/resources/WEB-INF/inspector-config.xml
trunk/examples/metawidget/dvdstore/src/
trunk/examples/metawidget/dvdstore/src/com/
trunk/examples/metawidget/dvdstore/src/com/jboss/
trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/
trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/
trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/Customer.java
trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/EditCustomer.java
trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/User.java
trunk/examples/metawidget/dvdstore/view/
trunk/examples/metawidget/dvdstore/view/confirm.xhtml
trunk/examples/metawidget/dvdstore/view/newuser/
trunk/examples/metawidget/dvdstore/view/newuser/account.xhtml
trunk/examples/metawidget/dvdstore/view/newuser/card.xhtml
trunk/examples/metawidget/dvdstore/view/newuser/contact.xhtml
trunk/examples/metawidget/groovybooking/
trunk/examples/metawidget/groovybooking/build.properties
trunk/examples/metawidget/groovybooking/build.xml
trunk/examples/metawidget/groovybooking/readme.txt
trunk/examples/metawidget/groovybooking/resources/
trunk/examples/metawidget/groovybooking/resources/WEB-INF/
trunk/examples/metawidget/groovybooking/resources/WEB-INF/inspector-config.xml
trunk/examples/metawidget/groovybooking/src/
trunk/examples/metawidget/groovybooking/src/model/
trunk/examples/metawidget/groovybooking/src/model/org/
trunk/examples/metawidget/groovybooking/src/model/org/jboss/
trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/
trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/example/
trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/example/groovy/
trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/example/groovy/Booking.groovy
trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/example/groovy/Hotel.groovy
trunk/examples/metawidget/groovybooking/view/
trunk/examples/metawidget/groovybooking/view/book.xhtml
trunk/examples/metawidget/groovybooking/view/confirm.xhtml
trunk/examples/metawidget/groovybooking/view/hotel.xhtml
trunk/examples/metawidget/groovybooking/view/main.xhtml
trunk/examples/metawidget/metawidget-backend.jar
trunk/examples/metawidget/metawidget-frontend.jar
trunk/examples/metawidget/metawidget.jar
trunk/examples/metawidget/readme.txt
Log:
JBSEAM-4051
Property changes on: trunk/examples/metawidget/booking
___________________________________________________________________
Name: svn:ignore
+ dist
exploded-archives
staging
Added: trunk/examples/metawidget/booking/build.properties
===================================================================
--- trunk/examples/metawidget/booking/build.properties (rev 0)
+++ trunk/examples/metawidget/booking/build.properties 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1 @@
+# Define overrides here
Added: trunk/examples/metawidget/booking/build.xml
===================================================================
--- trunk/examples/metawidget/booking/build.xml (rev 0)
+++ trunk/examples/metawidget/booking/build.xml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<project name="Seam Metawidget Booking" default="deploy" basedir=".">
+
+ <!-- Naming -->
+ <property name="Name" value="Seam Metawidget Booking Example"/>
+ <property name="example.name" value="jboss-seam-metawidget-booking"/>
+
+ <property file="${basedir}/build.properties" />
+
+ <!-- Define location of merged source -->
+ <property name="staging.dir" value="${basedir}/staging"/>
+ <property name="src.java.dir" value="${staging.dir}/src"/>
+ <property name="src.test.dir" value="${src.java.dir}"/>
+ <property name="view.dir" value="${staging.dir}/view"/>
+ <property name="resources.dir" value="${staging.dir}/resources"/>
+ <property name="clean.extra" value="${staging.dir}"/>
+
+ <!-- Libraries to include -->
+ <property name="seam.ui.lib" value="yes"/>
+ <property name="seam.debug.lib" value="yes"/>
+ <property name="facelets.lib" value="yes"/>
+ <property name="richfaces.lib" value="yes"/>
+ <!--<property name="metawidget-ear.lib" value="yes"/>-->
+
+ <!-- Datasource -->
+ <property name="example.ds" value="jboss-seam-metawidget-booking-ds.xml"/>
+
+ <target name="build">
+
+ <!-- Copy the original Seam booking example -->
+ <copy todir="${staging.dir}">
+ <fileset dir="${seam.dir}/examples/booking">
+ <include name="src/**"/>
+ <include name="view/**"/>
+ <include name="resources/**"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy metawidget example overrides -->
+ <copy todir="${staging.dir}" overwrite="true">
+ <fileset dir=".">
+ <include name="src/**"/>
+ <include name="view/**"/>
+ <include name="resources/**"/>
+ </fileset>
+ </copy>
+
+ <move file="${resources.dir}/jboss-seam-booking-ds.xml" tofile="${resources.dir}/${example.ds}"/>
+ </target>
+
+ <import file="${basedir}/../../build.xml"/>
+
+ <path id="build.classpath.extras">
+ <fileset dir="${basedir}/..">
+ <include name="metawidget.jar"/>
+ </fileset>
+ </path>
+
+ <fileset id="ear.lib.extras" dir="${basedir}/..">
+ <include name="metawidget-backend.jar"/>
+ </fileset>
+
+ <fileset id="war.lib.extras" dir="${basedir}/..">
+ <include name="metawidget-frontend.jar"/>
+ </fileset>
+
+</project>
Added: trunk/examples/metawidget/booking/readme.txt
===================================================================
--- trunk/examples/metawidget/booking/readme.txt (rev 0)
+++ trunk/examples/metawidget/booking/readme.txt 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,34 @@
+Seam Metawidget Booking Example
+===============================
+
+This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+Forms are layed out using Metawidget.
+
+The source files in this example are just the overrides needed to utilize
+metawidget. Before you can deploy the example, you have to merge these
+overrides with the original groovybooking source code in a staging directory.
+That is done using the following command:
+
+ ant build
+
+This example runs on JBoss AS as an EAR or Tomcat with JBoss Embedded as a WAR.
+
+ example.name=booking
+
+To deploy this application to a cluster, first follow the steps 1-9 clustering-howto.txt in the root folder of the Seam distribution. Then execute the following command:
+
+ ant farm
+
+This command will deploy the archive to the farm directory of the "all" JBoss AS domain. To undeploy, run the following command:
+
+ ant unfarm
+
+HTTP session replication is enabled by default. You can disable it with the following commandline switch:
+
+ -Dsession.replication=false
+
+You can also toggle Seam's ManagedEntityInterceptor for any deployment with the following commandline switch:
+
+ -Ddistributable=false
+
Added: trunk/examples/metawidget/booking/resources/META-INF/application.xml
===================================================================
--- trunk/examples/metawidget/booking/resources/META-INF/application.xml (rev 0)
+++ trunk/examples/metawidget/booking/resources/META-INF/application.xml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
+ version="5">
+
+ <display-name>Seam Metawidget Booking</display-name>
+
+ <module>
+ <web>
+ <web-uri>jboss-seam-metawidget-booking.war</web-uri>
+ <context-root>/seam-metawidget-booking</context-root>
+ </web>
+ </module>
+
+ <module>
+ <ejb>jboss-seam-metawidget-booking.jar</ejb>
+ </module>
+
+ <module>
+ <ejb>jboss-seam.jar</ejb>
+ </module>
+
+</application>
Added: trunk/examples/metawidget/booking/resources/WEB-INF/inspector-config.xml
===================================================================
--- trunk/examples/metawidget/booking/resources/WEB-INF/inspector-config.xml (rev 0)
+++ trunk/examples/metawidget/booking/resources/WEB-INF/inspector-config.xml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<inspector-config xmlns="http://metawidget.org/inspector-config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://metawidget.org/inspector-config http://metawidget.org/inspector-config/inspector-config-1.0.xsd" version="1.0">
+
+ <compositeInspector xmlns="java:org.metawidget.inspector.composite" config="CompositeInspectorConfig">
+ <inspectors>
+ <metawidgetAnnotationInspector xmlns="java:org.metawidget.inspector.annotation"/>
+ <propertyTypeInspector xmlns="java:org.metawidget.inspector.propertytype"/>
+ <facesInspector xmlns="java:org.metawidget.inspector.faces"/>
+ <jpaInspector xmlns="java:org.metawidget.inspector.jpa"/>
+ <hibernateValidatorInspector xmlns="java:org.metawidget.inspector.hibernate.validator"/>
+ </inspectors>
+ </compositeInspector>
+
+</inspector-config>
\ No newline at end of file
Added: trunk/examples/metawidget/booking/src/org/jboss/seam/example/booking/Booking.java
===================================================================
--- trunk/examples/metawidget/booking/src/org/jboss/seam/example/booking/Booking.java (rev 0)
+++ trunk/examples/metawidget/booking/src/org/jboss/seam/example/booking/Booking.java 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,219 @@
+//$Id: Booking.java 5579 2007-06-27 00:06:49Z gavin $
+package org.jboss.seam.example.booking;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.text.DateFormat;
+import java.util.Date;
+
+import javax.persistence.Basic;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotNull;
+import org.hibernate.validator.Pattern;
+import org.jboss.seam.annotations.Name;
+
+import org.metawidget.inspector.annotation.*;
+import org.metawidget.inspector.faces.*;
+
+@Entity
+@Name("booking")
+public class Booking implements Serializable
+{
+ private Long id;
+ private User user;
+ private Hotel hotel;
+ private Date checkinDate;
+ private Date checkoutDate;
+ private String creditCard;
+ private String creditCardName;
+ private int creditCardExpiryMonth;
+ private int creditCardExpiryYear;
+ private boolean smoking;
+ private int beds;
+
+ public Booking() {}
+
+ public Booking(Hotel hotel, User user)
+ {
+ this.hotel = hotel;
+ this.user = user;
+ }
+
+ @Transient
+ @UiHidden
+ @UiFacesNumberConverter(type="currency",currencySymbol="$")
+ @UiLabel("Total payment")
+ public BigDecimal getTotal()
+ {
+ return hotel.getPrice().multiply( new BigDecimal( getNights() ) );
+ }
+
+ @Transient
+ @UiHidden
+ public int getNights()
+ {
+ return (int) ( checkoutDate.getTime() - checkinDate.getTime() ) / 1000 / 60 / 60 / 24;
+ }
+
+ @Id @GeneratedValue
+ public Long getId()
+ {
+ return id;
+ }
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @NotNull
+ @Basic @Temporal(TemporalType.DATE)
+ @UiComesAfter( "total" )
+ @UiFacesDateTimeConverter( pattern = "MM/dd/yyyy" )
+ public Date getCheckinDate()
+ {
+ return checkinDate;
+ }
+ public void setCheckinDate(Date datetime)
+ {
+ this.checkinDate = datetime;
+ }
+
+ @ManyToOne @NotNull
+ @UiHidden
+ public Hotel getHotel()
+ {
+ return hotel;
+ }
+ public void setHotel(Hotel hotel)
+ {
+ this.hotel = hotel;
+ }
+
+ @ManyToOne @NotNull
+ @UiHidden
+ public User getUser()
+ {
+ return user;
+ }
+ public void setUser(User user)
+ {
+ this.user = user;
+ }
+
+ @Basic @Temporal(TemporalType.DATE)
+ @NotNull
+ @UiComesAfter( "checkinDate" )
+ @UiFacesDateTimeConverter( pattern = "MM/dd/yyyy" )
+ public Date getCheckoutDate()
+ {
+ return checkoutDate;
+ }
+ public void setCheckoutDate(Date checkoutDate)
+ {
+ this.checkoutDate = checkoutDate;
+ }
+
+ @NotNull(message="Credit card number is required")
+ @Length(min=16, max=16, message="Credit card number must 16 digits long")
+ @Pattern(regex="^\\d*$", message="Credit card number must be numeric")
+ @UiComesAfter( "smoking" )
+ @UiLabel( "Credit card #" )
+ public String getCreditCard()
+ {
+ return creditCard;
+ }
+
+ public void setCreditCard(String creditCard)
+ {
+ this.creditCard = creditCard;
+ }
+
+ @Transient
+ @UiHidden
+ public String getDescription()
+ {
+ DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
+ return hotel==null ? null : hotel.getName() +
+ ", " + df.format( getCheckinDate() ) +
+ " to " + df.format( getCheckoutDate() );
+ }
+
+ @UiLookup( value = { "true", "false" }, labels = { "Smoking", "Non Smoking" } )
+ @UiFacesComponent( "javax.faces.HtmlSelectOneRadio" )
+ @UiComesAfter( "beds" )
+ public boolean isSmoking()
+ {
+ return smoking;
+ }
+
+ public void setSmoking(boolean smoking)
+ {
+ this.smoking = smoking;
+ }
+
+ @UiLabel( "Room preference" )
+ @UiComesAfter( "checkoutDate" )
+ @UiLookup( value = { "1", "2", "3" }, labels = { "One king-size bed", "Two double beds", "Three beds" } )
+ public int getBeds()
+ {
+ return beds;
+ }
+
+ public void setBeds(int beds)
+ {
+ this.beds = beds;
+ }
+ @NotNull(message="Credit card name is required")
+ @Length(min=3, max=70)
+ @UiComesAfter( "creditCard" )
+ public String getCreditCardName()
+ {
+ return creditCardName;
+ }
+
+ public void setCreditCardName(String creditCardName)
+ {
+ this.creditCardName = creditCardName;
+ }
+
+ @UiLookup( value = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }, labels = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } )
+ @UiComesAfter( "creditCardName" )
+ @UiLabel( "Expiry month" )
+ public int getCreditCardExpiryMonth()
+ {
+ return creditCardExpiryMonth;
+ }
+
+ public void setCreditCardExpiryMonth(int creditCardExpiryMonth)
+ {
+ this.creditCardExpiryMonth = creditCardExpiryMonth;
+ }
+
+ @UiComesAfter( "creditCardExpiryMonth" )
+ @UiLookup( { "2005", "2006", "2007", "2008", "2009" } )
+ @UiLabel( "Expiry year" )
+ public int getCreditCardExpiryYear()
+ {
+ return creditCardExpiryYear;
+ }
+
+ public void setCreditCardExpiryYear(int creditCardExpiryYear)
+ {
+ this.creditCardExpiryYear = creditCardExpiryYear;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Booking(" + user + ","+ hotel + ")";
+ }
+
+}
Added: trunk/examples/metawidget/booking/src/org/jboss/seam/example/booking/Hotel.java
===================================================================
--- trunk/examples/metawidget/booking/src/org/jboss/seam/example/booking/Hotel.java (rev 0)
+++ trunk/examples/metawidget/booking/src/org/jboss/seam/example/booking/Hotel.java 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,125 @@
+//$Id: Hotel.java 5579 2007-06-27 00:06:49Z 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;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.annotations.Name;
+
+import org.metawidget.inspector.annotation.*;
+import org.metawidget.inspector.faces.*;
+
+@Entity
+@Name("hotel")
+public class Hotel implements Serializable
+{
+ private Long id;
+ private String name;
+ private String address;
+ private String city;
+ private String state;
+ private String zip;
+ private String country;
+ private BigDecimal price;
+
+ @Id @GeneratedValue
+ public Long getId()
+ {
+ return id;
+ }
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @Length(max=50) @NotNull
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @Length(max=100) @NotNull
+ @UiComesAfter("name")
+ public String getAddress()
+ {
+ return address;
+ }
+ public void setAddress(String address)
+ {
+ this.address = address;
+ }
+
+ @Length(max=40) @NotNull
+ @UiComesAfter("address")
+ public String getCity()
+ {
+ return city;
+ }
+ public void setCity(String city)
+ {
+ this.city = city;
+ }
+
+ @Length(min=4, max=6) @NotNull
+ @UiComesAfter("state")
+ public String getZip()
+ {
+ return zip;
+ }
+ public void setZip(String zip)
+ {
+ this.zip = zip;
+ }
+
+ @Length(min=2, max=10) @NotNull
+ @UiComesAfter("city")
+ public String getState()
+ {
+ return state;
+ }
+ public void setState(String state)
+ {
+ this.state = state;
+ }
+
+ @Length(min=2, max=40) @NotNull
+ @UiComesAfter("zip")
+ public String getCountry()
+ {
+ return country;
+ }
+ public void setCountry(String country)
+ {
+ this.country = country;
+ }
+
+ @Column(precision=6, scale=2)
+ @UiComesAfter("country")
+ @UiFacesNumberConverter(type="currency",currencySymbol="$")
+ @UiLabel("Nightly rate")
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ public void setPrice(BigDecimal price)
+ {
+ this.price = price;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Hotel(" + name + "," + address + "," + city + "," + zip + ")";
+ }
+}
Added: trunk/examples/metawidget/booking/view/book.xhtml
===================================================================
--- trunk/examples/metawidget/booking/view/book.xhtml (rev 0)
+++ trunk/examples/metawidget/booking/view/book.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,65 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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"
+ xmlns:a="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:m="http://metawidget.org/faces/richfaces"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+<div class="section">
+ <h1>Book Hotel</h1>
+</div>
+<div class="section">
+ <div class="entry errors">
+ <h:messages id="messages" globalOnly="true"/>
+ </div>
+
+ <ui:include src="hotelview.xhtml"/>
+
+ <div style="clear:both"/>
+
+ <h:form id="booking">
+ <fieldset>
+
+ <s:validateAll>
+
+ <m:metawidget value="#{booking}" rendererType="div" validatorClass="org.metawidget.faces.component.validator.RequiredValidator">
+ <f:param name="divStyleClasses" value="entry,label,required,input,error errors"/>
+ </m:metawidget>
+
+ </s:validateAll>
+
+ <div class="buttonBox">
+ <h:commandButton id="proceed" value="Proceed" action="#{hotelBooking.setBookingDetails}"/>
+  
+ <s:button id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
+ </div>
+
+ </fieldset>
+ </h:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+
+<h1>Workspace management</h1>
+<p>
+ As you can see, Seam makes it easy to work in multiple windows or multiple browser
+ tabs. But you can even switch between multiple tasks inside a single browser tab!
+ The "Workspaces" section showcases this advanced feature.
+</p>
+<p>
+ <a href="#" onclick="window.open('exp/workspaceExp.html','exp','width=752,height=500,scrollbars=yes');">
+ How does the workspace list work?
+ </a>
+</p>
+
+</ui:define>
+
+</ui:composition>
Added: trunk/examples/metawidget/booking/view/confirm.xhtml
===================================================================
--- trunk/examples/metawidget/booking/view/confirm.xhtml (rev 0)
+++ trunk/examples/metawidget/booking/view/confirm.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,60 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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"
+ xmlns:m="http://metawidget.org/faces/richfaces"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+ <h1>Confirm Hotel Booking</h1>
+</div>
+
+<div class="section">
+
+ <ui:include src="hotelview.xhtml"/>
+
+ <m:metawidget value="#{booking}" rendererType="div" readOnly="#{true}">
+ <f:param name="divStyleClasses" value="entry,label,required,input"/>
+ <h:outputText value="#{booking.total}"/>
+ <m:stub value="#{booking.creditCardExpiryMonth}"/>
+ <m:stub value="#{booking.creditCardExpiryYear}"/>
+ </m:metawidget>
+
+ <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 -->
+<ui:define name="sidebar">
+<h1>Back button navigation</h1>
+<p>
+ When you click "Confirm", the new booking is written to the database, the
+ conversation ends, and state associated with the conversation is automatically
+ destroyed by Seam. After you confirm your booking, try hitting the back button
+ on your web browser and clicking "Confirm" again. Seam makes it easy implement
+ applications that behave elegantly in response to the back, forward and refresh
+ buttons.
+</p>
+<p>
+ <a href="#" onclick="window.open('exp/confirmExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What happens when the conversation ends?
+ </a>
+</p>
+</ui:define>
+
+</ui:composition>
Added: trunk/examples/metawidget/booking/view/hotelview.xhtml
===================================================================
--- trunk/examples/metawidget/booking/view/hotelview.xhtml (rev 0)
+++ trunk/examples/metawidget/booking/view/hotelview.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,11 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:m="http://metawidget.org/faces/richfaces">
+
+ <m:metawidget value="#{hotel}" rendererType="div" readOnly="#{true}">
+ <f:param name="divStyleClasses" value="entry,label,required,input"/>
+ </m:metawidget>
+
+</ui:composition>
Added: trunk/examples/metawidget/booking/view/main.xhtml
===================================================================
--- trunk/examples/metawidget/booking/view/main.xhtml (rev 0)
+++ trunk/examples/metawidget/booking/view/main.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,139 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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"
+ xmlns:a="http://richfaces.org/a4j"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+
+ <span class="errors">
+ <h:messages id="messages" globalOnly="true"/>
+ </span>
+
+ <h1>Search Hotels</h1>
+
+ <h:form id="searchCriteria">
+ <fieldset>
+ <h:inputText id="searchString" value="#{hotelSearch.searchString}" style="width: 165px;">
+ <a:support id="onkeyup" event="onkeyup" actionListener="#{hotelSearch.find}" reRender="searchResults" />
+ </h:inputText>
+  
+ <h:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}"/>
+  
+ <a:status id="status">
+ <f:facet id="StartStatus" name="start">
+ <h:graphicImage id="SpinnerGif" value="/img/spinner.gif"/>
+ </f:facet>
+ </a:status>
+ <br/>
+ <h:outputLabel id="MaximumResultsLabel" for="pageSize">Maximum results:</h:outputLabel> 
+ <h:selectOneMenu id="pageSize" value="#{hotelSearch.pageSize}">
+ <f:selectItem id="PageSize5" itemLabel="5" itemValue="5"/>
+ <f:selectItem id="PageSize10" itemLabel="10" itemValue="10"/>
+ <f:selectItem id="PageSize20" itemLabel="20" itemValue="20"/>
+ </h:selectOneMenu>
+ </fieldset>
+ </h:form>
+
+</div>
+
+<a:outputPanel id="searchResults">
+ <div class="section">
+ <h:outputText id="NoHotelsFoundMessage" value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
+ <h:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
+ <h:column id="column1">
+ <f:facet id="NameFacet" name="header">Name</f:facet>
+ #{hot.name}
+ </h:column>
+ <h:column id="column2">
+ <f:facet id="AddressFacet" name="header">Address</f:facet>
+ #{hot.address}
+ </h:column>
+ <h:column id="column3">
+ <f:facet id="CityStateFacet" name="header">City, State</f:facet>
+ #{hot.city}, #{hot.state}, #{hot.country}
+ </h:column>
+ <h:column id="column4">
+ <f:facet id="ZipFacet" name="header">Zip</f:facet>
+ #{hot.zip}
+ </h:column>
+ <h:column id="column5">
+ <f:facet id="ActionFacet" name="header">Action</f:facet>
+ <s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
+ </h:column>
+ </h:dataTable>
+ <s:link id="MoreResultsLink" value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}"/>
+ </div>
+</a:outputPanel>
+
+<div class="section">
+ <h1>Current Hotel Bookings</h1>
+</div>
+<div class="section">
+ <h:form id="bookings">
+ <h:outputText id="NoBookingsFoundMessage" value="No Bookings Found" rendered="#{bookings.rowCount==0}"/>
+ <h:dataTable id="bookings" value="#{bookings}" var="book" rendered="#{bookings.rowCount>0}">
+ <h:column id="column1">
+ <f:facet id="NameFacet" name="header">Name</f:facet>
+ #{book.hotel.name}
+ </h:column>
+ <h:column id="column2">
+ <f:facet id="AddressFacet" name="header">Address</f:facet>
+ #{book.hotel.address}
+ </h:column>
+ <h:column id="column3">
+ <f:facet id="CityStateFacet" name="header">City, State</f:facet>
+ #{book.hotel.city}, #{book.hotel.state}
+ </h:column>
+ <h:column id="column4">
+ <f:facet id="CheckInDateFacet" name="header">Check in date</f:facet>
+ <h:outputText id="BookingCheckInDate" value="#{book.checkinDate}"/>
+ </h:column>
+ <h:column id="column5">
+ <f:facet id="CheckOutDateFacet" name="header">Check out date</f:facet>
+ <h:outputText id="BookingCheckOutDate" value="#{book.checkoutDate}"/>
+ </h:column>
+ <h:column id="column6">
+ <f:facet id="ConfNumberFacet" name="header">Confirmation number</f:facet>
+ #{book.id}
+ </h:column>
+ <h:column id="column7">
+ <f:facet id="ActionFacet" name="header">Action</f:facet>
+ <h:commandLink id="cancel" value="Cancel" action="#{bookingList.cancel}"/>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+
+<h1>State management in Seam</h1>
+<p>
+ State in Seam is <em>contextual</em>. When you click "Find Hotels", the application
+ retrieves a list of hotels from the database and caches it in the session context. When you
+ navigate to one of the hotel records by clicking the "View Hotel" link, a <em>conversation</em>
+ begins. The conversation is attached to a particular tab, in a particular browser window. You can
+ navigate to multiple hotels using "open in new tab" or "open in new window" in your web browser.
+ Each window will execute in the context of a different conversation. The application keeps state
+ associated with your hotel booking in the conversation context, which ensures that the concurrent
+ conversations do not interfere with each other.
+</p>
+
+<p>
+ <a href="#" onclick="window.open('exp/mainExp.html','exp','width=752,height=500,scrollbars=yes');">
+ How does the search page work?
+ </a>
+</p>
+
+</ui:define>
+
+</ui:composition>
Property changes on: trunk/examples/metawidget/dvdstore
___________________________________________________________________
Name: svn:ignore
+ dist
exploded-archives
staging
Added: trunk/examples/metawidget/dvdstore/build.properties
===================================================================
--- trunk/examples/metawidget/dvdstore/build.properties (rev 0)
+++ trunk/examples/metawidget/dvdstore/build.properties 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1 @@
+# Define overrides here
Added: trunk/examples/metawidget/dvdstore/build.xml
===================================================================
--- trunk/examples/metawidget/dvdstore/build.xml (rev 0)
+++ trunk/examples/metawidget/dvdstore/build.xml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<project name="Metawidget DVD Store" default="deploy" basedir=".">
+
+ <!-- Naming -->
+ <property name="Name" value="Seam DVD Store Example"/>
+ <property name="example.name" value="jboss-seam-metawidget-dvdstore"/>
+
+ <property file="${basedir}/build.properties" />
+
+ <!-- Define location of merged source -->
+ <property name="staging.dir" value="${basedir}/staging"/>
+ <property name="src.java.dir" value="${staging.dir}/src"/>
+ <property name="src.test.dir" value="${src.java.dir}"/>
+ <property name="view.dir" value="${staging.dir}/view"/>
+ <property name="resources.dir" value="${staging.dir}/resources"/>
+ <property name="clean.extra" value="${staging.dir}"/>
+
+ <!-- Libraries to include -->
+ <property name="seam.ui.lib" value="yes"/>
+ <property name="seam.debug.lib" value="yes"/>
+ <property name="facelets.lib" value="yes"/>
+ <property name="jbpm.lib" value="yes"/>
+ <property name="search.lib" value="yes"/>
+ <property name="urlrewrite.lib" value="yes"/>
+ <!--<property name="metawidget-ear.lib" value="yes"/>-->
+
+ <!-- Datasource -->
+ <property name="example.ds" value="jboss-seam-metawidget-dvdstore-ds.xml"/>
+
+ <target name="build">
+
+ <!-- Copy the original Seam booking example -->
+ <copy todir="${staging.dir}">
+ <fileset dir="${seam.dir}/examples/dvdstore">
+ <include name="src/**"/>
+ <include name="view/**"/>
+ <include name="resources/**"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy metawidget example overrides -->
+ <copy todir="${staging.dir}" overwrite="true">
+ <fileset dir=".">
+ <include name="src/**"/>
+ <include name="view/**"/>
+ <include name="resources/**"/>
+ </fileset>
+ </copy>
+
+ <move file="${resources.dir}/jboss-seam-dvdstore-ds.xml" tofile="${resources.dir}/${example.ds}"/>
+ </target>
+
+ <import file="${basedir}/../../build.xml"/>
+
+ <path id="build.classpath.extras">
+ <fileset dir="${basedir}/..">
+ <include name="metawidget.jar"/>
+ </fileset>
+ </path>
+
+ <fileset id="ear.lib.extras" dir="${basedir}/..">
+ <include name="metawidget-backend.jar"/>
+ </fileset>
+
+ <fileset id="war.lib.extras" dir="${basedir}/..">
+ <include name="metawidget-frontend.jar"/>
+ </fileset>
+
+</project>
Added: trunk/examples/metawidget/dvdstore/readme.txt
===================================================================
--- trunk/examples/metawidget/dvdstore/readme.txt (rev 0)
+++ trunk/examples/metawidget/dvdstore/readme.txt 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,15 @@
+Seam Metawidget DVD Store Example
+=================================
+
+This example demonstrates the use of Seam with jBPM pageflow and business
+process management. It uses metawidget to layout the forms. The example runs on
+JBoss AS as an EAR and Tomcat with Embedded JBoss as a WAR.
+
+example.name=dvdstore
+
+The source files in this example are just the overrides needed to utilize
+metawidget. Before you can deploy the example, you have to merge these
+overrides with the original groovybooking source code in a staging directory.
+That is done using the following command:
+
+ ant build
Added: trunk/examples/metawidget/dvdstore/resources/META-INF/application.xml
===================================================================
--- trunk/examples/metawidget/dvdstore/resources/META-INF/application.xml (rev 0)
+++ trunk/examples/metawidget/dvdstore/resources/META-INF/application.xml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
+ version="5">
+
+ <display-name>Metawidget DVD Store</display-name>
+
+ <module>
+ <ejb>jboss-seam-metawidget-dvdstore.jar</ejb>
+ </module>
+
+ <module>
+ <web>
+ <web-uri>jboss-seam-metawidget-dvdstore.war</web-uri>
+ <context-root>/seam-metawidget-dvdstore</context-root>
+ </web>
+ </module>
+
+ <module>
+ <ejb>jboss-seam.jar</ejb>
+ </module>
+
+</application>
Added: trunk/examples/metawidget/dvdstore/resources/WEB-INF/inspector-config.xml
===================================================================
--- trunk/examples/metawidget/dvdstore/resources/WEB-INF/inspector-config.xml (rev 0)
+++ trunk/examples/metawidget/dvdstore/resources/WEB-INF/inspector-config.xml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<inspector-config xmlns="http://metawidget.org/inspector-config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://metawidget.org/inspector-config http://metawidget.org/inspector-config/inspector-config-1.0.xsd" version="1.0">
+
+ <compositeInspector xmlns="java:org.metawidget.inspector.composite" config="CompositeInspectorConfig">
+ <inspectors>
+ <metawidgetAnnotationInspector xmlns="java:org.metawidget.inspector.annotation"/>
+ <propertyTypeInspector xmlns="java:org.metawidget.inspector.propertytype"/>
+ <facesInspector xmlns="java:org.metawidget.inspector.faces"/>
+ <jpaInspector xmlns="java:org.metawidget.inspector.jpa"/>
+ <hibernateValidatorInspector xmlns="java:org.metawidget.inspector.hibernate.validator"/>
+ <jbpmInspector xmlns="java:org.metawidget.inspector.jbpm" config="JbpmInspectorConfig">
+ <files>
+ <string>checkout.jpdl.xml</string>
+ <string>newuser.jpdl.xml</string>
+ </files>
+ </jbpmInspector>
+ </inspectors>
+ </compositeInspector>
+
+</inspector-config>
\ No newline at end of file
Added: trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/Customer.java
===================================================================
--- trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/Customer.java (rev 0)
+++ trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/Customer.java 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,175 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package com.jboss.dvd.seam;
+
+import java.io.Serializable;
+
+import javax.persistence.*;
+
+import org.jboss.seam.annotations.Name;
+import org.hibernate.validator.*;
+import org.metawidget.inspector.annotation.*;
+import org.metawidget.inspector.faces.*;
+
+@Entity
+@Name("customer")
+@DiscriminatorValue("customer")
+public class Customer
+ extends User
+ implements Serializable
+{
+ private static final long serialVersionUID = 5699525147178760355L;
+
+ public static String[] cctypes = {"MasterCard", "Visa", "Discover", "Amex", "Dell Preferred"};
+
+ String address1;
+ String address2;
+ String city;
+ String state;
+ String zip;
+
+ String email;
+ String phone;
+
+ Integer creditCardType = 1;
+ String creditCard = "000-0000-0000";
+ int ccMonth = 1;
+ int ccYear = 2005;
+
+
+ public Customer() {
+ }
+
+
+ @Column(name="ADDRESS1",length=50)
+ @NotNull
+ @UiComesAfter("lastName")
+ public String getAddress1() {
+ return address1;
+ }
+ public void setAddress1(String address1) {
+ this.address1 = address1;
+ }
+
+ @Column(name="ADDRESS2",length=50)
+ @NotNull
+ @UiComesAfter("address1")
+ public String getAddress2() {
+ return address2;
+ }
+ public void setAddress2(String address2) {
+ this.address2 = address2;
+ }
+
+ @Column(name="CITY",length=50)
+ @NotNull
+ @UiComesAfter("address2")
+ public String getCity() {
+ return city;
+ }
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+
+ @Column(name="STATE",length=2)
+ @NotNull
+ @Length(min=2,max=2)
+ @UiComesAfter("city")
+ public String getState() {
+ return state;
+ }
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ @Column(name="ZIP", length=10)
+ @Length(min=5, max=10)
+ @Pattern(regex="[0-9]{5}(-[0-9]{4})?", message="not a valid zipcode") // {validator.zip}
+ @NotNull
+ @UiComesAfter("state")
+ public String getZip() {
+ return zip;
+ }
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
+
+ @Column(name="EMAIL",length=50)
+ @Email
+ @UiComesAfter("zip")
+ public String getEmail() {
+ return email;
+ }
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ @Column(name="PHONE",length=50)
+ @UiComesAfter("email")
+ public String getPhone() {
+ return phone;
+ }
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+
+ @Column(name="CREDITCARDTYPE")
+ @UiFacesLookup("#{editCustomer.creditCardTypes}")
+ public Integer getCreditCardType() {
+ return creditCardType;
+ }
+ public void setCreditCardType(Integer type) {
+ this.creditCardType = type;
+ }
+
+ @Transient @UiHidden public String getCreditCardTypeString() {
+ if (creditCardType<1 || creditCardType>cctypes.length) {
+ return "";
+ }
+ return cctypes[creditCardType-1];
+ }
+
+ @Column(name="CC_NUM", length=50)
+ public String getCreditCard() {
+ return creditCard;
+ }
+ public void setCreditCard(String creditCard) {
+ this.creditCard = creditCard;
+ }
+
+ @Column(name="CC_MONTH", length=50)
+ @UiLookup( value = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }, labels = { "#{messages.mo_1}", "#{messages.mo_2}", "#{messages.mo_3}", "#{messages.mo_4}", "#{messages.mo_5}", "#{messages.mo_6}", "#{messages.mo_7}", "#{messages.mo_8}", "#{messages.mo_9}", "#{messages.mo_10}", "#{messages.mo_11}", "#{messages.mo_12}" } )
+ public int getCreditCardMonth() {
+ return ccMonth;
+ }
+ public void setCreditCardMonth(int ccMonth) {
+ this.ccMonth = ccMonth;
+ }
+
+ @Column(name="CC_YEAR", length=50)
+ @UiLookup( { "2005", "2006", "2007", "2008", "2009", "2010" } )
+ public int getCreditCardYear() {
+ return ccYear;
+ }
+ public void setCreditCardYear(int ccYear) {
+ this.ccYear = ccYear;
+ }
+
+ @Transient
+ @UiHidden
+ public String getCreditCardExpiration() {
+ return "" + ccMonth + "/" + ccYear;
+ }
+
+ @Override
+ public String toString() {
+ return "Customer#" + getId() + "(" + userName + ")";
+ }
+
+}
Added: trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/EditCustomer.java
===================================================================
--- trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/EditCustomer.java (rev 0)
+++ trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/EditCustomer.java 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package com.jboss.dvd.seam;
+
+import java.util.Map;
+
+import javax.ejb.Local;
+
+import org.hibernate.validator.*;
+import org.metawidget.inspector.annotation.*;
+
+@Local
+public interface EditCustomer
+{
+ public void startEdit();
+
+ public Map<String,Integer> getCreditCardTypes();
+
+ public void setPasswordVerify(String password);
+
+ @UiMasked
+ @NotNull
+ public String getPasswordVerify();
+
+ public boolean isValidNamePassword();
+
+ public String saveUser();
+
+ public void destroy();
+}
Added: trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/User.java
===================================================================
--- trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/User.java (rev 0)
+++ trunk/examples/metawidget/dvdstore/src/com/jboss/dvd/seam/User.java 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package com.jboss.dvd.seam;
+
+import java.io.Serializable;
+
+import javax.persistence.*;
+import org.hibernate.validator.*;
+import org.metawidget.inspector.annotation.*;
+
+@Entity
+@Table(name="USERS")
+public abstract class User
+ implements Serializable
+{
+ long id;
+
+ String userName;
+ String password;
+
+ String firstName;
+ String lastName;
+
+ @Id @GeneratedValue
+ @Column(name="USERID")
+ public long getId() {
+ return id;
+ }
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ @Column(name="USERNAME",unique=true,nullable=false,length=50)
+ @NotNull
+ @Length(min=4,max=16)
+ public String getUserName() {
+ return userName;
+ }
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ @Column(name="PASSWORD",nullable=false,length=50)
+ @NotNull
+ @Length(min=6,max=50)
+ @UiMasked
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ @Column(name="FIRSTNAME",length=50)
+ public String getFirstName() {
+ return firstName;
+ }
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+ @Column(name="LASTNAME",length=50)
+ @UiComesAfter("firstName")
+ public String getLastName() {
+ return lastName;
+ }
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ @Transient
+ @UiHidden
+ public boolean isAdmin() {
+ return false;
+ }
+}
Added: trunk/examples/metawidget/dvdstore/view/confirm.xhtml
===================================================================
--- trunk/examples/metawidget/dvdstore/view/confirm.xhtml (rev 0)
+++ trunk/examples/metawidget/dvdstore/view/confirm.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,93 @@
+<!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:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:m="http://metawidget.org/faces">
+<body>
+ <ui:composition template="/WEB-INF/template.xhtml">
+ <ui:define name="topnav">
+ <ui:include src="/WEB-INF/incl/store_nav.xhtml">
+ <ui:param name="page" value="cart" />
+ </ui:include>
+ </ui:define>
+
+ <ui:define name="sidebar">
+ <ui:include src="/WEB-INF/incl/login.xhtml" />
+ </ui:define>
+
+ <ui:define name="body">
+ <h1>Confirm Order</h1>
+
+ <f:subview id="no_order" rendered="#{currentOrder==null}">
+ <p>You have no order.</p>
+ </f:subview>
+
+ <f:subview id="orderdetail" rendered="#{currentOrder != null}">
+ <h:form id="OrderDetailForm">
+ <h:dataTable id="OrderDetailDataTable"
+ value="#{currentOrder.orderLines}" var="line"
+ styleClass="dvdtable"
+ headerClass="dvdtablehead"
+ rowClasses="dvdtableodd,dvdtableeven"
+ columnClasses="dvdtablecol">
+ <h:column id="column1">
+ <f:facet id="TitleFacet" name="header">
+ <h:outputText id="TitleText" value="#{messages.cartTitleColumn}" />
+ </f:facet>
+ <h:outputText id="TitleValue" value="#{line.product.title}" />
+ </h:column>
+ <h:column id="column2">
+ <f:facet id="ActorFacet" name="header">
+ <h:outputText id="ActorText" value="#{messages.cartActorColumn}" />
+ </f:facet>
+ <h:outputText id="ActorValue" value="#{line.product.actors[0].name}" />
+ </h:column>
+
+ <h:column id="column3">
+ <f:facet id="PriceFacet" name="header">
+ <h:outputText id="PriceText" value="#{messages.cartPriceColumn}" />
+ </f:facet>
+ <h:outputText id="PriceValue" value="#{line.product.price}">
+ <f:convertNumber type="currency" currencySymbol="$" />
+ </h:outputText>
+ </h:column>
+ <h:column id="column4">
+ <f:facet id="QuantityFacet" name="header">
+ <h:outputText id="QuantityText" value="#{messages.cartQuantityColumn}" />
+ </f:facet>
+ <h:outputText id="QuantityValue" value="#{line.quantity}"/>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+
+ <div style="width: 100%;">
+ <div class="cntInfo" style="float:right;">
+ <h:panelGrid id="CostSummary" columns="2">
+ <h:outputText id="CartSubtotalText" value="#{messages.checkoutSubtotal}" />
+ <h:outputText id="CartSubtotalValue" value="#{currentOrder.netAmount}">
+ <f:convertNumber type="currency" currencySymbol="$" />
+ </h:outputText>
+
+ <h:outputText id="CartTaxText" value="#{messages.checkoutTax}" />
+ <h:outputText id="CartTaxValue" value="#{currentOrder.tax}">
+ <f:convertNumber type="currency" currencySymbol="$" />
+ </h:outputText>
+
+ <h:outputText id="CartTotalText" value="#{messages.checkoutTotal}" />
+ <h:outputText id="CartTotalValue" value="#{currentOrder.totalAmount}">
+ <f:convertNumber type="currency" currencySymbol="$" />
+ </h:outputText>
+ </h:panelGrid>
+
+ <h:form id="ConfirmOrCancelForm">
+ <m:metawidget value="checkout.confirm" rendererType="simple"/>
+ </h:form>
+ </div>
+ </div>
+ </f:subview>
+ </ui:define>
+ </ui:composition>
+</body>
+</html>
Added: trunk/examples/metawidget/dvdstore/view/newuser/account.xhtml
===================================================================
--- trunk/examples/metawidget/dvdstore/view/newuser/account.xhtml (rev 0)
+++ trunk/examples/metawidget/dvdstore/view/newuser/account.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,55 @@
+<!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:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:m="http://metawidget.org/faces">
+<body>
+ <ui:composition template="/WEB-INF/template.xhtml">
+ <ui:define name="topnav">
+ <ui:include src="/WEB-INF/incl/store_nav.xhtml">
+ <ui:param name="page" value="home" />
+ </ui:include>
+ </ui:define>
+
+ <ui:define name="sidebar">
+ <ui:include src="/WEB-INF/incl/login.xhtml" />
+ </ui:define>
+
+ <ui:define name="body">
+ <h2><h:outputText id="NewCustomerHeader" value="#{messages.newCustomerHeader}" /></h2>
+
+ <p><em><h:outputText id="NewCustomerInfo" value="#{messages.newCustomerInfo}" /></em></p>
+
+
+ <p>
+ The user registration wizard uses a
+ <a onclick="window.open('../img/newuser.html','flowimg','height=580,width=510,toolbar=no,status=no,directories=no,menubar=no,scrollbars=no,resizable=no'); return false;"
+ href="img/newuser.html">pageflow</a>
+ to define the flow of the user interaction.
+ </p>
+
+ <div class="cntInfo">
+ <h:form id="NewAccountForm">
+
+ <m:metawidget>
+ <f:param name="labelStyle" value="text-align: left; font-weight: normal"/>
+ <f:param name="messageStyleClass" value="cntError"/>
+
+ <m:metawidget value="#{customer.userName}" inspectFromParent="true" rendererType="simple"/>
+ <m:metawidget value="#{customer.password}" inspectFromParent="true" rendererType="simple"/>
+ <m:metawidget value="#{editCustomer.passwordVerify}" inspectFromParent="true" rendererType="simple"/>
+
+ <f:facet name="footer">
+ <m:metawidget value="newuser.account" rendererType="simple"/>
+ </f:facet>
+ </m:metawidget>
+
+ </h:form>
+ </div>
+ </ui:define>
+ </ui:composition>
+</body>
+</html>
Added: trunk/examples/metawidget/dvdstore/view/newuser/card.xhtml
===================================================================
--- trunk/examples/metawidget/dvdstore/view/newuser/card.xhtml (rev 0)
+++ trunk/examples/metawidget/dvdstore/view/newuser/card.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,46 @@
+<!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:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:m="http://metawidget.org/faces">
+<body>
+ <ui:composition template="/WEB-INF/template.xhtml">
+ <ui:define name="topnav">
+ <ui:include src="/WEB-INF/incl/store_nav.xhtml">
+ <ui:param name="page" value="home" />
+ </ui:include>
+ </ui:define>
+
+ <ui:define name="sidebar">
+ <ui:include src="/WEB-INF/incl/login.xhtml" />
+ </ui:define>
+
+ <ui:define name="body">
+ <h2><h:outputText id="NewCustomerHeaderText" value="#{messages.newCustomerHeader}" /></h2>
+
+ <p><em><h:outputText id="NewCustomerInfoText" value="#{messages.newCustomerInfo}" /></em></p>
+
+ <h:form id="NewAccountForm">
+ <m:metawidget>
+ <f:param name="labelStyle" value="text-align: left; font-weight: normal"/>
+ <f:param name="messageStyleClass" value="cntError"/>
+
+ <m:metawidget value="#{customer.creditCardType}" inspectFromParent="true" rendererType="simple"/>
+ <m:metawidget value="#{customer.creditCard}" inspectFromParent="true" rendererType="simple"/>
+ <m:stub value="#{customer.creditCardMonth}">
+ <m:metawidget value="#{customer.creditCardMonth}" inspectFromParent="true" rendererType="simple"/>
+ <m:metawidget value="#{customer.creditCardYear}" inspectFromParent="true" rendererType="simple"/>
+ </m:stub>
+ <f:facet name="footer">
+ <m:metawidget value="newuser.card" rendererType="simple"/>
+ </f:facet>
+ </m:metawidget>
+ </h:form>
+
+ </ui:define>
+ </ui:composition>
+</body>
+</html>
Added: trunk/examples/metawidget/dvdstore/view/newuser/contact.xhtml
===================================================================
--- trunk/examples/metawidget/dvdstore/view/newuser/contact.xhtml (rev 0)
+++ trunk/examples/metawidget/dvdstore/view/newuser/contact.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,49 @@
+<!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:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:m="http://metawidget.org/faces">
+<body>
+ <ui:composition template="/WEB-INF/template.xhtml">
+ <ui:define name="topnav">
+ <ui:include src="/WEB-INF/incl/store_nav.xhtml">
+ <ui:param name="page" value="home" />
+ </ui:include>
+ </ui:define>
+
+ <ui:define name="sidebar">
+ <ui:include src="/WEB-INF/incl/login.xhtml" />
+ </ui:define>
+
+ <ui:define name="body">
+ <h2><h:outputText id="CustomerHeaderText" value="#{messages.newCustomerHeader}" /></h2>
+
+ <p><em><h:outputText id="NewCustomerInfoText" value="#{messages.newCustomerInfo}" /></em></p>
+
+ <h:form id="NewAccountForm">
+ <s:validateAll id="ValidateAll">
+ <m:metawidget value="#{customer}" validatorClass="org.metawidget.faces.component.validator.RequiredValidator">
+ <f:param name="labelStyle" value="text-align: left; font-weight: normal"/>
+ <f:param name="messageStyleClass" value="cntError"/>
+
+ <m:stub value="#{customer.userName}"/>
+ <m:stub value="#{customer.password}"/>
+ <m:stub value="#{customer.creditCard}"/>
+ <m:stub value="#{customer.creditCardMonth}"/>
+ <m:stub value="#{customer.creditCardYear}"/>
+ <m:stub value="#{customer.creditCardType}"/>
+
+ <f:facet name="footer">
+ <m:metawidget value="newuser.contact" rendererType="simple"/>
+ </f:facet>
+ </m:metawidget>
+ </s:validateAll>
+ </h:form>
+
+ </ui:define>
+ </ui:composition>
+</body>
+</html>
Property changes on: trunk/examples/metawidget/groovybooking
___________________________________________________________________
Name: svn:ignore
+ dist
exploded-archives
staging
Added: trunk/examples/metawidget/groovybooking/build.properties
===================================================================
--- trunk/examples/metawidget/groovybooking/build.properties (rev 0)
+++ trunk/examples/metawidget/groovybooking/build.properties 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,2 @@
+# Uncomment when deploying to JBoss AS 5
+#loadPersistenceUnits=false
Added: trunk/examples/metawidget/groovybooking/build.xml
===================================================================
--- trunk/examples/metawidget/groovybooking/build.xml (rev 0)
+++ trunk/examples/metawidget/groovybooking/build.xml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,145 @@
+<?xml version="1.0"?>
+<project name="Seam Metawidget Groovy Booking" default="jbosswar.restart" basedir=".">
+
+ <!-- Naming -->
+ <property name="Name" value="Seam Metawidget Groovy Booking Example"/>
+ <property name="example.name" value="jboss-seam-metawidget-groovybooking"/>
+
+ <property file="${basedir}/build.properties" />
+
+ <!-- Define location of merged source -->
+ <property name="staging.dir" value="${basedir}/staging"/>
+ <property name="src.model.dir" value="${staging.dir}/src/model" />
+ <property name="src.action.dir" value="${staging.dir}/src/action" />
+ <property name="src.test.dir" value="${staging.dir}/src/test" />
+ <property name="src.java.dir" value="${src.model.dir}"/>
+ <property name="view.dir" value="${staging.dir}/view"/>
+ <property name="resources.dir" value="${staging.dir}/resources"/>
+ <property name="clean.extra" value="${staging.dir}"/>
+
+ <!-- Libraries to include -->
+ <property name="seam.ui.lib" value="yes"/>
+ <property name="seam.debug.lib" value="yes"/>
+ <property name="facelets.lib" value="yes"/>
+ <property name="richfaces.lib" value="yes"/>
+ <property name="groovy.lib" value="yes" />
+ <!--<property name="metawidget-war.lib" value="yes" />-->
+
+ <property name="profile" value="dev" />
+
+ <!-- Datasource -->
+ <property name="example.ds" value="metawidget-groovybooking-${profile}-ds.xml"/>
+
+ <target name="build">
+
+ <!-- Copy the original Seam booking example -->
+ <copy todir="${staging.dir}">
+ <fileset dir="${seam.dir}/examples/groovybooking">
+ <include name="src/**"/>
+ <include name="view/**"/>
+ <include name="resources/**"/>
+ </fileset>
+ </copy>
+
+ <!-- Copy metawidget example overrides -->
+ <copy todir="${staging.dir}" overwrite="true">
+ <fileset dir=".">
+ <include name="src/**"/>
+ <include name="view/**"/>
+ <include name="resources/**"/>
+ </fileset>
+ </copy>
+
+ <move file="${resources.dir}/groovybooking-dev-ds.xml" tofile="${resources.dir}/metawidget-groovybooking-dev-ds.xml"/>
+ <move file="${resources.dir}/groovybooking-prod-ds.xml" tofile="${resources.dir}/metawidget-groovybooking-prod-ds.xml"/>
+ </target>
+
+ <import file="${basedir}/../../build.xml"/>
+
+ <path id="build.classpath.extras">
+ <fileset dir="${basedir}/..">
+ <include name="metawidget.jar"/>
+ </fileset>
+ </path>
+
+ <fileset id="war.lib.extras" dir="${basedir}/..">
+ <include name="metawidget.jar"/>
+ </fileset>
+
+ <!-- remaining configuration copied from ../../groovybooking/build.xml -->
+ <target name="explode">
+ <antcall target="jbosswar.explode" />
+ </target>
+
+ <target name="restart">
+ <antcall target="jbosswar.restart" />
+ </target>
+
+ <target name="unexplode">
+ <antcall target="jbosswar.unexplode" />
+ </target>
+
+ <property name="classes.model.dir" value="${war.dir}/WEB-INF/classes" />
+ <property name="classes.action.dir" value="${war.dir}/WEB-INF/dev" />
+ <property name="debug" value="true" />
+
+ <path id="src.test.path">
+ <path path="${src.model.dir}" />
+ <path path="${src.test.dir}" />
+ <path path="${src.action.dir}" />
+ </path>
+
+ <target name="groovy.init" description="Initialize the build">
+ <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="build.classpath" />
+ <!-- really only the groovy jar is necessary -->
+ <mkdir dir="${classes.model.dir}" />
+ <mkdir dir="${classes.action.dir}" />
+ <condition property="groovy.dynamic" value="true">
+ <and>
+ <istrue value="${debug}" />
+ </and>
+ </condition>
+ <condition property="groovy.static" value="true">
+ <and>
+ <isfalse value="${debug}" />
+ </and>
+ </condition>
+ </target>
+
+ <target name="compilemodel" depends="groovy.init">
+ <groovyc classpathref="build.classpath" destdir="${classes.model.dir}" srcdir="${src.model.dir}" />
+ </target>
+
+ <target name="compileactions" depends="groovy.init,compileactions.compilegroovy,compileactions.copygroovy,compilemodel">
+ <javac classpathref="build.classpath" destdir="${classes.action.dir}" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on">
+ <classpath path="${classes.model.dir}" />
+ <src path="${src.action.dir}" />
+ </javac>
+ </target>
+
+ <!-- private task -->
+ <target name="compileactions.compilegroovy" if="groovy.static" depends="groovy.init,compilemodel">
+ <path id="groovy.action.classpath">
+ <path refid="build.classpath" />
+ <dirset dir="${classes.model.dir}" />
+ </path>
+ <groovyc classpathref="groovy.action.classpath" destdir="${classes.action.dir}" srcdir="${src.action.dir}">
+ </groovyc>
+ </target>
+
+ <!-- private task -->
+ <target name="compileactions.copygroovy" if="groovy.dynamic">
+ <!-- copy the action groovy files into action if not compiled -->
+ <copy todir="${classes.action.dir}">
+ <fileset dir="${src.action.dir}">
+ <include name="**/*.groovy" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="init.war" depends="compilemodel,compileactions">
+ <copy tofile="${war.dir}/WEB-INF/classes/META-INF/persistence.xml" file="${resources.dir}/META-INF/persistence-${profile}-war.xml" overwrite="true" />
+ <copy tofile="${war.dir}/WEB-INF/classes/import.sql" file="${resources.dir}/import-${profile}.sql" overwrite="true" />
+ </target>
+
+</project>
Added: trunk/examples/metawidget/groovybooking/readme.txt
===================================================================
--- trunk/examples/metawidget/groovybooking/readme.txt (rev 0)
+++ trunk/examples/metawidget/groovybooking/readme.txt 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,24 @@
+Seam Metawidget GroovyBooking Example
+=====================================
+
+This is the Hotel Booking example implemented in Groovy Beans and Hibernate JPA
+and uses Metawidget to layout the forms. This application runs on JBoss AS, but
+is deployed as a WAR rather than an EAR. Thus, you prefix all the typical
+targets (explode, restart, unexplode) with "jbosswar." (e.g., jbosswar.explode,
+jbosswar.restart, jbosswar.unexplode).
+
+Please note that you need to uncomment the loadPersistenceUnits=true property
+in build.properties when deploying to JBoss AS 5.
+
+The source files in this example are just the overrides needed to utilize
+metawidget. Before you can deploy the example, you have to merge these
+overrides with the original groovybooking source code in a staging directory.
+That is done using the following command:
+
+ ant build
+
+When editing Groovy files from the src/action directory, you can run "ant
+build jbosswar.explode" to see your changes take effect. When editing Groovy files
+from src/model, you need to run "ant build jbosswar.explode jbosswar.restart"
+
+Access the application at http://localhost:8080/jboss-seam-metawidget-groovybooking
Added: trunk/examples/metawidget/groovybooking/resources/WEB-INF/inspector-config.xml
===================================================================
--- trunk/examples/metawidget/groovybooking/resources/WEB-INF/inspector-config.xml (rev 0)
+++ trunk/examples/metawidget/groovybooking/resources/WEB-INF/inspector-config.xml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<inspector-config xmlns="http://metawidget.org/inspector-config"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://metawidget.org/inspector-config http://metawidget.org/inspector-config/inspector-config-1.0.xsd" version="1.0">
+
+ <compositeInspector xmlns="java:org.metawidget.inspector.composite" config="CompositeInspectorConfig">
+ <inspectors>
+ <metawidgetAnnotationInspector xmlns="java:org.metawidget.inspector.annotation" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
+ <propertyStyle>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</propertyStyle>
+ </metawidgetAnnotationInspector>
+ <propertyTypeInspector xmlns="java:org.metawidget.inspector.propertytype" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
+ <propertyStyle>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</propertyStyle>
+ </propertyTypeInspector>
+ <facesInspector xmlns="java:org.metawidget.inspector.faces" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
+ <propertyStyle>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</propertyStyle>
+ </facesInspector>
+ <jpaInspector xmlns="java:org.metawidget.inspector.jpa" config="JpaInspectorConfig">
+ <propertyStyle>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</propertyStyle>
+ </jpaInspector>
+ <hibernateValidatorInspector xmlns="java:org.metawidget.inspector.hibernate.validator" config="org.metawidget.inspector.impl.BaseObjectInspectorConfig">
+ <propertyStyle>org.metawidget.inspector.impl.propertystyle.groovy.GroovyPropertyStyle</propertyStyle>
+ </hibernateValidatorInspector>
+ </inspectors>
+ </compositeInspector>
+
+</inspector-config>
\ No newline at end of file
Added: trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/example/groovy/Booking.groovy
===================================================================
--- trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/example/groovy/Booking.groovy (rev 0)
+++ trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/example/groovy/Booking.groovy 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,121 @@
+//$Id: Booking.groovy 4698 2007-04-18 06:40:06Z ebernard $
+package org.jboss.seam.example.groovy
+
+import java.text.DateFormat
+import javax.persistence.Basic
+import javax.persistence.Entity
+import javax.persistence.GeneratedValue
+import javax.persistence.Id
+import javax.persistence.ManyToOne
+import javax.persistence.Temporal
+import javax.persistence.TemporalType
+import javax.persistence.Transient
+
+import org.hibernate.validator.Length
+import org.hibernate.validator.NotNull
+import org.hibernate.validator.Pattern
+import org.jboss.seam.annotations.Name
+
+import org.metawidget.inspector.annotation.*;
+import org.metawidget.inspector.faces.*;
+
+@Entity
+@Name("booking")
+class Booking implements Serializable
+{
+ @Id @GeneratedValue
+ Long id
+
+ @ManyToOne @NotNull
+ @UiHidden
+ User user
+
+ @ManyToOne @NotNull
+ @UiHidden
+ Hotel hotel
+
+ @NotNull
+ @Basic @Temporal(TemporalType.DATE)
+ @UiComesAfter( [ "total" ] )
+ @UiFacesDateTimeConverter( pattern = "MM/dd/yyyy" )
+ Date checkinDate
+
+ @Basic @Temporal(TemporalType.DATE)
+ @NotNull
+ @UiComesAfter( [ "checkinDate" ] )
+ @UiFacesDateTimeConverter( pattern = "MM/dd/yyyy" )
+ Date checkoutDate
+
+ @NotNull(message="Credit card number is required")
+ @Length(min=16, max=16, message="Credit card number must 16 digits long")
+ @Pattern(regex=/^\d*$/, message="Credit card number must be numeric")
+ @UiComesAfter( [ "smoking" ] )
+ @UiLabel( "Credit card #" )
+ String creditCard
+
+ @NotNull(message="Credit card name is required")
+ @Length(min=3, max=70)
+ @UiComesAfter( [ "creditCard" ] )
+ String creditCardName
+
+ @UiLookup( value = [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ], labels = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ] )
+ @UiComesAfter( [ "creditCardName" ] )
+ @UiLabel( "Expiry month" )
+ int creditCardExpiryMonth
+
+ @UiComesAfter( [ "creditCardExpiryMonth" ] )
+ @UiLookup( [ "2005", "2006", "2007", "2008", "2009" ] )
+ @UiLabel( "Expiry year" )
+ int creditCardExpiryYear
+
+ @UiLookup( value = [ "true", "false" ], labels = [ "Smoking", "Non Smoking" ] )
+ @UiFacesComponent( "javax.faces.HtmlSelectOneRadio" )
+ @UiComesAfter( [ "beds" ] )
+ boolean smoking
+
+ @UiLabel( "Room preference" )
+ @UiComesAfter( [ "checkoutDate" ] )
+ @UiLookup( value = [ "1", "2", "3" ], labels = [ "One king-size bed", "Two double beds", "Three beds" ] )
+ int beds
+
+ Booking() {}
+
+ Booking(Hotel hotel, User user)
+ {
+ this.hotel = hotel
+ this.user = user
+ }
+
+ @Transient
+ @UiHidden
+ @UiFacesNumberConverter(type="currency",currencySymbol="\$")
+ @UiLabel("Total payment")
+ BigDecimal getTotal()
+ {
+ return hotel.price * getNights()
+ }
+
+ @Transient
+ @UiHidden
+ int getNights()
+ {
+ return (int) ( ( checkoutDate.time - checkinDate.time ) / 1000 / 60 / 60 / 24 )
+ }
+
+ @Transient
+ @UiHidden
+ String getDescription()
+ {
+ DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM)
+ return hotel ?
+ "${hotel.name}, ${df.format( checkinDate )} to ${df.format(checkoutDate)}" :
+ null
+ }
+
+ @Override
+ String toString()
+ {
+ return "Booking(" + user + ","+ hotel + ")"
+ }
+
+}
Added: trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/example/groovy/Hotel.groovy
===================================================================
--- trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/example/groovy/Hotel.groovy (rev 0)
+++ trunk/examples/metawidget/groovybooking/src/model/org/jboss/seam/example/groovy/Hotel.groovy 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,57 @@
+//$Id: Hotel.groovy 4698 2007-04-18 06:40:06Z ebernard $
+package org.jboss.seam.example.groovy
+
+import javax.persistence.Column
+import javax.persistence.Entity
+import javax.persistence.GeneratedValue
+import javax.persistence.Id
+
+import org.hibernate.validator.Length
+import org.hibernate.validator.NotNull
+import org.jboss.seam.annotations.Name
+
+import org.metawidget.inspector.annotation.*;
+import org.metawidget.inspector.faces.*;
+
+@Entity
+@Name("hotel")
+class Hotel implements Serializable
+{
+ @Id @GeneratedValue
+ Long id
+
+ @Length(max=50) @NotNull
+ String name
+
+ @Length(max=100) @NotNull
+ @UiComesAfter( [ "name" ] )
+ String address
+
+ @Length(max=40) @NotNull
+ @UiComesAfter( [ "address" ] )
+ String city
+
+ @Length(min=2, max=10) @NotNull
+ @UiComesAfter( [ "city" ] )
+ String state
+
+ @Length(min=4, max=6) @NotNull
+ @UiComesAfter( [ "state" ] )
+ String zip
+
+ @Length(min=2, max=40) @NotNull
+ @UiComesAfter( [ "zip" ] )
+ String country
+
+ @Column(precision=6, scale=2)
+ @UiComesAfter( [ "country" ])
+ @UiFacesNumberConverter(type="currency",currencySymbol="\$")
+ @UiLabel("Nightly rate")
+ BigDecimal price
+
+ @Override
+ String toString()
+ {
+ return "Hotel(${name},${address},${city},${zip})"
+ }
+}
Added: trunk/examples/metawidget/groovybooking/view/book.xhtml
===================================================================
--- trunk/examples/metawidget/groovybooking/view/book.xhtml (rev 0)
+++ trunk/examples/metawidget/groovybooking/view/book.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,53 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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"
+ xmlns:a="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:m="http://metawidget.org/faces/richfaces"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+<div class="section">
+ <h1>Book Hotel</h1>
+</div>
+<div class="section">
+ <h:form id="booking">
+ <fieldset>
+
+ <m:metawidget value="#{hotel}" rendererType="div" readOnly="#{true}">
+ <f:param name="divStyleClasses" value="entry,label,required,output"/>
+ </m:metawidget>
+
+ <s:validateAll>
+
+ <m:metawidget value="#{booking}" rendererType="div" validatorClass="org.metawidget.faces.component.validator.RequiredValidator">
+ <f:param name="divStyleClasses" value="entry,label,required,input,error errors"/>
+ </m:metawidget>
+
+ </s:validateAll>
+
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
+ <div class="entry">
+ <div class="label"> </div>
+ <div class="input">
+ <h:commandButton id="proceed" value="Proceed" action="#{hotelBooking.setBookingDetails}"/> 
+ <s:button id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
+ </div>
+ </div>
+ </fieldset>
+ </h:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+</ui:define>
+
+</ui:composition>
Added: trunk/examples/metawidget/groovybooking/view/confirm.xhtml
===================================================================
--- trunk/examples/metawidget/groovybooking/view/confirm.xhtml (rev 0)
+++ trunk/examples/metawidget/groovybooking/view/confirm.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,47 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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"
+ xmlns:m="http://metawidget.org/faces/richfaces"
+ 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>
+
+ <m:metawidget value="#{hotel}" rendererType="div" readOnly="#{true}">
+ <f:param name="divStyleClasses" value="entry,label,required,output"/>
+ </m:metawidget>
+
+ <m:metawidget value="#{booking}" rendererType="div" readOnly="#{true}">
+ <f:param name="divStyleClasses" value="entry,label,required,output"/>
+ <h:outputText value="#{booking.total}"/>
+ <m:stub value="#{booking.creditCardExpiryMonth}"/>
+ <m:stub value="#{booking.creditCardExpiryYear}"/>
+ </m:metawidget>
+
+ <div class="entry">
+ <div class="label"> </div>
+ <div class="input">
+ <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}"/>
+ </div>
+ </div>
+ </fieldset>
+ </h:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+</ui:define>
+
+</ui:composition>
Added: trunk/examples/metawidget/groovybooking/view/hotel.xhtml
===================================================================
--- trunk/examples/metawidget/groovybooking/view/hotel.xhtml (rev 0)
+++ trunk/examples/metawidget/groovybooking/view/hotel.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,36 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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"
+ xmlns:m="http://metawidget.org/faces/richfaces"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+<div class="section">
+ <h1>View Hotel</h1>
+</div>
+<div class="section">
+
+ <m:metawidget value="#{hotel}" rendererType="div" readOnly="#{true}">
+ <f:param name="divStyleClasses" value="entry,label,required,output"/>
+ </m:metawidget>
+
+</div>
+<div class="section">
+ <h:form id="hotel">
+ <fieldset class="buttonBox">
+ <h:commandButton id="bookHotel" action="#{hotelBooking.bookHotel}" value="Book Hotel"/> 
+ <h:commandButton id="cancel" action="#{hotelBooking.cancel}" value="Back to Search"/>
+ </fieldset>
+ </h:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+</ui:define>
+
+</ui:composition>
Added: trunk/examples/metawidget/groovybooking/view/main.xhtml
===================================================================
--- trunk/examples/metawidget/groovybooking/view/main.xhtml (rev 0)
+++ trunk/examples/metawidget/groovybooking/view/main.xhtml 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,119 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<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"
+ xmlns:a="http://richfaces.org/a4j"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+ <h:form id="main">
+
+ <span class="errors">
+ <h:messages id="messages" globalOnly="true"/>
+ </span>
+
+ <h1>Search Hotels</h1>
+ <fieldset>
+ <h:inputText id="searchString" value="#{hotelSearch.searchString}" style="width: 165px;">
+ <a:support event="onkeyup" actionListener="#{hotelSearch.find}" reRender="searchResults" />
+ </h:inputText>
+  
+ <h:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}"/>
+  
+ <a:status>
+ <f:facet name="start">
+ <h:graphicImage id="Spinner" value="/img/spinner.gif"/>
+ </f:facet>
+ </a:status>
+ <br/>
+ <h:outputLabel for="pageSize">Maximum results:</h:outputLabel> 
+ <h:selectOneMenu value="#{hotelSearch.pageSize}" id="pageSize">
+ <f:selectItem itemLabel="5" itemValue="5"/>
+ <f:selectItem itemLabel="10" itemValue="10"/>
+ <f:selectItem itemLabel="20" itemValue="20"/>
+ </h:selectOneMenu>
+ </fieldset>
+
+ </h:form>
+</div>
+
+<a:outputPanel id="searchResults">
+ <div class="section">
+ <h:outputText id="NoHotelsFoundMessage" value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
+ <h:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
+ <h:column>
+ <f:facet name="header">Name</f:facet>
+ #{hot.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Address</f:facet>
+ #{hot.address}
+ </h:column>
+ <h:column>
+ <f:facet name="header">City, State</f:facet>
+ #{hot.city}, #{hot.state}, #{hot.country}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Zip</f:facet>
+ #{hot.zip}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Action</f:facet>
+ <s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
+ </h:column>
+ </h:dataTable>
+ <s:link id="MoreResultsLink" value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}"/>
+ </div>
+</a:outputPanel>
+
+<div class="section">
+ <h1>Current Hotel Bookings</h1>
+</div>
+<div class="section">
+ <h:form id="bookings">
+ <h:outputText value="No Bookings Found" rendered="#{bookings.rowCount==0}"/>
+ <h:dataTable id="bookings" value="#{bookings}" var="book" rendered="#{bookings.rowCount>0}">
+ <h:column>
+ <f:facet name="header">Name</f:facet>
+ #{book.hotel.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Address</f:facet>
+ #{book.hotel.address}
+ </h:column>
+ <h:column>
+ <f:facet name="header">City, State</f:facet>
+ #{book.hotel.city}, #{book.hotel.state}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Check in date</f:facet>
+ <h:outputText value="#{book.checkinDate}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Check out date</f:facet>
+ <h:outputText value="#{book.checkoutDate}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Confirmation number</f:facet>
+ #{book.id}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Action</f:facet>
+ <h:commandLink id="cancel" value="Cancel" action="#{bookingList.cancel}"/>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+</ui:define>
+
+</ui:composition>
Added: trunk/examples/metawidget/metawidget-backend.jar
===================================================================
(Binary files differ)
Property changes on: trunk/examples/metawidget/metawidget-backend.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/metawidget/metawidget-frontend.jar
===================================================================
(Binary files differ)
Property changes on: trunk/examples/metawidget/metawidget-frontend.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/metawidget/metawidget.jar
===================================================================
(Binary files differ)
Property changes on: trunk/examples/metawidget/metawidget.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/examples/metawidget/readme.txt
===================================================================
--- trunk/examples/metawidget/readme.txt (rev 0)
+++ trunk/examples/metawidget/readme.txt 2009-03-28 19:54:58 UTC (rev 10226)
@@ -0,0 +1,13 @@
+Metawidget Examples
+===================
+
+These examples demonstrate the use of the Metawidget user interface builder.
+These examples demonstrate the Metawidget JSF componenents, though Metawidget
+supports many other user interface platforms.
+
+You can find information about Metawidget at the project homepage:
+
+http://metawidget.sourceforge.net
+
+Thanks to Richard Kennard for porting the original Seam examples to use the
+Metawidget JSF components.
15 years, 9 months
Seam SVN: r10225 - trunk/doc/Seam_Reference_Guide/it-IT.
by seam-commits@lists.jboss.org
Author: nico.ben
Date: 2009-03-28 10:41:35 -0400 (Sat, 28 Mar 2009)
New Revision: 10225
Modified:
trunk/doc/Seam_Reference_Guide/it-IT/Controls.po
Log:
JBSEAM-3767: Italian translation of Seam guide
Modified: trunk/doc/Seam_Reference_Guide/it-IT/Controls.po
===================================================================
--- trunk/doc/Seam_Reference_Guide/it-IT/Controls.po 2009-03-28 00:57:36 UTC (rev 10224)
+++ trunk/doc/Seam_Reference_Guide/it-IT/Controls.po 2009-03-28 14:41:35 UTC (rev 10225)
@@ -6,7 +6,7 @@
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-05 00:19+0000\n"
-"PO-Revision-Date: 2009-03-25 20:44+0100\n"
+"PO-Revision-Date: 2009-03-28 15:41+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -1128,7 +1128,7 @@
#: Controls.xml:707
#, no-c-format
msgid "Outputs <emphasis>Seam Text</emphasis>, a rich text markup useful for blogs, wikis and other applications that might use rich text. See the Seam Text chapter for full usage."
-msgstr ""
+msgstr "Mostra come output <emphasis>Seam Text</emphasis>, un markup di testo utile per blog, wiki ed altre applicazioni che possono usare rich text. Vedere il capitolo di Seam Text per ulteriori informazioni."
#. Tag: para
#: Controls.xml:716
@@ -1232,13 +1232,13 @@
#: Controls.xml:795
#, no-c-format
msgid "<literal>label</literal> — the label to be used when rendering the <literal>SelectItem</literal>. Can reference the <literal>var</literal> variable."
-msgstr ""
+msgstr "<literal>label</literal> — l'etichetta da usare per generare <literal>SelectItem</literal>. Può fare riferimento alla variabile <literal>var</literal>."
#. Tag: para
#: Controls.xml:802
#, no-c-format
msgid "<literal>itemValue</literal> — Value to return to the server if this option is selected. Optional, by default the <literal>var</literal> object is used. Can reference the <literal>var</literal> variable."
-msgstr ""
+msgstr "<literal>itemValue</literal> — Il valore da restituire al server se quest'opzione è selezionata. E' opzionale, di default viene usato l'oggetto <literal>var</literal>. Può fare riferimento alla variabile <literal>var</literal>."
#. Tag: para
#: Controls.xml:811
@@ -1250,13 +1250,13 @@
#: Controls.xml:819
#, no-c-format
msgid "<literal>noSelectionLabel</literal> — specifies the (optional) label to place at the top of list (if <literal>required=\"true\"</literal> is also specified then selecting this value will cause a validation error)."
-msgstr ""
+msgstr "<literal>noSelectionLabel</literal> — specifica l'etichetta (opzionale) da mettere in cima alla lista (se è specificato anche <literal>required=\"true\"</literal> allora selezionando questo valore può causare una validazione d'errore)."
#. Tag: para
#: Controls.xml:827
#, no-c-format
msgid "<literal>hideNoSelectionLabel</literal> — if true, the <literal>noSelectionLabel</literal> will be hidden when a value is selected"
-msgstr ""
+msgstr "<literal>hideNoSelectionLabel</literal> — se true, <literal>noSelectionLabel</literal>verrà nascosto quando viene selezionato il valore."
#. Tag: programlisting
#: Controls.xml:835
@@ -1288,19 +1288,19 @@
#: Controls.xml:847
#, no-c-format
msgid "Cache the rendered page fragment using JBoss Cache. Note that <literal><s:cache></literal> actually uses the instance of JBoss Cache managed by the built-in <literal>pojoCache</literal> component."
-msgstr ""
+msgstr "Mette nella cache il frammento di pagina renderizzato usando JBoss Cache. Si noti che <literal><s:cache></literal> in verità usa l'istanza di JBoss Cache gestita dal componente predefinito <literal>pojoCache</literal>."
#. Tag: para
#: Controls.xml:856
#, no-c-format
msgid "<literal>key</literal> — the key to cache rendered content, often a value expression. For example, if we were caching a page fragment that displays a document, we might use <literal>key=\"Document-#{document.id}\"</literal>."
-msgstr ""
+msgstr "<literal>key</literal> — la chiave per memorizzare (cache) il contenuto renderizzato, spesso un'espressione di valore. Per esempio, se si mette nella cache un frammento di pagina che mostra un documento, si può usare <literal>key</literal> —"
#. Tag: para
#: Controls.xml:864
#, no-c-format
msgid "<literal>enabled</literal> — a value expression that determines if the cache should be used."
-msgstr ""
+msgstr "<literal>enabled</literal> — un'espressione di valore che determina se la cache debba essere usata."
#. Tag: para
#: Controls.xml:870
@@ -1354,7 +1354,7 @@
#: Controls.xml:887
#, no-c-format
msgid "Renders a file upload control. This control must be used within a form with an encoding type of <literal>multipart/form-data</literal>, i.e:"
-msgstr ""
+msgstr "Renderizza un controllo per l'upload del file. Questo controllo deve essere usato dentro la form con tipo di codifica <literal>multipart/form-data</literal>, cioè:"
#. Tag: programlisting
#: Controls.xml:893
@@ -1366,7 +1366,7 @@
#: Controls.xml:895
#, no-c-format
msgid "For multipart requests, the Seam Multipart servlet filter must also be configured in <literal>web.xml</literal>:"
-msgstr ""
+msgstr "Per richieste multiple, in <literal>web.xml</literal> deve essere configurato il filtro servlet Seam Multipart :"
#. Tag: programlisting
#: Controls.xml:900
@@ -1402,7 +1402,7 @@
#: Controls.xml:911
#, no-c-format
msgid "<literal>createTempFiles</literal> — if this option is set to true, uploaded files are streamed to a temporary file instead of in memory."
-msgstr ""
+msgstr "<literal>createTempFiles</literal> — se quest'opzione è impostata a true, i file caricati vengono accodati in un file temporaneo invece che in memoria."
#. Tag: para
#: Controls.xml:918
@@ -1434,7 +1434,7 @@
#: Controls.xml:934
#, no-c-format
msgid "<literal>data</literal> — this value binding receives the binary file data. The receiving field should be declared as a <literal>byte[]</literal> or <literal>InputStream</literal> (required)."
-msgstr ""
+msgstr "<literal>data</literal> — questo value binding riceve i dati binari. Il campo ricevente deve essere dichiarato come <literal>byte[]</literal> o <literal>InputStream</literal> (richiesto)."
#. Tag: para
#: Controls.xml:942
@@ -1446,7 +1446,7 @@
#: Controls.xml:948
#, no-c-format
msgid "<literal>fileName</literal> — this value binding receives the filename (optional)."
-msgstr ""
+msgstr "<literal>fileName</literal> — questo value binding riceve il nome del file (opzionale)."
#. Tag: para
#: Controls.xml:954
@@ -1458,7 +1458,7 @@
#: Controls.xml:960
#, no-c-format
msgid "<literal>accept</literal> — a comma-separated list of content types to accept, may not be supported by the browser. E.g. <literal>\"images/png,images/jpg\"</literal>, <literal>\"images/*\"</literal>."
-msgstr ""
+msgstr "<literal>accept</literal> — una lista separata da virgola con i tipi di contenuto da accettare, può non essere supportata dal browser. Esempio: <literal>\"images/png,images/jpg\"</literal>, <literal>\"images/*\"</literal>."
#. Tag: programlisting
#: Controls.xml:980
@@ -1482,7 +1482,7 @@
#: Controls.xml:988
#, no-c-format
msgid "A tag that acts a file download provider. It must be alone in the JSF page. To be able to use this contol, web.xml must be set up as follows."
-msgstr ""
+msgstr "Un tag che agisce come fornitore di download dei file. Deve essere il solo nella pagina JSF. Per essere in grado di usare questo controllo, web.xml deve essere impostato come segue."
#. Tag: programlisting
#: Controls.xml:995
@@ -1560,7 +1560,7 @@
#: Controls.xml:1027
#, no-c-format
msgid "The bean named <literal>resources</literal> is some backing bean that given some request parameters servers a specific file, see <literal>s:download</literal>."
-msgstr ""
+msgstr "Il bean chiamato <literal>resources</literal> fornisce al file i parametri di richiesta del server, si veda <literal>s:download</literal>."
#. Tag: literal
#: Controls.xml:1032
@@ -1572,7 +1572,7 @@
#: Controls.xml:1034
#, no-c-format
msgid "Builds a RESTful link to a <literal><s:resource></literal>. Nested <literal>f:param</literal> build up the url."
-msgstr ""
+msgstr "Costruisce un link RESTful a <literal><s:resource></literal>. <literal>f:param</literal> innestati costruiscono l'url."
#. Tag: para
#: Controls.xml:1041
@@ -1608,7 +1608,7 @@
#: Controls.xml:1060
#, no-c-format
msgid "An extended <literal><h:graphicImage></literal> that allows the image to be created in a Seam Component; further transforms can be applied to the image."
-msgstr ""
+msgstr "Un <literal><h:graphicImage></literal> esteso che consente all'immagine di essere creata in un componente Seam; possono essere applicate all'immagine altre trasformazioni."
#. Tag: para
#: Controls.xml:1065
@@ -1626,7 +1626,7 @@
#: Controls.xml:1086
#, no-c-format
msgid "<literal>fileName</literal> — if not specified the served image will have a generated file name. If you want to name your file, you should specify it here. This name should be unique"
-msgstr ""
+msgstr "<literal>fileName</literal> — se non specificato l'immagine servita avrà un nome di file generato. Se si vuole nominare il file, occorre specificarlo in questo attributo. Il nome deve essere univoco."
#. Tag: emphasis
#: Controls.xml:1095
@@ -1638,7 +1638,7 @@
#: Controls.xml:1096
#, no-c-format
msgid "To apply a transform to the image, you would nest a tag specifying the transform to apply. Seam currently supports these transforms:"
-msgstr ""
+msgstr "Per applicare una trasformazione all'immagine, occorre innestare un tag specificando la trasformazione da applicare. Seam attualmente supporta queste trasformazioni:"
#. Tag: literal
#: Controls.xml:1104
@@ -1662,7 +1662,7 @@
#: Controls.xml:1121
#, no-c-format
msgid "<literal>maintainRatio</literal> — if <literal>true</literal>, and <emphasis>one</emphasis> of <literal>width</literal>/<literal>height</literal> are specified, the image will be resized with the dimension not specified being calculated to maintain the aspect ratio."
-msgstr ""
+msgstr "<literal>maintainRatio</literal> — se vengono specificati <literal>true</literal>, ed <emphasis>uno</emphasis> fra <literal>width</literal>/<literal>height</literal>, l'immagine sarà ridimensionata con la dimensione non specificata che viene calcolata per mantenere l'aspect ratio."
#. Tag: para
#: Controls.xml:1132
@@ -1698,7 +1698,7 @@
#: Controls.xml:1174
#, no-c-format
msgid "It's easy to create your own transform - create a <literal>UIComponent</literal> which implements <literal>org.jboss.seam.ui.graphicImage.ImageTransform</literal>. Inside the <literal>applyTransform()</literal>method use <literal>image.getBufferedImage()</literal> to get the original image and <literal>image.setBufferedImage()</literal> to set your transformed image. Transforms are applied in the order specified in the view."
-msgstr ""
+msgstr "E' facile creare una trasformazione - si crei un <literal>UIComponent</literal> che implementi <literal>org.jboss.seam.ui.graphicImage.ImageTransform</literal>. Dentro il metodo <literal>applyTransform()</literal> si usi <literal>image.getBufferedImage()</literal> per recuperare l'immagine originale e <literal>image.setBufferedImage()</literal> per impostare l'immagine trasformata. Le trasformazioni sono applicare nell'ordine specificato nella vista."
#. Tag: programlisting
#: Controls.xml:1185
15 years, 9 months
Seam SVN: r10224 - trunk/src/main/org/jboss/seam/navigation.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-03-27 20:57:36 -0400 (Fri, 27 Mar 2009)
New Revision: 10224
Modified:
trunk/src/main/org/jboss/seam/navigation/Pages.java
Log:
JBSEAM-4035
Modified: trunk/src/main/org/jboss/seam/navigation/Pages.java
===================================================================
--- trunk/src/main/org/jboss/seam/navigation/Pages.java 2009-03-27 14:32:22 UTC (rev 10223)
+++ trunk/src/main/org/jboss/seam/navigation/Pages.java 2009-03-28 00:57:36 UTC (rev 10224)
@@ -244,25 +244,9 @@
private Page getCachedPage(String viewId)
{
- Page result = pagesByViewId.get(viewId);
- if (result==null)
- {
- //workaround for what I believe is a bug in the JSF RI
- viewId = replaceExtension( viewId, getSuffix() );
- if (viewId!=null)
- {
- result = pagesByViewId.get(viewId);
- }
- }
- return result;
+ return pagesByViewId.get(viewId);
}
- private static String replaceExtension(String viewId, String suffix)
- {
- int loc = viewId.lastIndexOf('.');
- return loc<0 ? null : viewId.substring(0, loc) + suffix;
- }
-
/**
* Get the stack of Page objects, from least specific to
* most specific, that match the given view id.
15 years, 9 months
Seam SVN: r10223 - branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-03-27 10:32:22 -0400 (Fri, 27 Mar 2009)
New Revision: 10223
Modified:
branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java
Log:
JBPAPP-1832
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java 2009-03-26 23:33:51 UTC (rev 10222)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java 2009-03-27 14:32:22 UTC (rev 10223)
@@ -299,10 +299,15 @@
else
{
//TODO: for a pure temporary conversation, this is unnecessary, optimize it
- for ( String name: getNamesFromSession() )
- {
+ for (String name: getNamesFromSession()) {
session.remove( getKey(name) );
}
+
+ // remove removed objects
+ for (String name: removals) {
+ session.remove(getKey(name));
+ }
+ removals.clear();
}
}
15 years, 9 months
Seam SVN: r10222 - trunk/src/main/org/jboss/seam/security/management.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-26 19:33:51 -0400 (Thu, 26 Mar 2009)
New Revision: 10222
Modified:
trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
JBSEAM-4044
Modified: trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java 2009-03-26 22:06:04 UTC (rev 10221)
+++ trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java 2009-03-26 23:33:51 UTC (rev 10222)
@@ -666,7 +666,7 @@
List<String> groups = new ArrayList<String>();
- if (roleGroupsProperty != null)
+ if (roleGroupsProperty.isSet())
{
Collection roleGroups = (Collection) roleGroupsProperty.getValue(role);
if (roleGroups != null)
@@ -914,7 +914,7 @@
private List<String> listRoleMembers(String role)
{
- if (roleGroupsProperty != null)
+ if (roleGroupsProperty.isSet())
{
Object roleEntity = lookupRole(role);
15 years, 9 months
Seam SVN: r10221 - trunk/src/main/org/jboss/seam.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-03-26 18:06:04 -0400 (Thu, 26 Mar 2009)
New Revision: 10221
Modified:
trunk/src/main/org/jboss/seam/pageflow-2.1.xsd
Log:
JBSEAM-4027
Modified: trunk/src/main/org/jboss/seam/pageflow-2.1.xsd
===================================================================
--- trunk/src/main/org/jboss/seam/pageflow-2.1.xsd 2009-03-26 21:58:34 UTC (rev 10220)
+++ trunk/src/main/org/jboss/seam/pageflow-2.1.xsd 2009-03-26 22:06:04 UTC (rev 10221)
@@ -54,14 +54,14 @@
<xs:element ref="exception-handler" />
</xs:choice>
<xs:attribute name="name" type="xs:string" />
-
+ <xs:attribute name="binding" type="bindingType" />
</xs:complexType>
</xs:element>
<xs:element name="sub-process">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
- <xs:attribute name="version" type="xs:integer" />
+ <xs:attribute name="version" type="xs:integer" />
<xs:attribute name="binding" type="bindingType" />
</xs:complexType>
</xs:element>
15 years, 9 months
Seam SVN: r10220 - trunk/src/main/org/jboss/seam.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-03-26 17:58:34 -0400 (Thu, 26 Mar 2009)
New Revision: 10220
Modified:
trunk/src/main/org/jboss/seam/pageflow-2.1.xsd
Log:
JBSEAM-4027
Modified: trunk/src/main/org/jboss/seam/pageflow-2.1.xsd
===================================================================
--- trunk/src/main/org/jboss/seam/pageflow-2.1.xsd 2009-03-26 21:43:33 UTC (rev 10219)
+++ trunk/src/main/org/jboss/seam/pageflow-2.1.xsd 2009-03-26 21:58:34 UTC (rev 10220)
@@ -54,7 +54,7 @@
<xs:element ref="exception-handler" />
</xs:choice>
<xs:attribute name="name" type="xs:string" />
- <xs:attribute name="binding" type="bindingType" />
+
</xs:complexType>
</xs:element>
@@ -62,7 +62,7 @@
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="version" type="xs:integer" />
-
+ <xs:attribute name="binding" type="bindingType" />
</xs:complexType>
</xs:element>
15 years, 9 months
Seam SVN: r10219 - trunk/src/main/org/jboss/seam/mock.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-03-26 17:43:33 -0400 (Thu, 26 Mar 2009)
New Revision: 10219
Modified:
trunk/src/main/org/jboss/seam/mock/MockViewHandler.java
Log:
JBSEAM-4041
Modified: trunk/src/main/org/jboss/seam/mock/MockViewHandler.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockViewHandler.java 2009-03-26 20:55:23 UTC (rev 10218)
+++ trunk/src/main/org/jboss/seam/mock/MockViewHandler.java 2009-03-26 21:43:33 UTC (rev 10219)
@@ -49,7 +49,7 @@
}
else
{
- return contextPath + viewId;
+ return contextPath + (servletPath!=null?servletPath : "") + viewId;
}
}
15 years, 9 months