You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shale.apache.org by gv...@apache.org on 2006/10/20 05:33:30 UTC

svn commit: r465963 - in /shale/sandbox/shale-clay-mailreader: ./ src/main/java/org/apache/shale/examples/mailreader/ src/main/webapp/WEB-INF/ src/main/webapp/pages/

Author: gvanmatre
Date: Thu Oct 19 20:33:28 2006
New Revision: 465963

URL: http://svn.apache.org/viewvc?view=rev&rev=465963
Log:
Added a couple quick Clay template examples of using the t:commandSortableHeader within the t:dataTable.

Added:
    shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_nsjsp.html   (with props)
    shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_tap.html   (with props)
Modified:
    shale/sandbox/shale-clay-mailreader/pom.xml
    shale/sandbox/shale-clay-mailreader/src/main/java/org/apache/shale/examples/mailreader/Registration.java
    shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/clay-config.xml
    shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/clay-tiles-config.xml
    shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/web.xml
    shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/registration_nsjsp.html

Modified: shale/sandbox/shale-clay-mailreader/pom.xml
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-mailreader/pom.xml?view=diff&rev=465963&r1=465962&r2=465963
==============================================================================
--- shale/sandbox/shale-clay-mailreader/pom.xml (original)
+++ shale/sandbox/shale-clay-mailreader/pom.xml Thu Oct 19 20:33:28 2006
@@ -43,6 +43,12 @@
             <artifactId>commons-validator</artifactId>
             <version>1.3.0</version>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.shale</groupId>
+            <artifactId>shale-application</artifactId>
+            <version>1.0.4-SNAPSHOT</version>
+        </dependency>
 
 		<dependency>
 			<groupId>org.apache.shale</groupId>

Modified: shale/sandbox/shale-clay-mailreader/src/main/java/org/apache/shale/examples/mailreader/Registration.java
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-mailreader/src/main/java/org/apache/shale/examples/mailreader/Registration.java?view=diff&rev=465963&r1=465962&r2=465963
==============================================================================
--- shale/sandbox/shale-clay-mailreader/src/main/java/org/apache/shale/examples/mailreader/Registration.java (original)
+++ shale/sandbox/shale-clay-mailreader/src/main/java/org/apache/shale/examples/mailreader/Registration.java Thu Oct 19 20:33:28 2006
@@ -18,6 +18,11 @@
 
 package org.apache.shale.examples.mailreader;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
 import javax.faces.application.FacesMessage;
 
 import org.apache.commons.logging.Log;
@@ -28,26 +33,32 @@
 import org.apache.struts.apps.mailreader.dao.UserDatabase;
 
 /**
- * <p><code>ViewController</code> for the <code>registration</code> page.</p>
+ * <p>
+ * <code>ViewController</code> for the <code>registration</code> page.
+ * </p>
  */
 
 public class Registration extends BaseViewController {
 
-    
-    // -------------------------------------------------------- Static Variables
+    String sort = null;
 
+    boolean ascending = true;
+
+    // -------------------------------------------------------- Static Variables
 
     /**
-     * <p>The log instance for this bean.</p>
+     * <p>
+     * The log instance for this bean.
+     * </p>
      */
     private static final Log log = LogFactory.getLog(Registration.class);
 
-
     // -------------------------------------------------------------- Properties
 
-
     /**
-     * <p>The from address of this user.</p>
+     * <p>
+     * The from address of this user.
+     * </p>
      */
     private String fromAddress = null;
 
@@ -59,15 +70,17 @@
     }
 
     /**
-     * @param fromAddress The fromAddress to set.
+     * @param fromAddress
+     *            The fromAddress to set.
      */
     public void setFromAddress(String fromAddress) {
         this.fromAddress = fromAddress;
     }
 
-
     /**
-     * <p>The full name of this user.</p>
+     * <p>
+     * The full name of this user.
+     * </p>
      */
     private String fullName = null;
 
@@ -79,22 +92,17 @@
     }
 
     /**
-     * @param fullName The fullName to set.
+     * @param fullName
+     *            The fullName to set.
      */
     public void setFullName(String fullName) {
         this.fullName = fullName;
     }
-    
-    
-
-
-
-
-
-
 
     /**
-     * <p>The login password for this user.</p>
+     * <p>
+     * The login password for this user.
+     * </p>
      */
     private String password = null;
 
@@ -106,15 +114,17 @@
     }
 
     /**
-     * @param password The password to set.
+     * @param password
+     *            The password to set.
      */
     public void setPassword(String password) {
         this.password = password;
     }
-    
-    
+
     /**
-     * <p>The confirmation password for this user.</p>
+     * <p>
+     * The confirmation password for this user.
+     * </p>
      */
     private String password2 = null;
 
@@ -126,15 +136,17 @@
     }
 
     /**
-     * @param password2 The password2 to set.
+     * @param password2
+     *            The password2 to set.
      */
     public void setPassword2(String password2) {
         this.password2 = password2;
     }
 
-
     /**
-     * <p>The reply to address of this user.</p>
+     * <p>
+     * The reply to address of this user.
+     * </p>
      */
     private String replyToAddress = null;
 
@@ -146,15 +158,16 @@
     }
 
     /**
-     * @param replyToAddress The replyToAddress to set.
+     * @param replyToAddress
+     *            The replyToAddress to set.
      */
     public void setReplyToAddress(String replyToAddress) {
         this.replyToAddress = replyToAddress;
     }
 
-
     /**
-     * <p>The set of subscriptions for the currently logged in user.
+     * <p>
+     * The set of subscriptions for the currently logged in user.
      */
     private Subscription[] subscriptions = null;
 
@@ -162,11 +175,13 @@
      * @return Returns the subscriptions.
      */
     public Subscription[] getSubscriptions() {
+        this.sort(getSort(), isAscending());
         return this.subscriptions;
     }
 
     /**
-     * @param subscriptions The subscriptions to set.
+     * @param subscriptions
+     *            The subscriptions to set.
      */
     public void setSubscriptions(Subscription subscriptions[]) {
         if (log.isTraceEnabled()) {
@@ -179,9 +194,10 @@
         this.subscriptions = subscriptions;
     }
 
-
     /**
-     * <p>The logon username for this user.</p>
+     * <p>
+     * The logon username for this user.
+     * </p>
      */
     private String username = null;
 
@@ -191,20 +207,21 @@
     public String getUsername() {
         return this.username;
     }
-    
+
     /**
-     * @param username The username to set.
+     * @param username
+     *            The username to set.
      */
     public void setUsername(String username) {
         this.username = username;
     }
 
-
     // ---------------------------------------------------------- Event Handlers
 
-
     /**
-     * <p>Return to the appropriate page depending on the current mode.</p>
+     * <p>
+     * Return to the appropriate page depending on the current mode.
+     * </p>
      */
     public String cancel() {
 
@@ -216,9 +233,10 @@
 
     }
 
-
     /**
-     * <p>Create a new subscription.</p>
+     * <p>
+     * Create a new subscription.
+     * </p>
      */
     public String create() {
 
@@ -226,15 +244,17 @@
         state.setHost(null);
         state.setMode("CREATE");
         if (log.isTraceEnabled()) {
-            log.trace("subscription(" + state.getMode() + "," + state.getHost() + ")");
+            log.trace("subscription(" + state.getMode() + "," + state.getHost()
+                    + ")");
         }
         return "subscription";
 
     }
 
-
     /**
-     * <p>Delete an existing subscription.</p>
+     * <p>
+     * Delete an existing subscription.
+     * </p>
      */
     public String delete() {
 
@@ -242,15 +262,17 @@
         state.setHost(((Subscription) getBean("current")).getHost());
         state.setMode("DELETE");
         if (log.isTraceEnabled()) {
-            log.trace("subscription(" + state.getMode() + "," + state.getHost() + ")");
+            log.trace("subscription(" + state.getMode() + "," + state.getHost()
+                    + ")");
         }
         return "subscription";
 
     }
 
-
     /**
-     * <p>Edit an existing subscription.</p>
+     * <p>
+     * Edit an existing subscription.
+     * </p>
      */
     public String edit() {
 
@@ -258,16 +280,19 @@
         state.setHost(((Subscription) getBean("current")).getHost());
         state.setMode("EDIT");
         if (log.isTraceEnabled()) {
-            log.trace("subscription(" + state.getMode() + "," + state.getHost() + ")");
+            log.trace("subscription(" + state.getMode() + "," + state.getHost()
+                    + ")");
         }
         return "subscription";
 
     }
 
-
     /**
-     * <p>Create or update the user information.</p>
-     * @throws ExpiredPasswordException 
+     * <p>
+     * Create or update the user information.
+     * </p>
+     * 
+     * @throws ExpiredPasswordException
      */
     public String save() throws ExpiredPasswordException {
 
@@ -282,7 +307,7 @@
             if (database.findUser(username) != null) {
                 // FIXME - localization
                 getFacesContext().addMessage("registration:username",
-                  new FacesMessage("That username is already taken"));
+                        new FacesMessage("That username is already taken"));
                 ok = false;
             }
 
@@ -290,7 +315,7 @@
             if (!password.equals(password2)) {
                 // FIXME - localization
                 getFacesContext().addMessage("registration:password2",
-                  new FacesMessage("Password values do not match"));
+                        new FacesMessage("Password values do not match"));
                 ok = false;
             }
 
@@ -300,17 +325,16 @@
                 user = database.createUser(username);
                 getState().setUser(user);
             }
-            
 
-        } else /* if ("EDIT".equals(mode)) */ {
+        } else /* if ("EDIT".equals(mode)) */{
 
             // Verify that the two password values match (if entered)
-            if ((password != null) && (password.length() > 0) &&
-                (password2 != null) && (password2.length() > 0) &&
-                !password.equals(password2)) {
+            if ((password != null) && (password.length() > 0)
+                    && (password2 != null) && (password2.length() > 0)
+                    && !password.equals(password2)) {
                 // FIXME - localization
                 getFacesContext().addMessage("registration:password2",
-                  new FacesMessage("Password values do not match"));
+                        new FacesMessage("Password values do not match"));
                 ok = false;
             }
 
@@ -318,7 +342,7 @@
             user = getState().getUser();
 
         }
-        
+
         // Copy the remaining properties
         if (ok) {
             if ((password != null) && (password.length() > 0)) {
@@ -333,8 +357,8 @@
         try {
             database.save();
         } catch (Exception e) {
-            getFacesContext().addMessage(null,
-              new FacesMessage(e.getMessage()));
+            getFacesContext()
+                    .addMessage(null, new FacesMessage(e.getMessage()));
             log.error("Database save exception", e);
             ok = false;
         }
@@ -348,16 +372,15 @@
 
     }
 
-
     // -------------------------------------------------- ViewController Methods
 
-
     /**
-     * <p>If this is a postback, and we are in EDIT mode, retrieve the
-     * subscriptions for the currently logged on user.  This is required
-     * in case the user clicked one of the Delete or Edit buttons in the
-     * table, so that the correct row can be positioned to before calling
-     * the event handler.</p>
+     * <p>
+     * If this is a postback, and we are in EDIT mode, retrieve the
+     * subscriptions for the currently logged on user. This is required in case
+     * the user clicked one of the Delete or Edit buttons in the table, so that
+     * the correct row can be positioned to before calling the event handler.
+     * </p>
      */
     public void preprocess() {
 
@@ -368,12 +391,13 @@
 
     }
 
-
     /**
-     * <p>If this is not a postback, and we are in EDIT mode, prepopulate
-     * the field values for the user registration update form and retrieve the
-     * subscriptions for the currently logged in user.  (If this is a
-     * postback, we will have done this already in <code>init()</code>.)</p>
+     * <p>
+     * If this is not a postback, and we are in EDIT mode, prepopulate the field
+     * values for the user registration update form and retrieve the
+     * subscriptions for the currently logged in user. (If this is a postback,
+     * we will have done this already in <code>init()</code>.)
+     * </p>
      */
     public void prerender() {
 
@@ -387,33 +411,89 @@
         // The first time in, prepopulate our input field values
         User user = state.getUser();
         if (!isPostBack()) {
-            setUsername(user.getUsername()); //FIXME: NPE (after session timeout?)
+            setUsername(user.getUsername()); // FIXME: NPE (after session
+            // timeout?)
             setPassword("");
             setPassword2("");
             setFullName(user.getFullName());
             setFromAddress(user.getFromAddress());
             setReplyToAddress(user.getReplyToAddress());
 
-        // Look up the subscriptions for the currently logged on user,
-        // if we have not done so already.
-        // If we were using a real database, this is where executing the
-        // query and opening the result set would occur
+            // Look up the subscriptions for the currently logged on user,
+            // if we have not done so already.
+            // If we were using a real database, this is where executing the
+            // query and opening the result set would occur
             setSubscriptions(user.getSubscriptions());
         }
 
     }
 
-
     /**
-     * <p>Release our reference to to the retrieved subscriptions (if any).
-     * If we were using a real database, this is where closing the result set
-     * would go.</p>
+     * <p>
+     * Release our reference to to the retrieved subscriptions (if any). If we
+     * were using a real database, this is where closing the result set would
+     * go.
+     * </p>
      */
     public void destroy() {
-    	// TODO this is causing the page not to display the subscriptions
-        //setSubscriptions(null);
+        // TODO this is causing the page not to display the subscriptions
+        // setSubscriptions(null);
+
+    }
+
+    public String getSort() {
+        return sort;
+    }
+
+    public void setSort(String sort) {
+        this.sort = sort;
+    }
+
+    protected void sort(final String column, final boolean ascending) {
+        Comparator comparator = new Comparator() {
+            public int compare(Object o1, Object o2) {
+                Subscription c1 = (Subscription) o1;
+                Subscription c2 = (Subscription) o2;
+                if (column == null) {
+                    return 0;
+                }
+                if (column.equals("type")) {
+                    return ascending ? c1.getType().compareTo(c2.getType())
+                            : c2.getType().compareTo(c1.getType());
+                } else if (column.equals("username")) {
+                    return ascending ? c1.getUsername().compareTo(
+                            c2.getUsername()) : c2.getUsername().compareTo(
+                            c1.getUsername());
+
+                } else if (column.equals("host")) {
+                    return ascending ? c1.getHost().compareTo(c2.getHost())
+                            : c2.getHost().compareTo(c1.getHost());
+
+                } else if (column.equals("autoConnect")) {
+                    String f1 = c1.getAutoConnect() ? "true" : "false";
+                    String f2 = c2.getAutoConnect() ? "true" : "false";
+                    return ascending ? f1.compareTo(f2) : f2.compareTo(f1);
+                }
+
+                else
+                    return 0;
+            }
+        };
 
+        List tmp = new ArrayList();
+        for (int i = 0; i < subscriptions.length; i++) {
+            tmp.add(subscriptions[i]);
+        }
+        Collections.sort(tmp, comparator);
+        tmp.toArray(subscriptions);
     }
 
+    public boolean isAscending() {
+        return ascending;
+    }
+
+    public void setAscending(boolean ascending) {
+        this.ascending = ascending;
+    }
 
 }

Modified: shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/clay-config.xml
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/clay-config.xml?view=diff&rev=465963&r1=465962&r2=465963
==============================================================================
--- shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/clay-config.xml (original)
+++ shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/clay-config.xml Thu Oct 19 20:33:28 2006
@@ -160,4 +160,100 @@
 		   </attributes>
 	</component>
 
+
+	<component jsfid="outputColumn" extends="t:column" allowBody="false"> 
+       <element renderId="0" jsfid="t:commandSortHeader" facetName="header" id="@columnAttribute">
+			<attributes>
+				<set name="columnName" value="@columnAttribute" />
+				<set name="arrow" value="true" />
+			</attributes>
+			<element renderId="1" jsfid="outputText">
+				<attributes>
+					<set name="value" value="@columnName" />
+				</attributes>
+			</element>
+       </element>
+       <element renderId="1" jsfid="outputText">
+	      <attributes>
+		     <set name="value" value="#{@row.@columnAttribute}" />
+		  </attributes>
+       </element>
+    </component>
+          
+    <component jsfid="columnActionCommand" extends="t:commandButton" id="@action">
+	      <attributes>
+		     <set name="action" value="#{@managed-bean-name.@action}"/>
+		     <set name="immediate" value="true"/>
+		     <set name="value" value="#{messages['button.@action']}"/>
+		  </attributes>    
+    </component>
+    
+    <component jsfid="subscriptionsTable" id="table" extends="t:dataTable">
+        <attributes>
+            <set name="rendered" value="#{state.mode == 'EDIT'}"/>
+            <set name="value" value="#{@managed-bean-name.subscriptions}"/>
+            <set name="var" value="@row"/>
+            <set name="sortColumn" value="#{@managed-bean-name.sort}"/>
+            <set name="sortAscending" value="#{@managed-bean-name.ascending}"/>
+        </attributes>
+        
+        <symbols>
+            <set name="@managed-bean-name" value="registration"/>
+            <set name="@row" value="current"/>    
+        </symbols>
+    
+        <element renderId="1" jsfid="outputColumn">
+            <symbols>
+               <set name="@columnAttribute" value="host"/>
+               <set name="@columnName" value="#{messages['heading.host']}"/>
+            </symbols>
+        </element>
+
+        <element renderId="2" jsfid="outputColumn">
+            <symbols>
+               <set name="@columnAttribute" value="username"/>
+               <set name="@columnName" value="#{messages['heading.user']}"/>
+            </symbols>
+        </element>
+
+        <element renderId="3" jsfid="outputColumn">
+            <symbols>
+               <set name="@columnAttribute" value="type"/>
+               <set name="@columnName" value="#{messages['heading.type']}"/>
+            </symbols>
+        </element>
+
+        <element renderId="4" jsfid="outputColumn">
+            <symbols>
+               <set name="@columnAttribute" value="autoConnect"/>
+               <set name="@columnName" value="#{messages['heading.autoConnect']}"/>
+            </symbols>
+        </element>
+
+        <element renderId="5" jsfid="t:column">
+
+        	<element renderId="0" jsfid="outputText" facetName="header">
+        		<attributes>
+        			<set name="value" value="#{messages['heading.action']}" />
+        		</attributes>
+        	</element>
+
+        	<element renderId="1" jsfid="columnActionCommand">
+        		<symbols>
+        			<set name="@action" value="delete" />
+        		</symbols>
+        	</element>
+
+        	<element renderId="2" jsfid="columnActionCommand">
+        		<symbols>
+        			<set name="@action" value="edit" />
+        		</symbols>
+        	</element>
+
+        </element>
+
+    </component>
+    
+    
+
 </view>

Modified: shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/clay-tiles-config.xml
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/clay-tiles-config.xml?view=diff&rev=465963&r1=465962&r2=465963
==============================================================================
--- shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/clay-tiles-config.xml (original)
+++ shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/clay-tiles-config.xml Thu Oct 19 20:33:28 2006
@@ -48,6 +48,8 @@
        <symbols>
            <set name="@title" value="registrationTitle"/>
            <set name="@bodycontent" value="/pages/registration_nsjsp.html"/> 
+           <!-- <set name="@subscriptionTable" value="/pages/subscription_table_tap.html"/> -->
+           <set name="@subscriptionTable" value="/pages/subscription_table_nsjsp.html"/>
        </symbols>
     </component>
 

Modified: shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/web.xml?view=diff&rev=465963&r1=465962&r2=465963
==============================================================================
--- shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/web.xml (original)
+++ shale/sandbox/shale-clay-mailreader/src/main/webapp/WEB-INF/web.xml Thu Oct 19 20:33:28 2006
@@ -96,7 +96,7 @@
 	<filter>
 		<filter-name>shale</filter-name>
 		<filter-class>
-			org.apache.shale.faces.ShaleApplicationFilter
+			org.apache.shale.application.faces.ShaleApplicationFilter
 		</filter-class>
 	</filter>
 

Modified: shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/registration_nsjsp.html
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/registration_nsjsp.html?view=diff&rev=465963&r1=465962&r2=465963
==============================================================================
--- shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/registration_nsjsp.html (original)
+++ shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/registration_nsjsp.html Thu Oct 19 20:33:28 2006
@@ -10,7 +10,8 @@
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:t="http://myfaces.apache.org/tomahawk"
       xmlns:s="http://shale.apache.org/core"
-      xmlns:v="http://shale.apache.org/validator">
+      xmlns:v="http://shale.apache.org/validator"
+      xmlns:clay="http://shale.apache.org/clay">
 
 <t:messages    globalOnly="true"/>
 
@@ -160,63 +161,8 @@
 
   </t:panelGrid>
 
-  <t:dataTable         id="table"
-                 rendered="#{state.mode == 'EDIT'}"
-                    value="#{registration.subscriptions}"
-                      var="current">
+  <clay:clay jsfid="clay" clayJsfid="@subscriptionTable"/>
 
-    <t:column>
-      <f:facet       name="header">
-        <t:outputText
-                    value="#{messages['heading.host']}"/>
-      </f:facet>
-      <t:outputText    id="subHost"
-                    value="#{current.host}"/>
-    </t:column>
-
-    <t:column>
-      <f:facet       name="header">
-        <t:outputText
-                    value="#{messages['heading.user']}"/>
-      </f:facet>
-      <t:outputText    id="subUsername"
-                    value="#{current.username}"/>
-    </t:column>
-
-    <t:column>
-      <f:facet       name="header">
-        <t:outputText
-                    value="#{messages['heading.type']}"/>
-      </f:facet>
-      <t:outputText    id="subType"
-                    value="#{current.type}"/>
-    </t:column>
-
-    <t:column>
-      <f:facet       name="header">
-        <t:outputText
-                    value="#{messages['heading.autoConnect']}"/>
-      </f:facet>
-      <t:outputText    id="subAutoConnect"
-                    value="#{current.autoConnect}"/>
-    </t:column>
-
-    <t:column>
-      <f:facet       name="header">
-        <t:outputText
-                    value="#{messages['heading.action']}"/>
-      </f:facet>
-      <t:commandButton id="delete"
-                   action="#{registration.delete}"
-                immediate="true"
-                    value="#{messages['button.delete']}"/>
-      <t:commandButton id="edit"
-                   action="#{registration.edit}"
-                immediate="true"
-                    value="#{messages['button.edit']}"/>
-    </t:column>
-
-  </t:dataTable>
 
   <t:commandButton     id="create"
                    action="#{registration.create}"

Added: shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_nsjsp.html
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_nsjsp.html?view=auto&rev=465963
==============================================================================
--- shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_nsjsp.html (added)
+++ shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_nsjsp.html Thu Oct 19 20:33:28 2006
@@ -0,0 +1,86 @@
+<!-- ### clay:page charset="UTF-8" /### -->
+<!-- ### clay:remove ### -->
+<html>
+<head>
+<title>Mock Logon Title</title>
+</head>
+<body>
+<!-- ### /clay:remove ### -->
+<span jsfid="void" xmlns:f="http://java.sun.com/jsf/core" 
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:t="http://myfaces.apache.org/tomahawk"
+      xmlns:s="http://shale.apache.org/core"
+      xmlns:v="http://shale.apache.org/validator">
+
+  <t:dataTable         id="table"
+                 rendered="#{state.mode == 'EDIT'}"
+                    value="#{registration.subscriptions}"
+                      var="current"
+                sortColumn="#{registration.sort}" 
+               sortAscending="#{registration.ascending}">
+
+    <t:column>
+      <f:facet       name="header">
+        <t:commandSortHeader columnName="host" arrow="true">
+           <t:outputText
+                    value="#{messages['heading.host']}"/>
+        </t:commandSortHeader>
+      </f:facet>
+      <t:outputText    id="subHost"
+                    value="#{current.host}"/>
+    </t:column>
+
+    <t:column>
+      <f:facet       name="header">
+        <t:commandSortHeader columnName="username" arrow="true">
+            <t:outputText
+                    value="#{messages['heading.user']}"/>
+        </t:commandSortHeader>
+      </f:facet>
+      <t:outputText    id="subUsername"
+                    value="#{current.username}"/>
+    </t:column>
+
+    <t:column>
+      <f:facet       name="header">
+        <t:commandSortHeader columnName="type" arrow="true">
+           <t:outputText
+                    value="#{messages['heading.type']}"/>
+        </t:commandSortHeader>
+      </f:facet>
+      <t:outputText    id="subType"
+                    value="#{current.type}"/>
+    </t:column>
+
+    <t:column>
+      <f:facet       name="header">
+        <t:commandSortHeader columnName="autoConnect" arrow="true">
+           <t:outputText
+                    value="#{messages['heading.autoConnect']}"/>
+        </t:commandSortHeader>
+      </f:facet>
+      <t:outputText    id="subAutoConnect"
+                    value="#{current.autoConnect}"/>
+    </t:column>
+
+    <t:column>
+      <f:facet       name="header">
+        <t:outputText
+                    value="#{messages['heading.action']}"/>
+      </f:facet>
+      <t:commandButton id="delete"
+                   action="#{registration.delete}"
+                immediate="true"
+                    value="#{messages['button.delete']}"/>
+      <t:commandButton id="edit"
+                   action="#{registration.edit}"
+                immediate="true"
+                    value="#{messages['button.edit']}"/>
+    </t:column>
+
+  </t:dataTable>
+</span>
+<!-- ### clay:remove ### -->
+</body>
+</html>
+<!-- ### /clay:remove ### -->
\ No newline at end of file

Propchange: shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_nsjsp.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_tap.html
URL: http://svn.apache.org/viewvc/shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_tap.html?view=auto&rev=465963
==============================================================================
--- shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_tap.html (added)
+++ shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_tap.html Thu Oct 19 20:33:28 2006
@@ -0,0 +1,17 @@
+<!-- ### clay:page charset="UTF-8" /### -->
+<!-- ### clay:remove ### -->
+<html>
+<head>
+<title>Mock Logon Title</title>
+</head>
+<body>
+<!-- ### /clay:remove ### -->
+<table jsfid="subscriptionsTable">
+   <tr><th>Host Name<th>User Name<th>Server Type<th>Auto<th>Action
+   <tr><td>xyx@abc.com<td>user123<td>pop3<td>true<td><input type=submit value=Delete><input type="submit" value=Edit>
+   <tr>
+</table>
+<!-- ### clay:remove ### -->
+</body>
+</html>
+<!-- ### /clay:remove ### -->
\ No newline at end of file

Propchange: shale/sandbox/shale-clay-mailreader/src/main/webapp/pages/subscription_table_tap.html
------------------------------------------------------------------------------
    svn:eol-style = native