You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Eigen Technology Pty Ltd <mi...@eigentechnology.com> on 2002/12/23 11:42:26 UTC

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:   <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: 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 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>