-T
Shashidhar Bhattaram wrote:
how did this code even compile? where have you initialized Vector B??
-----Original Message-----
From: Eigen Technology Pty Ltd [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 31, 2002 1:49 PM
To: [EMAIL PROTECTED]
Subject: RE: Howto create a VECTOR for Velocity
Is this Legal?
Vector A = (some Vector from the Database);
Vector B = null;
for (i=0; i < A.size(); ++i) {
B.add(A.elementAt(i));
}
I am expecting the contents in A will be the same as B after the for loop.
But:
context.put("entries", B);
returns nothing and this time there is no error log. Anything wrong there?
thanks
michael
I dont see why that should be an issue as the context uses a Hashmap to
store the values... It ideally should have just replaced the entry,
unless the wrapper (VelocityContext) is performing some checks... have
you taken a look at the code?
-----Original Message-----
From: Colin Chalmers [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 31, 2002 12:26 PM
To: Turbine Users List; [EMAIL PROTECTED]
Subject: Re: Howto create a VECTOR for Velocity
The only thing that I can see, and that's probably more to do with your
example, is that you use "entry" twice.
Do you have logs/stacktraces we could look at?
/c
----- Original Message -----
From: "Eigen Technology Pty Ltd" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 31, 2002 7:30 AM
Subject: Re: Howto create a VECTOR for Velocity
Well, the reason I raised the question was because I tried and failedVelocity.
using arrays, lists etc when passon to Velocity, i.e.
context.put("entry", some_list/some_array);
have FAILED.
This is what I did:
1. I have a Vector A; <------ context.put("entry", A) is OK with
2. But I need to do some work on the data in A. So:AND:
3. Extract Object a = A.elementAt(some_position); Do what I have to do
4. Put it back into another Vector B.<mailto:[EMAIL PROTECTED]>
B.add(modified_a);
context.put("entry", B);
BUT velocity does not like it.
I tried to vary Vector B with Array B, List B, nothing worked, anyone
know where I have done wrong?
cheers
michael
or you could probably use an array of an array directly.templates
On Monday, December 30, 2002, at 04:24 PM, Scott Eade wrote:
Michael,
Most people on this list will argue strongly that your velocity
thisshould contain only formatting code and never processing code - put
- thisinstead in a pull tool or the screen classes.
Provide a method in your pull tool that provides the data you need
to do.might instantiate and populate a Vector or whatever else you want
to describe below, but an object is an object, whether it isI don't really understand the specific example you are attempting
created by Turbine, Torque, your pull tool or screen class - and
Velocity should
madebe
able to access it and work with it provided that you have somehow
instantiate non-primitives (other than String). You can createit
available to the context.
One thing you can't do in velocity (and shouldn't be able to do) is
references
Vectorto objects, arrays, Strings and ints using #set.
BTW: You may like to use ArrayList in preference to Vector.
HTH,
Scott
--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
.Mac Chat/AIM: seade at mac dot com
On 31/12/2002 10:56 AM, "Eigen Technology Pty Ltd"
<[EMAIL PROTECTED]> wrote:
Thanks for the advice,
I knew the Pull Tool part. But my question was on how to create a
inin this PullTool.
Say you have 100 rows of data each with 6 cols in your
$DateTool.TodaysDate()
function. Before you pass it to Velocity, you have to package them
nota
Vector first, right (correct me if I am wrong)? If this vector is
service by adding a line likefrom
Turbine, how do you create it?
cheers
michael
you have to configure your TR.properties file. Configure the pull
$DateTool.TodaysDate()services.PullService.tool.<scope>.<id> = <classname>
for example:
services.PullService.tool.request.date=com.clavie.myEvents.tool.DateT
ool
then, you should be able to access it in Velocity with sth like:
Ltd wrote:David
On Monday, December 30, 2002, at 03:37 PM, Eigen Technology Pty
and returnsWhen Turbine extract data from a database, it creates a Vector
results arefor Velocity to display.
If I want to write a Java Utility, some tabulated calculated
Turbine, howto be passed on to Velocity, i.e. Vectors not created by
additional commands, e-mail:should I do it.--
I tried:
Vector TEST=null;
etc....
for(i=0; i < somelimit; ++i) {
TEST.add(someobject(i));
}
etc....
return TEST;
Velocity displays nothing, help is much appreciated.
michael
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]> For
<mailto:[EMAIL PROTECTED]>
commands, e-mail: <mailto:[EMAIL PROTECTED]>----
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]> For additional
--
To unsubscribe, e-mail:
For additional commands, e-mail:<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]> For additional
commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]> For additional
commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
