You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dan � <po...@hotmail.com> on 2005/08/23 19:00:37 UTC
Howto set a dynamically generated file as an asset?
Hello all,
In my app, I generate some files on the fly. How do I set them as assets,
like when they are created?
thank you
_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Howto set a dynamically generated file as an asset?
Posted by Tomáš Drenčák <to...@gmail.com>.
Try IRequestCycle.getAbsoluteURL("/")
2005/8/23, Dan <po...@hotmail.com>:
> Thanks for the reply Adam.
>
> I am generating PDFs and Excel files from the page. (The page calls the
> class that generates the file in different formats)
> Currently just to test the file generations i am storing these in the
> user.home property. (/home/user ).
> I think your 1st soln is much easier to implement, cuz i just need to change
> to the path where files are getting created/updated and they will be visible
> to contextasset :)
>
> btw, is there a way i can find out the absolute path to a deployed app in a
> container? i mean i would not like to deal with coding the path in a
> properties file or as java code
>
> thanks again.
>
>
>
>
> >From: "Adam Greene" <ag...@iq-2000.com>
> >Reply-To: "Tapestry users" <ta...@jakarta.apache.org>
> >To: "Tapestry users" <ta...@jakarta.apache.org>
> >Subject: Re: Howto set a dynamically generated file as an asset?
> >Date: Tue, 23 Aug 2005 14:45:54 -0300
> >
> >Questions:
> >
> >1. What are you generating? JPGs, PDFs, CSS, etc.
> >1. How do you generate the files, via a Tapestry service? or internal to a
> >page?
> >2. Once the files are generated, where do they end up? In the web
> >context, WEB-INF, class path, etc.
> >
> >Possible Solutions:
> >
> >1. If it lands in the context or classpath then you can simply write a
> >method in your page class (or elsewhere) that returns a ContextAsset or a
> >ClasspathAsset.
> >2. If it is a new service you have created, then you are going to have to
> >take a look at org/apache/tapestry/asset/ , I suggest looking at the
> >ContextAssetFactory, ContextAsset, etc. Don't forget to contribute to
> >AssetFactories:
> >
> ><contribution configuration-id="AssetFactories">
> > <factory prefix="myprefix" object="service:MyAssetFactory" />
> > </contribution>
> >
> >----- Original Message ----- From: "Dan " <po...@hotmail.com>
> >To: <ta...@jakarta.apache.org>
> >Sent: Tuesday, August 23, 2005 2:00 PM
> >Subject: Howto set a dynamically generated file as an asset?
> >
> >
> >>Hello all,
> >>
> >>In my app, I generate some files on the fly. How do I set them as assets,
> >>like when they are created?
> >>
> >>thank you
> >>
> >>_________________________________________________________________
> >>On the road to retirement? Check out MSN Life Events for advice on how to
> >>get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Howto set a dynamically generated file as an asset?
Posted by Dan � <po...@hotmail.com>.
Thanks for the reply Adam.
I am generating PDFs and Excel files from the page. (The page calls the
class that generates the file in different formats)
Currently just to test the file generations i am storing these in the
user.home property. (/home/user ).
I think your 1st soln is much easier to implement, cuz i just need to change
to the path where files are getting created/updated and they will be visible
to contextasset :)
btw, is there a way i can find out the absolute path to a deployed app in a
container? i mean i would not like to deal with coding the path in a
properties file or as java code
thanks again.
>From: "Adam Greene" <ag...@iq-2000.com>
>Reply-To: "Tapestry users" <ta...@jakarta.apache.org>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Subject: Re: Howto set a dynamically generated file as an asset?
>Date: Tue, 23 Aug 2005 14:45:54 -0300
>
>Questions:
>
>1. What are you generating? JPGs, PDFs, CSS, etc.
>1. How do you generate the files, via a Tapestry service? or internal to a
>page?
>2. Once the files are generated, where do they end up? In the web
>context, WEB-INF, class path, etc.
>
>Possible Solutions:
>
>1. If it lands in the context or classpath then you can simply write a
>method in your page class (or elsewhere) that returns a ContextAsset or a
>ClasspathAsset.
>2. If it is a new service you have created, then you are going to have to
>take a look at org/apache/tapestry/asset/ , I suggest looking at the
>ContextAssetFactory, ContextAsset, etc. Don't forget to contribute to
>AssetFactories:
>
><contribution configuration-id="AssetFactories">
> <factory prefix="myprefix" object="service:MyAssetFactory" />
> </contribution>
>
>----- Original Message ----- From: "Dan " <po...@hotmail.com>
>To: <ta...@jakarta.apache.org>
>Sent: Tuesday, August 23, 2005 2:00 PM
>Subject: Howto set a dynamically generated file as an asset?
>
>
>>Hello all,
>>
>>In my app, I generate some files on the fly. How do I set them as assets,
>>like when they are created?
>>
>>thank you
>>
>>_________________________________________________________________
>>On the road to retirement? Check out MSN Life Events for advice on how to
>>get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
_________________________________________________________________
Dont just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Howto set a dynamically generated file as an asset?
Posted by Adam Greene <ag...@iq-2000.com>.
Questions:
1. What are you generating? JPGs, PDFs, CSS, etc.
1. How do you generate the files, via a Tapestry service? or internal to a
page?
2. Once the files are generated, where do they end up? In the web context,
WEB-INF, class path, etc.
Possible Solutions:
1. If it lands in the context or classpath then you can simply write a
method in your page class (or elsewhere) that returns a ContextAsset or a
ClasspathAsset.
2. If it is a new service you have created, then you are going to have to
take a look at org/apache/tapestry/asset/ , I suggest looking at the
ContextAssetFactory, ContextAsset, etc. Don't forget to contribute to
AssetFactories:
<contribution configuration-id="AssetFactories">
<factory prefix="myprefix" object="service:MyAssetFactory" />
</contribution>
----- Original Message -----
From: "Dan " <po...@hotmail.com>
To: <ta...@jakarta.apache.org>
Sent: Tuesday, August 23, 2005 2:00 PM
Subject: Howto set a dynamically generated file as an asset?
> Hello all,
>
> In my app, I generate some files on the fly. How do I set them as assets,
> like when they are created?
>
> thank you
>
> _________________________________________________________________
> On the road to retirement? Check out MSN Life Events for advice on how to
> get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org