Is it possible to set own ASO? e.g. when user sings in to store whole
user entity as aso, not in aso...

2005/9/17, Nick Stuart <[EMAIL PROTECTED]>:
> Ok, so what exactly are you trying to do Travis? If I am reading it
> correctly you simply would to inject a state object (say a user class
> that holds values for a visitor to your site).
> 
> If this IS what you want to do look below:
> 
> First, all your ASO are simple POJO's, nothing speical about them, so
> make your User class and call it good. Next up is configuring hivemind
> to know about it.
> 
> In your hivemodule.xml (if you dont have one, you need one in your
> META-INF folder) you need to add the following few lines:
> ....
>     <contribution configuration-id="tapestry.state.ApplicationObjects">
>         <state-object name="user" scope="session">
>             <create-instance class="User"/>
>         </state-object>
>     </contribution>
> ....
> You can play with the scope and name values to fit your needs. Thats
> all you need to do in hivemind.
> 
> Next, in your page/component class (doesnt matter which) you do the following:
> 
>     @InjectState("user")
>     public abstract User getUser();
> 
> There are similar xml elements for injecting state as well (dont use
> them much so I cant remember them off the top of my head). But
> anyways, thats the full process to adding a state object to your
> application and accessing them in your page.
> 
> -Nick
> 
> On 9/16/05, Travis McLeskey <[EMAIL PROTECTED]> wrote:
> > I misunderstood what was going on here. I thought you were injecting
> > the ApplicationStateManager into a Tapestry page.
> >
> > So: how do you inject the ApplicationStateManager into a Tapestry page?
> > I see that Tapestry's StateBindingFactory gets a reference to the
> > ApplicationStateManager with the line
> >
> >          <set-object property="applicationStateManager"
> > value="infrastructure:applicationStateManager"/>
> >
> > in tapestry.bindings.xml.
> >
> > I don't understand why this isn't documented...am I the only one who
> > wants to access Application State Objects in the Java class?
> >
> > Any help would be appreciated!
> >
> > Thanks,
> > Travis
> >
> >
> >
> >
> > On Sep 16, 2005, at 9:21, Travis McLeskey wrote:
> >
> > > For those of us new to HiveMind, where does the <set-service> element
> > > need to go in the HiveMind config file? I'm just trying to access my
> > > ASO in java code.
> > >
> > > Thanks,
> > > Travis
> > >
> > >
> > >
> > >> Pete <pertl <at> gmx.org> writes:
> > >>
> > >> > does somebody know how to inject 'myState' into the marked
> > >> 'MyFilter'
> > >> > property 'injectedState' ????
> > >>
> > >> Try:
> > >>    <set-service
> > >>      property="appStateMgr"
> > >>      value="tapestry.state.ApplicationStateManager"/>
> > >>
> > >> class MyFilter {
> > >>   ApplicationStateManager appStateMgr;
> > >>
> > >>   MyState getInjectedState() {
> > >>     return (MyState)appStateMgr.get("myState");
> > >>   }
> > >> }
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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

Reply via email to