You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Ludwig <ge...@gmail.com> on 2013/07/25 19:49:06 UTC

What's an elegant way to set the source dir for jquery/showSource?

I have a few Tapestry 5.3.x component projects. As part of the test code,
there is a webapp that uses jquery/showSource, to display the source of the
test page to instruct the user on how to use the component. For example,
the tapestry5-highcharts project does exactly this.

My question is, is there an elegant way to set the source directory for the
showSource widget? Right now I do something like this in AppModule.java, in
contributeApplicationDefaults:

configuration.add("demo-src-dir","/Users/George/Dropbox/etc../myProject/src/test");

This works, but obviously it's hard-coded. How can I elegantly determine
the source dir and add it to the application defaults within AppModule?
I've tried it using an Asset as well as a Context, but haven't been able to
make it work.

-George

Re: What's an elegant way to set the source dir for jquery/showSource?

Posted by George Ludwig <ge...@gmail.com>.
Thanks so much Lance!


On Fri, Jul 26, 2013 at 1:23 PM, Lance Java <la...@googlemail.com>wrote:

> Oh, and in your webapp, you include src/main/java as a resources directory
> and they will make it onto your classpath too
> https://github.com/uklance/tapestry-stitch-demo/blob/master/pom.xml#L46
>
>
> On 26 July 2013 21:20, Lance Java <la...@googlemail.com> wrote:
>
> > I do this in tapestry stitch... you're welcome to steal my code component
> >
> > Demo here:
> > http://tapestry-stitch.uklance.cloudbees.net/codedemo
> >
> > Basically, you use the maven-source-plugin to generate a source artifact
> > for your component library. You then include the source artifact as a
> > dependency in your webapp (classifier=sources). Then the source code is
> on
> > your classpath and you can reference it as a classpath asset.
> >
> > https://github.com/uklance/tapestry-stitch/blob/master/pom.xml#L73
> > https://github.com/uklance/tapestry-stitch-demo/blob/master/pom.xml#L16
> >
> >
> >
> >
> > On 25 July 2013 18:49, George Ludwig <ge...@gmail.com> wrote:
> >
> >> I have a few Tapestry 5.3.x component projects. As part of the test
> code,
> >> there is a webapp that uses jquery/showSource, to display the source of
> >> the
> >> test page to instruct the user on how to use the component. For example,
> >> the tapestry5-highcharts project does exactly this.
> >>
> >> My question is, is there an elegant way to set the source directory for
> >> the
> >> showSource widget? Right now I do something like this in AppModule.java,
> >> in
> >> contributeApplicationDefaults:
> >>
> >>
> >>
> configuration.add("demo-src-dir","/Users/George/Dropbox/etc../myProject/src/test");
> >>
> >> This works, but obviously it's hard-coded. How can I elegantly determine
> >> the source dir and add it to the application defaults within AppModule?
> >> I've tried it using an Asset as well as a Context, but haven't been able
> >> to
> >> make it work.
> >>
> >> -George
> >>
> >
> >
>

Re: What's an elegant way to set the source dir for jquery/showSource?

Posted by Lance Java <la...@googlemail.com>.
Oh, and in your webapp, you include src/main/java as a resources directory
and they will make it onto your classpath too
https://github.com/uklance/tapestry-stitch-demo/blob/master/pom.xml#L46


On 26 July 2013 21:20, Lance Java <la...@googlemail.com> wrote:

> I do this in tapestry stitch... you're welcome to steal my code component
>
> Demo here:
> http://tapestry-stitch.uklance.cloudbees.net/codedemo
>
> Basically, you use the maven-source-plugin to generate a source artifact
> for your component library. You then include the source artifact as a
> dependency in your webapp (classifier=sources). Then the source code is on
> your classpath and you can reference it as a classpath asset.
>
> https://github.com/uklance/tapestry-stitch/blob/master/pom.xml#L73
> https://github.com/uklance/tapestry-stitch-demo/blob/master/pom.xml#L16
>
>
>
>
> On 25 July 2013 18:49, George Ludwig <ge...@gmail.com> wrote:
>
>> I have a few Tapestry 5.3.x component projects. As part of the test code,
>> there is a webapp that uses jquery/showSource, to display the source of
>> the
>> test page to instruct the user on how to use the component. For example,
>> the tapestry5-highcharts project does exactly this.
>>
>> My question is, is there an elegant way to set the source directory for
>> the
>> showSource widget? Right now I do something like this in AppModule.java,
>> in
>> contributeApplicationDefaults:
>>
>>
>> configuration.add("demo-src-dir","/Users/George/Dropbox/etc../myProject/src/test");
>>
>> This works, but obviously it's hard-coded. How can I elegantly determine
>> the source dir and add it to the application defaults within AppModule?
>> I've tried it using an Asset as well as a Context, but haven't been able
>> to
>> make it work.
>>
>> -George
>>
>
>

Re: What's an elegant way to set the source dir for jquery/showSource?

Posted by Lance Java <la...@googlemail.com>.
I do this in tapestry stitch... you're welcome to steal my code component

Demo here:
http://tapestry-stitch.uklance.cloudbees.net/codedemo

Basically, you use the maven-source-plugin to generate a source artifact
for your component library. You then include the source artifact as a
dependency in your webapp (classifier=sources). Then the source code is on
your classpath and you can reference it as a classpath asset.

https://github.com/uklance/tapestry-stitch/blob/master/pom.xml#L73
https://github.com/uklance/tapestry-stitch-demo/blob/master/pom.xml#L16




On 25 July 2013 18:49, George Ludwig <ge...@gmail.com> wrote:

> I have a few Tapestry 5.3.x component projects. As part of the test code,
> there is a webapp that uses jquery/showSource, to display the source of the
> test page to instruct the user on how to use the component. For example,
> the tapestry5-highcharts project does exactly this.
>
> My question is, is there an elegant way to set the source directory for the
> showSource widget? Right now I do something like this in AppModule.java, in
> contributeApplicationDefaults:
>
>
> configuration.add("demo-src-dir","/Users/George/Dropbox/etc../myProject/src/test");
>
> This works, but obviously it's hard-coded. How can I elegantly determine
> the source dir and add it to the application defaults within AppModule?
> I've tried it using an Asset as well as a Context, but haven't been able to
> make it work.
>
> -George
>