head	1.4;
access;
symbols
	TIGRIS_NOV_12_2000:1.3
	OLDHELM:1.3.0.4
	TIGRIS_NOV_11_2000:1.3
	TIGRIS_SEP_13_2000:1.3.0.2
	TIGRIS_BASELINE:1.3;
locks; strict;
comment	@# @;


1.4
date	2000.11.12.23.14.15;	author dlr;	state dead;
branches;
next	1.3;

1.3
date	2000.09.20.03.13.17;	author brian;	state Exp;
branches;
next	1.2;

1.2
date	2000.02.03.04.21.33;	author jrobbins;	state Exp;
branches;
next	1.1;

1.1
date	2000.01.30.01.59.39;	author jrobbins;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Does not exist in newhelm.
@
text
@/* ================================================================
 * Copyright (c) 2000 Collab.Net.  All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 
 * 3. The end-user documentation included with the redistribution, if
 * any, must include the following acknowlegement: "This product includes
 * software developed by Collab.Net (http://www.Collab.Net/)."
 * Alternately, this acknowlegement may appear in the software itself, if
 * and wherever such third-party acknowlegements normally appear.
 * 
 * 4. The hosted project names must not be used to endorse or promote
 * products derived from this software without prior written
 * permission. For written permission, please contact info@@collab.net.
 * 
 * 5. Products derived from this software may not use the "Tigris" name
 * nor may "Tigris" appear in their names without prior written
 * permission of Collab.Net.
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ====================================================================
 * 
 * This software consists of voluntary contributions made by many
 * individuals on behalf of Collab.Net.
 */


package org.tigris.helm.test;

// import the WebMacro servlet classes
import org.webmacro.servlet.*;

// import the WebMacro template classes
import org.webmacro.engine.*;

// import the WebMacro broker classes 
import org.webmacro.broker.*;

/**
  * HelloWorld -- the simplest possible WebMacro servlet.
  * The easiest way to create a WebMacro servlet is to
  * subclass from org.webmacro.servlet.WMServlet
  *
  * Before trying to run this example, be sure to do
  * all of the following:
  *
  *   1.  Add webmacro.jar to your CLASSPATH
  *
  *   2.  Compile this servlet and install it in your servlet directory
  *
  *   3.  Add webmacro.jar to your servlet runner's classpath,
  *       and put webmacro.properties in the same place
  *
  *   4.  Edit webmacro.properties to configure WebMacro for your setup
  *
  *   5.  Start your servlet runner
  *
  */
public class HelloWorld extends WMServlet
{

   /**
     * WebMacro creates a WebContext and passes it to your servlet. 
     * The WebContext contains all the information you'll need to 
     * handle the request. It is also the only object you share 
     * with the template. If you add objects to the WebContext via
     * its put(key,value)method,they become available in the 
     * template as variables named after the key.
     */
   public Template handle(WebContext context) 
      throws HandlerException
   {

      // Put whatever data you like into the context. In
      // this example we just put in a simple string

      context.put("Hello", "Hello, brave new world!");


      // Select a template. You could choose the template based 
      // on any criteria you like: user preference, current 
      // action, different templates for different results, etc.

      // Here we always return exactly the same template.
      Template view;

      try {

         // The following line asks WebMacro's resource broker to
         // find the "helloWorld.wm" template, cache it, and return a 
         // parsed copy to us.

         view = getTemplate("tigris/test/helloWorld.wm");

      } catch (ResourceUnavailableException e) {

         // If this happens you have not set WebMacro up correctly:

         throw new HandlerException(
              "HelloWorld loaded and executed OK, but was unable to load \n"
            + "a template. There are a couple of things that could be wrong \n"
            + "here. First, you may have put webmacro.properties somewhere \n"
            + "outside your servlet classpath. Try putting it in the same \n"
            + "place as you put webmacro.jar. Second, you may have set the \n"
            + "TemplateRoot directory incorectly. The file helloWorld.wm \n"
            + "must be in one of the directories listed in that option in \n"
            + "the webmacro.properties file. You should check the server \n"
            + "logs or output (or WebMacro's log if it's set and being used \n"
            + "for helpful messages which may indicate what the problem is. \n"
            + "Since your servlet runner may have d fewifferent classpath \n"
            + "settings, check that webmacro.properties is in the same \n"
            + "classpath that was used to load webmacro.jar. \n"
            + "\n"
            + "Here is the actual exception that was raised:\n" + e);
      }


      // Return the template selected. WebMacro will combine this
      // with the values in our context and return the result to
      // the user.

      return view;

   }


} /* end class HelloWorld */
@


1.3
log
@
Obtained from:
Submitted by:
Reviewed by:

Moved from org.helm to org.tigris.helm
Moved from org/helm to org/tigris/helm

perl -pi.bak -e, how I love thee

note: this update was done POST-CVS-REPOSITORY surgury.  In order to
get this right, you may need to remove the directories

$CVSROOT/helm/java/org/helm
$CVSROOT/helm/data/htdoc/look/www/org/helm
$CVSROOT/helm/templates/org/helm

before doing the "CVS update" call, since those directories don't
exist anymore and CVS will try to create lockfiles for you in them,
giving you an error.
@
text
@@


1.2
log
@Added tigris.org license
PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@d48 1
a48 1
package org.helm.test;
@


1.1
log
@initial checking
@
text
@d1 46
a46 1
// Copyright (c) 2000 Collab.Net, Inc. All Rights Reserved.
@

