Hi, Randall. 

I'm using a session scoped pull  Shopping Cart

in turbine2.2.b2


in TurbineResource.properties
tool.session.cart=org.slava.ts.services.pull.cart.Cart

to get access to it in any screen or action

import org.apache.velocity.context.Context;
import org.slava.ts.services.pull.cart.Cart;

//get the session cart from the context
Cart  crt = (Cart) context.get("cart");

//peform operations with cart
crt.addReport(new MyReport());

//save cart in context
context.put("cart", crt);

If every screen modules  gets and puts  a session pull toll from the
context  it remains persistent for a given session. 

I do this on several subsequent screens   to collect data from several
forms  and store it in the cart. 

I've discovered that a session tool works  in WeakScreens,Actions.  i.e.
a user is not required to be logged in. 

After a login,  my cart gets refreshed. 

Regards, 
Slava

On Thu, Jun 06, 2002 at 08:32:53AM -0400, Randall G. Alley wrote:
> Scott,
> 
> I've been looking at this a bit further. For a request scope Pull Tool, 
> there is a new pull instance for each request, and the init method is 
> called and receives the latest RunData object, correct ?
> 
> What I was trying to do was to extract data from a form, and put it in a 
> object in a Session scope tool, to have available for subsequent 
> templates. The request scope Pull object doesn't persist from request to 
> request (a new instance each request), and the Session scope object 
> doesn't get automatically refreshed with the RunData object.
> 
> Are there work arounds for this situation ?
> 1) Could I have the request Pull Tool move the data to the session Pull 
> Tool ? How it get a handle to the session tool without the context object ?
> 2) Or have the request Pull Tool save the data to a persistant object, 
> which I don't like since the object wouldn't be automatically cached, 
> and managed, and so forth.
> 
> Or am I missing something ?
> 
> Thanks again,
> Randy
> 
> Randall G. Alley wrote:
> 
> > Thanks for the tip, Scott. Sorry to bug the dev group. My problem was 
> > that I was using the session scope Tool.
> >
> > Randy
> >
> > Weaver, Scott wrote:
> >
> >> Your question would be better served on the turbine-user list instead of
> >> dev.
> >>
> >> The answer is you need neither an action class nor a screen class to
> >> retreive form values.
> >> All request pull tools are initilized per request with the current 
> >> request's
> >> RunData object.  The RunData object has access to all request variables
> >> including form fields.
> >> RunData.getParameters().getString("someFormField")
> >>
> >>
> >> hth,
> >> Scott
> >>
> >>  
> >>
> >>> -----Original Message-----
> >>> From: Randall G. Alley [mailto:[EMAIL PROTECTED]]
> >>> Sent: Wednesday, June 05, 2002 8:17 AM
> >>> To: Turbine Developers List
> >>> Subject: Extract form data directly from a Pull Tool ?
> >>>
> >>>
> >>> This may be a dumb question, but is there a way to directly extract 
> >>> data from a form submit with
> >>> a Pull Tool with out using an Action or Screen first ?
> >>>
> >>> I'm trying a simple Pull class, and see how it removes the need for 
> >>> a corresponding screen for each template,
> >>> but it still appears that a dedicated action is needed to get the 
> >>> submitted parameters from a form.
> >>>
> >>> Am I missing something ?
> >>>
> >>> Thanks,
> >>> Randy
> >>>
> >>>
> >>> -- 
> >>> To unsubscribe, e-mail:   
> >>> <mailto:[EMAIL PROTECTED]>
> >>> For additional commands, e-mail:   
> >>
> >> <mailto:[EMAIL PROTECTED]>
> >>
> >>  
> >>
> >
> >
> >
> >
> > -- 
> > To unsubscribe, e-mail:   
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> > <mailto:[EMAIL PROTECTED]>
> >
> >
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to