Re: Easiest way to integrate Quartz drawing into WO apps?
Re: Easiest way to integrate Quartz drawing into WO apps?
- Subject: Re: Easiest way to integrate Quartz drawing into WO apps?
- From: Patrick Middleton <email@hidden>
- Date: Wed, 14 Mar 2007 18:05:28 +0000
On 14 Mar 2007, at 16:56, Ken Tabb wrote:
Hi again folks,
I have some Objective-C code that draws pretty graphs using Quartz.
All looks lovely in Cocoa apps. I'd like to re-use this same code
(or at least the "pretty Quartz" technology within it) in a
WebObjects component, so that these same graphs appear in a web
page (as a JPEG).
What's the best way to get to Cocoa/Obj-C code from WO/Java apps?
First one to say "Cocoa/Java bridge" gets a slap :)
I'm thinking the options are:
[1] Cocoa app turns into web service, and somehow get at that from
the WO app. I'm new to web services (although it's something I'll
be needing to get into at some point, albeit not specifically from
a Cocoa angle), both in terms of publishing and consuming them.
[2] Run Cocoa app as-is on the server (same Mac OS X Server as the
WO app) and get some sort of inter-process communication going -
suggestions for the best route welcome (it's been some years since
I did any Java IPC stuff so I'm sure it's all changed). Bearing in
mind it's all running on the same server though, I could at the
worst send data from WO -> Cocoa via XML file / stream, and get
Cocoa app to save the image (with session ID etc. preceding
filename) in a known subdirectory of the web server - the session
could then remove all images whose filename begins with the
session's sessionID, at the time the session is destroyed. I guess
that would work (even though it gets zero for elegance / scalability!)
[3] Re-write the Quartz code in a Python / Ruby script - I don't
know Python or Ruby yet, but wouldn't be against learning this if
it was necessary; I believe both have routes to Quartz. I still
have the issue of needing to call it from, and send data back to,
the WO app - all suggestions welcome!
And secondly, how long is a piece of string?
Thanks in advance for any tips you can give,
Ken
As a WO 4.5.1 programmer, this reminds me thoroughly of all the
things you couldn't do in a production WO app on a server because
there would be no logged-in user and so all sorts of interesting and
very necessary GUI services would not be available to your GUI code.
Worked well enough in development when you ran your app through
ProjectBuilderWO though .... oh, and all GUI code needed to be
executed on the same thread, which was difficult to achieve, but
possible. Quartz isn't the AppKit; but I'd still expect both
problems to bite you. [Mmm. /usr/bin/sips works when headless, so
you might get lucky.] Having somebody logged in via Apple Remote
Desktop might help; if it does, and if you are deploying on a Xserve
without a real video card, performance might be disappointing.
These problems don't exist in WO5, where (1) you don't get access to
goodies like Quartz and (2) one can define a property -
Djava.awt.headless=true to run GUI code when headless.
--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
Hadleigh Fax: +44 (0)1702 556855
Essex. SS7 2BT Email: email@hidden
England (MIME welcome)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden