You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Onno Scheffers <on...@piraya.nl> on 2007/12/29 16:06:18 UTC

T5: Is the tml-extension configurable?

Hi,

it's been a while since I last used Tapestry. My last couple of projects 
were based on Wicket, simply because that's what the customer wanted. I 
prefer Tapestry myself and I've just started looking at Tapestry 5. It 
looks very promising so far. The only real annoyance for me is the fact 
that I have to use the .tml extension for my templates.

I've read the discussions on it and I understand where it comes from. 
But the reason I've been able to use Tapestry for some big projects has 
been the simple fact that I can seamlessly use templates sent to my by 
external web designers and if changes need to be made to those files, 
those designers can do it with the Tapestry jwcid's still in it (the 
HTML is always kept as close to the original as possible).

All external web designers deliver xhtml files with an html extension or 
xhtml extension. It is annoying to have to rename all those files just 
to be able to use them. In practice this will also mean having to rename 
them back before the designers can update those files, since we might 
have a different designers for each updates or project and training them 
will probably take longer than renaming the files.

Also the html may contain links to static html pages like helpfiles. In 
essence renaming the files means we also have to change those links 
inside the markup every time. This gets in the way of productivity and 
could introduces errors.

It would really help me if I could just configure Tapestry to support 
the .html extension again instead of the .tml extension.
Is this possible or planned for a future release?


Regards,

Onno

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


Re: T5: Is the tml-extension configurable?

Posted by Sven Homburg <ho...@googlemail.com>.
100% approval

Michael Lake-2 wrote:
> 
> 
> 
> 
> if your designers are only designing "pages" and not "components" that  
> will end up in your app's context root (not packaged away in a jar)  
> then you could probably get away with just contributing a  
> PageTemplateLocator in your AppModule. i reckon the odds of that impl  
> changing soon are relatively slim and it's not a complex class at all.
> 
> Otherwise, if you changed it for reading templates from the classpath,  
> then components dropped in by 3rd party developers wouldn't work  
> because they'd have the wrong extension
> 
> -mike lake
> 
> 
> On Dec 29, 2007, at 11:05 AM, Sven Homburg wrote:
> 
>>
>> yes, all is possible,
>> but not easy:
>>
>> you must overwrite some method/classes of tapestry
>>
>> - contributeResourceDigestGenerator in
>> org.apache.tapestry.services.TapestryModule
>> - org.apache.tapestry.internal.services.ComponentTemplateSourceImpl
>> - org.apache.tapestry.internal.services.PageTemplateLocatorImpl
>> - org.apache.tapestry.internal.services.StaticFilesFilter
>>
>> but i think its not recommendable to do this, because
>> you must change some internal services.
>>
>>
>> Onno Scheffers-3 wrote:
>>>
>>> Hi,
>>>
>>> it's been a while since I last used Tapestry. My last couple of  
>>> projects
>>> were based on Wicket, simply because that's what the customer  
>>> wanted. I
>>> prefer Tapestry myself and I've just started looking at Tapestry 5.  
>>> It
>>> looks very promising so far. The only real annoyance for me is the  
>>> fact
>>> that I have to use the .tml extension for my templates.
>>>
>>> I've read the discussions on it and I understand where it comes from.
>>> But the reason I've been able to use Tapestry for some big projects  
>>> has
>>> been the simple fact that I can seamlessly use templates sent to my  
>>> by
>>> external web designers and if changes need to be made to those files,
>>> those designers can do it with the Tapestry jwcid's still in it (the
>>> HTML is always kept as close to the original as possible).
>>>
>>> All external web designers deliver xhtml files with an html  
>>> extension or
>>> xhtml extension. It is annoying to have to rename all those files  
>>> just
>>> to be able to use them. In practice this will also mean having to  
>>> rename
>>> them back before the designers can update those files, since we might
>>> have a different designers for each updates or project and training  
>>> them
>>> will probably take longer than renaming the files.
>>>
>>> Also the html may contain links to static html pages like  
>>> helpfiles. In
>>> essence renaming the files means we also have to change those links
>>> inside the markup every time. This gets in the way of productivity  
>>> and
>>> could introduces errors.
>>>
>>> It would really help me if I could just configure Tapestry to support
>>> the .html extension again instead of the .tml extension.
>>> Is this possible or planned for a future release?
>>>
>>>
>>> Regards,
>>>
>>> Onno
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>>
>> -----
>> ---
>> best regards
>> Sven
>> -- 
>> View this message in context:
>> http://www.nabble.com/T5%3A-Is-the-tml-extension-configurable--tp14538352p14538815.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 


-----
---
best regards
Sven
-- 
View this message in context: http://www.nabble.com/T5%3A-Is-the-tml-extension-configurable--tp14538352p14540155.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5: Is the tml-extension configurable?

Posted by Onno Scheffers <on...@piraya.nl>.
Michael Lake schreef:
> I've testing this with 5.0.8-SNAPSHOT and I am able to .html "page" 
> files from the context root. I don't think this will work with 5.0.6, 
> but maybe 5.0.7

Hi Michael,

I was still working with Tapestry 5.0.6 and, indeed, it doesn't work on 
that version.
After upgrading to Tapestry 5.0.7 everything works like a charm though.

Thank you very much.

Regards,

Onno

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


Re: T5: Is the tml-extension configurable?

Posted by Michael Lake <ml...@netvue.com>.
Ohno -

you almost had it, except the PageTemplateLocatorImpl takes some  
constructor arguments to set it up.

The following snippet should work in your AppModule.

Note how the method name "buildMyLocator" automatically gives that  
service the name "MyLocator".


-----------------------

    public PageTemplateLocator buildMyLocator(@ContextProvider  
AssetFactory contextAssetFactory,

                                               ComponentClassResolver  
componentClassResolver) {
         return new  
PageTemplateLocatorModified(contextAssetFactory.getRootResource(),  
componentClassResolver);
     }


     public static void contributeAliasOverrides(
             @InjectService("MyLocator")PageTemplateLocator locator,
             Configuration<AliasContribution> configuration) {
          
configuration.add(AliasContribution.create(PageTemplateLocator.class,  
locator));
     }

-----------------------

I've testing this with 5.0.8-SNAPSHOT and I am able to .html "page"  
files from the context root. I don't think this will work with 5.0.6,  
but maybe 5.0.7


Hope it works for you,
mike


On Dec 30, 2007, at 6:35 AM, Onno Scheffers wrote:

>
>> if your designers are only designing "pages" and not "components"  
>> that will end up in your app's context root (not packaged away in a  
>> jar) then you could probably get away with just contributing a  
>> PageTemplateLocator in your AppModule.
>
> Hi Michael,
>
> Thanks for your reply. The designers do indeed only design pages, so  
> it seems like your solution is the way to go about it.
> I haven't been able to get this to work though. Maybe you can point  
> out what I'm doing wrong here?
>
> In my AppModule I have this code:
> public static void bind(ServiceBinder binder) {
>  binder.bind(PageTemplateLocator.class,  
> HTMLTemplateLocator.class).withId("htmlLocator");
> }
> public static void contributeAliasOverrides(
>     @InjectService("htmlLocator") PageTemplateLocator locator,
>     Configuration<AliasContribution> configuration) {
>   
> configuration 
> .add(AliasContribution.create(PageTemplateLocator.class, locator));
> }
>
> My HTMLTemplateLocator is currently just an exact copy from the  
> Tapestry PageTemplateLocatorImpl.
>
> This gives me the following error when I try to access the webapp:
>
> Exception constructing service 'htmlLocator':
> Error invoking constructor [MYPACKAGE].HTMLTemplateLocator(Resource,  
> ComponentClassResolver) (at HTMLTemplateLocator.java:31) (for  
> service 'htmlLocator'): No service implements the interface  
> org.apache.tapestry.ioc.Resource.
>
>
> It seems there's a problem setting up the contextRoot Resource  
> required for calling the constructor of my 'custom' TemplateLocator,  
> but it works for the default PageTemplateLocatorImpl?
>
>
> Regards,
>
> Onno
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-u


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


Re: T5: Is the tml-extension configurable?

Posted by Onno Scheffers <on...@piraya.nl>.
> if your designers are only designing "pages" and not "components" that 
> will end up in your app's context root (not packaged away in a jar) 
> then you could probably get away with just contributing a 
> PageTemplateLocator in your AppModule.

Hi Michael,

Thanks for your reply. The designers do indeed only design pages, so it 
seems like your solution is the way to go about it.
I haven't been able to get this to work though. Maybe you can point out 
what I'm doing wrong here?

In my AppModule I have this code:
public static void bind(ServiceBinder binder) {
   binder.bind(PageTemplateLocator.class, 
HTMLTemplateLocator.class).withId("htmlLocator");
}
public static void contributeAliasOverrides(
      @InjectService("htmlLocator") PageTemplateLocator locator,
      Configuration<AliasContribution> configuration) {
   configuration.add(AliasContribution.create(PageTemplateLocator.class, 
locator));
}

My HTMLTemplateLocator is currently just an exact copy from the Tapestry 
PageTemplateLocatorImpl.

This gives me the following error when I try to access the webapp:

Exception constructing service 'htmlLocator':
Error invoking constructor [MYPACKAGE].HTMLTemplateLocator(Resource, ComponentClassResolver) (at HTMLTemplateLocator.java:31) (for service 'htmlLocator'): No service implements the interface org.apache.tapestry.ioc.Resource.


It seems there's a problem setting up the contextRoot Resource required 
for calling the constructor of my 'custom' TemplateLocator, but it works 
for the default PageTemplateLocatorImpl?


Regards,

Onno


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


Re: T5: Is the tml-extension configurable?

Posted by Michael Lake <ml...@netvue.com>.


if your designers are only designing "pages" and not "components" that  
will end up in your app's context root (not packaged away in a jar)  
then you could probably get away with just contributing a  
PageTemplateLocator in your AppModule. i reckon the odds of that impl  
changing soon are relatively slim and it's not a complex class at all.

Otherwise, if you changed it for reading templates from the classpath,  
then components dropped in by 3rd party developers wouldn't work  
because they'd have the wrong extension

-mike lake


On Dec 29, 2007, at 11:05 AM, Sven Homburg wrote:

>
> yes, all is possible,
> but not easy:
>
> you must overwrite some method/classes of tapestry
>
> - contributeResourceDigestGenerator in
> org.apache.tapestry.services.TapestryModule
> - org.apache.tapestry.internal.services.ComponentTemplateSourceImpl
> - org.apache.tapestry.internal.services.PageTemplateLocatorImpl
> - org.apache.tapestry.internal.services.StaticFilesFilter
>
> but i think its not recommendable to do this, because
> you must change some internal services.
>
>
> Onno Scheffers-3 wrote:
>>
>> Hi,
>>
>> it's been a while since I last used Tapestry. My last couple of  
>> projects
>> were based on Wicket, simply because that's what the customer  
>> wanted. I
>> prefer Tapestry myself and I've just started looking at Tapestry 5.  
>> It
>> looks very promising so far. The only real annoyance for me is the  
>> fact
>> that I have to use the .tml extension for my templates.
>>
>> I've read the discussions on it and I understand where it comes from.
>> But the reason I've been able to use Tapestry for some big projects  
>> has
>> been the simple fact that I can seamlessly use templates sent to my  
>> by
>> external web designers and if changes need to be made to those files,
>> those designers can do it with the Tapestry jwcid's still in it (the
>> HTML is always kept as close to the original as possible).
>>
>> All external web designers deliver xhtml files with an html  
>> extension or
>> xhtml extension. It is annoying to have to rename all those files  
>> just
>> to be able to use them. In practice this will also mean having to  
>> rename
>> them back before the designers can update those files, since we might
>> have a different designers for each updates or project and training  
>> them
>> will probably take longer than renaming the files.
>>
>> Also the html may contain links to static html pages like  
>> helpfiles. In
>> essence renaming the files means we also have to change those links
>> inside the markup every time. This gets in the way of productivity  
>> and
>> could introduces errors.
>>
>> It would really help me if I could just configure Tapestry to support
>> the .html extension again instead of the .tml extension.
>> Is this possible or planned for a future release?
>>
>>
>> Regards,
>>
>> Onno
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
>
> -----
> ---
> best regards
> Sven
> -- 
> View this message in context: http://www.nabble.com/T5%3A-Is-the-tml-extension-configurable--tp14538352p14538815.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


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


Re: T5: Is the tml-extension configurable?

Posted by Onno Scheffers <on...@piraya.nl>.
Hi Sven,

so it looks like it is not currently configurable, but it can be worked 
around.
I sill hope it will be made configurable in the future, but for now I 
will see what I can accomplish with your advice. Thanks a lot.


Regards,

Onno



> yes, all is possible,
> but not easy:
>
> you must overwrite some method/classes of tapestry
>
> - contributeResourceDigestGenerator in
> org.apache.tapestry.services.TapestryModule
> - org.apache.tapestry.internal.services.ComponentTemplateSourceImpl
> - org.apache.tapestry.internal.services.PageTemplateLocatorImpl
> - org.apache.tapestry.internal.services.StaticFilesFilter
>
> but i think its not recommendable to do this, because
> you must change some internal services.
>
>
> Onno Scheffers-3 wrote:
>   
>> Hi,
>>
>> it's been a while since I last used Tapestry. My last couple of projects 
>> were based on Wicket, simply because that's what the customer wanted. I 
>> prefer Tapestry myself and I've just started looking at Tapestry 5. It 
>> looks very promising so far. The only real annoyance for me is the fact 
>> that I have to use the .tml extension for my templates.
>>
>> I've read the discussions on it and I understand where it comes from. 
>> But the reason I've been able to use Tapestry for some big projects has 
>> been the simple fact that I can seamlessly use templates sent to my by 
>> external web designers and if changes need to be made to those files, 
>> those designers can do it with the Tapestry jwcid's still in it (the 
>> HTML is always kept as close to the original as possible).
>>
>> All external web designers deliver xhtml files with an html extension or 
>> xhtml extension. It is annoying to have to rename all those files just 
>> to be able to use them. In practice this will also mean having to rename 
>> them back before the designers can update those files, since we might 
>> have a different designers for each updates or project and training them 
>> will probably take longer than renaming the files.
>>
>> Also the html may contain links to static html pages like helpfiles. In 
>> essence renaming the files means we also have to change those links 
>> inside the markup every time. This gets in the way of productivity and 
>> could introduces errors.
>>
>> It would really help me if I could just configure Tapestry to support 
>> the .html extension again instead of the .tml extension.
>> Is this possible or planned for a future release?
>>
>>
>> Regards,
>>
>> Onno
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>>     
>
>
> -----
> ---
> best regards
> Sven
>   


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


Re: T5: Is the tml-extension configurable?

Posted by Sven Homburg <ho...@googlemail.com>.
yes, all is possible,
but not easy:

you must overwrite some method/classes of tapestry

- contributeResourceDigestGenerator in
org.apache.tapestry.services.TapestryModule
- org.apache.tapestry.internal.services.ComponentTemplateSourceImpl
- org.apache.tapestry.internal.services.PageTemplateLocatorImpl
- org.apache.tapestry.internal.services.StaticFilesFilter

but i think its not recommendable to do this, because
you must change some internal services.


Onno Scheffers-3 wrote:
> 
> Hi,
> 
> it's been a while since I last used Tapestry. My last couple of projects 
> were based on Wicket, simply because that's what the customer wanted. I 
> prefer Tapestry myself and I've just started looking at Tapestry 5. It 
> looks very promising so far. The only real annoyance for me is the fact 
> that I have to use the .tml extension for my templates.
> 
> I've read the discussions on it and I understand where it comes from. 
> But the reason I've been able to use Tapestry for some big projects has 
> been the simple fact that I can seamlessly use templates sent to my by 
> external web designers and if changes need to be made to those files, 
> those designers can do it with the Tapestry jwcid's still in it (the 
> HTML is always kept as close to the original as possible).
> 
> All external web designers deliver xhtml files with an html extension or 
> xhtml extension. It is annoying to have to rename all those files just 
> to be able to use them. In practice this will also mean having to rename 
> them back before the designers can update those files, since we might 
> have a different designers for each updates or project and training them 
> will probably take longer than renaming the files.
> 
> Also the html may contain links to static html pages like helpfiles. In 
> essence renaming the files means we also have to change those links 
> inside the markup every time. This gets in the way of productivity and 
> could introduces errors.
> 
> It would really help me if I could just configure Tapestry to support 
> the .html extension again instead of the .tml extension.
> Is this possible or planned for a future release?
> 
> 
> Regards,
> 
> Onno
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 


-----
---
best regards
Sven
-- 
View this message in context: http://www.nabble.com/T5%3A-Is-the-tml-extension-configurable--tp14538352p14538815.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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