You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Rex Madden <re...@precision-distribution.com> on 2002/11/01 16:14:26 UTC

RE: Reading a cookie from a session pull tool

Thanks Eric,

Worked like a champ.  I'm realizing now that I'll need to be using the
User objects more than I thought.  The temp storage is the best way to
solve a lot of problems.

Thanks,
Rex

-----Original Message-----
From: Eric Emminger [mailto:eric@ericemminger.com] 
Sent: Thursday, October 31, 2002 11:23 AM
To: Turbine Users List
Subject: Re: Reading a cookie from a session pull tool

Rex

> Is there any way to read and write to a cookie in a session pull tool?
If
> not, is there a workaround I can use?  

I think you have two options.
1) use Turbine; I'll explain
2) use JavaScript; you figure it out

If you want to use Turbine to read and write cookies, you have to be
able to access RunData so that Turbine can modify the HTTP response. You
could also use a request-scope pull tool that would put the RunData into
the User temp storage. Something like

User.setTemp("runData", RunData);

in the init() method of the request tool.

Then, you could User.getTemp() in the session tool to access the
RunData. You can then use the CookieParser as below.

String userId = ((DefaultTurbineRunData)
runData).getCookieParser().get("userId");

> I am trying to put a user id into the cookie that I can get to when
the user
> comes back to the site.  I'm trying not to use the Turbine User
classes
> because I'm not using Torque and plus I have a lot of my own legacy
user
> code already.

I guess this would be a work-around, but you'd only be using the Turbine
User classes to feed data to your legacy code.

Hope that helps. Let me know.

Eric

-- 
Eric Emminger
eric@ericemminger.com


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


Another Intake assumption (2.2b3)

Posted by Mitch Christensen <mi...@informatixinc.com>.
My latest testing of Intake has led to the following assumption...

o If you initialize (and display) a form using mapTo(formBean), then the
user enters valid form data (isAllValid() == true), then you re-display the
form, and call mapTo() again with different initilialization data, the
user's input does not get replaced.  In other words, once a user has entered
data, updating that data seems impossible.

FWIW, I'm trying to do some auto-completion and data scrubbing on user data.
Their input may be acceptable, but not normalized (to it's "proper" format).
For instance, I want to allow a user to type "CA" into a field, and when the
form redisplays (with search results appended to the bottom), "CA" is now
"CALIFORNIA".

My intent is to have the formBean setters scrub/normalize the data, use the
formBean to interact with our data tier, then display the results using
mapTo(formBean) which now contains normalized data.  I've verified that the
formBean contains normalized data in the context, but no matter what, the
original user data is re-displayed.  I suspect that the new (normalized)
value can't override Field.testValue.

Anyone have any thoughts on this one?

-Mitch


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


RE: Understanding $intake declaration

Posted by Mitch Christensen <mi...@informatixinc.com>.
Oops... Found it.

An inner class of IntakeTool called PullHelper.

Now the #set(...) looks like

((IntakeTool.PullHelper)IntakeTool.get("MyGroup")).mapTo(instance_of_MyBeanC
lass) ;


-----Original Message-----
From: Mitch Christensen [mailto:mitch.christensen@informatixinc.com]
Sent: Friday, November 01, 2002 8:35 AM
To: Turbine Users List
Subject: RE: Understanding $intake declaration


...I meant,

IntakeTool.get("MyGroup").mapTo(instance_of_MyBeanClass) ;

sorry. :)



-----Original Message-----
From: Mitch Christensen [mailto:mitch.christensen@informatixinc.com]
Sent: Friday, November 01, 2002 8:32 AM
To: Turbine Users List
Subject: Understanding $intake declaration


When I say...

#set ( $group = $intake.MyGroup.mapTo($formBean) )

What is happening?

I assumed the following...

Group.get("MyGroup").mapTo(instance_of_MyBeanClass) ;

however, there is no Group.mapTo() method.

I suppose another alternative would be...

Group.get("MyGroup").get("mapTo") ...but what about .($formBean)?

I must be missing something.

Thanks,
-Mitch

--
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: Understanding $intake declaration

Posted by Mitch Christensen <mi...@informatixinc.com>.
...I meant,

IntakeTool.get("MyGroup").mapTo(instance_of_MyBeanClass) ;

sorry. :)



-----Original Message-----
From: Mitch Christensen [mailto:mitch.christensen@informatixinc.com]
Sent: Friday, November 01, 2002 8:32 AM
To: Turbine Users List
Subject: Understanding $intake declaration


When I say...

#set ( $group = $intake.MyGroup.mapTo($formBean) )

What is happening?

I assumed the following...

Group.get("MyGroup").mapTo(instance_of_MyBeanClass) ;

however, there is no Group.mapTo() method.

I suppose another alternative would be...

Group.get("MyGroup").get("mapTo") ...but what about .($formBean)?

I must be missing something.

Thanks,
-Mitch

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


Understanding $intake declaration

Posted by Mitch Christensen <mi...@informatixinc.com>.
When I say...

#set ( $group = $intake.MyGroup.mapTo($formBean) )

What is happening?

I assumed the following...

Group.get("MyGroup").mapTo(instance_of_MyBeanClass) ;

however, there is no Group.mapTo() method.

I suppose another alternative would be...

Group.get("MyGroup").get("mapTo") ...but what about .($formBean)?

I must be missing something.

Thanks,
-Mitch

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