You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by jv...@apache.org on 2001/03/17 20:19:53 UTC

cvs commit: jakarta-velocity/whiteboard/daveb/dajarred velocity.log

jvanzyl     01/03/17 11:19:53

  Modified:    src/java/org/apache/velocity/runtime Runtime.java
               src/java/org/apache/velocity/runtime/configuration
                        Configuration.java
               src/java/org/apache/velocity/runtime/resource
                        ResourceManager.java
               whiteboard/daveb/dajarred velocity.log
  Log:
  - updating after fixes for the configuration test.
  
  Revision  Changes    Path
  1.96      +23 -3     jakarta-velocity/src/java/org/apache/velocity/runtime/Runtime.java
  
  Index: Runtime.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/Runtime.java,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- Runtime.java	2001/03/15 04:42:06	1.95
  +++ Runtime.java	2001/03/17 19:19:52	1.96
  @@ -139,7 +139,7 @@
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:jlb@houseofdistraction.com">Jeff Bowden</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magusson Jr.</a>
  - * @version $Id: Runtime.java,v 1.95 2001/03/15 04:42:06 geirm Exp $
  + * @version $Id: Runtime.java,v 1.96 2001/03/17 19:19:52 jvanzyl Exp $
    */
   public class Runtime implements RuntimeConstants
   {    
  @@ -267,7 +267,7 @@
               InputStream inputStream = classLoader
                   .getResourceAsStream( DEFAULT_RUNTIME_PROPERTIES );
               
  -            configuration.setPropertiesInputStream( inputStream );
  +            configuration.load( inputStream );
               
               info ("Default Properties File: " + 
                   new File(DEFAULT_RUNTIME_PROPERTIES).getPath());
  @@ -295,8 +295,28 @@
           overridingProperties.setProperty( key, value );
       }        
   
  -    public static void addProperty(String key, String value)
  +    /**
  +     * Add a property to the configuration. If it already
  +     * exists then the value stated here will be added
  +     * to the configuration entry. For example, if
  +     *
  +     * resource.loader = file
  +     *
  +     * is already present in the configuration and you
  +     *
  +     * addProperty("resource.loader", "classpath")
  +     *
  +     * Then you will end up with a Vector like the
  +     * following:
  +     *
  +     * ["file", "classpath"]
  +     *
  +     * @param String key
  +     * @param String value
  +     */
  +    public static void addProperty(String key, Object value)
       {
  +        configuration.addProperty(key, value);
       }
       
       /**
  
  
  
  1.15      +24 -1     jakarta-velocity/src/java/org/apache/velocity/runtime/configuration/Configuration.java
  
  Index: Configuration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/configuration/Configuration.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Configuration.java	2001/03/17 18:59:41	1.14
  +++ Configuration.java	2001/03/17 19:19:53	1.15
  @@ -153,7 +153,7 @@
    * @author <a href="mailto:daveb@miceda-data">Dave Bryson</a>
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: Configuration.java,v 1.14 2001/03/17 18:59:41 jvanzyl Exp $
  + * @version $Id: Configuration.java,v 1.15 2001/03/17 19:19:53 jvanzyl Exp $
    */
   public class Configuration extends Hashtable
   {
  @@ -529,6 +529,29 @@
           }
       }
   
  +    /**
  +     * Add a property to the configuration. If it already
  +     * exists then the value stated here will be added
  +     * to the configuration entry. For example, if
  +     *
  +     * resource.loader = file
  +     *
  +     * is already present in the configuration and you
  +     *
  +     * addProperty("resource.loader", "classpath")
  +     *
  +     * Then you will end up with a Vector like the
  +     * following:
  +     *
  +     * ["file", "classpath"]
  +     *
  +     * @param String key
  +     * @param String value
  +     */
  +    public void addProperty(String key, Object value)
  +    {
  +    }
  +    
       /**
        * Save the properties to the given outputstream.
        *
  
  
  
  1.18      +4 -4      jakarta-velocity/src/java/org/apache/velocity/runtime/resource/ResourceManager.java
  
  Index: ResourceManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/resource/ResourceManager.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ResourceManager.java	2001/03/15 04:39:28	1.17
  +++ ResourceManager.java	2001/03/17 19:19:53	1.18
  @@ -55,8 +55,8 @@
    */
   
   import java.util.ArrayList;
  -import java.util.Enumeration;
   import java.util.Hashtable;
  +import java.util.Iterator;
   import java.util.Map;
   import java.util.Vector;
   
  @@ -77,7 +77,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:paulo.gaspar@krankikom.de">Paulo Gaspar</a>
  - * @version $Id: ResourceManager.java,v 1.17 2001/03/15 04:39:28 geirm Exp $
  + * @version $Id: ResourceManager.java,v 1.18 2001/03/17 19:19:53 jvanzyl Exp $
    */
   public class ResourceManager
   {
  @@ -184,10 +184,10 @@
                */
               String loaderID = 
                   resourceLoaderNames.get(i) + "." + Runtime.RESOURCE_LOADER;
  -        
  +
               Configuration loaderConfiguration =
                   Runtime.getConfiguration().subset(loaderID);
  -                
  +
               /*
                * Add resources to the list of resource loader
                * initializers.
  
  
  
  1.3       +47 -47    jakarta-velocity/whiteboard/daveb/dajarred/velocity.log
  
  Index: velocity.log
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/whiteboard/daveb/dajarred/velocity.log,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- velocity.log	2001/03/04 21:50:32	1.2
  +++ velocity.log	2001/03/17 19:19:53	1.3
  @@ -1,47 +1,47 @@
  -Sun Mar 04 16:49:28 EST 2001   [info] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : runtime.log = velocity.log
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : resource.loader.1.description = Velocity Jar Resource Loader
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : external.init = false
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : counter.initial.value = 1
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : resource.loader.1.modificationCheckInterval = 2
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : counter.name = velocityCount
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : include.output.errormsg.start = <!-- include error : 
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : resource.loader.1.cache = false
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : default.contentType = text/html
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : resource.loader.1.public.name = Jar
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : resource.loader.1.class = org.apache.velocity.runtime.resource.loader.JarResourceLoader
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : template.encoding = 8859_1
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : resource.loader.1.resource.path = jar:file:template.jar!/
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : include.output.errormsg.end = see error log -->
  -Sun Mar 04 16:49:28 EST 2001   [info]    ** Property Override : parse_directive.maxdepth = 10
  -Sun Mar 04 16:49:28 EST 2001   [info] Log file being used is: /home/jvanzyl/js/jakarta-velocity/whiteboard/daveb/dajarred/velocity.log
  -Sun Mar 04 16:49:28 EST 2001   [info] Resource Loader Instantiated: org.apache.velocity.runtime.resource.loader.JarResourceLoader
  -Sun Mar 04 16:49:28 EST 2001   [info] Resources Loaded From: jar:file:template.jar!/
  -Sun Mar 04 16:49:28 EST 2001   [info] JarResourceLoader Initialized.
  -Sun Mar 04 16:49:29 EST 2001   [info] Loaded Pluggable Directive: org.apache.velocity.runtime.directive.Literal
  -Sun Mar 04 16:49:29 EST 2001   [info] Loaded Pluggable Directive: org.apache.velocity.runtime.directive.Macro
  -Sun Mar 04 16:49:29 EST 2001   [info] Loaded Pluggable Directive: org.apache.velocity.runtime.directive.Parse
  -Sun Mar 04 16:49:29 EST 2001   [info] Loaded Pluggable Directive: org.apache.velocity.runtime.directive.Include
  -Sun Mar 04 16:49:29 EST 2001   [info] Loaded Pluggable Directive: org.apache.velocity.runtime.directive.Foreach
  -Sun Mar 04 16:49:30 EST 2001   [info] Created: 20 parsers.
  -Sun Mar 04 16:49:30 EST 2001   [info] Velocimacro : initialization starting.
  -Sun Mar 04 16:49:30 EST 2001   [info] Velocimacro : adding VMs from global VM library template : VM_global_library.vm
  -Sun Mar 04 16:49:30 EST 2001   [info] Attempting to find VM_global_library.vm with org.apache.velocity.runtime.resource.loader.JarResourceLoader
  -Sun Mar 04 16:49:30 EST 2001  [error] Resource Not Found
  -Sun Mar 04 16:49:30 EST 2001  [error] ResourceManager.getResource() exception: org.apache.velocity.exception.ResourceNotFoundException: Unknown resource error for resource VM_global_library.vm
  -Sun Mar 04 16:49:30 EST 2001   [info] Velocimacro : error using global VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unknown resource error for resource VM_global_library.vm
  -Sun Mar 04 16:49:30 EST 2001   [info] Velocimacro : no local VM library template used.
  -Sun Mar 04 16:49:30 EST 2001   [info] Velocimacro : allowInline = true : VMs can be defined inline in templates
  -Sun Mar 04 16:49:30 EST 2001   [info] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
  -Sun Mar 04 16:49:30 EST 2001   [info] Velocimacro : allowInlineLocal = false : VMs defined inline will be  global in scope if allowed.
  -Sun Mar 04 16:49:30 EST 2001   [info] Velocimacro : messages on  : VM system will output logging messages
  -Sun Mar 04 16:49:30 EST 2001   [info] Velocimacro : initialization complete.
  -Sun Mar 04 16:49:30 EST 2001   [info] Velocity successfully started.
  -Sun Mar 04 16:49:30 EST 2001   [info] Attempting to find /template/test1.vm with org.apache.velocity.runtime.resource.loader.JarResourceLoader
  -Sun Mar 04 16:49:30 EST 2001   [info] Attempting to find /example/test1.vm with org.apache.velocity.runtime.resource.loader.JarResourceLoader
  -Sun Mar 04 16:49:30 EST 2001  [error] Resource Not Found
  -Sun Mar 04 16:49:30 EST 2001  [error] ResourceManager.getResource() exception: org.apache.velocity.exception.ResourceNotFoundException: Unknown resource error for resource /example/test1.vm
  -Sun Mar 04 16:49:30 EST 2001   [info] Attempting to find /template/test2.vm with org.apache.velocity.runtime.resource.loader.JarResourceLoader
  -Sun Mar 04 16:49:31 EST 2001   [info] Attempting to find /example/yomama.vm with org.apache.velocity.runtime.resource.loader.JarResourceLoader
  -Sun Mar 04 16:49:31 EST 2001  [error] Resource Not Found
  -Sun Mar 04 16:49:31 EST 2001  [error] ResourceManager.getResource() exception: org.apache.velocity.exception.ResourceNotFoundException: Unknown resource error for resource /example/yomama.vm
  +Mon Mar 05 05:41:45 EST 2001   [info] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : runtime.log = velocity.log
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : resource.loader.1.description = Velocity Jar Resource Loader
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : external.init = false
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : counter.initial.value = 1
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : resource.loader.1.modificationCheckInterval = 2
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : counter.name = velocityCount
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : include.output.errormsg.start = <!-- include error : 
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : resource.loader.1.cache = false
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : default.contentType = text/html
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : resource.loader.1.public.name = Jar
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : resource.loader.1.class = org.apache.velocity.runtime.resource.loader.JarResourceLoader
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : template.encoding = 8859_1
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : resource.loader.1.resource.path = jar:file:template.jar!/
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : include.output.errormsg.end = see error log -->
  +Mon Mar 05 05:41:45 EST 2001   [info]    ** Property Override : parse_directive.maxdepth = 10
  +Mon Mar 05 05:41:45 EST 2001   [info] Log file being used is: /home/jvanzyl/js/jakarta-velocity/whiteboard/daveb/dajarred/velocity.log
  +Mon Mar 05 05:41:45 EST 2001   [info] Resource Loader Instantiated: org.apache.velocity.runtime.resource.loader.JarResourceLoader
  +Mon Mar 05 05:41:45 EST 2001   [info] PATHS SIZE= 1
  +Mon Mar 05 05:41:45 EST 2001   [info] Try to load: jar:file:template.jar!/
  +Mon Mar 05 05:41:45 EST 2001   [info] Attemting to connect to jar:file:template.jar!/
  +Mon Mar 05 05:41:45 EST 2001   [info] Initialized JAR: jar:file:template.jar!/
  +Mon Mar 05 05:41:45 EST 2001   [info] JarResourceLoader initialized...
  +Mon Mar 05 05:41:45 EST 2001   [info] Loaded Pluggable Directive: org.apache.velocity.runtime.directive.Literal
  +Mon Mar 05 05:41:45 EST 2001   [info] Loaded Pluggable Directive: org.apache.velocity.runtime.directive.Macro
  +Mon Mar 05 05:41:45 EST 2001   [info] Loaded Pluggable Directive: org.apache.velocity.runtime.directive.Parse
  +Mon Mar 05 05:41:45 EST 2001   [info] Loaded Pluggable Directive: org.apache.velocity.runtime.directive.Include
  +Mon Mar 05 05:41:45 EST 2001   [info] Loaded Pluggable Directive: org.apache.velocity.runtime.directive.Foreach
  +Mon Mar 05 05:41:46 EST 2001   [info] Created: 20 parsers.
  +Mon Mar 05 05:41:46 EST 2001   [info] Velocimacro : initialization starting.
  +Mon Mar 05 05:41:46 EST 2001   [info] Velocimacro : adding VMs from global VM library template : VM_global_library.vm
  +Mon Mar 05 05:41:46 EST 2001   [info] Attempting to find VM_global_library.vm with org.apache.velocity.runtime.resource.loader.JarResourceLoader
  +Mon Mar 05 05:41:46 EST 2001  [error] ResourceManager.getResource() exception: org.apache.velocity.exception.ResourceNotFoundException: Unknown resource error for resource VM_global_library.vm
  +Mon Mar 05 05:41:46 EST 2001   [info] Velocimacro : error using global VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unknown resource error for resource VM_global_library.vm
  +Mon Mar 05 05:41:46 EST 2001   [info] Velocimacro : no local VM library template used.
  +Mon Mar 05 05:41:46 EST 2001   [info] Velocimacro : allowInline = true : VMs can be defined inline in templates
  +Mon Mar 05 05:41:46 EST 2001   [info] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
  +Mon Mar 05 05:41:46 EST 2001   [info] Velocimacro : allowInlineLocal = false : VMs defined inline will be  global in scope if allowed.
  +Mon Mar 05 05:41:46 EST 2001   [info] Velocimacro : messages on  : VM system will output logging messages
  +Mon Mar 05 05:41:46 EST 2001   [info] Velocimacro : initialization complete.
  +Mon Mar 05 05:41:46 EST 2001   [info] Velocity successfully started.
  +Mon Mar 05 05:41:46 EST 2001   [info] Attempting to find /template/test1.vm with org.apache.velocity.runtime.resource.loader.JarResourceLoader
  +Mon Mar 05 05:41:46 EST 2001   [info] Attempting to find /example/test1.vm with org.apache.velocity.runtime.resource.loader.JarResourceLoader
  +Mon Mar 05 05:41:46 EST 2001  [error] ResourceManager.getResource() exception: org.apache.velocity.exception.ResourceNotFoundException: Unknown resource error for resource /example/test1.vm
  +Mon Mar 05 05:41:46 EST 2001   [info] Attempting to find /template/test2.vm with org.apache.velocity.runtime.resource.loader.JarResourceLoader
  +Mon Mar 05 05:41:46 EST 2001   [info] Attempting to find /example/yomama.vm with org.apache.velocity.runtime.resource.loader.JarResourceLoader
  +Mon Mar 05 05:41:46 EST 2001  [error] ResourceManager.getResource() exception: org.apache.velocity.exception.ResourceNotFoundException: Unknown resource error for resource /example/yomama.vm