To access an aso in your service, it is easier to
inject the
 ApplicationManager into your service. Then, in your
service, you use the 
ApplicationManager to retrieve the desired aso.

There is a how-to on this at 
http://lombok.demon.co.uk/tapestry4Demo/Inject.html

Shing

--- Julian Wood <[EMAIL PROTECTED]> wrote:

> Okay, this seems like the ticket. I now have an ASO,
> which I can  
> successfully inject into pages and access when
> needed, but I can't  
> figure out the right syntax for getting it into my
> service.
> 
> In hivemodule.xml, here's my ASO:
> 
>      <contribution
>
configuration-id="tapestry.state.ApplicationObjects">
>          <state-object name="session-data"
> scope="session">
>              <create-instance
> class="ca.ucalgary.tlc.SessionData"/>
>          </state-object>
>      </contribution>
> 
> and for the service:
> 
>      <service-point id="csvSP"  
>
interface="org.apache.tapestry.engine.IEngineService">
>          <invoke-factory>
>              <construct
> class="ca.ucalgary.tlc.CsvService">
>                  <set-object
> property="exceptionReporter"  
> value="infrastructure:requestExceptionReporter"/>
>                  <set-object property="response"  
> value="infrastructure:response"/>
>                  <set-object property="linkFactory" 
> 
> value="infrastructure:linkFactory"/>
>                  <set-object property="sessionData"
> value="app- 
> property:session-data"/>
>              </construct>
>          </invoke-factory>
>      </service-point>
> 
> Of course there are getters/setters for sessionData
> in  
> CsvService.java (just like for linkFactory, response
> - how do you  
> know what objects are available for use, btw), but
> there is something  
> up with value for sessionData. I've tried the
> prefixes app-property,  
> global-property, infrastructure and engine-service
> (just for kicks),  
> but getSessionData() is always null in the service.
> I know it must be  
> simple, but what am I missing?
> 
> Thanks,
> 
> J
> 
> On 18-Jul-06, at 4:54 PM, Shing Hing Man wrote:
> 
> > A possibility is to store the parameters (that are
> > needed to construct the data set) in a session
> ASO.
> > You can inject the above session ASO into your
> > service.
> > So that the data set can be constructed in your
> > service when the service is called.
> >
> > Shing
> >
> 
> --
> Julian Wood <[EMAIL PROTECTED]>
> 
> Software Engineer
> Teaching & Learning Centre
> University of Calgary
> 
> http://tlc.ucalgary.ca
> 
> 
> 


Home page :
  http://uk.geocities.com/matmsh/index.html


        
        
                
___________________________________________________________ 
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease 
of use." - PC Magazine 
http://uk.docs.yahoo.com/nowyoucan.html

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

Reply via email to