You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Julian Wood <wo...@ucalgary.ca> on 2007/03/08 18:36:16 UTC

serve html from packaged component?

I've just finished wrapping this rich text component from Kevin Roth   
<http://www.kevinroth.com/rte/> and I have it working nicely as a  
drop-in tapestry component (assuming correct installation into a  
project).

The final step is to put it in it's own component package for easy  
sharing across projects. The only concern I have is that the  
component needs access to 4 html files, which it uses to show a color  
picker, for instance, and which it accesses through some obfuscated  
and compressed javascript. So while this is fine when the files are  
simply placed in the webapp dir of the main app, how can it gain  
access to them when they're packaged into a component jar?

Another way of asking is: what is the tapestry URL to an html file  
packaged in a component jar? I've been trying to get the URL to say,  
Table.html in the contrib package as an example.

Thanks,

J

--
Julian Wood <wo...@ucalgary.ca>

Software Engineer
Teaching & Learning Centre
University of Calgary

http://tlc.ucalgary.ca



Re: serve html from packaged component?

Posted by Julian Wood <wo...@ucalgary.ca>.
Thanks Andy,

That worked perfectly.

J

On 10-Mar-07, at 12:29 PM, andyhot wrote:

> Express the folder you're interested in as an IAsset...
> Then do .buildURL() on  it and somehow pass the result to your  
> javascript...
> That's how AjaxShellDelegate includes dojo and its root folder ... BUT
> since it's a classpath asset, it'll be protected (i.e. have that  
> checksum appended)
>
> So you won't be able to reference relative files (cause the  
> checksum won't be right for them)
>
> You'll need to add a contribution to  
> tapestry.asset.UnprotectedAssets to get around this...
>
> Here's what tacos does to allow firebug-lite to work (and reference  
> relatively its files and images, e.t.c.).
>    <contribution configuration-id="tapestry.asset.UnprotectedAssets">
>        Unprotect assets for firebug lite.
>        <unprotected-resource contains="^/net/sf/tacos/components/ 
> firebug/" />
>    </contribution>
>
>
> Julian Wood wrote:
>> Thanks Andreas,
>>
>> Remember that I'm dealing with some compressed, obfuscated  
>> javascript which loads these resources (ie I can't change very  
>> much in how it loads these resources - just the dir in which too  
>> look for them, and the name of the file). I cannot use a PageLink  
>> in this situation. However, if I can determine the URL created by  
>> the PageLink to an html file deep in some component library (eg to  
>> org/apache/tapestry/contrib/table/components/Table.html), I might  
>> have a chance. However, I couldn't get it to correctly link to  
>> that page either (a longshot, I know).
>>
>> <a href="#" jwcid="@PageLink" page="contrib:Table">Table</a>
>>
>> I'm thinking that it might be better to write a small service  
>> which will return the resource the javascript requests, but it  
>> seems like more work than should be necessary. Let me know if I  
>> misunderstood how you thought PageLink could help.
>>
>> Thanks,
>>
>> J
>>
>> On 8-Mar-07, at 11:01 AM, Andreas Andreou wrote:
>>
>>> http://tapestry.apache.org/tapestry4.1/components/link/pagelink.html
>>>
>>> See the namespace attribute
>>>
>>> On 3/8/07, Julian Wood <wo...@ucalgary.ca> wrote:
>>>>
>>>> I've just finished wrapping this rich text component from Kevin  
>>>> Roth
>>>> <http://www.kevinroth.com/rte/> and I have it working nicely as a
>>>> drop-in tapestry component (assuming correct installation into a
>>>> project).
>>>>
>>>> The final step is to put it in it's own component package for easy
>>>> sharing across projects. The only concern I have is that the
>>>> component needs access to 4 html files, which it uses to show a  
>>>> color
>>>> picker, for instance, and which it accesses through some obfuscated
>>>> and compressed javascript. So while this is fine when the files are
>>>> simply placed in the webapp dir of the main app, how can it gain
>>>> access to them when they're packaged into a component jar?
>>>>
>>>> Another way of asking is: what is the tapestry URL to an html file
>>>> packaged in a component jar? I've been trying to get the URL to  
>>>> say,
>>>> Table.html in the contrib package as an example.
>>>>
>>>> Thanks,
>>>>
>>>> J
>>>>

--
Julian Wood <wo...@ucalgary.ca>

Software Engineer
Teaching & Learning Centre
University of Calgary

http://tlc.ucalgary.ca



Re: serve html from packaged component?

Posted by andyhot <an...@di.uoa.gr>.
Express the folder you're interested in as an IAsset...
Then do .buildURL() on  it and somehow pass the result to your javascript...
That's how AjaxShellDelegate includes dojo and its root folder ... BUT
since it's a classpath asset, it'll be protected (i.e. have that 
checksum appended)

So you won't be able to reference relative files (cause the checksum 
won't be right for them)

You'll need to add a contribution to tapestry.asset.UnprotectedAssets to 
get around this...

Here's what tacos does to allow firebug-lite to work (and reference 
relatively its files and images, e.t.c.).
    <contribution configuration-id="tapestry.asset.UnprotectedAssets">
        Unprotect assets for firebug lite.
        <unprotected-resource 
contains="^/net/sf/tacos/components/firebug/" />
    </contribution>


Julian Wood wrote:
> Thanks Andreas,
>
> Remember that I'm dealing with some compressed, obfuscated javascript 
> which loads these resources (ie I can't change very much in how it 
> loads these resources - just the dir in which too look for them, and 
> the name of the file). I cannot use a PageLink in this situation. 
> However, if I can determine the URL created by the PageLink to an html 
> file deep in some component library (eg to 
> org/apache/tapestry/contrib/table/components/Table.html), I might have 
> a chance. However, I couldn't get it to correctly link to that page 
> either (a longshot, I know).
>
> <a href="#" jwcid="@PageLink" page="contrib:Table">Table</a>
>
> I'm thinking that it might be better to write a small service which 
> will return the resource the javascript requests, but it seems like 
> more work than should be necessary. Let me know if I misunderstood how 
> you thought PageLink could help.
>
> Thanks,
>
> J
>
> On 8-Mar-07, at 11:01 AM, Andreas Andreou wrote:
>
>> http://tapestry.apache.org/tapestry4.1/components/link/pagelink.html
>>
>> See the namespace attribute
>>
>> On 3/8/07, Julian Wood <wo...@ucalgary.ca> wrote:
>>>
>>> I've just finished wrapping this rich text component from Kevin Roth
>>> <http://www.kevinroth.com/rte/> and I have it working nicely as a
>>> drop-in tapestry component (assuming correct installation into a
>>> project).
>>>
>>> The final step is to put it in it's own component package for easy
>>> sharing across projects. The only concern I have is that the
>>> component needs access to 4 html files, which it uses to show a color
>>> picker, for instance, and which it accesses through some obfuscated
>>> and compressed javascript. So while this is fine when the files are
>>> simply placed in the webapp dir of the main app, how can it gain
>>> access to them when they're packaged into a component jar?
>>>
>>> Another way of asking is: what is the tapestry URL to an html file
>>> packaged in a component jar? I've been trying to get the URL to say,
>>> Table.html in the contrib package as an example.
>>>
>>> Thanks,
>>>
>>> J
>>>
>>> -- 
> -- 
> Julian Wood <wo...@ucalgary.ca>
>
> Software Engineer
> Teaching & Learning Centre
> University of Calgary
>
> http://tlc.ucalgary.ca
>
>
>


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


DatePicker Validation

Posted by Marcos Chicote <mc...@newtechnologies.com.ar>.
Hello!

I'm using Tapestry 4.0 to develop a page with 2 DatePickers. I want to
check, in the client, if one of the date's is previous to the other.

Can anybody help me on how to do this??

Do I need to write a function in javascript to parse the date and then
compare? Isn't there any other nicer way? (or maybe somebody already has the
funcion programmed).

Thanks!

Marcos


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


Re: serve html from packaged component?

Posted by Julian Wood <wo...@ucalgary.ca>.
Thanks Andreas,

Remember that I'm dealing with some compressed, obfuscated javascript  
which loads these resources (ie I can't change very much in how it  
loads these resources - just the dir in which too look for them, and  
the name of the file). I cannot use a PageLink in this situation.  
However, if I can determine the URL created by the PageLink to an  
html file deep in some component library (eg to org/apache/tapestry/ 
contrib/table/components/Table.html), I might have a chance. However,  
I couldn't get it to correctly link to that page either (a longshot,  
I know).

<a href="#" jwcid="@PageLink" page="contrib:Table">Table</a>

I'm thinking that it might be better to write a small service which  
will return the resource the javascript requests, but it seems like  
more work than should be necessary. Let me know if I misunderstood  
how you thought PageLink could help.

Thanks,

J

On 8-Mar-07, at 11:01 AM, Andreas Andreou wrote:

> http://tapestry.apache.org/tapestry4.1/components/link/pagelink.html
>
> See the namespace attribute
>
> On 3/8/07, Julian Wood <wo...@ucalgary.ca> wrote:
>>
>> I've just finished wrapping this rich text component from Kevin Roth
>> <http://www.kevinroth.com/rte/> and I have it working nicely as a
>> drop-in tapestry component (assuming correct installation into a
>> project).
>>
>> The final step is to put it in it's own component package for easy
>> sharing across projects. The only concern I have is that the
>> component needs access to 4 html files, which it uses to show a color
>> picker, for instance, and which it accesses through some obfuscated
>> and compressed javascript. So while this is fine when the files are
>> simply placed in the webapp dir of the main app, how can it gain
>> access to them when they're packaged into a component jar?
>>
>> Another way of asking is: what is the tapestry URL to an html file
>> packaged in a component jar? I've been trying to get the URL to say,
>> Table.html in the contrib package as an example.
>>
>> Thanks,
>>
>> J
>>
>> --
--
Julian Wood <wo...@ucalgary.ca>

Software Engineer
Teaching & Learning Centre
University of Calgary

http://tlc.ucalgary.ca



Re: serve html from packaged component?

Posted by Andreas Andreou <an...@di.uoa.gr>.
http://tapestry.apache.org/tapestry4.1/components/link/pagelink.html

See the namespace attribute

On 3/8/07, Julian Wood <wo...@ucalgary.ca> wrote:
>
> I've just finished wrapping this rich text component from Kevin Roth
> <http://www.kevinroth.com/rte/> and I have it working nicely as a
> drop-in tapestry component (assuming correct installation into a
> project).
>
> The final step is to put it in it's own component package for easy
> sharing across projects. The only concern I have is that the
> component needs access to 4 html files, which it uses to show a color
> picker, for instance, and which it accesses through some obfuscated
> and compressed javascript. So while this is fine when the files are
> simply placed in the webapp dir of the main app, how can it gain
> access to them when they're packaged into a component jar?
>
> Another way of asking is: what is the tapestry URL to an html file
> packaged in a component jar? I've been trying to get the URL to say,
> Table.html in the contrib package as an example.
>
> Thanks,
>
> J
>
> --
> Julian Wood <wo...@ucalgary.ca>
>
> Software Engineer
> Teaching & Learning Centre
> University of Calgary
>
> http://tlc.ucalgary.ca
>
>
>


-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting