Questions tagged [nvelocity]

NVelocity is a port of the Apache Jakarta Velocity project. It is a simple, easy to learn and extensible template engine.

NVelocity is a port of the Apache Jakarta Velocity project. It is a simple, easy to learn and extensible template engine.

99 questions
1
vote
2 answers

How can I enable logging in NVelocity?

Any idea how to do what the title says? Only thing I found was on the original Velocity site, and I don't think ve.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.runtime.log.Log4JLogChute"…
ghallas
  • 285
  • 2
  • 14
1
vote
2 answers

Completely overwriting a file with Velocity / NVelocity

I am trying to use NVelocity templates in a .Net application: using a template to output results to a file. It all seems to work fine except for the fact that the output is never fully overwritten. If my file is 100 characters long and the template…
Jennifer
  • 5,148
  • 2
  • 21
  • 19
1
vote
1 answer

Does NVelocity support foreach.count?

I'm using the NVelocity from the Castle project and according to the velocity specs I should be able to access the loop counter like this: $foreach.counter But I can't get it to work so I suspect that it has not been implemented in NVelocity. Can…
Ola Herrdahl
  • 4,216
  • 3
  • 29
  • 23
1
vote
2 answers

Alternatives to NTidy and other ports, need to format html with custom tokens

Looking to format (automated, in application) some html / nvelocity templates. Tidy seems to be the answer for this, however all the .Net ports seem to be problematic and not very well maintained. Most rely on unmanaged code under the covers and…
Tim Hoolihan
  • 12,316
  • 3
  • 41
  • 54
1
vote
0 answers

Velocity: How to make a global array?

I have 3 vm files: f1.vm, f2.vm and f3.vm in f1.vm I make the array with name PROTOCOL_VERSIONS: #set($PROTOCOL_VERSIONS = []) I want to add elements in PROTOCOL_VERSIONS from f2.vm file: #set($success = $PROTOCOL_VERSIONS.add('{"major":1,…
1
vote
1 answer

NVelocity (or Velocity) as a stand-alone formula evaluator

I am using NVelocity in my application to generate html emails. My application has an event-driven model, where saving and/or updating of objects causes these emails to be sent out. Each event can trigger zero, one or multiple multiple emails. I…
dana
  • 17,267
  • 6
  • 64
  • 88
1
vote
2 answers

Template in monorail ViewComponent

Is it possible to have a template with html content in vm for a block component? I'm doing a lot of stuff in html, and want the html reside in a .vm, not in codebehind. Here is what i've got: public class TwoColumn : ViewComponent { …
George Polevoy
  • 7,450
  • 3
  • 36
  • 61
1
vote
2 answers

nVelocity - Template issue when attempting 'greater than' comparison on decimal property

I have a simple object that has as one of it's properties a decimal named Amount. When I attempt a comparison on this property as part of an nVelocity template, the comparison always fails. If I change the property to be of type int the comparison…
Bart
  • 99
  • 1
  • 11
1
vote
1 answer

macros not rendering in NVelocity

I have simple set of velocity templates. When I am trying to merge using NVelocity, the macros from other templates are not executing. The template contents are as follows: V1.vm #parse("V2.vm") #foreach( $customer in $customers) Hello…
Krishna Sarma
  • 1,852
  • 2
  • 29
  • 52
1
vote
1 answer

calling macro from another velocity template

I'm new and struggling with velocity templates. I have few templates in hand with lots of macros in it. // file b.vm #macro (bmacro) from b macro #end // file a.vm #parse("//temp//b.vm") from a #bmacro() My expectation is to get from a from b…
Krishna Sarma
  • 1,852
  • 2
  • 29
  • 52
1
vote
1 answer

Concat strings with separator in velocity template

In my velocity template, I want to concat strings delimited by comma(,) using foreach loop. #foreach($field in $MyObject.Fields) ${field.Name}, #end This results in an extra comma at the end. How can avoid the last unwanted comma? PS: I am…
Krishna Sarma
  • 1,852
  • 2
  • 29
  • 52
1
vote
2 answers

Modifying Cruise Control.NET

We are investigating using CruiseControl.NET as both a Continues Integration build provider, as well as automating the first part of our deployment process. Has anyone modified CruiseControl.NET's dashboard to add custom login and user roles (IE,…
FlySwat
  • 172,459
  • 74
  • 246
  • 311
1
vote
0 answers

How to put page numbers in PDF using NVelocity

I am using NVelocity to create PDF in C#.NET. My question is how to number the pages in the produced PDF document in code. The number of pages is not predefined, and the numbering should appear on the bottom of the page in the format page 1 of…
Dumi
  • 1,414
  • 4
  • 21
  • 41
1
vote
2 answers

NVelocity - Displaying money value

I have an object - call this "order" This object has a property - Total. This is type - decimal (it's a money value) In my template i have something like: Order Total: $order.Total GBP However, in the resulting merge, it comes out as: Order…
Alex
  • 37,502
  • 51
  • 204
  • 332
1
vote
1 answer

Visual Studio 2012 Colorizer and IntelliSense for the NVelocity language

The CVSI (Castle Visual Studio Integration) (which was available up to VS2010) was a good solution for handling NVelocity content files. There is no version for VS2012. Is there any other Extension for VS2012 out there to handle NVelocity content?…
Justin Schwartzenberger
  • 2,576
  • 2
  • 17
  • 20