Charts and Java servers

Hi,

As a long time Java/J2EE exponent I wanted to give Rails a fair crack of
the
whip and after we evaluated it for several weeks I have to say I like
it.

The installation process for the base system/framework is
straightforward on
the two platforms we’ve tried (Windows and Mac OS X). However, the
charting
components available, relying on ImageMagick or GraphicsMagick seem less
clear cut. OS X was no problem - but Windows XP proved tricky. The other
option we considered was using a Java servlet on Tomcat to provide the
charts (using JChart or something). Is there a way within a Rails
controller
(for example) to proxy a call to another server (on port 8080 in this
case)
within the firewall, to return a resource (a generated image). Obviously
we
don’t want to embed an link to something on 8080 since this won’t
be
available outside of the firewall. The only thing I can think to do is
to
use Apache proxying but we are trying to keep the installation and
configuration process simple. We did some PHP/J2EE development on a
previous
project and the installation process for PHP and Apache got quite exotic
towards the end.

Sean.

Sean B. wrote:

proved tricky. The other option we considered was using a Java servlet
on Tomcat to provide the charts (using JChart or something). Is there a
way within a Rails controller (for example) to proxy a call to another
server (on port 8080 in this case) within the firewall, to return a
resource (a generated image). Obviously we don’t want to embed an
link to something on 8080 since this won’t be available outside of the
firewall. The only thing I can think to do is to use Apache proxying but
we are trying to keep the installation and configuration process simple.
We did some PHP/J2EE development on a previous project and the
installation process for PHP and Apache got quite exotic towards the end.

Hah! I was just working on this… only using a simple servlet running
in tomcat and using
batik to transcode an svg to a png. It’s called by a php page.

Anyway, check out the Net::HTTP module:

http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html

You can use this to make an HTTP connection to the servlet running on
localhost:8080 and
pass it the data. The servlet can then write the chart into the
appropriate image dir and
the rails response will just find it there.

On the other hand, you might just be fine using gruff:

http://nubyonrails.topfunky.com/pages/gruff

b

Hi Ben,

I really liked the look of Gruff and as I said, installing the
pre-requisites (GraphicsMagick via Darwin Ports) was easy on my
Powerbook
… less easy on one the developer Windows boxes. I don’t know if
Instant
Rails ships with it. I am trying to secure a couple of new projects in
the
next few weeks and I’d really like to bring Rails into the mix (with a
splash of Java services fronted by REST web services). The clients are
energy traders/brokers and a European government agency and they seem to
have a bias towards Windows 2003 Server… so I really need a solution
that
can be concisely and easily installed on such a server (even though I’d
much
prefer to see them use Linux, Solaris 10 or OS X Server!) Charting is a
key
component of these projects.

Thanks for the steer on Net::HTTP.

I have writtn code for charts using easy charts. The only thing we need
to do is extract jar files such as
chart.jar,chartserver.jar,chart.ext.jar; and create objects and run the
code as we run java pgms.
Now i’m facing with a problem: i’m unable to run this java code using
tomcat. i would be grateful to u if u help me as i m a final year engg
student and need the same in regard to my project. waiting for ur reply
Yours sincerely
Sarika