Author: alexsmirnov
Date: 2007-11-01 20:30:29 -0400 (Thu, 01 Nov 2007)
New Revision: 3701
Added:
trunk/DEADJOE
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/ViewHandlerPortletRenderResponseWrapper.java
trunk/samples/seamBookingPortlet/
trunk/samples/seamBookingPortlet/.exadelproject
trunk/samples/seamBookingPortlet/hibernate-console.properties
trunk/samples/seamBookingPortlet/pom.xml
trunk/samples/seamBookingPortlet/src/
trunk/samples/seamBookingPortlet/src/main/
trunk/samples/seamBookingPortlet/src/main/java/
trunk/samples/seamBookingPortlet/src/main/java/org/
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Authenticator.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Booking.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/BookingList.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/BookingListAction.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/ChangePassword.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Hotel.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelBooking.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelSearching.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Register.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/RegisterAction.java
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/User.java
trunk/samples/seamBookingPortlet/src/main/resources/
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/application.xml
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/ejb-jar.xml
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/jboss-app.xml
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/persistence.xml
trunk/samples/seamBookingPortlet/src/main/resources/booking-ds.xml
trunk/samples/seamBookingPortlet/src/main/resources/components.properties
trunk/samples/seamBookingPortlet/src/main/resources/import.sql
trunk/samples/seamBookingPortlet/src/main/resources/messages.properties
trunk/samples/seamBookingPortlet/src/main/resources/seam.properties
trunk/samples/seamBookingPortlet/src/main/webapp/
trunk/samples/seamBookingPortlet/src/main/webapp/META-INF/
trunk/samples/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml
trunk/samples/seamBookingPortlet/src/main/webapp/book.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/confirm.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/conversations.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/css/
trunk/samples/seamBookingPortlet/src/main/webapp/css/date.css
trunk/samples/seamBookingPortlet/src/main/webapp/css/screen.css
trunk/samples/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css
trunk/samples/seamBookingPortlet/src/main/webapp/display.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/edit.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/exp/
trunk/samples/seamBookingPortlet/src/main/webapp/exp/bookingExp.html
trunk/samples/seamBookingPortlet/src/main/webapp/exp/confirmExp.html
trunk/samples/seamBookingPortlet/src/main/webapp/exp/introExp.html
trunk/samples/seamBookingPortlet/src/main/webapp/exp/loginExp.html
trunk/samples/seamBookingPortlet/src/main/webapp/exp/mainExp.html
trunk/samples/seamBookingPortlet/src/main/webapp/exp/registerExp.html
trunk/samples/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html
trunk/samples/seamBookingPortlet/src/main/webapp/home.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/hotel.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/hotelview.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/img/
trunk/samples/seamBookingPortlet/src/main/webapp/img/bg.gif
trunk/samples/seamBookingPortlet/src/main/webapp/img/btn.bg.gif
trunk/samples/seamBookingPortlet/src/main/webapp/img/cal-next.png
trunk/samples/seamBookingPortlet/src/main/webapp/img/cal-prev.png
trunk/samples/seamBookingPortlet/src/main/webapp/img/cnt.bg.gif
trunk/samples/seamBookingPortlet/src/main/webapp/img/dtpick.gif
trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.ad.jpg
trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.bar.jpg
trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.bg.gif
trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.title.gif
trunk/samples/seamBookingPortlet/src/main/webapp/img/header_line.gif
trunk/samples/seamBookingPortlet/src/main/webapp/img/input.bg.gif
trunk/samples/seamBookingPortlet/src/main/webapp/img/sdb.bg.gif
trunk/samples/seamBookingPortlet/src/main/webapp/img/spinner.gif
trunk/samples/seamBookingPortlet/src/main/webapp/img/th.bg.gif
trunk/samples/seamBookingPortlet/src/main/webapp/index.html
trunk/samples/seamBookingPortlet/src/main/webapp/main.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/password.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/register.xhtml
trunk/samples/seamBookingPortlet/src/main/webapp/template.xhtml
trunk/samples/seamBookingPortlet/src/test/
trunk/samples/seamBookingPortlet/src/test/java/
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java
Log:
Continue to implement JSR-301 bridge. Finish requrements from PLT 6.
Create Seam portlet example, based on the Seam booking store.
Added: trunk/DEADJOE
===================================================================
--- trunk/DEADJOE (rev 0)
+++ trunk/DEADJOE 2007-11-02 00:30:29 UTC (rev 3701)
@@ -0,0 +1,16 @@
+
+*** These modified files were found in JOE when it aborted on Wed Oct 31 15:45:33 2007
+*** JOE was aborted because the terminal closed
+
+*** File '(Unnamed)'
+/home/asmirnov/.bash_profile
+deployRelease.sh
+./ui/drag-drop/pom.xml
+./samples/ajaxPortlet/pom.xml
+./cdk/maven-archetype-jsf-component/src/main/resources/archetype-resources/pom.xml
+./framework/impl/pom.xml
+framework/impl/src/main/java/org/richfaces/VersionBean.java
+ui/paint2D/src/org/richfaces/renderkit/html/Paint2DResource.java
+ui/paint2D/src/main/java/org/richfaces/renderkit/html/Paint2DResource.java
+pom.xml
+/home/asmirnov/work/jboss-4.2.0.GA-src/build/output/jboss-4.2.0.GA/server/default/conf/jboss-log4j.xml
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java 2007-11-01
22:27:10 UTC (rev 3700)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -12,6 +12,7 @@
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
import javax.portlet.PortletException;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
@@ -62,7 +63,10 @@
+ config.getPortletName());
}
this.portletConfig = config;
- init();
+ PortletContext portletContext = config.getPortletContext();
+ synchronized (portletContext) {
+ init();
+ }
} catch (FacesException e) {
throw new PortletException("Initialization error", e);
}
@@ -87,8 +91,10 @@
facesContext.getApplication().getStateManager().saveSerializedView(
facesContext);
// save request scope variables and Faces Messages.
- windowState.saveRequest(facesContext);
- // saveView(facesContext);
+ if (!facesContext.getResponseComplete()) {
+ windowState.saveRequest(facesContext);
+
+ } // saveView(facesContext);
} catch (Exception e) {
log.error("Error processing execute lifecycle", e);
throw new BridgeException("Error processing execute lifecycle ", e);
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java 2007-11-01
22:27:10 UTC (rev 3700)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -26,11 +26,15 @@
import org.ajax4jsf.portlet.component.UIPortletViewRoot;
import org.ajax4jsf.portlet.context.AbstractExternalContext;
+
+
+
/**
* @author asmirnov
*
*/
public class PortletViewHandler extends AjaxViewHandler {
+ public static final String INTERWEAVING_RESPONSE_INTERFACE =
"com.sun.faces.application.InterweavingResponse";
/**
* @param parent
*/
@@ -127,10 +131,10 @@
// to handle error page and text that exists after the <f:view> tag
// among other things which have lots of servlet dependencies -
// we're skipping this for now for portlet
- extContext.dispatch(viewToRender.getViewId());
- /*
- * if (executePageToBuildView(context, viewToRender)) { response.flushBuffer();
return; }
- */
+ // extContext.dispatch(viewToRender.getViewId());
+
+ if (executePageToBuildView(context, viewToRender)) {
renderResponse.flushBuffer(); return; }
+
}
catch (IOException e)
{
@@ -182,22 +186,16 @@
context.setResponseWriter(oldWriter);
}
- Object content = extContext.getRequestMap().get(Bridge.AFTER_VIEW_CONTENT);
- if (content != null)
- {
- if (content instanceof char[])
- {
- renderResponse.getWriter().write(new String((byte[]) content));
- }
- else if (content instanceof byte[])
- {
- renderResponse.getWriter().write(new String((char[]) content));
- }
- else
- {
- throw new IOException("PortletViewHandlerImpl: invalid" +
"AFTER_VIEW_CONTENT buffer type");
- }
- }
+ // write any AFTER_VIEW_CONTENT to the response
+ // side effect: AFTER_VIEW_CONTENT removed
+ if(hasInterweavingResponse()) {
+ ViewHandlerPortletRenderResponseWrapper wrapper =
(ViewHandlerPortletRenderResponseWrapper)
+ extContext.getRequestMap().remove(Bridge.AFTER_VIEW_CONTENT);
+ if (null != wrapper) {
+ wrapper.flushToWriter(renderResponse.getWriter(),
+ renderResponse.getCharacterEncoding());
+ }
+ }
renderResponse.flushBuffer();
}
@@ -237,7 +235,6 @@
private void doRenderView(FacesContext context, UIViewRoot viewToRender) throws
IOException,
FacesException
{
- ExternalContext extContext = context.getExternalContext();
viewToRender.encodeAll(context);
}
@@ -333,5 +330,59 @@
}
}
+ /**
+ * Execute the target view. If the HTTP status code range is
+ * not 2xx, then return true to indicate the response should be
+ * immediately flushed by the caller so that conditions such as 404
+ * are properly handled.
+ * @param context the <code>FacesContext</code> for the current request
+ * @param viewToExecute the view to build
+ * @return <code>true</code> if the response should be immediately
flushed
+ * to the client, otherwise <code>false</code>
+ * @throws IOException if an error occurs executing the page
+ */
+ private boolean executePageToBuildView(FacesContext context,
+ UIViewRoot viewToExecute)
+ throws IOException {
+ String requestURI = viewToExecute.getViewId();
+
+ ExternalContext extContext = context.getExternalContext();
+
+ // replace the response with our wrapper
+ if(hasInterweavingResponse()) {
+ // save the original response
+ Object originalResponse = extContext.getResponse();
+
+ ViewHandlerPortletRenderResponseWrapper wrapped =
+ new
ViewHandlerPortletRenderResponseWrapper((RenderResponse)extContext.getResponse());
+ extContext.setResponse(wrapped);
+ // build the view by executing the page
+ extContext.dispatch(requestURI);
+
+
+ // replace the original response
+ extContext.setResponse(originalResponse);
+
+ // Put the AFTER_VIEW_CONTENT into request scope
+ // temporarily
+ extContext.getRequestMap().put(Bridge.AFTER_VIEW_CONTENT, wrapped);
+ } else {
+ // build the view by executing the page
+ extContext.dispatch(requestURI);
+
+ }
+
+ return false;
+ }
+ // If the JSF RI does not contain InterweavingResponse interface skip
+ // the content Interweaving logic
+ private boolean hasInterweavingResponse() {
+ try {
+ Class.forName(INTERWEAVING_RESPONSE_INTERFACE);
+ } catch (Throwable t) {
+ return false;
+ }
+ return true;
+ }
}
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java 2007-11-01
22:27:10 UTC (rev 3700)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -63,7 +63,7 @@
private Map<String, List> messages;
- private Map<String, Object> beans;
+ private transient Map<String, Object> beans;
private Object treeStructure;
@@ -73,24 +73,10 @@
private String viewId;
- private Map requestScopeBeans;
private Map<String, String[]> _requestParameters;
- /**
- * @return the requestScopeBeans
- */
- public Map getRequestScopeBeans() {
- return requestScopeBeans;
- }
- /**
- * @param requestScopeBeans
- * the requestScopeBeans to set
- */
- public void setRequestScopeBeans(Map requestScopeBeans) {
- this.requestScopeBeans = requestScopeBeans;
- }
/**
* @return the viewId
@@ -270,6 +256,8 @@
ExternalContext externalContext = facesContext.getExternalContext();
Map<String, Object> requestMap = externalContext.getRequestMap();
if (b) {
+ facesContext.setViewRoot(getViewRoot());
+ setViewRoot(null);
restoreMessages(facesContext);
restoreBeans(facesContext);
}
@@ -292,6 +280,7 @@
public void saveRequest(FacesContext facesContext) {
UIViewRoot root = facesContext.getViewRoot();
+ setViewRoot(root);
if (null != root) {
setViewId(root.getViewId());
}
Added:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/ViewHandlerPortletRenderResponseWrapper.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/ViewHandlerPortletRenderResponseWrapper.java
(rev 0)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/ViewHandlerPortletRenderResponseWrapper.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,306 @@
+/*
+ * CDDL HEADER START
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ *
http://www.sun.com/cddl/cddl.html and legal/CDDLv1.0.txt
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at legal/CDDLv1.0.txt.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ * CDDL HEADER END
+ */
+
+package org.ajax4jsf.portlet.application;
+
+import com.sun.faces.application.InterweavingResponse;
+
+import java.io.ByteArrayOutputStream;
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.Writer;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.CharacterCodingException;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.util.Locale;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.faces.FacesException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderResponse;
+
+
+/**
+ * ViewHandlerPortletRenderResponseWrapper is the Portlet implementation of the
InterweavingResponse wrapper.
+ * This class is loaded only if InterweavingResponse is present in JSF RI.
+ */
+public class ViewHandlerPortletRenderResponseWrapper implements RenderResponse,
InterweavingResponse {
+
+ private RenderResponse response;
+ private ByteArrayWebOutputStream bawos;
+ private PrintWriter pw ;
+ private CharArrayWriter caw;
+
+ public ViewHandlerPortletRenderResponseWrapper(RenderResponse response) {
+ this.response = response;
+ }
+
+ public void resetBuffers() throws IOException {
+ if (caw != null) {
+ caw.reset();
+ } else if (bawos != null) {
+ bawos.resetByteArray();
+ }
+ }
+
+ public boolean isBytes() {
+ return (bawos != null);
+ }
+
+ public boolean isChars() {
+ return (caw != null);
+ }
+
+ public char[] getChars() {
+ if (caw != null) {
+ return caw.toCharArray();
+ }
+ return null;
+ }
+
+ public byte[] getBytes() {
+ if (bawos != null) {
+ return bawos.toByteArray();
+ }
+ return null;
+ }
+
+ public int getStatus() {
+ return Integer.MIN_VALUE;
+ }
+
+ public String getContentType() {
+ return response.getContentType();
+ }
+
+ public PortletURL createRenderURL() {
+ return response.createRenderURL();
+ }
+
+ public PortletURL createActionURL() {
+ return response.createActionURL();
+ }
+
+ public String getNamespace() {
+ return response.getNamespace();
+ }
+
+ public void setTitle(String title) {
+ response.setTitle(title);
+ }
+
+ public void setContentType(String type) {
+ response.setContentType(type);
+ }
+
+ public String getCharacterEncoding() {
+ return response.getCharacterEncoding();
+ }
+
+ public Locale getLocale() {
+ return response.getLocale();
+ }
+
+ public void setBufferSize(int size) {
+ response.setBufferSize(size);
+ }
+
+ public int getBufferSize() {
+ return response.getBufferSize();
+ }
+
+ public void flushBuffer() throws IOException {
+ response.flushBuffer();
+ }
+
+ public void resetBuffer() {
+ response.resetBuffer();
+ }
+
+ public boolean isCommitted() {
+ return response.isCommitted();
+ }
+
+ public void reset() {
+ response.reset();
+ }
+
+ public PrintWriter getWriter() throws IOException {
+ if (bawos != null) {
+ throw new IllegalStateException();
+ }
+ if (pw == null) {
+ caw = new CharArrayWriter(1024);
+ pw = new PrintWriter(caw);
+ }
+
+ return pw;
+ }
+
+ public OutputStream getPortletOutputStream() throws IOException {
+ if (pw != null) {
+ throw new IllegalStateException();
+ }
+ if (bawos == null) {
+ bawos = new ByteArrayWebOutputStream();
+ }
+ return bawos;
+ }
+
+ public void addProperty(String key, String value) {
+ response.addProperty(key, value);
+ }
+
+ public void setProperty(String key, String value) {
+ response.setProperty(key, value);
+ }
+
+ public String encodeURL(String path) {
+ return response.encodeURL(path);
+ }
+
+ public void flushContentToWrappedResponse() throws IOException {
+ if (caw != null) {
+ pw.flush();
+ caw.writeTo(response.getWriter());
+ caw.reset();
+ } else if (bawos != null) {
+ try {
+ bawos.writeTo(response.getWriter(),
+ response.getCharacterEncoding());
+ } catch (IllegalStateException ise) {
+ bawos.writeTo(response.getPortletOutputStream());
+ }
+ bawos.resetByteArray();
+ }
+
+ }
+ public void flushToWriter(Writer writer, String encoding) throws IOException {
+ if (caw != null) {
+ pw.flush();
+ caw.writeTo(writer);
+ caw.reset();
+ } else if (bawos != null) {
+ bawos.writeTo(writer, encoding);
+ bawos.resetByteArray();
+ }
+ writer.flush();
+ }
+
+}
+
+// ------------------------------------------------------------- Private Classes
+
+/**
+ * This steam convers byte content to character.
+ */
+class ByteArrayWebOutputStream extends OutputStream {
+
+ private DirectByteArrayOutputStream baos;
+
+ public ByteArrayWebOutputStream() {
+ baos = new DirectByteArrayOutputStream(1024);
+ }
+
+ public void write(int n) {
+ baos.write(n);
+ }
+
+ /**
+ * <p>It's important to not expose this as reset.</p>
+ */
+
+ public void resetByteArray() {
+ baos.reset();
+ }
+
+ public byte[] toByteArray() {
+ return baos.toByteArray();
+ }
+
+
+ /**
+ * Converts the buffered bytes into chars based on the
+ * specified encoding and writes them to the provided Writer.
+ *
+ * @param writer target Writer
+ * @param encoding character encoding
+ */
+ public void writeTo(Writer writer, String encoding) {
+
+ ByteBuffer bBuff = baos.getByteBuffer();
+ CharsetDecoder decoder = Charset.forName(encoding).newDecoder();
+
+ try {
+ CharBuffer cBuff = decoder.decode(bBuff);
+ writer.write(cBuff.array());
+ } catch (CharacterCodingException cce) {
+ throw new FacesException(cce);
+ } catch (IOException ioe) {
+ throw new FacesException(ioe);
+ }
+ }
+
+
+ /**
+ * <p>Write the buffered bytes to the provided OutputStream.</p>
+ *
+ * @param stream the stream to write to
+ */
+ public void writeTo(OutputStream stream) {
+ try {
+ stream.write(baos.getByteBuffer().array());
+ } catch (IOException ioe) {
+ throw new FacesException(ioe);
+ }
+ }
+
+ private static class DirectByteArrayOutputStream extends ByteArrayOutputStream {
+
+ // -------------------------------------------------------- Constructors
+
+
+ public DirectByteArrayOutputStream(int initialCapacity) {
+ super(initialCapacity);
+ }
+
+ // ------------------------------------------------------- PublicMethods
+
+
+ /**
+ * Return the buffer backing this ByteArrayOutputStream as a
+ * ByteBuffer.
+ *
+ * @return buf wrapped in a ByteBuffer
+ */
+ public ByteBuffer getByteBuffer() {
+ return (ByteBuffer.wrap(buf, 0, count));
+ }
+
+ }
+}
\ No newline at end of file
Property changes on:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/ViewHandlerPortletRenderResponseWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java 2007-11-01
22:27:10 UTC (rev 3700)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -209,6 +209,8 @@
*/
public void setContext(Object context) {
this.context = context;
+ this.applicationMap = null;
+ this.initParameterMap = null;
}
/*
@@ -257,6 +259,12 @@
* @see javax.faces.context.ExternalContext#setRequest(java.lang.Object)
*/
public void setRequest(Object request) {
+ this.requestHeaderMap = null;
+ this.requestHeaderValues = null;
+ this.requestMap = null;
+ this.requestParameterMap = null;
+ this.requestParameterValuesMap = null;
+ this.sessionMap = null;
this.request = request;
}
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java 2007-11-01
22:27:10 UTC (rev 3700)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -115,8 +115,10 @@
"Dispatcher for render request is not created");
}
try {
- dispatcher.include((RenderRequest) getRequest(),
- (RenderResponse) getResponse());
+ RenderRequest renderRequest = (RenderRequest) getPortletRequest();
+ RenderResponse portletResponse = (RenderResponse) getPortletResponse();
+ dispatcher.include(renderRequest,
+ portletResponse);
} catch (PortletException e) {
throw new FacesException(e);
}
Added: trunk/samples/seamBookingPortlet/.exadelproject
===================================================================
--- trunk/samples/seamBookingPortlet/.exadelproject (rev 0)
+++ trunk/samples/seamBookingPortlet/.exadelproject 2007-11-02 00:30:29 UTC (rev 3701)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<FILESYSTEMS APPLICATION_NAME="seamBookingPortlet"
ENTITY="FileSystems"
+ VERSION="8.0.4" WORKSPACE_HOME="./src/main/webapp/WEB-INF">
+ <FILESYSTEM ENTITY="FileSystemFolder"
LOCATION="%exadel.workspace%" NAME="WEB-INF"/>
+ <FILESYSTEM ENTITY="FileSystemFolder" INFO="Content-Type=Web"
+ LOCATION="%exadel.workspace%/.." NAME="WEB-ROOT"/>
+ <FILESYSTEM ENTITY="FileSystemFolder"
+ LOCATION="%exadel.workspace%/../../java" NAME="src"/>
+ <FILESYSTEM ENTITY="FileSystemFolder"
+ LOCATION="%exadel.workspace%/../../resources" NAME="src2"/>
+ <FILESYSTEM ENTITY="FileSystemFolder"
+ LOCATION="%exadel.workspace%/../../../test/java" NAME="src3"/>
+ <FILESYSTEM ENTITY="FileSystemFolder"
+ LOCATION="%exadel.workspace%/../../../../target/classes"
NAME="classes"/>
+ <FILESYSTEM ENTITY="FileSystemFolder"
+ LOCATION="%exadel.eclipse.project%" NAME="seamBookingPortlet"/>
+ <WEB ENTITY="ExadelWeb" MODEL_PATH="/web.xml"
SERVLET_VERSION="2.4">
+ <MODULE ENTITY="WebJSFModule" ROOT="WEB-ROOT"
SRC="src,src2,src3" URI="/WEB-INF/faces-config.xml"/>
+ </WEB>
+</FILESYSTEMS>
Added: trunk/samples/seamBookingPortlet/hibernate-console.properties
===================================================================
--- trunk/samples/seamBookingPortlet/hibernate-console.properties
(rev 0)
+++ trunk/samples/seamBookingPortlet/hibernate-console.properties 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -0,0 +1,10 @@
+#File used by hibernate tools to override <datasource> and other container specific
settings in persistence.xml
+hibernate.connection.password=password
+hibernate.connection.username=username
+hibernate.connection.driver_class=org.hsqldb.jdbcDriver
+hibernate.dialect=org.hibernate.dialect.HSQLDialect
+hibernate.connection.url=jdbc:hsqldb:hsql://host
+
+hibernate.connection.provider_class
org.hibernate.connection.DriverManagerConnectionProvider
+hibernate.datasource=
+hibernate.transaction.manager_lookup_class=
\ No newline at end of file
Property changes on: trunk/samples/seamBookingPortlet/hibernate-console.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/pom.xml
===================================================================
--- trunk/samples/seamBookingPortlet/pom.xml (rev 0)
+++ trunk/samples/seamBookingPortlet/pom.xml 2007-11-02 00:30:29 UTC (rev 3701)
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>seamBookingPortlet</artifactId>
+ <packaging>war</packaging>
+ <name>seamBookingPortlet Maven Webapp</name>
+ <version>3.2.0-SNAPSHOT</version>
+ <build>
+ <finalName>seamBookingPortlet</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <!--
+ <webResources>
+ <resource>
+ <directory>${seamHome}</directory>
+ <targetPath>WEB-INF/lib</targetPath>
+ <includes>
+ <include>jboss-seam.jar</include>
+ <include>jboss-seam-ui.jar</include>
+ <include>jboss-seam-debug.jar</include>
+ <include>
+ jboss-seam-remoting.jar
+ </include>
+ <include>
+ jboss-seam-pdf.jar
+ </include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>${seamHome}/lib</directory>
+ <targetPath>WEB-INF/lib</targetPath>
+ <includes>
+ <include>jboss-el.jar</include>
+ </includes>
+ </resource>
+ </webResources>
+ -->
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>3.0.0.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.3.0.ga</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>3.3.1.ga</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>2.0.1.SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ui</artifactId>
+ <version>2.0.1.SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ioc</artifactId>
+ <version>2.0.1.SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-debug</artifactId>
+ <version>2.0.1.SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.extensions</groupId>
+ <artifactId>portlet</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_05</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_05</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <repository>
+ <id>repository.jboss.com</id>
+ <
url>http://repository.jboss.com/maven2</url>
+ </repository>
+ </repositories>
+</project>
+
Property changes on: trunk/samples/seamBookingPortlet/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Authenticator.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Authenticator.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Authenticator.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,6 @@
+package org.jboss.seam.example.booking;
+
+public interface Authenticator
+{
+ boolean authenticate();
+}
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Authenticator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,38 @@
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.util.List;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+
+@Name("authenticator")
+public class AuthenticatorAction implements Authenticator
+{
+ @In
+ private EntityManager entityManager;
+
+ @Out(required=false, scope = SESSION)
+ private User user;
+
+ public boolean authenticate()
+ {
+ List results = entityManager.createQuery("select u from User u where
u.username=#{identity.username} and u.password=#{identity.password}")
+ .getResultList();
+
+ if ( results.size()==0 )
+ {
+ return false;
+ }
+ else
+ {
+ user = (User) results.get(0);
+ return true;
+ }
+ }
+
+}
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/AuthenticatorAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Booking.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Booking.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Booking.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,190 @@
+//$Id: Booking.java,v 1.15 2007/06/27 00:06:49 gavin Exp $
+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;
+
+@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
+ public BigDecimal getTotal()
+ {
+ return hotel.getPrice().multiply( new BigDecimal( getNights() ) );
+ }
+
+ @Transient
+ public int getNights()
+ {
+ return (int) ( checkoutDate.getTime() - checkinDate.getTime() ) / 1000 / 60 / 60 /
24;
+ }
+
+ @Id @GeneratedValue
+ public Long getId()
+ {
+ return id;
+ }
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @NotNull
+ @Basic @Temporal(TemporalType.DATE)
+ public Date getCheckinDate()
+ {
+ return checkinDate;
+ }
+ public void setCheckinDate(Date datetime)
+ {
+ this.checkinDate = datetime;
+ }
+
+ @ManyToOne @NotNull
+ public Hotel getHotel()
+ {
+ return hotel;
+ }
+ public void setHotel(Hotel hotel)
+ {
+ this.hotel = hotel;
+ }
+
+ @ManyToOne @NotNull
+ public User getUser()
+ {
+ return user;
+ }
+ public void setUser(User user)
+ {
+ this.user = user;
+ }
+
+ @Basic @Temporal(TemporalType.DATE)
+ @NotNull
+ 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")
+ public String getCreditCard()
+ {
+ return creditCard;
+ }
+
+ public void setCreditCard(String creditCard)
+ {
+ this.creditCard = creditCard;
+ }
+
+ @Transient
+ public String getDescription()
+ {
+ DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
+ return hotel==null ? null : hotel.getName() +
+ ", " + df.format( getCheckinDate() ) +
+ " to " + df.format( getCheckoutDate() );
+ }
+
+ public boolean isSmoking()
+ {
+ return smoking;
+ }
+
+ public void setSmoking(boolean smoking)
+ {
+ this.smoking = smoking;
+ }
+
+ 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, message="Credit card name is required")
+ public String getCreditCardName()
+ {
+ return creditCardName;
+ }
+
+ public void setCreditCardName(String creditCardName)
+ {
+ this.creditCardName = creditCardName;
+ }
+
+ public int getCreditCardExpiryMonth()
+ {
+ return creditCardExpiryMonth;
+ }
+
+ public void setCreditCardExpiryMonth(int creditCardExpiryMonth)
+ {
+ this.creditCardExpiryMonth = creditCardExpiryMonth;
+ }
+
+ public int getCreditCardExpiryYear()
+ {
+ return creditCardExpiryYear;
+ }
+
+ public void setCreditCardExpiryYear(int creditCardExpiryYear)
+ {
+ this.creditCardExpiryYear = creditCardExpiryYear;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Booking(" + user + ","+ hotel + ")";
+ }
+
+}
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Booking.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/BookingList.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/BookingList.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/BookingList.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,10 @@
+//$Id: BookingList.java,v 1.7 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+public interface BookingList
+{
+ public void getBookings();
+ public Booking getBooking();
+ public void cancel();
+ public void destroy();
+}
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/BookingList.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/BookingListAction.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/BookingListAction.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/BookingListAction.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,68 @@
+//$Id: BookingListAction.java,v 1.23 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.datamodel.DataModelSelection;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+
+@Scope(SESSION)
+@Name("bookingList")
+(a)Restrict("#{identity.loggedIn}")
+public class BookingListAction implements BookingList, Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ @In
+ private EntityManager entityManager;
+
+ @In
+ private User user;
+
+ @DataModel
+ private List<Booking> bookings;
+ @DataModelSelection
+ private Booking booking;
+
+ @Logger
+ private Log log;
+
+ @Factory
+ @Observer("bookingConfirmed")
+ public void getBookings()
+ {
+ bookings = entityManager.createQuery("select b from Booking b where
b.user.username = :username order by b.checkinDate")
+ .setParameter("username", user.getUsername())
+ .getResultList();
+ }
+
+ public void cancel()
+ {
+ log.info("Cancel booking: #{bookingList.booking.id} for
#{user.username}");
+ Booking cancelled = entityManager.find(Booking.class, booking.getId());
+ if (cancelled!=null) entityManager.remove( cancelled );
+ getBookings();
+ FacesMessages.instance().add("Booking cancelled for confirmation number
#{bookingList.booking.id}");
+ }
+
+ public Booking getBooking()
+ {
+ return booking;
+ }
+
+ public void destroy() {}
+}
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/BookingListAction.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/ChangePassword.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/ChangePassword.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/ChangePassword.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,13 @@
+//$Id: ChangePassword.java,v 1.5 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+public interface ChangePassword
+{
+ public void changePassword();
+ public boolean isChanged();
+
+ public String getVerify();
+ public void setVerify(String verify);
+
+ public void destroy();
+}
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/ChangePassword.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,68 @@
+//$Id: ChangePasswordAction.java,v 1.22 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.EVENT;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.faces.FacesMessages;
+
+@Scope(EVENT)
+@Name("changePassword")
+(a)Restrict("#{identity.loggedIn}")
+public class ChangePasswordAction implements ChangePassword
+{
+ @In @Out
+ private User user;
+
+ @In
+ private EntityManager entityManager;
+
+ private String verify;
+
+ private boolean changed;
+
+ @In
+ private FacesMessages facesMessages;
+
+ public void changePassword()
+ {
+ if ( user.getPassword().equals(verify) )
+ {
+ user = entityManager.merge(user);
+ facesMessages.add("Password updated");
+ changed = true;
+ }
+ else
+ {
+ facesMessages.addToControl("verify", "Re-enter new
password");
+ revertUser();
+ verify=null;
+ }
+ }
+
+ public boolean isChanged()
+ {
+ return changed;
+ }
+
+ private void revertUser()
+ {
+ user = entityManager.find(User.class, user.getUsername());
+ }
+ public String getVerify()
+ {
+ return verify;
+ }
+ public void setVerify(String verify)
+ {
+ this.verify = verify;
+ }
+
+ public void destroy() {}
+}
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/ChangePasswordAction.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Hotel.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Hotel.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Hotel.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,114 @@
+//$Id: Hotel.java,v 1.13 2007/06/27 00:06:49 gavin Exp $
+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;
+
+@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
+ public String getAddress()
+ {
+ return address;
+ }
+ public void setAddress(String address)
+ {
+ this.address = address;
+ }
+
+ @Length(max=40) @NotNull
+ public String getCity()
+ {
+ return city;
+ }
+ public void setCity(String city)
+ {
+ this.city = city;
+ }
+
+ @Length(min=4, max=6) @NotNull
+ public String getZip()
+ {
+ return zip;
+ }
+ public void setZip(String zip)
+ {
+ this.zip = zip;
+ }
+
+ @Length(min=2, max=10) @NotNull
+ public String getState()
+ {
+ return state;
+ }
+ public void setState(String state)
+ {
+ this.state = state;
+ }
+
+ @Length(min=2, max=40) @NotNull
+ public String getCountry()
+ {
+ return country;
+ }
+ public void setCountry(String country)
+ {
+ this.country = country;
+ }
+
+ @Column(precision=6, scale=2)
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ public void setPrice(BigDecimal price)
+ {
+ this.price = price;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Hotel(" + name + "," + address + "," + city +
"," + zip + ")";
+ }
+}
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Hotel.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelBooking.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelBooking.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelBooking.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,19 @@
+//$Id: HotelBooking.java,v 1.14 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+public interface HotelBooking
+{
+ public void selectHotel(Hotel selectedHotel);
+
+ public void bookHotel();
+
+ public void setBookingDetails();
+ public boolean isBookingValid();
+
+ public void confirm();
+
+ public void cancel();
+
+ public void destroy();
+
+}
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelBooking.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,101 @@
+//$Id: HotelBookingAction.java,v 1.53 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import java.util.Calendar;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.core.Events;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+
+@Name("hotelBooking")
+(a)Restrict("#{identity.loggedIn}")
+public class HotelBookingAction implements HotelBooking
+{
+
+ @In
+ private EntityManager entityManager;
+
+ @In
+ private User user;
+
+ @In(required=false) @Out
+ private Hotel hotel;
+
+ @In(required=false)
+ @Out(required=false)
+ private Booking booking;
+
+ @In
+ private FacesMessages facesMessages;
+
+ @In
+ private Events events;
+
+ @Logger
+ private Log log;
+
+ private boolean bookingValid;
+
+ @Begin
+ public void selectHotel(Hotel selectedHotel)
+ {
+ hotel = entityManager.merge(selectedHotel);
+ }
+
+ public void bookHotel()
+ {
+ booking = new Booking(hotel, user);
+ Calendar calendar = Calendar.getInstance();
+ booking.setCheckinDate( calendar.getTime() );
+ calendar.add(Calendar.DAY_OF_MONTH, 1);
+ booking.setCheckoutDate( calendar.getTime() );
+ }
+
+ public void setBookingDetails()
+ {
+ Calendar calendar = Calendar.getInstance();
+ calendar.add(Calendar.DAY_OF_MONTH, -1);
+ if ( booking.getCheckinDate().before( calendar.getTime() ) )
+ {
+ facesMessages.addToControl("checkinDate", "Check in date must be
a future date");
+ bookingValid=false;
+ }
+ else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
+ {
+ facesMessages.addToControl("checkoutDate", "Check out date must
be later than check in date");
+ bookingValid=false;
+ }
+ else
+ {
+ bookingValid=true;
+ }
+ }
+
+ public boolean isBookingValid()
+ {
+ return bookingValid;
+ }
+
+ @End
+ public void confirm()
+ {
+ entityManager.persist(booking);
+ facesMessages.add("Thank you, #{user.name}, your confimation number for
#{hotel.name} is #{booking.id}");
+ log.info("New booking: #{booking.id} for #{user.username}");
+ events.raiseTransactionSuccessEvent("bookingConfirmed");
+ }
+
+ @End
+ public void cancel() {}
+
+ public void destroy() {}
+}
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelBookingAction.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelSearching.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelSearching.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelSearching.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,20 @@
+//$Id: HotelSearching.java,v 1.12 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+public interface HotelSearching
+{
+ public int getPageSize();
+ public void setPageSize(int pageSize);
+
+ public String getSearchString();
+ public void setSearchString(String searchString);
+
+ public String getSearchPattern();
+
+ public void find();
+ public void nextPage();
+ public boolean isNextPageAvailable();
+
+ public void destroy();
+
+}
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelSearching.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,82 @@
+//$Id: HotelSearchingAction.java,v 1.20 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import java.util.List;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.datamodel.DataModel;
+import org.jboss.seam.annotations.security.Restrict;
+
+@Name("hotelSearch")
+(a)Scope(ScopeType.SESSION)
+(a)Restrict("#{identity.loggedIn}")
+public class HotelSearchingAction implements HotelSearching
+{
+
+ @In
+ private EntityManager entityManager;
+
+ private String searchString;
+ private int pageSize = 10;
+ private int page;
+
+ @DataModel
+ private List<Hotel> hotels;
+
+ public void find()
+ {
+ page = 0;
+ queryHotels();
+ }
+ public void nextPage()
+ {
+ page++;
+ queryHotels();
+ }
+
+ private void queryHotels()
+ {
+ hotels = entityManager.createQuery("select h from Hotel h where lower(h.name)
like #{pattern} or lower(h.city) like #{pattern} or lower(h.zip) like #{pattern} or
lower(h.address) like #{pattern}")
+ .setMaxResults(pageSize)
+ .setFirstResult( page * pageSize )
+ .getResultList();
+ }
+
+ public boolean isNextPageAvailable()
+ {
+ return hotels!=null && hotels.size()==pageSize;
+ }
+
+ public int getPageSize() {
+ return pageSize;
+ }
+
+ public void setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ }
+
+ @Factory(value="pattern", scope=ScopeType.EVENT)
+ public String getSearchPattern()
+ {
+ return searchString==null ?
+ "%" : '%' + searchString.toLowerCase().replace('*',
'%') + '%';
+ }
+
+ public String getSearchString()
+ {
+ return searchString;
+ }
+
+ public void setSearchString(String searchString)
+ {
+ this.searchString = searchString;
+ }
+
+ public void destroy() {}
+}
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/HotelSearchingAction.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Register.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Register.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Register.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,13 @@
+//$Id: Register.java,v 1.5 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+public interface Register
+{
+ public void register();
+ public void invalid();
+ public String getVerify();
+ public void setVerify(String verify);
+ public boolean isRegistered();
+
+ public void destroy();
+}
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/Register.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/RegisterAction.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/RegisterAction.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/RegisterAction.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,75 @@
+//$Id: RegisterAction.java,v 1.23 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.EVENT;
+
+import java.util.List;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.faces.FacesMessages;
+
+@Scope(EVENT)
+@Name("register")
+public class RegisterAction implements Register
+{
+ @In
+ private User user;
+
+ @In
+ private EntityManager entityManager;
+
+ @In
+ private FacesMessages facesMessages;
+
+ private String verify;
+
+ private boolean registered;
+
+ public void register()
+ {
+ if ( user.getPassword().equals(verify) )
+ {
+ List existing = entityManager.createQuery("select u.username from User u
where u.username=#{user.username}")
+ .getResultList();
+ if (existing.size()==0)
+ {
+ entityManager.persist(user);
+ facesMessages.add("Successfully registered as #{user.username}");
+ registered = true;
+ }
+ else
+ {
+ facesMessages.addToControl("username", "Username
#{user.username} already exists");
+ }
+ }
+ else
+ {
+ facesMessages.addToControl("verify", "Re-enter your
password");
+ verify=null;
+ }
+ }
+
+ public void invalid()
+ {
+ facesMessages.add("Please try again");
+ }
+
+ public boolean isRegistered()
+ {
+ return registered;
+ }
+ public String getVerify()
+ {
+ return verify;
+ }
+ public void setVerify(String verify)
+ {
+ this.verify = verify;
+ }
+
+ public void destroy() {}
+}
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/RegisterAction.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/User.java
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/User.java
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/User.java 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,76 @@
+//$Id: User.java,v 1.8 2007/06/27 00:06:49 gavin Exp $
+package org.jboss.seam.example.booking;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotNull;
+import org.hibernate.validator.Pattern;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Entity
+@Name("user")
+@Scope(SESSION)
+@Table(name="Customer")
+public class User implements Serializable
+{
+ private String username;
+ private String password;
+ private String name;
+
+ public User(String name, String password, String username)
+ {
+ this.name = name;
+ this.password = password;
+ this.username = username;
+ }
+
+ public User() {}
+
+ @NotNull
+ @Length(max=100)
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @NotNull
+ @Length(min=5, max=15)
+ public String getPassword()
+ {
+ return password;
+ }
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ @Id
+ @Length(min=4, max=15)
+ @Pattern(regex="^\\w*$", message="not a valid username")
+ public String getUsername()
+ {
+ return username;
+ }
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "User(" + username + ")";
+ }
+}
Property changes on:
trunk/samples/seamBookingPortlet/src/main/java/org/jboss/seam/example/booking/User.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/resources/META-INF/application.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/resources/META-INF/application.xml
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/application.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -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 Booking</display-name>
+
+ <module>
+ <web>
+ <web-uri>jboss-seam-booking.war</web-uri>
+ <context-root>/seam-booking</context-root>
+ </web>
+ </module>
+
+ <module>
+ <ejb>jboss-seam-booking.jar</ejb>
+ </module>
+
+ <module>
+ <ejb>jboss-seam.jar</ejb>
+ </module>
+
+</application>
Property changes on:
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/application.xml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/resources/META-INF/ejb-jar.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/resources/META-INF/ejb-jar.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar
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/ejb-jar_3_0.xsd"
+ version="3.0">
+
+ <interceptors>
+ <interceptor>
+
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor>
+ </interceptors>
+
+ <assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor-binding>
+ </assembly-descriptor>
+
+</ejb-jar>
Property changes on:
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/ejb-jar.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/resources/META-INF/jboss-app.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/resources/META-INF/jboss-app.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/resources/META-INF/jboss-app.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE jboss-app
+ PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
+
+<jboss-app>
+ <loader-repository>
+ seam.jboss.org:loader=seam-booking
+ </loader-repository>
+</jboss-app>
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/jboss-app.xml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/resources/META-INF/persistence.xml
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/persistence.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+ <persistence-unit name="bookingDatabase">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:/bookingDatasource</jta-data-source>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <!-- These are the default for JBoss EJB3, but not for HEM: -->
+ <property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
+ <property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+ </properties>
+ </persistence-unit>
+</persistence>
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/resources/META-INF/persistence.xml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/resources/booking-ds.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/resources/booking-ds.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/resources/booking-ds.xml 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE datasources
+ PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+
+<datasources>
+ <local-tx-datasource>
+ <jndi-name>bookingDatasource</jndi-name>
+ <connection-url>jdbc:hsqldb:.</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ </local-tx-datasource>
+</datasources>
+
Property changes on: trunk/samples/seamBookingPortlet/src/main/resources/booking-ds.xml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/resources/components.properties
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/resources/components.properties
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/resources/components.properties 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1 @@
+jndiPattern #{ejbName}/local
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/resources/components.properties
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/resources/import.sql
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/resources/import.sql
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/resources/import.sql 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -0,0 +1,22 @@
+insert into Customer (username, password, name) values ('gavin',
'foobar', 'Gavin King')
+insert into Customer (username, password, name) values ('demo', 'demo',
'Demo User')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 120,
'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta',
'GA', '30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 180,
'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA',
'30305', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 450,
'W Hotel', 'Union Square, Manhattan', 'NY', 'NY',
'10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450,
'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY',
'10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 250,
'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC',
'20036', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 300,
'70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY',
'10011', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 300,
'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL',
'33131', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 80,
'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire',
'WI', '54703', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 90,
'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau
Claire', 'WI', '54701', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (11, 160,
'Marriot Downtown', '55 Fourth Street', 'San Francisco',
'CA', '94103', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (12, 200,
'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona',
'Catalunya', '08019', 'Spain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (13, 210,
'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '',
'63405', 'Israel')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (14, 240,
'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo',
'', '105', 'Japan')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (15, 130,
'Hotel Beaulac', ' Esplanade L�opold-Robert 2', 'Neuchatel',
'', '2000', 'Switzerland')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (16, 140,
'Conrad Treasury Place', 'William & George Streets',
'Brisbane', 'QLD', '4001', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (17, 230,
'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal',
'Quebec', 'H3G1H6', 'Canada')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (18, 460,
'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA',
'30326', 'USA')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (19, 220,
'Swissotel', '68 Market Street', 'Sydney', 'NSW',
'2000', 'Australia')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (20, 250,
'Meli� White House', 'Albany Street', 'Regents Park London',
'', 'NW13UP', 'Great Britain')
+insert into Hotel (id, price, name, address, city, state, zip, country) values (21, 210,
'Hotel Allegro', '171 West Randolph Street', 'Chicago',
'IL', '60601', 'USA')
Property changes on: trunk/samples/seamBookingPortlet/src/main/resources/import.sql
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/samples/seamBookingPortlet/src/main/resources/messages.properties
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/resources/messages.properties
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/resources/messages.properties 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,50 @@
+javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected
type
+javax.faces.component.UIInput.REQUIRED=value is required
+javax.faces.component.UIInput.REQUIRED_detail=value is required
+javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted
information
+javax.faces.component.UISelectOne.INVALID=value is not valid
+javax.faces.component.UISelectMany.INVALID=value is not valid
+
+javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number
+javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal
number consisting of zero or more digits, optionally followed by a decimal point and
fraction, eg. {1}
+javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be a number
+javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed
integer number consisting of zero or more digits
+javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false
+javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any
value other than true will evaluate to false)
+javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255
+javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255
+javax.faces.converter.CharacterConverter.CHARACTER=value must be a character
+javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII
character
+javax.faces.convert.DateTimeConverter.CONVERSION value must be a datetime
+javax.faces.convert.DateTimeConverter.CONVERSION_detail value must be a datetime
+javax.faces.converter.DateTimeConverter.DATE=value must be a date
+javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1}
+javax.faces.converter.DateTimeConverter.TIME=value must be a time
+javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1}
+javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time
+javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time,
eg. {1}
+javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be
specified to convert the value
+javax.faces.converter.DoubleConverter.DOUBLE=value must be a number
+javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between
4.9E-324 and 1.7976931348623157E308
+javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum
+javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or
from the enum that contains the constant {1}
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or
from the enum, but no enum class provided
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an
enum or from the enum, but no enum class provided
+javax.faces.converter.FloatConverter.FLOAT=value must be a number
+javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45
and 3.4028235E38
+javax.faces.converter.IntegerConverter.INTEGER=value must be a number
+javax.faces.converter.IntegerConverter.INTEGER_detail=value must be a number between
-2147483648 and 2147483647
+javax.faces.converter.LongConverter.LONG=value must be a number
+javax.faces.converter.LongConverter.LONG_detail=must be a number between
-9223372036854775808 and 9223372036854775807
+javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount
+javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount,
eg. {1}
+javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount
+javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount,
eg. {1}
+javax.faces.converter.NumberConverter.NUMBER=value must be a number
+javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number
+javax.faces.converter.NumberConverter.PATTERN=value must be a number
+javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number
+javax.faces.converter.ShortConverter.SHORT=value must be a number
+javax.faces.converter.ShortConverter.SHORT_detail=value must be a number between -32768
and 32767
+
+
Property changes on:
trunk/samples/seamBookingPortlet/src/main/resources/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/resources/seam.properties
===================================================================
Property changes on: trunk/samples/seamBookingPortlet/src/main/resources/seam.properties
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+ <persistence-unit name="bookingDatabase">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:/bookingDatasource</jta-data-source>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <!-- These are the default for JBoss EJB3, but not for HEM: -->
+ <property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
+ <property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+ </properties>
+ </persistence-unit>
+</persistence>
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/META-INF/persistence.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS ENTITY="JSFProcess"/>
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components
xmlns="http://jboss.com/products/seam/components"
+
xmlns:core="http://jboss.com/products/seam/core"
+
xmlns:security="http://jboss.com/products/seam/security"
+
xmlns:transaction="http://jboss.com/products/seam/transaction"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-2.0.xsd
+
http://jboss.com/products/seam/transaction
http://jboss.com/products/seam/transaction-2.0.xsd
+
http://jboss.com/products/seam/security
http://jboss.com/products/seam/security-2.0.xsd
+
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.0.xsd">
+
+ <core:init jndi-pattern="seamBookingPortlet/#{ejbName}/local"
+ debug="true" />
+
+ <core:manager conversation-timeout="120000"
+ concurrent-request-timeout="500" conversation-id-parameter="cid"
/><!--
+
+ <persistence:managed-persistence-context auto-create="true"
name="entityManager">
+ <persistence:persistence-unit-jndi-name>java:/blogEntityManagerFactory</persistence:persistence-unit-jndi-name>
+ </persistence:managed-persistence-context>
+
+ -->
+ <transaction:ejb-transaction />
+
+ <security:identity
+ authenticate-method="#{authenticator.authenticate}" />
+
+</components>
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,24 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config version="1.2"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <application>
+ <view-handler>
+ org.ajax4jsf.portlet.application.PortletViewHandler
+ </view-handler>
+ <state-manager>
+ org.ajax4jsf.portlet.application.PortalStateManager
+ </state-manager>
+ <!--
+ <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
+ -->
+ </application>
+ <factory>
+ <faces-context-factory>
+ org.ajax4jsf.portlet.context.FacesContextFactoryImpl
+ </faces-context-factory>
+ </factory>
+
+</faces-config>
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml.l4t 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS ENTITY="JSFProcess"/>
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,3 @@
+<jboss-app>
+ <app-name>seamBookingPortletApp</app-name>
+</jboss-app>
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-app.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+
"http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd"><portlet-app>
+ <portlet>
+ <portlet-name>seamBookingPortlet</portlet-name>
+ </portlet>
+</portlet-app>
\ No newline at end of file
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-portlet.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,12 @@
+ <!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+
+<jboss-web>
+ <class-loading java2ClassLoadingCompliance="false">
+ <loader-repository>
+ seam.jboss.org:loader=seamBookingPortlet
+
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
+ </loader-repository>
+ </class-loading>
+</jboss-web>
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pages
xmlns="http://jboss.com/products/seam/pages"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://jboss.com/products/seam/pages
http://jboss.com/products/seam/pages-2.0.xsd"
+
+ no-conversation-view-id="/main.xhtml"
+ login-view-id="/home.xhtml">
+
+ <page view-id="/register.xhtml">
+
+ <action if="#{validation.failed}"
+ execute="#{register.invalid}"/>
+
+ <navigation>
+ <rule if="#{register.registered}">
+ <redirect view-id="/home.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/home.xhtml">
+
+ <navigation>
+ <rule if="#{identity.loggedIn}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/password.xhtml"
+ login-required="true">
+
+ <navigation>
+ <rule if="#{changePassword.changed}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/main.xhtml"
+ login-required="true">
+
+ <navigation from-action="#{hotelBooking.selectHotel(hot)}">
+ <redirect view-id="/hotel.xhtml"/>
+ </navigation>
+
+ <navigation from-action="#{bookingList.cancel}">
+ <redirect/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/hotel.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>View hotel: #{hotel.name}</description>
+
+ <navigation from-action="#{hotelBooking.bookHotel}">
+ <redirect view-id="/book.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/book.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>Book hotel: #{hotel.name}</description>
+
+ <navigation from-action="#{hotelBooking.setBookingDetails}">
+ <rule if="#{hotelBooking.bookingValid}">
+ <redirect view-id="/confirm.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/confirm.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>Confirm booking: #{booking.description}</description>
+
+ <navigation from-action="#{hotelBooking.confirm}">
+ <redirect view-id="/main.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="*">
+
+ <navigation from-action="#{identity.logout}">
+ <redirect view-id="/home.xhtml"/>
+ </navigation>
+
+ <navigation from-action="#{hotelBooking.cancel}">
+ <redirect view-id="/main.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <exception class="org.jboss.seam.security.NotLoggedInException">
+ <redirect view-id="/home.xhtml">
+ <message severity="warn">You must be logged in to use this
feature</message>
+ </redirect>
+ </exception>
+
+</pages>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"
standalone="yes"?>
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>SeamBookingPortletInstance</instance-id>
+ <portlet-ref>seamBookingPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <instance>
+ <instance-id>SeamBookingPortletSecondInstance</instance-id>
+ <portlet-ref>seamBookingPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/portlet-instances.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,25 @@
+<portlet-app version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet"
+
xmlns="http://java.sun.com/xml/ns/portlet">
+ <portlet>
+ <portlet-name>seamBookingPortlet</portlet-name>
+ <portlet-class>
+ javax.portlet.faces.GenericFacesPortlet
+ </portlet-class>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.view</name>
+ <value>/home.xhtml</value>
+ </init-param>
+
+
+ <expiration-cache>-0</expiration-cache>
+ <portlet-info>
+ <title>Ajax Portlet</title>
+ </portlet-info>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ </portlet>
+</portlet-app>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml
===================================================================
---
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml
(rev 0)
+++
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <instance>
+ <instance-name>SeamBookingPortletInstance</instance-name>
+
<component-ref>seamBookingPortletApp.seamBookingPortlet</component-ref>
+ </instance>
+ </deployment>
+ <!--
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <page>
+ <page-name>seamBookingPortlet</page-name>
+ <window>
+ <window-name>ajaxportletWindow</window-name>
+ <instance-ref>SeamBookingPortletInstance</instance-ref>
+ <default>true</default>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>ajaxportletSecondWindow</window-name>
+ <instance-ref>SeamBookingPortletSecondInstance</instance-ref>
+ <default>true</default>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ </deployment>
+ -->
+ <deployment>
+ <if-exists>overwrite</if-exists>
+ <parent-ref>default.default</parent-ref>
+ <window>
+ <window-name>otherAjaxportletWindow</window-name>
+ <instance-ref>SeamBookingPortletInstance</instance-ref>
+ <default>true</default>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </deployment><!--
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <if-exists>overwrite</if-exists>
+ <instance>
+ <instance-name>SeamBookingPortletSecondInstance</instance-name>
+
<component-ref>seamBookingPortletApp.seamBookingPortlet</component-ref>
+ </instance>
+ </deployment>
+--></deployments>
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name>Seam Booking Example</display-name>
+
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>
+ org.ajax4jsf.portlet.application.FaceletPortletViewHandler
+ </param-value>
+ </context-param>
+ <!-- Seam -->
+
+ <listener>
+ <listener-class>
+ org.jboss.seam.servlet.SeamListener
+ </listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>
+ org.jboss.seam.servlet.SeamResourceServlet
+ </servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <!-- JSF -->
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</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>
+
+</web-app>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamBookingPortlet/src/main/webapp/book.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/book.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/book.xhtml 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -0,0 +1,122 @@
+<!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"
+ 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 globalOnly="true"/>
+ </div>
+
+ <ui:include src="hotelview.xhtml"/>
+
+ <div style="clear:both"/>
+
+ <h:form id="booking">
+ <fieldset>
+
+ <s:decorate id="checkinDateDecorate" template="edit.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <rich:calendar id="checkinDate" value="#{booking.checkinDate}"
required="true" datePattern="MM/dd/yyyy" event="onblur"
reRender="checkinDateDecorate" />
+ </s:decorate>
+
+ <s:decorate id="checkoutDateDecorate" template="edit.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <rich:calendar id="checkoutDate"
value="#{booking.checkoutDate}" required="true"
datePattern="MM/dd/yyyy" event="onblur"
reRender="checkoutDateDecorate" />
+ </s:decorate>
+
+ <s:decorate id="bedsDecorate" template="edit.xhtml">
+ <ui:define name="label">Room Preference:</ui:define>
+ <h:selectOneMenu id="beds" value="#{booking.beds}">
+ <f:selectItem itemLabel="One king-size bed"
itemValue="1"/>
+ <f:selectItem itemLabel="Two double beds" itemValue="2"/>
+ <f:selectItem itemLabel="Three beds" itemValue="3"/>
+ </h:selectOneMenu>
+ </s:decorate>
+
+ <s:decorate id="smokingDecorate" template="edit.xhtml">
+ <ui:define name="label">Smoking Preference:</ui:define>
+ <h:selectOneRadio id="smoking" value="#{booking.smoking}"
layout="pageDirection" styleClass="radio">
+ <f:selectItem itemLabel="Smoking" itemValue="true"/>
+ <f:selectItem itemLabel="Non Smoking" itemValue="false"/>
+ </h:selectOneRadio>
+ </s:decorate>
+
+ <s:decorate id="creditCardDecorate" template="edit.xhtml">
+ <ui:define name="label">Credit Card #:</ui:define>
+ <h:inputText id="creditCard" value="#{booking.creditCard}"
required="true">
+ <a:support event="onblur" reRender="creditCardDecorate"/>
+ </h:inputText>
+ </s:decorate>
+
+ <s:decorate id="creditCardNameDecorate"
template="edit.xhtml">
+ <ui:define name="label">Credit Card Name:</ui:define>
+ <h:inputText id="creditCardName"
value="#{booking.creditCardName}" required="true">
+ <a:support event="onblur"
reRender="creditCardNameDecorate"/>
+ </h:inputText>
+ </s:decorate>
+
+ <s:decorate id="creditCardExpiryDecorate"
template="edit.xhtml">
+ <ui:define name="label">Credit Card Expiry:</ui:define>
+ <h:selectOneMenu id="creditCardExpiryMonth"
value="#{booking.creditCardExpiryMonth}">
+ <f:selectItem itemLabel="Jan" itemValue="1"/>
+ <f:selectItem itemLabel="Feb" itemValue="2"/>
+ <f:selectItem itemLabel="Mar" itemValue="3"/>
+ <f:selectItem itemLabel="Apr" itemValue="4"/>
+ <f:selectItem itemLabel="May" itemValue="5"/>
+ <f:selectItem itemLabel="Jun" itemValue="6"/>
+ <f:selectItem itemLabel="Jul" itemValue="7"/>
+ <f:selectItem itemLabel="Aug" itemValue="8"/>
+ <f:selectItem itemLabel="Sep" itemValue="9"/>
+ <f:selectItem itemLabel="Oct" itemValue="10"/>
+ <f:selectItem itemLabel="Nov" itemValue="11"/>
+ <f:selectItem itemLabel="Dec" itemValue="12"/>
+ </h:selectOneMenu>
+ <h:selectOneMenu id="creditCardExpiryYear"
value="#{booking.creditCardExpiryYear}">
+ <f:selectItem itemLabel="2005" itemValue="2005"/>
+ <f:selectItem itemLabel="2006" itemValue="2006"/>
+ <f:selectItem itemLabel="2007" itemValue="2007"/>
+ <f:selectItem itemLabel="2008" itemValue="2008"/>
+ <f:selectItem itemLabel="2009" itemValue="2009"/>
+ </h:selectOneMenu>
+ </s:decorate>
+
+ <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>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/book.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/confirm.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/confirm.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/confirm.xhtml 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -0,0 +1,74 @@
+<!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"
+ 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"/>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Total Payment:</ui:define>
+ <h:outputText value="#{booking.total}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <h:outputText value="#{booking.checkinDate}"/>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <h:outputText value="#{booking.checkoutDate}"/>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Credit Card #:</ui:define>
+ #{booking.creditCard}
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:form id="confirm">
+ <h:commandButton id="confirm" value="Confirm"
action="#{hotelBooking.confirm}"/>
+  
+ <s:button id="revise" value="Revise"
view="/book.xhtml"/>
+  
+ <h:commandButton id="cancel" value="Cancel"
action="#{hotelBooking.cancel}"/>
+ </h:form>
+ </div>
+
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<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>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/confirm.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/conversations.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/conversations.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/conversations.xhtml 2007-11-02
00:30:29 UTC (rev 3701)
@@ -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:c="http://java.sun.com/jstl/core"
+
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">
+ <div>
+
+ <div class="section">
+ <h1><h:outputText rendered="#{not empty conversationList}"
value="Workspaces"/></h1>
+ </div>
+
+ <div class="section">
+ <h:form>
+ <h:dataTable value="#{conversationList}" var="entry">
+ <h:column>
+ <h:commandLink action="#{entry.select}"
value="#{entry.description}"/>
+  
+ <h:outputText value="[current]"
rendered="#{entry.current}"/>
+ </h:column>
+ <h:column>
+ <h:outputText value="#{entry.startDatetime}">
+ <s:convertDateTime type="time"
pattern="hh:mm"/>
+ </h:outputText>
+ -
+ <h:outputText value="#{entry.lastDatetime}">
+ <s:convertDateTime type="time"
pattern="hh:mm"/>
+ </h:outputText>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+ </div>
+
+ </div>
+</ui:composition>
\ No newline at end of file
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/conversations.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/css/date.css
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/css/date.css
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/css/date.css 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -0,0 +1,185 @@
+div.seam-date
+{
+ margin-top: 5px;
+ border: 1px solid #AAAAAA;
+ background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
+ background-color: #FFFFFF;
+ color: #505050;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+
+table.seam-date td {
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+.seam-date-monthNames
+{
+ width: 70px;
+ border: 1px solid #dddddd;
+ border-right: 3px solid #444444;
+ border-bottom: 3px solid #444444;
+ background-color: #ffffff;
+ font-size: 12px;
+ cursor: pointer;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: normal;
+}
+
+a.seam-date-monthNameLink, a.seam-date-monthNameLink:visited
+{
+ text-align: center;
+ display: block;
+ color: #555555;
+}
+
+a.seam-date-monthNameLink:hover
+{
+ background-color: #CCCCCC;
+ color: red;
+}
+
+.seam-date-years
+{
+ height: 10em;
+ overflow: auto;
+ width: 60px;
+ border: 1px solid #dddddd;
+ border-right: 3px solid #444444;
+ border-bottom: 3px solid #444444;
+ background-color: #ffffff;
+ font-size: 12px;
+ cursor: pointer;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: normal;
+}
+
+a.seam-date-yearLink, a.seam-date-yearLink:visited
+{
+ text-align: center;
+ display: block;
+ color: #555555;
+}
+
+a.seam-date-yearLink:hover
+{
+ background-color: #CCCCCC;
+ color: red;
+}
+
+tr.seam-date-header
+{
+ padding: 2px 0px 2px 0px;
+}
+
+td.seam-date-header
+{
+ padding: 0px 8px 0px 8px;
+ text-align: center;
+ color: gray;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ font-size: 12px;
+}
+
+td.seam-date-header-prevMonth
+{
+ background-image: url("../img/cal-prev.png");
+ background-repeat: no-repeat;
+ background-position: center;
+ padding: 0px 2px 0px 2px;
+ width: 17px;
+ height: 16px;
+ margin-left: 2px;
+}
+
+td.seam-date-header-nextMonth
+{
+ background-image: url("../img/cal-next.png");
+ background-repeat: no-repeat;
+ background-position: center;
+ padding: 0px 2px 0px 2px;
+ width: 17px;
+ height: 16px;
+ margin-right: 2px;
+}
+
+tr.seam-date-headerDays
+{
+ color: white;
+ font-weight: normal;
+}
+
+tr.seam-date-headerDays > td
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ color: white;
+ text-align: center;
+ width: 26px;
+}
+
+tr.seam-date-footer
+{
+ background-color: white;
+ color: #505050;
+ font-weight: bold;
+}
+
+tr.seam-date-footer > td
+{
+ text-align: center;
+}
+
+td.seam-date-inMonth
+{
+ background-color: white;
+ color: black;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-outMonth
+{
+ background-color: white;
+ color: #999999;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-selected
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ color: black;
+ font-weight: normal;
+}
+
+td.seam-date-dayOff-inMonth
+{
+ background-color: #efefef;
+ color: black;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-dayOff-outMonth
+{
+ background-color: #efefef;
+ color: #999999;
+ font-weight: normal;
+ cursor: pointer;
+ border: 1px solid #ece9d8;
+}
+
+td.seam-date-hover
+{
+ background-color: #CCCCCC;
+ border: 1px solid #AAAAAA;
+ cursor: pointer;
+ color: red;
+}
\ No newline at end of file
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/css/date.css
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/css/screen.css
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/css/screen.css
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/css/screen.css 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,274 @@
+/* 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;
+}
+img {
+ border: 0;
+}
+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;
+}
+.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: 150px;
+ text-align: right;
+}
+.entry .output {
+ float: right;
+ width: 360px;
+ padding-top: 10px;
+ text-align: left;
+}
+.entry .input {
+ float: right;
+ width: 360px;
+ text-align: left;
+}
+.entry .error {
+ float: right;
+ width: 360px;
+ text-align: left;
+}
+/* Sidebar
+----------------------------------------------- */
+.notes {
+ text-align: center;
+ 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;
+}
+#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;
+}
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/css/screen.css
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,148 @@
+* {
+ margin: 0px;
+ padding: 0px;
+ border: none;
+}
+
+body {
+ font: 1em verdana, arial, sans-serif;
+ background: #CCCCCC;
+}
+
+div#main {
+ margin-left: 0px;
+ width: 751px;
+ background: #ecefdf;
+}
+
+div#top,div#pictures{
+}
+
+div#pictures img {
+ float:left;
+}
+
+img#head1 {
+ margin-right: 3px;
+}
+
+img#head2 {
+ margin-right: 4px;
+}
+
+div.trail {
+ clear:both;
+ margin-left: 50px;
+ margin-top: 0px;
+ margin-right: 50px
+}
+
+div.foot {
+ margin-left: 50px;
+ margin-right: 50px;
+ margin-top: 50px;
+ text-align: center;
+ font-size: .5em;
+ height: 36px;
+}
+
+div.trail h1 {
+ margin-top: -30px;
+ margin-left: -50px;
+ font-size: 1.2em;
+ font-weight: bold;
+ padding-left: .4em;
+}
+
+div.trail h2 {
+ float: left;
+ font-size: 1em;
+ font-weight: bold;
+ padding-left: .4em;
+}
+
+div.trail h3 {
+ float: left;
+ font-size: .8em;
+ font-weight: bold;
+ margin-left: -1.4em;
+ margin-bottom: 1em;
+}
+
+
+div.trail p {
+ clear: both;
+ margin-top: 20px;
+ font-size: .8em;
+ text-decoration: none;
+}
+
+div#next_trail {
+ margin-left: 36px;
+}
+
+div.numbox {
+ border: thin solid black;
+ margin-left: -.8em;
+ float: left;
+ background: #ffffff;
+ padding: .2em .35em .3em;
+ font-style: normal;
+ font-weight: bold;
+ font-size: 1.4em;
+}
+
+div.figure {
+ text-align: center;
+ font-size: .6em;
+ margin-top: 30px;
+}
+
+div.figure img {
+ display: block;
+ margin-right: auto;
+ margin-left: auto;
+}
+
+code {
+ font: 1.1em "Courier New", Courier, mono;
+}
+
+code.block {
+ white-space: pre;
+ font: 10pt "Courier New", Courier, mono;
+ display: block;
+ border-style: dashed;
+ border-width: thin;
+ padding: .5em;
+ background: #ffffff;
+ margin: 20px;
+}
+
+div.foot_image {
+ float: left;
+ height: 86px;
+}
+
+a:active {
+ color : #666666;
+ text-decoration: none;
+}
+
+a:hover {
+ color : #000000;
+ background-color : #D6E0FE;
+ text-decoration: none;
+}
+
+a:link {
+ color : #005EB6;
+ text-decoration: none;
+}
+
+a:visited {
+ color : #888888;
+ text-decoration: none;
+}
+
+
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/css/trailblazer_main.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/display.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/display.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/display.xhtml 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -0,0 +1,16 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <div class="entry">
+ <span class="label">
+ <ui:insert name="label"/>
+ </span>
+ <span class="input">
+ <ui:insert/>
+ </span>
+ </div>
+
+</ui:composition>
\ No newline at end of file
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/display.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/edit.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/edit.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/edit.xhtml 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <div class="entry">
+ <s:label styleClass="label
#{invalid?'errors':''}">
+ <ui:insert name="label"/>
+ <s:span styleClass="required"
rendered="#{required}">*</s:span>
+ </s:label>
+ <span class="input #{invalid?'errors':''}">
+ <s:validateAll>
+ <ui:insert/>
+ </s:validateAll>
+ </span>
+ <s:message styleClass="error errors"/>
+ </div>
+
+</ui:composition>
\ No newline at end of file
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/edit.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/exp/bookingExp.html
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/exp/bookingExp.html
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/exp/bookingExp.html 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,161 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>In-depth Explanation</title>
+ <link href="../css/trailblazer_main.css" rel="stylesheet"
type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+ <div class="trail">
+ <div class="numbox">5</div>
+ <h2>Conversations</h2>
+ <img src="../img/header_line.gif" />
+
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+
+ <p>
+ The hotel booking "wizard" is implemented by a conversation-scoped
+ stateful session bean. All Seam components are in the
+ conversation scope by default.
+ The <code>HotelBookingAction</code> maintains
+ state associated with the booking process in the Seam conversation
+ scope. This ensures that if the user is working in multiple brower
+ tabs or multiple brower windows, the various conversations are
+ completely isolated from each other.
+ </p>
+ <p>
+ To see this working in practice, right click on the "View Hotel" button
+ in the search screen and select "open in new tab" or "open in new
window",
+ and try working on multiple hotel bookings simultaneously.
+ In the <a href="workspaceExp.html">next step</a>, we will
discuss
+ Seam's built-in components to manage multiple concurrent conversations.
+ </p>
+
+<code class="block">
+@Stateful
+@Name("hotelBooking")
+@LoggedIn
+public class HotelBookingAction implements HotelBooking
+{
+
+ @PersistenceContext(type=EXTENDED)
+ private EntityManager em;
+
+ @In
+ private User user;
+
+ @In(required=false) @Out
+ private Hotel hotel;
+
+ @In(required=false)
+ @Out(required=false)
+ private Booking booking;
+
+ @In(create=true)
+ private FacesMessages facesMessages;
+
+ @In(create=true)
+ private Events events;
+
+ @In
+ private HotelSearching hotelSearch;
+
+ @Logger
+ private Log log;
+
+ private boolean bookingValid;
+
+ @Begin
+ public void selectHotel(Hotel selectedHotel)
+ {
+ hotel = em.merge(selectedHotel);
+ }
+
+ public void bookHotel()
+ {
+ booking = new Booking(hotel, user);
+ Calendar calendar = Calendar.getInstance();
+ booking.setCheckinDate( calendar.getTime() );
+ calendar.add(Calendar.DAY_OF_MONTH, 1);
+ booking.setCheckoutDate( calendar.getTime() );
+ }
+
+
+ public void setBookingDetails()
+ {
+ Calendar calendar = Calendar.getInstance();
+ calendar.add(Calendar.DAY_OF_MONTH, -1);
+ if ( booking.getCheckinDate().before( calendar.getTime() ) )
+ {
+ facesMessages.addToControl("checkinDate", "Check in date must be
a future date");
+ bookingValid=false;
+ }
+ else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
+ {
+ facesMessages.addToControl("checkoutDate", "Check out date must
be later than check in date");
+ bookingValid=false;
+ }
+ else
+ {
+ bookingValid=true;
+ }
+ }
+
+ public boolean isBookingValid()
+ {
+ return bookingValid;
+ }
+
+ @End
+ public void confirm()
+ {
+ em.persist(booking);
+ facesMessages.add("Thank you, #{user.name}, your confimation number for
#{hotel.name} is #{booking.id}");
+ log.info("New booking: #{booking.id} for #{user.username}");
+ events.raiseTransactionSuccessEvent("bookingConfirmed");
+ }
+
+ @End
+ public void cancel() {}
+
+ @Remove
+ public void destroy() {}
+}</code>
+
+ <p>
+ The conversation begins when the <code>@Begin</code> annotated
+ <code>selectHotel()</code> is called, and ends when
+ the <code>@End</code> annotated
+ <code>confirm()</code> or <code>cancel()</code> is called.
Between the
+ <code>@Begin</code> and <code>@End</code> methods, the
user can do
+ any number of things with the application (i.e., invoke any
+ event handler method or use the BACK button etc.) and the
+ <code>hotelBooking</code> maintains its state throughout the process.
+ When the <code>@End</code> method is called, Seam destroys this
+ component and avoids any memory leak.
+ </p>
+
+ <p>
+ However, none of the <code>HotelBookingAction</code> bean methods
+ may be called outside of a long-running conversation.
+ So if we try to use the
+ back button after the end of the conversation, Seam will redirect to the main page,
with an
+ error message.
+ </p>
+
+
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+
+ </div>
+</div>
+
+</body>
+</html>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/exp/bookingExp.html
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/exp/confirmExp.html
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/exp/confirmExp.html
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/exp/confirmExp.html 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,104 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>In-depth Explanation</title>
+ <link href="../css/trailblazer_main.css" rel="stylesheet"
type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+ <div class="trail">
+ <div class="numbox">7</div>
+ <h2>Ending Conversations</h2>
+ <img src="../img/header_line.gif" />
+
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+
+ <p>
+ The "Confirm" button is bound to the action method
<code>confirm()</code>
+ of <code>HotelBookingAction</code>.
+ </p>
+
+<code class="block">
+<h:commandButton value="Confirm"
+ action="#{hotelBooking.confirm}"
+ id="confirm"/>
+</code>
+
+ <p>
+ The <code>confirm()</code> method is tagged with the
<code>@End</code> annotation,
+ which ends the long-running conversation and results in all state associated with
+ the conversation being destroyed at the end of the request.
+ Since the <code>pages.xml</code> file specifies a redirect for this
action, the state
+ will not be destroyed
+ until <em>after the redirect completes</em>. Note that even the
success message
+ that we create using the built-in <code>facesMessages</code> component
is transparently
+ propagated across the redirect!
+ </p>
+
+<code class="block">
+ @End
+ public void confirm()
+ {
+ if (booking==null || hotel==null) return "main";
+ em.persist(booking);
+ facesMessages.add("Thank you, #{user.name}, your confimation number " +
+ "for #{hotel.name} is #{booking.id}");
+ log.info("New booking: #{booking.id} for #{user.username}");
+ events.raiseEvent("bookingConfirmed");
+ }
+
+ @End
+ public void cancel() {}
+
+ @Destroy @Remove
+ public void destroy() {}
+}
+</code>
+
+ <p>
+ When the conversation state is finally destroyed, Seam calls the
<code>@Destroy</code> method,
+ which results in removal of the SFSB.
+ </p>
+
+ <p>
+ Notice that the <code>HotelBookingAction.confirm()</code> method
+ raises a <code>bookingConfirmed</code> event before it finishes. The
+ event mechanism allows Seam components to communicate with each other
+ without direct coupling. In this case, the
<code>BookingListAction</code>
+ component captures the <code>bookingConfirmed</code> event and
refreshes
+ the existing booking list for the current user.
+ </p>
+
+<code class="block">
+public class BookingListAction implements BookingList, Serializable
+{
+
+ ... ...
+
+ @Factory
+ @Observer("bookingConfirmed")
+ public void getBookings()
+ {
+ bookings = em.createQuery("from Booking b where b.user.username = " +
+ ":username order by b.checkinDate")
+ .setParameter("username", user.getUsername())
+ .getResultList();
+ }
+}
+</code>
+
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+
+ </div>
+</div>
+
+</body>
+</html>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/exp/confirmExp.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/exp/introExp.html
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/exp/introExp.html
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/exp/introExp.html 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,73 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>In-depth Explanation</title>
+ <link href="../css/trailblazer_main.css" rel="stylesheet"
type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+ <div class="trail">
+ <div class="numbox">1</div>
+ <h2>What is JBoss Seam</h2>
+ <img src="../img/header_line.gif" />
+
+ <p>
+ <center>
+ <form>
+ <INPUT type="button" value="Close Window"
onclick="window.close()">
+ </form>
+ </center>
+ </p>
+
+ <p>
+ EJB 3.0 and JSF are perhaps the most exciting new developments in the Java EE 5
platform.
+ Seam is an innovative new application framework that integrates the EJB 3.0
component model
+ with JSF as a presentation tier. Seam builds upon the standard extension points
provided by
+ both specifications and provides a set of Java annotations that extends the
standard
+ annotations defined by the EJB specification. In addition, Seam introduces several
innovative
+ new ideas: managed conversations, declarative and contextual application state
management,
+ bijection and integrated business process management.
+ </p>
+
+ <p>
+ Traditional web applications are incredibly vulnerable to bugs and performance
problems
+ relating to state management. Developers are forced to handle issues like back
button
+ navigation, multi-window browsing, session size management in an utterly ad-hoc
fashion.
+ Access to transactional components from the web tier has also been problematic.
J2EE
+ provided no way to have simultaneous access to state held in contexts associated
with
+ the web request, and state held in transactional resources accessed via EJB.
Finally,
+ J2EE had no first-class construct for representing state associated with a
long-running
+ business process. Seam tackles all these problems, and provides a uniform model
for
+ stateful components in Java EE 5.
+ </p>
+
+ <p>
+ Like all JBoss software, this entire software stack is free. The full source code
of this
+ sample application is available in the <code>examples/booking</code>
directory of the
+ <a
href="http://www.jboss.com/products/list/downloads#seam">Seam
distribution</a>.
+ <!--
+ There is even a
+ <a target="_blank"
href="http://docs.jboss.com/TrailBlazer/seam-booking/Seam.htm">
+ 10-minute flash demo
+ </a>
+ showing how to build a Seam web application from ground up.
+ -->
+ </p>
+
+ <p>
+ <center>
+ <form>
+ <INPUT type="button" value="Close Window"
onclick="window.close()">
+ </form>
+ </center>
+ </p>
+
+ </div>
+</div>
+
+</body>
+</html>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/exp/introExp.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/exp/loginExp.html
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/exp/loginExp.html
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/exp/loginExp.html 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,161 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>In-depth Explanation</title>
+ <link href="../css/trailblazer_main.css" rel="stylesheet"
type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+ <div class="trail">
+ <div class="numbox">2</div>
+ <h2>What happens when you login?</h2>
+ <img src="../img/header_line.gif" />
+
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+
+ <p>
+ The login page is defined using pure XHTML with JSF controls.
+ The form uses JSF EL value binding and method binding
+ expressions to refer to Seam components. For example,
+ <code>#{identity.username}</code> refers to a property of the
+ <code>Identity</code> component and
<code>#{identity.login}</code>
+ refers to a method of the <code>Identity</code> component.
+ </p>
+
+<code class="block">
+<div>
+ <h:outputLabel for="username">Login
Name</h:outputLabel>
+ <h:inputText id="username" value="#{identity.username}"
/>
+</div>
+<div>
+ <h:outputLabel for="password">Password</h:outputLabel>
+ <h:inputSecret id="password" value="#{identity.password}"
/>
+</div>
+
+... ...
+
+<div class="buttonBox">
+ <h:commandButton id="login"
+ action="#{identity.login}"
+ value="Account Login" />
+</div>
+</code>
+
+ <p>
+ After logging in, the <code>User</code> enity bean is mapped to the
Seam
+ context variable named <code>user</code> bean via the
+ <code>@Name</code> annotation. <code>User</code> is
+ a session scoped bean, meaning that the <code>user</code>
+ component value is retained for the entire session for
+ each user. You might also notice there are validation annotation
+ on the data properties. We will discuss those annotations in the
+ <a href="registerExp.html">next step</a>.
+ </p>
+
+<code class="block">
+@Entity
+@Name("user")
+@Scope(SESSION)
+public class User implements Serializable {
+ private String username;
+ private String password;
+ private String name;
+
+ @NotNull
+ @Length(min=5, max=15)
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+
+ @Id
+ @Length(min=4, max=15)
+ @Pattern(regex="^\\w*$", message="not a valid username")
+ public String getUsername () {
+ return username;
+ }
+ public void setUsername (String username) {
+ this.username = username;
+ }
+
+ // ... ...
+}
+</code>
+
+ <p>
+ Seam comes with its own Security framework, based on JAAS. It allows you
+ to perform user authentication by configuring your own authentication method
+ in <code>components.xml</code>.
+ </p>
+
+<code class="block">
+ <security:identity
authenticate-method="#{authenticator.authenticate}"/>
+</code>
+
+ <p>
+ <code>AuthenticatorAction</code> is an EJB 3.0 session bean mapped
+ to the Seam context variable named <code>authenticator</code>. When
+ the login button is clicked, the JSF method binding
+ <code>#{identity.login}</code> is evaluated, and based upon the
previous configuration, the
+ <code>authenticate()</code> method is invoked upon
<code>AuthenticatorAction</code>.
+ </p>
+
+<code class="block">
+@Stateless
+@Scope(EVENT)
+@Name("authenticator")
+public class AuthenticatorAction implements Authenticator
+{
+ @PersistenceContext EntityManager em;
+
+ @Out(required=false, scope = SESSION)
+ private User user;
+
+ public boolean authenticate()
+ {
+ List results = em.createQuery("select u from User u where" +
+ " u.username=#{identity.username}" +
+ " and u.password=#{identity.password}")
+ .getResultList();
+
+ if ( results.size()==0 )
+ {
+ return false;
+ }
+ else
+ {
+ user = (User) results.get(0);
+ return true;
+ }
+ }
+}
+</code>
+
+ <p>
+ The <code>@Out</code>
+ annotation indicates the <code>AuthenticatorAction</code> bean can
change the
+ value of the <code>user</code> context variable and make the new
instance
+ available to other session beans and JSF pages. The query expression
+ makes use of a special syntax in Seam that allows EL expressions to
+ serve as query parameters. This query references the
<code>identity</code> component,
+ a built-in Seam component that provides security functionality.
+ </p>
+
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+
+ </div>
+</div>
+
+</body>
+</html>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/exp/loginExp.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/exp/mainExp.html
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/exp/mainExp.html
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/exp/mainExp.html 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,214 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>In-depth Explanation</title>
+ <link href="../css/trailblazer_main.css" rel="stylesheet"
type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+ <div class="trail">
+ <div class="numbox">4</div>
+ <h2>Stateful components</h2>
+ <img src="../img/header_line.gif" />
+
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+
+ <p>
+ The hotel search page is backed by the a stateful session bean named
+ <code>hotelSearch</code> and implemented by the class
+ <code>HotelSearchingAction</code>.
+ </p>
+
+<code class="block">
+<h:inputText id="searchString"
value="#{hotelSearch.searchString}" >
+ <a:support event="onkeyup"
actionListener="#{hotelSearch.find}"
+ reRender="searchResults"/>
+</h:inputText>
+
+<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>
+</code>
+
+ <p>
+ When the button is clicked, the form is submitted and JSF sets the value
+ of the text box and drop down menu onto the <code>searchString</code>
and
+ <code>pageSize</code> attributes of
<code>HotelSearchingAction</code>
+ before calling the <code>find()</code> action listener method.
We've used a
+ session-scope stateful bean because we want it's state (the search results) to
+ be held in the session between requests to the server. The
<code><a:support></code>
+ tax specfies that after a keypress, the contents of the
<code><a:outputPanel></code> whose
+ id is <code>searchResults</code> should be rerendererd. This is done
through an AJAX-style
+ call back to the server with no additional code required of the application.
+ </p>
+
+<code class="block">
+@Stateful
+@Name("hotelSearch")
+(a)Scope(ScopeType.SESSION)
+@LoggedIn
+public class HotelSearchingAction implements HotelSearching
+{
+ @PersistenceContext
+ private EntityManager em;
+
+ private String searchString;
+ private int pageSize = 10;
+ private int page;
+
+ @DataModel
+ private List<Hotel> hotels;
+
+ public void find()
+ {
+ page = 0;
+ queryHotels();
+ }
+ public void nextPage()
+ {
+ page++;
+ queryHotels();
+ }
+
+ private void queryHotels()
+ {
+ hotels = em.createQuery("select h from Hotel h where lower(h.name) " +
+ "like #{pattern} or lower(h.city) like #{pattern}
" +
+ "or lower(h.zip) like #{pattern} or " +
+ "lower(h.address) like #{pattern}")
+ .setMaxResults(pageSize)
+ .setFirstResult( page * pageSize )
+ .getResultList();
+ }
+
+ public boolean isNextPageAvailable()
+ {
+ return hotels!=null && hotels.size()==pageSize;
+ }
+
+ public int getPageSize() {
+ return pageSize;
+ }
+
+ public void setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ }
+
+ @Factory(value="pattern", scope=ScopeType.EVENT)
+ public String getSearchPattern()
+ {
+ return searchString==null ?
+ "%" : '%' + searchString.toLowerCase().replace('*',
'%') + '%';
+ }
+
+ public String getSearchString()
+ {
+ return searchString;
+ }
+
+ public void setSearchString(String searchString)
+ {
+ this.searchString = searchString;
+ }
+
+ @Remove
+ public void destroy() {}
+}</code>
+
+ <p>
+ The <code>find()</code> method retrieves a list of hotels from the
database and
+ initializes the <code>hotels</code> field. The
<code>hotels</code> field is marked
+ with the <code>@DataModel</code> annotation, so when the
<code>find()</code> method
+ returns, Seam outjects an instance of <code>ListDataModel</code> to a
context
+ variable named <code>hotels</code>. So, when the search page is
re-rendered, the
+ result list is available to the JSF <code>dataTable</code>.
+ Each row of the data table has an associated command button or link
+ (see below).
+ </p>
+
+<code class="block">
+<h:outputText value="No Hotels Found"
+ rendered="#{hotels != null and hotels.rowCount==0}"/>
+<h:dataTable 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}
+ </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 value="View Hotel"
+ action="#{hotelBooking.selectHotel(hot)}"/>
+ </h:column>
+</h:dataTable>
+</code>
+
+ <p>
+ The "View Hotel" link is the above mentioned command link associated
+ with each row of the data table. It is implemented
+ using a Seam <code><s:link></code>, which is part of
Seam's
+ extension of JSF controls.
+ This JSF control let's us call an action, and pass a request parameter,
without
+ submitting any JSF form. The advantage of
<code><s:link></code> is that,
+ unlike a standard JSF <code><h:commandLink></code>,
there is no JavaScript
+ used, so "open link in new tab" works seamlessly.
+ </p>
+ <p>
+ When this link is clicked, the <code>selectHotel()</code> method of
the
+ <code>HotelBookingAction</code> bean is called with the
<code>hot</code>
+ parameter that is specified in the query. The parameter values are evaluated
+ at invocation time, not when the link is generated, so the
<code><s:link></code>
+ tag adds a dataModelSelection parameter that indicates the value of the
+ <code>hot</code> loop variable for the given row.</p>
+ <p> The <code>selectHotel()</code> method merges the selected
hotel into
+ the current persistence context (in case the same
+ hotel has been accessed before in the same session),
+ and starts a Seam conversation. We will discuss Seam conversations
+ in the next step.
+ </p>
+
+<code class="block">
+@Stateful
+@Name("hotelBooking")
+@LoggedIn
+public class HotelBookingAction implements HotelBooking
+{
+
+ ... ...
+
+ @Begin
+ public void selectHotel(Hotel selectedHotel)
+ {
+ hotel = em.merge(selectedHotel);
+ }
+}
+</code>
+
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+
+ </div>
+</div>
+
+</body>
+</html>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/exp/mainExp.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/exp/registerExp.html
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/exp/registerExp.html
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/exp/registerExp.html 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,229 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>In-depth Explanation</title>
+ <link href="../css/trailblazer_main.css" rel="stylesheet"
type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+ <div class="trail">
+ <div class="numbox">3</div>
+ <h2>What happens in the registration process?</h2>
+ <img src="img/header_line.gif" />
+
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+
+ <p>
+ The register.xhtml JSF form captures the user input for new account
+ registration. It validates the user input, binds the data to a
+ Seam data component, and invokes a Seam UI event handler method
+ when the form is submitted.
+ </p>
+
+<code class="block">
+<s:validateAll>
+<div class="entry">
+ <div class="label">
+ <h:outputLabel
for="username">Username:</h:outputLabel>
+ </div>
+ <div class="input">
+ <h:inputText id="username"
value="#{user.username}"/><br/>
+ <span class="errors"><h:message
for="username" /></span>
+ </div>
+</div>
+<div class="entry">
+ <div class="label">
+ <h:outputLabel for="name">Real
Name:</h:outputLabel>
+ </div>
+ <div class="input">
+ <h:inputText id="name" value="#{user.name}"
/><br/>
+ <span class="errors"><h:message for="name"
/></span>
+ </div>
+</div>
+</s:validateAll>
+
+... ...
+
+ <div class="input">
+ <h:commandButton value="Register"
+ action="#{register.register}"
+ class="button"/>
+ <h:commandButton value="Cancel" action="login"
class="button"/>
+ </div>
+</code>
+
+ <p>
+ The form fields are bound to properties of a Seam component named
+ <code>user</code> via JSF EL value binding expressions such as
+ <code>#{user.username}</code>. The form submit button is bound
+ to the <code>register()</code> method of the Seam component named
+ <code>register</code> using the JSF method binding expression
+ <code>#{register.register}</code>.
+ </p>
+
+ <p>
+ Notice that the input fields are enclosed by a
<code><s:validateAll</code>
+ tag. This tag is part of Seam's extension to JSF. It tells the Seam
+ runtime to validate those input fields when the form is submitted.
+ The validation conditions are specified on the entity bean classes
+ those input fields map to (e.g., here the validation condition is
+ on the <code>User</code> class, see later).
+ This JSF form also includes <code><h:message></code>
tags that
+ will display the results of any JSF validation failures.
+ </p>
+
+ <p>
+ The <code>User</code> class is an EJB 3.0 entity bean with a
+ <code>@Name</code> annotation that binds the bean instance to a
+ context variable named <code>user</code>. In addition to the standard
+ EJB 3.0 O/R mapping metadata, this bean features several Hibernate
+ Validator annotations such as
+ <code>@NotNull</code>, <code>@Length</code>. Due to the
+ <code><s:validateAll</code> tag in the form, these constraints
are
+ automatically validated by Seam when the form is submitted. If the user
+ enters invalid data in the JSF form, the form will be redisplayed with
+ error messages.
+ </p>
+
+<code class="block">
+@Entity
+@Name("user")
+@Scope(SESSION)
+public class User implements Serializable
+{
+ private String username;
+ private String password;
+ private String name;
+
+ public User(String name, String password, String username)
+ {
+ this.name = name;
+ this.password = password;
+ this.username = username;
+ }
+
+ public User() {}
+
+ @NotNull
+ @Length(max=100)
+ public String getName()
+ {
+ return name;
+ }
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @NotNull
+ @Length(min=5, max=15)
+ public String getPassword()
+ {
+ return password;
+ }
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ @Id
+ @Length(min=5, max=15)
+ public String getUsername()
+ {
+ return username;
+ }
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+
+}</code>
+
+ <p>
+ <code>RegisterAction</code> is an EJB 3.0 stateful session bean
+ bound to the Seam context variable named <code>register</code>.
+ The <code>register()</code> method is invoked when the form is
+ submitted.
+ </p>
+
+<code class="block">
+@Stateful
+@Scope(EVENT)
+@Name("register")
+public class RegisterAction implements Register
+{
+
+ @In
+ private User user;
+
+ @PersistenceContext
+ private EntityManager em;
+
+ @In(create=true)
+ private transient FacesMessages facesMessages;
+
+ private String verify;
+
+ public String register()
+ {
+ if ( user.getPassword().equals(verify) )
+ {
+ List existing = em.createQuery("select username from User " +
+ "where username=:username")
+ .setParameter("username", user.getUsername())
+ .getResultList();
+ if (existing.size()==0)
+ {
+ em.persist(user);
+ return "login";
+ }
+ else
+ {
+ facesMessages.add("username #{user.username} already exists");
+ return null;
+ }
+ }
+ else
+ {
+ facesMessages.add("re-enter your password");
+ verify=null;
+ return null;
+ }
+ }
+
+ public String getVerify()
+ {
+ return verify;
+ }
+
+ public void setVerify(String verify)
+ {
+ this.verify = verify;
+ }
+
+ @Destroy @Remove
+ public void destroy() {}
+}</code>
+
+ <p>
+ The <code>@In</code> annotations inject Seam components into the
<code>RegisterAction</code>
+ bean. The <code>user</code> component is our entity bean, of course.
The <code>facesMessages</code>
+ component is a built-in Seam component that makes it very easy to display
templated and localized
+ messages to the user, even when redirect after post is used.
+ </p>
+
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+
+ </div>
+</div>
+
+</body>
+</html>
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/exp/registerExp.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html 2007-11-02
00:30:29 UTC (rev 3701)
@@ -0,0 +1,92 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml" lang="en"
xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>In-depth Explanation</title>
+ <link href="../css/trailblazer_main.css" rel="stylesheet"
type="text/css" />
+</head>
+
+<body>
+
+<div id="main">
+ <div class="trail">
+ <div class="numbox">6</div>
+ <h2>The Workspace List</h2>
+ <img src="../img/header_line.gif" />
+
+ <p>
+ <center>
+ <form>
+ <INPUT type="button" value="Close Window"
onclick="window.close()">
+ </form>
+ </center>
+ </p>
+
+ <p>
+ The workspace list allows the user to switch between multiple
+ conversations from the same browser tab. There is no Java code
+ to write, just the following JSF code to include:
+ </p>
+
+<code class="block">
+<h:dataTable value="#{conversationList}" var="entry">
+ <h:column>
+ <h:commandLink action="#{entry.select}"
value="#{entry.description}"/>
+
+ <h:outputText value="[current]"
rendered="#{entry.current}"/>
+ </h:column>
+ <h:column>
+ <h:outputText value="#{entry.startDatetime}">
+ <f:convertDateTime type="time" pattern="hh:mm"/>
+ </h:outputText>
+ -
+ <h:outputText value="#{entry.lastDatetime}">
+ <f:convertDateTime type="time" pattern="hh:mm"/>
+ </h:outputText>
+ </h:column>
+</h:dataTable>
+</code>
+
+ <p>
+ We do need to specify what text will be displayed by
<code>#{entry.description}</code>.
+ We do this by setting the <code>description</code> value for each page
in <code>pages.xml</code>.
+ </p>
+
+<code class="block">
+<pages>
+ <!-- ... -->
+ <page view-id="/hotel.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>View hotel: #{hotel.name}</description>
+ <!-- ... -->
+ </page>
+
+ <page view-id="/book.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>Book hotel: #{hotel.name}</description>
+ <!-- ... -->
+ </page>
+<pages>
+</code>
+
+ <p>
+ Note that you don't need the <code>pages.xml</code> file if you
don't want the
+ workspace list in your application.
+ </p>
+
+ <p>
+ <form>
+ <input type="button" value="Close Window"
onclick="window.close()"/>
+ </form>
+ </p>
+
+ </div>
+</div>
+
+</body>
+</html>
Property changes on:
trunk/samples/seamBookingPortlet/src/main/webapp/exp/workspaceExp.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/home.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/home.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/home.xhtml 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -0,0 +1,64 @@
+<f:view
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:s="http://jboss.com/products/seam/taglib">
+<div id="document">
+ <div id="header">
+ <div id="title"><img src="img/hdr.title.gif"
alt="JBoss Suites: seam framework demo"/></div>
+ </div>
+ <div id="container">
+ <div id="sidebar">
+ <h:form id="login">
+ <fieldset>
+ <div>
+ <h:outputLabel for="username">Login Name</h:outputLabel>
+ <h:inputText id="username" value="#{identity.username}"
style="width: 175px;"/>
+ <div class="errors"><h:message
for="username"/></div>
+ </div>
+ <div>
+ <h:outputLabel for="password">Password</h:outputLabel>
+ <h:inputSecret id="password" value="#{identity.password}"
style="width: 175px;"/>
+ </div>
+ <div class="errors"><h:messages
globalOnly="true"/></div>
+ <div class="buttonBox"><h:commandButton id="login"
action="#{identity.login}" value="Account Login"/></div>
+ <div class="notes"><s:link id="register"
view="/register.xhtml" value="Register New User"/></div>
+ </fieldset>
+ </h:form>
+ </div>
+ <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 JBoss EJB 3.0, Seam, MyFaces, and
Facelets</div>
+</div>
+</f:view>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/home.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/hotel.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/hotel.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/hotel.xhtml 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -0,0 +1,56 @@
+<!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"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+ <h1>View Hotel</h1>
+</div>
+
+<div class="section">
+ <ui:include src="hotelview.xhtml"/>
+
+ <div class="buttonBox">
+ <h:form id="hotel">
+ <h:commandButton id="bookHotel"
action="#{hotelBooking.bookHotel}" value="Book Hotel"/>
+  
+ <h:commandButton id="cancel" action="#{hotelBooking.cancel}"
value="Back to Search"/>
+ </h:form>
+ </div>
+
+
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<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>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/hotel.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/hotelview.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/hotelview.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/hotelview.xhtml 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,45 @@
+<!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">
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Name:</ui:define>
+ #{hotel.name}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Address:</ui:define>
+ #{hotel.address}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">City:</ui:define>
+ #{hotel.city}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">State:</ui:define>
+ #{hotel.state}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Zip:</ui:define>
+ #{hotel.zip}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Country:</ui:define>
+ #{hotel.country}
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Nightly rate:</ui:define>
+ <h:outputText value="#{hotel.name}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+
+</ui:composition>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/hotelview.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/btn.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/btn.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/cal-next.png
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/cal-next.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/cal-prev.png
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/cal-prev.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/cnt.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/cnt.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/dtpick.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/dtpick.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.ad.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.ad.jpg
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.bar.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.bar.jpg
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.title.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/hdr.title.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/header_line.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/header_line.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/input.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/input.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/sdb.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/sdb.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/spinner.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/spinner.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/img/th.bg.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/img/th.bg.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/seamBookingPortlet/src/main/webapp/index.html
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/index.html
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/index.html 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=home.seam">
+</head>
+</html>
\ No newline at end of file
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/index.html
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/main.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/main.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/main.xhtml 2007-11-02 00:30:29 UTC
(rev 3701)
@@ -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 globalOnly="true"/>
+ </span>
+
+ <h1>Search Hotels</h1>
+
+ <h:form id="searchCriteria">
+ <fieldset>
+ <h:inputText id="searchString"
value="#{hotelSearch.searchString}" style="width: 165px;">
+ <a:support event="onkeyup"
actionListener="#{hotelSearch.find}" reRender="searchResults" />
+ </h:inputText>
+  
+ <a:commandButton id="findHotels" value="Find Hotels"
action="#{hotelSearch.find}" reRender="searchResults"/>
+  
+ <a:status>
+ <f:facet name="start">
+ <h:graphicImage 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 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 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">
+
+<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/samples/seamBookingPortlet/src/main/webapp/main.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/password.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/password.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/password.xhtml 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,64 @@
+<!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"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+ <h1>Change Your Password</h1>
+</div>
+
+<div class="section">
+
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
+ <h:form id="setpassword">
+
+ <fieldset>
+
+ <s:decorate template="edit.xhtml">
+ <ui:define name="label">Password:</ui:define>
+ <h:inputSecret id="password" value="#{user.password}"
required="true"/>
+ </s:decorate>
+
+ <s:decorate template="edit.xhtml">
+ <ui:define name="label">Verify:</ui:define>
+ <h:inputSecret id="verify" value="#{changePassword.verify}"
required="true"/>
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:commandButton id="change" value="Change"
action="#{changePassword.changePassword}"/>
+  
+ <s:button id="cancel" value="Cancel"
view="/main.xhtml"/>
+ </div>
+
+ </fieldset>
+
+ </h:form>
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+<h1>Simple things should be easy</h1>
+<p>
+ (And so should some complex things.) You shouldn't have to write four different
classes
+ just to change a password. Traditional J2EE architectures require that developers
spend
+ more time writing code to make the frameworks happy, than they ever get to spend
writing
+ code to make the user happy. Seam lets you reduce the size of your code
dramatically.
+ And that reduces bugs. And it makes refactoring easier. And it makes delivering new
+ functionality quicker. Productivity matters. But with Seam, JSF, EJB 3.0 and jBPM,
you
+ don't need to sacrifice the ability to handle complex problems just to achieve
great
+ productivity.
+</p>
+</ui:define>
+
+</ui:composition>
\ No newline at end of file
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/password.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/register.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/register.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/register.xhtml 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,102 @@
+<!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"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:a="http://richfaces.org/a4j">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
+ <title>JBoss Suites: Seam Framework</title>
+ <link href="css/screen.css" rel="stylesheet"
type="text/css" />
+</head>
+
+<body id="pgHome">
+
+<div id="document">
+
+ <div id="header">
+ <div id="title"><img src="img/hdr.title.gif"
alt="JBoss Suites: seam framework demo"/></div>
+ </div>
+
+ <div id="container">
+
+ <div id="sidebar">
+ <h1>Integrated multi-layer validation</h1>
+ <p>
+ Robust applications need data validation in several different places. Seam
integrates Hibernate Validator,
+ a set of annotations for expressing data model constraints in your domain model
classes. Then, these
+ constraints are applied almost completely transparently at three levels of the
application: by Seam when
+ the user first enters data, by EJB before persisting data to the database, and, if
you use Hibernate to
+ generate your database schema, by the database constraints themselves. Multi-layer
validation hardens
+ your application and protects your data. Even better, it's self-documenting,
and easy to change when
+ your business rules change.
+ </p>
+ <p>
+ <a href="#"
onclick="window.open('exp/registerExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What happens when I register?
+ </a>
+ </p>
+ </div>
+
+ <div id="content">
+
+ <div class="section">
+ <h1>Register</h1>
+ </div>
+
+ <div class="section">
+
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
+ <h:form id="registration">
+ <fieldset>
+
+ <s:decorate id="usernameDecorate" template="edit.xhtml">
+ <ui:define name="label">Username:</ui:define>
+ <h:inputText id="username" value="#{user.username}"
required="true">
+ <a:support event="onblur" reRender="usernameDecorate"/>
+ </h:inputText>
+ </s:decorate>
+
+ <s:decorate id="nameDecorate" template="edit.xhtml">
+ <ui:define name="label">Real Name:</ui:define>
+ <h:inputText id="name" value="#{user.name}"
required="true">
+ <a:support event="onblur" reRender="nameDecorate"/>
+ </h:inputText>
+ </s:decorate>
+
+ <s:decorate id="passwordDecorate" template="edit.xhtml">
+ <ui:define name="label">Password:</ui:define>
+ <h:inputSecret id="password" value="#{user.password}"
required="true"/>
+ </s:decorate>
+
+ <s:decorate id="verifyDecorate" template="edit.xhtml">
+ <ui:define name="label">Verify Password:</ui:define>
+ <h:inputSecret id="verify" value="#{register.verify}"
required="true"/>
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:commandButton id="register" value="Register"
action="#{register.register}"/>
+  
+ <s:button id="cancel" value="Cancel"
view="/home.xhtml"/>
+ </div>
+
+ </fieldset>
+ </h:form>
+
+ </div>
+
+ </div>
+
+ </div>
+
+ <div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and
Facelets</div>
+
+</div>
+
+</body>
+
+</html>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/register.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/samples/seamBookingPortlet/src/main/webapp/template.xhtml
===================================================================
--- trunk/samples/seamBookingPortlet/src/main/webapp/template.xhtml
(rev 0)
+++ trunk/samples/seamBookingPortlet/src/main/webapp/template.xhtml 2007-11-02 00:30:29
UTC (rev 3701)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<f:view
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">
+
+<div id="document">
+ <div id="header">
+ <div id="title"><img src="img/hdr.title.gif"
alt="JBoss Suites: seam framework demo"/></div>
+ <div id="status">
+ Welcome #{user.name}
+ | <s:link id="search" view="/main.xhtml"
value="Search" propagation="none"/>
+ | <s:link id="settings" view="/password.xhtml"
value="Settings" propagation="none"/>
+ | <s:link id="logout" action="#{identity.logout}"
value="Logout"/>
+ </div>
+ </div>
+ <div id="container">
+ <div id="sidebar">
+ <ui:insert name="sidebar"/>
+ </div>
+ <div id="content">
+ <ui:insert name="content"/>
+ <ui:include src="conversations.xhtml" />
+ </div>
+ </div>
+ <div id="footer">Created with JBoss Seam 2.0, JBoss EJB 3.0, JSF 1.2,
Hibernate 3 and Facelets</div>
+</div>
+</f:view>
Property changes on: trunk/samples/seamBookingPortlet/src/main/webapp/template.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain