home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / template.z / DOC.TXT < prev    next >
Text File  |  1996-12-04  |  4KB  |  95 lines

  1. NetImpact Dynamo Java Servelet Applications
  2.  
  3. Starbuck provides a custom Target Template which can be used
  4. to easily create Java applications for NetImpact Dynamo.
  5. A Java application can replace or augment a DynamoScript program.
  6. The Java application is executed on the server, as a plugin to Dynamo.
  7.  
  8. The Microsoft Java Virtual Machine is used to execute Java programs
  9. under NetImpact Dynamo. This means that your application can even
  10. access and use non-visual ActiveX components.
  11.  
  12.  
  13. ** Loading your DLL into Dynamo
  14.  
  15. To load Java support into Dynamo, you must execute a script to load
  16. JavaDynamo.dll into Dynamo. This is done with the (undocumented) AddExtension
  17. method on the site object:
  18.  
  19.     site.AddExtension ("java", "/path_to_Starbuck/system/javadynamo.dll");
  20.  
  21. NOTE: use forward slashes, or double each backslash, in the DLL pathname.
  22.  
  23. You can execute this statement in a new script (.ssc) or by adding the
  24. above line to your autoexec.ssc script and restarting Dynamo.
  25.  
  26. For example, if you have installed Starbuck to
  27.     c:/program files/powersoft/optima
  28. then the command will be:
  29.     site.AddExtension ("java", "c:/program files/powersoft/optima/system/javadynamo.dll");
  30.  
  31.  
  32. *** Defining an extension
  33.  
  34. A Dynamo template can contain HTML and Script tags. Executing the
  35. site.AddExtension() command defines a new tag called 'java'.
  36. A script of the form
  37.     <!--java classname
  38.     arg1
  39.     arg2
  40.     ...
  41.     -->
  42. will be passed to the javadynamo dll. The first name (classname) specifies
  43. the class that you have defined in Starbuck. The remaining arguments are
  44. made available in a list of Strings passed to main:
  45.     public void main(String args[]) {
  46.     }
  47.  
  48. *** Install support for Microsoft Java
  49.  
  50. This is for you when you install Starbuck onto your machine.
  51. If NetImpact Dynamo is running on a different computer, you will have to
  52. install the Microsoft Java VM on that machine as well. See the
  53. Microsoft WWW home page for a copy.
  54.  
  55. *** Install support for DynamoConnect
  56.  
  57. When your Java application is executed, it needs to communicate back
  58. to the specific requestor in NetImpact Dynamo. This is done by loading
  59. Java native methods from DynamoConnect.dll, from within Java.
  60. These native methods use an internal memory handle to access Dynamo.
  61.  
  62. If you examine the initialization code in the WebConnection class provided
  63. in the target template, you will see a call to
  64.  
  65.     System.loadLibrary("dynamoconnect");
  66.  
  67. If DynamoConnect.dll is not somewhere on your PATH, this statement will
  68. fail and your Java Application will be terminated. Be sure this DLL is copied
  69. from the Starbuck System directory, to a place on your PATH. For example,
  70. on Windows 95, you could copy this file to
  71.     c:/windows/dynamoconnect.dll
  72.  
  73. *** Using your Java Application
  74.  
  75. Base your Java application on the Starbuck target template called
  76.     NetImpact Dynamo Java Servelet
  77.  
  78. When you compile your Starbuck project, you will have a number of
  79. .class files in your project's debug directory. To execute these files,
  80. you must copy them to on the machine running NetImpact Dynamo, in a
  81. directory that will be searched automatically by the Microsoft Java VM.
  82.  
  83. If you run the regedit (on NT, regedt32) program, you can examine the
  84. system registry. The registry key
  85.     HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Java VM
  86. has a setting for Classpath. This is a semicolon (;) seperated list of
  87. directories that will be searched by the Java VM for undefined classes.
  88.  
  89. You can add a new directory to the Classpath key setting, and
  90. copy the .class files produced by Starbuck to that directory.
  91. Alternatively, you could simply copy your .class files to one of the
  92. directories specified in Classpath. Be careful not to overwrite a
  93. .class file needed for another application.
  94.  
  95.