Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1322 - in development/main/planet/facilities/http: . api/src/main/net/dpml/http api/src/main/net/dpml/planet blocks blocks/demo/src/main/net/dpml/planet/playground blocks/tapestry blocks/webappserver documentation documentation/src documentation/src/docs examples examples/hangman examples/hangman/api examples/hangman/api/src examples/hangman/api/src/main examples/hangman/api/src/main/net examples/hangman/api/src/main/net/dpml examples/hangman/api/src/main/net/dpml/http examples/hangman/api/src/main/net/dpml/http/hangman examples/hangman/app examples/hangman/app/etc examples/hangman/app/etc/deliverables examples/hangman/app/etc/deliverables/confs examples/hangman/block examples/hangman/etc examples/hangman/game examples/hangman/game/src examples/hangman/game/src/main examples/hangman/game/src/main/net examples/hangman/game/src/main/net/dpml examples/hangman/game/src/main/net/dpml/http examples/hangman/game/src/main/net/dpml/http/hangman examples/hangman/game/src/main/net/dpml/http/hangman/impl examples/hangman/src examples/hangman/view examples/hangman/view/etc examples/hangman/view/etc/deliverables examples/hangman/view/etc/deliverables/confs examples/hangman/view/src examples/hangman/view/src/main examples/hangman/view/src/main/net examples/hangman/view/src/main/net/dpml examples/hangman/view/src/main/net/dpml/http examples/hangman/view/src/main/net/dpml/http/hangman examples/hangman/view/src/main/net/dpml/http/hangman/view examples/hangman/view/src/web examples/hangman/view/src/web/WEB-INF examples/hangman/view/src/web/css examples/hangman/view/src/web/images impl/src/main/net/dpml/http/impl impl/src/main/net/dpml/planet spi/src/main/net/dpml/planet util/src/main/net/dpml/planet

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1322 - in development/main/planet/facilities/http: . api/src/main/net/dpml/http api/src/main/net/dpml/planet blocks blocks/demo/src/main/net/dpml/planet/playground blocks/tapestry blocks/webappserver documentation documentation/src documentation/src/docs examples examples/hangman examples/hangman/api examples/hangman/api/src examples/hangman/api/src/main examples/hangman/api/src/main/net examples/hangman/api/src/main/net/dpml examples/hangman/api/src/main/net/dpml/http examples/hangman/api/src/main/net/dpml/http/hangman examples/hangman/app examples/hangman/app/etc examples/hangman/app/etc/deliverables examples/hangman/app/etc/deliverables/confs examples/hangman/block examples/hangman/etc examples/hangman/game examples/hangman/game/src examples/hangman/game/src/main examples/hangman/game/src/main/net examples/hangman/game/src/main/net/dpml examples/hangman/game/src/main/net/dpml/http examples/hangman/game/src/main/net/dpml/http/hangman examples/hangman/game/src/main/net/dpml/http/hangman/impl examples/hangman/src examples/hangman/view examples/hangman/view/etc examples/hangman/view/etc/deliverables examples/hangman/view/etc/deliverables/confs examples/hangman/view/src examples/hangman/view/src/main examples/hangman/view/src/main/net examples/hangman/view/src/main/net/dpml examples/hangman/view/src/main/net/dpml/http examples/hangman/view/src/main/net/dpml/http/hangman examples/hangman/view/src/main/net/dpml/http/hangman/view examples/hangman/view/src/web examples/hangman/view/src/web/WEB-INF examples/hangman/view/src/web/css examples/hangman/view/src/web/images impl/src/main/net/dpml/http/impl impl/src/main/net/dpml/planet spi/src/main/net/dpml/planet util/src/main/net/dpml/planet
  • Date: Thu, 30 Dec 2004 06:53:47 +0100

Author: niclas
Date: Thu Dec 30 06:53:47 2004
New Revision: 1322

Added:

development/main/planet/facilities/http/api/src/main/net/dpml/http/ServletHandler.java
(contents, props changed)
development/main/planet/facilities/http/documentation/
development/main/planet/facilities/http/documentation/build.properties
(contents, props changed)
development/main/planet/facilities/http/documentation/build.xml
(contents, props changed)
development/main/planet/facilities/http/documentation/src/
development/main/planet/facilities/http/documentation/src/docs/

development/main/planet/facilities/http/documentation/src/docs/HttpFacility.xml
(contents, props changed)

development/main/planet/facilities/http/documentation/src/docs/components.xml
(contents, props changed)
development/main/planet/facilities/http/documentation/src/docs/hangman.xml
(contents, props changed)
development/main/planet/facilities/http/documentation/src/docs/intro.xml
(contents, props changed)

development/main/planet/facilities/http/documentation/src/docs/listeners.xml
(contents, props changed)

development/main/planet/facilities/http/documentation/src/docs/servlets.xml
(contents, props changed)

development/main/planet/facilities/http/documentation/src/docs/tapestry.xml
(contents, props changed)
development/main/planet/facilities/http/documentation/src/docs/webapps.xml
(contents, props changed)
development/main/planet/facilities/http/examples/hangman/api/
development/main/planet/facilities/http/examples/hangman/api/build.xml
(contents, props changed)
development/main/planet/facilities/http/examples/hangman/api/src/
development/main/planet/facilities/http/examples/hangman/api/src/main/
development/main/planet/facilities/http/examples/hangman/api/src/main/net/

development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/

development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/

development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/

development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/Controller.java
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/Dictionary.java
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/Game.java
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/GameException.java
(contents, props changed)
development/main/planet/facilities/http/examples/hangman/app/
development/main/planet/facilities/http/examples/hangman/app/build.xml
(contents, props changed)
development/main/planet/facilities/http/examples/hangman/app/etc/

development/main/planet/facilities/http/examples/hangman/app/etc/deliverables/

development/main/planet/facilities/http/examples/hangman/app/etc/deliverables/confs/

development/main/planet/facilities/http/examples/hangman/app/etc/deliverables/confs/webapp.conf
development/main/planet/facilities/http/examples/hangman/block/
development/main/planet/facilities/http/examples/hangman/block/build.xml
(contents, props changed)
development/main/planet/facilities/http/examples/hangman/game/
development/main/planet/facilities/http/examples/hangman/game/build.xml
(contents, props changed)
development/main/planet/facilities/http/examples/hangman/game/src/
development/main/planet/facilities/http/examples/hangman/game/src/main/
development/main/planet/facilities/http/examples/hangman/game/src/main/net/

development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/

development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/

development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/

development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/impl/

development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/impl/HangmanController.java
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/impl/HangmanGame.java
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/impl/HardCodedDictionary.java
(contents, props changed)
development/main/planet/facilities/http/examples/hangman/view/
development/main/planet/facilities/http/examples/hangman/view/build.xml
(contents, props changed)
development/main/planet/facilities/http/examples/hangman/view/etc/

development/main/planet/facilities/http/examples/hangman/view/etc/deliverables/

development/main/planet/facilities/http/examples/hangman/view/etc/deliverables/confs/
development/main/planet/facilities/http/examples/hangman/view/etc/web.xml
(contents, props changed)
development/main/planet/facilities/http/examples/hangman/view/src/
development/main/planet/facilities/http/examples/hangman/view/src/main/
development/main/planet/facilities/http/examples/hangman/view/src/main/net/

development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/

development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/

development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/

development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/

development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Failed.java
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Guess.java
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Home.java
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Success.java
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Visit.java
(contents, props changed)
development/main/planet/facilities/http/examples/hangman/view/src/web/

development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/

development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Failed.html
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Failed.page

development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Guess.html
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Guess.page

development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Home.html
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Home.page

development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Success.html
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Success.page

development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/hangman.application
development/main/planet/facilities/http/examples/hangman/view/src/web/css/

development/main/planet/facilities/http/examples/hangman/view/src/web/css/hangman.css
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/

development/main/planet/facilities/http/examples/hangman/view/src/web/images/0.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/1.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/10.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/2.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/3.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/4.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/5.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/6.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/7.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/8.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/9.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/loose.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/images/win.gif
(contents, props changed)

development/main/planet/facilities/http/examples/hangman/view/src/web/index.html
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/Ajp13Listener.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ClientCertAuthenticator.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ConfigurationMimeTypes.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/DumpHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ErrorPageHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ExpiryHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/FormAuthenticator.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ForwardHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashSessionManager.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpContextImpl.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpServerImpl.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/IPAccessHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JsseListener.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/MsieSslHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NotFoundHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NullHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ProxyHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ResourceHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/RootNotFoundHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SecurityHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SetResponseHeadersHandler.xprofile
(contents, props changed)

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SocketListener.xprofile
(contents, props changed)
Removed:
development/main/planet/facilities/http/api/src/main/net/dpml/planet/
development/main/planet/facilities/http/examples/hangman/etc/
development/main/planet/facilities/http/examples/hangman/src/
development/main/planet/facilities/http/impl/src/main/net/dpml/planet/
development/main/planet/facilities/http/spi/src/main/net/dpml/planet/
development/main/planet/facilities/http/util/src/main/net/dpml/planet/
Modified:

development/main/planet/facilities/http/blocks/demo/src/main/net/dpml/planet/playground/HelloComponent.java
development/main/planet/facilities/http/blocks/index.xml
development/main/planet/facilities/http/blocks/tapestry/build.xml
development/main/planet/facilities/http/blocks/webappserver/build.xml
development/main/planet/facilities/http/examples/hangman/build.xml
development/main/planet/facilities/http/examples/index.xml

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java

development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
development/main/planet/facilities/http/index.xml
Log:
Must commit to continue the clean-up of Planet.
o Taken away the 'planet' from all the package names of facilities.
o Fixed incorrect @metro tags in Reflector.
o Refactored the Hangman example to have the Game engine as a Metro
component.


Added:
development/main/planet/facilities/http/api/src/main/net/dpml/http/ServletHandler.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/api/src/main/net/dpml/http/ServletHandler.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2004 Niclas Hedman.
+ *
+ * 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 net.dpml.http;
+
+import org.mortbay.http.HttpHandler;
+
+/**
+ * @metro.service type="net.dpml.http.Servlethandler" version="1.0"
+ */
+public interface ServletHandler extends HttpHandler
+{
+ /** Adds the contextObject into the ServletContext object.
+ *
+ */
+ void addServletContextEntry( String entryName, Object contextObject );
+}

Modified:
development/main/planet/facilities/http/blocks/demo/src/main/net/dpml/planet/playground/HelloComponent.java
==============================================================================
---
development/main/planet/facilities/http/blocks/demo/src/main/net/dpml/planet/playground/HelloComponent.java
(original)
+++
development/main/planet/facilities/http/blocks/demo/src/main/net/dpml/planet/playground/HelloComponent.java
Thu Dec 30 06:53:47 2004
@@ -15,7 +15,7 @@
* limitations under the License.
*/

-package net.dpml.planet.playground;
+package net.dpml.playground;

import java.io.IOException;
import java.io.OutputStream;

Modified: development/main/planet/facilities/http/blocks/index.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/index.xml (original)
+++ development/main/planet/facilities/http/blocks/index.xml Thu Dec 30
06:53:47 2004
@@ -24,6 +24,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-context</name>
+ <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>
@@ -35,6 +36,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-webappserver</name>
+ <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>
@@ -46,6 +48,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-server</name>
+ <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>
@@ -57,6 +60,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-basic</name>
+ <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>
@@ -68,6 +72,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-form</name>
+ <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>
@@ -79,6 +84,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-clientcert</name>
+ <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>
@@ -90,6 +96,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-hash-digest</name>
+ <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>
@@ -101,6 +108,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-demo</name>
+ <version>1.0.0</version>
<type>jar</type>
</info>
<dependencies>
@@ -116,6 +124,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-static</name>
+ <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>
@@ -127,6 +136,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-servlet</name>
+ <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>
@@ -138,6 +148,7 @@
<info>
<group>dpml/http</group>
<name>dpml-http-tapestry</name>
+ <version>1.0.0</version>
<type>block</type>
</info>
<dependencies>

Modified: development/main/planet/facilities/http/blocks/tapestry/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/tapestry/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/tapestry/build.xml Thu
Dec 30 06:53:47 2004
@@ -26,6 +26,7 @@
key="dpml-http-webappserver" feature="block"/>

<x:block name="tapestry">
+ <x:service type="net.dpml.http.ServletHandler" source="server" />
<x:include name="server" uri="${webappserver.uri}" />
</x:block>


Modified:
development/main/planet/facilities/http/blocks/webappserver/build.xml
==============================================================================
--- development/main/planet/facilities/http/blocks/webappserver/build.xml
(original)
+++ development/main/planet/facilities/http/blocks/webappserver/build.xml
Thu Dec 30 06:53:47 2004
@@ -27,11 +27,10 @@
key="dpml-http-server" feature="block"/>

<x:block name="webapp">
+ <x:service type="net.dpml.http.ServletHandler" source="context" />
<x:include name="server" uri="${server.uri}"/>
-
- <x:component name="context"
class="net.dpml.http.impl.WebApplicationContext" activation="startup" />
-
- <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" activation="startup" >
+ <x:component name="context"
class="net.dpml.http.impl.WebApplicationContext" />
+ <x:component name="request-log"
class="net.dpml.http.impl.NcsaRequestLog" >
<x:parameters>
<x:parameter name="filename" value="logs/request.log" />
<x:parameter name="append" value="true" />

Added: development/main/planet/facilities/http/documentation/build.properties
==============================================================================
--- (empty file)
+++ development/main/planet/facilities/http/documentation/build.properties
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,7 @@
+project.docs.theme=docbook.sf.net
+project.docs.output.format=html
+project.docs.output.style=chunk
+project.docs.entry-point=HttpFacility.xml
+
+project.docs.xsl.base.dir=${basedir}/target/docs/
+

Added: development/main/planet/facilities/http/documentation/build.xml
==============================================================================
--- (empty file)
+++ development/main/planet/facilities/http/documentation/build.xml Thu
Dec 30 06:53:47 2004
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2004 Niclas Hedman.
+ *
+ * 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.dpml.net/central/about/legal/
+ *
+ * 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.
+-->
+
+<project
+ name="dpml-http-docs"
+ default="install"
+ basedir="."
+ xmlns:magic="antlib:net.dpml.magic"
+ xmlns:x="plugin:dpml/magic/dpml-magic-core"
+>
+ <magic:import uri="artifact:template:dpml/magic/standard"/>
+
+ <target name="docs" depends="prepare">
+ <x:property name="spec" feature="plugin" key="dpml-magic-doc"/>
+ <magic:plugin uri="${spec}">
+ <task class="net.dpml.magic.doc.DocTask" name="docs"/>
+ </magic:plugin>
+ <docs/>
+ </target>
+
+ <target name="update" depends="docs">
+ <publish xmlns="plugin:dpml/magic/dpml-magic-publish" path="central"/>
+ </target>
+
+ <target name="install" depends="docs"/>
+
+</project>
+

Added:
development/main/planet/facilities/http/documentation/src/docs/HttpFacility.xml
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/documentation/src/docs/HttpFacility.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2004 Niclas Hedhman
+
+ 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.
+-->
+<!DOCTYPE book PUBLIC
+ "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"; [
+
+<!-- Each chapter is in its own file -->
+
+<!ENTITY chap-intro SYSTEM "intro.xml">
+<!ENTITY chap-servlets SYSTEM "servlets.xml">
+<!ENTITY chap-webapps SYSTEM "webapps.xml">
+<!ENTITY chap-listeners SYSTEM "listeners.xml">
+<!ENTITY chap-hangman SYSTEM "hangman.xml">
+<!ENTITY chap-tapestry SYSTEM "tapestry.xml">
+<!ENTITY chap-components SYSTEM "components.xml">
+]>
+
+<!-- Conventions:
+
+ Component ids are <varname>
+ Java packages and class names are <classname>
+ Tapestry component aliases are <classname>
+
+ In-line code snippets use <function>
+ Property paths and JavaBeans property names used <varname>
+-->
+<book>
+ <title>DPML Http Facility Guide</title>
+ <bookinfo>
+ <author>
+ <firstname>Niclas</firstname>
+ <surname>Hedhman</surname>
+ </author>
+ <copyright>
+ <year>2004</year>
+ <holder>Niclas Hedhman</holder>
+ <holder>Digital Product Meta Library</holder>
+ </copyright>
+ </bookinfo>
+
+ &chap-intro;
+
+ &chap-servlets;
+
+ &chap-webapps;
+
+ &chap-listeners;
+
+ &chap-components;
+
+ &chap-tapestry;
+
+ &chap-hangman;
+
+</book>

Added:
development/main/planet/facilities/http/documentation/src/docs/components.xml
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/documentation/src/docs/components.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,44 @@
+<!--
+ Copyright 2004 Niclas Hedhman
+
+ 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.
+-->
+
+<chapter id="components">
+ <title>Component Reference</title>
+ <para>
+ </para>
+
+ <section id="components.blocks">
+ <title>Prepared Blocks</title>
+ </section>
+
+ <section id="components.listeners">
+ <title>Listeners</title>
+ </section>
+
+ <section id="components.contexts">
+ <title>Contexts</title>
+ </section>
+
+ <section id="components.handlers">
+ <title>Handlers</title>
+ </section>
+
+ <section id="components.misc">
+ <title>Miscellaneous Components</title>
+ </section>
+
+</chapter>
+
+

Added:
development/main/planet/facilities/http/documentation/src/docs/hangman.xml
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/documentation/src/docs/hangman.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,36 @@
+<!--
+ Copyright 2004 Niclas Hedhman
+
+ 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.
+-->
+
+<chapter id="hangman">
+ <title>Tapestry Example - Hangman</title>
+ <para>
+ </para>
+
+ <section id="hangman.run">
+ <title>Run the Hangman application</title>
+ </section>
+
+ <section id="hangman.model">
+ <title>Hangman Application Model</title>
+ </section>
+
+ <section id="hangman.view">
+ <title>Hangman View by Tapestry</title>
+ </section>
+
+</chapter>
+
+

Added:
development/main/planet/facilities/http/documentation/src/docs/intro.xml
==============================================================================
--- (empty file)
+++ development/main/planet/facilities/http/documentation/src/docs/intro.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,31 @@
+<!--
+ Copyright 2004 Niclas Hedhman
+
+ 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.
+-->
+
+<chapter id="intro">
+ <title>Introduction to the Http Facility</title>
+ <para>
+ </para>
+
+ <section id="intro.jetty">
+ <title>Embedding Jetty</title>
+ </section>
+
+ <section id="intro.metro">
+ <title>Metro component management</title>
+ </section>
+
+</chapter>
+

Added:
development/main/planet/facilities/http/documentation/src/docs/listeners.xml
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/documentation/src/docs/listeners.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,36 @@
+<!--
+ Copyright 2004 Niclas Hedhman
+
+ 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.
+-->
+
+<chapter id="listeners">
+ <title>Servlets</title>
+ <para>
+ </para>
+
+ <section id="listeners.socket">
+ <title>Socket Listener</title>
+ </section>
+
+ <section id="listeners.ssl">
+ <title>SSL Listener</title>
+ </section>
+
+ <section id="listeners.ajp">
+ <title>Ajp Listener</title>
+ </section>
+
+</chapter>
+
+

Added:
development/main/planet/facilities/http/documentation/src/docs/servlets.xml
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/documentation/src/docs/servlets.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,28 @@
+<!--
+ Copyright 2004 Niclas Hedhman
+
+ 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.
+-->
+
+<chapter id="servlets">
+ <title>Servlets</title>
+ <para>
+ </para>
+
+ <section id="servlets.handler">
+ <title>The Servlet Handler</title>
+ </section>
+
+</chapter>
+
+

Added:
development/main/planet/facilities/http/documentation/src/docs/tapestry.xml
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/documentation/src/docs/tapestry.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,32 @@
+<!--
+ Copyright 2004 Niclas Hedhman
+
+ 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.
+-->
+
+<chapter id="tapestry">
+ <title>Introduction to the Http Facility</title>
+ <para>
+ </para>
+
+ <section id="tapestry.block">
+ <title>The Tapestry Block</title>
+ </section>
+
+ <section id="tapestry.global">
+ <title>The Global Object in Tapestry</title>
+ </section>
+
+</chapter>
+
+

Added:
development/main/planet/facilities/http/documentation/src/docs/webapps.xml
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/documentation/src/docs/webapps.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,40 @@
+
+<!--
+ Copyright 2004 Niclas Hedhman
+
+ 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.
+-->
+
+<chapter id="webapps">
+ <title>Web Applications</title>
+ <para>
+ </para>
+
+ <section id="webapps.block">
+ <title>The WebAppServer block</title>
+ </section>
+
+ <section id="webapps.contexts">
+ <title>Web applicaion contexts</title>
+ </section>
+
+ <section id="webapps.servlethandler">
+ <title>The ServletHandler interface</title>
+ </section>
+
+ <section id="webapps.wars">
+ <title>WAR files</title>
+ </section>
+
+</chapter>
+

Added: development/main/planet/facilities/http/examples/hangman/api/build.xml
==============================================================================
--- (empty file)
+++ development/main/planet/facilities/http/examples/hangman/api/build.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2004 Niclas Hedman.
+ *
+ * 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.dpml.net/central/about/legal/
+ *
+ * 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.
+-->
+
+<project name="hangman-api" default="install" basedir="."
+ xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >
+
+ <magic:import uri="artifact:template:dpml/magic/standard"/>
+
+</project>

Added:
development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/Controller.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/Controller.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,12 @@
+package net.dpml.http.hangman;
+
+
+/**
+ * @metro.service type="net.dpml.http.hangman.Controller" version="1.0"
+ */
+public interface Controller
+{
+ Game getGame( Object association );
+
+ void releaseGame( Object association );
+}

Added:
development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/Dictionary.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/Dictionary.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,13 @@
+package net.dpml.http.hangman;
+
+
+/**
+ * @metro.service type="net.dpml.http.hangman.Dictionary"
+ *
+ */
+public interface Dictionary
+{
+ /** Returns a random word from the dictionary.
+ */
+ String getRandomWord();
+}

Added:
development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/Game.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/Game.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,32 @@
+package net.dpml.http.hangman;
+
+import java.util.ArrayList;
+
+
+/**
+ * @metro.service type="net.dpml.http.hangman.Game" version="1.0"
+ *
+ */
+public interface Game
+{
+ boolean getDone();
+
+ boolean getFailed();
+
+ void guess( String sLetter )
+ throws GameException;
+
+ ArrayList getUnused();
+
+ int getMissed();
+
+ int getMaxMisses();
+
+ String getGuess();
+
+ String getCorrectWord();
+
+ void start( int m_MaxMisses );
+
+}
+

Added:
development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/GameException.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/api/src/main/net/dpml/http/hangman/GameException.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,9 @@
+package net.dpml.http.hangman;
+
+public class GameException extends Exception
+{
+ public GameException( String message )
+ {
+ super( message );
+ }
+}

Added: development/main/planet/facilities/http/examples/hangman/app/build.xml
==============================================================================
--- (empty file)
+++ development/main/planet/facilities/http/examples/hangman/app/build.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2004 Niclas Hedman.
+ *
+ * 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.dpml.net/central/about/legal/
+ *
+ * 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.
+-->
+
+<project name="hangman-app" default="install" basedir="."
+ xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >
+
+ <x:filter token="HANGMAN_WAR_URI" feature="uri" key="hangman-view" />
+
+ <magic:import uri="artifact:template:dpml/magic/standard"/>
+
+ <target name="build" depends="standard.build" >
+ <x:property name="hangman.uri" key="hangman-game" feature="block"/>
+ <x:property name="tapestry.uri" key="dpml-http-tapestry"
feature="block"/>
+ <x:property name="console.uri" key="dpml-console-default"
feature="block"/>
+
+ <x:block name="web-hangman" >
+ <x:include name="console" uri="${console.uri}" />
+ <x:include name="tapestry" uri="${tapestry.uri}" />
+ <x:include name="app" uri="${hangman.uri}" />
+ </x:block>
+ </target>
+
+</project>

Added:
development/main/planet/facilities/http/examples/hangman/app/etc/deliverables/confs/webapp.conf
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/app/etc/deliverables/confs/webapp.conf
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2004 Niclas Hedman.
+ *
+ * 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.dpml.net/central/about/legal/
+ *
+ * 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.
+-->
+
+<targets>
+
+ <target path="/web-hangman/tapestry/server/context">
+ <configuration>
+ <web-application>@HANGMAN_WAR_URI@</web-application>
+ <context-path>/hangman</context-path>
+
<defaults-descriptor>artifact:conf:dpml/http/webapp-defaults</defaults-descriptor>
+ </configuration>
+ </target>
+
+ <target path="/web-hangman/app/controller">
+ <parameters>
+ <parameter name="servlet-name" value="hangman" />
+ </parameters>
+ </target>
+</targets>
+

Added:
development/main/planet/facilities/http/examples/hangman/block/build.xml
==============================================================================
--- (empty file)
+++ development/main/planet/facilities/http/examples/hangman/block/build.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2004 Niclas Hedman.
+ *
+ * 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.dpml.net/central/about/legal/
+ *
+ * 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.
+-->
+
+<project name="hangman-block" default="install" basedir="."
+ xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >
+
+ <magic:import uri="artifact:template:dpml/magic/standard"/>
+
+</project>

Modified: development/main/planet/facilities/http/examples/hangman/build.xml
==============================================================================
--- development/main/planet/facilities/http/examples/hangman/build.xml
(original)
+++ development/main/planet/facilities/http/examples/hangman/build.xml Thu
Dec 30 06:53:47 2004
@@ -16,18 +16,9 @@
* limitations under the License.
-->

-<project name="hangman" default="install" basedir="."
+<project name="http-hangman" default="default" basedir="."
xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >

- <magic:import uri="artifact:template:dpml/magic/standard"/>
-
- <target name="build" depends="standard.build">
- <mkdir dir="target/deliverables/wars/" />
- <mkdir dir="target/lib" />
- <war destfile="target/deliverables/wars/hangman.war"
webxml="etc/web.xml">
- <fileset dir="src/web"/>
- <classes dir="target/classes"/>
- </war>
- </target>
+ <magic:import uri="artifact:template:dpml/magic/reactor"/>

</project>

Added: development/main/planet/facilities/http/examples/hangman/game/build.xml
==============================================================================
--- (empty file)
+++ development/main/planet/facilities/http/examples/hangman/game/build.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2004 Niclas Hedman.
+ *
+ * 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.dpml.net/central/about/legal/
+ *
+ * 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.
+-->
+
+<project name="hangman-game" default="install" basedir="."
+ xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >
+
+ <magic:import uri="artifact:template:dpml/magic/standard"/>
+
+ <target name="build" depends="standard.build" >
+
+ <x:block name="hangman" >
+ <x:component name="game"
class="net.dpml.http.hangman.impl.HangmanGame" />
+ <x:component name="controller"
class="net.dpml.http.hangman.impl.HangmanController" />
+ <x:component name="dictionary"
class="net.dpml.http.hangman.impl.HardCodedDictionary" />
+ </x:block>
+ </target>
+</project>

Added:
development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/impl/HangmanController.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/impl/HangmanController.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,79 @@
+package net.dpml.http.hangman.impl;
+
+import java.io.Serializable;
+import java.util.HashMap;
+
+import net.dpml.http.ServletHandler;
+
+import net.dpml.http.hangman.Game;
+import net.dpml.http.hangman.Controller;
+
+import net.dpml.logging.Logger;
+
+import net.dpml.parameters.ParameterException;
+import net.dpml.parameters.Parameters;
+
+import net.dpml.service.ServiceException;
+import net.dpml.service.ServiceManager;
+
+/**
+ *
+ * @metro.component name="hangman-controller" lifestyle="singleton"
collection="hard"
+ * @metro.service type="net.dpml.http.hangman.Controller" version="1.0"
+ */
+public class HangmanController
+ implements Controller
+{
+ private ServiceManager m_Manager;
+ private HashMap m_ActiveGames;
+ private Logger m_Logger;
+
+ /**
+ * @metro.logger name="hangman"
+ * @metro.dependency type="net.dpml.http.hangman.Game" key="game"
+ * @metro.dependency type="net.dpml.http.ServletHandler"
key="servlethandler"
+ * @metro.dependency type="net.dpml.ServletHandler" key="servlethandler"
+ */
+ public HangmanController( Logger logger, ServiceManager man, Parameters
params )
+ throws ServiceException, ParameterException
+ {
+ m_Manager = man;
+ m_Logger = logger;
+ m_ActiveGames = new HashMap();
+ ServletHandler handler = (ServletHandler) man.lookup(
"servlethandler" );
+ String name = params.getParameter( "servlet-name" );
+ String global = "org.apache.tapestry.global:" + name;
+ handler.addServletContextEntry( global, this );
+ m_Logger.info( "Added a Hangman Controller to the servlet context:"
+ handler );
+ }
+
+ private Game newGame( Object assoc )
+ {
+ try
+ {
+ m_Logger.info( "New Game started: " + assoc );
+ Game game = (Game) m_Manager.lookup( "game" );
+ m_ActiveGames.put( assoc, game );
+ return game;
+ } catch( ServiceException e )
+ {
+ throw new RuntimeException( "Unable to located the game." );
+ }
+ }
+
+ public synchronized Game getGame( Object assoc )
+ {
+ m_Logger.info( "Game retrieved: " + assoc );
+ Game game = (Game) m_ActiveGames.get( assoc );
+ if( game == null )
+ game = newGame( assoc );
+ return game;
+ }
+
+ public synchronized void releaseGame( Object assoc )
+ {
+ m_Logger.info( "Game released: " + assoc );
+ Game game = (Game) m_ActiveGames.remove( assoc );
+ m_Manager.release( game );
+ }
+}

Added:
development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/impl/HangmanGame.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/impl/HangmanGame.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,141 @@
+package net.dpml.http.hangman.impl;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+
+import net.dpml.http.hangman.Dictionary;
+import net.dpml.http.hangman.Game;
+import net.dpml.http.hangman.GameException;
+
+import net.dpml.logging.Logger;
+
+import net.dpml.service.ServiceException;
+import net.dpml.service.ServiceManager;
+
+/**
+ *
+ * @metro.component name="hangman-game" lifestyle="transient"
collection="hard"
+ * @metro.service type="net.dpml.http.hangman.Game" version="1.0"
+ */
+public class HangmanGame
+ implements Serializable, Game
+{
+ private int m_MaxMisses = 5;
+ private int m_Missed = 0;
+ private String m_CurWord = "";
+ private ArrayList m_UnusedLetters = null;
+ private String m_Guess = "";
+ private String m_GuessedRightLetters = "";
+
+ private Logger m_Logger;
+ private Dictionary m_Dictionary;
+
+ /**
+ * @metro.logger name="hangman"
+ * @metro.dependency type="net.dpml.http.hangman.Dictionary"
key="dictionary"
+ */
+ public HangmanGame( Logger logger, ServiceManager man )
+ throws ServiceException
+ {
+ m_Logger = logger;
+ m_Dictionary = (Dictionary) man.lookup( "dictionary" );
+ }
+
+ public void start( int m_MaxMisses )
+ {
+ this.m_MaxMisses = m_MaxMisses;
+ m_Missed = 0;
+
+ m_CurWord = m_Dictionary.getRandomWord();
+ m_GuessedRightLetters = "";
+
+ m_Guess = "";
+ for (int count = 0; count < m_CurWord.length(); count++) {
+ m_Guess += "_ ";
+ }
+
+ m_UnusedLetters = new ArrayList();
+ String sLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ for( int count = 0; count < sLetters.length(); count++ )
+ {
+ String letter = sLetters.substring( count, count + 1 );
+ m_UnusedLetters.add( letter );
+ }
+ }
+
+ public String getCorrectWord()
+ {
+ return m_CurWord;
+ }
+
+ //The current state of the guessed word
+ public String getGuess()
+ {
+ return m_Guess;
+ }
+
+ public int getMaxMisses()
+ {
+ return m_MaxMisses;
+ }
+
+ public int getMissed()
+ {
+ return m_Missed;
+ }
+
+ public ArrayList getUnused()
+ {
+ return m_UnusedLetters;
+ }
+
+ public void guess( String sLetter )
+ throws GameException
+ {
+ m_UnusedLetters.remove( sLetter );
+
+ if( m_CurWord.indexOf( sLetter ) == -1 )
+ {
+ m_Missed++;
+ throw new GameException( "Letter " + sLetter + " is not in the
word");
+ }
+
+ //Good letter! Reveal it in the guess
+ m_GuessedRightLetters += sLetter;
+
+ //Rebuild the guessed word... make sure
+ //guessed letters are visible.
+ m_Guess = "";
+ for( int count = 0; count < m_CurWord.length(); count++ )
+ {
+ String sFind = m_CurWord.substring( count, count + 1 );
+ if( m_GuessedRightLetters.indexOf( sFind ) == -1 )
+ {
+ m_Guess += "_ ";
+ }
+ else
+ {
+ m_Guess += sFind + " ";
+ }
+ }
+ }
+
+ public boolean getFailed()
+ {
+ if( m_Missed > m_MaxMisses )
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean getDone()
+ {
+ if( m_Guess.indexOf( "_" ) == -1 )
+ {
+ //All letters guessed right!
+ return true;
+ }
+ return false;
+ }
+}

Added:
development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/impl/HardCodedDictionary.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/game/src/main/net/dpml/http/hangman/impl/HardCodedDictionary.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,306 @@
+package net.dpml.http.hangman.impl;
+
+import java.util.Random;
+
+import net.dpml.http.hangman.Dictionary;
+
+/**
+ * @metro.component name="hardcoded-dictionary" lifestyle="singleton"
+ * @metro.service type="net.dpml.http.hangman.Dictionary" version="1.0"
+ */
+public class HardCodedDictionary
+ implements Dictionary
+{
+ private Random m_Random;
+
+ public HardCodedDictionary()
+ {
+ m_Random = new Random();
+ }
+
+ public String getRandomWord()
+ {
+ int pos = m_Random.nextInt( saWordList.length );
+ return saWordList[ pos ].toUpperCase();
+ }
+
+
+ private static String saWordList[] =
+ {
+ "access",
+ "account",
+ "acquisition",
+ "acrobat",
+ "acronym",
+ "active",
+ "address",
+ "adobe",
+ "affiliate",
+ "algorithm",
+ "alias",
+ "analog",
+ "anchor",
+ "animation",
+ "anonymous",
+ "apache",
+ "apple",
+ "aspect",
+ "audio",
+ "authorization",
+ "backbone",
+ "backdoor",
+ "bandwidth",
+ "banner",
+ "barter",
+ "batch",
+ "benchmark",
+ "beta",
+ "binary",
+ "biometrics",
+ "bitmap",
+ "bookmark",
+ "broadband",
+ "broadcast",
+ "browser",
+ "buzzword",
+ "cable",
+ "cache",
+ "campus",
+ "channel",
+ "character",
+ "clean",
+ "click",
+ "client",
+ "collaborative",
+ "command",
+ "commerce",
+ "compatible",
+ "compression",
+ "computer",
+ "confidentiality",
+ "configuration",
+ "configure",
+ "connect",
+ "connectivity",
+ "content",
+ "convergence",
+ "cookies",
+ "coopetition",
+ "counter",
+ "crackable",
+ "crash",
+ "crusader",
+ "customize",
+ "cyborg",
+ "daemon",
+ "deactivation",
+ "decode",
+ "decryption",
+ "default",
+ "device",
+ "digital",
+ "directory",
+ "distribution",
+ "document",
+ "domain",
+ "download",
+ "dynamic",
+ "electronic",
+ "embedded",
+ "enterprise",
+ "environment",
+ "ethernet",
+ "evangelist",
+ "export",
+ "extensions",
+ "extranet",
+ "failure",
+ "favorite",
+ "feature",
+ "file",
+ "filter",
+ "finger",
+ "firewall",
+ "firmware",
+ "flame",
+ "flavor",
+ "format",
+ "forum",
+ "fractal",
+ "freeware",
+ "functionality",
+ "gaming",
+ "gateway",
+ "geek",
+ "genius",
+ "gigabyte",
+ "globalization",
+ "google",
+ "graffiti",
+ "graphics",
+ "groupware",
+ "guardian",
+ "hacker",
+ "hairball",
+ "handle",
+ "handshake",
+ "handwriting",
+ "headmount",
+ "hexadecimal",
+ "hierarchy",
+ "homepage",
+ "host",
+ "hotmail",
+ "hyperlink",
+ "hypermedia",
+ "hypertext",
+ "identity",
+ "inbox",
+ "index",
+ "information",
+ "infotainment",
+ "infrared",
+ "infrastructure",
+ "initialization",
+ "install",
+ "integrate",
+ "integrity",
+ "interactive",
+ "interface",
+ "internet",
+ "interoperability",
+ "intranet",
+ "java",
+ "javascript",
+ "kernel",
+ "keyboard",
+ "kilobyte",
+ "kiosk",
+ "knowledge",
+ "language",
+ "laptop",
+ "launch",
+ "legacy",
+ "leverage",
+ "link",
+ "link",
+ "linux",
+ "load",
+ "log",
+ "logoff",
+ "macintosh",
+ "macromedia",
+ "mainframe",
+ "management",
+ "megabyte",
+ "megahertz",
+ "meltdown",
+ "microsoft",
+ "modem",
+ "monitor",
+ "mozilla",
+ "multicast",
+ "nanosecond",
+ "napster",
+ "navigate",
+ "netscape",
+ "newsgroups",
+ "norton",
+ "obsolete",
+ "offline",
+ "online",
+ "optimize",
+ "outage",
+ "packet",
+ "payment",
+ "paypal",
+ "peer",
+ "peripheral",
+ "photoshop",
+ "portable",
+ "portal",
+ "postmaster",
+ "program",
+ "programmer",
+ "programming",
+ "prompt",
+ "proprietary",
+ "protocol",
+ "publisher",
+ "quantum",
+ "query",
+ "queue",
+ "qwerty",
+ "radar",
+ "radio",
+ "reboot",
+ "redirect",
+ "reformat",
+ "refresh",
+ "remote",
+ "resolution",
+ "resolve",
+ "resonate",
+ "robot",
+ "runtime",
+ "satellite",
+ "scanner",
+ "schedule",
+ "script",
+ "search",
+ "security",
+ "server",
+ "shareware",
+ "skyscraper",
+ "sniffer",
+ "socket",
+ "spam",
+ "speed",
+ "spider",
+ "spoofing",
+ "spyware",
+ "stack",
+ "static",
+ "strawman",
+ "string",
+ "stylus",
+ "subscribe",
+ "success",
+ "support",
+ "synchronization",
+ "technobabble",
+ "terminal",
+ "thread",
+ "throughput",
+ "thumbnail",
+ "titanium",
+ "toggle",
+ "toolbar",
+ "trackball",
+ "traffic",
+ "transponder",
+ "turnkey",
+ "unix",
+ "upgrade",
+ "uplink",
+ "upload",
+ "upside",
+ "upstream",
+ "user",
+ "vanilla",
+ "vaporware",
+ "vector",
+ "video",
+ "virtual",
+ "virus",
+ "wallpaper",
+ "windows",
+ "wireless",
+ "workstation",
+ "worm",
+ "yahoo",
+ "zip",
+ "zombie",
+ "zone"
+ };
+}

Added: development/main/planet/facilities/http/examples/hangman/view/build.xml
==============================================================================
--- (empty file)
+++ development/main/planet/facilities/http/examples/hangman/view/build.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2004 Niclas Hedman.
+ *
+ * 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.dpml.net/central/about/legal/
+ *
+ * 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.
+-->
+
+<project name="hangman-view" default="install" basedir="."
+ xmlns:magic="antlib:net.dpml.magic"
xmlns:x="plugin:dpml/magic/dpml-magic-core" >
+
+ <magic:import uri="artifact:template:dpml/magic/standard"/>
+
+ <target name="build" depends="standard.build">
+ <mkdir dir="target/deliverables/wars/" />
+ <mkdir dir="target/lib" />
+ <!-- No idea how to write this properly. Need to check with Steve. -->
+ <war destfile="target/deliverables/wars/hangman-view.war"
+ webxml="etc/web.xml">
+ <fileset dir="src/web"/>
+ <classes dir="target/classes"/>
+ </war>
+ </target>
+
+</project>

Added:
development/main/planet/facilities/http/examples/hangman/view/etc/web.xml
==============================================================================
--- (empty file)
+++ development/main/planet/facilities/http/examples/hangman/view/etc/web.xml
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app
+ xmlns="http://java.sun.com/xml/ns/j2ee";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
artifact:xsd:sun/xml/ns/j2ee/web-app#2.4"
+ version="2.4">
+
+ <display-name>hangman</display-name>
+ <distributable/>
+ <servlet>
+ <servlet-name>hangman</servlet-name>
+ <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>hangman</servlet-name>
+ <url-pattern>/app</url-pattern>
+ </servlet-mapping>
+
+ <filter>
+ <filter-name>redirect</filter-name>
+ <filter-class>org.apache.tapestry.RedirectFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>redirect</filter-name>
+ <url-pattern>/</url-pattern>
+ </filter-mapping>
+
+ <session-config>
+ <session-timeout>15</session-timeout>
+ </session-config>
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>

Added:
development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Failed.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Failed.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,15 @@
+package net.dpml.http.hangman.view;
+
+import org.apache.tapestry.IEngine;
+import org.apache.tapestry.html.BasePage;
+
+public class Failed extends BasePage
+{
+
+ public void attach(IEngine engine)
+ {
+ super.attach( engine );
+ Visit visit = (Visit) engine.getVisit();
+ visit.gameFinished();
+ }
+}

Added:
development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Guess.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Guess.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,75 @@
+package net.dpml.http.hangman.view;
+
+import net.dpml.http.hangman.Game;
+import net.dpml.http.hangman.GameException;
+
+import org.apache.tapestry.IAsset;
+import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.html.BasePage;
+
+public class Guess extends BasePage
+{
+ String error = "";
+
+ public void detach()
+ {
+ error = "";
+ super.detach();
+ }
+
+ public boolean getHasError()
+ {
+ if( (error == null) || (error.length() == 0) )
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public String getError()
+ {
+ return error;
+ }
+
+ public void makeGuess( IRequestCycle cycle )
+ {
+ Object[] parameters = cycle.getServiceParameters();
+ String letter = (String) parameters[ 0 ];
+ Game game = ( (Visit) getVisit() ).getGame();
+ try
+ {
+ game.guess( letter );
+ } catch( GameException ex )
+ {
+ error = ex.getMessage();
+ if( game.getFailed() )
+ cycle.activate( "Failed" );
+ return;
+ }
+ // A good guess.
+ if( game.getDone() )
+ {
+ cycle.activate( "Success" );
+ }
+ }
+
+ //Retrieve the appropriate asset for the
+ //number of wrong guesses
+ public IAsset getGuessImageAsset()
+ {
+ Game game = ( (Visit) getVisit() ).getGame();
+ int iMissed = game.getMissed();
+ int iMaxMisses = game.getMaxMisses();
+ int iFactor = 1;
+ if( iMaxMisses==3 )
+ {
+ iFactor = 3;
+ }
+ else if( iMaxMisses==5 )
+ {
+ iFactor = 2;
+ }
+ String name = "wrong_" + iMissed*iFactor;
+ return getAsset(name);
+ }
+}

Added:
development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Home.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Home.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,62 @@
+package net.dpml.http.hangman.view;
+
+import net.dpml.http.hangman.Controller;
+
+import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.html.BasePage;
+
+public class Home extends BasePage
+{
+ public static final int EASY = 10;
+ public static final int MEDIUM = 5;
+ public static final int HARD = 3;
+
+ private int misses = 0;
+ private String error = "";
+
+ public void detach()
+ {
+ misses = 0;
+ error = null;
+ super.detach();
+ }
+
+ public int getMisses()
+ {
+ return misses;
+ }
+
+ public void setMisses( int value )
+ {
+ misses = value;
+ }
+
+ public String getError()
+ {
+ return error;
+ }
+
+ public boolean getHasError()
+ {
+ if( ( error == null ) || ( error.length() == 0 ) )
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public void formSubmit( IRequestCycle cycle )
+ {
+ if (misses == 0)
+ {
+ error = "Please select a game difficulty.";
+ return;
+ }
+ System.out.println( getGlobal().getClass().getName() );
+ Controller controller = (Controller) getGlobal();
+
+ Visit visit = (Visit) getVisit();
+ visit.startGame( controller, misses );
+ cycle.activate( "Guess" );
+ }
+}

Added:
development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Success.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Success.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,16 @@
+package net.dpml.http.hangman.view;
+
+import org.apache.tapestry.IEngine;
+import org.apache.tapestry.html.BasePage;
+
+public class Success extends BasePage
+{
+
+ public void attach( IEngine engine )
+ {
+ super.attach( engine );
+ Visit visit = (Visit) engine.getVisit();
+ visit.gameFinished();
+ }
+
+}

Added:
development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Visit.java
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/main/net/dpml/http/hangman/view/Visit.java
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,39 @@
+package net.dpml.http.hangman.view;
+
+import java.io.Serializable;
+
+import net.dpml.http.hangman.Controller;
+import net.dpml.http.hangman.Game;
+
+public class Visit
+ implements Serializable
+{
+ private Controller m_Controller;
+ private boolean m_Complete;
+ private String m_Correct;
+
+ public Game getGame()
+ {
+ return m_Controller.getGame( this );
+ }
+
+ public void startGame( Controller controller, int iMaxMisses )
+ {
+ m_Complete = false;
+ m_Controller = controller;
+ Game g = m_Controller.getGame( this );
+ g.start( iMaxMisses );
+ m_Correct = g.getCorrectWord();
+ }
+
+ public void gameFinished()
+ {
+ m_Controller.releaseGame( this );
+ m_Complete = true;
+ }
+
+ public boolean getCompleted()
+ {
+ return m_Complete;
+ }
+}

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Failed.html
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Failed.html
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,10 @@
+<html>
+<span jwcid="@Shell" stylesheet="ognl:assets.stylesheet" title="Hangman
Failed"/>
+<body>
+<p class="headerText">You Lose!</p>
+<p><img jwcid="looseImage"/></p>
+<p class="guessLettersPreText">The word was:
+<span class="hiddenWord" jwcid="insertCorrectWord"/>.
+<p><a jwcid="home">Start Again</a>
+</body>
+</html>
\ No newline at end of file

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Failed.page
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Failed.page
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE page-specification
+ PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd";>
+
+<page-specification class="net.dpml.http.hangman.view.Failed">
+ <context-asset name="stylesheet" path="/css/hangman.css"/>
+ <context-asset name="loose" path="/images/loose.gif"/>
+ <component id="looseImage" type="Image">
+ <binding name="image" expression="assets.loose"/>
+ </component>
+ <component id="insertCorrectWord" type="Insert">
+ <binding name="value" expression="page.visit.correctWord"/>
+ </component>
+ <component id="home" type="PageLink">
+ <static-binding name="page">
+ Home
+ </static-binding>
+ </component>
+</page-specification>

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Guess.html
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Guess.html
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,33 @@
+<html>
+<span jwcid="@Shell" stylesheet="ognl:assets.stylesheet" title="Hangman
Guess"/>
+<body>
+<span jwcid="ifNotComplete">
+ <p class="headerText">Make a Guess</p>
+ <p><img jwcid="guessImage"/></p>
+ <p class="hiddenWord">
+ <span jwcid="insertGuess"/>
+ </p>
+ <p>
+ You have made <span jwcid="insertMissed"/> bad guesses,
+ out of a maximum of <span jwcid="insertMaxMisses"/>.
+ <span jwcid="ifError">
+ <p class="error"><span jwcid="insertError"/></p>
+ </span>
+ <p class="guessLettersPreText">
+ Guess:
+ <span class="guessLetters">
+ <span jwcid="e">
+ <a jwcid="guess"><span jwcid="insertLetter"/></a>
+ </span>
+ </span>
+ <p>
+ <a jwcid="giveUp">Give up?</a>
+</span>
+<span jwcid="ifComplete">
+ <p class="headerText">The game is already finished.</p>
+ <p class="guessLettersPreText">The word was:
+ <span class="hiddenWord" jwcid="insertCorrectWord"/>.
+ <p><a jwcid="home">Start Again</a>
+</span>
+</body>
+</html>
\ No newline at end of file

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Guess.page
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Guess.page
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE page-specification
+ PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd";>
+
+<page-specification class="net.dpml.http.hangman.view.Guess">
+ <context-asset name="stylesheet" path="/css/hangman.css"/>
+ <context-asset name="wrong_0" path="/images/0.gif"/>
+ <context-asset name="wrong_1" path="/images/1.gif"/>
+ <context-asset name="wrong_2" path="/images/2.gif"/>
+ <context-asset name="wrong_3" path="/images/3.gif"/>
+ <context-asset name="wrong_4" path="/images/4.gif"/>
+ <context-asset name="wrong_5" path="/images/5.gif"/>
+ <context-asset name="wrong_6" path="/images/6.gif"/>
+ <context-asset name="wrong_7" path="/images/7.gif"/>
+ <context-asset name="wrong_8" path="/images/8.gif"/>
+ <context-asset name="wrong_9" path="/images/9.gif"/>
+ <context-asset name="wrong_10" path="/images/10.gif"/>
+ <component id="guessImage" type="Image">
+ <binding name="image" expression="guessImageAsset"/>
+ </component>
+ <component id="insertGuess" type="Insert">
+ <binding name="value" expression="page.visit.game.guess"/>
+ </component>
+ <component id="insertMissed" type="Insert">
+ <binding name="value" expression="page.visit.game.missed"/>
+ </component>
+ <component id="insertMaxMisses" type="Insert">
+ <binding name="value" expression="page.visit.game.maxMisses"/>
+ </component>
+ <component id="ifComplete" type="Conditional">
+ <binding name="condition" expression="page.visit.completed"/>
+ </component>
+ <component id="ifNotComplete" type="Conditional">
+ <binding name="condition" expression="!page.visit.completed"/>
+ </component>
+ <component id="ifError" type="Conditional">
+ <binding name="condition" expression="hasError"/>
+ </component>
+ <component id="insertError" type="Insert">
+ <binding name="value" expression="error"/>
+ </component>
+ <component id="e" type="Foreach">
+ <binding name="source" expression="page.visit.game.unused"/>
+ </component>
+ <component id="guess" type="DirectLink">
+ <binding name="listener" expression="listeners.makeGuess"/>
+ <binding name="parameters" expression="components.e.value"/>
+ </component>
+ <component id="insertLetter" type="Insert">
+ <binding name="value" expression="components.e.value"/>
+ </component>
+ <component id="giveUp" type="PageLink">
+ <static-binding name="page">
+ Failed
+ </static-binding>
+ </component>
+ <component id="insertCorrectWord" type="Insert">
+ <binding name="value" expression="page.visit.correctWord"/>
+ </component>
+ <component id="home" type="PageLink">
+ <static-binding name="page">
+ Home
+ </static-binding>
+ </component>
+</page-specification>

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Home.html
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Home.html
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,35 @@
+<html>
+<span jwcid="@Shell" stylesheet="ognl:assets.stylesheet" title="Hangman"/>
+<body>
+<p class="headerText">Tapestry Hangman</p>
+<p>
+ This is the standard game of Hangman. You must guess
+ a word, a letter at a time. If you make too many
+ mistakes, you lose!</p>
+<form jwcid="form">
+ <span jwcid="group">
+ <span jwcid="ifError">
+ <span class="error" jwcid="insertError"/>
+ </span>
+ <table>
+ <tr>
+ <td><input jwcid="inputEasy"/></td>
+ <td>Easy game; you are allowed ten misses.</td>
+ </tr>
+ <tr>
+ <td><input jwcid="inputMedium"/></td>
+ <td>Medium game; you are allowed five misses.</td>
+ </tr>
+ <tr>
+ <td><input jwcid="inputHard"/></td>
+ <td>Hard game; you are only allowed three misses.</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><input type="submit" value="Play!"></td>
+ </tr>
+ </table>
+ </span>
+</form>
+</body>
+</html>
\ No newline at end of file

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Home.page
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Home.page
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE page-specification
+ PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd";>
+
+<page-specification class="net.dpml.http.hangman.view.Home">
+ <context-asset name="stylesheet" path="/css/hangman.css"/>
+ <component id="form" type="Form">
+ <binding name="listener" expression="listeners.formSubmit" />
+ </component>
+ <component id="ifError" type="Conditional">
+ <binding name="condition" expression="hasError" />
+ </component>
+ <component id="insertError" type="Insert">
+ <binding name="value" expression="error" />
+ </component>
+ <component id="group" type="RadioGroup">
+ <binding name="selected" expression="misses" />
+ </component>
+ <component id="inputEasy" type="Radio">
+ <binding name="value"
expression="@net.dpml.http.hangman.view.Home@EASY" />
+ </component>
+ <component id="inputMedium" type="Radio">
+ <binding name="value"
expression="@net.dpml.http.hangman.view.Home@MEDIUM" />
+ </component>
+ <component id="inputHard" type="Radio">
+ <binding name="value"
expression="@net.dpml.http.hangman.view.Home@HARD" />
+ </component>
+</page-specification>

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Success.html
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Success.html
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,10 @@
+<html>
+<span jwcid="@Shell" stylesheet="ognl:assets.stylesheet" title="Hangman
Success"/>
+<body>
+<p class="headerText">You Win!</p>
+<p><img jwcid="winImage"/></p>
+<p class="guessLettersPreText">The word was:
+<span class="hiddenWord" jwcid="insertCorrectWord"/>.
+<p><a jwcid="home">Start Again</a>
+</body>
+</html>
\ No newline at end of file

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Success.page
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/Success.page
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE page-specification
+ PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd";>
+
+<page-specification class="net.dpml.http.hangman.view.Success">
+ <context-asset name="stylesheet" path="/css/hangman.css"/>
+ <context-asset name="win" path="/images/win.gif"/>
+ <component id="winImage" type="Image">
+ <binding name="image" expression="assets.win"/>
+ </component>
+ <component id="insertCorrectWord" type="Insert">
+ <binding name="value" expression="page.visit.correctWord"/>
+ </component>
+ <component id="home" type="PageLink">
+ <static-binding name="page">
+ Home
+ </static-binding>
+ </component>
+</page-specification>

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/hangman.application
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/WEB-INF/hangman.application
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application
+ PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd";>
+
+<application name="hangman"
engine-class="org.apache.tapestry.engine.BaseEngine" >
+ <description>Hangman Application</description>
+ <property
name="org.apache.tapestry.visit-class">net.dpml.http.hangman.view.Visit</property>
+ <page name="Home" specification-path="Home.page"/>
+</application>

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/css/hangman.css
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/css/hangman.css
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,34 @@
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12pt;
+}
+
+.headerText {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 16pt;
+ font-weight: bold;
+}
+
+.error {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 14pt;
+ font-weight: bold;
+ color: #FF0000;
+}
+
+.hiddenWord {
+ font-family: "Courier New", Courier, mono;
+ font-size: 14pt;
+ font-weight: bold;
+}
+
+.guessLettersPreText {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 13pt;
+}
+
+.guessLetters {
+ font-family: "Courier New", Courier, mono;
+ font-size: 13pt;
+ font-weight: bold;
+}
\ No newline at end of file

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/0.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/1.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/10.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/2.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/3.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/4.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/5.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/6.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/7.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/8.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/9.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/loose.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/images/win.gif
==============================================================================
Binary file. No diff available.

Added:
development/main/planet/facilities/http/examples/hangman/view/src/web/index.html
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/examples/hangman/view/src/web/index.html
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,9 @@
+<HTML>
+<meta http-equiv="Refresh" content="0; URL=/hangman/app" />
+<HEADER>
+<TITLE>hangman2</TITLE>
+</HEADER>
+<BODY>
+<P><A HREF="/hangman/app">If you are not automatically redirected click
here</A></P>
+</BODY>
+</HTML>

Modified: development/main/planet/facilities/http/examples/index.xml
==============================================================================
--- development/main/planet/facilities/http/examples/index.xml (original)
+++ development/main/planet/facilities/http/examples/index.xml Thu Dec 30
06:53:47 2004
@@ -20,18 +20,61 @@

<import index="../../index.xml" />

- <project basedir="hangman">
+ <project basedir="hangman/api">
<info>
<group>dpml/http/examples/hangman</group>
- <name>hangman</name>
- <version>1.0.0</version>
+ <name>hangman-api</name>
+ <version>2.0.0</version>
+ </info>
+ <dependencies>
+ </dependencies>
+ </project>
+
+ <project basedir="hangman/app">
+ <info>
+ <group>dpml/http/examples/hangman</group>
+ <name>hangman-app</name>
+ <version>2.0.0</version>
+ <type>block</type>
+ </info>
+ <dependencies>
+ <include key="hangman-game" />
+ <include key="hangman-view" />
+ <include key="dpml-http-tapestry" />
+ </dependencies>
+ <plugins>
+ <include key="dpml-meta-tools"/>
+ </plugins>
+ </project>
+
+ <project basedir="hangman/game">
+ <info>
+ <group>dpml/http/examples/hangman</group>
+ <name>hangman-game</name>
+ <version>2.0.0</version>
+ </info>
+ <dependencies>
+ <include key="hangman-api" />
+ <include key="dpml-http-api" />
+ <include key="dpml-parameters-api" />
+ <include key="dpml-service-api" />
+ <include key="dpml-logging-api" />
+ </dependencies>
+ <plugins>
+ <include key="dpml-meta-tools"/>
+ </plugins>
+ </project>
+
+ <project basedir="hangman/view">
+ <info>
+ <group>dpml/http/examples/hangman</group>
+ <name>hangman-view</name>
<type>war</type>
</info>
<dependencies>
+ <include key="hangman-api" />
<include key="tapestry" />
</dependencies>
</project>
-
-
</index>


Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/Ajp13Listener.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/Ajp13Listener.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ClientCertAuthenticator.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ClientCertAuthenticator.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ConfigurationMimeTypes.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ConfigurationMimeTypes.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/DumpHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/DumpHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ErrorPageHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ErrorPageHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ExpiryHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ExpiryHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/FormAuthenticator.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/FormAuthenticator.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ForwardHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ForwardHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HTAccessHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashSessionManager.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HashSessionManager.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpContextImpl.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpContextImpl.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpServerImpl.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/HttpServerImpl.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/IPAccessHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/IPAccessHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JsseListener.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/JsseListener.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/MsieSslHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/MsieSslHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NcsaRequestLog.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NotFoundHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NotFoundHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NullHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/NullHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ProxyHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ProxyHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ResourceHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ResourceHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/RootNotFoundHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/RootNotFoundHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SecurityHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SecurityHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.java
Thu Dec 30 06:53:47 2004
@@ -33,15 +33,14 @@

/**
* @metro.component name="http-servlet-handler" lifestyle="singleton"
- * @metro.service type="org.mortbay.http.HttpHandler"
+ * @metro.service type="net.dpml.http.ServletHandler"
*/
public class ServletHandler extends org.mortbay.jetty.servlet.ServletHandler
- implements Configurable, Startable
+ implements Configurable, Startable, net.dpml.http.ServletHandler
{
private Logger m_Logger;
private HttpContextService m_Context;
private int m_Index;
- private ContainmentModel m_Model;
private boolean m_EnableModelInContext;

/**
@@ -52,14 +51,13 @@
* key="session-manager" optional="true"
* @metro.entry key="urn:metro:name"
* type="java.lang.String"
- * @metro.entry key="urn:composition:containment.model"
- * type="net.dpml.composition.model.ContainmentModel"
*/
public ServletHandler( Logger logger, Context ctx, Parameters params,
ServiceManager man )
throws ServiceException, ContextException
{
m_Logger = logger;
m_Context = (HttpContextService) man.lookup( "http-context" );
+
if( man.hasService( "session-manager" ) )
{
SessionManager sm = (SessionManager) man.lookup(
"session-manager" );
@@ -75,10 +73,6 @@

boolean autoInitialize = params.getParameterAsBoolean(
"auto-initialize-servlets", true );
setAutoInitializeServlets( autoInitialize );
-
- m_EnableModelInContext = params.getParameterAsBoolean(
"enable-composition-model", false );
- if( m_EnableModelInContext )
- m_Model = (ContainmentModel) ctx.get(
"urn:composition:containment.model" );
}

public void configure( Configuration conf )
@@ -125,10 +119,8 @@
m_Logger.debug( "Starting ServletHandler: " + this );
if( ! isStarted() )
super.doStart();
-// if( m_EnableModelInContext )
-// getServletContext().setAttribute(
"urn:composition:containment.model", m_Model );
}
-
+
protected void doStop()
throws Exception
{
@@ -138,5 +130,13 @@
super.doStop();
m_Context.removeHandler( this );
}
+
+ /** Adds the contextObject into the ServletContext object.
+ *
+ */
+ public void addServletContextEntry( String entryName, Object
contextObject )
+ {
+ getServletContext().setAttribute( entryName, contextObject );
+ }
}


Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/ServletHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SetResponseHeadersHandler.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SetResponseHeadersHandler.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Added:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SocketListener.xprofile
==============================================================================
--- (empty file)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/SocketListener.xprofile
Thu Dec 30 06:53:47 2004
@@ -0,0 +1,2 @@
+<profiles>
+</profiles>

Modified:
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
==============================================================================
---
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
(original)
+++
development/main/planet/facilities/http/impl/src/main/net/dpml/http/impl/WebApplicationContext.java
Thu Dec 30 06:53:47 2004
@@ -16,6 +16,8 @@
package net.dpml.http.impl;

import java.io.File;
+import javax.servlet.ServletContext;
+
import net.dpml.activity.Disposable;
import net.dpml.activity.Startable;
import net.dpml.configuration.Configurable;
@@ -39,10 +41,12 @@
/**
* @metro.component name="http-web-context" lifestyle="singleton"
* @metro.service type="net.dpml.http.HttpContextService"
+ * @metro.service type="net.dpml.http.ServletHandler"
*/
public class WebApplicationContext
extends org.mortbay.jetty.servlet.WebApplicationContext
- implements Startable, Serviceable, Disposable, Configurable,
HttpContextService
+ implements Startable, Serviceable, Disposable, Configurable,
+ HttpContextService, net.dpml.http.ServletHandler
{
private HttpService m_HttpServer;
private boolean m_Graceful;
@@ -251,5 +255,21 @@
destroy();
m_HttpServer = null;
}
+
+ /** Adds the contextObject into the ServletContext object.
+ *
+ */
+ public void addServletContextEntry( String entryName, Object
contextObject )
+ {
+ ServletContext ctx = getServletHandler().getServletContext();
+ ctx.setAttribute( entryName, contextObject );
+System.out.println( "NICLAS***********************************" );
+System.out.println( ctx );
+java.util.Enumeration names = ctx.getAttributeNames();
+while( names.hasMoreElements() )
+ System.out.println( names.nextElement() );
+System.out.println( "----------------------------------------" );
+
+ }
}


Modified: development/main/planet/facilities/http/index.xml
==============================================================================
--- development/main/planet/facilities/http/index.xml (original)
+++ development/main/planet/facilities/http/index.xml Thu Dec 30 06:53:47
2004
@@ -84,7 +84,7 @@
<include key="dpml-configuration-impl"/>
<include key="org.mortbay.jetty"/>
<include key="org.mortbay.jaas"/>
- <include key="servletapi" runtime="true" build="false" />
+ <include key="servletapi" runtime="true" build="true" />
<include key="commons-logging" build="false" runtime="true"/>
<include key="jsp-api" runtime="true" build="false" />
<include key="jasper-runtime" runtime="true" build="false" />



  • svn commit: r1322 - in development/main/planet/facilities/http: . api/src/main/net/dpml/http api/src/main/net/dpml/planet blocks blocks/demo/src/main/net/dpml/planet/playground blocks/tapestry blocks/webappserver documentation documentation/src documentation/src/docs examples examples/hangman examples/hangman/api examples/hangman/api/src examples/hangman/api/src/main examples/hangman/api/src/main/net examples/hangman/api/src/main/net/dpml examples/hangman/api/src/main/net/dpml/http examples/hangman/api/src/main/net/dpml/http/hangman examples/hangman/app examples/hangman/app/etc examples/hangman/app/etc/deliverables examples/hangman/app/etc/deliverables/confs examples/hangman/block examples/hangman/etc examples/hangman/game examples/hangman/game/src examples/hangman/game/src/main examples/hangman/game/src/main/net examples/hangman/game/src/main/net/dpml examples/hangman/game/src/main/net/dpml/http examples/hangman/game/src/main/net/dpml/http/hangman examples/hangman/game/src/main/net/dpml/http/hangman/impl examples/hangman/src examples/hangman/view examples/hangman/view/etc examples/hangman/view/etc/deliverables examples/hangman/view/etc/deliverables/confs examples/hangman/view/src examples/hangman/view/src/main examples/hangman/view/src/main/net examples/hangman/view/src/main/net/dpml examples/hangman/view/src/main/net/dpml/http examples/hangman/view/src/main/net/dpml/http/hangman examples/hangman/view/src/main/net/dpml/http/hangman/view examples/hangman/view/src/web examples/hangman/view/src/web/WEB-INF examples/hangman/view/src/web/css examples/hangman/view/src/web/images impl/src/main/net/dpml/http/impl impl/src/main/net/dpml/planet spi/src/main/net/dpml/planet util/src/main/net/dpml/planet, niclas, 12/30/2004

Archive powered by MHonArc 2.6.24.

Top of Page