CFC as VO for Java suggests you are trying to pass a CFC to Java -
which won't work in CFML (well, Railo 4.0 will support it).
> I have a need to call a single function/method in a java class that
> will return a single object with three properties, each property being
> a typed array (or arrayList if need be) of objects.
Then you'll get back that Java object.
Show us the signature of the Java method and we can tell you more about it.
> So... from CF I call the CFC method which calls the JAVA method which
> returns an object with three arrays populated. (each array will need
> to be used as a query result set in CF) Ideally (i think...), when
> back in CF I am working with a ? structure ? that has three queries on
> it.
You're working with a Java object with three Java arrays in it.
Java arrays != CFML queries. In fact, Java 'queries' != CFML queries
either. Java has a type RecordSet which is a bit like a CFML query
(but not interchangeable).
Basically, if you're interacting with Java, you need to follow the
Java APIs for the code you're calling...
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
Well, yes and no.
No, insofar as a CF "query" is a very different beast to a Java
ResultSet. In fact a CF query is a specific Java type defined within
the CFML engine itself so you won't be able to return a native
CF-compatible query.
Yes, you can either convert your Java array of maps (presumably?) to a
CF query - using queryNew() / querySetCell() etc - or iterate directly
over the native Java types.
If your Java method returns a map with three keys, each referencing an
array of maps (name/value pairs), then CF can interact with that
pretty easily. A Java HashMap is pretty much a CF struct and an array
is... well, it should convert to a CF array I think.
It'll be hard to provide specific guidance for you tho' without
specific code examples...
Javaloader can do it. :-)
Mark Mandel is a rockstar.
:Den
--
Take away paradox from the thinker and you have a professor.
Soren Kierkegaard
I'm 95% sure I have turned a java result set into a cfquery using Railo.
I'd have to dig to find where, but I'm pretty sure it's pretty doable.
Ah:
:Den
--
The function of prayer is not to influence God, but rather to change
the nature of the one who prays.
Soren Kierkegaard
Are you *certain* about that? I don't believe JavaLoader does that...
I can't see how it would let you instantiate a Java object and pass a
CFC in as an argument to methods on that Java object (and have Java
code call methods on that CFC).
> Mark Mandel is a rockstar.
That I agree with.
That's much neater than iterating over the ResultSet and creating a CF
query object row-by-row - nice!
Paul.
It's black magic, and there are caveats, but yup, that's what it does.
There are docs for that feature too, but they're sorta hidden away,
and I can't remember where off hand. Google knows.
>> Mark Mandel is a rockstar.
>
> That I agree with.
So do I! Oh, yeah. But Still. Worth reiterating. :)
:Den
--
To dare is to lose one's footing momentarily. Not to dare is to lose oneself.
Soren Kierkegaard
Sean
BTW, Railo 4.0 is going to provide that natively.
Hmm, that's pretty gnarly stuff and relies on some deep CF internals.
Does it run on Railo? (I'd be surprised, given the classes it relies
on but...)
It relies on Java's own dynamic proxy mechanism to provide an
intercept point for invocation of methods and delegates to the CFC. I
didn't realize Java had a dynamic proxy facility! Learn something new
every day (several things today, in fact).
Cool stuff!
Railo 4 is going to knock my socks off! Cherry features man, cherry.
:Den
--
Trouble is the common denominator of living. It is the great equalizer.
Soren Kierkegaard
I don't think it works on Railo. =)
Micha posted something a while back that was pretty close. I don't
remember if a fully working example was ever put together... maybe it
was some RPC stuff, come to think of it.
> It relies on Java's own dynamic proxy mechanism to provide an
> intercept point for invocation of methods and delegates to the CFC. I
> didn't realize Java had a dynamic proxy facility! Learn something new
> every day (several things today, in fact).
I love days like that.
:Den
--
Any necessary truth, whether a priori or a posteriori, could not have
turned out otherwise.
Saul Kripke
I think it's super cool that Railo has some of this sort of stuff
built right in.
:Den
--
What is a poet? An unhappy person who conceals profound anguish in his
heart but whose lips are so formed that as sighs and cries pass over
them they sound like beautiful music.
Soren Kierkegaard
I am building a collection of utilities in CFM for various departments.
Distribution would work the best to have these apps built into Portlets
and deployed across the organization.
Our Goal is that you will be very satisfied with the services you
receive. Please let us know how we are doing.
Walter Seay
Integration Specialist
Eisenhower Medical Center
39000 Bob Hope Drive
Rancho Mirage, CA 92270
760-340-3911 ext: 5977
Evidently not...In a quick review there appears to be some good information here. I would still appreciate any feedback where this has been put into practice. For example, lessons learned, best practice, etc.Walter Seay
I thought I would bring this topic of Portals back up. My goal is to take of the of CF applications done for various hospital departments and package them up in a portal server. We will be going forward with the portal server and I really don't want to recode everything as .jsp pages.I am looking for anyone with experience using Railo within Jetspeed, Liferay or other Java portals. I am familiar with creating portlets, but how do I get Railo in the mix to call my cfm pages?Any step by step intros to get started will be greatly appreciated!!