Author: wglass
Date: Mon Jan 31 17:27:24 2005
New Revision: 149352
URL: http://svn.apache.org/viewcvs?view=rev&rev=149352
Log:
if VM_global_library.vm can not be found, then give INFO log message, not
error. Thanks Shinobu for the patch.
http://issues.apache.org/bugzilla/show_bug.cgi?id=9938
Modified:
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/RuntimeConstants.java
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/defaults/velocity.properties
Modified:
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/RuntimeConstants.java
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/RuntimeConstants.java?view=diff&r1=149351&r2=149352
==============================================================================
---
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/RuntimeConstants.java
(original)
+++
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/RuntimeConstants.java
Mon Jan 31 17:27:24 2005
@@ -24,7 +24,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: RuntimeConstants.java,v 1.39 2004/03/20 03:35:50 dlr Exp $
+ * @version $Id$
*/
public interface RuntimeConstants
{
@@ -207,6 +207,11 @@
* Name of local Velocimacro library template.
*/
public static final String VM_LIBRARY = "velocimacro.library";
+
+ /**
+ * Default Velocimacro library template.
+ */
+ public static final String VM_LIBRARY_DEFAULT = "VM_global_library.vm";
/**
* switch for autoloading library-sourced VMs (for development)
Modified:
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java?view=diff&r1=149351&r2=149352
==============================================================================
---
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java
(original)
+++
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java
Mon Jan 31 17:27:24 2005
@@ -30,7 +30,7 @@
* manages the set of VMs in a running Velocity engine.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * @version $Id: VelocimacroFactory.java,v 1.19 2004/03/19 17:13:34 dlr Exp $
+ * @version $Id$
*/
public class VelocimacroFactory
{
@@ -134,7 +134,23 @@
*/
Object libfiles = rsvc.getProperty( RuntimeConstants.VM_LIBRARY );
-
+
+ if (libfiles == null)
+ {
+ logVMMessageInfo("Velocimacro : \"" +
RuntimeConstants.VM_LIBRARY +
+ "\" not set. trying default library : " +
RuntimeConstants.VM_LIBRARY_DEFAULT);
+
+ // try the default library.
+ if
(rsvc.getLoaderNameForResource(RuntimeConstants.VM_LIBRARY_DEFAULT) != null)
+ {
+ libfiles = RuntimeConstants.VM_LIBRARY_DEFAULT;
+ }
+ else
+ {
+ logVMMessageInfo("Velocimacro : default library not
found.");
+ }
+ }
+
if( libfiles != null)
{
if (libfiles instanceof Vector)
Modified:
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/defaults/velocity.properties
URL:
http://svn.apache.org/viewcvs/jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/defaults/velocity.properties?view=diff&r1=149351&r2=149352
==============================================================================
---
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/defaults/velocity.properties
(original)
+++
jakarta/velocity/trunk/src/java/org/apache/velocity/runtime/defaults/velocity.properties
Mon Jan 31 17:27:24 2005
@@ -113,7 +113,7 @@
# template path. You may remove it (either the file or this property) if
# you wish with no harm.
#----------------------------------------------------------------------------
-velocimacro.library = VM_global_library.vm
+#velocimacro.library = VM_global_library.vm
velocimacro.permissions.allow.inline = true
velocimacro.permissions.allow.inline.to.replace.global = false
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]