You can still use the tapestry-spring integration - the spring prefix
still exists in your hivemodule as well as in your page/component specs:

<set-object property="propertyToSet"
                    value="spring:beanToInject" />

And make sure you have a setPropertyToSet method in your service
implementation. 

-----Original Message-----
From: Michael Lake [mailto:[EMAIL PROTECTED] 
Sent: 29 June 2006 04:46
To: Tapestry users
Subject: getting spring services inside my custom service (
IEngineService) using hivemind

Hello folks, I've tried bouncing around the usual spots for getting 
information on what i'm trying to do. no luck.

For those of you familiar with Tong's book, I've implemented his chapter

which demonstrates a custom service for displaying an image. now to get 
the bytes from a REAL database..

I have DAOs set up as spring beans to for utilizing hibernate. Normally 
in page objects I can use Howard's tapestry-spring contribution to 
access them via @InjectObject("spring:userDao")

..but it seems that's not allowed in custom services... I'm pretty sure 
I need to make a setter and use the <set-object property="..."> element 
in hivemodule.xml. beyond that, I'm lost at how to get my 
spring/hibernate DAO in there.

any help would be greatly appreciated. thanks

-mike

Here's my current hivemodule.xml

<module id="com.mydomain.tapestryspring" version="1.0.0">
    <implementation
        service-id="hivemind.lib.DefaultSpringBeanFactoryHolder">
        <invoke-factory>
            <construct autowire-services="false"
                
class="com.mydomain.tapestryspring.XSpringBeanFactoryHolderImpl">
                <event-listener
                    service-id="hivemind.ShutdownCoordinator" />
                <set-object property="context"
                    value="service:tapestry.globals.WebContext" />
            </construct>
        </invoke-factory>
    </implementation>
    <service-point id="CaptchaService"
        interface="org.apache.tapestry.engine.IEngineService">
        <invoke-factory>
            <construct class="com.mydomain.services.CaptchaService">
                <set-object property="linkFactory"
                    value="service:tapestry.url.LinkFactory" />
            </construct>
        </invoke-factory>
    </service-point>
    <service-point id="ImageService"
        interface="org.apache.tapestry.engine.IEngineService">
        <invoke-factory>
            <construct class="com.mydomain.services.ImageService">
                <set-object property="linkFactory" 
value="service:tapestry.url.LinkFactory"/>
            </construct>
        </invoke-factory>
    </service-point>
   
    <contribution
        configuration-id="tapestry.services.ApplicationServices">
        <service name="image" object="service:ImageService" />
    </contribution>
    <contribution
        configuration-id="tapestry.services.ApplicationServices">
        <service name="captcha" object="service:CaptchaService" />
    </contribution>
    <contribution
        configuration-id="tapestry.state.ApplicationObjects">
        <state-object name="user" scope="session">
            <create-instance class="com.mydomain.shared.models.User" />
        </state-object>
    </contribution>


</module>

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