From velocity-dev-returnejones@example.org Sun Mar 03 18:14:50 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 14979 invoked from network); 3 Mar 2002 18:14:50 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 3 Mar 2002 18:14:50 -0000 Received: (qmail 1071 invoked by uid 97); 3 Mar 2002 18:14:51 -0000 Delivered-To: ejones@example.org Received: (qmail 1033 invoked by uid 97); 3 Mar 2002 18:14:50 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 8421 invoked by uid 0); 3 Mar 2002 18:02:21 -0000 Message-ID: <ejones@example.org> From: ejones@example.org To: ejones@example.org Subject: Bug report for Velocity [2002/03/03] Date: Sun, 03 Mar 2002 18:02:21 -0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N +---------------------------------------------------------------------------+ | Bugzilla Bug ID | | +---------------------------------------------------------------------+ | | Status: UNC=Unconfirmed NEW=New ASS=Assigned | | | OPN=Reopened VER=Verified (Skipped Closed/Resolved) | | | +-----------------------------------------------------------------+ | | | Severity: BLK=Blocker CRI=Critical MAJ=Major | | | | MIN=Minor NOR=Normal EHN=Ehnancement | | | | +-------------------------------------------------------------+ | | | | Date Posted | | | | | +--------------------------------------------------+ | | | | | Description | | | | | | | | 4321|Ver|Enh|2001-10-21|Why is Context orthogonal to the Collections API | | 4322|Ass|Enh|2001-10-21|Overwrite option for Texen | | 4483|Ass|Nor|2001-10-28|calls to local macros not always made when templat| | 4576|Ass|Nor|2001-11-01|Does not leave character # alone. | | 4943|New|Nor|2001-11-18|patch for Win* examples .bat files | | 6546|Ass|Cri|2002-02-19|Problems with recursive macro calling when using #| +-----+---+---+----------+--------------------------------------------------+ | Total 6 bugs | +---------------------------------------------------------------------------+ -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Mon Mar 04 01:52:41 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 25590 invoked from network); 4 Mar 2002 01:52:40 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 4 Mar 2002 01:52:40 -0000 Received: (qmail 6030 invoked by uid 97); 4 Mar 2002 01:52:47 -0000 Delivered-To: ejones@example.org Received: (qmail 5975 invoked by uid 97); 4 Mar 2002 01:52:45 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 5958 invoked by uid 97); 4 Mar 2002 01:52:44 -0000 Date: 4 Mar 2002 01:52:34 -0000 Message-ID: <ejones@example.org> From: ejones@example.org To: ejones@example.org Subject: cvs commit: jakarta-velocity/src/java/org/apache/velocity/texen/ant Texen.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N jvanzyl 02/03/03 17:52:34 Added: src/java/org/apache/velocity/texen/ant Texen.java Log: Allow the use of Texen as a bean so that it can eventually be utililized from the command line and from GUIs. The impetus came from Maven where I want to use Texen from the command line to generate the build system for a project. I am not fully ready to replace the existing Ant task even though the bean is working correctly with the TaskAdapter in Ant. I need to clean up some of the exception reporting but this is enough to allow me to get going in Maven. This bean will not replace the task until thorough testing. Revision Changes Path 1.1 jakarta-velocity/src/java/org/apache/velocity/texen/ant/Texen.java Index: Texen.java =================================================================== package org.apache.velocity.texen.ant; /* * The Apache Software License, Version 1.1 * * Copyright (c) 2001 The Apache Software Foundation. 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 the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Velocity", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact ejones@example.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * 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 THE APACHE SOFTWARE FOUNDATION 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 the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ import java.util.StringTokenizer; import java.util.Date; import java.util.Hashtable; import java.util.Iterator; import java.util.Map; import java.io.File; import java.io.Writer; import java.io.FileInputStream; import java.io.InputStream; import java.io.IOException; import org.apache.tools.ant.Project; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.Velocity; import org.apache.velocity.context.Context; import org.apache.velocity.texen.Generator; import org.apache.velocity.util.StringUtils; import org.apache.velocity.exception.MethodInvocationException; import org.apache.velocity.exception.ParseErrorException; import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.commons.collections.ExtendedProperties; /** * An ant task for generating output by using Velocity * * @author <a href="mailto:ejones@example.org">Jason van Zyl</a> * @author <a href="ejones@example.org">Robert Burrell Donkin</a> * @version $Id: Texen.java,v 1.1 2002/03/04 01:52:34 jvanzyl Exp $ */ public class Texen { /** * This message fragment (telling users to consult the log or * invoke ant with the -debug flag) is appended to rethrown * exception messages. */ private final static String ERR_MSG_FRAGMENT = ". For more information consult the velocity log, or invoke ant " + "with the -debug flag."; /** * This is the control template that governs the output. * It may or may not invoke the services of worker * templates. */ protected String controlTemplate; /** * This is where Velocity will look for templates * using the file template loader. */ protected String templatePath; /** * This is where texen will place all the output * that is a product of the generation process. */ protected String outputDirectory; /** * This is the file where the generated text * will be placed. */ protected String outputFile; /** * This is the encoding for the output file(s). */ protected String outputEncoding; /** * This is the encoding for the input file(s) * (templates). */ protected String inputEncoding; /** * <p> * These are properties that are fed into the * initial context from a properties file. This * is simply a convenient way to set some values * that you wish to make available in the context. * </p> * <p> * These values are not critical, like the template path * or output path, but allow a convenient way to * set a value that may be specific to a particular * generation task. * </p> * <p> * For example, if you are generating scripts to allow * user to automatically create a database, then * you might want the <code>$databaseName</code> * to be placed * in the initial context so that it is available * in a script that might look something like the * following: * <code><pre> * #!bin/sh * * echo y | mysqladmin create $databaseName * </pre></code> * The value of <code>$databaseName</code> isn't critical to * output, and you obviously don't want to change * the ant task to simply take a database name. * So initial context values can be set with * properties file. */ protected ExtendedProperties contextProperties; /** * Reference to the context properties that is held * until processing in the execute() method. We do this * now so that the Ant TaskAdapter can set the project * which is needed for correct path processing when * this bean is used as an ant task. */ protected String contextPropertiesFile; /** * Property which controls whether the classpath * will be used when trying to locate templates. */ protected boolean useClasspath; /** * Path separator. */ private String fileSeparator = System.getProperty("file.separator"); /** * Ant project that is populated by the Ant TaskAdapter when * this bean is run as an Ant Task. */ protected Project project; /** * [REQUIRED] Set the control template for the * generating process. */ public void setControlTemplate (String controlTemplate) { this.controlTemplate = controlTemplate; } /** * Get the control template for the * generating process. */ public String getControlTemplate() { return controlTemplate; } /** * [REQUIRED] Set the path where Velocity will look * for templates using the file template * loader. */ public void setTemplatePath(String templatePath) { this.templatePath = templatePath; } /** * Process the templatePath. We hold off processing so that * when run as an Ant Task the project will be set, and the * project is required for correct path resolving. */ protected void processTemplatePath(String templatePath) throws Exception { StringBuffer resolvedPath = new StringBuffer(); StringTokenizer st = new StringTokenizer(templatePath, ","); while ( st.hasMoreTokens() ) { // resolve relative path from basedir and leave // absolute path untouched. File fullPath = resolveFile(st.nextToken()); resolvedPath.append(fullPath.getCanonicalPath()); if ( st.hasMoreTokens() ) { resolvedPath.append(","); } } this.templatePath = resolvedPath.toString(); } /** * Get the path where Velocity will look * for templates using the file template * loader. */ public String getTemplatePath() { return templatePath; } /** * [REQUIRED] Set the output directory. It will be * created if it doesn't exist. */ public void setOutputDirectory(File outputDirectory) throws Exception { try { this.outputDirectory = outputDirectory.getCanonicalPath(); } catch (IOException ioe) { throw new Exception( "There is a problem with the outputDirectory: " + ioe); } } /** * Get the output directory. */ public String getOutputDirectory() { return outputDirectory; } /** * [REQUIRED] Set the output file for the * generation process. */ public void setOutputFile(String outputFile) { this.outputFile = outputFile; } /** * Set the output encoding. */ public void setOutputEncoding(String outputEncoding) { this.outputEncoding = outputEncoding; } /** * Set the input (template) encoding. */ public void setInputEncoding(String inputEncoding) { this.inputEncoding = inputEncoding; } /** * Get the output file for the * generation process. */ public String getOutputFile() { return outputFile; } /** * Set the context properties that will be * fed into the initial context be the * generating process starts. */ public void setContextProperties(String file) { this.contextPropertiesFile = file; } /** * Process the templatePath. We hold off processing so that * when run as an Ant Task the project will be set, and the * project is required for correct path resolving. */ protected void processContextProperties( String file ) throws Exception { String[] sources = StringUtils.split(file,","); contextProperties = new ExtendedProperties(); // Always try to get the context properties resource // from a file first. Templates may be taken from a JAR // file but the context properties resource may be a // resource in the filesystem. If this fails than attempt // to get the context properties resource from the // classpath. for (int i = 0; i < sources.length; i++) { ExtendedProperties source = new ExtendedProperties(); try { // resolve relative path from basedir and leave // absolute path untouched. File fullPath = resolveFile(sources[i]); log("Using contextProperties file: " + fullPath); source.load(new FileInputStream(fullPath)); } catch (Exception e) { ClassLoader classLoader = this.getClass().getClassLoader(); try { InputStream inputStream = classLoader.getResourceAsStream(sources[i]); if (inputStream == null) { throw new Exception("Context properties file " + sources[i] + " could not be found in the file system or on the classpath!"); } else { source.load(inputStream); } } catch (IOException ioe) { source = null; } } Iterator j = source.getKeys(); while (j.hasNext()) { String name = (String) j.next(); String value = source.getString(name); contextProperties.setProperty(name,value); } } } /** * Get the context properties that will be * fed into the initial context be the * generating process starts. */ public ExtendedProperties getContextProperties() { return contextProperties; } /** * Set the use of the classpath in locating templates * * @param boolean true means the classpath will be used. */ public void setUseClasspath(boolean useClasspath) { this.useClasspath = useClasspath; } /** * Set the Ant project. Used when this bean is adapted * by the Ant TaskAdapter. */ public void setProject(Project project) { this.project = project; } /** * Get the Ant project which will be non-null if * this bean is used as a Task and adapted by the * Ant TaskAdapter. */ public Project getProject() { return project; } /** * Creates a VelocityContext. * * @return new Context * @throws Exception the execute method will catch * and rethrow as a <code>BuildException</code> */ public Context initControlContext() throws Exception { return new VelocityContext(); } /** * Execute the input script with Velocity * * @throws BuildException * BuildExceptions are thrown when required attributes are missing. * Exceptions thrown by Velocity are rethrown as BuildExceptions. */ public void execute () throws Exception { // Make sure the template path is set. if (templatePath == null && useClasspath == false) { throw new Exception( "The template path needs to be defined if you are not using " + "the classpath for locating templates!"); } // Make sure the control template is set. if (controlTemplate == null) { throw new Exception("The control template needs to be defined!"); } // Make sure the output directory is set. if (outputDirectory == null) { throw new Exception("The output directory needs to be defined!"); } // Make sure there is an output file. if (outputFile == null) { throw new Exception("The output file needs to be defined!"); } // Process the context properties if (contextPropertiesFile != null) { processContextProperties(contextPropertiesFile); } try { // Setup the Velocity Runtime. if (templatePath != null) { processTemplatePath(templatePath); log("Using templatePath: " + templatePath); Velocity.setProperty( Velocity.FILE_RESOURCE_LOADER_PATH, templatePath); } if (useClasspath) { log("Using classpath"); Velocity.addProperty( Velocity.RESOURCE_LOADER, "classpath"); Velocity.setProperty( "classpath." + Velocity.RESOURCE_LOADER + ".class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); Velocity.setProperty( "classpath." + Velocity.RESOURCE_LOADER + ".cache", "false"); Velocity.setProperty( "classpath." + Velocity.RESOURCE_LOADER + ".modificationCheckInterval", "2"); } Velocity.init(); // Create the text generator. Generator generator = Generator.getInstance(); generator.setOutputPath(outputDirectory); generator.setInputEncoding(inputEncoding); generator.setOutputEncoding(outputEncoding); if (templatePath != null) { generator.setTemplatePath(templatePath); } // Make sure the output directory exists, if it doesn't // then create it. File file = new File(outputDirectory); if (! file.exists()) { file.mkdirs(); } String path = outputDirectory + File.separator + outputFile; log("Generating to file " + path); Writer writer = generator.getWriter(path, outputEncoding); // The generator and the output path should // be placed in the init context here and // not in the generator class itself. Context c = initControlContext(); // Everything in the generator class should be // pulled out and placed in here. What the generator // class does can probably be added to the Velocity // class and the generator class can probably // be removed all together. populateInitialContext(c); // Feed all the options into the initial // control context so they are available // in the control/worker templates. if (contextProperties != null) { Iterator i = contextProperties.getKeys(); while (i.hasNext()) { String property = (String) i.next(); String value = contextProperties.getString(property); // Now lets quickly check to see if what // we have is numeric and try to put it // into the context as an Integer. try { c.put(property, new Integer(value)); } catch (NumberFormatException nfe) { // Now we will try to place the value into // the context as a boolean value if it // maps to a valid boolean value. String booleanString = contextProperties.testBoolean(value); if (booleanString != null) { c.put(property, new Boolean(booleanString)); } else { // We are going to do something special // for properties that have a "file.contents" // suffix: for these properties will pull // in the contents of the file and make // them available in the context. So for // a line like the following in a properties file: // // license.file.contents = license.txt // // We will pull in the contents of license.txt // and make it available in the context as // $license. This should make texen a little // more flexible. if (property.endsWith("file.contents")) { // We need to turn the license file from relative to // absolute, and let Ant help :) value = StringUtils.fileContentsToString( resolveFile(value).getCanonicalPath()); property = property.substring( 0, property.indexOf("file.contents") - 1); } c.put(property, value); } } } } writer.write(generator.parse(controlTemplate, c)); writer.flush(); writer.close(); generator.shutdown(); cleanup(); } catch( MethodInvocationException e ) { throw new Exception( "Exception thrown by '" + e.getReferenceName() + "." + e.getMethodName() +"'" + ERR_MSG_FRAGMENT); } catch( ParseErrorException e ) { throw new Exception("Velocity syntax error" + ERR_MSG_FRAGMENT); } catch( ResourceNotFoundException e ) { throw new Exception("Resource not found" + ERR_MSG_FRAGMENT); } catch( Exception e ) { throw new Exception("Generation failed" + ERR_MSG_FRAGMENT); } } /** * <p>Place useful objects into the initial context.</p> * * <p>TexenTask places <code>Date().toString()</code> into the * context as <code>$now</code>. Subclasses who want to vary the * objects in the context should override this method.</p> * * <p><code>$generator</code> is not put into the context in this * method.</p> * * @param context The context to populate, as retrieved from * {@link #initControlContext()}. * * @throws Exception Error while populating context. The {@link * #execute()} method will catch and rethrow as a * <code>BuildException</code>. */ protected void populateInitialContext(Context context) throws Exception { context.put("now", new Date().toString()); } /** * A hook method called at the end of {@link #execute()} which can * be overridden to perform any necessary cleanup activities (such * as the release of database connections, etc.). By default, * does nothing. * * @exception Exception Problem cleaning up. */ protected void cleanup() throws Exception { } /** * Log a message. Use the Ant logging system if being * used as an Ant Task. */ private void log(String message) { if (project != null) { project.log(message); } else { System.out.println(message); } } /** * Resolve a file. Use the baseDir of the project if * being run as an Ant Task. A couple methods */ private File resolveFile(String file) throws Exception { if (project != null) { return project.resolveFile(file); } else { return new File(file); } } } -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Tue Mar 05 11:07:38 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 16964 invoked from network); 5 Mar 2002 11:07:38 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 5 Mar 2002 11:07:38 -0000 Received: (qmail 9203 invoked by uid 97); 5 Mar 2002 11:07:50 -0000 Delivered-To: ejones@example.org Received: (qmail 9162 invoked by uid 97); 5 Mar 2002 11:07:49 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 9151 invoked from network); 5 Mar 2002 11:07:48 -0000 Message-ID: <ejones@example.org> Date: Tue, 05 Mar 2002 12:12:45 +0100 From: Gabriel Sidler <ejones@example.org> X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: ejones@example.org Subject: Re: [VelTools] Velocity for Struts Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, based on the discussed API for Velocity for Struts I implemented the context tools. I have put together a demo application that incudes several small application examples as well as reference documentation for the context tools. The demo can be downloaded from http://www.teamup.com/velstruts/velstruts.war [1.3 MB] This is a ready-to-deploy war file. Put it into the webapps directory of your favorite servlet container and restart. Then point your browser at http://yourserver:port/velstruts/ While implementing the API I came across several weaknesses of the discussed API. I made the changes outlined below. Please review and yell if you feel something is going the wrong way. Please refer to the reference documentation in the war files for details. The code is now structured such that all Struts Know-How is kept in a class StrutsUtils. This is a utility class with all static methods. All context tools use it to access to the Struts resources. This avoids the spreading of Struts Know How all over. The methods of StrutsUtils reflect what Velocity context tools need from Struts. I hope that at some point these utilities can be integrated into Struts itself. I introduced an abstract context tool ServletContextTool. All Struts context tools extend ServletContextTool. It provides logging to the logging facility provided by the Servlet API. I am not fully satisfied yet with this approach. I think we should forsee logging support already in the ContextTool interface. My intention is now to wait for feedback, make necessary improvements and then commit this software to jakarta-velocity-tools within about a week. My next planned steps are the following: - setup test cases - add documentation: overview, user guide, quick reference guide - make documentation printable - put together a binary distribution with examples and a blank application and announce it to the world - add ActionMessagesTool - rework the current logging concept for context tools - add capability to config Velocity - remove Velocity's [INFO] logging for each template Your feedback is appreciated. Gabe -------------------------------------------------------------------- API Changes in 0.6: - MessageTool - Added method public get(String key, ArrayList args). It's more Velocity compatible than get(String key, Object[]). I left the latter to stay compatibility with existing apps. - LinkTool: - Renamed setPath() to setURI(). This method takes absolute URIs, server-relative URIs, relative URIs and URIs with query parameters. The new name is more accurately reflecting what the method does. - Renamed getServerPath() to getContextURI(). This naming is consistent with the naming used in the Servlet API and it seems also more intuitive. - Added method getContextPath(). This is a natural complement to method getContextURI() - I based my implementation of LinkTool on the implementation contributed by Nathan. I changed the following aspects: - Added support to work with relative URIs (in addition to absolute URIs) - Added support to work with URIs that point to other servers - Added support to resolve Struts action names to URI references - Added support to resolve Struts forwards to URI references - ErrorsTool: - Added method public boolean exist(String property). This is a natural complement to public boolean exist(). - Changed methods get() and getAll() to return ArrayLists instead of HashMaps. With ArrayList the sequence of error messages is maintained. This was not the case before. - Introduced methods getMsgs() and getMsgs(String property). These two methods generate the necessary markup to display error messages in the view. All the markup is configurable in the message resources. We discussed previouly to skip these methods and instead recommend the use of a macro to render error messages. While creating some examples for the documentation I realized that it is very painful to have to write a macro each time you want to render some error messages. Displaying error messages is such a basic and frequently needed feature that I feel we need to provide basic support for it in the ErrorsTool. It is still possible to use macros to custom format error messages. - FormTool: - Added method getTokenName() to retrieve the request parameter name that must be used for the transaction token. This is necessary to be able to handle the transaction token. - ActionMessages: - Not implmented yet. This is a feature of the upcoming Struts 1.1 release. I need to study this in more detail to really understand what the intended behavior is in relation to the ErrorMessages -------------------------------------------------------------------- -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Tue Mar 05 12:29:14 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 59206 invoked from network); 5 Mar 2002 12:29:13 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 5 Mar 2002 12:29:13 -0000 Received: (qmail 17898 invoked by uid 97); 5 Mar 2002 12:29:11 -0000 Delivered-To: ejones@example.org Received: (qmail 17876 invoked by uid 97); 5 Mar 2002 12:29:11 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 17865 invoked from network); 5 Mar 2002 12:29:10 -0000 Date: Tue, 05 Mar 2002 07:29:07 -0500 From: "Geir Magnusson Jr." <ejones@example.org> Subject: Re: [VelTools] Velocity for Struts In-reply-to: <ejones@example.org> To: Velocity Developer's List <ejones@example.org> Message-id: <ejones@example.org> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT User-Agent: Microsoft-Entourage/83.161.120.1559 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On 3/5/02 6:12 AM, "Gabriel Sidler" <ejones@example.org> wrote: > Hi, > based on the discussed API for Velocity for Struts I implemented > the context tools. I have put together a demo application that > incudes several small application examples as well as reference > documentation for the context tools. The demo can be downloaded > from > > http://www.teamup.com/velstruts/velstruts.war [1.3 MB] > > This is a ready-to-deploy war file. Put it into the webapps > directory of your favorite servlet container and restart. Then > point your browser at http://yourserver:port/velstruts/ > > While implementing the API I came across several weaknesses of > the discussed API. I made the changes outlined below. Please review > and yell if you feel something is going the wrong way. Please refer > to the reference documentation in the war files for details. > > The code is now structured such that all Struts Know-How is > kept in a class StrutsUtils. This is a utility class with all > static methods. All context tools use it to access to the > Struts resources. This avoids the spreading of Struts Know How > all over. The methods of StrutsUtils reflect what Velocity context > tools need from Struts. I hope that at some point these > utilities can be integrated into Struts itself. It would have been cuter if you called it 'StrutsKnowHow'. > > I introduced an abstract context tool ServletContextTool. All > Struts context tools extend ServletContextTool. It provides > logging to the logging facility provided by the Servlet API. > I am not fully satisfied yet with this approach. I think we > should forsee logging support already in the ContextTool interface. Struts has no concept of logging???? -- Geir Magnusson Jr. ejones@example.org System and Software Consulting The question is : What is a Mahnamahna? -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Tue Mar 05 13:34:22 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 6966 invoked from network); 5 Mar 2002 13:34:22 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 5 Mar 2002 13:34:22 -0000 Received: (qmail 13147 invoked by uid 97); 5 Mar 2002 13:34:21 -0000 Delivered-To: ejones@example.org Received: (qmail 13125 invoked by uid 97); 5 Mar 2002 13:34:21 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 13088 invoked from network); 5 Mar 2002 13:34:20 -0000 Message-ID: <ejones@example.org> Date: Tue, 05 Mar 2002 14:39:11 +0100 From: Gabriel Sidler <ejones@example.org> X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: Velocity Developers List <ejones@example.org> Subject: Re: [VelTools] Velocity for Struts References: <ejones@example.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N "Geir Magnusson Jr." wrote: [..] > > The code is now structured such that all Struts Know-How is > > kept in a class StrutsUtils. This is a utility class with all > > static methods. All context tools use it to access to the > > Struts resources. This avoids the spreading of Struts Know How > > all over. The methods of StrutsUtils reflect what Velocity context > > tools need from Struts. I hope that at some point these > > utilities can be integrated into Struts itself. > > It would have been cuter if you called it 'StrutsKnowHow'. Are you serious? :-) This sounds a little awkward... > > > > > I introduced an abstract context tool ServletContextTool. All > > Struts context tools extend ServletContextTool. It provides > > logging to the logging facility provided by the Servlet API. > > I am not fully satisfied yet with this approach. I think we > > should forsee logging support already in the ContextTool interface. > > Struts has no concept of logging???? Standard Struts relies on the logging facilities provided by the servlet API. It adds a thin layer that supports log levels (as a log() method of the Struts servlet). There's now some discussion on the dev list about adding the commons logging. But, how do context tools get access to the logging facilities? That's not straightforward. The current ContextTool interface doesn't forsee anything. One approach would be to add a setLogger(Logger l) method to the ContextTool interface. A context tool manager, like VelocityViewServlet, could then use this method to pass a reference to a logger. Such an approach wouldn't be specific to a servlet environments. Gabe > > > -- > Geir Magnusson Jr. ejones@example.org > System and Software Consulting > The question is : What is a Mahnamahna? -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Tue Mar 05 13:42:42 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 14432 invoked from network); 5 Mar 2002 13:42:42 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 5 Mar 2002 13:42:42 -0000 Received: (qmail 18661 invoked by uid 97); 5 Mar 2002 13:42:41 -0000 Delivered-To: ejones@example.org Received: (qmail 18645 invoked by uid 97); 5 Mar 2002 13:42:41 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 18567 invoked from network); 5 Mar 2002 13:42:40 -0000 Date: Tue, 05 Mar 2002 08:42:35 -0500 From: "Geir Magnusson Jr." <ejones@example.org> Subject: Re: [VelTools] Velocity for Struts In-reply-to: <ejones@example.org> To: Velocity Developer's List <ejones@example.org> Message-id: <ejones@example.org> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT User-Agent: Microsoft-Entourage/83.161.120.1559 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On 3/5/02 8:39 AM, "Gabriel Sidler" <ejones@example.org> wrote: > "Geir Magnusson Jr." wrote: > [..] >>> The code is now structured such that all Struts Know-How is >>> kept in a class StrutsUtils. This is a utility class with all >>> static methods. All context tools use it to access to the >>> Struts resources. This avoids the spreading of Struts Know How >>> all over. The methods of StrutsUtils reflect what Velocity context >>> tools need from Struts. I hope that at some point these >>> utilities can be integrated into Struts itself. >> >> It would have been cuter if you called it 'StrutsKnowHow'. > > Are you serious? :-) This sounds a little awkward... No, not serious :) -- Geir Magnusson Jr. ejones@example.org System and Software Consulting "Whoever would overthrow the liberty of a nation must begin by subduing the freeness of speech." - Benjamin Franklin -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Tue Mar 05 22:12:31 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 68424 invoked from network); 5 Mar 2002 22:12:30 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 5 Mar 2002 22:12:30 -0000 Received: (qmail 1140 invoked by uid 97); 5 Mar 2002 22:12:35 -0000 Delivered-To: ejones@example.org Received: (qmail 1110 invoked by uid 97); 5 Mar 2002 22:12:34 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 1069 invoked from network); 5 Mar 2002 22:12:32 -0000 Date: Tue, 5 Mar 2002 23:12:24 +0100 From: Incze Lajos <ejones@example.org> To: Velocity Developers List <ejones@example.org> Subject: Re: [VelTools] Velocity for Struts Message-ID: <ejones@example.org> References: <ejones@example.org> <ejones@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/83.161.120.155i In-Reply-To: <ejones@example.org>; from ejones@example.org on Tue, Mar 05, 2002 at 02:39:11PM +0100 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > > Struts has no concept of logging???? > > Standard Struts relies on the logging facilities provided by the servlet > API. It adds a thin layer that supports log levels (as a log() method of the > Struts servlet). There's now some discussion on the dev list about adding > the commons logging. Recently the commons-logging was introduced in the head branch. incze -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Wed Mar 06 08:02:43 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 14617 invoked from network); 6 Mar 2002 08:02:43 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 6 Mar 2002 08:02:43 -0000 Received: (qmail 7551 invoked by uid 97); 6 Mar 2002 08:02:54 -0000 Delivered-To: ejones@example.org Received: (qmail 7513 invoked by uid 97); 6 Mar 2002 08:02:53 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 7494 invoked by uid 50); 6 Mar 2002 08:02:52 -0000 Date: 6 Mar 2002 08:02:52 -0000 Message-ID: <ejones@example.org> From: ejones@example.org To: ejones@example.org Cc: Subject: DO NOT REPLY [Bug 6901] New: - Escaping examples wrong X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6901>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6901 Escaping examples wrong Summary: Escaping examples wrong Product: Velocity Version: 1.2 Platform: All URL: http://jakarta.apache.org/velocity/user-guide.html OS/Version: All Status: NEW Severity: Normal Priority: Other Component: Documentation AssignedTo: ejones@example.org ReportedBy: ejones@example.org On page: http://jakarta.apache.org/velocity/user-guide.html ## The following line defines $email in this template: #set( $email = "foo" ) $email \$email \\$email \\\$email does not render as the documentation states foo $email \$email \\$email but rather foo $email \foo \$email The same error is also faithfully reproduced in the Finnish User Manual http://jakarta.apache.org/velocity/user-guide_fi.html -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Wed Mar 06 13:32:22 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 15810 invoked from network); 6 Mar 2002 13:32:22 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 6 Mar 2002 13:32:22 -0000 Received: (qmail 4909 invoked by uid 97); 6 Mar 2002 13:32:20 -0000 Delivered-To: ejones@example.org Received: (qmail 4878 invoked by uid 97); 6 Mar 2002 13:32:19 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 4864 invoked by uid 50); 6 Mar 2002 13:32:19 -0000 Date: 6 Mar 2002 13:32:19 -0000 Message-ID: <ejones@example.org> From: ejones@example.org To: ejones@example.org Cc: Subject: DO NOT REPLY [Bug 6901] - Escaping examples wrong X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6901>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6901 Escaping examples wrong ejones@example.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED ------- Additional Comments From ejones@example.org 2002-03-06 13:32 ------- thanks. You are right. -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Wed Mar 06 17:13:14 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 44183 invoked from network); 6 Mar 2002 17:13:14 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 6 Mar 2002 17:13:14 -0000 Received: (qmail 9793 invoked by uid 97); 6 Mar 2002 17:13:12 -0000 Delivered-To: ejones@example.org Received: (qmail 9719 invoked by uid 97); 6 Mar 2002 17:13:11 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 9646 invoked from network); 6 Mar 2002 17:13:10 -0000 Message-ID: <ejones@example.org> From: "Nathan Bubna" <ejones@example.org> To: "Velocity Developers List" <ejones@example.org> References: <ejones@example.org> Subject: Re: [VelTools] Velocity for Struts Date: Wed, 6 Mar 2002 09:11:29 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N [...] > I introduced an abstract context tool ServletContextTool. All > Struts context tools extend ServletContextTool. It provides > logging to the logging facility provided by the Servlet API. > I am not fully satisfied yet with this approach. I think we > should forsee logging support already in the ContextTool interface. yeah, i'm not fully satisfied with this either. i would prefer at some point to pass logging off to a more configurable log system. i don't know anything about what support struts has (if any) for logging, but we should prefer to hook into that if/when it exists. i would like to see similar things happen with the logging for the VelocityViewServlet. at present it is using a mix of the ServletContext log and System.out, neither of which is appealing to me. > My intention is now to wait for feedback, make necessary > improvements and then commit this software to > jakarta-velocity-tools within about a week. > > My next planned steps are the following: > - setup test cases > - add documentation: overview, user guide, quick reference guide > - make documentation printable > - put together a binary distribution with examples and a blank > application and announce it to the world > - add ActionMessagesTool > - rework the current logging concept for context tools > - add capability to config Velocity i really look forward to this!! IMO this is one of the biggest things missing. i've entertained the idea of finding some time to add this to the velocity view stuff myself. i may still... > - remove Velocity's [INFO] logging for each template > > > Your feedback is appreciated. hey, it's the least we (i?) can do. i really appreciate all the work you've put into organizing and developing this! > Gabe > > -------------------------------------------------------------------- > API Changes in 0.6: > > - MessageTool > - Added method public get(String key, ArrayList args). It's more > Velocity compatible than get(String key, Object[]). I left > the latter to stay compatibility with existing apps. +1 actually, since this is a tool specifically for use in Velocity templates and we're changing most things anyway, i think perhaps we should remove the get(String,Object[]) method altogether. i know i'm certainly not dependant on it. > - LinkTool: > - Renamed setPath() to setURI(). This method takes absolute > URIs, server-relative URIs, relative URIs and URIs with query > parameters. The new name is more accurately reflecting what the > method does. > - Renamed getServerPath() to getContextURI(). This naming is > consistent with the naming used in the Servlet API and it seems > also more intuitive. > - Added method getContextPath(). This is a natural complement to > method getContextURI() > - I based my implementation of LinkTool on the implementation > contributed by Nathan. I changed the following aspects: > - Added support to work with relative URIs (in addition to > absolute URIs) > - Added support to work with URIs that point to other servers > - Added support to resolve Struts action names to URI references > - Added support to resolve Struts forwards to URI references +1 > - ErrorsTool: > - Added method public boolean exist(String property). This is a > natural complement to public boolean exist(). > - Changed methods get() and getAll() to return ArrayLists instead > of HashMaps. With ArrayList the sequence of error messages is > maintained. This was not the case before. ick. that kills the option of doing things like $!errors.login_errors.invalid_username and basically forces people to loop over errors like #foreach( $error in $errors.login_errors) $error #end or do something truly evil like $errors.login_errors.get(0) instead of allowing them to access individual messages directly by their key. so, i find myself conflicted. i agree, we need to have the errors maintain their order, but i'm loathe to give up direct access by key. perhaps we need to consider returning a Map or List class of our own that would maintain the order and still allow get(key) access. > - Introduced methods getMsgs() and getMsgs(String property). These > two methods generate the necessary markup to display error messages > in the view. All the markup is configurable in the message resources. > We discussed previouly to skip these methods and instead recommend > the use of a macro to render error messages. > While creating some examples for the documentation I realized that > it is very painful to have to write a macro each time you > want to render some error messages. Displaying error messages is > such a basic and frequently needed feature that I feel we need to > provide basic support for it in the ErrorsTool. It is still > possible to use macros to custom format error messages. -1 ok, i fully agree that it is ridiculous to write an #errorMarkup macro for each template, but this is why we need to allow for Velocity configuration. the #errorMarkup velocimacro should be a global macro so that you need only write it once. still, even as things presently are, you can write it in a template on it's own and #parse that template at the top of any other templates you need it in. if you insist, then i suppose i can abide the presence of these methods until the time that such velocity configurability is added :-). but i think at the very least, these methods should be surrounded by glaring warnings of their future demise to discourage any new users to become reliant upon them. i'm REALLY not a fan of adding this functionality. > - FormTool: > - Added method getTokenName() to retrieve the request parameter name > that must be used for the transaction token. This is necessary to > be able to handle the transaction token. +1 > - ActionMessages: > - Not implmented yet. This is a feature of the upcoming Struts 1.1 > release. I need to study this in more detail to really understand > what the intended behavior is in relation to the ErrorMessages yeah, makes sense to wait for ejones@example.org. i'm still fuzzy on this too. Nathan Bubna ejones@example.org -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Wed Mar 06 20:30:29 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 41323 invoked from network); 6 Mar 2002 20:30:28 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 6 Mar 2002 20:30:28 -0000 Received: (qmail 18807 invoked by uid 97); 6 Mar 2002 20:30:29 -0000 Delivered-To: ejones@example.org Received: (qmail 18795 invoked by uid 97); 6 Mar 2002 20:30:28 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 17667 invoked from network); 6 Mar 2002 20:25:59 -0000 Message-ID: <ejones@example.org> Date: Wed, 06 Mar 2002 20:23:47 +0000 From: Paul Hammant <ejones@example.org> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7) Gecko/20011221 X-Accept-Language: en-us MIME-Version: 1.0 To: ejones@example.org Subject: ForumDemo copied to EOB CVS Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Folks, As a coutesy I thought I'd mention that I have forked the 'ForumDemo' out of Velocity CVS and into that of Enterprise Object Broker (EOB). Essentially the indentical Velocity webapp is launched by EOB nearly unchnaged, but the Message and ForumDataBase classes have been changed ( separated into interface/impl and ForumDatabase is no longer static) The ControllerServlet rather than handling the object model directly, now does a lookup on the single instance of ForumDatabase, and also treats the Message interface as a pass-by-reference boundary. The MessageImpl and ForumDatabaseImpl beans do not persist, that might follow. Velocity itself is in jar form, and is a snapshot from CVS this morning. For people interested in the technology, Velocity is running insode the 'Jo!' webserver which sits alongside EOB on top on Avalon-Phoenix in one JVM. AltRMI glues the beans to the servlet, sadly in this case that means sockets until some JNDI enhancements to AltRMI are started. For those interested in the EOB project, check out http://eob.sourceforge.net/ Ignore the 0.20 release as it does not have the ForumDemo in it. If you are CVS and Ant savvy, you should manage to build and launch the demo. Apache license and original author honoured in the forked demo. Thanks folks. Regards, - Paul -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Wed Mar 06 22:21:21 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 30645 invoked from network); 6 Mar 2002 22:21:20 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 6 Mar 2002 22:21:20 -0000 Received: (qmail 20939 invoked by uid 97); 6 Mar 2002 22:21:24 -0000 Delivered-To: ejones@example.org Received: (qmail 20923 invoked by uid 97); 6 Mar 2002 22:21:24 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 20912 invoked from network); 6 Mar 2002 22:21:24 -0000 Message-ID: <ejones@example.org> Date: Wed, 06 Mar 2002 17:09:11 -0500 From: Andrus Adamchik <ejones@example.org> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020205 X-Accept-Language: en-us MIME-Version: 1.0 To: ejones@example.org Subject: JNDI resource loader Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I am planning to use org.apache.velocity.runtime.resource.loader.ResourceLoader and its concrete implementations for things unrelated to Velocity template loading. It looks like these classes would help to define a clear policy as to where the resources are loaded from. (Unless somebody knows of a better package to handle resources ?) Question is - is there a subclass of ResourceLoader used to load resources via JNDI? If not, I will write my own, just didn't want to reinvent the wheel. -- ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- - Andrei (a.k.a. Andrus) Adamchik Home of Cayenne - O/R Persistence Framework http://objectstyle.org/cayenne/ email: ejones@example.org -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Wed Mar 06 22:29:00 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 35645 invoked from network); 6 Mar 2002 22:28:59 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 6 Mar 2002 22:28:59 -0000 Received: (qmail 751 invoked by uid 97); 6 Mar 2002 22:29:04 -0000 Delivered-To: ejones@example.org Received: (qmail 714 invoked by uid 97); 6 Mar 2002 22:29:04 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 703 invoked from network); 6 Mar 2002 22:29:03 -0000 Date: Wed, 06 Mar 2002 17:28:55 -0500 From: "Geir Magnusson Jr." <ejones@example.org> Subject: Re: JNDI resource loader In-reply-to: <ejones@example.org> To: Velocity Developer's List <ejones@example.org> Message-id: <ejones@example.org> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT User-Agent: Microsoft-Entourage/83.161.120.1559 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On 3/6/02 5:09 PM, "Andrus Adamchik" <ejones@example.org> wrote: > I am planning to use > org.apache.velocity.runtime.resource.loader.ResourceLoader and its > concrete implementations for things unrelated to Velocity template > loading. It looks like these classes would help to define a clear policy > as to where the resources are loaded from. (Unless somebody knows of a > better package to handle resources ?) > > Question is - is there a subclass of ResourceLoader used to load > resources via JNDI? > > If not, I will write my own, just didn't want to reinvent the wheel. > I thought there was some stuff over in the new turbine projects, I think fulcrum or stratum? -- Geir Magnusson Jr. ejones@example.org System and Software Consulting "He who throws mud only loses ground." - Fat Albert -- To unsubscribe, e-mail: <mailto:ejones@example.org> For additional commands, e-mail: <mailto:ejones@example.org> From velocity-dev-returnejones@example.org Thu Mar 07 00:40:52 2002 Return-Path: <velocity-dev-returnejones@example.org> Delivered-To: ejones@example.org Received: (qmail 15022 invoked from network); 7 Mar 2002 00:40:52 -0000 Received: from unknown (HELO nagoya.betaversion.org) (83.161.120.155) by daedalus.apache.org with SMTP; 7 Mar 2002 00:40:52 -0000 Received: (qmail 4959 invoked by uid 97); 7 Mar 2002 00:40:57 -0000 Delivered-To: ejones@example.org Received: (qmail 4920 invoked by uid 97); 7 Mar 2002 00:40:57 -0000 Mailing-List: contact ejones@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:ejones@example.org> List-Subscribe: <mailto:ejones@example.org> List-Help: <mailto:ejones@example.org> List-Post: <mailto:ejones@example.org> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <ejones@example.org> Delivered-To: mailing list ejones@example.org Received: (qmail 568 invoked from network); 7 Mar 2002 00:38:02 -0000 Subject: [viewservlet] oddities with the ChainedContext MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 6 Mar 2002 06:38:31 -0800 Message-ID: <ejones@example.org> X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0 content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [viewservlet] oddities with the ChainedContext Thread-Index: AcHFHjR5UH/VT4umRw+N9KxrGsrRyA== From: "Jeff Schnitzer" <ejones@example.org> To: <ejones@example.org> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I'm trying to patch the VelocityViewServlet so that the same context is
{'source': 'Apache Software Foundation Public Mail Archives'}