You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Paolo Donà <pa...@gmail.com> on 2005/11/03 19:00:01 UTC

Friendly urls with a custom IEngineService

Hi guys,
I'm trying to set up friendly URLs for a custom service which downloads a
generated excel spreadsheet.
Everything's fine with ugly urls, but cannot setup the friendly ones...

This is my hivemodule config:

<contribution configuration-id="tapestry.services.FactoryServices">
<service name="excel" object="service:Excel"/>
</contribution>

<service-point id="Excel" interface="
org.apache.tapestry.engine.IEngineService">
<invoke-factory>
<construct class="it.archeometra.flotte.business.balance.ExcelService">
<set-object property="linkFactory" value="infrastructure:linkFactory"/>
<set-object property="response" value="service:tapestry.globals.WebResponse
"/>
<set-object property="balanceService" value="spring:balanceService"/>
</construct>
</invoke-factory>
</service-point>

<contribution configuration-id="tapestry.url.ServiceEncoders">
<encoder id="report" before="excel"
object="instance:it.archeometra.flotte.business.balance.ExcelServiceEncoder
"/>
</contribution>

Re: Friendly urls with a custom IEngineService

Posted by Adam Greene <ag...@iq-2000.com>.
Take the before="excel" out, what that refers to is what other 
ServiceEncoders should run before yours, most of the time, you can just put

after="*"

which means run it last.

----- Original Message ----- 
From: "Paolo Donà" <pa...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, November 03, 2005 2:00 PM
Subject: Friendly urls with a custom IEngineService


Hi guys,
I'm trying to set up friendly URLs for a custom service which downloads a
generated excel spreadsheet.
Everything's fine with ugly urls, but cannot setup the friendly ones...

This is my hivemodule config:

<contribution configuration-id="tapestry.services.FactoryServices">
<service name="excel" object="service:Excel"/>
</contribution>

<service-point id="Excel" interface="
org.apache.tapestry.engine.IEngineService">
<invoke-factory>
<construct class="it.archeometra.flotte.business.balance.ExcelService">
<set-object property="linkFactory" value="infrastructure:linkFactory"/>
<set-object property="response" value="service:tapestry.globals.WebResponse
"/>
<set-object property="balanceService" value="spring:balanceService"/>
</construct>
</invoke-factory>
</service-point>

<contribution configuration-id="tapestry.url.ServiceEncoders">
<encoder id="report" before="excel"
object="instance:it.archeometra.flotte.business.balance.ExcelServiceEncoder
"/>
</contribution>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Friendly urls with a custom IEngineService

Posted by Paolo Donà <pa...@gmail.com>.
Thanks Kent, it works with before="*" too.

Paolo

On 11/4/05, Kent Tong <ke...@cpttm.org.mo> wrote:
>
> Paolo Donà <paolo.dona <at> gmail.com <http://gmail.com>> writes:
>
> > I'm getting a RuntimeException "Unknown encoder dependency 'excel' (for
> > 'report')"...
> > basically I don't know what I should type for my 'before' attribute.
> > I put the service name but obviously it's wrong.
> > I really cannot figure out what's wrong...
>
> Just don't set the "before" attribute if you don't mind the ordering
> of your service encoder.
>
> --
> Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: Friendly urls with a custom IEngineService

Posted by Kent Tong <ke...@cpttm.org.mo>.
Paolo Donà <paolo.dona <at> gmail.com> writes:

> I'm getting a RuntimeException "Unknown encoder dependency 'excel' (for
> 'report')"...
> basically I don't know what I should type for my 'before' attribute.
> I put the service name but obviously it's wrong.
> I really cannot figure out what's wrong...

Just don't set the "before" attribute if you don't mind the ordering
of your service encoder.

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Friendly urls with a custom IEngineService

Posted by Paolo Donà <pa...@gmail.com>.
Sorry, I sent the mail too early... :-)

I'm getting a RuntimeException "Unknown encoder dependency 'excel' (for
'report')"...
basically I don't know what I should type for my 'before' attribute.
I put the service name but obviously it's wrong.
I really cannot figure out what's wrong...

Paolo


On 11/3/05, Paolo Donà <pa...@gmail.com> wrote:
>
> Hi guys,
> I'm trying to set up friendly URLs for a custom service which downloads a
> generated excel spreadsheet.
> Everything's fine with ugly urls, but cannot setup the friendly ones...
>
> This is my hivemodule config:
>
> <contribution configuration-id="tapestry.services.FactoryServices">
> <service name="excel" object="service:Excel"/>
> </contribution>
>
> <service-point id="Excel" interface="
> org.apache.tapestry.engine.IEngineService">
> <invoke-factory>
> <construct class="it.archeometra.flotte.business.balance.ExcelService">
> <set-object property="linkFactory" value="infrastructure:linkFactory"/>
> <set-object property="response" value="service:
> tapestry.globals.WebResponse"/>
> <set-object property="balanceService" value="spring:balanceService"/>
> </construct>
> </invoke-factory>
> </service-point>
>
> <contribution configuration-id="tapestry.url.ServiceEncoders">
> <encoder id="report" before="excel"
> object="instance:
> it.archeometra.flotte.business.balance.ExcelServiceEncoder"/>
> </contribution>
>