velocity

Need some help with velocity templates for Jira Plugins

hello, I am trying to develop a plugin for jira and ive having quite a lot of trouble as i have little knowlwdge of how it works. I have a plugin that: adds a button to the options menu in the view issue screen adds a tab in the same screen loads a /secure/action!map.jspa page from a success.vm file. I would like to be able to load fi...

$null check in velocity

Hi, I came to know about null check using $null in velocity 1.6 through a resource updated by you. Resource: http://stackoverflow.com/questions/24495/reading-model-objects-mapped-in-velocity-templates But I am facing so many challenges that there is no $null for null check in velocity as there is no documentation provided about this. Pl...

Velocity statement to add class to last menu item?

I have this velocity code for a simple menu: <div id="header" class="navstrip"> #foreach( $navItem in $navItems ) <a href="$navItem.URL">$navItem.Title</a> | #end </div> I would like to give the last menu link a class of "last". What would the conditional be for that? ...

how to load velocity template dynamically through properties file

I am using velocity templates as view component,and my welcome file is also a .vm file.Here I am facing the problem,when ever I run my application that .vm file is not rendered by the velocity engine.So to render that .vm files at the time of loading application what to do? ...

What is the lexically correct statement in Velocity Template Language

The following line of code is a generic version of a line in a template I'm working on. I have locked at the Velocity Template Language Documentation but I keep gettting errors no matter how I format this statement. This is my first real experience with VTL so I was hoping to get a set of experienced eyes on the issue: #set($includeAt...

String replacement in java, similar to a velocity template

Is there any String replacement mechanism in Java, where I can pass objects with a text, and it replaces the string as it occurs. For example, the text is : Hello ${user.name}, Welcome to ${site.name}. The objects I have are "user" and "site". I want to replace the strings given inside ${} with its equivalent values from the obje...

Unable to load template when URLResourceLoader is used with Velocity

Hi, I am getting the following error when I try to access access Velocity template using URLResourceLoader. org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'http://localhost:8080/myvelocityapp/my-template.vm' at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceMana...

New Line in velocity set directive

How do you append a newline in velocity template using set? This does not work. #(set $some = "$a \n $b") Prints literally \n. Doing this also does not work : VelocityContext context = new VelocityContext(); context.put("esc", new EscapeTool()); Velocity.evaluate(context, writer, "LOG", template); ...

In which project context would you use Velocity instead JPS2-EL?

We are going to start a very small web development project. The team has experience using Velocity in the past, which was a clear option when we were working with JSP 1.2, long before 2.0... but now we have JSP-EL available. Therefore: would you recommend to get rid of Velocity and to invest in JSP2? We are inclined to do so in order to...

How to reset a property in ANT?

Hi, I'm writing a velocity macro within which I have some ant tasks. Within a #foreach loop in the velocity macro, I have a pathconvert task: #foreach(<iterate through something>) <pathconvert property='filename' refid='swf.file'> <mapper> <chainedmapper> <flattenmapper/> ...

What are the main differences between StringTemplate and FreeMarker?

The net seems to be full of comparisons between Velocity and FreeMarker, and they seem to be reasonably equivalent. But there seems to be almost no comparisons between StringTemplate and FreeMarker! So, what are the main differences between StringTemplate and FreeMarker? My usage for them would be to generate HTML pages only. Out of th...

Getting email addresses of all users with the Administrator role

Hi All, We are using dotCMS 1.7a and I am having difficulty getting the email addresses of users in the Administrator role. This SQL works: select user_.emailaddress from user_ INNER JOIN users_roles ON users_roles.userid = user_.userid INNER JOIN role_ ON users_roles.roleid = role_.roleid where role_.name = 'Adm...

How can I access a Velocity template from a sub-subdirectory?

I have a velocity template rendering VXML that is located at /billing/billingQuestionsMenu_pp.vm then, in that template, I am forwarding to: <submit next="#springUrl('/billing/billingQuestions/billingQuestionsMenuOption1.vxml')" /> Now in my Controller, I have a mapped method: @RequestMapping(method = RequestMethod.GET) public Str...

Apache's Velocity Template Engine -- Worst Software Package Ever?

So I'm using Velocity in a legacy project. And even rendering moderately large pages takes FOREVER. Literally 10+ minutes. There has to be some kind of bug I'm hitting... anyone else have bad experiences with Velocity in general? I'm about to start stepping through the source code and see where it hangs/etc but I wanted to see what SO h...

Extreme Misuse/Mishandling of Velocity -- Not Sure Where To Start

Working on a legacy project that includes a fair amount of velocity. Not sure on what I can safely post on her (copyrights and all) but I'll try to be an clear and concise as I can. We have several templateX.vm files. They're not large, only about 200 lines or so long. They do not rely on outside resources. They do not use any macros. I...

Apache's Velocity -- getTemplate() call that takes a string not a filename?

Wanting to do some fancy stuff... :P We'd like to be able to pass a string that IS the file, instead of a string that simple a filename. We're going to create a file in memory using a string/stringbuffer and we want the velocity engine to act upon that instead of reading in a file. Does this function exist? Many thanks! ...

problem with elseif in velocity

I have this velocity template. It works fine in one case, but doesn't in another. If I remove the elseif it works fine. Has anyone encountered this? #if (some condition) ## Do something #elseif ## Do something else #end ...

IllegalStateException: ResourceLoader was not initialized

What is in my velocity.properties file resouce.loader = string string.resource.loader.description = Velocity StringResource Loader string.resource.loader.class = org.apache.velocity.runtime.resource.loader.StringResourceLoader #string.resource.loader.repository.class = org.apache.velocity.runtime.resource.loader.StringResourceRepository...

velocity template and javascript

I try add javascript to my velocity template. <html> <head> <title>:: $currency.CurrencyName Detail Info ::</title> </head> <body> <table> <tr> <td>Name</td> <td>$currency.CurrencyName</td> </tr> <tr> <td>Jual</td> <td><div id="$currency.CurrencyName_buy">$currency.Buy</div></td> </tr> <tr> <td>Beli</td> <td><div...

Eclipse and How it Handles JARS -- Odd Case

Trying to make some small changes to Apache's Velocity engine. Here's what I can and can't do. I'm making a change to the merge function(). The change I'm making doesn't matter because I haven't made it yet. ;) Right now I am settling for a println statement firing. I have two references to merge(). If I change the function to mergeBA...