Macromedia’s Java Dreamweaver 2 allows you to configuration Web pages with tweaked parts. You can modify the interface to these segments to indicate the specific look and feel of the decisions introduced. While this customization is incredible, Macromedia likewise allows you to expand Dreamweaver’s JavaScript into C language libraries. By utilizing this “escape into C,” Dreamweaver can be reached out with whatever other language that can interface with C.

I’ll show you an illustration of this extensibility by giving a connection to Java code. We’ll utilize a Windows DLL written in C to permit Dreamweaver JavaScript to call, and recover values from, static strategies in Java. In the first place, I’ll go bit by bit through an insignificant model; at that point I’ll show you a more powerful interface with adequate blunder checking to get the inescapable mix-ups we make while creating.

I’ll expect that you as of now have Dreamweaver and Java introduced and working; I will not be expounding much on Dreamweaver or Java separately, zeroing in rather on the association between the two.


Why Connect to Java?

You can’t store information outside Dreamweaver utilizing JavaScript, which can restrict your capacity to make complex segment models. Going into the universe of Java allows you to exploit a full-included language, in particular utilizing Java’s information constancy instruments: object Serialization, JDBC, Remote Method Invocation (RMI), or simply composing regular records. By calling Java code, you can get tirelessness without coding down at the C level.

I’ve utilized Java from Dreamweaver to store part formats in diligent Java objects (see Figure 1). Essentially, I keep segment “classes” in Java and make Dreamweaver part “objects” from those classes. This is near the JavaBeans model. By keeping the class properties covered up, I uncover just certain properties to be changed for a given part example through Dreamweaver’s “property overseer” system. Along these lines, various degrees of segment customizations can be made accessible at various occasions or for various undertakings. I can likewise control the HTML produced for a part by delivering the HTML for a page from the Java classes. This gives me the adaptability to change the presence of a part and its conduct – without changing the segment occurrence, which may have been utilized on numerous pages.

Also, Java permits generally simple admittance to our substance the board framework (CMS) through JDBC. The CMS is executed in a Sybase data set. Parts that incorporate critical substance (say, a section or more) can reference the content in the CMS at page configuration time. The Dreamweaver client can pick the substance continuously by utilizing a custom Dreamweaver object with a custom property reviewer.


JavaScript Talks to C

I’ll focus on the basics of making the Java association. Figure 2 shows the associations between parts of the framework. In the initial step, we will get the JavaScript in Example 1(a) to call the Java class appeared in Example 1(b).

In the first place, ensure Dreamweaver is introduced effectively. Spot the document EchoTest.html in the Dreamweaver catalog Configuration/Commands. (In a standard establishment, the Dreamweaver registry is at/Program Files/Macromedia/Dreamweaver 2.) After you start Dreamweaver, you should see EchoTest in the Commands drop-down menu; select it. You’ll get a mistake message about DWjavaio not being characterized; that is the library you’ll make.

Then, ensure Java is introduced accurately. Your CLASSPATH climate variable ought to incorporate a . for current index. Spot the record from Example 1(b) into the Dreamweaver 2 index, and arrange it with javac. The primary technique is only for testing; run your class with java EchoTest. On the off chance that everything is set up appropriately, you’ll see the test message.

We’ll build the fundamental DLL in two phases: first we’ll simply associate with Dreamweaver to ensure we have that interface working, at that point we’ll add the Java association.

You’ll have to get the “Broadening Dreamweaver” documentation bundle from the Macromedia site (right now at; both Mac and Windows renditions are accessible. The bundle incorporates an Adobe Acrobat specialized report, test code, and the interface record mm_init.h. The bundle does exclude parallel code due to the manner in which Dreamweaver will call your DLL.

I’ve utilized just Microsoft Visual C++ to construct the DLL, yet since we needn’t bother with Microsoft augmentations or structures, you ought to have the option to work with any compiler that can focus on a Windows DLL. Since Dreamweaver and Java are additionally accessible on Macintosh, Mac clients ought to have the option to apply the vast majority of the source code in this article, however explicit form and establishment steps will presumably vary.

To make the main DLL, make another registry and spot DW2J1.c from Listing One in it. Duplicate mm_init.h from the Extending Dreamweaver bundle. Assemble and connection to DWjavaio.DLL. Duplicate the new DLL to the Dreamweaver 2\Configuration\JSExtensions index. Restart Dreamweaver, and select EchoTest from the Commands pull-down menu once more. The alarm message ought to affirm that you made the full circle to your new DLL.


JavaScript Talks to Java

Since we know the Dreamweaver-to-DLL association is working, we can include Java along with everything else. We’ll utilize the Java Native Interface (JNI), which is essential for the JDK. I’m utilizing JDK rendition 1.1.6, while the most recent creation adaptation is 1.2.x (a.k.a. “Delivery 2”). I don’t know about any regressive similarity issues to the 1.1.6 JNI, so on the off chance that you utilize 1.2 you ought to be fine. JNI allows you to call Java techniques from C capacities and carry out Java classes in C. Since every one of our communications with Java start from Dreamweaver, we just need to stress over calling Java from C. See the JDK documentation for more data about JNI; note that the JNI archive (reasonably) centers on composing Java classes in C, so you’ll need to search for the C-calls-Java parts. Segment 4 of the JNI archive is the most helpful as a kind of perspective.

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *