You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Jake Fear <fe...@grifware.com> on 2002/12/23 08:54:32 UTC

turbine 2.2 in CVS

I am building from the 2.2 branch in CVS.  Can anyone tell me why the 
displayName attribute of an intake group does not appear in the 
intake.dtd?  I actually rely on this attribute, and I am concerned it 
may be removed from future versions of the product.  Perhaps it is very 
new and only appears in the code.   In any instance, I have added it 
myself, and the implementing code seems to work fine.

Jake


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Howto create a VECTOR for Velocity

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
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:
>>>> <ma...@jakarta.apache.org>
>>>> For additional commands, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>>
>>>
>>>
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org> For additional
>>> commands, e-mail: <ma...@jakarta.apache.org>
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Howto create a VECTOR for Velocity

Posted by David Worms <da...@simpledesign.com>.
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:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org> For additional
>> commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:    
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:  
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Howto create a VECTOR for Velocity

Posted by Colin Chalmers <co...@maxware.nl>.
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" <mi...@eigentechnology.com>
To: <tu...@jakarta.apache.org>
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 failed
> 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
Velocity.
> 2. But I need to do some work on the data in A. So:
> 3. Extract Object a = A.elementAt(some_position); Do what I have to do
AND:
> 4. Put it back into another Vector B.
>    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.
> >
> > On Monday, December 30, 2002, at 04:24  PM, Scott Eade wrote:
> >
> >> Michael,
> >>
> >> Most people on this list will argue strongly that your velocity
> >> templates
> >> should contain only formatting code and never processing code - put
> >> this
> >> instead in a pull tool or the screen classes.
> >>
> >> Provide a method in your pull tool that provides the data you need -
> >> this
> >> might instantiate and populate a Vector or whatever else you want to
> >> do.
> >>
> >> I don't really understand the specific example you are attempting to
> >> describe below, but an object is an object, whether it is created by
> >> Turbine, Torque, your pull tool or screen class - and Velocity should
> >>  be
> >> able to access it and work with it provided that you have somehow made
> >>   it
> >> available to the context.
> >>
> >> One thing you can't do in velocity (and shouldn't be able to do) is
> >> instantiate non-primitives (other than String).  You can create
> >> references
> >> to 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"
> >> <mi...@eigentechnology.com> 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.DateT
> >>>>  ool
> >>>>
> >>>> 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:
> >>>>> <ma...@jakarta.apache.org>
> >>>>> For additional commands, e-mail:
> >>>>> <ma...@jakarta.apache.org>
> >>>>>
> >>>>
> >>>>
> >>>> --
> >>>> To unsubscribe, e-mail:
> >>>> <ma...@jakarta.apache.org> For additional
> >>>> commands, e-mail: <ma...@jakarta.apache.org>
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> To unsubscribe, e-mail:
> >>> <ma...@jakarta.apache.org>
> >>> For additional commands, e-mail:
> >>> <ma...@jakarta.apache.org>
> >>>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> >> <ma...@jakarta.apache.org>
> >> For additional commands, e-mail:
> >> <ma...@jakarta.apache.org>
> >>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org> For additional
> > commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Howto create a VECTOR for Velocity

Posted by Scott Eade <se...@backstagetech.com.au>.
Why can the processing not occur before you put the list/array into the
context?  This would be the MVC thing to do and would simplify things
greatly.

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
.Mac Chat/AIM: seade at mac dot com


On 31/12/2002 5:30 PM, "Eigen Technology Pty Ltd"
<mi...@eigentechnology.com> wrote:

> Well, the reason I raised the question was because I tried and failed
> 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 Velocity.
> 2. But I need to do some work on the data in A. So:
> 3. Extract Object a = A.elementAt(some_position); Do what I have to do AND:
> 4. Put it back into another Vector B.
>  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.
>> 
>> On Monday, December 30, 2002, at 04:24  PM, Scott Eade wrote:
>> 
>>> Michael,
>>> 
>>> Most people on this list will argue strongly that your velocity
>>> templates
>>> should contain only formatting code and never processing code - put
>>> this
>>> instead in a pull tool or the screen classes.
>>> 
>>> Provide a method in your pull tool that provides the data you need -
>>> this
>>> might instantiate and populate a Vector or whatever else you want to
>>> do.
>>> 
>>> I don't really understand the specific example you are attempting to
>>> describe below, but an object is an object, whether it is created by
>>> Turbine, Torque, your pull tool or screen class - and Velocity should
>>>  be
>>> able to access it and work with it provided that you have somehow made
>>>   it
>>> available to the context.
>>> 
>>> One thing you can't do in velocity (and shouldn't be able to do) is
>>> instantiate non-primitives (other than String).  You can create
>>> references
>>> to 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"
>>> <mi...@eigentechnology.com> 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.DateT
>>>>>  ool
>>>>> 
>>>>> 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:
>>>>>> <ma...@jakarta.apache.org>
>>>>>> For additional commands, e-mail:
>>>>>> <ma...@jakarta.apache.org>
>>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> To unsubscribe, e-mail:
>>>>> <ma...@jakarta.apache.org> For additional
>>>>> commands, e-mail: <ma...@jakarta.apache.org>
>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> To unsubscribe, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>> For additional commands, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>> 
>>> 
>>> 
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org> For additional
>> commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Howto create a VECTOR for Velocity

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
Well, the reason I raised the question was because I tried and failed
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 Velocity.
2. But I need to do some work on the data in A. So:
3. Extract Object a = A.elementAt(some_position); Do what I have to do AND:
4. Put it back into another Vector B.
   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.
>
> On Monday, December 30, 2002, at 04:24  PM, Scott Eade wrote:
>
>> Michael,
>>
>> Most people on this list will argue strongly that your velocity
>> templates
>> should contain only formatting code and never processing code - put
>> this
>> instead in a pull tool or the screen classes.
>>
>> Provide a method in your pull tool that provides the data you need -
>> this
>> might instantiate and populate a Vector or whatever else you want to
>> do.
>>
>> I don't really understand the specific example you are attempting to
>> describe below, but an object is an object, whether it is created by
>> Turbine, Torque, your pull tool or screen class - and Velocity should
>>  be
>> able to access it and work with it provided that you have somehow made
>>   it
>> available to the context.
>>
>> One thing you can't do in velocity (and shouldn't be able to do) is
>> instantiate non-primitives (other than String).  You can create
>> references
>> to 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"
>> <mi...@eigentechnology.com> 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.DateT
>>>>  ool
>>>>
>>>> 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:
>>>>> <ma...@jakarta.apache.org>
>>>>> For additional commands, e-mail:
>>>>> <ma...@jakarta.apache.org>
>>>>>
>>>>
>>>>
>>>> --
>>>> To unsubscribe, e-mail:
>>>> <ma...@jakarta.apache.org> For additional
>>>> commands, e-mail: <ma...@jakarta.apache.org>
>>>
>>>
>>>
>>>
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Howto create a VECTOR for Velocity

Posted by David Worms <da...@simpledesign.com>.
or you could probably use an array of an array directly.

On Monday, December 30, 2002, at 04:24  PM, Scott Eade wrote:

> Michael,
>
> Most people on this list will argue strongly that your velocity  
> templates
> should contain only formatting code and never processing code - put  
> this
> instead in a pull tool or the screen classes.
>
> Provide a method in your pull tool that provides the data you need -  
> this
> might instantiate and populate a Vector or whatever else you want to  
> do.
>
> I don't really understand the specific example you are attempting to
> describe below, but an object is an object, whether it is created by
> Turbine, Torque, your pull tool or screen class - and Velocity should  
> be
> able to access it and work with it provided that you have somehow made  
> it
> available to the context.
>
> One thing you can't do in velocity (and shouldn't be able to do) is
> instantiate non-primitives (other than String).  You can create  
> references
> to 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"
> <mi...@eigentechnology.com> 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.DateT 
>>> ool
>>>
>>> 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:
>>>> <ma...@jakarta.apache.org>
>>>> For additional commands, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>>
>>>
>>>
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org> For additional
>>> commands, e-mail: <ma...@jakarta.apache.org>
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:    
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:  
>> <ma...@jakarta.apache.org>
>>
>
>
> --
> To unsubscribe, e-mail:    
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:  
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Howto create a VECTOR for Velocity

Posted by Scott Eade <se...@backstagetech.com.au>.
Michael,

Most people on this list will argue strongly that your velocity templates
should contain only formatting code and never processing code - put this
instead in a pull tool or the screen classes.

Provide a method in your pull tool that provides the data you need - this
might instantiate and populate a Vector or whatever else you want to do.

I don't really understand the specific example you are attempting to
describe below, but an object is an object, whether it is created by
Turbine, Torque, your pull tool or screen class - and Velocity should be
able to access it and work with it provided that you have somehow made it
available to the context.

One thing you can't do in velocity (and shouldn't be able to do) is
instantiate non-primitives (other than String).  You can create references
to 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"
<mi...@eigentechnology.com> 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.DateTool
>> 
>> 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:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org> For additional
>> commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Howto create a VECTOR for Velocity

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
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.DateTool
>
> 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:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Howto create a VECTOR for Velocity

Posted by David Worms <da...@simpledesign.com>.
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.DateTool

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:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Howto create a VECTOR for Velocity

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A Java Question... not working.

Posted by Scott Eade <se...@backstagetech.com.au>.
On 28/12/2002 10:04 AM, "Eigen Technology Pty Ltd"
<mi...@eigentechnology.com> wrote:

> it might help if I would be allowed to have a
> look at the Turbine's source code.

http://cvs.apache.org/viewcvs/jakarta-turbine-2/

Cheers,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
.Mac Chat/AIM: seade at mac dot com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A Java Question... not working.

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
I guess this question can be addressed by the author of Turbine :-). 
Since we can extract data by doing:

$document.XXX in .vm

the author must have a way of extracting data from the $document object.
Since I can't extract the data using my methods (and/or all those who has
offered me assisstance), it might help if I would be allowed to have a
look at the Turbine's source code.

thanks
michael



> Thanks to all,
>
> I have tried all that suggested, unfortunately none worked ... What Wei
> has suggested compiles OK, but nothing got returned. Here is my
> procedure again:
>
> 1. Extract data from DB using a PullTool
> 2. Data is encapsulated in a Vector.
> 3. Each element in this Vector contains a single row of data (multiple
> col). 4. Try to extract a single col of datum from a single row.
>
> The first time when I perform the elementAt(1), it is OK, it returns a
> list of Objects. I can get Velocity to display its contents by
>
> $documents.XXX
>
> If I perform toString() on these objects, I get only the Address of the
> objects. If I perform another elementAt(x), nothing got returned. I am a
> bit confused here, how is object-strings converted in general?
>
> thanks
> michael
>
>
>
>
>
>
>
>>
>> Your right hand side is an Object, you need to do a cast.  That is:
>>
>> String test = (String)((Object)docs.elementAt(1)).elementAt(1);
>>
>> or
>>
>> String test = ((Doc)docs.get(1)).getDocString();
>>
>> or
>>
>> String test = (docs.elementAt(1)).elementAt(1).toString();
>>
>> It depends on the type you have for the first field in your doc
>> object.
>>   If it is a BigDecimal, direct cast may not work, toString() will do.
>> You see my point.
>>
>> Hope this helps.
>>
>> Eigen Technology Pty Ltd wrote:
>>> I could possibly write a servlet to extract and then filter the data,
>>> but I think that would defeat the purpose of having Turbine in the
>>> first place.
>>>
>>> I tried:
>>>
>>>  String test = ((Object)docs.elementAt(1)).elementAt(1);
>>>  return test;
>>>
>>> the compiler did not complain, but Velocity rejected it. Really
>>> running out of ideas. Any suggestion would be appreciated.
>>>
>>> cheers
>>> michael
>>>
>>>
>>>
>>>
>>>>I have a db Table consisting of 10 (say col_A, col_B, col_C, col_D,
>>>> ... col_J) columns.  After accessing these data using a PullTool (as
>>>> suggested by Scott and Peter), I stored them in a Vector/List.
>>>> Before I display them in my .vm file, I want to perform some
>>>> filtering, e.g. select col_A = "some_Text".
>>>>
>>>>The question is:
>>>>
>>>>I can extract what is in the Vector as Objects which has all ten
>>>> columns in it, it returns a certain address. But How do I get data
>>>> in col_A out and perform the filtering I intended to do?
>>>>
>>>>best wishes
>>>>michael
>>>>
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:
>>>><ma...@jakarta.apache.org> For additional
>>>> commands, e-mail: <ma...@jakarta.apache.org>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org> For additional
>>> commands, e-mail: <ma...@jakarta.apache.org>
>>>
>>
>>
>> --
>> Wei He
>> Email: weihe@optonline.net
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org> For additional
>> commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A Java Question... not working.

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
Wei,

I tried

$document.getClass().getName()

it just return with the path to one of my class files:

org.mycompany.medici.om.Contact

where Contact is the name of the Database Table. What does this mean?

cheers
michael





>
> I think the last resort is to find out what the objects really are. This
>  can be done by using getClass().getName() on each Object in your
> Collection.  This can be done in vm file, and class name of each Object
> will be printed.
>
> Once you find out what they are and call their own methods to get the
> fields you need.  Hope this helps.
>
> Eigen Technology Pty Ltd wrote:
>> Thanks to all,
>>
>> I have tried all that suggested, unfortunately none worked ... What
>> Wei has suggested compiles OK, but nothing got returned. Here is my
>> procedure again:
>>
>> 1. Extract data from DB using a PullTool
>> 2. Data is encapsulated in a Vector.
>> 3. Each element in this Vector contains a single row of data (multiple
>> col). 4. Try to extract a single col of datum from a single row.
>>
>> The first time when I perform the elementAt(1), it is OK, it returns a
>> list of Objects. I can get Velocity to display its contents by
>>
>> $documents.XXX
>>
>> If I perform toString() on these objects, I get only the Address of
>> the objects. If I perform another elementAt(x), nothing got returned.
>> I am a bit confused here, how is object-strings converted in general?
>>
>> thanks
>> michael
>>
>>
>>
>>
>>
>>
>>
>>
>>>Your right hand side is an Object, you need to do a cast.  That is:
>>>
>>>String test = (String)((Object)docs.elementAt(1)).elementAt(1);
>>>
>>>or
>>>
>>>String test = ((Doc)docs.get(1)).getDocString();
>>>
>>>or
>>>
>>>String test = (docs.elementAt(1)).elementAt(1).toString();
>>>
>>>It depends on the type you have for the first field in your doc
>>> object.
>>>  If it is a BigDecimal, direct cast may not work, toString() will do.
>>>You see my point.
>>>
>>>Hope this helps.
>>>
>>>Eigen Technology Pty Ltd wrote:
>>>
>>>>I could possibly write a servlet to extract and then filter the data,
>>>> but I think that would defeat the purpose of having Turbine in the
>>>> first place.
>>>>
>>>>I tried:
>>>>
>>>> String test = ((Object)docs.elementAt(1)).elementAt(1);
>>>> return test;
>>>>
>>>>the compiler did not complain, but Velocity rejected it. Really
>>>> running out of ideas. Any suggestion would be appreciated.
>>>>
>>>>cheers
>>>>michael
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>I have a db Table consisting of 10 (say col_A, col_B, col_C, col_D,
>>>>> ... col_J) columns.  After accessing these data using a PullTool (as
>>>>> suggested by Scott and Peter), I stored them in a Vector/List.
>>>>> Before I display them in my .vm file, I want to perform some
>>>>> filtering, e.g. select col_A = "some_Text".
>>>>>
>>>>>The question is:
>>>>>
>>>>>I can extract what is in the Vector as Objects which has all ten
>>>>> columns in it, it returns a certain address. But How do I get data
>>>>> in col_A out and perform the filtering I intended to do?
>>>>>
>>>>>best wishes
>>>>>michael
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>To unsubscribe, e-mail:
>>>>><ma...@jakarta.apache.org> For additional
>>>>> commands, e-mail: <ma...@jakarta.apache.org>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:
>>>><ma...@jakarta.apache.org> For additional
>>>> commands, e-mail: <ma...@jakarta.apache.org>
>>>>
>>>
>>>--
>>>Wei He
>>>Email: weihe@optonline.net
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>><ma...@jakarta.apache.org> For additional
>>> commands, e-mail: <ma...@jakarta.apache.org>
>>
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org> For additional
>> commands, e-mail: <ma...@jakarta.apache.org>
>>
>
>
> --
> Wei He, Ph.D.
> Email: weihe@optonline.net
> Voice: (845)359-5621
> Fax:   (845)359-1631
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A Java Question... not working.

Posted by Wei He <we...@ldeo.columbia.edu>.
I think the last resort is to find out what the objects really are. This 
can be done by using getClass().getName() on each Object in your 
Collection.  This can be done in vm file, and class name of each Object 
will be printed.

Once you find out what they are and call their own methods to get the 
fields you need.  Hope this helps.

Eigen Technology Pty Ltd wrote:
> Thanks to all,
> 
> I have tried all that suggested, unfortunately none worked ... What Wei
> has suggested compiles OK, but nothing got returned. Here is my procedure
> again:
> 
> 1. Extract data from DB using a PullTool
> 2. Data is encapsulated in a Vector.
> 3. Each element in this Vector contains a single row of data (multiple col).
> 4. Try to extract a single col of datum from a single row.
> 
> The first time when I perform the elementAt(1), it is OK, it returns a
> list of Objects. I can get Velocity to display its contents by
> 
> $documents.XXX
> 
> If I perform toString() on these objects, I get only the Address of the
> objects. If I perform another elementAt(x), nothing got returned. I am a
> bit confused here, how is object-strings converted in general?
> 
> thanks
> michael
> 
> 
> 
> 
> 
> 
> 
> 
>>Your right hand side is an Object, you need to do a cast.  That is:
>>
>>String test = (String)((Object)docs.elementAt(1)).elementAt(1);
>>
>>or
>>
>>String test = ((Doc)docs.get(1)).getDocString();
>>
>>or
>>
>>String test = (docs.elementAt(1)).elementAt(1).toString();
>>
>>It depends on the type you have for the first field in your doc object.
>>  If it is a BigDecimal, direct cast may not work, toString() will do.
>>You see my point.
>>
>>Hope this helps.
>>
>>Eigen Technology Pty Ltd wrote:
>>
>>>I could possibly write a servlet to extract and then filter the data,
>>>but I think that would defeat the purpose of having Turbine in the
>>>first place.
>>>
>>>I tried:
>>>
>>> String test = ((Object)docs.elementAt(1)).elementAt(1);
>>> return test;
>>>
>>>the compiler did not complain, but Velocity rejected it. Really
>>>running out of ideas. Any suggestion would be appreciated.
>>>
>>>cheers
>>>michael
>>>
>>>
>>>
>>>
>>>
>>>>I have a db Table consisting of 10 (say col_A, col_B, col_C, col_D,
>>>>... col_J) columns.  After accessing these data using a PullTool (as
>>>>suggested by Scott and Peter), I stored them in a Vector/List. Before
>>>>I display them in my .vm file, I want to perform some filtering, e.g.
>>>>select col_A = "some_Text".
>>>>
>>>>The question is:
>>>>
>>>>I can extract what is in the Vector as Objects which has all ten
>>>>columns in it, it returns a certain address. But How do I get data in
>>>>col_A out and perform the filtering I intended to do?
>>>>
>>>>best wishes
>>>>michael
>>>>
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:
>>>><ma...@jakarta.apache.org> For additional
>>>>commands, e-mail: <ma...@jakarta.apache.org>
>>>
>>>
>>>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>><ma...@jakarta.apache.org> For additional
>>>commands, e-mail: <ma...@jakarta.apache.org>
>>>
>>
>>--
>>Wei He
>>Email: weihe@optonline.net
>>
>>
>>--
>>To unsubscribe, e-mail:
>><ma...@jakarta.apache.org> For additional
>>commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


-- 
Wei He, Ph.D.
Email: weihe@optonline.net
Voice: (845)359-5621
Fax:   (845)359-1631


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A Java Question... not working.

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
Thanks to all,

I have tried all that suggested, unfortunately none worked ... What Wei
has suggested compiles OK, but nothing got returned. Here is my procedure
again:

1. Extract data from DB using a PullTool
2. Data is encapsulated in a Vector.
3. Each element in this Vector contains a single row of data (multiple col).
4. Try to extract a single col of datum from a single row.

The first time when I perform the elementAt(1), it is OK, it returns a
list of Objects. I can get Velocity to display its contents by

$documents.XXX

If I perform toString() on these objects, I get only the Address of the
objects. If I perform another elementAt(x), nothing got returned. I am a
bit confused here, how is object-strings converted in general?

thanks
michael







>
> Your right hand side is an Object, you need to do a cast.  That is:
>
> String test = (String)((Object)docs.elementAt(1)).elementAt(1);
>
> or
>
> String test = ((Doc)docs.get(1)).getDocString();
>
> or
>
> String test = (docs.elementAt(1)).elementAt(1).toString();
>
> It depends on the type you have for the first field in your doc object.
>   If it is a BigDecimal, direct cast may not work, toString() will do.
> You see my point.
>
> Hope this helps.
>
> Eigen Technology Pty Ltd wrote:
>> I could possibly write a servlet to extract and then filter the data,
>> but I think that would defeat the purpose of having Turbine in the
>> first place.
>>
>> I tried:
>>
>>  String test = ((Object)docs.elementAt(1)).elementAt(1);
>>  return test;
>>
>> the compiler did not complain, but Velocity rejected it. Really
>> running out of ideas. Any suggestion would be appreciated.
>>
>> cheers
>> michael
>>
>>
>>
>>
>>>I have a db Table consisting of 10 (say col_A, col_B, col_C, col_D,
>>> ... col_J) columns.  After accessing these data using a PullTool (as
>>> suggested by Scott and Peter), I stored them in a Vector/List. Before
>>> I display them in my .vm file, I want to perform some filtering, e.g.
>>> select col_A = "some_Text".
>>>
>>>The question is:
>>>
>>>I can extract what is in the Vector as Objects which has all ten
>>> columns in it, it returns a certain address. But How do I get data in
>>> col_A out and perform the filtering I intended to do?
>>>
>>>best wishes
>>>michael
>>>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>><ma...@jakarta.apache.org> For additional
>>> commands, e-mail: <ma...@jakarta.apache.org>
>>
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org> For additional
>> commands, e-mail: <ma...@jakarta.apache.org>
>>
>
>
> --
> Wei He
> Email: weihe@optonline.net
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A Java Question...

Posted by Wei He <we...@ldeo.columbia.edu>.
Your right hand side is an Object, you need to do a cast.  That is:

String test = (String)((Object)docs.elementAt(1)).elementAt(1);

or

String test = ((Doc)docs.get(1)).getDocString();

or

String test = (docs.elementAt(1)).elementAt(1).toString();

It depends on the type you have for the first field in your doc object. 
  If it is a BigDecimal, direct cast may not work, toString() will do. 
You see my point.

Hope this helps.

Eigen Technology Pty Ltd wrote:
> I could possibly write a servlet to extract and then filter the data, but
> I think that would defeat the purpose of having Turbine in the first
> place.
> 
> I tried:
> 
>  String test = ((Object)docs.elementAt(1)).elementAt(1);
>  return test;
> 
> the compiler did not complain, but Velocity rejected it. Really running
> out of ideas. Any suggestion would be appreciated.
> 
> cheers
> michael
> 
> 
> 
> 
>>I have a db Table consisting of 10 (say col_A, col_B, col_C, col_D, ...
>>col_J) columns.  After accessing these data using a PullTool (as
>>suggested by Scott and Peter), I stored them in a Vector/List. Before I
>>display them in my .vm file, I want to perform some filtering, e.g.
>>select col_A = "some_Text".
>>
>>The question is:
>>
>>I can extract what is in the Vector as Objects which has all ten columns
>>in it, it returns a certain address. But How do I get data in col_A out
>>and perform the filtering I intended to do?
>>
>>best wishes
>>michael
>>
>>
>>
>>--
>>To unsubscribe, e-mail:
>><ma...@jakarta.apache.org> For additional
>>commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


-- 
Wei He
Email: weihe@optonline.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A Java Question...

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
I could possibly write a servlet to extract and then filter the data, but
I think that would defeat the purpose of having Turbine in the first
place.

I tried:

 String test = ((Object)docs.elementAt(1)).elementAt(1);
 return test;

the compiler did not complain, but Velocity rejected it. Really running
out of ideas. Any suggestion would be appreciated.

cheers
michael



> I have a db Table consisting of 10 (say col_A, col_B, col_C, col_D, ...
> col_J) columns.  After accessing these data using a PullTool (as
> suggested by Scott and Peter), I stored them in a Vector/List. Before I
> display them in my .vm file, I want to perform some filtering, e.g.
> select col_A = "some_Text".
>
> The question is:
>
> I can extract what is in the Vector as Objects which has all ten columns
> in it, it returns a certain address. But How do I get data in col_A out
> and perform the filtering I intended to do?
>
> best wishes
> michael
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to configure template for web page?

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
Try:

http://jakarta.apache.org/turbine/tdk/tdk-howto.html

there are a few other howtos to help you get started.

best wishes
michael




> In TurbineResources.properties, what these variables mean? And what are
> they used to do?
> I am just confused by them.
> # ------------------------------------------------------------------- #
> #  F R A M E W O R K  S E T T I N G S
> #
> # ------------------------------------------------------------------- #
> These are settings that control the behaviour of the framework,
> # such as determining whether a template system is in use, what
> # the default templates and screens are and session handling settings. #
> -------------------------------------------------------------------
>
> # Used to set the template homepage if you are using a template
> # layout.
> #
> # Default: Index.vm
>
> template.homepage=Index.vm
>
> # This is the default screen to show to people when they first access #
> the system. Specify one of the template screens such as VelocityScreen #
> to use a template system.
> #
> # Default: Login
>
> screen.homepage=
>
> # This is the template that is shown on an incorrect login attempt. #
> Setting this property will override any value of screen.login specfied #
> below.
> #
> # Default: Login.vm
>
> template.login=Login.vm
>
> # This is the page that is shown on an incorrect login attempt.  It is #
> referenced in the LoginUser action. Note that it will only be used if #
> a login template has not been specified (see template.login above). #
> # Default: Login
>
> screen.login=
>
> # This is the template that is used by the respective Template based #
> ErrorScreen for displaying the error. If you are not using a Template
> based
> # ErrorScreen, then this is ignored.
> #
> # Default: Error.vm
>
> template.error=Error.vm
>
> # This is the default error screen.
> #
> # Default: VelocityErrorScreen
>
> screen.error=VelocityErrorScreen
>
> # This is the screen that is displayed when the user's web page is in #
> an invalid state.
> #
> # Default: error.InvalidState
>
> screen.invalidstate=error.InvalidState
>
> # Set the default Doctype.  The default Doctype can be set by using #
> the single strings: Html40Strict, Html40Transitional, or
> # Html40Frameset.  Additionally the default can be supplied as two #
> strings separated by a comma giving the DTD and URI.
> #
> # Default: ignored if not set to some value.
>
> default.doctype=Html40Transitional
>
> # This is the default action to log a user in.
>
> action.login=LoginUser
>
> # This is the default action to log a user out.
>
> action.logout=LogoutUser
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How to configure template for web page?

Posted by Quinton McCombs <qm...@nequalsone.com>.
I am going to assume that you will be using Velocity and not JSP or some
other type of view.

My comments are inline.

> -----Original Message-----
> From: John [mailto:jrhcn@hotmail.com] 
> Sent: Monday, December 30, 2002 5:07 AM
> To: Turbine Users List
> Subject: How to configure template for web page?
> 
> 
> In TurbineResources.properties, what these variables mean? 
> And what are they used to do? I am just confused by them. # 
> -------------------------------------------------------------------
> #
> #  F R A M E W O R K  S E T T I N G S
> #
> # -------------------------------------------------------------------
> # These are settings that control the behaviour of the 
> framework, # such as determining whether a template system is 
> in use, what # the default templates and screens are and 
> session handling settings. # 
> -------------------------------------------------------------------
> 
> # Used to set the template homepage if you are using a 
> template # layout. # # Default: Index.vm
> 
> template.homepage=Index.vm
>

This is the default page that Turbine will render if a specific page is
not request.  For example, if you accessed the followjng page
http://www.myapp.com/blah/servlet/sampleapp (just an example), you will
get the template listed in template.homepage.  Think of this as
Turbine's, index.html.


> # This is the default screen to show to people when they 
> first access # the system. Specify one of the template 
> screens such as VelocityScreen # to use a template system. # 
> # Default: Login
> 
> screen.homepage=
> 

Ignore this.  It is only used if you do not have a template.homepage.

> # This is the template that is shown on an incorrect login 
> attempt. # Setting this property will override any value of 
> screen.login specfied # below. # # Default: Login.vm
> 
> template.login=Login.vm
> 

This is really only used in the default login action and the secure
session validator (not enabled by default).  For the login action, this
is used on an invalid login attempt.  This is where the user will be
sent if the login fails.  This should normally, be you login template.
Make sure that somewhere on your template you display
$data.getMessage().  When the login fails, data.setMessage() is called
to store the reason for the login failure.

> # This is the page that is shown on an incorrect login 
> attempt.  It is # referenced in the LoginUser action. Note 
> that it will only be used if # a login template has not been 
> specified (see template.login above). # # Default: Login
> 
> screen.login=
> 

Ignore.  This is only used when template.login is not specified.

> # This is the template that is used by the respective 
> Template based # ErrorScreen for displaying the error. If you 
> are not using a Template based # ErrorScreen, then this is 
> ignored. # # Default: Error.vm
> 
> template.error=Error.vm

This template is displayed when an exception is thrown during the page
generation.  This could be an action that threw the exception, your
screen class, etc...  

The actual exception is added to the context as "processingException"
and the stack trace as "stackTrace".  

> 
> # This is the default error screen.
> #
> # Default: VelocityErrorScreen
> 
> screen.error=VelocityErrorScreen

Ignore.

> 
> # This is the screen that is displayed when the user's web 
> page is in # an invalid state. # # Default: error.InvalidState
> 
> screen.invalidstate=error.InvalidState

Leave this as the default.  It is used by the session validator classes
in cases where a user tries to submit stale form data.  This screen is
then displayed to the user.  This functionality is not enabled by
default.  To use it, you would add a hidden form field called
_session_access_counter in your form.  The value should be set to
$data.User.AccessCounterForSession.

If you are really interested in using this, look at the source code for
a better explaination of how it really works.  I have never used it,
myself.

> 
> # Set the default Doctype.  The default Doctype can be set by 
> using # the single strings: Html40Strict, Html40Transitional, 
> or # Html40Frameset.  Additionally the default can be 
> supplied as two # strings separated by a comma giving the DTD 
> and URI. # # Default: ignored if not set to some value.
> 
> default.doctype=Html40Transitional

Not sure...

> 
> # This is the default action to log a user in.
> 
> action.login=LoginUser
> 

Turbine handles the login and logout actions specially.  If you write
your own implmentation of the login or logout actions, you will need to
update this setting with the new class name.

> # This is the default action to log a user out.
> 
> action.logout=LogoutUser
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


How to configure template for web page?

Posted by John <jr...@hotmail.com>.
In TurbineResources.properties, what these variables mean? And what are they
used to do?
I am just confused by them.
# -------------------------------------------------------------------
#
#  F R A M E W O R K  S E T T I N G S
#
# -------------------------------------------------------------------
# These are settings that control the behaviour of the framework,
# such as determining whether a template system is in use, what
# the default templates and screens are and session handling settings.
# -------------------------------------------------------------------

# Used to set the template homepage if you are using a template
# layout.
#
# Default: Index.vm

template.homepage=Index.vm

# This is the default screen to show to people when they first access
# the system. Specify one of the template screens such as VelocityScreen
# to use a template system.
#
# Default: Login

screen.homepage=

# This is the template that is shown on an incorrect login attempt.
# Setting this property will override any value of screen.login specfied
# below.
#
# Default: Login.vm

template.login=Login.vm

# This is the page that is shown on an incorrect login attempt.  It is
# referenced in the LoginUser action. Note that it will only be used if
# a login template has not been specified (see template.login above).
#
# Default: Login

screen.login=

# This is the template that is used by the respective Template based
# ErrorScreen for displaying the error. If you are not using a Template
based
# ErrorScreen, then this is ignored.
#
# Default: Error.vm

template.error=Error.vm

# This is the default error screen.
#
# Default: VelocityErrorScreen

screen.error=VelocityErrorScreen

# This is the screen that is displayed when the user's web page is in
# an invalid state.
#
# Default: error.InvalidState

screen.invalidstate=error.InvalidState

# Set the default Doctype.  The default Doctype can be set by using
# the single strings: Html40Strict, Html40Transitional, or
# Html40Frameset.  Additionally the default can be supplied as two
# strings separated by a comma giving the DTD and URI.
#
# Default: ignored if not set to some value.

default.doctype=Html40Transitional

# This is the default action to log a user in.

action.login=LoginUser

# This is the default action to log a user out.

action.logout=LogoutUser

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A Java Question...

Posted by "Jeffrey D. Brekke" <jb...@wi.rr.com>.
FWIW in commons collection's CollectionUtils class there is a method, 
select() that will select objects from a collection given conditions 
you specify.

http://jakarta.apache.org/commons/collections/api/org/apache/commons/collections/CollectionUtils.html

On Fri, 27 Dec 2002, Eigen Technology Pty Ltd wrote:

> I have a db Table consisting of 10 (say col_A, col_B, col_C, col_D, ...
> col_J) columns.  After accessing these data using a PullTool (as suggested
> by Scott and Peter), I stored them in a Vector/List. Before I display them
> in my .vm file, I want to perform some filtering, e.g. select col_A =
> "some_Text".
> 
> The question is:
> 
> I can extract what is in the Vector as Objects which has all ten columns
> in it, it returns a certain address. But How do I get data in col_A out
> and perform the filtering I intended to do?
> 
> best wishes
> michael
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 

-- 
=====================================================================
Jeffrey D. Brekke                                   jbrekke@wi.rr.com
Wisconsin,  USA                                     brekke@apache.org
                                                    ekkerbj@yahoo.com



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


A Java Question...

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
I have a db Table consisting of 10 (say col_A, col_B, col_C, col_D, ...
col_J) columns.  After accessing these data using a PullTool (as suggested
by Scott and Peter), I stored them in a Vector/List. Before I display them
in my .vm file, I want to perform some filtering, e.g. select col_A =
"some_Text".

The question is:

I can extract what is in the Vector as Objects which has all ten columns
in it, it returns a certain address. But How do I get data in col_A out
and perform the filtering I intended to do?

best wishes
michael



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Pull Tool

Posted by Scott Eade <se...@backstagetech.com.au>.
On 26/12/2002 10:30 PM, "Eigen Technology Pty Ltd"
<mi...@eigentechnology.com> wrote:

> Just want to mention that I have read quite a bit in the archive. The
> archive has detail description in how to implement a Pull Tool, but no
> example to show one how to use it (I might have missed it somehow, if this
> is the case, would appreicate if someone could point me to one) ....

http://jakarta.apache.org/turbine/turbine-2/services/pull-service.html

1. Define your tool in TR.props according to the above document.
2. Use the tool in a template as:
    $toolName.Method  (where "toolName" is the name of the tool configured
in TR.props and "Method" or getSomething("aaa") are methods implemented by
the tool.

HTH,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
.Mac Chat/AIM: seade at mac dot com



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Pull Tool

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
Just want to mention that I have read quite a bit in the archive. The
archive has detail description in how to implement a Pull Tool, but no
example to show one how to use it (I might have missed it somehow, if this
is the case, would appreicate if someone could point me to one) ....

thanks
michael



> Peter Courcoux helped me with the creation of a Pull tool in my Turbine
> applicaiton. Below is the code he suggested to me. To complete the whole
> loop of things, would anybody be kind enough as to tell me how to access
> the data obtained by this UtilsTool from a .vm file.  I tried:
>
> #set ( $documents = $utils.getDocuments())
> $utils.getDocuments()
>
> this obviously does not work. An example would be appreciated.
>
> cheers
> michael
>
>
> public class UtilsTool implements ApplicationTool
> {
> /**
> * Initialize the UtilsTool object.
> *
> * @param data This is null, RunData or User depending upon
> * specified tool scope.
> */
>       public void init(Object data)
>       {
>           if (data == null)
>               {
>                Log.debug("UtilsTool scope is global");
>           } else if (data instanceof RunData) {
>                Log.debug("UtilsTool scope is request");
>           } else if (data instanceof User) {
>                Log.debug("UtilsTool scope is session");
>           }
>       }
>
>       public void refresh()
>       {
>           // this does not need to do anything
>           Log.debug("Refreshing UtilsTool");
>       }
>       /** gets a list of all docs in the Registry table in my db
>       */
>
>       public List getDocuments()
>       {
>           List docs = null;
>           try {
>                Criteria c = new Criteria();
>                docs = ContactPeer.doSelect(c);
>           } catch ( Exception e) {
>                Log.info("system", "UtilsTool-getDocuments:" + "Exception
> caught", e );
>                return null;
>           }
>           return docs;
>       }
> }
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Pull Tool

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
Peter Courcoux helped me with the creation of a Pull tool in my Turbine
applicaiton. Below is the code he suggested to me. To complete the whole
loop of things, would anybody be kind enough as to tell me how to access
the data obtained by this UtilsTool from a .vm file.  I tried:

#set ( $documents = $utils.getDocuments())
$utils.getDocuments()

this obviously does not work. An example would be appreciated.

cheers
michael


public class UtilsTool implements ApplicationTool
{
/**
* Initialize the UtilsTool object.
*
* @param data This is null, RunData or User depending upon
* specified tool scope.
*/
      public void init(Object data)
      {
          if (data == null)
              {
               Log.debug("UtilsTool scope is global");
          } else if (data instanceof RunData) {
               Log.debug("UtilsTool scope is request");
          } else if (data instanceof User) {
               Log.debug("UtilsTool scope is session");
          }
      }

      public void refresh()
      {
          // this does not need to do anything
          Log.debug("Refreshing UtilsTool");
      }
      /** gets a list of all docs in the Registry table in my db
      */

      public List getDocuments()
      {
          List docs = null;
          try {
               Criteria c = new Criteria();
               docs = ContactPeer.doSelect(c);
          } catch ( Exception e) {
               Log.info("system", "UtilsTool-getDocuments:" + "Exception
caught", e );
               return null;
          }
          return docs;
      }
}






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Intake Example

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
Thanks, I have not seen this file before. I will read it first.

best wishes
michael



>
> There is an example form on the intake service document.  It is not the
> how-to, but the docs for the service itself.  Here is a link to the doc
> on the jakarta site...
> http://jakarta.apache.org/turbine/turbine-2/services/intake-service.html
>
> Take a look at that.  It should answer the rest of your questions.  If
> you have already been through that documents, let me know and I will try
> explain it a little better.
>
>> -----Original Message-----
>> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>> Sent: Monday, December 23, 2002 6:08 AM
>> To: turbine-user@jakarta.apache.org
>> Subject: RE: Intake Example
>>
>>
>> I am still a bit unclear... Below is the Test.java file I
>> copied from intake-howto.html and my FORM.vm
>>
>>
>> Q1: Does the name in FORM.vm
>> <input type=text name=" HERE " <-----   need to match that in
>>
>>    String username = (String)group.get("Username").getValue();  ?
>>
>> Q2: How is Group in Test.java file being used? It is not
>> anywhere in my FORM.vm file?
>>
>> Q3: If the Action is successful, LoginSuccess.vm will be
>> displayed, else Login.vm will be displayed?
>>
>> cheers
>> micahel
>>
>>
>>  <FORM action="$link.setAction('Test')" method="POST">
>>  <input type=text name="CompanyName" value="">
>>  <input type=submit>
>>  $intake.declareGroups()
>>  </FORM>
>>
>>
>> package org.mycompany.medici.modules.actions;
>> import org.apache.velocity.context.Context;
>> import org.apache.turbine.util.RunData;
>> import org.apache.turbine.util.db.Criteria;
>> import org.apache.turbine.modules.actions.VelocityAction;
>> import org.mycompany.medici.om.Contact;
>> import org.mycompany.medici.om.ContactPeer;
>> import org.apache.turbine.services.intake.IntakeTool;
>> import org.apache.turbine.services.intake.model.*;
>>
>> public class Test extends SecureAction
>> {
>>
>> public void doLogin(RunData data, Context context)
>>         throws Exception {
>>        IntakeTool intake = (IntakeTool)context.get("intake");
>>        Group group = intake.get("LoginGroup", IntakeTool.DEFAULT_KEY);
>> if (!group.isAllValid()) {
>>        //Log.debug("Group elements INVALID");
>>        setTemplate(data, "Login.vm");
>>        return;
>>        } else {
>>        setTemplate(data, "LoginSuccess.vm");
>>        }
>>        String username = (String)group.get("Username").getValue();
>> String password = (String)group.get("Password").getValue(); }
>>
>> }
>>
>>
>>
>>
>>
>> > import org.apache.turbine.services.intake.IntakeTool;
>> > import org.apache.turbine.services.intake.model.*;
>> >
>> > Btw - You class name of your action might need to be Test
>> instead of
>> > TEST.  You will want to follow the standard naming conventions for
>> packages and class names for Turbine to correctly load the
>> classes for
>> > you.
>> >
>> >> -----Original Message-----
>> >> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>> Sent: Monday, December 23, 2002 5:33 AM
>> >> To: turbine-user@jakarta.apache.org
>> >> Subject: RE: Intake Example
>> >>
>> >>
>> >> I think I have followed things correctly.  In that action
>> file, what
>> >> packages do I need to import so that IntakeTool becomes
>> part of it? I
>> >> compile a file as given in the intake-howto, errors occur.
>> >>
>> >> compile:
>> >>     [javac] Compiling 4 source files to
>> >> /usr/local/tdk/webapps/medici/WEB-INF/cl
>> >> asses
>> >>     [javac]
>> >>
>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>> >> modules/actions/TEST.java:22: cannot resolve symbol
>> >>     [javac] symbol  : class IntakeTool
>> >>     [javac] location: class
>> org.mycompany.medici.modules.actions.TEST
>> >> [javac]        IntakeTool intake =
>> >> (IntakeTool)context.get("intake");
>> >>     [javac]        ^
>> >>     [javac]
>> >>
>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>> >> modules/actions/TEST.java:22: cannot resolve symbol
>> >>     [javac] symbol  : class IntakeTool
>> >>     [javac] location: class
>> org.mycompany.medici.modules.actions.TEST
>> >> [javac]        IntakeTool intake =
>> >> (IntakeTool)context.get("intake");
>> >>     [javac]                             ^
>> >>     [javac]
>> >>
>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>> >> modules/actions/TEST.java:26: cannot resolve symbol
>> >>     [javac] symbol  : class Group
>> >>     [javac] location: class
>> org.mycompany.medici.modules.actions.TEST
>> >> [javac]        Group group = intake.get("LoginGroup",
>> >> IntakeTool.DEFAULT_KEY
>> >> );
>> >>
>> >> > The intake.xml file should be located in your WEB-INF/conf
>> >> directory.
>> >> >
>> >> > For the action, the name of the calls should match the
>> >> action name.
>> >> > It should be located in your modules.actions package.  Make
>> >> sure that
>> >> > your setting for module.packages includes the name of your
>> applications, modules as well as those for turbine.  For
>> >> exmaple, if
>> >> > your actions are under
>> com.mycompany.sampleapp.modules.actions, the
>> >> entry in TurbineResource.properties should read:
>> >> >
>> >> >
>> >>
>> module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.mo
>> >> d
>> >> > ul
>> >> > es
>> >> >
>> >> > For all of the details on how actions work, look at the
>> >> Velocity Site
>> >> > how-to and the Action Events how-to.
>> >> >
>> >> >
>> >> >> -----Original Message-----
>> >> >> From: Eigen Technology Pty Ltd
>> >> >> [mailto:michael@eigentechnology.com]
>> >> Sent: Monday, December 23, 2002 4:42 AM
>> >> >> To: turbine-user@jakarta.apache.org
>> >> >> Subject: Intake Example
>> >> >>
>> >> >>
>> >> >> I am learning how to use Intake. I am a bit confused by a
>> >> couple of
>> >> >> things.
>> >> >>
>> >> >> 1. The intake.xml file, I checked in the archive about its
>> >> location
>> >> >> in the file system. Britta Ladwig-Attinger on 28th June 2001 has
>> >> posted this exact question, but it does not seem to be conclusive.
>> So, where should this file be located? I have uncommented the three
>> >> >> fields for Intake in TurbineResrouces.properties, tried adding a
>> >> intake.xml file under app/WBE-INF/conf and "ant init" again. Don't
>> know what to expect at this stage.
>> >> >>
>> >> >> 2. The Action file used in the Intake howto, where should
>> >> this file
>> >> >> be located? and What should the .java file be named?
>> >> Should I put it
>> >> >> under ./src/java/org/mycompany/medici/modules/actions/
>> and call
>> >> >> it
>> >> myAction.java ...
>> >> >>
>> >> >> thanks
>> >> >> michael
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> To unsubscribe, e-mail:
>> >> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org> For
>> additional commands,
>> >> >> e-mail: <ma...@jakarta.apache.org>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> To unsubscribe, e-mail:
>> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>> >> For
>> >> additional commands,
>> >> e-mail: <ma...@jakarta.apache.org>
>> >>
>> >>
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>> For
>> additional commands,
>> e-mail: <ma...@jakarta.apache.org>
>>
>>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Intake Example

Posted by Laurie Harper <zo...@holoweb.net>.
The references to ScarabConstants are all just string constants. You can 
just replace them with strings. The TEMPLATE and NEXT_TEMPLATE constants 
are the names of the Intake keys for two form inputs that allow the 
action to be told by the form what screen to load in the case of failure 
or success. You can replace them with whatever you want provided you 
make sure that your intake.xml matches.

L.

Eigen Technology Pty Ltd wrote:

> Here is another reply:
>
> =======================================================
> From: Everson Dave
> Subject: Intake doc...
> Date: Mon, 24 Sep 2001 13:22:38 -0500
> Content-Type: text/plain;
>  charset=iso-8859-1
>
>
> ScarabConstants.INTAKE_TOOL equals the string "intake"
>
> I had to grab the source to figure that out.
> =====================================================
>
> if that is the case, can I just subsititute intake for
> ScarabConstants.INTAKE_TOOL ?
>
> And also, what about ScarabConstants.NEXT_TEMPLATE and
> ScarabConstants.TEMPLATE ?  What should they be replaced with?
>
>
>
> compile:
>     [javac] Compiling 2 source files to
> /usr/local/tdk/webapps/medici/WEB-INF/classes
>     [javac]
> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/modules/actions/Test.java:26:
> cannot resolve symbol
>     [javac] symbol  : variable NEXT_TEMPLATE
>     [javac] location: class org.apache.turbine.services.intake.IntakeTool
>     [javac]                String template =
> data.getParameters().getString(intake.NEXT_TEMPLATE,TurbineResources.getString("template.homepage",
> "SelectedContact.vm") );
>     [javac]
>            ^
>     [javac]
> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/modules/actions/Test.java:33:
> cannot resolve symbol
>     [javac] symbol  : variable TEMPLATE
>     [javac] location: class org.apache.turbine.services.intake.IntakeTool
>     [javac]             setTemplate(data,
> data.getParameters().getString(intake.TEMPLATE, "Login.vm"));
>     [javac]
>
>
>
>
>
>
>
> >This documents helps to clarify some of my quries. However, a variable
> >in the Action code - ScarabConstants is undefined during Compilation. I
> >checked the archive and got this:
> >
> >========================================================================
> >ScarabConstants.INTAKE_TOOL is set to "intake" which is the handle given
> >to the intake tool for use within templates.  The handle is set in
> >TR.props.
> >
> >john mcnally
> >========================================================================
> >
> >when John attempted to answer a question raised by Jonathan Porterfield.
> >
> >But I don't understand the Answer. Is John suggesting to add a line in
> >TR.properties like this ?
> >
> >tool.request.intake=org.apache.turbine.services.intake.IntakeTool
> >
> >for ScarabConstants?
> >
> >
> >cheers
> >michael
> >
> >
> >
> >
> >
> >>There is an example form on the intake service document.  It is not
> >>the how-to, but the docs for the service itself.  Here is a link to
> >>the doc on the jakarta site...
> >>http://jakarta.apache.org/turbine/turbine-2/services/intake-service.html
> >>
> >>Take a look at that.  It should answer the rest of your questions.  If
> >>you have already been through that documents, let me know and I will
> >>try explain it a little better.
> >>
> >>
> >>>-----Original Message-----
> >>>From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
> >>>Sent: Monday, December 23, 2002 6:08 AM
> >>>To: turbine-user@jakarta.apache.org
> >>>Subject: RE: Intake Example
> >>>
> >>>
> >>>I am still a bit unclear... Below is the Test.java file I
> >>>copied from intake-howto.html and my FORM.vm
> >>>
> >>>
> >>>Q1: Does the name in FORM.vm
> >>><-----   need to match that in
> >>>
> >>>   String username = (String)group.get("Username").getValue();  ?
> >>>
> >>>Q2: How is Group in Test.java file being used? It is not
> >>>anywhere in my FORM.vm file?
> >>>
> >>>Q3: If the Action is successful, LoginSuccess.vm will be
> >>>displayed, else Login.vm will be displayed?
> >>>
> >>>cheers
> >>>micahel
> >>>
> >>>
> >>>
>
> >>>
> >>>
> >>> $intake.declareGroups()
> >>>
>
>
> >>>
> >>>
> >>>package org.mycompany.medici.modules.actions;
> >>>import org.apache.velocity.context.Context;
> >>>import org.apache.turbine.util.RunData;
> >>>import org.apache.turbine.util.db.Criteria;
> >>>import org.apache.turbine.modules.actions.VelocityAction;
> >>>import org.mycompany.medici.om.Contact;
> >>>import org.mycompany.medici.om.ContactPeer;
> >>>import org.apache.turbine.services.intake.IntakeTool;
> >>>import org.apache.turbine.services.intake.model.*;
> >>>
> >>>public class Test extends SecureAction
> >>>{
> >>>
> >>>public void doLogin(RunData data, Context context)
> >>>        throws Exception {
> >>>       IntakeTool intake = (IntakeTool)context.get("intake");
> >>>       Group group = intake.get("LoginGroup",
> >>>IntakeTool.DEFAULT_KEY);
> >>>if (!group.isAllValid()) {
> >>>       //Log.debug("Group elements INVALID");
> >>>       setTemplate(data, "Login.vm");
> >>>       return;
> >>>       } else {
> >>>       setTemplate(data, "LoginSuccess.vm");
> >>>       }
> >>>       String username = (String)group.get("Username").getValue();
> >>>String password = (String)group.get("Password").getValue(); }
> >>>
> >>>}
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>import org.apache.turbine.services.intake.IntakeTool;
> >>>>import org.apache.turbine.services.intake.model.*;
> >>>>
> >>>>Btw - You class name of your action might need to be Test
> >>>
> >>>instead of
> >>>
> >>>>TEST.  You will want to follow the standard naming conventions for
> >>>
> >>>packages and class names for Turbine to correctly load the
> >>>classes for
> >>>
> >>>>you.
> >>>>
> >>>>
> >>>>>-----Original Message-----
> >>>>>From: Eigen Technology Pty Ltd
> >>>
> >>>[mailto:michael@eigentechnology.com]
> >>>Sent: Monday, December 23, 2002 5:33 AM
> >>>
> >>>>>To: turbine-user@jakarta.apache.org
> >>>>>Subject: RE: Intake Example
> >>>>>
> >>>>>
> >>>>>I think I have followed things correctly.  In that action
> >>>
> >>>file, what
> >>>
> >>>>>packages do I need to import so that IntakeTool becomes
> >>>
> >>>part of it? I
> >>>
> >>>>>compile a file as given in the intake-howto, errors occur.
> >>>>>
> >>>>>compile:
> >>>>>    [javac] Compiling 4 source files to
> >>>>>/usr/local/tdk/webapps/medici/WEB-INF/cl
> >>>>>asses
> >>>>>    [javac]
> >>>>>
> >>>
> >>>/usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
> >>>
> >>>>>modules/actions/TEST.java:22: cannot resolve symbol
> >>>>>    [javac] symbol  : class IntakeTool
> >>>>>    [javac] location: class
> >>>
> >>>org.mycompany.medici.modules.actions.TEST
> >>>
> >>>>>[javac]        IntakeTool intake =
> >>>>>(IntakeTool)context.get("intake");
> >>>>>    [javac]        ^
> >>>>>    [javac]
> >>>>>
> >>>
> >>>/usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
> >>>
> >>>>>modules/actions/TEST.java:22: cannot resolve symbol
> >>>>>    [javac] symbol  : class IntakeTool
> >>>>>    [javac] location: class
> >>>
> >>>org.mycompany.medici.modules.actions.TEST
> >>>
> >>>>>[javac]        IntakeTool intake =
> >>>>>(IntakeTool)context.get("intake");
> >>>>>    [javac]                             ^
> >>>>>    [javac]
> >>>>>
> >>>
> >>>/usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
> >>>
> >>>>>modules/actions/TEST.java:26: cannot resolve symbol
> >>>>>    [javac] symbol  : class Group
> >>>>>    [javac] location: class
> >>>
> >>>org.mycompany.medici.modules.actions.TEST
> >>>
> >>>>>[javac]        Group group = intake.get("LoginGroup",
> >>>>>IntakeTool.DEFAULT_KEY
> >>>>>);
> >>>>>
> >>>>>
> >>>>>>The intake.xml file should be located in your WEB-INF/conf
> >>>>>
> >>>>>directory.
> >>>>>
> >>>>>>For the action, the name of the calls should match the
> >>>>>
> >>>>>action name.
> >>>>>
> >>>>>>It should be located in your modules.actions package.  Make
> >>>>>
> >>>>>sure that
> >>>>>
> >>>>>>your setting for module.packages includes the name of your
> >>>
> >>>applications, modules as well as those for turbine.  For
> >>>
> >>>>>exmaple, if
> >>>>>
> >>>>>>your actions are under
> >>>
> >>>com.mycompany.sampleapp.modules.actions, the
> >>>
> >>>>>entry in TurbineResource.properties should read:
> >>>>>
> >>>>>>
> >>>module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.mo
> >>>
> >>>>>d
> >>>>>
> >>>>>>ul
> >>>>>>es
> >>>>>>
> >>>>>>For all of the details on how actions work, look at the
> >>>>>
> >>>>>Velocity Site
> >>>>>
> >>>>>>how-to and the Action Events how-to.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>-----Original Message-----
> >>>>>>>From: Eigen Technology Pty Ltd
> >>>>>>>[mailto:michael@eigentechnology.com]
> >>>>>
> >>>>>Sent: Monday, December 23, 2002 4:42 AM
> >>>>>
> >>>>>>>To: turbine-user@jakarta.apache.org
> >>>>>>>Subject: Intake Example
> >>>>>>>
> >>>>>>>
> >>>>>>>I am learning how to use Intake. I am a bit confused by a
> >>>>>
> >>>>>couple of
> >>>>>
> >>>>>>>things.
> >>>>>>>
> >>>>>>>1. The intake.xml file, I checked in the archive about its
> >>>>>
> >>>>>location
> >>>>>
> >>>>>>>in the file system. Britta Ladwig-Attinger on 28th June 2001
> >>>
> >>>has
> >>>
> >>>>>posted this exact question, but it does not seem to be conclusive.
> >>>
> >>>So, where should this file be located? I have uncommented the three
> >>>
> >>>>>>>fields for Intake in TurbineResrouces.properties, tried adding
> >>>
> >>>a
> >>>
> >>>>>intake.xml file under app/WBE-INF/conf and "ant init" again. Don't
> >>>
> >>>know what to expect at this stage.
> >>>
> >>>>>>>2. The Action file used in the Intake howto, where should
> >>>>>
> >>>>>this file
> >>>>>
> >>>>>>>be located? and What should the .java file be named?
> >>>>>
> >>>>>Should I put it
> >>>>>
> >>>>>>>under ./src/java/org/mycompany/medici/modules/actions/
> >>>
> >>>and call
> >>>
> >>>>>>>it
> >>>>>
> >>>>>myAction.java ...
> >>>>>
> >>>>>>>thanks
> >>>>>>>michael
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>--
> >>>>>>>To unsubscribe, e-mail:
> >>>>>>> unsubscribe@jakarta.apache.org> For
> >>>
> >>>additional commands,
> >>>
> >>>>>>>e-mail:
> >>>>>>>
> >>>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>--
> >>>>>To unsubscribe, e-mail:
> >>>>> unsubscribe@jakarta.apache.org>
> >>>>>For
> >>>>>additional commands,
> >>>>>e-mail:
> >>>>>
> >>>>>
> >>>
> >>>
> >>>
> >>>--
> >>>To unsubscribe, e-mail:
> >>> unsubscribe@jakarta.apache.org>
> >>>For
> >>>additional commands,
> >>>e-mail:
> >>>
> >>>
> >>
> >>--
> >>To unsubscribe, e-mail:
> >> For additional
> >>commands, e-mail:
> >
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
> > For additional
> >commands, e-mail:
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Intake Example

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
I made a mistake. I should follow the example in the intake-howto by
downloading the Scarab software FIRST.

Scarab has many advanced features and java classes, but using it in
conjuntion with the intake-howto is a bit complicated for beginners like
me to understand.

I would appreciate it if anyone can show me a simpler example on how
intake functions?

thanks
michael




> Here is another reply:
>
> =======================================================
> From: Everson Dave <DA...@AGRIS.com>
> Subject: Intake doc...
> Date: Mon, 24 Sep 2001 13:22:38 -0500
> Content-Type: text/plain;
>  charset=iso-8859-1
>
>
> ScarabConstants.INTAKE_TOOL equals the string "intake"
>
> I had to grab the source to figure that out.
> =====================================================
>
> if that is the case, can I just subsititute intake for
> ScarabConstants.INTAKE_TOOL ?
>
> And also, what about ScarabConstants.NEXT_TEMPLATE and
> ScarabConstants.TEMPLATE ?  What should they be replaced with?
>
>
>
> compile:
>     [javac] Compiling 2 source files to
> /usr/local/tdk/webapps/medici/WEB-INF/classes
>     [javac]
> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/modules/actions/Test.java:26:
> cannot resolve symbol
>     [javac] symbol  : variable NEXT_TEMPLATE
>     [javac] location: class
> org.apache.turbine.services.intake.IntakeTool [javac]
> String template =
> data.getParameters().getString(intake.NEXT_TEMPLATE,TurbineResources.getString("template.homepage",
> "SelectedContact.vm") );
>     [javac]
>
>            ^
>     [javac]
> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/modules/actions/Test.java:33:
> cannot resolve symbol
>     [javac] symbol  : variable TEMPLATE
>     [javac] location: class
> org.apache.turbine.services.intake.IntakeTool [javac]
> setTemplate(data,
> data.getParameters().getString(intake.TEMPLATE, "Login.vm"));
>     [javac]
>
>
>
>
>
>
>> This documents helps to clarify some of my quries. However, a variable
>> in the Action code - ScarabConstants is undefined during Compilation.
>> I checked the archive and got this:
>>
>> ========================================================================
>> ScarabConstants.INTAKE_TOOL is set to "intake" which is the handle
>> given to the intake tool for use within templates.  The handle is set
>> in TR.props.
>>
>> john mcnally
>> ========================================================================
>>
>> when John attempted to answer a question raised by Jonathan
>> Porterfield.
>>
>> But I don't understand the Answer. Is John suggesting to add a line in
>> TR.properties like this ?
>>
>> tool.request.intake=org.apache.turbine.services.intake.IntakeTool
>>
>> for ScarabConstants?
>>
>>
>> cheers
>> michael
>>
>>
>>
>>
>>>
>>> There is an example form on the intake service document.  It is not
>>> the how-to, but the docs for the service itself.  Here is a link to
>>> the doc on the jakarta site...
>>> http://jakarta.apache.org/turbine/turbine-2/services/intake-service.html
>>>
>>> Take a look at that.  It should answer the rest of your questions.
>>> If you have already been through that documents, let me know and I
>>> will try explain it a little better.
>>>
>>>> -----Original Message-----
>>>> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>>>> Sent: Monday, December 23, 2002 6:08 AM
>>>> To: turbine-user@jakarta.apache.org
>>>> Subject: RE: Intake Example
>>>>
>>>>
>>>> I am still a bit unclear... Below is the Test.java file I
>>>> copied from intake-howto.html and my FORM.vm
>>>>
>>>>
>>>> Q1: Does the name in FORM.vm
>>>> <input type=text name=" HERE " <-----   need to match that in
>>>>
>>>>    String username = (String)group.get("Username").getValue();  ?
>>>>
>>>> Q2: How is Group in Test.java file being used? It is not
>>>> anywhere in my FORM.vm file?
>>>>
>>>> Q3: If the Action is successful, LoginSuccess.vm will be
>>>> displayed, else Login.vm will be displayed?
>>>>
>>>> cheers
>>>> micahel
>>>>
>>>>
>>>>  <FORM action="$link.setAction('Test')" method="POST">
>>>>  <input type=text name="CompanyName" value="">
>>>>  <input type=submit>
>>>>  $intake.declareGroups()
>>>>  </FORM>
>>>>
>>>>
>>>> package org.mycompany.medici.modules.actions;
>>>> import org.apache.velocity.context.Context;
>>>> import org.apache.turbine.util.RunData;
>>>> import org.apache.turbine.util.db.Criteria;
>>>> import org.apache.turbine.modules.actions.VelocityAction;
>>>> import org.mycompany.medici.om.Contact;
>>>> import org.mycompany.medici.om.ContactPeer;
>>>> import org.apache.turbine.services.intake.IntakeTool;
>>>> import org.apache.turbine.services.intake.model.*;
>>>>
>>>> public class Test extends SecureAction
>>>> {
>>>>
>>>> public void doLogin(RunData data, Context context)
>>>>         throws Exception {
>>>>        IntakeTool intake = (IntakeTool)context.get("intake");
>>>>        Group group = intake.get("LoginGroup",
>>>> IntakeTool.DEFAULT_KEY);
>>>> if (!group.isAllValid()) {
>>>>        //Log.debug("Group elements INVALID");
>>>>        setTemplate(data, "Login.vm");
>>>>        return;
>>>>        } else {
>>>>        setTemplate(data, "LoginSuccess.vm");
>>>>        }
>>>>        String username = (String)group.get("Username").getValue();
>>>> String password = (String)group.get("Password").getValue(); }
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> > import org.apache.turbine.services.intake.IntakeTool;
>>>> > import org.apache.turbine.services.intake.model.*;
>>>> >
>>>> > Btw - You class name of your action might need to be Test
>>>> instead of
>>>> > TEST.  You will want to follow the standard naming conventions for
>>>> packages and class names for Turbine to correctly load the
>>>> classes for
>>>> > you.
>>>> >
>>>> >> -----Original Message-----
>>>> >> From: Eigen Technology Pty Ltd
>>>> [mailto:michael@eigentechnology.com]
>>>> Sent: Monday, December 23, 2002 5:33 AM
>>>> >> To: turbine-user@jakarta.apache.org
>>>> >> Subject: RE: Intake Example
>>>> >>
>>>> >>
>>>> >> I think I have followed things correctly.  In that action
>>>> file, what
>>>> >> packages do I need to import so that IntakeTool becomes
>>>> part of it? I
>>>> >> compile a file as given in the intake-howto, errors occur.
>>>> >>
>>>> >> compile:
>>>> >>     [javac] Compiling 4 source files to
>>>> >> /usr/local/tdk/webapps/medici/WEB-INF/cl
>>>> >> asses
>>>> >>     [javac]
>>>> >>
>>>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>>>> >> modules/actions/TEST.java:22: cannot resolve symbol
>>>> >>     [javac] symbol  : class IntakeTool
>>>> >>     [javac] location: class
>>>> org.mycompany.medici.modules.actions.TEST
>>>> >> [javac]        IntakeTool intake =
>>>> >> (IntakeTool)context.get("intake");
>>>> >>     [javac]        ^
>>>> >>     [javac]
>>>> >>
>>>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>>>> >> modules/actions/TEST.java:22: cannot resolve symbol
>>>> >>     [javac] symbol  : class IntakeTool
>>>> >>     [javac] location: class
>>>> org.mycompany.medici.modules.actions.TEST
>>>> >> [javac]        IntakeTool intake =
>>>> >> (IntakeTool)context.get("intake");
>>>> >>     [javac]                             ^
>>>> >>     [javac]
>>>> >>
>>>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>>>> >> modules/actions/TEST.java:26: cannot resolve symbol
>>>> >>     [javac] symbol  : class Group
>>>> >>     [javac] location: class
>>>> org.mycompany.medici.modules.actions.TEST
>>>> >> [javac]        Group group = intake.get("LoginGroup",
>>>> >> IntakeTool.DEFAULT_KEY
>>>> >> );
>>>> >>
>>>> >> > The intake.xml file should be located in your WEB-INF/conf
>>>> >> directory.
>>>> >> >
>>>> >> > For the action, the name of the calls should match the
>>>> >> action name.
>>>> >> > It should be located in your modules.actions package.  Make
>>>> >> sure that
>>>> >> > your setting for module.packages includes the name of your
>>>> applications, modules as well as those for turbine.  For
>>>> >> exmaple, if
>>>> >> > your actions are under
>>>> com.mycompany.sampleapp.modules.actions, the
>>>> >> entry in TurbineResource.properties should read:
>>>> >> >
>>>> >> >
>>>> >>
>>>> module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.mo
>>>> >> d
>>>> >> > ul
>>>> >> > es
>>>> >> >
>>>> >> > For all of the details on how actions work, look at the
>>>> >> Velocity Site
>>>> >> > how-to and the Action Events how-to.
>>>> >> >
>>>> >> >
>>>> >> >> -----Original Message-----
>>>> >> >> From: Eigen Technology Pty Ltd
>>>> >> >> [mailto:michael@eigentechnology.com]
>>>> >> Sent: Monday, December 23, 2002 4:42 AM
>>>> >> >> To: turbine-user@jakarta.apache.org
>>>> >> >> Subject: Intake Example
>>>> >> >>
>>>> >> >>
>>>> >> >> I am learning how to use Intake. I am a bit confused by a
>>>> >> couple of
>>>> >> >> things.
>>>> >> >>
>>>> >> >> 1. The intake.xml file, I checked in the archive about its
>>>> >> location
>>>> >> >> in the file system. Britta Ladwig-Attinger on 28th June 2001
>>>> has
>>>> >> posted this exact question, but it does not seem to be
>>>> conclusive.
>>>> So, where should this file be located? I have uncommented the three
>>>> >> >> fields for Intake in TurbineResrouces.properties, tried adding
>>>> a
>>>> >> intake.xml file under app/WBE-INF/conf and "ant init" again.
>>>> Don't
>>>> know what to expect at this stage.
>>>> >> >>
>>>> >> >> 2. The Action file used in the Intake howto, where should
>>>> >> this file
>>>> >> >> be located? and What should the .java file be named?
>>>> >> Should I put it
>>>> >> >> under ./src/java/org/mycompany/medici/modules/actions/
>>>> and call
>>>> >> >> it
>>>> >> myAction.java ...
>>>> >> >>
>>>> >> >> thanks
>>>> >> >> michael
>>>> >> >>
>>>> >> >>
>>>> >> >>
>>>> >> >>
>>>> >> >> --
>>>> >> >> To unsubscribe, e-mail:
>>>> >> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org> For
>>>> additional commands,
>>>> >> >> e-mail: <ma...@jakarta.apache.org>
>>>> >> >>
>>>> >> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >> --
>>>> >> To unsubscribe, e-mail:
>>>> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>>> >> For
>>>> >> additional commands,
>>>> >> e-mail: <ma...@jakarta.apache.org>
>>>> >>
>>>> >>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> To unsubscribe, e-mail:
>>>> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>>> For
>>>> additional commands,
>>>> e-mail: <ma...@jakarta.apache.org>
>>>>
>>>>
>>>
>>>
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org> For additional
>>> commands, e-mail: <ma...@jakarta.apache.org>
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org> For additional
>> commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Intake Example

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
Here is another reply:

=======================================================
From: Everson Dave <DA...@AGRIS.com>
Subject: Intake doc...
Date: Mon, 24 Sep 2001 13:22:38 -0500
Content-Type: text/plain;
 charset=iso-8859-1


ScarabConstants.INTAKE_TOOL equals the string "intake"

I had to grab the source to figure that out.
=====================================================

if that is the case, can I just subsititute intake for
ScarabConstants.INTAKE_TOOL ?

And also, what about ScarabConstants.NEXT_TEMPLATE and
ScarabConstants.TEMPLATE ?  What should they be replaced with?



compile:
    [javac] Compiling 2 source files to
/usr/local/tdk/webapps/medici/WEB-INF/classes
    [javac]
/usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/modules/actions/Test.java:26:
cannot resolve symbol
    [javac] symbol  : variable NEXT_TEMPLATE
    [javac] location: class org.apache.turbine.services.intake.IntakeTool
    [javac]                String template =
data.getParameters().getString(intake.NEXT_TEMPLATE,TurbineResources.getString("template.homepage",
"SelectedContact.vm") );
    [javac]                                                               
           ^
    [javac]
/usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/modules/actions/Test.java:33:
cannot resolve symbol
    [javac] symbol  : variable TEMPLATE
    [javac] location: class org.apache.turbine.services.intake.IntakeTool
    [javac]             setTemplate(data,
data.getParameters().getString(intake.TEMPLATE, "Login.vm"));
    [javac]






> This documents helps to clarify some of my quries. However, a variable
> in the Action code - ScarabConstants is undefined during Compilation. I
> checked the archive and got this:
>
> ========================================================================
> ScarabConstants.INTAKE_TOOL is set to "intake" which is the handle given
> to the intake tool for use within templates.  The handle is set in
> TR.props.
>
> john mcnally
> ========================================================================
>
> when John attempted to answer a question raised by Jonathan Porterfield.
>
> But I don't understand the Answer. Is John suggesting to add a line in
> TR.properties like this ?
>
> tool.request.intake=org.apache.turbine.services.intake.IntakeTool
>
> for ScarabConstants?
>
>
> cheers
> michael
>
>
>
>
>>
>> There is an example form on the intake service document.  It is not
>> the how-to, but the docs for the service itself.  Here is a link to
>> the doc on the jakarta site...
>> http://jakarta.apache.org/turbine/turbine-2/services/intake-service.html
>>
>> Take a look at that.  It should answer the rest of your questions.  If
>> you have already been through that documents, let me know and I will
>> try explain it a little better.
>>
>>> -----Original Message-----
>>> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>>> Sent: Monday, December 23, 2002 6:08 AM
>>> To: turbine-user@jakarta.apache.org
>>> Subject: RE: Intake Example
>>>
>>>
>>> I am still a bit unclear... Below is the Test.java file I
>>> copied from intake-howto.html and my FORM.vm
>>>
>>>
>>> Q1: Does the name in FORM.vm
>>> <input type=text name=" HERE " <-----   need to match that in
>>>
>>>    String username = (String)group.get("Username").getValue();  ?
>>>
>>> Q2: How is Group in Test.java file being used? It is not
>>> anywhere in my FORM.vm file?
>>>
>>> Q3: If the Action is successful, LoginSuccess.vm will be
>>> displayed, else Login.vm will be displayed?
>>>
>>> cheers
>>> micahel
>>>
>>>
>>>  <FORM action="$link.setAction('Test')" method="POST">
>>>  <input type=text name="CompanyName" value="">
>>>  <input type=submit>
>>>  $intake.declareGroups()
>>>  </FORM>
>>>
>>>
>>> package org.mycompany.medici.modules.actions;
>>> import org.apache.velocity.context.Context;
>>> import org.apache.turbine.util.RunData;
>>> import org.apache.turbine.util.db.Criteria;
>>> import org.apache.turbine.modules.actions.VelocityAction;
>>> import org.mycompany.medici.om.Contact;
>>> import org.mycompany.medici.om.ContactPeer;
>>> import org.apache.turbine.services.intake.IntakeTool;
>>> import org.apache.turbine.services.intake.model.*;
>>>
>>> public class Test extends SecureAction
>>> {
>>>
>>> public void doLogin(RunData data, Context context)
>>>         throws Exception {
>>>        IntakeTool intake = (IntakeTool)context.get("intake");
>>>        Group group = intake.get("LoginGroup",
>>> IntakeTool.DEFAULT_KEY);
>>> if (!group.isAllValid()) {
>>>        //Log.debug("Group elements INVALID");
>>>        setTemplate(data, "Login.vm");
>>>        return;
>>>        } else {
>>>        setTemplate(data, "LoginSuccess.vm");
>>>        }
>>>        String username = (String)group.get("Username").getValue();
>>> String password = (String)group.get("Password").getValue(); }
>>>
>>> }
>>>
>>>
>>>
>>>
>>>
>>> > import org.apache.turbine.services.intake.IntakeTool;
>>> > import org.apache.turbine.services.intake.model.*;
>>> >
>>> > Btw - You class name of your action might need to be Test
>>> instead of
>>> > TEST.  You will want to follow the standard naming conventions for
>>> packages and class names for Turbine to correctly load the
>>> classes for
>>> > you.
>>> >
>>> >> -----Original Message-----
>>> >> From: Eigen Technology Pty Ltd
>>> [mailto:michael@eigentechnology.com]
>>> Sent: Monday, December 23, 2002 5:33 AM
>>> >> To: turbine-user@jakarta.apache.org
>>> >> Subject: RE: Intake Example
>>> >>
>>> >>
>>> >> I think I have followed things correctly.  In that action
>>> file, what
>>> >> packages do I need to import so that IntakeTool becomes
>>> part of it? I
>>> >> compile a file as given in the intake-howto, errors occur.
>>> >>
>>> >> compile:
>>> >>     [javac] Compiling 4 source files to
>>> >> /usr/local/tdk/webapps/medici/WEB-INF/cl
>>> >> asses
>>> >>     [javac]
>>> >>
>>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>>> >> modules/actions/TEST.java:22: cannot resolve symbol
>>> >>     [javac] symbol  : class IntakeTool
>>> >>     [javac] location: class
>>> org.mycompany.medici.modules.actions.TEST
>>> >> [javac]        IntakeTool intake =
>>> >> (IntakeTool)context.get("intake");
>>> >>     [javac]        ^
>>> >>     [javac]
>>> >>
>>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>>> >> modules/actions/TEST.java:22: cannot resolve symbol
>>> >>     [javac] symbol  : class IntakeTool
>>> >>     [javac] location: class
>>> org.mycompany.medici.modules.actions.TEST
>>> >> [javac]        IntakeTool intake =
>>> >> (IntakeTool)context.get("intake");
>>> >>     [javac]                             ^
>>> >>     [javac]
>>> >>
>>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>>> >> modules/actions/TEST.java:26: cannot resolve symbol
>>> >>     [javac] symbol  : class Group
>>> >>     [javac] location: class
>>> org.mycompany.medici.modules.actions.TEST
>>> >> [javac]        Group group = intake.get("LoginGroup",
>>> >> IntakeTool.DEFAULT_KEY
>>> >> );
>>> >>
>>> >> > The intake.xml file should be located in your WEB-INF/conf
>>> >> directory.
>>> >> >
>>> >> > For the action, the name of the calls should match the
>>> >> action name.
>>> >> > It should be located in your modules.actions package.  Make
>>> >> sure that
>>> >> > your setting for module.packages includes the name of your
>>> applications, modules as well as those for turbine.  For
>>> >> exmaple, if
>>> >> > your actions are under
>>> com.mycompany.sampleapp.modules.actions, the
>>> >> entry in TurbineResource.properties should read:
>>> >> >
>>> >> >
>>> >>
>>> module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.mo
>>> >> d
>>> >> > ul
>>> >> > es
>>> >> >
>>> >> > For all of the details on how actions work, look at the
>>> >> Velocity Site
>>> >> > how-to and the Action Events how-to.
>>> >> >
>>> >> >
>>> >> >> -----Original Message-----
>>> >> >> From: Eigen Technology Pty Ltd
>>> >> >> [mailto:michael@eigentechnology.com]
>>> >> Sent: Monday, December 23, 2002 4:42 AM
>>> >> >> To: turbine-user@jakarta.apache.org
>>> >> >> Subject: Intake Example
>>> >> >>
>>> >> >>
>>> >> >> I am learning how to use Intake. I am a bit confused by a
>>> >> couple of
>>> >> >> things.
>>> >> >>
>>> >> >> 1. The intake.xml file, I checked in the archive about its
>>> >> location
>>> >> >> in the file system. Britta Ladwig-Attinger on 28th June 2001
>>> has
>>> >> posted this exact question, but it does not seem to be conclusive.
>>> So, where should this file be located? I have uncommented the three
>>> >> >> fields for Intake in TurbineResrouces.properties, tried adding
>>> a
>>> >> intake.xml file under app/WBE-INF/conf and "ant init" again. Don't
>>> know what to expect at this stage.
>>> >> >>
>>> >> >> 2. The Action file used in the Intake howto, where should
>>> >> this file
>>> >> >> be located? and What should the .java file be named?
>>> >> Should I put it
>>> >> >> under ./src/java/org/mycompany/medici/modules/actions/
>>> and call
>>> >> >> it
>>> >> myAction.java ...
>>> >> >>
>>> >> >> thanks
>>> >> >> michael
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >> --
>>> >> >> To unsubscribe, e-mail:
>>> >> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org> For
>>> additional commands,
>>> >> >> e-mail: <ma...@jakarta.apache.org>
>>> >> >>
>>> >> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> To unsubscribe, e-mail:
>>> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>> >> For
>>> >> additional commands,
>>> >> e-mail: <ma...@jakarta.apache.org>
>>> >>
>>> >>
>>>
>>>
>>>
>>>
>>> --
>>> To unsubscribe, e-mail:
>>> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>> For
>>> additional commands,
>>> e-mail: <ma...@jakarta.apache.org>
>>>
>>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org> For additional
>> commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Intake Example

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
This documents helps to clarify some of my quries. However, a variable in
the Action code - ScarabConstants is undefined during Compilation. I
checked the archive and got this:

========================================================================
ScarabConstants.INTAKE_TOOL is set to "intake" which is the handle given
to the intake tool for use within templates.  The handle is set in
TR.props.

john mcnally
========================================================================

when John attempted to answer a question raised by Jonathan Porterfield.

But I don't understand the Answer. Is John suggesting to add a line in
TR.properties like this ?

tool.request.intake=org.apache.turbine.services.intake.IntakeTool

for ScarabConstants?


cheers
michael




>
> There is an example form on the intake service document.  It is not the
> how-to, but the docs for the service itself.  Here is a link to the doc
> on the jakarta site...
> http://jakarta.apache.org/turbine/turbine-2/services/intake-service.html
>
> Take a look at that.  It should answer the rest of your questions.  If
> you have already been through that documents, let me know and I will try
> explain it a little better.
>
>> -----Original Message-----
>> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>> Sent: Monday, December 23, 2002 6:08 AM
>> To: turbine-user@jakarta.apache.org
>> Subject: RE: Intake Example
>>
>>
>> I am still a bit unclear... Below is the Test.java file I
>> copied from intake-howto.html and my FORM.vm
>>
>>
>> Q1: Does the name in FORM.vm
>> <input type=text name=" HERE " <-----   need to match that in
>>
>>    String username = (String)group.get("Username").getValue();  ?
>>
>> Q2: How is Group in Test.java file being used? It is not
>> anywhere in my FORM.vm file?
>>
>> Q3: If the Action is successful, LoginSuccess.vm will be
>> displayed, else Login.vm will be displayed?
>>
>> cheers
>> micahel
>>
>>
>>  <FORM action="$link.setAction('Test')" method="POST">
>>  <input type=text name="CompanyName" value="">
>>  <input type=submit>
>>  $intake.declareGroups()
>>  </FORM>
>>
>>
>> package org.mycompany.medici.modules.actions;
>> import org.apache.velocity.context.Context;
>> import org.apache.turbine.util.RunData;
>> import org.apache.turbine.util.db.Criteria;
>> import org.apache.turbine.modules.actions.VelocityAction;
>> import org.mycompany.medici.om.Contact;
>> import org.mycompany.medici.om.ContactPeer;
>> import org.apache.turbine.services.intake.IntakeTool;
>> import org.apache.turbine.services.intake.model.*;
>>
>> public class Test extends SecureAction
>> {
>>
>> public void doLogin(RunData data, Context context)
>>         throws Exception {
>>        IntakeTool intake = (IntakeTool)context.get("intake");
>>        Group group = intake.get("LoginGroup", IntakeTool.DEFAULT_KEY);
>> if (!group.isAllValid()) {
>>        //Log.debug("Group elements INVALID");
>>        setTemplate(data, "Login.vm");
>>        return;
>>        } else {
>>        setTemplate(data, "LoginSuccess.vm");
>>        }
>>        String username = (String)group.get("Username").getValue();
>> String password = (String)group.get("Password").getValue(); }
>>
>> }
>>
>>
>>
>>
>>
>> > import org.apache.turbine.services.intake.IntakeTool;
>> > import org.apache.turbine.services.intake.model.*;
>> >
>> > Btw - You class name of your action might need to be Test
>> instead of
>> > TEST.  You will want to follow the standard naming conventions for
>> packages and class names for Turbine to correctly load the
>> classes for
>> > you.
>> >
>> >> -----Original Message-----
>> >> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>> Sent: Monday, December 23, 2002 5:33 AM
>> >> To: turbine-user@jakarta.apache.org
>> >> Subject: RE: Intake Example
>> >>
>> >>
>> >> I think I have followed things correctly.  In that action
>> file, what
>> >> packages do I need to import so that IntakeTool becomes
>> part of it? I
>> >> compile a file as given in the intake-howto, errors occur.
>> >>
>> >> compile:
>> >>     [javac] Compiling 4 source files to
>> >> /usr/local/tdk/webapps/medici/WEB-INF/cl
>> >> asses
>> >>     [javac]
>> >>
>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>> >> modules/actions/TEST.java:22: cannot resolve symbol
>> >>     [javac] symbol  : class IntakeTool
>> >>     [javac] location: class
>> org.mycompany.medici.modules.actions.TEST
>> >> [javac]        IntakeTool intake =
>> >> (IntakeTool)context.get("intake");
>> >>     [javac]        ^
>> >>     [javac]
>> >>
>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>> >> modules/actions/TEST.java:22: cannot resolve symbol
>> >>     [javac] symbol  : class IntakeTool
>> >>     [javac] location: class
>> org.mycompany.medici.modules.actions.TEST
>> >> [javac]        IntakeTool intake =
>> >> (IntakeTool)context.get("intake");
>> >>     [javac]                             ^
>> >>     [javac]
>> >>
>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>> >> modules/actions/TEST.java:26: cannot resolve symbol
>> >>     [javac] symbol  : class Group
>> >>     [javac] location: class
>> org.mycompany.medici.modules.actions.TEST
>> >> [javac]        Group group = intake.get("LoginGroup",
>> >> IntakeTool.DEFAULT_KEY
>> >> );
>> >>
>> >> > The intake.xml file should be located in your WEB-INF/conf
>> >> directory.
>> >> >
>> >> > For the action, the name of the calls should match the
>> >> action name.
>> >> > It should be located in your modules.actions package.  Make
>> >> sure that
>> >> > your setting for module.packages includes the name of your
>> applications, modules as well as those for turbine.  For
>> >> exmaple, if
>> >> > your actions are under
>> com.mycompany.sampleapp.modules.actions, the
>> >> entry in TurbineResource.properties should read:
>> >> >
>> >> >
>> >>
>> module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.mo
>> >> d
>> >> > ul
>> >> > es
>> >> >
>> >> > For all of the details on how actions work, look at the
>> >> Velocity Site
>> >> > how-to and the Action Events how-to.
>> >> >
>> >> >
>> >> >> -----Original Message-----
>> >> >> From: Eigen Technology Pty Ltd
>> >> >> [mailto:michael@eigentechnology.com]
>> >> Sent: Monday, December 23, 2002 4:42 AM
>> >> >> To: turbine-user@jakarta.apache.org
>> >> >> Subject: Intake Example
>> >> >>
>> >> >>
>> >> >> I am learning how to use Intake. I am a bit confused by a
>> >> couple of
>> >> >> things.
>> >> >>
>> >> >> 1. The intake.xml file, I checked in the archive about its
>> >> location
>> >> >> in the file system. Britta Ladwig-Attinger on 28th June 2001 has
>> >> posted this exact question, but it does not seem to be conclusive.
>> So, where should this file be located? I have uncommented the three
>> >> >> fields for Intake in TurbineResrouces.properties, tried adding a
>> >> intake.xml file under app/WBE-INF/conf and "ant init" again. Don't
>> know what to expect at this stage.
>> >> >>
>> >> >> 2. The Action file used in the Intake howto, where should
>> >> this file
>> >> >> be located? and What should the .java file be named?
>> >> Should I put it
>> >> >> under ./src/java/org/mycompany/medici/modules/actions/
>> and call
>> >> >> it
>> >> myAction.java ...
>> >> >>
>> >> >> thanks
>> >> >> michael
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> To unsubscribe, e-mail:
>> >> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org> For
>> additional commands,
>> >> >> e-mail: <ma...@jakarta.apache.org>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> To unsubscribe, e-mail:
>> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>> >> For
>> >> additional commands,
>> >> e-mail: <ma...@jakarta.apache.org>
>> >>
>> >>
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>> For
>> additional commands,
>> e-mail: <ma...@jakarta.apache.org>
>>
>>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Intake Example

Posted by Quinton McCombs <qm...@nequalsone.com>.
There is an example form on the intake service document.  It is not the
how-to, but the docs for the service itself.  Here is a link to the doc
on the jakarta site...
http://jakarta.apache.org/turbine/turbine-2/services/intake-service.html

Take a look at that.  It should answer the rest of your questions.  If
you have already been through that documents, let me know and I will try
explain it a little better.

> -----Original Message-----
> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com] 
> Sent: Monday, December 23, 2002 6:08 AM
> To: turbine-user@jakarta.apache.org
> Subject: RE: Intake Example
> 
> 
> I am still a bit unclear... Below is the Test.java file I 
> copied from intake-howto.html and my FORM.vm
> 
> 
> Q1: Does the name in FORM.vm
> <input type=text name=" HERE " <-----   need to match that in
> 
>    String username = (String)group.get("Username").getValue();  ?
> 
> Q2: How is Group in Test.java file being used? It is not 
> anywhere in my FORM.vm file?
> 
> Q3: If the Action is successful, LoginSuccess.vm will be 
> displayed, else Login.vm will be displayed?
> 
> cheers
> micahel
> 
> 
>  <FORM action="$link.setAction('Test')" method="POST">
>  <input type=text name="CompanyName" value="">
>  <input type=submit>
>  $intake.declareGroups()
>  </FORM>
> 
> 
> package org.mycompany.medici.modules.actions;
> import org.apache.velocity.context.Context;
> import org.apache.turbine.util.RunData;
> import org.apache.turbine.util.db.Criteria;
> import org.apache.turbine.modules.actions.VelocityAction;
> import org.mycompany.medici.om.Contact;
> import org.mycompany.medici.om.ContactPeer;
> import org.apache.turbine.services.intake.IntakeTool;
> import org.apache.turbine.services.intake.model.*;
> 
> public class Test extends SecureAction
> {
> 
> public void doLogin(RunData data, Context context)
>         throws Exception {
>        IntakeTool intake = (IntakeTool)context.get("intake");
>        Group group = intake.get("LoginGroup", IntakeTool.DEFAULT_KEY);
>        if (!group.isAllValid()) {
>        //Log.debug("Group elements INVALID");
>        setTemplate(data, "Login.vm");
>        return;
>        } else {
>        setTemplate(data, "LoginSuccess.vm");
>        }
>        String username = (String)group.get("Username").getValue();
>        String password = (String)group.get("Password").getValue();
>        }
> 
> }
> 
> 
> 
> 
> 
> > import org.apache.turbine.services.intake.IntakeTool;
> > import org.apache.turbine.services.intake.model.*;
> >
> > Btw - You class name of your action might need to be Test 
> instead of 
> > TEST.  You will want to follow the standard naming conventions for 
> > packages and class names for Turbine to correctly load the 
> classes for 
> > you.
> >
> >> -----Original Message-----
> >> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
> >> Sent: Monday, December 23, 2002 5:33 AM
> >> To: turbine-user@jakarta.apache.org
> >> Subject: RE: Intake Example
> >>
> >>
> >> I think I have followed things correctly.  In that action 
> file, what 
> >> packages do I need to import so that IntakeTool becomes 
> part of it? I 
> >> compile a file as given in the intake-howto, errors occur.
> >>
> >> compile:
> >>     [javac] Compiling 4 source files to 
> >> /usr/local/tdk/webapps/medici/WEB-INF/cl
> >> asses
> >>     [javac] 
> >> 
> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
> >> modules/actions/TEST.java:22: cannot resolve symbol
> >>     [javac] symbol  : class IntakeTool
> >>     [javac] location: class 
> org.mycompany.medici.modules.actions.TEST
> >> [javac]        IntakeTool intake =
> >> (IntakeTool)context.get("intake");
> >>     [javac]        ^
> >>     [javac] 
> >> 
> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
> >> modules/actions/TEST.java:22: cannot resolve symbol
> >>     [javac] symbol  : class IntakeTool
> >>     [javac] location: class 
> org.mycompany.medici.modules.actions.TEST
> >> [javac]        IntakeTool intake =
> >> (IntakeTool)context.get("intake");
> >>     [javac]                             ^
> >>     [javac] 
> >> 
> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
> >> modules/actions/TEST.java:26: cannot resolve symbol
> >>     [javac] symbol  : class Group
> >>     [javac] location: class 
> org.mycompany.medici.modules.actions.TEST
> >> [javac]        Group group = intake.get("LoginGroup",
> >> IntakeTool.DEFAULT_KEY
> >> );
> >>
> >> > The intake.xml file should be located in your WEB-INF/conf
> >> directory.
> >> >
> >> > For the action, the name of the calls should match the
> >> action name.
> >> > It should be located in your modules.actions package.  Make
> >> sure that
> >> > your setting for module.packages includes the name of your 
> >> > applications, modules as well as those for turbine.  For
> >> exmaple, if
> >> > your actions are under 
> com.mycompany.sampleapp.modules.actions, the
> >> entry in TurbineResource.properties should read:
> >> >
> >> >
> >> 
> module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.mo
> >> d
> >> > ul
> >> > es
> >> >
> >> > For all of the details on how actions work, look at the
> >> Velocity Site
> >> > how-to and the Action Events how-to.
> >> >
> >> >
> >> >> -----Original Message-----
> >> >> From: Eigen Technology Pty Ltd 
> >> >> [mailto:michael@eigentechnology.com]
> >> Sent: Monday, December 23, 2002 4:42 AM
> >> >> To: turbine-user@jakarta.apache.org
> >> >> Subject: Intake Example
> >> >>
> >> >>
> >> >> I am learning how to use Intake. I am a bit confused by a
> >> couple of
> >> >> things.
> >> >>
> >> >> 1. The intake.xml file, I checked in the archive about its
> >> location
> >> >> in the file system. Britta Ladwig-Attinger on 28th June 2001 has
> >> posted this exact question, but it does not seem to be conclusive. 
> >> So, where should this file be located? I have uncommented the three
> >> >> fields for Intake in TurbineResrouces.properties, tried adding a
> >> intake.xml file under app/WBE-INF/conf and "ant init" again. Don't 
> >> know what to expect at this stage.
> >> >>
> >> >> 2. The Action file used in the Intake howto, where should
> >> this file
> >> >> be located? and What should the .java file be named?
> >> Should I put it
> >> >> under ./src/java/org/mycompany/medici/modules/actions/  
> and call 
> >> >> it
> >> myAction.java ...
> >> >>
> >> >> thanks
> >> >> michael
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> To unsubscribe, e-mail:
> >> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org> For
> >> >> additional commands,
> >> >> e-mail: <ma...@jakarta.apache.org>
> >> >>
> >> >>
> >>
> >>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >> For
> >> additional commands,
> >> e-mail: <ma...@jakarta.apache.org>
> >>
> >>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Intake Example

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
I am still a bit unclear... Below is the Test.java file I copied from
intake-howto.html and my FORM.vm


Q1: Does the name in FORM.vm
<input type=text name=" HERE " <-----   need to match that in

   String username = (String)group.get("Username").getValue();  ?

Q2: How is Group in Test.java file being used? It is not anywhere in my
FORM.vm file?

Q3: If the Action is successful, LoginSuccess.vm will be displayed, else
Login.vm will be displayed?

cheers
micahel


 <FORM action="$link.setAction('Test')" method="POST">
 <input type=text name="CompanyName" value="">
 <input type=submit>
 $intake.declareGroups()
 </FORM>


package org.mycompany.medici.modules.actions;
import org.apache.velocity.context.Context;
import org.apache.turbine.util.RunData;
import org.apache.turbine.util.db.Criteria;
import org.apache.turbine.modules.actions.VelocityAction;
import org.mycompany.medici.om.Contact;
import org.mycompany.medici.om.ContactPeer;
import org.apache.turbine.services.intake.IntakeTool;
import org.apache.turbine.services.intake.model.*;

public class Test extends SecureAction
{

public void doLogin(RunData data, Context context)
        throws Exception {
       IntakeTool intake = (IntakeTool)context.get("intake");
       Group group = intake.get("LoginGroup", IntakeTool.DEFAULT_KEY);
       if (!group.isAllValid()) {
       //Log.debug("Group elements INVALID");
       setTemplate(data, "Login.vm");
       return;
       } else {
       setTemplate(data, "LoginSuccess.vm");
       }
       String username = (String)group.get("Username").getValue();
       String password = (String)group.get("Password").getValue();
       }

}





> import org.apache.turbine.services.intake.IntakeTool;
> import org.apache.turbine.services.intake.model.*;
>
> Btw - You class name of your action might need to be Test instead of
> TEST.  You will want to follow the standard naming conventions for
> packages and class names for Turbine to correctly load the classes for
> you.
>
>> -----Original Message-----
>> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>> Sent: Monday, December 23, 2002 5:33 AM
>> To: turbine-user@jakarta.apache.org
>> Subject: RE: Intake Example
>>
>>
>> I think I have followed things correctly.  In that action
>> file, what packages do I need to import so that IntakeTool
>> becomes part of it? I compile a file as given in the
>> intake-howto, errors occur.
>>
>> compile:
>>     [javac] Compiling 4 source files to
>> /usr/local/tdk/webapps/medici/WEB-INF/cl
>> asses
>>     [javac]
>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>> modules/actions/TEST.java:22: cannot resolve symbol
>>     [javac] symbol  : class IntakeTool
>>     [javac] location: class org.mycompany.medici.modules.actions.TEST
>> [javac]        IntakeTool intake =
>> (IntakeTool)context.get("intake");
>>     [javac]        ^
>>     [javac]
>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>> modules/actions/TEST.java:22: cannot resolve symbol
>>     [javac] symbol  : class IntakeTool
>>     [javac] location: class org.mycompany.medici.modules.actions.TEST
>> [javac]        IntakeTool intake =
>> (IntakeTool)context.get("intake");
>>     [javac]                             ^
>>     [javac]
>> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
>> modules/actions/TEST.java:26: cannot resolve symbol
>>     [javac] symbol  : class Group
>>     [javac] location: class org.mycompany.medici.modules.actions.TEST
>> [javac]        Group group = intake.get("LoginGroup",
>> IntakeTool.DEFAULT_KEY
>> );
>>
>> > The intake.xml file should be located in your WEB-INF/conf
>> directory.
>> >
>> > For the action, the name of the calls should match the
>> action name.
>> > It should be located in your modules.actions package.  Make
>> sure that
>> > your setting for module.packages includes the name of your
>> > applications, modules as well as those for turbine.  For
>> exmaple, if
>> > your actions are under com.mycompany.sampleapp.modules.actions, the
>> entry in TurbineResource.properties should read:
>> >
>> >
>> module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.mod
>> > ul
>> > es
>> >
>> > For all of the details on how actions work, look at the
>> Velocity Site
>> > how-to and the Action Events how-to.
>> >
>> >
>> >> -----Original Message-----
>> >> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>> Sent: Monday, December 23, 2002 4:42 AM
>> >> To: turbine-user@jakarta.apache.org
>> >> Subject: Intake Example
>> >>
>> >>
>> >> I am learning how to use Intake. I am a bit confused by a
>> couple of
>> >> things.
>> >>
>> >> 1. The intake.xml file, I checked in the archive about its
>> location
>> >> in the file system. Britta Ladwig-Attinger on 28th June 2001 has
>> posted this exact question, but it does not seem to be conclusive.
>> So, where should this file be located? I have uncommented
>> the three
>> >> fields for Intake in TurbineResrouces.properties, tried adding a
>> intake.xml file under app/WBE-INF/conf and "ant init" again. Don't
>> know what to expect at this stage.
>> >>
>> >> 2. The Action file used in the Intake howto, where should
>> this file
>> >> be located? and What should the .java file be named?
>> Should I put it
>> >> under ./src/java/org/mycompany/medici/modules/actions/  and call it
>> myAction.java ...
>> >>
>> >> thanks
>> >> michael
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> To unsubscribe, e-mail:
>> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>> >> For
>> >> additional commands,
>> >> e-mail: <ma...@jakarta.apache.org>
>> >>
>> >>
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>> For
>> additional commands,
>> e-mail: <ma...@jakarta.apache.org>
>>
>>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Intake Example

Posted by Quinton McCombs <qm...@nequalsone.com>.
import org.apache.turbine.services.intake.IntakeTool;
import org.apache.turbine.services.intake.model.*;

Btw - You class name of your action might need to be Test instead of
TEST.  You will want to follow the standard naming conventions for
packages and class names for Turbine to correctly load the classes for
you.

> -----Original Message-----
> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com] 
> Sent: Monday, December 23, 2002 5:33 AM
> To: turbine-user@jakarta.apache.org
> Subject: RE: Intake Example
> 
> 
> I think I have followed things correctly.  In that action 
> file, what packages do I need to import so that IntakeTool 
> becomes part of it? I compile a file as given in the 
> intake-howto, errors occur.
> 
> compile:
>     [javac] Compiling 4 source files to 
> /usr/local/tdk/webapps/medici/WEB-INF/cl
> asses
>     [javac] 
> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
> modules/actions/TEST.java:22: cannot resolve symbol
>     [javac] symbol  : class IntakeTool
>     [javac] location: class org.mycompany.medici.modules.actions.TEST
>     [javac]        IntakeTool intake = 
> (IntakeTool)context.get("intake");
>     [javac]        ^
>     [javac] 
> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
> modules/actions/TEST.java:22: cannot resolve symbol
>     [javac] symbol  : class IntakeTool
>     [javac] location: class org.mycompany.medici.modules.actions.TEST
>     [javac]        IntakeTool intake = 
> (IntakeTool)context.get("intake");
>     [javac]                             ^
>     [javac] 
> /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
> modules/actions/TEST.java:26: cannot resolve symbol
>     [javac] symbol  : class Group
>     [javac] location: class org.mycompany.medici.modules.actions.TEST
>     [javac]        Group group = intake.get("LoginGroup",
> IntakeTool.DEFAULT_KEY
> );
> 
> > The intake.xml file should be located in your WEB-INF/conf 
> directory.
> >
> > For the action, the name of the calls should match the 
> action name.  
> > It should be located in your modules.actions package.  Make 
> sure that 
> > your setting for module.packages includes the name of your 
> > applications, modules as well as those for turbine.  For 
> exmaple, if 
> > your actions are under com.mycompany.sampleapp.modules.actions, the 
> > entry in TurbineResource.properties should read:
> >
> > 
> module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.mod
> > ul
> > es
> >
> > For all of the details on how actions work, look at the 
> Velocity Site 
> > how-to and the Action Events how-to.
> >
> >
> >> -----Original Message-----
> >> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
> >> Sent: Monday, December 23, 2002 4:42 AM
> >> To: turbine-user@jakarta.apache.org
> >> Subject: Intake Example
> >>
> >>
> >> I am learning how to use Intake. I am a bit confused by a 
> couple of 
> >> things.
> >>
> >> 1. The intake.xml file, I checked in the archive about its 
> location 
> >> in the file system. Britta Ladwig-Attinger on 28th June 2001 has 
> >> posted this exact question, but it does not seem to be conclusive. 
> >> So, where should this file be located? I have uncommented 
> the three 
> >> fields for Intake in TurbineResrouces.properties, tried adding a 
> >> intake.xml file under app/WBE-INF/conf and "ant init" again. Don't 
> >> know what to expect at this stage.
> >>
> >> 2. The Action file used in the Intake howto, where should 
> this file 
> >> be located? and What should the .java file be named? 
> Should I put it 
> >> under ./src/java/org/mycompany/medici/modules/actions/  and call it
> >> myAction.java ...
> >>
> >> thanks
> >> michael
> >>
> >>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> >> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >> For
> >> additional commands,
> >> e-mail: <ma...@jakarta.apache.org>
> >>
> >>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Intake Example

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
I think I have followed things correctly.  In that action file, what
packages do I need to import so that IntakeTool becomes part of it? I
compile a file as given in the intake-howto, errors occur.

compile:
    [javac] Compiling 4 source files to
/usr/local/tdk/webapps/medici/WEB-INF/cl
asses
    [javac]
/usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
modules/actions/TEST.java:22: cannot resolve symbol
    [javac] symbol  : class IntakeTool
    [javac] location: class org.mycompany.medici.modules.actions.TEST
    [javac]        IntakeTool intake = (IntakeTool)context.get("intake");
    [javac]        ^
    [javac]
/usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
modules/actions/TEST.java:22: cannot resolve symbol
    [javac] symbol  : class IntakeTool
    [javac] location: class org.mycompany.medici.modules.actions.TEST
    [javac]        IntakeTool intake = (IntakeTool)context.get("intake");
    [javac]                             ^
    [javac]
/usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/
modules/actions/TEST.java:26: cannot resolve symbol
    [javac] symbol  : class Group
    [javac] location: class org.mycompany.medici.modules.actions.TEST
    [javac]        Group group = intake.get("LoginGroup",
IntakeTool.DEFAULT_KEY
);

> The intake.xml file should be located in your WEB-INF/conf directory.
>
> For the action, the name of the calls should match the action name.  It
> should be located in your modules.actions package.  Make sure that your
> setting for module.packages includes the name of your applications,
> modules as well as those for turbine.  For exmaple, if your actions are
> under com.mycompany.sampleapp.modules.actions, the entry in
> TurbineResource.properties should read:
>
> module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.modul
> es
>
> For all of the details on how actions work, look at the Velocity Site
> how-to and the Action Events how-to.
>
>
>> -----Original Message-----
>> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>> Sent: Monday, December 23, 2002 4:42 AM
>> To: turbine-user@jakarta.apache.org
>> Subject: Intake Example
>>
>>
>> I am learning how to use Intake. I am a bit confused by a
>> couple of things.
>>
>> 1. The intake.xml file, I checked in the archive about its
>> location in the file system. Britta Ladwig-Attinger on 28th
>> June 2001 has posted this exact question, but it does not
>> seem to be conclusive. So, where should this file be located?
>> I have uncommented the three fields for Intake in
>> TurbineResrouces.properties, tried adding a intake.xml file
>> under app/WBE-INF/conf and "ant init" again. Don't know what
>> to expect at this stage.
>>
>> 2. The Action file used in the Intake howto, where should
>> this file be located? and What should the .java file be
>> named? Should I put it under
>> ./src/java/org/mycompany/medici/modules/actions/  and call it
>> myAction.java ...
>>
>> thanks
>> michael
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>> For
>> additional commands,
>> e-mail: <ma...@jakarta.apache.org>
>>
>>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Intake Example

Posted by Quinton McCombs <qm...@nequalsone.com>.
The intake.xml file should be located in your WEB-INF/conf directory.

For the action, the name of the calls should match the action name.  It
should be located in your modules.actions package.  Make sure that your
setting for module.packages includes the name of your applications,
modules as well as those for turbine.  For exmaple, if your actions are
under com.mycompany.sampleapp.modules.actions, the entry in
TurbineResource.properties should read:

module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.modul
es

For all of the details on how actions work, look at the Velocity Site
how-to and the Action Events how-to.


> -----Original Message-----
> From: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com] 
> Sent: Monday, December 23, 2002 4:42 AM
> To: turbine-user@jakarta.apache.org
> Subject: Intake Example
> 
> 
> I am learning how to use Intake. I am a bit confused by a 
> couple of things.
> 
> 1. The intake.xml file, I checked in the archive about its 
> location in the file system. Britta Ladwig-Attinger on 28th 
> June 2001 has posted this exact question, but it does not 
> seem to be conclusive. So, where should this file be located? 
> I have uncommented the three fields for Intake in 
> TurbineResrouces.properties, tried adding a intake.xml file 
> under app/WBE-INF/conf and "ant init" again. Don't know what 
> to expect at this stage.
> 
> 2. The Action file used in the Intake howto, where should 
> this file be located? and What should the .java file be 
> named? Should I put it under 
> ./src/java/org/mycompany/medici/modules/actions/  and call it 
> myAction.java ...
> 
> thanks
> michael
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Intake Example

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
I am learning how to use Intake. I am a bit confused by a couple of things.

1. The intake.xml file, I checked in the archive about its location in the
file system. Britta Ladwig-Attinger on 28th June 2001 has posted this
exact question, but it does not seem to be conclusive. So, where should
this file be located? I have uncommented the three fields for Intake in
TurbineResrouces.properties, tried adding a intake.xml file under
app/WBE-INF/conf and "ant init" again. Don't know what to expect at this
stage.

2. The Action file used in the Intake howto, where should this file be
located? and What should the .java file be named? Should I put it under
./src/java/org/mycompany/medici/modules/actions/  and call it
myAction.java ...

thanks
michael




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Sample app build error

Posted by Jake Fear <fe...@grifware.com>.
Make sure you have set the tdk.home property all of you *.properties
files.

On Tue, 2003-01-07 at 08:54, pavel kusch wrote:
> Hello,
> We are having a problem to create the sample app in TDK 2.2.01. Got thru
> the first step running ant (just added the home) and now after we
> modified build.properties and running ant init, the message bellow is 
> generated.
> 
> I got one reply on the mailing list:
> 
> "Try copying the ss-data.dtd file to the directory you are running Ant 
> from; that worked for me. Or try changing the system identifier in the 
> XML files Torque reads to use an absolute path to the DTDs, that might
> help too."
> 
> But I could not find the ss-data.dtd file. Please, could you help me to 
> get it up and running. We are moving our application from 2.1 to 2.2 and 
> need it fast. I would really appreciate your help. Thank you.
> 
> 
> ************************************************************************
> init-tasks:
> 
> create-database:
> 
> create-db-check:
> 
> create-db:
> [torque-data-model] Using classpath
> [torque-data-model] Generating to file
> /home/pavel/turbine/tdk-2.2/webapps/newapp/WEB-INF/src/sql/create-db.sql
> [torque-data-model] Resolver: used database.dtd from
> org.apache.torque.engine.database.transform package
> [torque-data-model] Resolver: used database.dtd from
> org.apache.torque.engine.database.transform package
> [torque-data-model] Resolver: used database.dtd from
> org.apache.torque.engine.database.transform package
> 
> BUILD FAILED
> file:/home/pavel/turbine/tdk-2.2/webapps/newapp/WEB-INF/build/build-torque.xml:284: 
> 
> Resource not found. For more information consult the velocity log, or
> invoke ant with the -debug flag.
> ****************************************************************************
> It is complaining that it did not find the resource but the file is in
> the directory which is specified in the path.
> 
> In the build.properties we have changed:
> 
> PROJECT PROPERTIES:
> added: tdk.home = /home/pavel/turbine/tdk-2.2
> 
> DATABASE SETTINGS:
> database.name = newapp
> database = mysql
> createDatabaseUrl = jdbc:mysql://127.0.0.1/newapp
> buildDatabaseUrl = jdbc:mysql://127.0.0.1/newapp
> databaseUrl = jdbc:mysql://127.0.0.1/newapp
> databaseDriver = org.gjt.mm.mysql.Driver
> databaseUser = ****
> databasePassword = *****
> databaseHost = 127.0.0.1
> 
> --------------------------------
> os: Linux
> java version "1.3.0_02"
> ant: 1.5
> ----------------------------------
> 
> Thank you  for advice.
> 
> with regards,
> pavel kusch
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
Jake Fear <fe...@grifware.com>
Grifware.Com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Sample app build error

Posted by pavel kusch <pa...@icecentric.com>.
Hello,
We are having a problem to create the sample app in TDK 2.2.01. Got thru
the first step running ant (just added the home) and now after we
modified build.properties and running ant init, the message bellow is 
generated.

I got one reply on the mailing list:

"Try copying the ss-data.dtd file to the directory you are running Ant 
from; that worked for me. Or try changing the system identifier in the 
XML files Torque reads to use an absolute path to the DTDs, that might
help too."

But I could not find the ss-data.dtd file. Please, could you help me to 
get it up and running. We are moving our application from 2.1 to 2.2 and 
need it fast. I would really appreciate your help. Thank you.


************************************************************************
init-tasks:

create-database:

create-db-check:

create-db:
[torque-data-model] Using classpath
[torque-data-model] Generating to file
/home/pavel/turbine/tdk-2.2/webapps/newapp/WEB-INF/src/sql/create-db.sql
[torque-data-model] Resolver: used database.dtd from
org.apache.torque.engine.database.transform package
[torque-data-model] Resolver: used database.dtd from
org.apache.torque.engine.database.transform package
[torque-data-model] Resolver: used database.dtd from
org.apache.torque.engine.database.transform package

BUILD FAILED
file:/home/pavel/turbine/tdk-2.2/webapps/newapp/WEB-INF/build/build-torque.xml:284: 

Resource not found. For more information consult the velocity log, or
invoke ant with the -debug flag.
****************************************************************************
It is complaining that it did not find the resource but the file is in
the directory which is specified in the path.

In the build.properties we have changed:

PROJECT PROPERTIES:
added: tdk.home = /home/pavel/turbine/tdk-2.2

DATABASE SETTINGS:
database.name = newapp
database = mysql
createDatabaseUrl = jdbc:mysql://127.0.0.1/newapp
buildDatabaseUrl = jdbc:mysql://127.0.0.1/newapp
databaseUrl = jdbc:mysql://127.0.0.1/newapp
databaseDriver = org.gjt.mm.mysql.Driver
databaseUser = ****
databasePassword = *****
databaseHost = 127.0.0.1

--------------------------------
os: Linux
java version "1.3.0_02"
ant: 1.5
----------------------------------

Thank you  for advice.

with regards,
pavel kusch




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Sample app build init problem

Posted by pavel kusch <pa...@icecentric.com>.
Thanks for helping. Unfortunately, I could not locate the file 
ss-data.dtd . Please, where is the file?

with regards,
Pavel Kusch


Laurie Harper wrote:

> Try copying the ss-data.dtd file to the directory you are running Ant 
> from; that worked for me. Or try changing the system identifier in the 
> XML files Torque reads to use an absolute path to the DTDs, that might 
> help too.
>
> L.
>
> pavel kusch wrote:
>
>> Hello,
>> We are having a problem to create the sample app in TDK 2.2.01. Got thru
>> the first step running ant (just added the home) and now after we
>> modified build.properties and running ant init, this message is 
>> generated.
>>
>> ************************************************************************
>> init-tasks:
>>
>> create-database:
>>
>> create-db-check:
>>
>> create-db:
>> [torque-data-model] Using classpath
>> [torque-data-model] Generating to file
>> /home/pavel/turbine/tdk-2.2/webapps/newapp/WEB-INF/src/sql/create-db.sql
>> [torque-data-model] Resolver: used database.dtd from
>> org.apache.torque.engine.database.transform package
>> [torque-data-model] Resolver: used database.dtd from
>> org.apache.torque.engine.database.transform package
>> [torque-data-model] Resolver: used database.dtd from
>> org.apache.torque.engine.database.transform package
>>
>> BUILD FAILED
>> file:/home/pavel/turbine/tdk-2.2/webapps/newapp/WEB-INF/build/build-torque.xml:284: 
>>
>> Resource not found. For more information consult the velocity log, or
>> invoke ant with the -debug flag.
>> **************************************************************************** 
>>
>> It is complaining that it did not find the resource but the file is in
>> the directory which is specified in the path.
>>
>> In the build.properties we have changed:
>>
>> PROJECT PROPERTIES:
>> added: tdk.home = /home/pavel/turbine/tdk-2.2
>>
>> DATABASE SETTINGS:
>> database.name = newapp
>> database = mysql
>> createDatabaseUrl = jdbc:mysql://127.0.0.1/newapp
>> buildDatabaseUrl = jdbc:mysql://127.0.0.1/newapp
>> databaseUrl = jdbc:mysql://127.0.0.1/newapp
>> databaseDriver = org.gjt.mm.mysql.Driver
>> databaseUser = ****
>> databasePassword = *****
>> databaseHost = 127.0.0.1
>>
>> --------------------------------
>> os: Linux
>> java version "1.3.0_02"
>> ant: 1.5
>> ----------------------------------
>>
>> Thank you  for advice.
>>
>> with regards,
>> pavel kusch
>>
>>
>> -- 
>> To unsubscribe, e-mail:
>>
>> For additional commands, e-mail:
>>
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Sample app build init problem

Posted by Laurie Harper <zo...@holoweb.net>.
Try copying the ss-data.dtd file to the directory you are running Ant 
from; that worked for me. Or try changing the system identifier in the 
XML files Torque reads to use an absolute path to the DTDs, that might 
help too.

L.

pavel kusch wrote:

> Hello,
> We are having a problem to create the sample app in TDK 2.2.01. Got thru
> the first step running ant (just added the home) and now after we
> modified build.properties and running ant init, this message is generated.
>
> ************************************************************************
> init-tasks:
>
> create-database:
>
> create-db-check:
>
> create-db:
> [torque-data-model] Using classpath
> [torque-data-model] Generating to file
> /home/pavel/turbine/tdk-2.2/webapps/newapp/WEB-INF/src/sql/create-db.sql
> [torque-data-model] Resolver: used database.dtd from
> org.apache.torque.engine.database.transform package
> [torque-data-model] Resolver: used database.dtd from
> org.apache.torque.engine.database.transform package
> [torque-data-model] Resolver: used database.dtd from
> org.apache.torque.engine.database.transform package
>
> BUILD FAILED
> file:/home/pavel/turbine/tdk-2.2/webapps/newapp/WEB-INF/build/build-torque.xml:284: 
>
> Resource not found. For more information consult the velocity log, or
> invoke ant with the -debug flag.
> ****************************************************************************
> It is complaining that it did not find the resource but the file is in
> the directory which is specified in the path.
>
> In the build.properties we have changed:
>
> PROJECT PROPERTIES:
> added: tdk.home = /home/pavel/turbine/tdk-2.2
>
> DATABASE SETTINGS:
> database.name = newapp
> database = mysql
> createDatabaseUrl = jdbc:mysql://127.0.0.1/newapp
> buildDatabaseUrl = jdbc:mysql://127.0.0.1/newapp
> databaseUrl = jdbc:mysql://127.0.0.1/newapp
> databaseDriver = org.gjt.mm.mysql.Driver
> databaseUser = ****
> databasePassword = *****
> databaseHost = 127.0.0.1
>
> --------------------------------
> os: Linux
> java version "1.3.0_02"
> ant: 1.5
> ----------------------------------
>
> Thank you  for advice.
>
> with regards,
> pavel kusch
>
>
> --
> To unsubscribe, e-mail:
>
> For additional commands, e-mail:
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Sample app build init problem

Posted by pavel kusch <pa...@icecentric.com>.
Hello,
We are having a problem to create the sample app in TDK 2.2.01. Got thru 
the first step running ant (just added the home) and now after we 
modified build.properties and running ant init, this message is generated.

************************************************************************
init-tasks:

create-database:

create-db-check:

create-db:
[torque-data-model] Using classpath
[torque-data-model] Generating to file 
/home/pavel/turbine/tdk-2.2/webapps/newapp/WEB-INF/src/sql/create-db.sql
[torque-data-model] Resolver: used database.dtd from 
org.apache.torque.engine.database.transform package
[torque-data-model] Resolver: used database.dtd from 
org.apache.torque.engine.database.transform package
[torque-data-model] Resolver: used database.dtd from 
org.apache.torque.engine.database.transform package

BUILD FAILED
file:/home/pavel/turbine/tdk-2.2/webapps/newapp/WEB-INF/build/build-torque.xml:284: 
Resource not found. For more information consult the velocity log, or 
invoke ant with the -debug flag.
****************************************************************************
It is complaining that it did not find the resource but the file is in 
the directory which is specified in the path.

In the build.properties we have changed:

PROJECT PROPERTIES:
added: tdk.home = /home/pavel/turbine/tdk-2.2

DATABASE SETTINGS:
database.name = newapp
database = mysql
createDatabaseUrl = jdbc:mysql://127.0.0.1/newapp
buildDatabaseUrl = jdbc:mysql://127.0.0.1/newapp
databaseUrl = jdbc:mysql://127.0.0.1/newapp
databaseDriver = org.gjt.mm.mysql.Driver
databaseUser = ****
databasePassword = *****
databaseHost = 127.0.0.1

--------------------------------
os: Linux
java version "1.3.0_02"
ant: 1.5
----------------------------------

Thank you  for advice.

with regards,
pavel kusch


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: turbine 2.2 in CVS

Posted by Quinton McCombs <qm...@nequalsone.com>.
My changes should be going into the 2.3 version.  

The problem that you pointed out is fixed in the new version.  

> -----Original Message-----
> From: Jake Fear [mailto:fear@grifware.com] 
> Sent: Monday, December 23, 2002 11:50 AM
> To: Turbine Users List
> Subject: Re: turbine 2.2 in CVS
> 
> 
> Understood, thanks for clearing that up.  Will this functionality be 
> rolled into the 2.2.1 or 2.3 releases when they are finalized?  Also, 
> one last thing while we are on the topic and I will cease to 
> pester you 
> about this.  In looking at the DateStringValidator I think I 
> discovered 
> a problem.  In the 'public Date parse(String) throws ParseException' 
> method I believe there is a bug in the 2_2 branch, and perhaps it has 
> been resolved.  If you have specified a list (1 or more) formats all 
> exceptions are ignored during the parse, which makes sense.  
> However, if 
> you have specified formats then the default df variable will will be 
> null, and the final attempt to format with that instance 
> variable will 
> not be executed.  Thus, the local date variable is null and 
> is returned 
> as such.  It seems that instead it should throw and 
> exception.  I have 
> patched it as such on my machine, and it seems to give the expected 
> behavior.  I have pasted the method below.  I posted this 
> before, but I 
> got now response on it.  If I am off base, could you tell me 
> how?  The 
> code I added is at the bottom, right before the return statement.
> 
>     public Date parse(String s)
>         throws ParseException
>     {
>         Date date = null;
> 
>         if (s == null)
>         {
>             throw new ParseException("Input string was null", -1);
>         }
> 
>         for (int i = 0; i < dateFormats.size(); i++)
>         {
>             sdf.applyPattern((String)dateFormats.get(i));
> 
>             try
>             {
>                 date = sdf.parse(s);
>             }
>             catch (ParseException e)
>             {
>                 // ignore
>                 e.printStackTrace();
>             }
> 
>             if (date != null)
>             {
>                 break;
>             }
>         }
> 
>         if ((date == null) && (df != null))
>         {
>             date = df.parse(s);
>         }
> 
>         if (date == null)
>         {
>             throw new ParseException("Could not match to any 
> format", -1);
>         }
> 
>         return date;
>     }
> 
> 
> Quinton McCombs wrote:
> 
> >The only way that you will get that functionality right now is to 
> >switch to the fulcrum version.  Within the next few days, it will 
> >should be available in T 2.2 HEAD.  I have completed my work on the 
> >service.  I am just waiting for scarab to become available so that I 
> >can post the patches.
> >
> >If you can wait, the new version will have updated docs 
> (including an 
> >updated and commented DTD).  Exception handling and 
> reporting has also 
> >been improved.  A few bug fixes have also been implemented.  If you 
> >look through the messages on the list over the past 2 - 3 days, you 
> >will find a more complete list of the changes being made.
> >
> >  
> >
> >>-----Original Message-----
> >>From: Jake Fear [mailto:fear@grifware.com]
> >>Sent: Monday, December 23, 2002 11:33 AM
> >>To: Turbine Users List
> >>Subject: Re: turbine 2.2 in CVS
> >>
> >>
> >>I am not seeing this behavior in my own application.  I
> >>checked out from 
> >>the branch names TURBINE_2_2_BRANCH and the DateStringField 
> does not 
> >>override the toString() method in that code line.  Perhaps I 
> >>am "barking 
> >>up the wrong branch." ;-)  Thinking this might be the case I also 
> >>grabbed the HEAD tag to see if it lived there.  No such luck. 
> >> Can you 
> >>please tell me where I can grab this functionality.  It does 
> >>sound like 
> >>I would be reinventing the wheel for the most part.
> >>
> >>Cheers,
> >>Jake
> >>
> >>Quinton McCombs wrote:
> >>
> >>    
> >>
> >>>There is something close to this for the DateString field.  The
> >>>toString() method will use the first format rule for the field to
> >>>format the date.  This is actually in the Fulcrum version 
> >>>      
> >>>
> >>which I have
> >>    
> >>
> >>>just completed back porting to T2.2.
> >>>
> >>>What would be ideal is one definition (formatter/mask) that
> >>>      
> >>>
> >>is used for
> >>    
> >>
> >>>both validation and display.  This is what I really like
> >>>      
> >>>
> >>about the way
> >>    
> >>
> >>>that the DatString field is implemented.  It used the first
> >>>      
> >>>
> >>format mask
> >>    
> >>
> >>>for display.  You can still have other masks that will allow other
> >>>formats for the input.
> >>>
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>-----Original Message-----
> >>>>From: Jake Fear [mailto:fear@grifware.com]
> >>>>Sent: Monday, December 23, 2002 2:09 AM
> >>>>To: Turbine Users List
> >>>>Subject: Re: turbine 2.2 in CVS
> >>>>
> >>>>
> >>>>I'm considering adding the capability to specify a 
> formatter for a 
> >>>>field.  I don't want to dupliate any effort.  Can you tell me if 
> >>>>anyone else is working on such a feature already? It does not
> >>>>        
> >>>>
> >>appear like it 
> >>    
> >>
> >>>>would be difficult, provided a few assumptions.
> >>>>1.) There is no need to have several formatters for a field, 
> >>>>one should 
> >>>>always suffice.
> >>>>2.) Specifying a formatter is optional.
> >>>>3.) If a formatter is specified, it will be used in the 
> >>>>toString() call 
> >>>>of the Field class.  If not formatter is specified, the 
> >>>>current behavior 
> >>>>will be used.
> >>>>
> >>>>I think this is a good way to remain backward compatible and have
> >>>>minimum impact on the API, while at the same time allow those 
> >>>>who want 
> >>>>to leverage the solution to do so with little or now code 
> >>>>change (they 
> >>>>may need to rip out any existing solutions to use this one).  The 
> >>>>implementation would be similar to that for rules, only 
> >>>>        
> >>>>
> >>significantly 
> >>    
> >>
> >>>>simpler.  I think this really completes the "Field" 
> >>>>        
> >>>>
> >>abstraction, and 
> >>    
> >>
> >>>>simplifies the writing of templates that must deal with dates, 
> >>>>currencies and the like.
> >>>>
> >>>>Cheers,
> >>>>Jake
> >>>>
> >>>>Quinton McCombs wrote:
> >>>>
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>The DTD is out of date.
> >>>>>
> >>>>>
> >>>>>
> >>>>>     
> >>>>>
> >>>>>          
> >>>>>
> >>>>>>-----Original Message-----
> >>>>>>From: Jake Fear [mailto:fear@grifware.com]
> >>>>>>Sent: Monday, December 23, 2002 1:55 AM
> >>>>>>To: Turbine Users List
> >>>>>>Subject: turbine 2.2 in CVS
> >>>>>>
> >>>>>>
> >>>>>>I am building from the 2.2 branch in CVS.  Can anyone tell
> >>>>>>       
> >>>>>>
> >>>>>>            
> >>>>>>
> >>>>me why the
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>>displayName attribute of an intake group does not appear in the
> >>>>>>intake.dtd?  I actually rely on this attribute, and I am 
> >>>>>>       
> >>>>>>
> >>>>>>            
> >>>>>>
> >>>>concerned it
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>>may be removed from future versions of the product.  Perhaps
> >>>>>>it is very 
> >>>>>>new and only appears in the code.   In any instance, I have 
> >>>>>>       
> >>>>>>
> >>>>>>            
> >>>>>>
> >>>>added it
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>>myself, and the implementing code seems to work fine.
> >>>>>>
> >>>>>>Jake
> >>>>>>
> >>>>>>
> >>>>>>--
> >>>>>>To unsubscribe, e-mail:   
> >>>>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>>>>>For
> >>>>>>additional commands,
> >>>>>>e-mail: <ma...@jakarta.apache.org>
> >>>>>>
> >>>>>>
> >>>>>>  
> >>>>>>
> >>>>>>       
> >>>>>>
> >>>>>>            
> >>>>>>
> >>>>>--
> >>>>>To unsubscribe, e-mail:   
> >>>>>     
> >>>>>
> >>>>>          
> >>>>>
> >>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>For
> >>>>>     
> >>>>>
> >>>>>          
> >>>>>
> >>>>additional commands,
> >>>>e-mail: 
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>><ma...@jakarta.apache.org>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>     
> >>>>>
> >>>>>          
> >>>>>
> >>>>--
> >>>>To unsubscribe, e-mail:   
> >>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>>>For
> >>>>additional commands, 
> >>>>e-mail: <ma...@jakarta.apache.org>
> >>>>
> >>>>
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>--
> >>>To unsubscribe, e-mail:   
> >>>      
> >>>
> >><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>    
> >>
> >>>For 
> >>>      
> >>>
> >>additional commands, 
> >>e-mail: 
> >>    
> >>
> >>><ma...@jakarta.apache.org>
> >>>
> >>>
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>
> >>--
> >>To unsubscribe, e-mail:   
> >><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>For 
> >>additional commands, 
> >>e-mail: <ma...@jakarta.apache.org>
> >>
> >>
> >>    
> >>
> >
> >
> >--
> >To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> >
> >
> >
> >  
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: turbine 2.2 in CVS

Posted by Quinton McCombs <qm...@nequalsone.com>.
I just added my patches into Scarab.  TTWS28 & TTWS29

> -----Original Message-----
> From: Jake Fear [mailto:fear@grifware.com] 
> Sent: Monday, December 23, 2002 11:50 AM
> To: Turbine Users List
> Subject: Re: turbine 2.2 in CVS
> 
> 
> Understood, thanks for clearing that up.  Will this functionality be 
> rolled into the 2.2.1 or 2.3 releases when they are finalized?  Also, 
> one last thing while we are on the topic and I will cease to 
> pester you 
> about this.  In looking at the DateStringValidator I think I 
> discovered 
> a problem.  In the 'public Date parse(String) throws ParseException' 
> method I believe there is a bug in the 2_2 branch, and perhaps it has 
> been resolved.  If you have specified a list (1 or more) formats all 
> exceptions are ignored during the parse, which makes sense.  
> However, if 
> you have specified formats then the default df variable will will be 
> null, and the final attempt to format with that instance 
> variable will 
> not be executed.  Thus, the local date variable is null and 
> is returned 
> as such.  It seems that instead it should throw and 
> exception.  I have 
> patched it as such on my machine, and it seems to give the expected 
> behavior.  I have pasted the method below.  I posted this 
> before, but I 
> got now response on it.  If I am off base, could you tell me 
> how?  The 
> code I added is at the bottom, right before the return statement.
> 
>     public Date parse(String s)
>         throws ParseException
>     {
>         Date date = null;
> 
>         if (s == null)
>         {
>             throw new ParseException("Input string was null", -1);
>         }
> 
>         for (int i = 0; i < dateFormats.size(); i++)
>         {
>             sdf.applyPattern((String)dateFormats.get(i));
> 
>             try
>             {
>                 date = sdf.parse(s);
>             }
>             catch (ParseException e)
>             {
>                 // ignore
>                 e.printStackTrace();
>             }
> 
>             if (date != null)
>             {
>                 break;
>             }
>         }
> 
>         if ((date == null) && (df != null))
>         {
>             date = df.parse(s);
>         }
> 
>         if (date == null)
>         {
>             throw new ParseException("Could not match to any 
> format", -1);
>         }
> 
>         return date;
>     }
> 
> 
> Quinton McCombs wrote:
> 
> >The only way that you will get that functionality right now is to 
> >switch to the fulcrum version.  Within the next few days, it will 
> >should be available in T 2.2 HEAD.  I have completed my work on the 
> >service.  I am just waiting for scarab to become available so that I 
> >can post the patches.
> >
> >If you can wait, the new version will have updated docs 
> (including an 
> >updated and commented DTD).  Exception handling and 
> reporting has also 
> >been improved.  A few bug fixes have also been implemented.  If you 
> >look through the messages on the list over the past 2 - 3 days, you 
> >will find a more complete list of the changes being made.
> >
> >  
> >
> >>-----Original Message-----
> >>From: Jake Fear [mailto:fear@grifware.com]
> >>Sent: Monday, December 23, 2002 11:33 AM
> >>To: Turbine Users List
> >>Subject: Re: turbine 2.2 in CVS
> >>
> >>
> >>I am not seeing this behavior in my own application.  I
> >>checked out from 
> >>the branch names TURBINE_2_2_BRANCH and the DateStringField 
> does not 
> >>override the toString() method in that code line.  Perhaps I 
> >>am "barking 
> >>up the wrong branch." ;-)  Thinking this might be the case I also 
> >>grabbed the HEAD tag to see if it lived there.  No such luck. 
> >> Can you 
> >>please tell me where I can grab this functionality.  It does 
> >>sound like 
> >>I would be reinventing the wheel for the most part.
> >>
> >>Cheers,
> >>Jake
> >>
> >>Quinton McCombs wrote:
> >>
> >>    
> >>
> >>>There is something close to this for the DateString field.  The
> >>>toString() method will use the first format rule for the field to
> >>>format the date.  This is actually in the Fulcrum version 
> >>>      
> >>>
> >>which I have
> >>    
> >>
> >>>just completed back porting to T2.2.
> >>>
> >>>What would be ideal is one definition (formatter/mask) that
> >>>      
> >>>
> >>is used for
> >>    
> >>
> >>>both validation and display.  This is what I really like
> >>>      
> >>>
> >>about the way
> >>    
> >>
> >>>that the DatString field is implemented.  It used the first
> >>>      
> >>>
> >>format mask
> >>    
> >>
> >>>for display.  You can still have other masks that will allow other
> >>>formats for the input.
> >>>
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>-----Original Message-----
> >>>>From: Jake Fear [mailto:fear@grifware.com]
> >>>>Sent: Monday, December 23, 2002 2:09 AM
> >>>>To: Turbine Users List
> >>>>Subject: Re: turbine 2.2 in CVS
> >>>>
> >>>>
> >>>>I'm considering adding the capability to specify a 
> formatter for a 
> >>>>field.  I don't want to dupliate any effort.  Can you tell me if 
> >>>>anyone else is working on such a feature already? It does not
> >>>>        
> >>>>
> >>appear like it 
> >>    
> >>
> >>>>would be difficult, provided a few assumptions.
> >>>>1.) There is no need to have several formatters for a field, 
> >>>>one should 
> >>>>always suffice.
> >>>>2.) Specifying a formatter is optional.
> >>>>3.) If a formatter is specified, it will be used in the 
> >>>>toString() call 
> >>>>of the Field class.  If not formatter is specified, the 
> >>>>current behavior 
> >>>>will be used.
> >>>>
> >>>>I think this is a good way to remain backward compatible and have
> >>>>minimum impact on the API, while at the same time allow those 
> >>>>who want 
> >>>>to leverage the solution to do so with little or now code 
> >>>>change (they 
> >>>>may need to rip out any existing solutions to use this one).  The 
> >>>>implementation would be similar to that for rules, only 
> >>>>        
> >>>>
> >>significantly 
> >>    
> >>
> >>>>simpler.  I think this really completes the "Field" 
> >>>>        
> >>>>
> >>abstraction, and 
> >>    
> >>
> >>>>simplifies the writing of templates that must deal with dates, 
> >>>>currencies and the like.
> >>>>
> >>>>Cheers,
> >>>>Jake
> >>>>
> >>>>Quinton McCombs wrote:
> >>>>
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>The DTD is out of date.
> >>>>>
> >>>>>
> >>>>>
> >>>>>     
> >>>>>
> >>>>>          
> >>>>>
> >>>>>>-----Original Message-----
> >>>>>>From: Jake Fear [mailto:fear@grifware.com]
> >>>>>>Sent: Monday, December 23, 2002 1:55 AM
> >>>>>>To: Turbine Users List
> >>>>>>Subject: turbine 2.2 in CVS
> >>>>>>
> >>>>>>
> >>>>>>I am building from the 2.2 branch in CVS.  Can anyone tell
> >>>>>>       
> >>>>>>
> >>>>>>            
> >>>>>>
> >>>>me why the
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>>displayName attribute of an intake group does not appear in the
> >>>>>>intake.dtd?  I actually rely on this attribute, and I am 
> >>>>>>       
> >>>>>>
> >>>>>>            
> >>>>>>
> >>>>concerned it
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>>may be removed from future versions of the product.  Perhaps
> >>>>>>it is very 
> >>>>>>new and only appears in the code.   In any instance, I have 
> >>>>>>       
> >>>>>>
> >>>>>>            
> >>>>>>
> >>>>added it
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>>myself, and the implementing code seems to work fine.
> >>>>>>
> >>>>>>Jake
> >>>>>>
> >>>>>>
> >>>>>>--
> >>>>>>To unsubscribe, e-mail:   
> >>>>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>>>>>For
> >>>>>>additional commands,
> >>>>>>e-mail: <ma...@jakarta.apache.org>
> >>>>>>
> >>>>>>
> >>>>>>  
> >>>>>>
> >>>>>>       
> >>>>>>
> >>>>>>            
> >>>>>>
> >>>>>--
> >>>>>To unsubscribe, e-mail:   
> >>>>>     
> >>>>>
> >>>>>          
> >>>>>
> >>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>For
> >>>>>     
> >>>>>
> >>>>>          
> >>>>>
> >>>>additional commands,
> >>>>e-mail: 
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>><ma...@jakarta.apache.org>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>     
> >>>>>
> >>>>>          
> >>>>>
> >>>>--
> >>>>To unsubscribe, e-mail:   
> >>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>>>For
> >>>>additional commands, 
> >>>>e-mail: <ma...@jakarta.apache.org>
> >>>>
> >>>>
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>--
> >>>To unsubscribe, e-mail:   
> >>>      
> >>>
> >><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>    
> >>
> >>>For 
> >>>      
> >>>
> >>additional commands, 
> >>e-mail: 
> >>    
> >>
> >>><ma...@jakarta.apache.org>
> >>>
> >>>
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>
> >>--
> >>To unsubscribe, e-mail:   
> >><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>For 
> >>additional commands, 
> >>e-mail: <ma...@jakarta.apache.org>
> >>
> >>
> >>    
> >>
> >
> >
> >--
> >To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> >
> >
> >
> >  
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: turbine 2.2 in CVS

Posted by Jake Fear <fe...@grifware.com>.
Understood, thanks for clearing that up.  Will this functionality be 
rolled into the 2.2.1 or 2.3 releases when they are finalized?  Also, 
one last thing while we are on the topic and I will cease to pester you 
about this.  In looking at the DateStringValidator I think I discovered 
a problem.  In the 'public Date parse(String) throws ParseException' 
method I believe there is a bug in the 2_2 branch, and perhaps it has 
been resolved.  If you have specified a list (1 or more) formats all 
exceptions are ignored during the parse, which makes sense.  However, if 
you have specified formats then the default df variable will will be 
null, and the final attempt to format with that instance variable will 
not be executed.  Thus, the local date variable is null and is returned 
as such.  It seems that instead it should throw and exception.  I have 
patched it as such on my machine, and it seems to give the expected 
behavior.  I have pasted the method below.  I posted this before, but I 
got now response on it.  If I am off base, could you tell me how?  The 
code I added is at the bottom, right before the return statement.

    public Date parse(String s)
        throws ParseException
    {
        Date date = null;

        if (s == null)
        {
            throw new ParseException("Input string was null", -1);
        }

        for (int i = 0; i < dateFormats.size(); i++)
        {
            sdf.applyPattern((String)dateFormats.get(i));

            try
            {
                date = sdf.parse(s);
            }
            catch (ParseException e)
            {
                // ignore
                e.printStackTrace();
            }

            if (date != null)
            {
                break;
            }
        }

        if ((date == null) && (df != null))
        {
            date = df.parse(s);
        }

        if (date == null)
        {
            throw new ParseException("Could not match to any format", -1);
        }

        return date;
    }


Quinton McCombs wrote:

>The only way that you will get that functionality right now is to switch
>to the fulcrum version.  Within the next few days, it will should be
>available in T 2.2 HEAD.  I have completed my work on the service.  I am
>just waiting for scarab to become available so that I can post the
>patches.
>
>If you can wait, the new version will have updated docs (including an
>updated and commented DTD).  Exception handling and reporting has also
>been improved.  A few bug fixes have also been implemented.  If you look
>through the messages on the list over the past 2 - 3 days, you will find
>a more complete list of the changes being made.
>
>  
>
>>-----Original Message-----
>>From: Jake Fear [mailto:fear@grifware.com] 
>>Sent: Monday, December 23, 2002 11:33 AM
>>To: Turbine Users List
>>Subject: Re: turbine 2.2 in CVS
>>
>>
>>I am not seeing this behavior in my own application.  I 
>>checked out from 
>>the branch names TURBINE_2_2_BRANCH and the DateStringField does not 
>>override the toString() method in that code line.  Perhaps I 
>>am "barking 
>>up the wrong branch." ;-)  Thinking this might be the case I also 
>>grabbed the HEAD tag to see if it lived there.  No such luck. 
>> Can you 
>>please tell me where I can grab this functionality.  It does 
>>sound like 
>>I would be reinventing the wheel for the most part.
>>
>>Cheers,
>>Jake
>>
>>Quinton McCombs wrote:
>>
>>    
>>
>>>There is something close to this for the DateString field.  The
>>>toString() method will use the first format rule for the field to 
>>>format the date.  This is actually in the Fulcrum version 
>>>      
>>>
>>which I have 
>>    
>>
>>>just completed back porting to T2.2.
>>>
>>>What would be ideal is one definition (formatter/mask) that 
>>>      
>>>
>>is used for 
>>    
>>
>>>both validation and display.  This is what I really like 
>>>      
>>>
>>about the way 
>>    
>>
>>>that the DatString field is implemented.  It used the first 
>>>      
>>>
>>format mask 
>>    
>>
>>>for display.  You can still have other masks that will allow other 
>>>formats for the input.
>>>
>>>
>>> 
>>>
>>>      
>>>
>>>>-----Original Message-----
>>>>From: Jake Fear [mailto:fear@grifware.com]
>>>>Sent: Monday, December 23, 2002 2:09 AM
>>>>To: Turbine Users List
>>>>Subject: Re: turbine 2.2 in CVS
>>>>
>>>>
>>>>I'm considering adding the capability to specify a formatter for a
>>>>field.  I don't want to dupliate any effort.  Can you tell me 
>>>>if anyone 
>>>>else is working on such a feature already? It does not 
>>>>        
>>>>
>>appear like it 
>>    
>>
>>>>would be difficult, provided a few assumptions.
>>>>1.) There is no need to have several formatters for a field, 
>>>>one should 
>>>>always suffice.
>>>>2.) Specifying a formatter is optional.
>>>>3.) If a formatter is specified, it will be used in the 
>>>>toString() call 
>>>>of the Field class.  If not formatter is specified, the 
>>>>current behavior 
>>>>will be used.
>>>>
>>>>I think this is a good way to remain backward compatible and have
>>>>minimum impact on the API, while at the same time allow those 
>>>>who want 
>>>>to leverage the solution to do so with little or now code 
>>>>change (they 
>>>>may need to rip out any existing solutions to use this one).  The 
>>>>implementation would be similar to that for rules, only 
>>>>        
>>>>
>>significantly 
>>    
>>
>>>>simpler.  I think this really completes the "Field" 
>>>>        
>>>>
>>abstraction, and 
>>    
>>
>>>>simplifies the writing of templates that must deal with dates, 
>>>>currencies and the like.
>>>>
>>>>Cheers,
>>>>Jake
>>>>
>>>>Quinton McCombs wrote:
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>The DTD is out of date.
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>>>-----Original Message-----
>>>>>>From: Jake Fear [mailto:fear@grifware.com]
>>>>>>Sent: Monday, December 23, 2002 1:55 AM
>>>>>>To: Turbine Users List
>>>>>>Subject: turbine 2.2 in CVS
>>>>>>
>>>>>>
>>>>>>I am building from the 2.2 branch in CVS.  Can anyone tell
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>me why the
>>>>   
>>>>
>>>>        
>>>>
>>>>>>displayName attribute of an intake group does not appear in the
>>>>>>intake.dtd?  I actually rely on this attribute, and I am 
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>concerned it
>>>>   
>>>>
>>>>        
>>>>
>>>>>>may be removed from future versions of the product.  Perhaps
>>>>>>it is very 
>>>>>>new and only appears in the code.   In any instance, I have 
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>added it
>>>>   
>>>>
>>>>        
>>>>
>>>>>>myself, and the implementing code seems to work fine.
>>>>>>
>>>>>>Jake
>>>>>>
>>>>>>
>>>>>>--
>>>>>>To unsubscribe, e-mail:   
>>>>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>>>>>For
>>>>>>additional commands,
>>>>>>e-mail: <ma...@jakarta.apache.org>
>>>>>>
>>>>>>
>>>>>>  
>>>>>>
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>>--
>>>>>To unsubscribe, e-mail:   
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>>>   
>>>>
>>>>        
>>>>
>>>>>For
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>additional commands,
>>>>e-mail: 
>>>>   
>>>>
>>>>        
>>>>
>>>>><ma...@jakarta.apache.org>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>--
>>>>To unsubscribe, e-mail:   
>>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>>>For
>>>>additional commands, 
>>>>e-mail: <ma...@jakarta.apache.org>
>>>>
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>--
>>>To unsubscribe, e-mail:   
>>>      
>>>
>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>    
>>
>>>For 
>>>      
>>>
>>additional commands, 
>>e-mail: 
>>    
>>
>>><ma...@jakarta.apache.org>
>>>
>>>
>>>
>>> 
>>>
>>>      
>>>
>>
>>--
>>To unsubscribe, e-mail:   
>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>For 
>>additional commands, 
>>e-mail: <ma...@jakarta.apache.org>
>>
>>
>>    
>>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: turbine 2.2 in CVS

Posted by Quinton McCombs <qm...@nequalsone.com>.
The only way that you will get that functionality right now is to switch
to the fulcrum version.  Within the next few days, it will should be
available in T 2.2 HEAD.  I have completed my work on the service.  I am
just waiting for scarab to become available so that I can post the
patches.

If you can wait, the new version will have updated docs (including an
updated and commented DTD).  Exception handling and reporting has also
been improved.  A few bug fixes have also been implemented.  If you look
through the messages on the list over the past 2 - 3 days, you will find
a more complete list of the changes being made.

> -----Original Message-----
> From: Jake Fear [mailto:fear@grifware.com] 
> Sent: Monday, December 23, 2002 11:33 AM
> To: Turbine Users List
> Subject: Re: turbine 2.2 in CVS
> 
> 
> I am not seeing this behavior in my own application.  I 
> checked out from 
> the branch names TURBINE_2_2_BRANCH and the DateStringField does not 
> override the toString() method in that code line.  Perhaps I 
> am "barking 
> up the wrong branch." ;-)  Thinking this might be the case I also 
> grabbed the HEAD tag to see if it lived there.  No such luck. 
>  Can you 
> please tell me where I can grab this functionality.  It does 
> sound like 
> I would be reinventing the wheel for the most part.
> 
> Cheers,
> Jake
> 
> Quinton McCombs wrote:
> 
> >There is something close to this for the DateString field.  The
> >toString() method will use the first format rule for the field to 
> >format the date.  This is actually in the Fulcrum version 
> which I have 
> >just completed back porting to T2.2.
> >
> >What would be ideal is one definition (formatter/mask) that 
> is used for 
> >both validation and display.  This is what I really like 
> about the way 
> >that the DatString field is implemented.  It used the first 
> format mask 
> >for display.  You can still have other masks that will allow other 
> >formats for the input.
> >
> >
> >  
> >
> >>-----Original Message-----
> >>From: Jake Fear [mailto:fear@grifware.com]
> >>Sent: Monday, December 23, 2002 2:09 AM
> >>To: Turbine Users List
> >>Subject: Re: turbine 2.2 in CVS
> >>
> >>
> >>I'm considering adding the capability to specify a formatter for a
> >>field.  I don't want to dupliate any effort.  Can you tell me 
> >>if anyone 
> >>else is working on such a feature already? It does not 
> appear like it 
> >>would be difficult, provided a few assumptions.
> >>1.) There is no need to have several formatters for a field, 
> >>one should 
> >>always suffice.
> >>2.) Specifying a formatter is optional.
> >>3.) If a formatter is specified, it will be used in the 
> >>toString() call 
> >>of the Field class.  If not formatter is specified, the 
> >>current behavior 
> >>will be used.
> >>
> >>I think this is a good way to remain backward compatible and have
> >>minimum impact on the API, while at the same time allow those 
> >>who want 
> >>to leverage the solution to do so with little or now code 
> >>change (they 
> >>may need to rip out any existing solutions to use this one).  The 
> >>implementation would be similar to that for rules, only 
> significantly 
> >>simpler.  I think this really completes the "Field" 
> abstraction, and 
> >>simplifies the writing of templates that must deal with dates, 
> >>currencies and the like.
> >>
> >>Cheers,
> >>Jake
> >>
> >>Quinton McCombs wrote:
> >>
> >>    
> >>
> >>>The DTD is out of date.
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>>>-----Original Message-----
> >>>>From: Jake Fear [mailto:fear@grifware.com]
> >>>>Sent: Monday, December 23, 2002 1:55 AM
> >>>>To: Turbine Users List
> >>>>Subject: turbine 2.2 in CVS
> >>>>
> >>>>
> >>>>I am building from the 2.2 branch in CVS.  Can anyone tell
> >>>>        
> >>>>
> >>me why the
> >>    
> >>
> >>>>displayName attribute of an intake group does not appear in the
> >>>>intake.dtd?  I actually rely on this attribute, and I am 
> >>>>        
> >>>>
> >>concerned it
> >>    
> >>
> >>>>may be removed from future versions of the product.  Perhaps
> >>>>it is very 
> >>>>new and only appears in the code.   In any instance, I have 
> >>>>        
> >>>>
> >>added it
> >>    
> >>
> >>>>myself, and the implementing code seems to work fine.
> >>>>
> >>>>Jake
> >>>>
> >>>>
> >>>>--
> >>>>To unsubscribe, e-mail:   
> >>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>>>For
> >>>>additional commands,
> >>>>e-mail: <ma...@jakarta.apache.org>
> >>>>
> >>>>
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>--
> >>>To unsubscribe, e-mail:   
> >>>      
> >>>
> >><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>    
> >>
> >>>For
> >>>      
> >>>
> >>additional commands,
> >>e-mail: 
> >>    
> >>
> >>><ma...@jakarta.apache.org>
> >>>
> >>>
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>
> >>--
> >>To unsubscribe, e-mail:   
> >><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>For
> >>additional commands, 
> >>e-mail: <ma...@jakarta.apache.org>
> >>
> >>
> >>    
> >>
> >
> >
> >--
> >To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >For 
> additional commands, 
> e-mail: 
> ><ma...@jakarta.apache.org>
> >
> >
> >
> >  
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: turbine 2.2 in CVS

Posted by Jake Fear <fe...@grifware.com>.
I am not seeing this behavior in my own application.  I checked out from 
the branch names TURBINE_2_2_BRANCH and the DateStringField does not 
override the toString() method in that code line.  Perhaps I am "barking 
up the wrong branch." ;-)  Thinking this might be the case I also 
grabbed the HEAD tag to see if it lived there.  No such luck.  Can you 
please tell me where I can grab this functionality.  It does sound like 
I would be reinventing the wheel for the most part.

Cheers,
Jake

Quinton McCombs wrote:

>There is something close to this for the DateString field.  The
>toString() method will use the first format rule for the field to format
>the date.  This is actually in the Fulcrum version which I have just
>completed back porting to T2.2.  
>
>What would be ideal is one definition (formatter/mask) that is used for
>both validation and display.  This is what I really like about the way
>that the DatString field is implemented.  It used the first format mask
>for display.  You can still have other masks that will allow other
>formats for the input.
>
>
>  
>
>>-----Original Message-----
>>From: Jake Fear [mailto:fear@grifware.com] 
>>Sent: Monday, December 23, 2002 2:09 AM
>>To: Turbine Users List
>>Subject: Re: turbine 2.2 in CVS
>>
>>
>>I'm considering adding the capability to specify a formatter for a 
>>field.  I don't want to dupliate any effort.  Can you tell me 
>>if anyone 
>>else is working on such a feature already? It does not appear like it 
>>would be difficult, provided a few assumptions.
>>1.) There is no need to have several formatters for a field, 
>>one should 
>>always suffice.
>>2.) Specifying a formatter is optional.
>>3.) If a formatter is specified, it will be used in the 
>>toString() call 
>>of the Field class.  If not formatter is specified, the 
>>current behavior 
>>will be used.
>>
>>I think this is a good way to remain backward compatible and have 
>>minimum impact on the API, while at the same time allow those 
>>who want 
>>to leverage the solution to do so with little or now code 
>>change (they 
>>may need to rip out any existing solutions to use this one).  The 
>>implementation would be similar to that for rules, only significantly 
>>simpler.  I think this really completes the "Field" abstraction, and 
>>simplifies the writing of templates that must deal with dates, 
>>currencies and the like.
>>
>>Cheers,
>>Jake
>>
>>Quinton McCombs wrote:
>>
>>    
>>
>>>The DTD is out of date.
>>>
>>> 
>>>
>>>      
>>>
>>>>-----Original Message-----
>>>>From: Jake Fear [mailto:fear@grifware.com]
>>>>Sent: Monday, December 23, 2002 1:55 AM
>>>>To: Turbine Users List
>>>>Subject: turbine 2.2 in CVS
>>>>
>>>>
>>>>I am building from the 2.2 branch in CVS.  Can anyone tell 
>>>>        
>>>>
>>me why the
>>    
>>
>>>>displayName attribute of an intake group does not appear in the 
>>>>intake.dtd?  I actually rely on this attribute, and I am 
>>>>        
>>>>
>>concerned it 
>>    
>>
>>>>may be removed from future versions of the product.  Perhaps 
>>>>it is very 
>>>>new and only appears in the code.   In any instance, I have 
>>>>        
>>>>
>>added it 
>>    
>>
>>>>myself, and the implementing code seems to work fine.
>>>>
>>>>Jake
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:   
>>>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>>>For
>>>>additional commands, 
>>>>e-mail: <ma...@jakarta.apache.org>
>>>>
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>--
>>>To unsubscribe, e-mail:   
>>>      
>>>
>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>    
>>
>>>For 
>>>      
>>>
>>additional commands, 
>>e-mail: 
>>    
>>
>>><ma...@jakarta.apache.org>
>>>
>>>
>>>
>>> 
>>>
>>>      
>>>
>>
>>--
>>To unsubscribe, e-mail:   
>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>For 
>>additional commands, 
>>e-mail: <ma...@jakarta.apache.org>
>>
>>
>>    
>>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: turbine 2.2 in CVS

Posted by Quinton McCombs <qm...@nequalsone.com>.
There is something close to this for the DateString field.  The
toString() method will use the first format rule for the field to format
the date.  This is actually in the Fulcrum version which I have just
completed back porting to T2.2.  

What would be ideal is one definition (formatter/mask) that is used for
both validation and display.  This is what I really like about the way
that the DatString field is implemented.  It used the first format mask
for display.  You can still have other masks that will allow other
formats for the input.


> -----Original Message-----
> From: Jake Fear [mailto:fear@grifware.com] 
> Sent: Monday, December 23, 2002 2:09 AM
> To: Turbine Users List
> Subject: Re: turbine 2.2 in CVS
> 
> 
> I'm considering adding the capability to specify a formatter for a 
> field.  I don't want to dupliate any effort.  Can you tell me 
> if anyone 
> else is working on such a feature already? It does not appear like it 
> would be difficult, provided a few assumptions.
> 1.) There is no need to have several formatters for a field, 
> one should 
> always suffice.
> 2.) Specifying a formatter is optional.
> 3.) If a formatter is specified, it will be used in the 
> toString() call 
> of the Field class.  If not formatter is specified, the 
> current behavior 
> will be used.
> 
> I think this is a good way to remain backward compatible and have 
> minimum impact on the API, while at the same time allow those 
> who want 
> to leverage the solution to do so with little or now code 
> change (they 
> may need to rip out any existing solutions to use this one).  The 
> implementation would be similar to that for rules, only significantly 
> simpler.  I think this really completes the "Field" abstraction, and 
> simplifies the writing of templates that must deal with dates, 
> currencies and the like.
> 
> Cheers,
> Jake
> 
> Quinton McCombs wrote:
> 
> >The DTD is out of date.
> >
> >  
> >
> >>-----Original Message-----
> >>From: Jake Fear [mailto:fear@grifware.com]
> >>Sent: Monday, December 23, 2002 1:55 AM
> >>To: Turbine Users List
> >>Subject: turbine 2.2 in CVS
> >>
> >>
> >>I am building from the 2.2 branch in CVS.  Can anyone tell 
> me why the
> >>displayName attribute of an intake group does not appear in the 
> >>intake.dtd?  I actually rely on this attribute, and I am 
> concerned it 
> >>may be removed from future versions of the product.  Perhaps 
> >>it is very 
> >>new and only appears in the code.   In any instance, I have 
> added it 
> >>myself, and the implementing code seems to work fine.
> >>
> >>Jake
> >>
> >>
> >>--
> >>To unsubscribe, e-mail:   
> >><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >>For
> >>additional commands, 
> >>e-mail: <ma...@jakarta.apache.org>
> >>
> >>
> >>    
> >>
> >
> >
> >--
> >To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> >For 
> additional commands, 
> e-mail: 
> ><ma...@jakarta.apache.org>
> >
> >
> >
> >  
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: turbine 2.2 in CVS

Posted by Jake Fear <fe...@grifware.com>.
I'm considering adding the capability to specify a formatter for a 
field.  I don't want to dupliate any effort.  Can you tell me if anyone 
else is working on such a feature already? It does not appear like it 
would be difficult, provided a few assumptions.
1.) There is no need to have several formatters for a field, one should 
always suffice.
2.) Specifying a formatter is optional.
3.) If a formatter is specified, it will be used in the toString() call 
of the Field class.  If not formatter is specified, the current behavior 
will be used.

I think this is a good way to remain backward compatible and have 
minimum impact on the API, while at the same time allow those who want 
to leverage the solution to do so with little or now code change (they 
may need to rip out any existing solutions to use this one).  The 
implementation would be similar to that for rules, only significantly 
simpler.  I think this really completes the "Field" abstraction, and 
simplifies the writing of templates that must deal with dates, 
currencies and the like.

Cheers,
Jake

Quinton McCombs wrote:

>The DTD is out of date.
>
>  
>
>>-----Original Message-----
>>From: Jake Fear [mailto:fear@grifware.com] 
>>Sent: Monday, December 23, 2002 1:55 AM
>>To: Turbine Users List
>>Subject: turbine 2.2 in CVS
>>
>>
>>I am building from the 2.2 branch in CVS.  Can anyone tell me why the 
>>displayName attribute of an intake group does not appear in the 
>>intake.dtd?  I actually rely on this attribute, and I am concerned it 
>>may be removed from future versions of the product.  Perhaps 
>>it is very 
>>new and only appears in the code.   In any instance, I have added it 
>>myself, and the implementing code seems to work fine.
>>
>>Jake
>>
>>
>>--
>>To unsubscribe, e-mail:   
>><mailto:turbine-user-> unsubscribe@jakarta.apache.org>
>>For 
>>additional commands, 
>>e-mail: <ma...@jakarta.apache.org>
>>
>>
>>    
>>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: turbine 2.2 in CVS

Posted by Quinton McCombs <qm...@nequalsone.com>.
The DTD is out of date.

> -----Original Message-----
> From: Jake Fear [mailto:fear@grifware.com] 
> Sent: Monday, December 23, 2002 1:55 AM
> To: Turbine Users List
> Subject: turbine 2.2 in CVS
> 
> 
> I am building from the 2.2 branch in CVS.  Can anyone tell me why the 
> displayName attribute of an intake group does not appear in the 
> intake.dtd?  I actually rely on this attribute, and I am concerned it 
> may be removed from future versions of the product.  Perhaps 
> it is very 
> new and only appears in the code.   In any instance, I have added it 
> myself, and the implementing code seems to work fine.
> 
> Jake
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>