You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2006/02/10 07:09:17 UTC
svn commit: r376573 - in /jakarta/tapestry/trunk: ./ config/ eclipse/
examples/TimeTracker/ examples/TimeTracker/src/config/
examples/TimeTracker/src/context/ examples/TimeTracker/src/context/WEB-INF/
examples/TimeTracker/src/context/css/ examples/Time...
Author: jkuhnert
Date: Thu Feb 9 22:09:15 2006
New Revision: 376573
URL: http://svn.apache.org/viewcvs?rev=376573&view=rev
Log:
Added a lot more commons dependencies, initial db setup for tracker demo.
Added:
jakarta/tapestry/trunk/examples/TimeTracker/src/config/createDatabase.sql
jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Home.properties
jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/log4j.properties
jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.db.xml
jakarta/tapestry/trunk/examples/TimeTracker/src/context/css/forms.css
jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/
jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/
jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/
jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/
jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/
jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/DataSourceProxyFactory.java
jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/DatabaseInstaller.java
jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/JdbcConnectionProxy.java
Removed:
jakarta/tapestry/trunk/eclipse/Tapestry-AjaxWorkbench.launch
Modified:
jakarta/tapestry/trunk/.classpath
jakarta/tapestry/trunk/config/common.properties
jakarta/tapestry/trunk/eclipse/Tapestry-TimeTracker.launch
jakarta/tapestry/trunk/examples/TimeTracker/build.xml
jakarta/tapestry/trunk/examples/TimeTracker/src/context/Home.html
jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html
jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.jwc
jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.properties
jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/hivemodule.xml
jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.application
jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/web.xml
jakarta/tapestry/trunk/examples/TimeTracker/src/context/css/timetracker.css
jakarta/tapestry/trunk/src/documentation/content/xdocs/dev.xml
Modified: jakarta/tapestry/trunk/.classpath
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/.classpath?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
Binary files - no diff available.
Modified: jakarta/tapestry/trunk/config/common.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/config/common.properties?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/config/common.properties (original)
+++ jakarta/tapestry/trunk/config/common.properties Thu Feb 9 22:09:15 2006
@@ -18,7 +18,12 @@
codec.version=1.3
fileupload.version=1.0
logging.version=1.0.4
+dbcp.version=1.2
+pool.version=1.2
+collections.version=3.1
oro.version=2.0.8
servlet.version=2.3
log4j.version=1.2.8
-jboss-j2ee.version=4.0.0DR4
\ No newline at end of file
+jboss-j2ee.version=4.0.0DR4
+derby.version=10.1.2.1
+io.version=1.1
\ No newline at end of file
Modified: jakarta/tapestry/trunk/eclipse/Tapestry-TimeTracker.launch
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/eclipse/Tapestry-TimeTracker.launch?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/eclipse/Tapestry-TimeTracker.launch (original)
+++ jakarta/tapestry/trunk/eclipse/Tapestry-TimeTracker.launch Thu Feb 9 22:09:15 2006
@@ -4,6 +4,8 @@
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.mortbay.start.Main"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="jakarta-tapestry" path="1" type="4"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/jakarta-tapestry/ext-package/lib/commons-dbcp-1.2.jar" path="3" type="2"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/jakarta-tapestry/ext-package/lib/derby-10.1.2.1.jar" path="3" type="2"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento project="jakarta-tapestry"/> </runtimeClasspathEntry> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.USER_LIBRARY/JETTY6_LIB" path="3" type="4"/> "/>
</listAttribute>
Modified: jakarta/tapestry/trunk/examples/TimeTracker/build.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/build.xml?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/build.xml (original)
+++ jakarta/tapestry/trunk/examples/TimeTracker/build.xml Thu Feb 9 22:09:15 2006
@@ -21,7 +21,7 @@
<property name="module.javac.target" value="1.5"/>
<property name="module.javac.source" value="1.5"/>
<property name="javadoc.package" value="org.apache.tapestry.timetracker.*"/>
-
+
<property name="root.dir" value="../.."/>
<property file="${root.dir}/config/build.properties"/>
<property file="${root.dir}/config/common.properties"/>
@@ -36,8 +36,12 @@
<ibiblio-dependency artifact="commons-codec" version="${codec.version}" group="commons-codec" use="run"/>
<ibiblio-dependency artifact="commons-fileupload" version="${fileupload.version}" group="commons-fileupload" use="run"/>
- <ibiblio-dependency artifact="commons-logging" version="${logging.version}" group="commons-logging" use="run"/>
-
+ <ibiblio-dependency artifact="commons-logging" version="${logging.version}" group="commons-logging" use="run"/>
+ <ibiblio-dependency artifact="commons-dbcp" version="${dbcp.version}" group="commons-dbcp" use="run"/>
+ <ibiblio-dependency artifact="commons-io" version="${io.version}" group="commons-io" use="run"/>
+ <ibiblio-dependency artifact="commons-pool" version="${pool.version}" group="commons-pool" use="run"/>
+ <ibiblio-dependency artifact="commons-collections" version="${collections.version}" group="commons-collections" use="run"/>
+
<ibiblio-dependency artifact="hivemind" version="${hivemind.version}" group="hivemind" use="run"/>
<ibiblio-dependency artifact="hivemind-lib" version="${hivemind.version}" group="hivemind" use="run"/>
<ibiblio-dependency artifact="javassist" version="${javassist.version}" group="jboss" use="run"/>
@@ -45,6 +49,8 @@
<ibiblio-dependency artifact="ognl" version="${ognl.version}" group="ognl" use="run"/>
<ibiblio-dependency artifact="oro" version="${oro.version}" group="oro" use="run"/>
<ibiblio-dependency artifact="servletapi" version="${servlet.version}" group="servletapi"/>
+
+ <ibiblio-dependency artifact="derby" version="${derby.version}" group="org.apache.derby"/>
</target>
</project>
Added: jakarta/tapestry/trunk/examples/TimeTracker/src/config/createDatabase.sql
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/config/createDatabase.sql?rev=376573&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/config/createDatabase.sql (added)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/config/createDatabase.sql Thu Feb 9 22:09:15 2006
@@ -0,0 +1,8 @@
+create table projects (
+ project_id integer not null generated always as identity(start with 100, increment by 1),
+ name varchar(40) not null,
+);
+
+insert into projects(name) values ('Code Zeitgeist');
+insert into projects(name) values ('Zooland Systems');
+insert into projects(name) values ('Weedasher Industries');
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/TimeTracker/src/context/Home.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/Home.html?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/Home.html (original)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/Home.html Thu Feb 9 22:09:15 2006
@@ -1,15 +1,36 @@
<span jwcid="@Border">
-<p>This is the Tapestry Workbench. It is a testing ground for Tapestry.
-Each tab above links to a new page, or set of pages, that demonstrate Tapestry components and
-features.
+<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>The check box control below is used to enable or disable the display of request information. This is
-a detailed description of incoming request and session data, the same as provided by
-the Tapestry Inspector. This is very useful when trying to understand or debug a form component.
-
-<p>The Tapestry icon in the lower right corner raises the Tapestry Inspector in a new window.
-The Inspector is a mini-application used
-to explore a running Tapestry application.
+<form >
+ <fieldset>
+ <legend><span jwcid="@Insert" value="message:new.task"/></legend>
+ <div class="fm-hopt">
+ <label for="fm-state">Project</label>
+ <select id="fm-state" name="fm-state">
+ <option value="" selected="selected">Select..</option>
+ <option value="UNK">Tapestry</option>
+ <option value="AL">Code zigest</option>
+ </select>
+ </div>
+ <div class="fm-hreq">
+ <label for="fm-firstname">Start</label>
+ <input style="width:auto" size="10" name="fm-firstname" id="fm-firstname" type="text" />
+ </div>
+ <div class="fm-hopt">
+ <label for="fm-middlename">End</label>
+ <input style="width:auto" size="10" id="fm-middlename" name="fm-middlename" type="text" />
+ </div>
+ <div class="fm-hreq">
+ <label for="fm-lastname">Description</label>
+ <input name="fm-lastname" id="fm-lastname" type="text" />
+ </div>
+ <div id="fm-hsubmit" class="fm-req">
+ <input name="Submit" value="add" type="submit" />
+ </div>
+ </fieldset>
+</form>
</span>
Modified: jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html (original)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.html Thu Feb 9 22:09:15 2006
@@ -2,11 +2,26 @@
<link rel="shortcut icon" href="favicon.ico" type="image/gif" />
<link href="css/timetracker.css" rel="stylesheet" type="text/css" media="all" />
+<link href="css/forms.css" rel="stylesheet" type="text/css" media="all" />
<body jwcid="@Body">
-<h2>Home</h2>
-This is home.
-again again
+<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>
+
</body>
+
</html>
Modified: jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.jwc
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.jwc?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.jwc (original)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.jwc Thu Feb 9 22:09:15 2006
@@ -21,4 +21,5 @@
<component-specification allow-informal-parameters="no">
+ <inject property="conn" object="service:timetracker.db.DerbyConnection" />
</component-specification>
Modified: jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.properties?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.properties (original)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Border.properties Thu Feb 9 22:09:15 2006
@@ -12,3 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
window.title=Tapestry TimeTracker
+
+header.display=Tapestry TimeTracker
\ No newline at end of file
Added: jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Home.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Home.properties?rev=376573&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Home.properties (added)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/Home.properties Thu Feb 9 22:09:15 2006
@@ -0,0 +1 @@
+new.task=Task Entry
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/hivemodule.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/hivemodule.xml?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/hivemodule.xml (original)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/hivemodule.xml Thu Feb 9 22:09:15 2006
@@ -17,6 +17,9 @@
<module id="timetracker" version="1.0.0" package="org.apache.tapestry.timetracker">
+ <contribution configuration-id="hivemind.EagerLoad">
+ <load service-id="timetracker.db.DatabaseInstaller" />
+ </contribution>
-
+ <sub-module descriptor="timetracker.db.xml" />
</module>
Added: jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/log4j.properties
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/log4j.properties?rev=376573&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/log4j.properties (added)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/log4j.properties Thu Feb 9 22:09:15 2006
@@ -0,0 +1,29 @@
+# Copyright 2005 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+log4j.rootCategory=DEBUG, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%c{1} [%p] %m%n
+
+log4j.category.org.apache.hivemind=WARN
+log4j.category.hivemind=DEBUG
+
+log4j.category.org.apache.tapestry.ApplicationServlet=info
+
+log4j.category.org.apache.tapestry.timetracker=debug
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.application
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.application?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.application (original)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.application Thu Feb 9 22:09:15 2006
@@ -19,13 +19,7 @@
"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
-<application name="Tapestry Ajax Component Workbench">
- <meta key="org.apache.tapestry.visit-class" value="org.apache.tapestry.ajaxworkbench.Visit"/>
- <meta key="org.apache.tapestry.template-encoding" value="ISO-8859-1"/>
- <meta key="org.apache.tapestry.page-class-packages" value="org.apache.tapestry.ajaxworkbench"/>
- <meta key="org.apache.tapestry.component-class-packages" value="org.apache.tapestry.ajaxworkbench.components"/>
-
- <extension name="org.apache.tapestry.request-decoder" class="org.apache.tapestry.ajaxworkbench.RequestDecoder"/>
+<application name="Tapestry TimeTracker">
<library id="contrib" specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>
</application>
Added: jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.db.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.db.xml?rev=376573&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.db.xml (added)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/timetracker.db.xml Thu Feb 9 22:09:15 2006
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 2004, 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<module id="timetracker.db" version="1.0.0"
+ package="org.apache.tapestry.timetracker.jdbc">
+
+ <contribution configuration-id="hivemind.SymbolSources">
+ <source name="SystemProps" before="*"
+ class="org.apache.hivemind.impl.SystemPropertiesSymbolSource" />
+ </contribution>
+
+ <service-point id="DerbyConnProxyFactory"
+ interface="org.apache.hivemind.ServiceImplementationFactory"
+ parameters-occurs="none">
+ Core service implementation factory that constructs dynamic
+ proxies to dbcp connection pools
+ <invoke-factory service-id="hivemind.BuilderFactory">
+ <construct class="DataSourceProxyFactory" autowire-services="false">
+ <set-service property="dataSource" service-id="DerbyDataSource" />
+ </construct>
+ </invoke-factory>
+ </service-point>
+
+ <service-point id="DerbyDataSource"
+ interface="org.apache.commons.dbcp.BasicDataSource"
+ parameters-occurs="none">
+
+ Basic apache database pool service.
+ <invoke-factory service-id="hivemind.BuilderFactory">
+ <construct
+ class="org.apache.commons.dbcp.BasicDataSource">
+ <set property="driverClassName"
+ value="org.apache.derby.jdbc.EmbeddedDriver" />
+ <set property="url"
+ value="jdbc:derby:${java.io.tmpdir}/tapestry-timetrackerdb;create=true" />
+ <set property="initialSize" value="1" />
+ <set property="maxActive" value="2" />
+ <set property="maxWait" value="40000" />
+ <set property="poolPreparedStatements" value="true" />
+ <set property="maxOpenPreparedStatements" value="20" />
+ </construct>
+ </invoke-factory>
+ </service-point>
+
+ <service-point id="DerbyConnection" interface="java.sql.Connection">
+ DB Connection for derby database
+ <invoke-factory service-id="DerbyConnProxyFactory" model="threaded" />
+ </service-point>
+
+ <service-point id="DatabaseInstaller" interface="DatabaseInstaller">
+ Ensures the database has been created/initialised.
+ <invoke-factory service-id="hivemind.BuilderFactory">
+ <construct class="DatabaseInstaller" autowire-services="false">
+ <set-service property="connection" service-id="DerbyConnection" />
+ <set property="filePath" value="src/config/createDatabase.sql" />
+ </construct>
+ </invoke-factory>
+ </service-point>
+
+</module>
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/web.xml?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/web.xml (original)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/WEB-INF/web.xml Thu Feb 9 22:09:15 2006
@@ -33,10 +33,6 @@
<servlet>
<servlet-name>timetracker</servlet-name>
<servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
- <init-param>
- <param-name>TreeRootDir</param-name>
- <param-value>/</param-value>
- </init-param>
<load-on-startup>0</load-on-startup>
</servlet>
Added: jakarta/tapestry/trunk/examples/TimeTracker/src/context/css/forms.css
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/css/forms.css?rev=376573&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/css/forms.css (added)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/css/forms.css Thu Feb 9 22:09:15 2006
@@ -0,0 +1,165 @@
+/* Styles */
+form {
+ margin: 0;
+ padding: 0;
+}
+
+fieldset {
+ margin: 1em 0;
+ float: left;
+}
+
+legend {
+ margin-bottom: 0.7em;
+ padding: 0 .5em;
+ color: #036;
+ background: transparent;
+ font-size: 1.3em;
+ font-weight: bold;
+ float: left;
+ border-bottom: 1px solid #ccc;;
+ padding: 0 .5em;
+}
+
+label {
+ float: left;
+ width: 100px;
+ padding: 0 1em;
+ text-align: right;
+}
+
+fieldset div {
+ margin-bottom: .5em;
+ padding: 0;
+ display: block;
+}
+
+fieldset div input,fieldset div textarea {
+ width: 150px;
+ border-top: 1px solid #555;
+ border-left: 1px solid #555;
+ border-bottom: 1px solid #ccc;
+ border-right: 1px solid #ccc;
+ padding: 1px;
+ color: #333;
+}
+
+fieldset div select {
+ padding: 1px;
+}
+
+div.fm-multi div {
+ margin: 5px 0;
+}
+
+div.fm-multi input {
+ width: 1em;
+}
+
+div.fm-multi label {
+ display: block;
+ width: 200px;
+ padding-left: 5em;
+ text-align: left;
+}
+
+#fm-submit {
+ clear: both;
+ padding-top: 1em;
+ text-align: center;
+}
+
+#fm-submit input {
+ border: 1px solid #333;
+ padding: 2px 1em;
+ background: #555;
+ color: #fff;
+ font-size: 100%;
+}
+
+input:focus,textarea:focus {
+ background: #D6AE33;
+ color: #000;
+}
+
+fieldset div input:focus,fieldset div textarea:focus {
+ border-top: 1px solid #292929;
+ border-left: 1px solid #292929;
+}
+
+/* required fields - does not work in IE */
+fieldset div.fm-req,fieldset div.fm-hreq {
+ font-weight: bold;
+}
+
+fieldset div.fm-req label:before,fieldset div.fm-hreq label:before {
+ content: "* "; /* does not work in IE */
+}
+
+div.fm-hopt,div.fm-hreq {
+ clear: none;
+ float: left;
+ margin-right: 1em;
+ margin-bottom: 1em;
+}
+
+div.fm-hopt label,div.fm-hreq label {
+ width: auto;
+ padding-left: 0px;
+ padding-bottom: 0.2em;
+}
+
+div.fm-hopt input,div.fm-hreq input {
+ clear: left;
+ float: left;
+}
+
+div.fm-hopt select,div.fm-hreq select {
+ clear: left;
+ float: left;
+}
+
+div.fm-hopt a {
+ clear: left;
+ float: left;
+}
+
+#fm-hsubmit {
+ text-align: center;
+ padding-top: 14px;
+ margin-right: 0.5em;
+ float: left;
+ width:auto;
+}
+
+#fm-hsubmitsec {
+ text-align: center;
+ padding-top: 14px;
+ margin-right: 0.5em;
+ float: left;
+}
+
+#fm-hsubmit input {
+ border: 1px solid #292929;
+ padding: 2px 1em;
+ background: #2A78B0;
+ color: #fff;
+ font-size: 100%;
+ float: left;
+ clear: left;
+ width:auto;
+}
+
+#fm-hsubmitsec input {
+ border: 1px solid #aaaaaa;
+ padding: 2px 1em;
+ background: #D4D4D4;
+ color: #555555;
+ font-size: 100%;
+ float: left;
+ clear: left;
+}
+
+#fm-hsubmit .dialog,#fm-hsubmitsec .dialog {
+ float: right;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/TimeTracker/src/context/css/timetracker.css
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/context/css/timetracker.css?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/context/css/timetracker.css (original)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/context/css/timetracker.css Thu Feb 9 22:09:15 2006
@@ -1,18 +1,86 @@
@import url("undohtml.css"); /* CSS to undo some default browser css that gets in the way more than it helps */
body {
- width: 100%;
+ width: auto;
+ margin-left: 3%;
}
body, td, th {
- font-family: Lucida Grande, Tahoma, Verdana, Arial, sans-serif;
- font-size: 9pt;
+ font-family: Lucida Grande, Tahoma, Verdana, Arial, sans-serif;
+ font-size: 9pt;
+ color: #292929;
+ margin-left: 3%;
+}
+
+p {
+ margin-bottom: 8px;
}
.even {
- background-color: #f0f0f0;
+ background-color: #f0f0f0;
}
.odd {
- background-color: #f9f9f9;
+ background-color: #f9f9f9;
+}
+
+#header {
+ border-bottom: 2px solid #D6D6D6;
+ height: 5em;
+}
+
+.headertxt {
+ font-size: 26pt;
+ letter-spacing: 0.2em;
+ color: #2A78B0;
+ position:fixed:
+ left: -4em;
+ display:block;
+}
+
+#navigation {
+ background: #215E8A;
+ display:block;
+ float:left;
+ clear:both;
+ width:100%;
+}
+
+#navigation ul li {
+ display: block;
+ float: left;
+ list-style: none;
+ margin-right: 5px;
+}
+
+#navigation ul li {
+
+}
+
+#navigation ul li a {
+ text-decoration: none;
+ padding-right: 5px;
+ padding-left: 5px;
+ padding-top:6px;
+ padding-bottom: 3px;
+ display: block;
+ color: #D6D6D6;
+ font-weight: bold;
+}
+
+#navigation ul li a:hover {
+ background: #D6AE33;
+ color: #292929;
+}
+
+#navigation ul li a.here {
+ background: #2A78B0;
+}
+
+#content {
+ padding-top: 6px;
+ padding-left: 6px;
+ padding-right: 6px;
+ float:left;
+ clear:both;
}
Added: jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/DataSourceProxyFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/DataSourceProxyFactory.java?rev=376573&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/DataSourceProxyFactory.java (added)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/DataSourceProxyFactory.java Thu Feb 9 22:09:15 2006
@@ -0,0 +1,84 @@
+// Copyright 2004, 2005 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package org.apache.tapestry.timetracker.jdbc;
+
+import java.lang.reflect.Proxy;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.commons.logging.Log;
+import org.apache.hivemind.Discardable;
+import org.apache.hivemind.ServiceImplementationFactory;
+import org.apache.hivemind.ServiceImplementationFactoryParameters;
+import org.apache.hivemind.events.RegistryShutdownListener;
+
+
+/**
+ * Wrapper around jdbc {@link BasicDataSource} pools for providing
+ * transaction aware connection pooling services to hivemind.
+ *
+ * @author jkuhnert
+ */
+public class DataSourceProxyFactory implements ServiceImplementationFactory,
+RegistryShutdownListener
+{
+ /* logger */
+ protected Log _log;
+ /* jdbc pool */
+ protected BasicDataSource _dataSource;
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object createCoreServiceImplementation(ServiceImplementationFactoryParameters parms)
+ {
+ if (_dataSource == null)
+ throw new IllegalStateException("No dataSource configured for factory.");
+
+ _log = parms.getLog();
+ try {
+ _log.debug("Opening connection ");
+ Connection conn = _dataSource.getConnection();
+
+ return Proxy.newProxyInstance(this.getClass()
+ .getClassLoader(), new Class[] { Connection.class,
+ Discardable.class }, new JdbcConnectionProxy(_log, conn));
+ } catch (SQLException e) {
+ _log.fatal("Unable to create a new DB connection", e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void registryDidShutdown()
+ {
+ try {
+ _dataSource.close();
+ } catch (Throwable t) {
+ _log.error("Error shutting down dataSource", t);
+ }
+ }
+
+ /**
+ * Sets the data source.
+ * @param dataSource
+ */
+ public void setDataSource(BasicDataSource dataSource)
+ {
+ _dataSource = dataSource;
+ }
+}
Added: jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/DatabaseInstaller.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/DatabaseInstaller.java?rev=376573&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/DatabaseInstaller.java (added)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/DatabaseInstaller.java Thu Feb 9 22:09:15 2006
@@ -0,0 +1,124 @@
+// Copyright 2004, 2005 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package org.apache.tapestry.timetracker.jdbc;
+
+import java.io.File;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+/**
+ * Checks the database instance running against for correct table
+ * setup, if it can't find any of the required tables will install
+ * them manually.
+ *
+ * @author jkuhnert
+ */
+public class DatabaseInstaller
+{
+ /** File ISO format. */
+ public static final String ISO_FORMAT = "ISO8859_1";
+ protected static Log _log = LogFactory.getLog(DatabaseInstaller.class);
+
+ /** threaded db conn. */
+ protected Connection _conn;
+ /** db installer file path. */
+ protected String _filePath;
+
+ /** default constructor. */
+ public DatabaseInstaller() { }
+
+ /**
+ * Invoked to cause initialization of db checks.
+ */
+ public void initialise()
+ throws Exception
+ {
+ assert _filePath != null;
+
+ if (!tablesExist())
+ createDatabase();
+ }
+
+ /**
+ * Checks for existance of database tables.
+ * @return True, if any row exists in a table called "projects".
+ * @throws SQLException
+ */
+ public boolean tablesExist()
+ throws SQLException
+ {
+ PreparedStatement ps = null;
+ ResultSet rs = null;
+
+ try {
+ ps = _conn.prepareStatement("select 'X' from projects");
+ rs = ps.executeQuery();
+
+ return rs.next();
+
+ } finally {
+ try { if (rs != null) rs.close(); } catch (Exception e) { }
+ try { if (ps != null) ps.close(); } catch (Exception e) { }
+ }
+ }
+
+ /**
+ * Creates the database by reading in a sql creation file
+ * and running the contents found within on the connected
+ * database.
+ * @throws Exception If any io/db errors occur.
+ */
+ protected void createDatabase()
+ throws Exception
+ {
+ PreparedStatement ps = null;
+ try {
+
+ ps = _conn.prepareStatement(FileUtils.readFileToString(new File(_filePath), ISO_FORMAT));
+ ps.execute();
+
+ } catch (Throwable t) {
+ _log.error("Error creating database.", t);
+ try { if (_conn != null) _conn.rollback(); } catch (Exception e) { }
+ throw new RuntimeException(t);
+ } finally {
+ try { if (ps != null) ps.close(); } catch (Exception e) { }
+ }
+ }
+
+ /**
+ * Sets db connection.
+ * @param conn
+ */
+ public void setConnection(Connection conn)
+ {
+ _conn = conn;
+ }
+
+ /**
+ * Sets the createDatabase.sql file path.
+ * @param filePath
+ */
+ public void setFilePath(String filePath)
+ {
+ _filePath = filePath;
+ }
+}
Added: jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/JdbcConnectionProxy.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/JdbcConnectionProxy.java?rev=376573&view=auto
==============================================================================
--- jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/JdbcConnectionProxy.java (added)
+++ jakarta/tapestry/trunk/examples/TimeTracker/src/java/org/apache/tapestry/timetracker/jdbc/JdbcConnectionProxy.java Thu Feb 9 22:09:15 2006
@@ -0,0 +1,113 @@
+// Copyright 2004, 2005 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package org.apache.tapestry.timetracker.jdbc;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.apache.commons.logging.Log;
+import org.apache.hivemind.Discardable;
+
+
+/**
+ * Wraps {@link Connection} to provide hivemind threaded connection
+ * services.
+ *
+ * @author jkuhnert
+ */
+public class JdbcConnectionProxy implements InvocationHandler, Discardable
+{
+
+ /* Logger */
+ protected Log _log;
+ /* connection */
+ protected Connection _conn;
+ /* Intercepts close method calls */
+ protected Method closeMethod;
+
+ /**
+ * Creates a new proxy wrapping the provided {@link Connection}.
+ * @param log
+ * @param conn
+ * @throws SQLException
+ */
+ public JdbcConnectionProxy(Log log, Connection conn)
+ throws SQLException
+ {
+ _log = log;
+ _conn = conn;
+
+ try {
+ closeMethod = this.getClass().getDeclaredMethod("threadDidDiscardService", (Class[])null);
+ } catch (Exception et) {
+ throw new RuntimeException(et);
+ }
+
+ _conn.setAutoCommit(false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable
+ {
+ try {
+ if (method.getName().equals("threadDidDiscardService"))
+ return closeMethod.invoke(this, args);
+ else if (method.getName().equals("close")) {
+ _log.debug("Doing nice connection close.");
+ return closeMethod.invoke(this, args);
+ }
+
+ return method.invoke(_conn, args);
+ } catch (IllegalAccessException e) {
+ _log.error(e);
+ throw e;
+ } catch (InvocationTargetException e) {
+ _log.error("Error ocurred in invoker, rolling back any pending db transaction.", e);
+ try { if (_conn != null) _conn.rollback(); } catch (Exception et) { }
+ closeMethod.invoke(this, new Object[0]);
+ throw e.getTargetException();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void threadDidDiscardService()
+ {
+ try {
+ if (_log.isDebugEnabled())
+ _log.debug("threadDidDiscardService(): Closing connection: " + _conn.isClosed());
+
+ if (!_conn.isClosed()) {
+ if (!_conn.getAutoCommit()) {
+ if (_log.isDebugEnabled())
+ _log.debug("Committing uncommitted transaction.");
+ _conn.commit();
+ }
+ }
+ } catch (SQLException e) {
+ _log.error("SQL error cleaning up connection, rolling back transaction(if any).", e);
+ try { if (_conn != null) _conn.rollback(); } catch (Exception et) { }
+ } finally {
+ try { if (_conn != null) _conn.close(); } catch (Exception e) { }
+ }
+ }
+
+}
Modified: jakarta/tapestry/trunk/src/documentation/content/xdocs/dev.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/src/documentation/content/xdocs/dev.xml?rev=376573&r1=376572&r2=376573&view=diff
==============================================================================
--- jakarta/tapestry/trunk/src/documentation/content/xdocs/dev.xml (original)
+++ jakarta/tapestry/trunk/src/documentation/content/xdocs/dev.xml Thu Feb 9 22:09:15 2006
@@ -93,5 +93,14 @@
and has added a suite of WML components to the framework.</p>
</section>
+<section>
+ <title>Jesse Kuhnert</title>
+ <p>
+ Jesse initially cut his teeth working on a component project for tapestry called
+ <link href="http://tacos.sourceforge.net"/>Tacos</link>. He is currently working
+ on ajax specfic features in tapestry, as well as wherever else he can.
+ </p>
+</section>
+
</body>
</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org