Picon
Favicon

[jira] [Created] (VELOCITY-817) Dynamic Templates with Caching

Dynamic Templates with Caching
------------------------------

                 Key: VELOCITY-817
                 URL: https://issues.apache.org/jira/browse/VELOCITY-817
             Project: Velocity
          Issue Type: Improvement
          Components: Engine
    Affects Versions: 1.7
            Reporter: Mark S

I thought I would share the following code with the Apache Velocity community.

Problem Description:  I wanted to use Dynamic Templates though I found the following had massive
performance implications.

-- Velocity Call Snippet --
{code}
String template = "message.to:  ${message.to} ";
StringWriter velocityWriter = new StringWriter();
velocityEngine.evaluate( velocityContext, velocityWriter, "LOG", template );
return velocityWriter.toString();
{code}
-- Velocity Call Snippet --

As such, I needed an alternate solution and guessed that if I could cache the Velocity templates used I could
see big performance gains.

I initially looked to the org.apache.velocity.runtime.resource.loader.StringResourceLoader class
to solve my problems.   The StringResourceLoader class requires an instance of the
(Continue reading)

Picon
Favicon

[jira] [Updated] (VELOCITY-719) Unwritable velocity.log appears to cause Velocity initialization to fail, leaving velocity dead and useless.


     [
https://issues.apache.org/jira/browse/VELOCITY-719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Georg Kallidis updated VELOCITY-719:
------------------------------------

    Comment: was deleted

(was: may be this is related. The definition in TR.properties of the velocity log is

services.VelocityService.runtime.log=/log/velocity.log

If using as VelocityService the default class
org.apache.turbine.services.velocity.TurbineVelocityService 

you find in the method createVelocityProperties(..)  (which is called when initializing) a condition: 

if (!key.endsWith(RESOURCE_LOADER_PATH) {... continue } 

and only after pathes are resolved relative to the web-app. 

If you consider this, then e.g defining runtime.log as above you end up (in may case) with a log in C:/log/velocity.log.

)

> Unwritable velocity.log appears to cause Velocity initialization to fail, leaving velocity dead and
useless. 
> -------------------------------------------------------------------------------------------------------------
>
(Continue reading)

Picon
Favicon

[jira] [Issue Comment Edited] (VELOCITY-719) Unwritable velocity.log appears to cause Velocity initialization to fail, leaving velocity dead and useless.


    [
https://issues.apache.org/jira/browse/VELOCITY-719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13197896#comment-13197896
] 

Georg Kallidis edited comment on VELOCITY-719 at 2/1/12 3:14 PM:
-----------------------------------------------------------------

may be this is related. The definition in TR.properties of the velocity log is

services.VelocityService.runtime.log=/log/velocity.log

If using as VelocityService the default class
org.apache.turbine.services.velocity.TurbineVelocityService 

you find in the method createVelocityProperties(..)  (which is called when initializing) a condition: 

if (!key.endsWith(RESOURCE_LOADER_PATH) {... continue } 

and only after pathes are resolved relative to the web-app. 

If you consider this, then e.g defining runtime.log as above you end up (in may case) with a log in C:/log/velocity.log.

                
      was (Author: gm_kall):
    may be this is related. The definition in TR.properties 

services.VelocityService.runtime.log=/log/velocity.log

If using as VelocityService org.apache.turbine.services.velocity.TurbineVelocityService in
(Continue reading)

Picon
Favicon

[jira] [Created] (VELOCITY-816) Upgrade commons-lang from 2.4 to 2.6.

Upgrade commons-lang from 2.4 to 2.6.
-------------------------------------

                 Key: VELOCITY-816
                 URL: https://issues.apache.org/jira/browse/VELOCITY-816
             Project: Velocity
          Issue Type: Improvement
            Reporter: Craig P. Motlin
             Fix For: 1.7.x

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
Christopher Schultz | 19 Jan 17:19

Update on VELTOOLS-143

All,

I logged VELTOOLS-143 a while ago and I'd like to get it fixed for an
upcoming release of my own software.

Can someone help me understand why mailto: links don't accept params?

Thanks,
-chris

Darren Cruse | 16 Jan 15:12
Picon

Re: [jira] [Resolved] (VELOCITY-814) Allow for overriding the query used by DataSourceResourceLoader

Thanks that's great.  

Do you have any guess when that 2.x version will be released btw?

(doesn't really matter partly I'm just curious)

Sent from my iPad

On Jan 13, 2012, at 1:38 PM, "Nathan Bubna (Resolved) (JIRA)" <dev <at> velocity.apache.org> wrote:

> 
>     [
https://issues.apache.org/jira/browse/VELOCITY-814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> 
> Nathan Bubna resolved VELOCITY-814.
> -----------------------------------
> 
>       Resolution: Fixed
>    Fix Version/s:     (was: 1.7.x)
>                   2.x
> 
> Sorry it took so long.  Holidays and all...
> 
> I applied the patch to 2.x, as that is the trunk now and likely next version.
> 
>> Allow for overriding the query used by DataSourceResourceLoader
>> ---------------------------------------------------------------
>> 
>>                Key: VELOCITY-814
>>                URL: https://issues.apache.org/jira/browse/VELOCITY-814
(Continue reading)

Picon
Favicon

[jira] [Created] (VELOCITY-815) MapGetExecutor is very slow

MapGetExecutor is very slow
---------------------------

                 Key: VELOCITY-815
                 URL: https://issues.apache.org/jira/browse/VELOCITY-815
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 1.7.x, 2.x
            Reporter: Oswaldo Hernandez

When MapGetExecutor is instantiated by the UberspectImpl it iterates through all the interfaces
implemented by the object's Class to figure out whether it's a java.util.Map 

This could be replaced by an instance of test on the object received by the Uberspect which would be much
faster. We noticed this as a hotspot after upgrading to 1.6 through our Performance Tests JProfiler output.

I am happy to provide a patch for this, it would be nice to get this on the maintenance branch as well if
possible, so that we don't have to maintain a fork until we upgrade.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
Picon
Favicon

[jira] [Created] (VELTOOLS-151) is the "application" a reserved word in the EscapeTool?

is the "application" a reserved word in the EscapeTool?
-------------------------------------------------------

                 Key: VELTOOLS-151
                 URL: https://issues.apache.org/jira/browse/VELTOOLS-151
             Project: Velocity Tools
          Issue Type: Bug
          Components: GenericTools
    Affects Versions: 2.1
            Reporter: jamee.wang

Recently, I use apache velocity for view template in spring framework, and in order to escape the HTML
entity, I introduced the "org.apache.velocity.tools.generic.EscapeTool", however, then I found the
variable named with "$application" cannot work now, that any variable named with "$application" shows
blank, e.g. "$!application.name".

When I removed the velocity tool configuration, "$application" can be read correctly. So anyone knows if
the "$application" a reserved word in velocity escape tool or I make a mistake when configuration?

Toolbox config:
<?xml version="1.0" encoding="UTF-8"?>
<toolbox>
<tool>
<key>esc</key>
<scope>application</scope>
<class>org.apache.velocity.tools.generic.EscapeTool</class>
</tool>
</toolbox>

Config in spring-beans XML:
(Continue reading)

Picon
Favicon

[jira] [Created] (VELTOOLS-150) VelocityLayoutServlet allows clients to specify "layout" without performing any security checks.

VelocityLayoutServlet allows clients to specify "layout" without performing any security checks.
------------------------------------------------------------------------------------------------

                 Key: VELTOOLS-150
                 URL: https://issues.apache.org/jira/browse/VELTOOLS-150
             Project: Velocity Tools
          Issue Type: Bug
          Components: VelocityView
    Affects Versions: 2.0, 1.4
         Environment: Velocity 1.7, Velocity Tools 2.0.
Confirmed also affects Velocity 1.4, Velocity Tools 1.4.
            Reporter: Christopher Schultz
            Priority: Critical

For reference:
http://markmail.org/thread/43cz2dymzmxjjrq5

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
SigmaSquared | 5 Jan 15:44
Picon

Velocity + GWT SplitLayoutPanel


I have a GWT application that renders a Velocity .vm file and displays links
within its panel. The .vm displays search results after the API call is
made.  Whenever the search is first made the .vm file comes back as desired.
But whenever you click on any of the links it looses the GWT application and
displays the results in the application.  I can see how and why, but im
wondering how can i maintain the .vm file within the application with each
hyperlink click?  As im writing this im thinking i should put it in a
frame...? Maybe that might work.  Either way does anyone have any
suggestions?

Regards,

SigmaSquared
--

-- 
View this message in context: http://old.nabble.com/Velocity-%2B-GWT-SplitLayoutPanel-tp33086428p33086428.html
Sent from the Velocity - Dev mailing list archive at Nabble.com.
Picon
Favicon

[jira] [Created] (VELOCITY-814) Allow for overriding the query used by DataSourceResourceLoader

Allow for overriding the query used by DataSourceResourceLoader
---------------------------------------------------------------

                 Key: VELOCITY-814
                 URL: https://issues.apache.org/jira/browse/VELOCITY-814
             Project: Velocity
          Issue Type: Improvement
          Components: Engine
    Affects Versions: 1.7.x
            Reporter: Darren Cruse
            Priority: Minor
             Fix For: 1.7.x

In future versions of Velocity 1.7, allow users of DataSourceResourceLoader to customize the database
query used by extending the class and overriding the getStatement() method.

This would be helpful for users in cases where the table being accessed is pre-existing and has a structure
that does not match the default query.  e.g. The default query does not work if the table has a compound key
rather than a single column key.

This feature is also helpful if the template name passed by velocity differs from what is actually stored in
their table's keys - by overriding getStatement() they can parse the template name passed prior to the
query being run to deal with such differences.

Without this change such users will likely copy and modify the entire DataSourceResourceLoader.java
file, but with this change it's far easier to simply override the getStatement() function alone. 

The necessary changes are simply to: 

a. make the getStatement() function protected not private, and
(Continue reading)


Gmane