Serving large number of product images

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Serving large number of product images

Patrick Yip
I apologize if this question has been asked too many times.   I did a
quick search and haven't been able to find a satisfactory answer.
 
Currently, I face a practical issue of serving the images when the image
files are packaged into the war file.
Adding images require me to repackage the war file and upload to the
JBoss server.
 
Is there a way to specify a directory outside of JBoss server directory
(but on the same physical machine) so I can have a permanent home for my
product images?    
 
For instance, I would like to store all the product images under
c:\products\  directory.
Any suggestion is greatly appreciated.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Serving large number of product images

Erik Hatcher

On May 16, 2005, at 8:00 PM, Patrick Yip wrote:

> I apologize if this question has been asked too many times.   I did a
> quick search and haven't been able to find a satisfactory answer.
>
> Currently, I face a practical issue of serving the images when the  
> image
> files are packaged into the war file.
> Adding images require me to repackage the war file and upload to the
> JBoss server.
>
> Is there a way to specify a directory outside of JBoss server  
> directory
> (but on the same physical machine) so I can have a permanent home  
> for my
> product images?
>
> For instance, I would like to store all the product images under
> c:\products\  directory.
> Any suggestion is greatly appreciated.

You will need c:\products be web accessible for this to work, check  
out the externalizer capability built into Tapestry asset handling:

     http://jakarta.apache.org/tapestry/doc/api/org/apache/tapestry/ 
asset/AssetExternalizer.html

Erik



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Serving large number of product images

Patrick Yip
In reply to this post by Patrick Yip
Hi, there,

I'm still trying to find a way to put large number of product images on
a centralized folder not under the application WEB.

I was able to use this to get my images from a folder not under WEB
application:

public IAsset getProductImage(String path){
  // e.g. path = c:\products\images\sony_dvd.gif"

  return (IAsset) new ExternalAsset(path,null);
}

The image shows up fine in IE after getting this annoying warning:
  "This page contains both secure and nonsecure items..."

However, the image does not show up at all in FireFox.

Can someone give me a hint?
Is there a better way to get my images that are not under the WEB
context?

Thanks.


-----Original Message-----
From: Patrick Yip
Sent: Monday, May 16, 2005 5:01 PM
To: [hidden email]
Subject: Serving large number of product images

I apologize if this question has been asked too many times.   I did a
quick search and haven't been able to find a satisfactory answer.
 
Currently, I face a practical issue of serving the images when the image
files are packaged into the war file.
Adding images require me to repackage the war file and upload to the
JBoss server.
 
Is there a way to specify a directory outside of JBoss server directory
(but on the same physical machine) so I can have a permanent home for my
product images?    
 
For instance, I would like to store all the product images under
c:\products\  directory.
Any suggestion is greatly appreciated.
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Serving large number of product images

Konstantin Ignatyev
In reply to this post by Patrick Yip
Why do not serve them simply from a servlet?
Its initial parameter would be your root directory,
and because you control the servlet's mapping you can
simply construct proper image URL in a custom
component.

--- Patrick Yip <[hidden email]> wrote:

> Hi, there,
>
> I'm still trying to find a way to put large number
> of product images on
> a centralized folder not under the application WEB.
>
> I was able to use this to get my images from a
> folder not under WEB
> application:
>
> public IAsset getProductImage(String path){
>   // e.g. path = c:\products\images\sony_dvd.gif"
>
>   return (IAsset) new ExternalAsset(path,null);
> }
>
> The image shows up fine in IE after getting this
> annoying warning:
>   "This page contains both secure and nonsecure
> items..."
>
> However, the image does not show up at all in
> FireFox.
>
> Can someone give me a hint?
> Is there a better way to get my images that are not
> under the WEB
> context?
>
> Thanks.
>
>
> -----Original Message-----
> From: Patrick Yip
> Sent: Monday, May 16, 2005 5:01 PM
> To: [hidden email]
> Subject: Serving large number of product images
>
> I apologize if this question has been asked too many
> times.   I did a
> quick search and haven't been able to find a
> satisfactory answer.
>  
> Currently, I face a practical issue of serving the
> images when the image
> files are packaged into the war file.
> Adding images require me to repackage the war file
> and upload to the
> JBoss server.
>  
> Is there a way to specify a directory outside of
> JBoss server directory
> (but on the same physical machine) so I can have a
> permanent home for my
> product images?    
>  
> For instance, I would like to store all the product
> images under
> c:\products\  directory.
> Any suggestion is greatly appreciated.
>  
>  
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Serving large number of product images

Patrick Yip
In reply to this post by Patrick Yip
Hi Erik,

Can you please give a brief example to show us how to use the
AssetExternalizer?  Where should the AssetExternalizer be set up and
configured?

If possible, can you add it to the FAQ because I believe it is not in
any of the documentation or in the TIA book?

Thanks,
-Patrick

-----Original Message-----
From: Erik Hatcher [mailto:[hidden email]]
Sent: Tuesday, May 17, 2005 5:41 AM
To: Tapestry users
Subject: Re: Serving large number of product images


On May 16, 2005, at 8:00 PM, Patrick Yip wrote:

> I apologize if this question has been asked too many times.   I did a
> quick search and haven't been able to find a satisfactory answer.
>
> Currently, I face a practical issue of serving the images when the  
> image
> files are packaged into the war file.
> Adding images require me to repackage the war file and upload to the
> JBoss server.
>
> Is there a way to specify a directory outside of JBoss server  
> directory
> (but on the same physical machine) so I can have a permanent home  
> for my
> product images?
>
> For instance, I would like to store all the product images under
> c:\products\  directory.
> Any suggestion is greatly appreciated.

You will need c:\products be web accessible for this to work, check  
out the externalizer capability built into Tapestry asset handling:

     http://jakarta.apache.org/tapestry/doc/api/org/apache/tapestry/ 
asset/AssetExternalizer.html

Erik



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Serving large number of product images

Erik Hatcher
In reply to this post by Patrick Yip

On May 17, 2005, at 6:36 PM, Patrick Yip wrote:

> Hi, there,
>
> I'm still trying to find a way to put large number of product  
> images on
> a centralized folder not under the application WEB.
>
> I was able to use this to get my images from a folder not under WEB
> application:
>
> public IAsset getProductImage(String path){
>   // e.g. path = c:\products\images\sony_dvd.gif"
>
>   return (IAsset) new ExternalAsset(path,null);
> }
>
> The image shows up fine in IE after getting this annoying warning:
>   "This page contains both secure and nonsecure items..."
>
> However, the image does not show up at all in FireFox.
>
> Can someone give me a hint?
> Is there a better way to get my images that are not under the WEB
> context?

Firefox has a default to not serve things from the local filesystem -  
it has to come from http:// not file://.  You can disable that at the  
risk of a security vulnerability.  But, the bigger picture is that  
you probably want to serve your images directly from a web server,  
not from your application server or the filesystem directly - it  
won't work for remote viewers on the filesystem anyway!

     Erik


>
> Thanks.
>
>
> -----Original Message-----
> From: Patrick Yip
> Sent: Monday, May 16, 2005 5:01 PM
> To: [hidden email]
> Subject: Serving large number of product images
>
> I apologize if this question has been asked too many times.   I did a
> quick search and haven't been able to find a satisfactory answer.
>
> Currently, I face a practical issue of serving the images when the  
> image
> files are packaged into the war file.
> Adding images require me to repackage the war file and upload to the
> JBoss server.
>
> Is there a way to specify a directory outside of JBoss server  
> directory
> (but on the same physical machine) so I can have a permanent home  
> for my
> product images?
>
> For instance, I would like to store all the product images under
> c:\products\  directory.
> Any suggestion is greatly appreciated.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Serving large number of product images

Erik Hatcher
In reply to this post by Patrick Yip

On May 18, 2005, at 1:01 PM, Patrick Yip wrote:

> Hi Erik,
>
> Can you please give a brief example to show us how to use the
> AssetExternalizer?  Where should the AssetExternalizer be set up and
> configured?

>
> If possible, can you add it to the FAQ because I believe it is not in
> any of the documentation or in the TIA book?

I don't have a working example handy, as the externalizer is used  
primarily for production deployments, not for development.  But, it  
works exactly as documented at the page I sent.  Set those two system  
properties as described and any private assets will get externalized  
to the directory specified and the generated URLs to those assets  
will be modified to use the base URL specified.

On second thought, asset externalization is not a good solution for  
this particular case.  Asset externalization is for private assets  
that get served from the classpath, which is probably not the case  
here.  I consider the asset externalization feature of Tapestry one  
of its really clever strong points - beating up the app. server to  
feed the DatePicker calendar icon from the classpath dynamically is  
not good for production, yet you can flip a couple of switches and  
off-load that calendar icon to Apache directly.

     Erik


>
> Thanks,
> -Patrick
>
> -----Original Message-----
> From: Erik Hatcher [mailto:[hidden email]]
> Sent: Tuesday, May 17, 2005 5:41 AM
> To: Tapestry users
> Subject: Re: Serving large number of product images
>
>
> On May 16, 2005, at 8:00 PM, Patrick Yip wrote:
>
>
>> I apologize if this question has been asked too many times.   I did a
>> quick search and haven't been able to find a satisfactory answer.
>>
>> Currently, I face a practical issue of serving the images when the
>> image
>> files are packaged into the war file.
>> Adding images require me to repackage the war file and upload to the
>> JBoss server.
>>
>> Is there a way to specify a directory outside of JBoss server
>> directory
>> (but on the same physical machine) so I can have a permanent home
>> for my
>> product images?
>>
>> For instance, I would like to store all the product images under
>> c:\products\  directory.
>> Any suggestion is greatly appreciated.
>>
>
> You will need c:\products be web accessible for this to work, check
> out the externalizer capability built into Tapestry asset handling:
>
>      http://jakarta.apache.org/tapestry/doc/api/org/apache/tapestry/
> asset/AssetExternalizer.html
>
> Erik
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Serving large number of product images

Alberto Lepe
I use to add a System Property like:
(with JBOSS:)
MY_IMAGES=/usr/local/jboss/server/default/deploy/jbossweb-tomcat50.sar/ROOT.war/project_images
(with ORION:)
MY_IMAGES=/usr/local/orion/default-web-app/project_images

Those are web folders that are not affected if you restart the server
or you deploy your application and will let you upload files (if you
setup permissions propertly).

At you application, you will call your images at:
/project_images/logo.jpg

Use System Properties, so you can change it to what ever directory you want.

Please visit: www.tapestryforum.com and join us!

A. Lepe

2005/5/18, Erik Hatcher <[hidden email]>:

>
> On May 18, 2005, at 1:01 PM, Patrick Yip wrote:
>
> > Hi Erik,
> >
> > Can you please give a brief example to show us how to use the
> > AssetExternalizer?  Where should the AssetExternalizer be set up and
> > configured?
>
> >
> > If possible, can you add it to the FAQ because I believe it is not in
> > any of the documentation or in the TIA book?
>
> I don't have a working example handy, as the externalizer is used
> primarily for production deployments, not for development.  But, it
> works exactly as documented at the page I sent.  Set those two system
> properties as described and any private assets will get externalized
> to the directory specified and the generated URLs to those assets
> will be modified to use the base URL specified.
>
> On second thought, asset externalization is not a good solution for
> this particular case.  Asset externalization is for private assets
> that get served from the classpath, which is probably not the case
> here.  I consider the asset externalization feature of Tapestry one
> of its really clever strong points - beating up the app. server to
> feed the DatePicker calendar icon from the classpath dynamically is
> not good for production, yet you can flip a couple of switches and
> off-load that calendar icon to Apache directly.
>
>      Erik
>
>
> >
> > Thanks,
> > -Patrick
> >
> > -----Original Message-----
> > From: Erik Hatcher [mailto:[hidden email]]
> > Sent: Tuesday, May 17, 2005 5:41 AM
> > To: Tapestry users
> > Subject: Re: Serving large number of product images
> >
> >
> > On May 16, 2005, at 8:00 PM, Patrick Yip wrote:
> >
> >
> >> I apologize if this question has been asked too many times.   I did a
> >> quick search and haven't been able to find a satisfactory answer.
> >>
> >> Currently, I face a practical issue of serving the images when the
> >> image
> >> files are packaged into the war file.
> >> Adding images require me to repackage the war file and upload to the
> >> JBoss server.
> >>
> >> Is there a way to specify a directory outside of JBoss server
> >> directory
> >> (but on the same physical machine) so I can have a permanent home
> >> for my
> >> product images?
> >>
> >> For instance, I would like to store all the product images under
> >> c:\products\  directory.
> >> Any suggestion is greatly appreciated.
> >>
> >
> > You will need c:\products be web accessible for this to work, check
> > out the externalizer capability built into Tapestry asset handling:
> >
> >      http://jakarta.apache.org/tapestry/doc/api/org/apache/tapestry/
> > asset/AssetExternalizer.html
> >
> > Erik
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]