Here is an example from a production application:

    <service-point id="ChartEngine"
        interface="org.apache.tapestry.engine.IEngineService">
        <invoke-factory model="threaded">
            <construct class="impl.ChartEngineServiceImpl">
                <set-object property="exceptionReporter"
                    value="infrastructure:requestExceptionReporter" />
                <set-object property="response"
                    value="infrastructure:response" />
                <set-object property="linkFactory"
                    value="infrastructure:linkFactory" />
                <set-object property="request"
                    value="infrastructure:request" />
            </construct>
        </invoke-factory>
    </service-point>


    <contribution configuration-id="tapestry.url.ServiceEncoders">
            <path-encoder id="chart" path="/chart" service="chart" />

    </contribution>

    <contribution configuration-id="tapestry.services.ApplicationServices">
        <service name="chart" object="service:bookie.framework.ChartEngine"/>

    </contribution>

On Feb 19, 2008 4:52 PM, Stroeber, Andreas <[EMAIL PROTECTED]>
wrote:

> Hi users,
>
> It's driving me crazy. :o(
>
> The thing i want to accomplish is, adding a new service to my tapestry
> application. Relying on "Enjoying Web Development with Tapestry", it can be
> done by writing a class implementing the interface IEngineService and
> furthermore adding some configuration to the file
> src/META-INF/hivemodule.xml. That should be all to get it work. For example
> hivemodule.xml could look like this:
>
> <?xml version="1.0"?>
>     <module id="com.ttdev.album" version="1.0.0">
>     <contribution configuration-id="tapestry.services.ApplicationServices
> ">
>          <service name="image" object="instance:
> com.ttdev.album.ImageService"/>
>     </contribution>
> </module>
>
>
> So I implemented the interface and made my configuration that looks
> similar to this now:
>
> <?xml version="1.0"?>
> <module id="rd.bird" version="1.0.0">
>    <contribution configuration-id="tapestry.state.ApplicationObjects">
>
>        <!-- PDF-Downloadservice -->
>        <service name="pdf" object="instance:
> rd.bird.colibri.tapservices.FileService"/>
>
>        <!-- Application User -->
>        <state-object name="asoUser" scope="session">
>            <create-instance class="
> rd.bird.colibri.objects.UnauthenticatedUser"/>
>        </state-object>
>
>        <!-- Statusmessages  -->
>        <state-object name="asoStatus" scope="session">
>            <create-instance class="rd.bird.colibri.objects.Status"/>
>        </state-object>
>
>        [ . . . ]
>
>    </contribution>
> </module>
>
>
> But now when starting my application, it throws several Exceptions:
>
> [ +/- ] Exception: Unable to construct configuration
> tapestry.state.ApplicationObjects: Error at
> file:/D:/z__netbeans_workspace__/Colibri/build/web/WEB-INF/classes/META-INF/hivemodule.xml,
> line 6, column 88: Element service is not allowed here.
> org.apache.hivemind.ApplicationRuntimeException
> location:
>  
> file:/D:/z__netbeans_workspace__/Colibri/build/web/WEB-INF/classes/META-INF/hivemodule.xml,
> line 6, column 88
>
> 1       <?xml version="1.0"?>
> 2       <module id="rd.bird" version="1.0.0">
> 3            <contribution configuration-id="
> tapestry.state.ApplicationObjects">
> 4
> 5                <!-- PDF-Downloadservice -->
> 6                <service name="pdf" object="instance:
> rd.bird.colibri.tapservices.FileService"/>
> 7
> 8
> 9
> 10               <!-- Der Benutzer der Anwendung -->
> 11               <state-object name="asoUser" scope="session">
>
> [ +/- ] Exception: Error at
> file:/D:/z__netbeans_workspace__/Colibri/build/web/WEB-INF/classes/META-INF/hivemodule.xml,
> line 6, column 88: Element service is not allowed here.
>
>
> I tried several things... A second <contribution> section, ... But i
> wasn't able to find the definition, where the element should be defined?!
> Where can i find the corresponding DTD? I wasn't able to find one. Who can
> help me? Thanks in advance.
>
> For additional information:
> The purpose of all this is a FileService that serves files that request by
> users. The web application generates links als /app?service=file&id=1234 and
> the user can download files for example. That's not my favorite way, but
> it's the only one I know.
>
>
> Best regards
> Andreas Stroeber
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Best regards,

Igor Drobiazko

Reply via email to