Adobe COLDFUSION 9 Manual page 1184

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
3
Run the CF_root\Jintegra\bin\com2java.exe program from a command line or the Windows Start Menu. A window
appears.
If a COM class implements multiple interfaces that define methods with the same names, click the Options
a
button and clear the Implement interfaces that may conflict option. The generated Java stub classes do not
implement the additional, conflicting, interfaces. You can still access the interfaces using the getAsXXX method
that is generated. See the generated comments in the Java files.
Click the
button.
b
Select
Select your COM object's Type Library or DLL. For Microsoft Outlook in Windows XP, it is normally Program
c
Files\Microsoft Office\Office10\MSOUTL.OLB.
d
Enter a package name (for example, outlookXP) in the Java package field in the com2java dialog box. This
package will contain all the classes for the Java stubs for the COM object.
Note: Adobe uses a package name that starts with coldfusion.runtime.com.com2java for the packages that contain
the preinstalled Java stubs for Microsoft Excel, Microsoft Word, and Microsoft Access. For example, the name for
the package containing the Microsoft Word XP Java stub classes is coldfusion.runtime.com.com2java.wordXP.
This package name hierarchy results in the wordXP classes having a path inside the msapps.jar file of
coldfusion\runtime\com\com2java\wordXP\className.class. Although this naming convention is not necessary,
consider using a similar package naming convention for clarity, if you use many COM objects.
Click the Generate Proxies button to display the File browser. Select the directory you created in step 2., and click
e
the file browser OK button to generate the stub files.
Click Close to close the com2java.exe utility.
f
The files generated in your directory include the following:
• A Java interface and proxy class for each COM interface
• A Java class for each COM class
• A Java interface for each ENUM (a set of constant definitions)
Compile your Java code. In a command prompt, do the following:
4
a
Make the directory that contains the Java stubs (in this example, C:\src\outlookXP) your working directory.
Enter the following line:
b
javac -J-mx100m -J-ms100m *.java
The compiler switches ensure that you have enough memory to compile all the necessary files.
Note: If you did not place jintegra.jar on your CLASSPATH in step 1b, add the switch
classpath:/cf_root/lib/jintegra.jar
command.
Ensure that the ColdFusion server is not running. To stop the ColdFusion server, open the Services control panel,
5
select ColdFusion application server, and click Stop.
Add your .class files to the ColdFusion Microsoft application Java stubs file by doing the following:
6
a
In the Windows Command prompt, make the parent directory of the directory that contains your class files your
working directory. In this example, make c:\src your working director by entering cd .. in the Command prompt
from step 4.
b
Enter the following command:
jar -uvf cf_root\lib\msapps.jar directoryName\*.class
, where
is the directory where ColdFusion is installed, to the
cf_root
Last updated 8/5/2010
1179
-

Advertisement

Table of Contents
loading

Table of Contents