Jason Tesser | 29 Jun 15:47

Serialize Template Object

I have a need for cache purposes to serialize the Velocity Resource object.
I was hoping to cache the velocity code within the template and then
reconstruct the template on the other end.

Is there a good way to do this.  I am look at the code and api and it isn't
obvious how.

Thanks,
Jason Tesser
dotCMS Lead Development Manager
1-305-858-1422
ChadDavis | 26 Jun 19:48

macros parameter type checking

I have a macro that takes an integer parameter.  AFAIK, there's no
support for typing in the Velocity language.  How can I verify that
the parameter is an integer value before doing my velocity macro
logic?
Vernon | 22 Jun 18:57

Please help me to unsubscribe this mailing list


I have sent the unsubscription email to the requested email address quite
few times. For some reason, I am still on this list. Please help me to
unsubscribe this list.

Thanks.

--

-- 
www.vicina.info - your local community information service

News portal - quick, easy browses more than 4,000 news entries from all
major news agencies around the world.
Community news - share your story with others in your community.
Service directory - find or review local places to eat, shop, relax, and
play.
Classified ad - post and browse free classified ads in your neighbourhood.
Petermair Patrick | 22 Jun 17:40
Favicon

text output page header

Hi!

We are using Velocity to create some reports that will be printed out. One
report gets a list of customers and prints some data about them. I¹m now
faced with the problem of writing a page header at the beginning of every
page (that gets printed out). Something like:

³Page 23²

and so on... Is there any support in Velocity to print some kind of header
after a fixed amount of lines? I know how many lines a page can hold. The
data per customer isn¹t static so I don¹t know how many lines each customer
will take. So basically my textfile would look like this:

Page 1
<some data>
<more data>
Page 2
<some more data>
Page 3
<even more data>
<still more data>
<more more data>
Page 4
...

Without the header I would simply output every customer in a ³for each²
loop. But I need to tell Velocity somehow that it needs to print an extra
line with some header data after every 80th line (for example).

(Continue reading)

James_Wilson | 22 Jun 11:59

James Wilson is out of office.


I will be out of the office starting  06/22/2009 and will not return until
06/25/2009.

I will respond to your message when I return.
Richard | 22 Jun 10:55

warnings by install velocity

Hi all,

a am new to this usergroup. I would like to try to use velocity for 
generating pdf with xml. I hope this is possible.

I can't install velocity correct, on windows vista. I installed ant, i 
hope so.

By installing velocity-1.6.2 and velocity-tools-1.4-src i a am getting a 
lot of warnings like:

velocity:
...\velocity-1.6.2\bin\src\org\apache\velocity\anakia\AnakiaTask.java:34: 
package org.apache.tools.ant does not exist
import org.apache.tools.ant.BuildException;

What meas package org.apache.tools.ant does not exist. My 
java.class.path has "C:\ANT_HOME\lib\ant.jar"

or

...\velocity-1.6.2\bin\src\org\apache\velocity\anakia\AnakiaTask.java:217: 
cannot find symbol
symbol  : class BuildException
location: class org.apache.velocity.anakia.AnakiaTask
    public void execute () throws BuildException

I get 15 warnings and then the build routines says:

docs:
(Continue reading)

Mark Fenbers | 14 Jun 01:53
Favicon

Resource from a jar file

I'm having some trouble with mergeTemplate() in that it seems to be 
unable to open a template file if it is packaged in a jar file.  In my 
Java code, I use getResource("resources/velocity.template").getFile() 
[from the "Class" object] to expand the relative location to a full 
URL.  This is for flexibility/portability...  This approach works fine 
when *not* running my app from a Jar file because the file name expands 
to a simple path, something like: 
"/home/mark/resources/velocity.template" whereas when run from a Jar 
file, it expands to something like: 
"file:/home/mark/MyApp.jar!/resources/velocity.template", and thus 
mergeTemplate doesn't like this format... probably the "file:" or the 
"!" throw it off.

I'm not sure how to get past this hurdle.  Any ideas?

Mark
sebb | 13 Jun 12:10

Best way to handle optional attributes in 1.6.2

I'm generating HTML using a Velocity style sheet with version 1.6.2

The source contains lots of elements which are used to generate table
cell entries:

<property name="Name" required="">Description</property>

The "required" attribute is supposed to be "Yes" or "No", with a
default of "No".

The VSL currently has:

<td>
#if($items.getAttributeValue("required") != "")
$items.getAttributeValue("required")
#else
No
#end
</td>

This works OK provided that the "required" attribute is present,
however I would like to treat a missing attribute the same way as the
empty string.

The above code used to work in Velocity 1.5, but now I get

<td>$items.getAttributeValue("required")</td>

instead of

(Continue reading)

Cappoli, William | 11 Jun 21:54
Favicon

Velocity and attachment id in JIRA

I'm trying to create a template that will be used to send a notification
to a user when an attachment is added to a JIRA issue. I have everything
in place for the most part but want to include a link to the attachment
in the email.  This is were the problem occurs as no matter what I do I
cannot seem to get the attachment id and filename. As this information
is included in the web address of where JIRA stored the file it is
needed for the link to work properly. I have tried a number of things
but cannot seem to get it working. Any chance anyone can help me figure
out what I'm doing wrong? Here is what I currently have:

<a
href="http://dev-jira.fareis.net/secure/attachment/$attachment.getId()/$
attachment.getFilename()">attachment</a>

When the email is sent the link is included but clicking on it brings up
an error page saying $attachment.getId() cannot be resolved.

 
Thanks

Bill Cappoli 
LAS IT 
BCS - Business Collaboration Services 
Intermediate Business Systems Analyst 
Phone - 1-800-969-8787 ext. 6795 
Fax - 1-800-644-6262 

**********************************************************************
This message contains confidential information intended only for the use
of the addressee(s) named above and may contain information that is
(Continue reading)

Int64 | 10 Jun 08:04

Velocity Variables are accepted in JavaScript Array??


I am developing an Ajax AutoComplete using javascript.

I have an Array in which i am adding elements.

	var suggestions = new Array();

#foreach($show in $allShowList)

suggestions.push($show);

#end

when i do the above it does not add the variables to the list(it doesnt
display then in autosuggest)

but if i do
$show="someValue"
suggestions.push($show);

Then it adds this thing

Can some1 tell me why, is it a type compatibility issue?
--

-- 
View this message in context: http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23956244.html
Sent from the Velocity - User mailing list archive at Nabble.com.
James_Wilson | 2 Jun 11:59

James Wilson is out of office.


I will be out of the office starting  06/02/2009 and will not return until
06/08/2009.

I will respond to your message when I return.

Gmane