You can place these into any object you wish.  Velocity can work with any
publicly accessible object.

So you may want to create a class that encapsulates the information you
require in the format you require and place an object of that class into the
velocity context and away you go.  

You are not solely restricted to using vectors in velocity.

george

-----Original Message-----
From: Eigen Technology Pty Ltd [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 31 December 2002 11:19 AM
To: [EMAIL PROTECTED]
Subject: Re: Howto create a VECTOR for Velocity


Say I pulled some data from a database:

ID    Col_2     Col_3
1      A          10
2      B          20
3      C          50
4      D          100
5      E          0.5


I then perfomed some arithmatic manipulation, e.g. invert all the number
in Col_2, and now my new data are:

ID    Col_2     Col_3
1      A          0.1
2      B          0.05
3      C          0.02
4      D          0.01
5      E          20

I now want to pass these data to Velocity, I have to encapsulate them in a
Vector first. How do I do that?

If I have a Vector TEST,

TEST.addElement(??)

will only work for single col arrays. My case need to have the data put
into some form of Objects and then create the Vector ... which is what I
am asking for... thanks

michael












>
> hum, not sure what you mean by "this vector is not from Turbine". You
> can get the contents of your vector from Turbine, directly from a
> database, or anywhere else. Can you give me more infos?
>
>
> On Monday, December 30, 2002, at 03:56  PM, Eigen Technology Pty Ltd
> wrote:
>
>> Thanks for the advice,
>>
>> I knew the Pull Tool part. But my question was on how to create a
>> Vector
>> in 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 in
>> a Vector first, right (correct me if I am wrong)? If this vector is
>> not   from
>> Turbine, how do you create it?
>>
>> cheers
>> michael
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>>
>>> you have to configure your TR.properties file. Configure the pull
>>> service by adding a line like
>>>
>>> services.PullService.tool.<scope>.<id> = <classname>
>>>
>>> for example:
>>>
>>> services.PullService.tool.request.date=com.clavie.myEvents.tool.DateTo
>>>  ol
>>>
>>> then, you should be able to access it in Velocity with sth like:
>>> $DateTool.TodaysDate()
>>>
>>> David
>>>
>>> On Monday, December 30, 2002, at 03:37  PM, Eigen Technology Pty Ltd
>>> wrote:
>>>
>>>> When Turbine extract data from a database, it creates a Vector and
>>>> returns
>>>> for Velocity to display.
>>>>
>>>> If I want to write a Java Utility, some tabulated calculated results
>>>> are
>>>> to be passed on to Velocity, i.e. Vectors not created by Turbine,
>>>> how 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 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]>

Reply via email to