tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r416973 - in /tapestry/tapestry4/trunk: examples/TimeTracker/src/context/ examples/TimeTracker/src/context/WEB-INF/ framework/src/test/org/apache/tapestry/engine/encoders/
Date Sun, 25 Jun 2006 01:05:37 GMT
Author: jkuhnert
Date: Sat Jun 24 18:05:36 2006
New Revision: 416973

URL: http://svn.apache.org/viewvc?rev=416973&view=rev
Log:
Updated timetracker to use friendly URLs

Added:
    tapestry/tapestry4/trunk/examples/TimeTracker/src/context/Home.html   (with props)
    tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html   (with
props)
Modified:
    tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/hivemodule.xml
    tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.application
    tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/web.xml
    tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/engine/encoders/TestPageServiceEncoder.java

Added: tapestry/tapestry4/trunk/examples/TimeTracker/src/context/Home.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/examples/TimeTracker/src/context/Home.html?rev=416973&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/examples/TimeTracker/src/context/Home.html (added)
+++ tapestry/tapestry4/trunk/examples/TimeTracker/src/context/Home.html Sat Jun 24 18:05:36
2006
@@ -0,0 +1,60 @@
+<span jwcid="@Border">
+
+<p>
+This is the Tapestry TimeTracker application. It is a demonstration of some of the new
+core features available in tapestry, as well as how a sample application might be built
+using them.
+</p>
+
+<form jwcid="taskForm@Form" class="container" clientValidationEnabled="true" >
+<h3><span jwcid="@Insert" value="message:new.task"/></h3>
+	<fieldset>
+    <table width="90%" class="form" cellpadding="2" cellspacing="0" >
+    <tr>
+      <td><label jwcid="@FieldLabel" field="component:projectChoose" /></td>
+      <td><label jwcid="@FieldLabel" field="component:descriptionField" /></td>
+      <td><label>Duration</label></td>
+      <td>&nbsp;</td>
+    </tr>
+    <tr>
+      <td><div class="field required"><span jwcid="projectChoose" /></div></td>
+      <td><div class="field required"><input jwcid="descriptionField" /></div></td>
+      <td><div jwcid="duration@Any">18 minutes</div></td>
+      <td>&nbsp;</td>
+    </tr>
+    
+    <tr>
+      <td><label jwcid="@FieldLabel" field="component:datePicker" /></td>
+      <td><label jwcid="@FieldLabel" field="component:startPicker" /></td>
+      <td><label jwcid="@FieldLabel" field="component:endPicker" /></td>
+      <td>&nbsp;</td>
+    </tr>
+    
+    <tr>
+	  <td><div class="field required"><input jwcid="datePicker" /></div></td>
+      <td>
+      	<div class="field required">
+      		<input jwcid="startPicker" />
+      	</div>
+      </td>
+      <td>
+      	<div class="field required">
+      		<input jwcid="endPicker" />
+      	</div>
+      </td>
+      <td>
+      	<input jwcid="@Submit" value="message:button.add" class="submitButton" action="listener:addTask"
/>
+      </td>
+    </tr>
+    
+    </table>
+    </fieldset>
+</form>
+
+<div jwcid="projectDescription@Any" >
+	<span jwcid="@If" condition="ognl:selectedProject">
+		<h2 style="clear:left" ><span jwcid="@Insert" value="ognl:selectedProject.name"
/></h2>
+	</span>
+</div>
+
+</span>
\ No newline at end of file

Propchange: tapestry/tapestry4/trunk/examples/TimeTracker/src/context/Home.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html?rev=416973&view=auto
==============================================================================
--- tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html (added)
+++ tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html Sat Jun
24 18:05:36 2006
@@ -0,0 +1,32 @@
+<html jwcid="@Shell" 
+	  title="message:window.title" 
+	  ajaxEnabled="true" 
+	  browserLogLevel="DEBUG" >
+
+<link rel="shortcut icon" href="favicon.ico" type="image/gif" />
+<link href="css/timetracker.css" rel="stylesheet" type="text/css" media="all" />
+
+<body jwcid="@Body">
+
+<div id="header" >
+    <span class="headertxt"><span jwcid="@Insert" value="message:header.display"/>
</span>
+</div>
+
+<div id="navigation" >
+    <ul>
+        <li><a class="here" href="" >home</a></li>
+        <li><a href="others">others</a></li>
+        <li><a href="and more">more things</a></li>
+    </ul>
+</div>
+
+<div id="content">
+<span jwcid="@RenderBody" />
+</div>
+
+<div id="debug">
+</div>
+
+</body>
+
+</html>

Propchange: tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/hivemodule.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/hivemodule.xml?rev=416973&r1=416972&r2=416973&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/hivemodule.xml (original)
+++ tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/hivemodule.xml Sat Jun
24 18:05:36 2006
@@ -21,6 +21,13 @@
         <load service-id="timetracker.db.DatabaseInstaller" />
     </contribution>
     
+    <contribution configuration-id="tapestry.url.ServiceEncoders">
+        <asset-encoder id="asset" path="/assets" />
+        <extension-encoder id="extension" extension="svc" after="*"/>
+        <direct-service-encoder id="direct" stateless-extension="direct" stateful-extension="sdirect"/>
+        <page-service-encoder id="page" extension="htm" service="page"/>
+    </contribution>
+    
     <sub-module descriptor="timetracker.db.xml" />
     <sub-module descriptor="timetracker.dao.xml" />
 </module>

Modified: tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.application
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.application?rev=416973&r1=416972&r2=416973&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.application
(original)
+++ tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.application
Sat Jun 24 18:05:36 2006
@@ -22,4 +22,5 @@
 <application name="Tapestry TimeTracker">
   
   <library id="contrib" specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>
+  
 </application>

Modified: tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/web.xml?rev=416973&r1=416972&r2=416973&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/web.xml (original)
+++ tapestry/tapestry4/trunk/examples/TimeTracker/src/context/WEB-INF/web.xml Sat Jun 24 18:05:36
2006
@@ -70,6 +70,16 @@
     <servlet-name>timetracker</servlet-name>
     <url-pattern>/assets/*</url-pattern>
   </servlet-mapping>
+  
+  <servlet-mapping>
+    <servlet-name>timetracker</servlet-name>
+    <url-pattern>*.html</url-pattern>
+  </servlet-mapping>
+
+  <servlet-mapping>
+    <servlet-name>timetracker</servlet-name>
+    <url-pattern>*.htm</url-pattern>
+  </servlet-mapping>
 
   <session-config>
   	<session-timeout>15</session-timeout>

Modified: tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/engine/encoders/TestPageServiceEncoder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/engine/encoders/TestPageServiceEncoder.java?rev=416973&r1=416972&r2=416973&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/engine/encoders/TestPageServiceEncoder.java
(original)
+++ tapestry/tapestry4/trunk/framework/src/test/org/apache/tapestry/engine/encoders/TestPageServiceEncoder.java
Sat Jun 24 18:05:36 2006
@@ -71,6 +71,32 @@
         verifyControls();
     }
 
+    public void testEncodeHtm()
+    {
+        MockControl control = newControl(ServiceEncoding.class);
+        ServiceEncoding e = (ServiceEncoding) control.getMock();
+
+        e.getParameterValue(ServiceConstants.SERVICE);
+        control.setReturnValue("page");
+
+        e.getParameterValue(ServiceConstants.PAGE);
+        control.setReturnValue("Home");
+
+        e.setServletPath("/Home.htm");
+        e.setParameterValue(ServiceConstants.SERVICE, null);
+        e.setParameterValue(ServiceConstants.PAGE, null);
+
+        replayControls();
+
+        PageServiceEncoder encoder = new PageServiceEncoder();
+        encoder.setServiceName("page");
+        encoder.setExtension("htm");
+
+        encoder.encode(e);
+
+        verifyControls();
+    }
+    
     public void testEncodeInNamespace()
     {
         MockControl control = newControl(ServiceEncoding.class);
@@ -158,6 +184,28 @@
 
         PageServiceEncoder encoder = new PageServiceEncoder();
         encoder.setExtension("html");
+        encoder.setServiceName("page");
+
+        encoder.decode(e);
+
+        verifyControls();
+    }
+    
+    public void testDecodeHtmSuccess()
+    {
+        MockControl control = newControl(ServiceEncoding.class);
+        ServiceEncoding e = (ServiceEncoding) control.getMock();
+
+        e.getServletPath();
+        control.setReturnValue("/Home.htm");
+
+        e.setParameterValue(ServiceConstants.SERVICE, "page");
+        e.setParameterValue(ServiceConstants.PAGE, "Home");
+
+        replayControls();
+
+        PageServiceEncoder encoder = new PageServiceEncoder();
+        encoder.setExtension("htm");
         encoder.setServiceName("page");
 
         encoder.decode(e);



Mime
View raw message