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