Java programmers all seem to think that running an image generating process in 
a web 
browser window on the server is "bad practice".  So I think I might just go 
ahead and 
compile it as an AIR app.  I'm not sure though how to deploy AIR apps though.  
Can they 
go in a .war file?  

If someone has any ideas about this or if there is an "aircoders" list that 
might better 
answer this question or if going AIR is the wrong approach here please let me 
know.  
Thanks!


--- In [email protected], "netdeep" <[EMAIL PROTECTED]> wrote:
>
> 
> I am using the following method to save the image:
> 
> private function captureImg(comp:UIComponent, name:String):void {     
>                 var imageSnap:ImageSnapshot = 
> ImageSnapshot.captureImage(comp);
>                 var imageByteArray:ByteArray = imageSnap.data as ByteArray;
>                 imgSave.saveImage(imageByteArray, name+"-img.png");
>             }
> 
> imgSave is a RemoteObject java class.  The problem is that the flex app which 
> runs this 
> code never gets launched on the server.  When I try to launch it from java 
> with a runtime 
> exec and the URL, it never launches, presumably because it is running in a 
> browser and 
> the server is headless.  That's why I am considering reconfiguring flex to 
> run headless 
or 
> converting it into an AIR app.
> 
> 
> --- In [email protected], "Igor Costa" <igorcosta@> wrote:
> >
> > actually not need air app to do that, You can use the bytearray to encode
> > the image and send to your java to save that each time or in meanwhile you
> > need.
> > 
> > Regards
> > Igor
> > 
> > On Mon, Jun 2, 2008 at 4:50 PM, netdeep <deepnet@> wrote:
> > 
> > >   I am trying to run flex as an image generator on the server. Since my
> > > server is headless, the
> > > feedback I am getting is that it is bad practice to run flex in the 
> > > browser
> > > for a background
> > > app.
> > >
> > > Here's what the program does in a nutshell:
> > >
> > > The server launches my java app. It reads a list of report definitions 
> > > from
> > > the data base. For
> > > each report, it spawns a thread. Each thread launches my Flex application
> > > in the browser.
> > > Flex draws the data in charts. Each time data is pushed to the flex
> > > application from the java
> > > server side, Flex calls a remote java method to save it's image to a file.
> > > This file sits in a
> > > directory where it can be viewed in a regular old html page.
> > >
> > > The problem is really the automated aspect. I want to have this chart
> > > generated every few
> > > minutes as a .png file. It works perfectly fine on my localhost machine,
> > > but the server
> > > deployment is so far not working. We have firefox installed on the server.
> > > Is there no way to
> > > launch it as a background process to draw these images? Should I turn this
> > > into an AIR app
> > > (I've never done anything with AIR up to this point) to make it run more
> > > easily in the
> > > background?
> > >
> > > 
> > >
> > 
> > 
> > 
> > -- 
> > ----------------------------
> > Igor Costa
> > www.igorcosta.com
> > www.igorcosta.org
> >
>



Reply via email to