[seam-commits] Seam SVN: r10712 - in examples/trunk/booking: war and 10 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Wed Apr 29 02:32:42 EDT 2009
Author: dan.j.allen
Date: 2009-04-29 02:32:41 -0400 (Wed, 29 Apr 2009)
New Revision: 10712
Added:
examples/trunk/booking/war/
examples/trunk/booking/war/pom.xml
examples/trunk/booking/war/src/
examples/trunk/booking/war/src/main/
examples/trunk/booking/war/src/main/webapp/
examples/trunk/booking/war/src/main/webapp/WEB-INF/
examples/trunk/booking/war/src/main/webapp/WEB-INF/faces-config.xml
examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/
examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml
examples/trunk/booking/war/src/main/webapp/WEB-INF/layout/
examples/trunk/booking/war/src/main/webapp/WEB-INF/layout/template.xhtml
examples/trunk/booking/war/src/main/webapp/WEB-INF/web.xml
examples/trunk/booking/war/src/main/webapp/book.xhtml
examples/trunk/booking/war/src/main/webapp/confirm.xhtml
examples/trunk/booking/war/src/main/webapp/css/
examples/trunk/booking/war/src/main/webapp/css/screen.css
examples/trunk/booking/war/src/main/webapp/favicon.ico
examples/trunk/booking/war/src/main/webapp/home.xhtml
examples/trunk/booking/war/src/main/webapp/hotel.xhtml
examples/trunk/booking/war/src/main/webapp/img/
examples/trunk/booking/war/src/main/webapp/img/bg.gif
examples/trunk/booking/war/src/main/webapp/img/btn.bg.gif
examples/trunk/booking/war/src/main/webapp/img/cal-next.png
examples/trunk/booking/war/src/main/webapp/img/cal-prev.png
examples/trunk/booking/war/src/main/webapp/img/cnt.bg.gif
examples/trunk/booking/war/src/main/webapp/img/dtpick.gif
examples/trunk/booking/war/src/main/webapp/img/hdr.ad.jpg
examples/trunk/booking/war/src/main/webapp/img/hdr.bar.jpg
examples/trunk/booking/war/src/main/webapp/img/hdr.bg.gif
examples/trunk/booking/war/src/main/webapp/img/hdr.title.gif
examples/trunk/booking/war/src/main/webapp/img/header_line.gif
examples/trunk/booking/war/src/main/webapp/img/input.bg.gif
examples/trunk/booking/war/src/main/webapp/img/sdb.bg.gif
examples/trunk/booking/war/src/main/webapp/img/spinner.gif
examples/trunk/booking/war/src/main/webapp/img/th.bg.gif
examples/trunk/booking/war/src/main/webapp/index.html
examples/trunk/booking/war/src/main/webapp/main.xhtml
examples/trunk/booking/war/src/main/webapp/resources/
examples/trunk/booking/war/src/main/webapp/resources/property/
examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml
examples/trunk/booking/war/src/main/webapp/resources/property/edit.xhtml
Log:
recover from SVN move disaster
Property changes on: examples/trunk/booking/war
___________________________________________________________________
Name: svn:ignore
+ target
Added: examples/trunk/booking/war/pom.xml
===================================================================
--- examples/trunk/booking/war/pom.xml (rev 0)
+++ examples/trunk/booking/war/pom.xml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>seam-booking</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>seam-booking-war</artifactId>
+ <packaging>war</packaging>
+ <name>Seam Booking Example (Web module)</name>
+
+ <build>
+ <defaultGoal>package</defaultGoal>
+ <finalName>${project.parent.artifactId}</finalName>
+ </build>
+
+ <dependencies>
+
+ <!--
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ -->
+
+ <!-- is this necessary? is it for upgrading to EL 1.2? -->
+ <!--
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ -->
+
+ <!--
+ <dependency>
+ <groupId>${seam.groupId}</groupId>
+ <artifactId>seam-faces</artifactId>
+ </dependency>
+ -->
+
+ <!-- pulled in by seam-el
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ -->
+
+ </dependencies>
+
+</project>
Added: examples/trunk/booking/war/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/faces-config.xml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
+
+ <navigation-rule>
+ <from-view-id>*</from-view-id>
+
+ <navigation-case>
+ <from-action>#{bookingAgent.cancel}</from-action>
+ <to-view-id>/main.xhtml</to-view-id>
+ <if>#{true}</if>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/main.xhtml</from-view-id>
+
+ <!-- navigation rules are required to reset request-scoped producer variables -->
+ <!--
+ <navigation-case>
+ <from-action>#{hotelSearch.find}</from-action>
+ <to-view-id>/main.xhtml</to-view-id>
+ <if>#{true}</if>
+ <redirect/>
+ </navigation-case>
+ <navigation-case>
+ <from-action>#{hotelSearch.nextPage}</from-action>
+ <to-view-id>/main.xhtml</to-view-id>
+ <if>#{true}</if>
+ <redirect/>
+ </navigation-case>
+ -->
+
+ <navigation-case>
+ <from-action>#{bookingAgent.selectHotel(_hotel)}</from-action>
+ <to-view-id>/hotel.xhtml</to-view-id>
+ <if>#{bookingAgent.hotelSelection != null}</if>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/hotel.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-action>#{bookingAgent.bookHotel}</from-action>
+ <to-view-id>/book.xhtml</to-view-id>
+ <if>#{bookingAgent.booking != null}</if>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/book.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-action>#{bookingAgent.validateBooking}</from-action>
+ <to-view-id>/confirm.xhtml</to-view-id>
+ <if>#{bookingAgent.bookingValid}</if>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/confirm.xhtml</from-view-id>
+
+ <navigation-case>
+ <from-action>#{bookingAgent.confirm}</from-action>
+ <to-view-id>/main.xhtml</to-view-id>
+ <if>#{true}</if>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
+</faces-config>
Added: examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,21 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:p="http://http://java.sun.com/jsf/composite/property">
+
+ <p:display label="Name" value="#{hotel.name}"/>
+ <p:display label="Address" value="#{hotel.address}"/>
+ <p:display label="City" value="#{hotel.city}"/>
+ <p:display label="State" value="#{hotel.state}"/>
+ <p:display label="Zip" value="#{hotel.zip}"/>
+ <p:display label="Country" value="#{hotel.country}"/>
+ <p:display label="Nightly rate" override="true">
+ <h:outputText value="#{hotel.price}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </p:display>
+
+</ui:composition>
Added: examples/trunk/booking/war/src/main/webapp/WEB-INF/layout/template.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/WEB-INF/layout/template.xhtml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/layout/template.xhtml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"><ui:remove><!-- Using <f:view> as the root prevents conversation from propagating correctly--></ui:remove>
+ <h:head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <title>JBoss Suites: Seam Framework</title>
+ <link rel="shortcut icon" href="#{request.contextPath}/favicon.ico"/>
+ <link href="#{request.contextPath}/css/screen.css" rel="stylesheet" type="text/css"/>
+ <ui:insert name="head"/>
+ </h:head>
+ <h:body>
+ <div id="document">
+ <div id="header">
+ <div id="title"><h:graphicImage value="/img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
+ <div id="status">
+ <h:link id="about" outcome="/home.xhtml" value="About"/>
+ #{' | '}
+ <h:link id="search" outcome="/main.xhtml" value="Search"/>
+ <ui:remove><!--
+ Welcome #{user.name} or use (#{user.name})
+ | <h:link id="search" outcome="/main.xhtml" value="Search"/>
+ | <h:link id="settings" outcome="/password.xhtml" value="Settings"/>
+ | <s:link id="logout" action="#{identity.logout}" value="Logout"/>
+ --></ui:remove>
+ </div>
+ </div>
+ <div id="container">
+ <div id="sidebar">
+ <ui:insert name="sidebar"/>
+ </div>
+ <div id="content">
+ <ui:insert name="content"/>
+ </div>
+ </div>
+ <div id="footer">
+ Created with Seam 3.0, Web Beans, EJB 3.0 and JSF 2.0
+ <br/>
+ #{javax.context.conversation}
+ </div>
+ </div>
+ </h:body>
+</html>
Added: examples/trunk/booking/war/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/web.xml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <display-name>Seam Booking Example</display-name>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+ <security-constraint>
+ <display-name>Restrict access to XHTML documents</display-name>
+ <web-resource-collection>
+ <web-resource-name>XHTML</web-resource-name>
+ <url-pattern>*.xhtml</url-pattern>
+ </web-resource-collection>
+ <auth-constraint/>
+ </security-constraint>
+
+</web-app>
Added: examples/trunk/booking/war/src/main/webapp/book.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/book.xhtml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/book.xhtml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,115 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:p="http://http://java.sun.com/jsf/composite/property"
+ template="/WEB-INF/layout/template.xhtml">
+
+ <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="/WEB-INF/fragments/hotel.xhtml"/>
+
+ <div style="clear: both;"/>
+
+ <h:form id="booking">
+ <fieldset>
+
+ <p:edit id="checkinDate" label="Check-in date">
+ <h:inputText id="input" value="#{booking.checkinDate}">
+ <f:convertDateTime type="date" pattern="MM/dd/yyyy"/>
+ </h:inputText>
+ </p:edit>
+
+ <p:edit id="checkoutDate" label="Check-out date">
+ <h:inputText id="input" value="#{booking.checkoutDate}">
+ <f:convertDateTime type="date" pattern="MM/dd/yyyy"/>
+ </h:inputText>
+ </p:edit>
+
+ <p:edit id="beds" label="Room preference">
+ <h:selectOneMenu id="input" value="#{booking.beds}">
+ <f:selectItem itemLabel="One king-size bed" itemValue="1"/>
+ <f:selectItem itemLabel="Two double beds" itemValue="2"/>
+ <f:selectItem itemLabel="Three beds" itemValue="3"/>
+ </h:selectOneMenu>
+ </p:edit>
+
+ <p:edit id="smoking" label="Smoking preference">
+ <h:selectOneRadio id="input" value="#{booking.smoking}" layout="pageDirection" styleClass="radio">
+ <f:selectItem itemLabel="Smoking" itemValue="true"/>
+ <f:selectItem itemLabel="Non Smoking" itemValue="false"/>
+ </h:selectOneRadio>
+ </p:edit>
+
+ <p:edit id="creditCardName" label="Credit card name">
+ <h:inputText id="input" value="#{booking.creditCardName}"/>
+ </p:edit>
+
+ <p:edit id="creditCardNumber" label="Credit card #">
+ <h:inputText id="input" value="#{booking.creditCard}"/>
+ </p:edit>
+
+ <p:edit id="creditCardExpiry" label="Credit card expiry">
+ <h:selectOneMenu id="input" value="#{booking.creditCardExpiryMonth}">
+ <f:selectItem itemLabel="Jan" itemValue="1"/>
+ <f:selectItem itemLabel="Feb" itemValue="2"/>
+ <f:selectItem itemLabel="Mar" itemValue="3"/>
+ <f:selectItem itemLabel="Apr" itemValue="4"/>
+ <f:selectItem itemLabel="May" itemValue="5"/>
+ <f:selectItem itemLabel="Jun" itemValue="6"/>
+ <f:selectItem itemLabel="Jul" itemValue="7"/>
+ <f:selectItem itemLabel="Aug" itemValue="8"/>
+ <f:selectItem itemLabel="Sep" itemValue="9"/>
+ <f:selectItem itemLabel="Oct" itemValue="10"/>
+ <f:selectItem itemLabel="Nov" itemValue="11"/>
+ <f:selectItem itemLabel="Dec" itemValue="12"/>
+ </h:selectOneMenu>
+ <h:selectOneMenu id="input2" value="#{booking.creditCardExpiryYear}">
+ <f:selectItem itemLabel="2009" itemValue="2009"/>
+ <f:selectItem itemLabel="2010" itemValue="2010"/>
+ <f:selectItem itemLabel="2011" itemValue="2011"/>
+ <f:selectItem itemLabel="2012" itemValue="2012"/>
+ <f:selectItem itemLabel="2013" itemValue="2013"/>
+ </h:selectOneMenu>
+ </p:edit>
+
+ <div class="buttonBox">
+ <h:commandButton id="proceed" value="Proceed" action="#{bookingAgent.validateBooking}"/>
+ #{' '}
+ <h:commandButton id="cancel" value="Cancel" action="#{bookingAgent.cancel}" immediate="true"/>
+ </div>
+
+ </fieldset>
+ </h:form>
+ </div>
+
+ </ui:define>
+
+ <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: examples/trunk/booking/war/src/main/webapp/confirm.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/confirm.xhtml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/confirm.xhtml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,63 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:p="http://http://java.sun.com/jsf/composite/property"
+ template="/WEB-INF/layout/template.xhtml">
+
+ <ui:define name="content">
+
+ <div class="section">
+ <h1>Confirm Hotel Booking</h1>
+ </div>
+
+ <div class="section">
+
+ <ui:include src="/WEB-INF/fragments/hotel.xhtml"/>
+
+ <p:display label="Total payment" override="true">
+ <h:outputText value="#{booking.total}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </p:display>
+
+ <p:display label="Check-in date" value="#{booking.checkinDate}"/>
+ <p:display label="Check-out date" value="#{booking.checkoutDate}"/>
+ <p:display label="Credit card #" value="#{booking.creditCard}"/>
+
+ <div class="buttonBox">
+ <h:form id="confirm">
+ <h:commandButton id="confirm" value="Confirm" action="#{bookingAgent.confirm}"/>
+ #{' '}
+ <h:button id="revise" value="Revise" outcome="/book.xhtml">
+ <f:param name="cid" value="#{javax.context.conversation.id}"/>
+ </h:button>
+ #{' '}
+ <h:commandButton id="cancel" value="Cancel" action="#{bookingAgent.cancel}" immediate="true"/>
+ </h:form>
+ </div>
+
+ </div>
+
+ </ui:define>
+
+ <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: examples/trunk/booking/war/src/main/webapp/css/screen.css
===================================================================
--- examples/trunk/booking/war/src/main/webapp/css/screen.css (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/css/screen.css 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,271 @@
+/* Setup defaults since variable in browsers
+----------------------------------------------- */
+body, div, span, dd, dt, dl, img, ul, ol, li, p, h1, h2, h3, h4, h5, form, hr, fieldset {
+ margin: 0;
+ padding: 0;
+}
+/* Element Defaults
+----------------------------------------------- */
+html {
+ height: 100%;
+ background-color: #DBD4C6;
+ overflow-y: scroll;
+}
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: small;
+ line-height: 1.25em;
+ color: #362F2D;
+ position: relative;
+ width: 760px;
+ height: 100%;
+ margin-left: auto;
+ margin-right: auto;
+}
+a img {
+ border: none;
+}
+.label {
+ font-weight: bold;
+ color: #5E5147;
+}
+input {
+ border: 1px solid #C3BBB6;
+ padding: 4px;
+ margin: 5px 0;
+ background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+}
+select {
+ border: 1px solid #C3BBB6;
+ padding: 4px;
+ margin: 5px 0;
+ background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+}
+ol, ul {
+ margin: 10px 0px 10px 6px;
+}
+li {
+ margin: 10px 12px;
+}
+fieldset {
+ border: 0;
+}
+/* Layout
+----------------------------------------------- */
+#document {
+ padding: 0 1px;
+ background: #fff url(../img/bg.gif) 0 0 repeat-y;
+ float: left;
+ border-bottom: 1px solid #C3BBB6;
+}
+#header {
+ float: left;
+ width: 758px;
+ height: 46px;
+ background: url(../img/hdr.bg.gif) 0 0 repeat-x;
+}
+#container {
+ float: left;
+ width: 758px;
+ background: url(../img/hdr.bar.jpg) 0 0 repeat-x;
+}
+#sidebar {
+ float: left;
+ width: 190px;
+ margin-top: 96px;
+ padding: 20px 10px 0 10px;
+ background: url(../img/sdb.bg.gif) 0 0 no-repeat;
+}
+#content {
+ float: left;
+ width: 548px;
+ margin-top: 75px;
+ padding-top: 5px;
+ background: #fff url(../img/cnt.bg.gif) 0 0 repeat-x;
+}
+#footer {
+ clear: both;
+ margin-top: 40px;
+ float: left;
+ padding: 20px;
+ border-top: 1px solid #C3BBB6;
+ background-color: #fff;
+ width: 718px;
+ text-align: right;
+}
+/* General
+----------------------------------------------- */
+input[type="submit"], input[type="button"] {
+ font-weight: bold;
+ color: #fff;
+ border: 1px solid #5D1414;
+ height: 26px;
+ background: #fff url(../img/btn.bg.gif) 0 0 repeat-x;
+ border-style: none;
+}
+.center {
+ text-align: center;
+}
+.entry {
+ clear: both;
+ padding-top: 10px;
+}
+.entry .label {
+ float: left;
+ padding-right: 5px;
+ font-weight: bold;
+ width: 160px;
+ text-align: right;
+}
+.entry .input, .entry .output, .entry .error {
+ float: right;
+ width: 350px;
+ text-align: left;
+}
+/* Sidebar
+----------------------------------------------- */
+.notes {
+ text-align: center;
+ font-size: small;
+}
+.subnotes {
+ margin-top: 1em;
+ font-size: small;
+}
+.errors {
+ font-size: small;
+ font-weight: bold;
+ text-align: center;
+ color: #600;
+}
+.errors div {
+ text-align: left;
+}
+.errors span {
+ text-align: left;
+}
+.errors input {
+ border: 1px solid #600;
+}
+.errors ul {
+ list-style: none;
+}
+.buttonBox {
+ text-align: center;
+ padding: 5px 0;
+ clear: both;
+}
+#sidebar p {
+ font-size: small;
+ color: #8B7869;
+ line-height: 150%;
+ padding-bottom: 10px;
+}
+#sidebar li {
+ font-size: small;
+ color: #8B7869;
+}
+#sidebar h1 {
+ line-height: normal;
+ font-weight: bold;
+ font-size: small;
+}
+/*
+#sidebar p:hover {
+ color: #362F2D;
+}
+*/
+/* Content
+----------------------------------------------- */
+#content .section {
+ float: left;
+ width: 518px;
+ padding: 15px 15px 0 15px;
+}
+#content .section h1 {
+ font-family: "Trebuchet MS", Arial, sans-serif;
+ line-height: normal;
+ font-weight: normal;
+ font-size: large;
+}
+#content .section p {
+ line-height: 150%;
+ padding: 10px 0;
+ font-size: small;
+}
+#content table {
+ width: 100%;
+ border: 1px solid #D2C9C4;
+ border-collapse: collapse;
+}
+#content table caption {
+ padding-bottom: 6px;
+ text-align: left;
+ font-weight: bold;
+}
+#content table thead th {
+ border-left: 1px solid #D2C9C4;
+ background: #fff url(../img/th.bg.gif) 0 100% repeat-x;
+ border-bottom: 1px solid #D2C9C4;
+ padding: 6px;
+ text-align: left;
+ font-size: small;
+}
+#content table tbody td {
+ border-left: 1px solid #E4DBD5;
+ padding: 4px;
+ border-bottom: 1px solid #D2C9C4;
+ font-size: small;
+}
+td.action {
+ text-align: center;
+}
+#content dt {
+ font-weight: bold;
+ float: left;
+ width: 33%;
+}
+#content dd {
+ padding-left: 10px;
+ float: left;
+ width: 66%;
+}
+#content table.radio {
+ border: 0px;
+}
+#content table.radio tbody tr td {
+ border: 0px;
+ border-left: 0px;
+ border-bottom: 0px;
+}
+/* Header
+----------------------------------------------- */
+#title {
+ float: left;
+ padding: 1px 0 6px 15px;
+}
+#status {
+ color: #C7B299;
+ float: right;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: x-small;
+ text-align: right;
+ padding-top: 14px;
+ padding-right: 15px;
+}
+#status a {
+ color: #C7B299;
+ text-decoration: none;
+}
+/* Homepage Modifications
+----------------------------------------------- */
+#pgHome #container {
+ background: url(../img/hdr.ad.jpg) 0 0 repeat-x;
+}
+#pgHome #sidebar {
+ margin-top: 207px;
+}
+#pgHome #content {
+ margin-top: 183px;
+}
Added: examples/trunk/booking/war/src/main/webapp/favicon.ico
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/favicon.ico
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/home.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/home.xhtml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/home.xhtml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,87 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+ <title>JBoss Suites: Seam Framework</title>
+ <link rel="shortcut icon" href="#{request.contextPath}/favicon.ico"/>
+ <link href="#{request.contextPath}/css/screen.css" rel="stylesheet" type="text/css"/>
+ </head>
+ <body id="pgHome">
+ <f:view>
+ <div id="document">
+ <div id="header">
+ <div id="title"><h:graphicImage value="/img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
+ </div>
+ <div id="container">
+ <div id="sidebar">
+ <h:link id="search" outcome="/main.xhtml" value="Search"/>
+ <ui:remove>
+ <h:form id="login">
+ <fieldset>
+ <div>
+ <h:outputLabel id="UsernameLabel" for="username">Login Name</h:outputLabel>
+ <h:inputText id="username" value="#{identity.username}" style="width: 175px;"/>
+ <div class="errors"><h:message id="UsernameMessage" for="username"/></div>
+ </div>
+ <div>
+ <h:outputLabel id="PasswordLabel" for="password">Password</h:outputLabel>
+ <h:inputSecret id="password" value="#{identity.password}" style="width: 175px;"/>
+ </div>
+ <div class="errors"><h:messages id="messages" globalOnly="true"/></div>
+ <div class="buttonBox"><h:commandButton id="login" action="#{identity.login}" value="Account Login"/></div>
+ <div class="notes"><!--<h:link id="register" outcome="/register.xhtml" value="Register New User"/>--></div>
+ <div class="subnotes">
+ Or use a demo account:
+ <ul>
+ <li>gavin/mexico</li>
+ <li>pete/edinburgh</li>
+ <li>shane/brisbane</li>
+ <li>dan/maryland</li>
+ </ul>
+ </div>
+ </fieldset>
+ </h:form>
+ </ui:remove>
+ </div>
+ <div id="content">
+ <div class="section">
+
+ <h1>About this example application</h1>
+
+ <p>
+ This sample application demonstrates how easy it is to develop stateful web
+ applications using JBoss Seam. Just register, login, and book a room to see
+ Seam in action. Throughout the application you'll see popup links like
+ the ones at the bottom of this page. Click them to see how the application
+ works under the hood.
+ </p>
+
+ <p>
+ Note: Please do NOT enter personal information or your credit card number in
+ this sample application.
+ </p>
+
+ <p>
+ <a href="#" onclick="window.open('exp/introExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What is JBoss Seam?
+ </a>
+ </p>
+
+ <p>
+ <a href="#" onclick="window.open('exp/loginExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What happens when I login?
+ </a>
+ </p>
+
+ </div>
+ </div>
+ </div>
+ <div id="footer">Created with Seam 3.0, Web Beans, EJB 3.0 and JSF 2.0</div>
+ </div>
+ </f:view>
+ </body>
+</html>
Added: examples/trunk/booking/war/src/main/webapp/hotel.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/hotel.xhtml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/hotel.xhtml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,54 @@
+<!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:h="http://java.sun.com/jsf/html"
+ template="/WEB-INF/layout/template.xhtml">
+
+ <ui:define name="content">
+
+ <div class="section">
+ <h1>View Hotel</h1>
+ </div>
+
+ <div class="section">
+ <ui:include src="/WEB-INF/fragments/hotel.xhtml"/>
+
+ <div class="buttonBox">
+ <h:form id="actions">
+ <h:commandButton id="bookHotel" action="#{bookingAgent.bookHotel}" value="Book Hotel"/>
+ #{' '}
+ <h:commandButton id="cancel" action="#{bookingAgent.cancel}" value="Return to Search" immediate="true"/>
+ </h:form>
+ </div>
+
+ </div>
+
+ </ui:define>
+
+ <ui:define name="sidebar">
+
+ <h1>Don't kill your database</h1>
+ <p>
+ Keeping conversational state in memory in the middle tier is a great
+ way to improve your application's scalability. It saves hitting the
+ database every time we refresh a page, to re-read the data we were
+ just looking at five seconds ago. By using Seam's conversation
+ context, we get a natural cache of data associated with the what the
+ user is currently doing. By nature, this cache has a more efficient
+ eviction policy than the MRU-type algorithms used by a typical
+ second-level data cache in an O/R mapping engine like Hibernate (at
+ least for some kinds of data). Of course, you should use a clever
+ combination of second-level caching and conversational data caching to
+ achieve the best performance for your application.
+ </p>
+ <p>
+ <a href="#" onclick="window.open('exp/bookingExp.html','exp','width=752,height=500,scrollbars=yes');">
+ How does the hotel booking wizard work?
+ </a>
+ </p>
+
+ </ui:define>
+
+</ui:composition>
Added: examples/trunk/booking/war/src/main/webapp/img/bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/btn.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/btn.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/cal-next.png
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/cal-next.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/cal-prev.png
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/cal-prev.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/cnt.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/cnt.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/dtpick.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/dtpick.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/hdr.ad.jpg
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/hdr.ad.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/hdr.bar.jpg
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/hdr.bar.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/hdr.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/hdr.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/hdr.title.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/hdr.title.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/header_line.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/header_line.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/input.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/input.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/sdb.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/sdb.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/spinner.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/spinner.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/img/th.bg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/booking/war/src/main/webapp/img/th.bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/booking/war/src/main/webapp/index.html
===================================================================
--- examples/trunk/booking/war/src/main/webapp/index.html (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/index.html 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1 @@
+<html><head><meta http-equiv="Refresh" content="0; URL=home.seam"/></head></html>
Added: examples/trunk/booking/war/src/main/webapp/main.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/main.xhtml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/main.xhtml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,174 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ template="/WEB-INF/layout/template.xhtml">
+
+ <ui:define name="head">
+ <script type="text/javascript">
+function controlSpinner(behavior)
+{
+ if (behavior.name == 'begin')
+ {
+ document.getElementById('activity').style.display = 'inline';
+ }
+ else if (behavior.name == 'complete')
+ {
+ document.getElementById('activity').style.display = 'none';
+ }
+}
+ </script>
+ </ui:define>
+
+ <ui:define name="content">
+
+ <div class="section">
+
+ <span class="errors">
+ <h:messages id="messages" globalOnly="true"/>
+ </span>
+
+ <h1>Search Hotels</h1>
+
+ <h:form id="searchForm" prependId="false">
+ <fieldset>
+ <h:inputText id="searchString" value="#{searchCriteria.searchString}" style="width: 165px;">
+ <f:ajax event="keyup" listener="#{hotelSearch.find}" render="searchResults" onevent="controlSpinner"/>
+ </h:inputText>
+ #{' '}
+ <h:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}">
+ <f:ajax listener="#{hotelSearch.find}" execute="searchString" render="searchResults" onevent="controlSpinner"/>
+ </h:commandButton>
+ #{' '}
+ <span id="activity" style="display: none;"><h:graphicImage id="spinner" value="/img/spinner.gif"/></span>
+ <br/>
+ <h:outputLabel id="lblPageSize" for="pageSize" value="Maximum results:"/>
+ #{' '}
+ <h:selectOneMenu id="pageSize" value="#{searchCriteria.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>
+
+ <h:panelGroup id="searchResults">
+ <div class="section">
+ <h:outputText id="noHotelsMsg" value="No Hotels Found" rendered="#{empty hotels}"/>
+ <h:form id="hotelSelectionForm">
+ <h:dataTable id="hotels" value="#{hotels}" var="_hotel" rendered="#{not empty hotels}"
+ columnClasses=",,,,action">
+ <h:column id="nameCol">
+ <f:facet id="nameFct" name="header">Name</f:facet>
+ #{_hotel.name}
+ </h:column>
+ <h:column id="addressCol">
+ <f:facet id="addressFct" name="header">Address</f:facet>
+ #{_hotel.address}
+ </h:column>
+ <h:column id="locationCol">
+ <f:facet id="locationFct" name="header">Location</f:facet>
+ #{_hotel.city}, #{_hotel.state}, #{_hotel.country}
+ </h:column>
+ <h:column id="zipCol">
+ <f:facet id="zipFct" name="header">Zip</f:facet>
+ #{_hotel.zip}
+ </h:column>
+ <h:column id="actionCol">
+ <f:facet id="actionFct" name="header">Action</f:facet>
+ <h:commandLink id="view" value="View" action="#{bookingAgent.selectHotel(_hotel)}" style="white-space: nowrap;"/>
+ <ui:remove>
+ <h:commandButton id="view" value="View" action="#{bookingAgent.selectHotel(_hotel)}"/>
+ </ui:remove>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+ <h:form id="paginationForm">
+ <h:commandButton id="previousResults" value="Previous page" action="#{hotelSearch.previousPage}" rendered="#{hotelSearch.previousPageAvailable}"/>
+ #{' '}
+ <h:commandButton id="moreResults" value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}"/>
+ <ui:remove>
+ <!-- links in Mojarra are broken -->
+ <h:commandLink id="previousResults" value="More results" action="#{hotelSearch.previousPage}" rendered="#{hotelSearch.previousPageAvailable}">
+ <f:ajax listener="#{hotelSearch.previousPage}" render="searchResults"/>
+ </h:commandLink>
+ <h:commandLink id="moreResults" value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}">
+ <f:ajax listener="#{hotelSearch.nextPage}" render="searchResults"/>
+ </h:commandLink>
+ </ui:remove>
+ </h:form>
+ </div>
+ </h:panelGroup>
+
+<ui:remove>
+<!--
+<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:remove>
+
+ </ui:define>
+
+ <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>
Added: examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,30 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:comp="http://java.sun.com/jsf/composite">
+
+ <comp:interface>
+ <comp:attribute name="label" required="true"/>
+ <comp:attribute name="value" required="false"/>
+ <comp:attribute name="override" required="false" default="false"/>
+ </comp:interface>
+
+ <!-- the override is a workaround because assigning an id to the output dynamically is not working -->
+ <!-- TODO allow for a template to be specified, falling back to a default -->
+ <comp:implementation>
+ <div class="entry">
+ <span class="label">#{cc.attrs.label}:</span>
+ <span class="output">
+ <c:choose>
+ <c:when test="#{cc.attrs.override}"><comp:insertChildren/></c:when>
+ <c:otherwise>#{cc.attrs.value}</c:otherwise>
+ </c:choose>
+ </span>
+ </div>
+ </comp:implementation>
+
+</ui:composition>
Added: examples/trunk/booking/war/src/main/webapp/resources/property/edit.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/resources/property/edit.xhtml (rev 0)
+++ examples/trunk/booking/war/src/main/webapp/resources/property/edit.xhtml 2009-04-29 06:32:41 UTC (rev 10712)
@@ -0,0 +1,35 @@
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:comp="http://java.sun.com/jsf/composite">
+
+ <comp:interface>
+ <comp:attribute name="label" required="true"/>
+ <comp:attribute name="required" required="false"/>
+ </comp:interface>
+
+ <!-- TODO allow for a template to be specified, falling back to a default -->
+ <!-- TODO detect required from child or from bean validation annotation -->
+ <comp:implementation>
+
+ <c:set var="required" value="#{cc.attrs.required eq null ? true : cc.attrs.required}"/>
+ <c:set var="invalid" value="#{not empty facesContext.getMessageList(cc.clientId.concat(':input'))}"/>
+
+ <div class="entry">
+ <h:outputLabel value="#{cc.attrs.label}:" for="input" styleClass="label#{invalid ? ' errors' : ''}">
+ <c:if test="#{required}"><span class="required">*</span></c:if>
+ </h:outputLabel>
+ <span class="input#{invalid ? ' errors' : ''}">
+ <comp:insertChildren/>
+ </span>
+ <h:message for="input" styleClass="error errors"/>
+ </div>
+
+ </comp:implementation>
+
+
+</ui:composition>
More information about the seam-commits
mailing list