I wrote the JDJ article referenced below and using a JNI COM wrapper would
be a "pure Java" approach to creating a Java API for Rose, but if I had to
create a Java API for Rose I would never choose this way. I would prioritize
my alternatives as follows:
a) SUN Java-COM plugin. Will take some work, but should have support
forever.
b) J++ - if I am going to assume a Windows environment, this is easiest, but
how long J++?
c) A 3d party COM bridge.
d) if none of the above are applicable, then I would write the Rose API as a
VB ActiveX dll to simplify the interface, type conversions, and debugging as
much as possible, and then wrap the VB dll with JNI code. There is demo code
on my website, but you would have to have a compelling reason for wanting to
do this.
akgreen

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Patrick Kennedy
Sent: Thursday, February 15, 2001 12:52 PM
To: Wasgint Rainer; [EMAIL PROTECTED]
Subject: Re: (ROSE) Accessing Rose via API from Java?



Options seem to be J++, JNI, jintegra.
I have not tried any of this but here's some
notes on the subject (from various sources, including
newsgroups) from when I last looked into this:

-------------------------------------------------------------------
There was an article in Java Developers Journal about accessing
COM components from Java using JNI. The article was specifically
about accessing Excel, but can be applied more generally.

http://www.sys-con.com/java/index2.html

Calling MS Excel via the Java Native Interface
 a hybrid application, but the technique works with any COM object
-------------------------------------------------------------------
Jintegra from www.linar.com
-------------------------------------------------------------------
How to access ActiveX/COM object from Java using any VM ???

I am doing this right now with JDK 1.2 but there shouldn't be any
major differences.

You don't need any extra packages but you do need to study up on
JNI. I suggest doing the tutorial on it and this site and buying
The Java Native Interface book by Shen Liang.

Essentially what I do is to get a COM interface pointer as an
integer by calling a native method. I then keep this interface
pointer and pass it to other native methods as an input parameter.

If you want a commercial bridge (only supports dual interfaces
and costs money) then try JIntegra from www.linar.com.
-------------------------------------------------------------------
What you should bear in mind when moving towards using ActiveX and
COM/OLE is that instead of using java as a multi platform language you
are immediately tying yourself into the Microsoft Windows platform.
Only Windows platform have OLE.
-------------------------------------------------------------------
You can use the J-Integra pure Java-COM bridge to access local and
remote Java objects as though they were COM objects from ASP.
 Doc: http://www.linar.com/jintegra/doc/
 Download: http://www.linar.com/
-------------------------------------------------------------------
You have at least two options.

 1) JIntegra, it is a pure java solution. I used this one before.
 2) IBM alphaworks provide a bean for it. It uses JNI. Have
 not tried it yet.
-------------------------------------------------------------------
 You can find JIntegra at www.linar.com
 Another pure java solution is RJax, to be found at
 http://www.halcyonsoft.com/prods/r_jax/r_jax.htm
 Alphaworks can be found at http://alphaworks.ibm.com/
-------------------------------------------------------------------
I have only used the MS Java - COM integration, but I have heard
that there are several altrernatives.

 * Implement your COM calling code in C/C++ and then use
 JNI to call that code from Java.  Not exactly pure Java and it
 will only work in an applet if that applet is signed.

 * Use JIntegra from Linar, a pure Java implementation of DCOM
 that should work in an applet:
 http://www.linar.com

 * Use Java2COM from Neva Object Tech, I don't know if this is
 pure Java http://www.nevaobject.com

 * Use IBM's new OLEBridge product:
 http://www.alphaworks.ibm.com/tech/olebridge?open&l=jlob,t=oleb

 No matter which solution you use, If you want to talk to COM
 object that live on a machine other than the web server that
 served up the applet page, I think you'll need a signed
 applet.
-------------------------------------------------------------------
J-Integra is a pure Java-COM bridge which will let you automate
office applications from Java clients running in any JVM on any OS
on any platform. No additional sw needs installing on the Windows
boxes running office, since DCOM is part of NT/Win98.

 Download: http://www.linar.com/
 Doc: http://www.linar.com/jintegra/doc/
-------------------------------------------------------------------
 Integrating Microsoft DCOM with Java
 http://www.linar.com/jintegra/doc/guidev/jbuilder/index.html

Using JBuilder 3 to integrate MTS based COM objects into
your pure Java applications
-------------------------------------------------------------------
http://users.rcn.com/danadler/javacom/

If you are looking to integrate Java with COM you have several
options:

- Write your own bridge in Java and C++ utilizing JNI and COM.
- Use The Microsoft Java VM. If you follow this route, make sure
  you read the archives at: Microsoft Java-COM list.
- If you are looking for a Java-COM bridge that works for any Java
  VM on any platform (yes! including UNIX), please check out the
  Linar's J/Integra product.
- Sun's Java-COM bridge is part of the Java PLUG-IN
------------------------------------------------------------------
You can write your AddIn in Java. But you need a COM-Bridge to use
Rose.
Compare the ArcStyler. This tool uses a COM-Bridge to control Rose.

For a COM-Bridge see http://www.linar.com/ . For other you have to
search
------------------------------------------------------------------
Rose DM seems to be written with MS J++ since the class files inside the zip
files you will found in the RoseDM directory using a lot of the Microsoft
Java stuff. It is very easy with MS J++ to access COM servers or to build
COM Servers/Clients so it can easy access Rose REI and the OLE-DB COM
Interfaces, which are used to talk to the database. This is only possible
with NT.

A platform independend COM implemenation is JIntegra (you can search for it
in yahoo) which simulates the DCOM/COM protocol on top of the underlying
network protocol. With this implementation you can build or access COM
objects on every platform in Java (UNIX, NT) without MS, or you can talk
from non MS Java programs (SUN JDK, IBM JDK) directly to MS Office or to
Rose. This is a platform independent COM implementation for Java. The only
drawback, it costs a lot of money.
------------------------------------------------------------------

Patrick Kennedy
 Rational Support

On Feb 14, 14:51, Wasgint Rainer wrote:
> Subject: (ROSE) Accessing Rose via API from Java?
>
> Hello all,
>
> i know - Rose has a COM API for accessing almost everything.
> Is the same possible from Java (without a bridge)?
> Any hints?
>
> Thanks
> Rainer
>
> --------------------------------------------------------------------------
--
> ---------------------------------------
> SIEMENS
>                                       Siemens AG
>                                       CT SE 1
> Rainer Wasgint                                                D-81730 München
>                                       Tel.:   +49 89 / 636-53111
>                                       Fax:    +49 89 / 636-40898
>                                       Email:
> [EMAIL PROTECTED]
> --------------------------------------------------------------------------
--
> ----------------------------------------
>
>  <<Wasgint, Rainer (E-Mail).vcf>>
>
>
> [ Attachment (application/octet-stream): "Wasgint, Rainer _E-Mail_.vcf"
455
bytes
>   Encoded with "quoted-printable" ]
>-- End of excerpt from Wasgint Rainer


************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************

************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages: 
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************

Reply via email to