You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Patrick Moore <pa...@amplafi.com> on 2010/08/08 01:34:29 UTC

T5: How to have .tml/.properties files in the same directory as the .java files

Hi there --

I am working to move our project from T4 to T5. In T4 we are using the tacos
component resolver that allows the templates and properties files to be in
the same directory.  In T5 how can we do the same thing?

In T4, I have found that having all 3 files .java, .properties, .tml in the
same directory makes editing enormously easier. So this is really, really
important to me. Switching between template and .java when the files are
scattered is a pain.

If there is no existing way, does anyone have some suggestions on how to
gracefully add this in. In T4 it wasn't that hard and it seems like it
should be even easier in T5.

-Pat

Re: T5: How to have .tml/.properties files in the same directory as the .java files

Posted by Sven Homburg <ho...@googlemail.com>.
be sure that your IDE copies the resource files (properties/tml) into
your classpath (WEB-INF/classes)

with regards
Sven Homburg
Founder of the Chenille Kit Project
http://chenillekit.codehaus.org




2010/8/8 Patrick Moore <pa...@amplafi.com>
>
> I tried with the tutorial and it didn't work. the rendering failed.
>
> Patrick Moore
> Amplafi
> http://amplafi.com
> mobile: 650-207-9792
> "Put your front window on your front page"
> corp blog : http://amplafi.com/blog
> personal blog : http://www.sworddance.com/blog
>
>
> On Sat, Aug 7, 2010 at 10:38 PM, Josh Canfield <jo...@gmail.com>wrote:
>
> > > I am working to move our project from T4 to T5. In T4 we are using the
> > tacos
> > > component resolver that allows the templates and properties files to be
> > in
> > > the same directory.  In T5 how can we do the same thing?
> >
> > Hmm... Just do it. The .tml and properties can be in the same package
> > structure as the classes.
> >
> > Josh
> >
> > On Sat, Aug 7, 2010 at 4:34 PM, Patrick Moore <pa...@amplafi.com>
> > wrote:
> > > Hi there --
> > >
> > > I am working to move our project from T4 to T5. In T4 we are using the
> > tacos
> > > component resolver that allows the templates and properties files to be
> > in
> > > the same directory.  In T5 how can we do the same thing?
> > >
> > > In T4, I have found that having all 3 files .java, .properties, .tml in
> > the
> > > same directory makes editing enormously easier. So this is really, really
> > > important to me. Switching between template and .java when the files are
> > > scattered is a pain.
> > >
> > > If there is no existing way, does anyone have some suggestions on how to
> > > gracefully add this in. In T4 it wasn't that hard and it seems like it
> > > should be even easier in T5.
> > >
> > > -Pat
> > >
> >
> >
> >
> > --
> > --
> > http://www.bodylabgym.com - a private, by appointment only, one-on-one
> > health and fitness facility.
> > --
> > http://www.ectransition.com - Quality Electronic Cigarettes at a
> > reasonable price!
> > --
> > TheDailyTube.com. Sign up and get the best new videos on the internet
> > delivered fresh to your inbox.
> >
> > ---------------------------------------------------------------------
> > 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: How to have .tml/.properties files in the same directory as the .java files

Posted by Patrick Moore <pa...@amplafi.com>.
I tried with the tutorial and it didn't work. the rendering failed.

Patrick Moore
Amplafi
http://amplafi.com
mobile: 650-207-9792
"Put your front window on your front page"
corp blog : http://amplafi.com/blog
personal blog : http://www.sworddance.com/blog


On Sat, Aug 7, 2010 at 10:38 PM, Josh Canfield <jo...@gmail.com>wrote:

> > I am working to move our project from T4 to T5. In T4 we are using the
> tacos
> > component resolver that allows the templates and properties files to be
> in
> > the same directory.  In T5 how can we do the same thing?
>
> Hmm... Just do it. The .tml and properties can be in the same package
> structure as the classes.
>
> Josh
>
> On Sat, Aug 7, 2010 at 4:34 PM, Patrick Moore <pa...@amplafi.com>
> wrote:
> > Hi there --
> >
> > I am working to move our project from T4 to T5. In T4 we are using the
> tacos
> > component resolver that allows the templates and properties files to be
> in
> > the same directory.  In T5 how can we do the same thing?
> >
> > In T4, I have found that having all 3 files .java, .properties, .tml in
> the
> > same directory makes editing enormously easier. So this is really, really
> > important to me. Switching between template and .java when the files are
> > scattered is a pain.
> >
> > If there is no existing way, does anyone have some suggestions on how to
> > gracefully add this in. In T4 it wasn't that hard and it seems like it
> > should be even easier in T5.
> >
> > -Pat
> >
>
>
>
> --
> --
> http://www.bodylabgym.com - a private, by appointment only, one-on-one
> health and fitness facility.
> --
> http://www.ectransition.com - Quality Electronic Cigarettes at a
> reasonable price!
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5: How to have .tml/.properties files in the same directory as the .java files

Posted by Josh Canfield <jo...@gmail.com>.
> I am working to move our project from T4 to T5. In T4 we are using the tacos
> component resolver that allows the templates and properties files to be in
> the same directory.  In T5 how can we do the same thing?

Hmm... Just do it. The .tml and properties can be in the same package
structure as the classes.

Josh

On Sat, Aug 7, 2010 at 4:34 PM, Patrick Moore <pa...@amplafi.com> wrote:
> Hi there --
>
> I am working to move our project from T4 to T5. In T4 we are using the tacos
> component resolver that allows the templates and properties files to be in
> the same directory.  In T5 how can we do the same thing?
>
> In T4, I have found that having all 3 files .java, .properties, .tml in the
> same directory makes editing enormously easier. So this is really, really
> important to me. Switching between template and .java when the files are
> scattered is a pain.
>
> If there is no existing way, does anyone have some suggestions on how to
> gracefully add this in. In T4 it wasn't that hard and it seems like it
> should be even easier in T5.
>
> -Pat
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: T5: How to have .tml/.properties files in the same directory as the .java files

Posted by Patrick Moore <pa...@amplafi.com>.
Sounds like a good idea to me....

btw I was looking to figure out where I started going wrong in my
understanding. I fell victim to a  "confirmation bias" that was "confirmed"
by this page: http://tapestry.apache.org/tapestry5.1/tutorial1/first.html ,
which indicated that T5 required all templates be in the webapp directory.

It was also "confirmed" by the archetype tutorial1. I would suggest changing
the example to reflect the thinking of putting templates under resources or
in the java directories in a maven project.

thx

On Sun, Aug 8, 2010 at 1:42 PM, Howard Lewis Ship <hl...@gmail.com> wrote:

> The only exception is page templates which are allowed to be stored in the
> context root.  And in fact, if I were starting T5 again, that would not be
> supported. It may even be removed in a future release.
>
> On Sun, Aug 8, 2010 at 12:07 PM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
> > On Sat, 07 Aug 2010 20:34:29 -0300, Patrick Moore <pa...@amplafi.com>
> > wrote:
> >
> >  Hi there --
> >>
> >
> > Hi!
> >
> >
> >  I am working to move our project from T4 to T5. In T4 we are using the
> >> tacos component resolver that allows the templates and properties files
> to
> >> be in the same directory.  In T5 how can we do the same thing?
> >>
> >
> > In Tapestry 5, it's mandatory you to put them in the same package.
> >
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> > and instructor
> > Owner, Ars Machina Tecnologia da Informação Ltda.
> > http://www.arsmachina.com.br
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn
> how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>

Re: T5: How to have .tml/.properties files in the same directory as the .java files

Posted by Howard Lewis Ship <hl...@gmail.com>.
The only exception is page templates which are allowed to be stored in the
context root.  And in fact, if I were starting T5 again, that would not be
supported. It may even be removed in a future release.

On Sun, Aug 8, 2010 at 12:07 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Sat, 07 Aug 2010 20:34:29 -0300, Patrick Moore <pa...@amplafi.com>
> wrote:
>
>  Hi there --
>>
>
> Hi!
>
>
>  I am working to move our project from T4 to T5. In T4 we are using the
>> tacos component resolver that allows the templates and properties files to
>> be in the same directory.  In T5 how can we do the same thing?
>>
>
> In Tapestry 5, it's mandatory you to put them in the same package.
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to learn
how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Re: T5: How to have .tml/.properties files in the same directory as the .java files

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sat, 07 Aug 2010 20:34:29 -0300, Patrick Moore <pa...@amplafi.com>  
wrote:

> Hi there --

Hi!

> I am working to move our project from T4 to T5. In T4 we are using the  
> tacos component resolver that allows the templates and properties files  
> to be in the same directory.  In T5 how can we do the same thing?

In Tapestry 5, it's mandatory you to put them in the same package.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: T5: How to have .tml/.properties files in the same directory as the .java files

Posted by Patrick Moore <pa...@amplafi.com>.
Well ... sure enough... it works!

I was expecting a problem because the documentation kept talking about
/webapp being the required directory for the .tml files. With no mention of
any other option, I was expecting to have to rig it up.

thanks!

Patrick Moore
Amplafi
http://amplafi.com
mobile: 650-207-9792
"Put your front window on your front page"
corp blog : http://amplafi.com/blog
personal blog : http://www.sworddance.com/blog


On Sun, Aug 8, 2010 at 4:15 AM, Ville Virtanen <vi...@cerion.fi>wrote:

>
> T5 application works ok as is if the files are in the same directory.
>
> If you use maven, then the maven default structure layout dictates that the
> non-java files must be in resources or webapp folders. (The build process
> copies the resources to the same directory structure from java and
> resources.)
>
> Now you want to tell maven to also copy the tml and properties files from
> the java side. One way to do this is to alter your pom.xml: add this inside
> the build tag: (This is not tested, just something I typed on the fly.
> There
> are better ways to do it.)
>
>        <resources>
>            <resource>
>                <directory>src/main/java</directory>
>                <filtering>false</filtering>
>                <includes>
>                        <indluce>**/*.*</indluce>
>                </includes>
>                <excludes>
>                    <exclude>**/*.java</exclude>
>                    <exclude>**/*.class</exclude>
>                </excludes>
>            </resource>
>        </resources>
>
> On the other hand, there is support for IDE:s. We are using Netbeans
> support, which let's users change (and open if not already open) between
> .tml, .java and .properties files.
>
> https://nbtapestrysupport.dev.java.net/
>
>  - Ville
>
> Tapestry 5 actually
>
> Patrick Moore-6 wrote:
> >
> > Hi there --
> >
> > I am working to move our project from T4 to T5. In T4 we are using the
> > tacos
> > component resolver that allows the templates and properties files to be
> in
> > the same directory.  In T5 how can we do the same thing?
> >
> > In T4, I have found that having all 3 files .java, .properties, .tml in
> > the
> > same directory makes editing enormously easier. So this is really, really
> > important to me. Switching between template and .java when the files are
> > scattered is a pain.
> >
> > If there is no existing way, does anyone have some suggestions on how to
> > gracefully add this in. In T4 it wasn't that hard and it seems like it
> > should be even easier in T5.
> >
> > -Pat
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/T5%3A-How-to-have-.tml-.properties-files-in-the-same-directory-as-the--.java-files-tp29377569p29379502.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: How to have .tml/.properties files in the same directory as the .java files

Posted by Ville Virtanen <vi...@cerion.fi>.
T5 application works ok as is if the files are in the same directory. 

If you use maven, then the maven default structure layout dictates that the
non-java files must be in resources or webapp folders. (The build process
copies the resources to the same directory structure from java and
resources.) 

Now you want to tell maven to also copy the tml and properties files from
the java side. One way to do this is to alter your pom.xml: add this inside
the build tag: (This is not tested, just something I typed on the fly. There
are better ways to do it.)

        <resources>
            <resource>
                <directory>src/main/java</directory>
                <filtering>false</filtering>
		<includes>
			<indluce>**/*.*</indluce>
		</includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                    <exclude>**/*.class</exclude>
                </excludes>
            </resource>
        </resources>

On the other hand, there is support for IDE:s. We are using Netbeans
support, which let's users change (and open if not already open) between
.tml, .java and .properties files. 

https://nbtapestrysupport.dev.java.net/

 - Ville

Tapestry 5 actually 

Patrick Moore-6 wrote:
> 
> Hi there --
> 
> I am working to move our project from T4 to T5. In T4 we are using the
> tacos
> component resolver that allows the templates and properties files to be in
> the same directory.  In T5 how can we do the same thing?
> 
> In T4, I have found that having all 3 files .java, .properties, .tml in
> the
> same directory makes editing enormously easier. So this is really, really
> important to me. Switching between template and .java when the files are
> scattered is a pain.
> 
> If there is no existing way, does anyone have some suggestions on how to
> gracefully add this in. In T4 it wasn't that hard and it seems like it
> should be even easier in T5.
> 
> -Pat
> 
> 

-- 
View this message in context: http://old.nabble.com/T5%3A-How-to-have-.tml-.properties-files-in-the-same-directory-as-the--.java-files-tp29377569p29379502.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