You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by manuel aldana <al...@gmx.de> on 2009/02/06 01:49:38 UTC

[T5] filesystem asset problems

hi,

want to create a new asset-type, which makes images available from 
filesystem (file:/) to webapp (http:/), but somehow I don't get it...

I am sure at least some of my assumptions are wrong:
-with Asset framework I can make resources available through tapestry 
webapp context (http://xxx url is then kind of a gateway to the Resource)
-Resource is the real resource (file, other website, relative context 
path etc.)
-AssetFactory implementation tells how to map between the resource and 
the client-view (-> toClientUrl())
-if everything works fine, the resource is loaded (amongst others 
AbstractResource.openStream() loads the contents) and is passed to the 
AssetFactory impl

My biggest doubt to my expectations is that for tapestry it should be 
very difficult to track the toClientUrl() return value to its own 
webcontext, e.g.: how should it know that 
http://domain:port/tapestryApp/toClientUrlValue points to 
file://d:/srv/images/xxxx? It then would need to handle a lot of URL 
redirecting magic internally.

Any other option for making my filesystem pics accessible to the same 
domain:host as the tapestry app is running without putting it to one of 
the jars or to webapp-context?

thanks a lot.

-- 
 manuel aldana
 aldana@gmx.de
 software-engineering blog: http://www.aldana-online.de


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


Re: [T5] filesystem asset problems

Posted by manuel aldana <al...@gmx.de>.
thanks for the hint, it makes more sense now. So there are two parts, 
when it comes to assets:

1) Presenting the asset as a proper link to the client (as component 
link inside HTML)
2) Getting tapestry to response it when it is requested as URL. 
Currently built in as direct context path or assets folder -> 
http://xxxxx/assets/.


Jonathan O'Connor schrieb:
> Manuel,
> look at the AssetDispatcher class. That will clear up a lot of 
> problems, I think.
> Ciao,
> Jonathan
>
> On 06/02/2009 00:49, manuel aldana wrote:
>> hi,
>>
>> want to create a new asset-type, which makes images available from 
>> filesystem (file:/) to webapp (http:/), but somehow I don't get it...
>>
>> I am sure at least some of my assumptions are wrong:
>> -with Asset framework I can make resources available through tapestry 
>> webapp context (http://xxx url is then kind of a gateway to the 
>> Resource)
>> -Resource is the real resource (file, other website, relative context 
>> path etc.)
>> -AssetFactory implementation tells how to map between the resource 
>> and the client-view (-> toClientUrl())
>> -if everything works fine, the resource is loaded (amongst others 
>> AbstractResource.openStream() loads the contents) and is passed to 
>> the AssetFactory impl
>>
>> My biggest doubt to my expectations is that for tapestry it should be 
>> very difficult to track the toClientUrl() return value to its own 
>> webcontext, e.g.: how should it know that 
>> http://domain:port/tapestryApp/toClientUrlValue points to 
>> file://d:/srv/images/xxxx? It then would need to handle a lot of URL 
>> redirecting magic internally.
>>
>> Any other option for making my filesystem pics accessible to the same 
>> domain:host as the tapestry app is running without putting it to one 
>> of the jars or to webapp-context?
>>
>> thanks a lot.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


-- 
 manuel aldana
 aldana@gmx.de
 software-engineering blog: http://www.aldana-online.de


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


Re: [T5] filesystem asset problems

Posted by Jonathan O'Connor <ni...@eircom.net>.
Manuel,
look at the AssetDispatcher class. That will clear up a lot of problems, 
I think.
Ciao,
Jonathan

On 06/02/2009 00:49, manuel aldana wrote:
> hi,
>
> want to create a new asset-type, which makes images available from 
> filesystem (file:/) to webapp (http:/), but somehow I don't get it...
>
> I am sure at least some of my assumptions are wrong:
> -with Asset framework I can make resources available through tapestry 
> webapp context (http://xxx url is then kind of a gateway to the Resource)
> -Resource is the real resource (file, other website, relative context 
> path etc.)
> -AssetFactory implementation tells how to map between the resource and 
> the client-view (-> toClientUrl())
> -if everything works fine, the resource is loaded (amongst others 
> AbstractResource.openStream() loads the contents) and is passed to the 
> AssetFactory impl
>
> My biggest doubt to my expectations is that for tapestry it should be 
> very difficult to track the toClientUrl() return value to its own 
> webcontext, e.g.: how should it know that 
> http://domain:port/tapestryApp/toClientUrlValue points to 
> file://d:/srv/images/xxxx? It then would need to handle a lot of URL 
> redirecting magic internally.
>
> Any other option for making my filesystem pics accessible to the same 
> domain:host as the tapestry app is running without putting it to one 
> of the jars or to webapp-context?
>
> thanks a lot.
>

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