Re: #foreach($i in [1..$n]) causes exception

2011-05-30 Thread Sergiu Dumitriu
must define the range somewhere else as a string, you can use #evaluate to dynamically interpret the range, but that adds unneeded complexity. -- Sergiu Dumitriu http://purl.org/net/sergiu/ - To unsubscribe, e-mail: user-unsubscr

Re: Does velocity provide these features?

2011-06-01 Thread Sergiu Dumitriu
in: https://github.com/xwiki/xwiki-platform/raw/master/xwiki-platform-core/xwiki-platform-web/src/main/webapp/templates/code.vm -- Sergiu Dumitriu http://purl.org/net/sergiu/ - To unsubscribe, e-mail: user-unsubscr

Re: String to Number/Integer

2011-07-05 Thread Sergiu Dumitriu
/velocity/tools/generic/ConversionTool.html#toInteger%28java.lang.Object%29 -- Sergiu Dumitriu http://purl.org/net/sergiu/ - To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org For additional commands, e-mail: user-h

Re: Velocity to fetch full docs?

2011-09-26 Thread Sergiu Dumitriu
.), then shoot the single doc to another (nonSolr) process for postprocessing. Can I use Velocity to do this? How? Can Velocity reach back to the Nutch crawl for the full text of the docs (they don't change often at all)? Any help would be much appreciated. -- Sergiu Dumitriu http://purl.org/net

Re: Javascript, multiple lines, and Velocity

2011-11-09 Thread Sergiu Dumitriu
-- Sergiu Dumitriu http://purl.org/net/sergiu/ - To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org For additional commands, e-mail: user-h...@velocity.apache.org

MIME type for velocity templates

2012-01-25 Thread Sergiu Dumitriu
Is there a recommended MIME type that should be used for .vm files? I found text/velocity on http://www.filesuffix.com/extension/vm.html but I'd like to get an official opinion. -- Sergiu Dumitriu http://purl.org/net/sergiu

Re: MIME type for velocity templates

2012-01-31 Thread Sergiu Dumitriu
. Does a Java file full of String concatenation, where the strings are XML markup, warrant an application/xml MIME type just because it has more than 50% XML in it? Thanks everyone for your answers. -- Sergiu Dumitriu http://purl.org/net/sergiu

Re: Velocity syntax

2012-03-26 Thread Sergiu Dumitriu
. For consistency and a more thorough yet simple definition of the syntax, all keywords follow these rules. -- Sergiu Dumitriu http://purl.org/net/sergiu/ - To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org

Re: More 1.7 BC issues (porting from 1.5)

2012-05-03 Thread Sergiu Dumitriu
, and to foobaryokdar - on 1.5. String template = #set($global_types=['foo', 'bar', 'yok', 'dar'])#macro( showBox $input)#set($type = \\)$input#end+ #macro(showBoxes $types)#foreach($type in $types)#showBox($type)#end#end#showBoxes($global_types); -- Sergiu Dumitriu http://purl.org

Re: Accessing a key in a java map.

2012-06-01 Thread Sergiu Dumitriu
($LabTestType in $LabTestTypeEntry.value) ## $LabTestType is a MyJavaObject from the TreeSet $LabTestType.labTestTypeCode ## I guess that your MyJavaObject has a getLabTestTypeCode() method #end #end -- Sergiu Dumitriu http://purl.org/net/sergiu

Re: Having trouble doing math with values retrieved from external data source

2012-10-02 Thread Sergiu Dumitriu
('Location-FIPSCode')}$!{dsobj.getValue('Device-Instance')} #end Output: ! false hostname stelsewhere99 ! Clearly, the length is more than 8 -- Sergiu Dumitriu http://purl.org/net/sergiu/ - To unsubscribe, e-mail

Re: Simple list of all methods, properties, variables available to templates?

2013-02-12 Thread Sergiu Dumitriu
On 02/12/2013 12:17 PM, ANS Developer Team wrote: Ah thanks, it's pretty sparse, hence why I'm asking here. Much appreciated, will figure it out from source. If you can get your hands on the current VelocityContext, then you could list all the properties it contains (it extends Map). On

Re: template.merge output an empty file

2013-02-21 Thread Sergiu Dumitriu
On 02/21/2013 01:50 PM, Garey Mills wrote: Hi - I am trying to user VelocityEngine. Here is my code: Properties vp = new Properties(); vp.setProperty(file.resource.loader.path, templatesDirectory + /); VelocityEngine ve = new VelocityEngine();

Re: While-like structure in Velocity?

2013-05-15 Thread Sergiu Dumitriu
the loop, and #break($foreach) once the queue is empty: #foreach($i in [0..10]) #if ($queue.isEmpty()) #break($foreach) #end #set ($item = $queue.pop()) ## Do stuff with $item #if (should add more things) #set ($discard = $queue.add(new things)) #end #end -- Sergiu Dumitriu

Re: addition of lists

2013-05-24 Thread Sergiu Dumitriu
On 05/24/2013 02:37 PM, ricardo.julio.rodriguez.fernan...@sergas.es wrote: Hey Sergiu! A big pleasure to meet you here! Thanks for your answer. Please, see below... From: Sergiu Dumitriu [sergiu.dumit...@gmail.com] Sent: 24 May 2013 19:54 To: user

Re: On sorting

2013-05-25 Thread Sergiu Dumitriu
On 05/25/2013 11:39 AM, ricardo.julio.rodriguez.fernan...@sergas.es wrote: I'm really getting mad! :-) Of course I know that the only reason for this is my lack of skills!!! Catching up... I do need some kind of security. Please, could you confirm this statement... Class SortTool can be

Re: On sorting

2013-05-25 Thread Sergiu Dumitriu
On 05/25/2013 11:59 AM, ricardo.julio.rodriguez.fernan...@sergas.es wrote: From: Sergiu Dumitriu [sergiu.dumit...@gmail.com] Sent: 25 May 2013 17:49 To: Velocity Users List Subject: Re: On sorting On 05/25/2013 11:39 AM

Re: Returning String without Whitespace from Velocimacros

2013-08-01 Thread Sergiu Dumitriu
for more complicated macros. I am curious what is the correct way to return values from Velocimacros and if I can Trim the resulting Whitespace before returning it? Thank you an advance for any help. O. O. -- Sergiu Dumitriu http://purl.org/net/sergiu

Re: Returning String without Whitespace from Velocimacros

2013-08-01 Thread Sergiu Dumitriu
an advance for any help. O. O. -- Sergiu Dumitriu http://purl.org/net/sergiu - To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org For additional commands, e-mail: user-h...@velocity.apache.org

Re: Documentation regarding Custom Utility Class for Velocity

2013-08-08 Thread Sergiu Dumitriu
. - To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org For additional commands, e-mail: user-h...@velocity.apache.org -- Sergiu Dumitriu http://purl.org/net/sergiu

Re: [tools] Replacement for ListTool?

2014-06-26 Thread Sergiu Dumitriu
)) [the $bundle object is a List] #end But it's kind of verbose, plus I need to check to see if it's an array as well. Any suggestions using existing tools? Thanks, -chris -- Sergiu Dumitriu http://purl.org/net/sergiu

Re: Fwd: Trouble with Velocity in SOLR 5.0.0

2015-03-11 Thread Sergiu Dumitriu
...@velocity.apache.org -- Sergiu Dumitriu http://purl.org/net/sergiu/ - To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org For additional commands, e-mail: user-h...@velocity.apache.org

Re: Explicitly using null in a template

2015-07-27 Thread Sergiu Dumitriu
($referenceThatIsCertainlyNull) ? I seem to remember there being a helper object (VelocityTool?) that had nice things in it like $helper.null or something like that, but I can't seem to find a reference for it. Thanks, -chris -- Sergiu Dumitriu http://purl.org/net/sergiu

Re: [ANNOUNCE] Velocity Engine 2.0 test build available

2016-11-08 Thread Sergiu Dumitriu
city-eng >> ine/2.0/release-notes.html >> >> Distribution: >> >> * https://dist.apache.org/repos/dist/dev/velocity/velocity-engine/2.0/ >> >> Maven 2 staging repository: >> >> * https://repository.apache.org/content/repositories/orgapache >&g

Re: How to prevent skip of newline after line comment

2016-11-25 Thread Sergiu Dumitriu
t; Next line with some text > > Best regards, > Andreas > -- Sergiu Dumitriu http://purl.org/net/sergiu/ - To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org For additional commands, e-mail: user-h...@velocity.apache.org

Re: Create an empty java.util.Set in VTL

2018-01-25 Thread Sergiu Dumitriu
gt; > 2. I'm going to be consulting it a lot using Set.contains(object) so > something other than ArrayList/LinkedList will be much faster > > Thanks, > -chris >> >> - >> To unsubscribe, e-mail: user-un

Re: Create an empty java.util.Set in VTL

2018-01-25 Thread Sergiu Dumitriu
-- > To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org > For additional commands, e-mail: user-h...@velocity.apache.org > -- Sergiu Dumitriu http://purl.org/net/sergiu