Author: Jack Palevich mailto:palevich@netscape.com

# Composer Plug-in SDK Release Notes

Copyright (C) 1997 Netscape Communications, Inc. All Rights Reserved
Version 26
4/29/97
Jack Palevich x6701 palevich@netscape.com

## Introduction

The Composer Plug-in SDK allows you to develop plug-ins for Netscape Composer. Please refer to the on-line documentation, the sample plugins, and the developer's guide for more information.

## What's New

Version 26 (For Netscape Communicator 4.0PR4)

- Added a new method, public static void Document.editDocument(String documentURL). This method lets you open an arbitrary URL for editing. This method is asynchronous. It does not return any status. You can use it to programatically open an arbitrary URL for editing by the user. You don't even have to be in a Composer Plug-in when you call the method. You can call it from an applette, or JavaScript, or wherever.
- Added a sample plug-in, EditHomePage, that shows how to use Document.editDocument.
- Added a sample plug-in, RedirectTest, that shows how to redirect "edit" requests.
- You must now use JDK 1.1, or a JDK 1.1 compatable IDE such as Symantec Cafe 1.5.1 with the 1.1 Preview, to develop Composer Plug-ins.
- Removed fakejava.zip -- it is not needed now that JDK 1.1 is required.
- Updated the DocInfo and IFCTest samples to use the JDK 1.1 standard API for ResourceBundles and Character.IsWhiteSpace.
- Updated the AddButton sample to ask for the UniversalConnect privilege. (This principle is required in order to read from a URL.)
- Note that JDK 1.1 will issue depricated interface warnings when compiling some of the samples. If you attempt to fix these warnings, you may run into trouble. The reason is that some of the new JDK 1.1 methods (especially new features of AWT 1.1) are not supported by Communicator 4.0. When in doubt, stick to AWT 1.0 features.

Version 25

- Two new methods have been added to Document: getText and setText. These convenience methods allow you to get and set the whole raw HTML text of the document. This makes it easier to write Composer Plug-ins that perform operations on the raw HTML text.
- The EditRaw and IFCTest sample plug-ins have been updated to use Document.getText and Document.setText. About 10 lines were saved in each sample.

Version 24 (For Netscape Communicator 4.0 PR3)

- You can now create and use jar files instead of zip files to hold your Composer Plug-in classes. Using .zip files will continue to work. However, the benefits of jar files are:

- Since they don't end in .zip, users won't be tempted to unzip them.
- They are clearly identified as Java files, rather than generic archive files.
- They can be compressed. (However, this feature is not working for Composer 4.0 PR3.)
- They can be signed. For more information, look at the Java signing and security release notes for PR3.

- Communicator 4.0 has a new security model for Java code. When you want to do something special, you ask the netscape security manager for permission. It, in turn, asks the user for permission. If the user grants you the permission, your code is free perform the action.

- The AddApplet and AddButton sample Composer Plug-ins have been enhanced to use this new security model.
- The Composer Plug-in kit's classes.zip file now includes a stub version of the class netscape.security.SecurityManager. This will allow you to use your existing Java development environment to write code that calls the SecurityManager.
- If your plug-in needs to read or write files, or load a dynamic library, or otherwise do something that might be dangerous, you will have to upgrade to this new security model.For more information, look at the Java signing and security release notes for PR3.

- The pre-built sample plug-ins, cpTest.jar, now come as a jar file instead of a zip file.

Version 23

- The bug where the plug-in's window comes up behind the Composer's window has been fixed. The fix is for plug-ins to call requestFocus() after they call show(). The samples AddLayer, DocInfo and EditRaw have been updated to include this fix.
- The Java 1.1 classes that used to be in classes.zip have been moved to a seperate zip file, fakejava11.zip. If you are developing under JDK 1.0.2, include both classes.zip and fakejava11.zip in your classpath. If you are developing under JDK 1.1, only include classes.zip.
- The Test framework's -in option now works again. It was broken because it was using FileReader, which does not appear to work under JDK 1.0.2.
- An event model has been added to Composer Plug-ins. This event model, which will work with Communicator PR3, allows you to write a Plug-in that can automaticly perform actions when certain events occur. Check the javadoc and regular documentation for Plugin and for Document for more information.
- The source code for the test framework classes is now included in the SDK.
- A sample Composer Plug-in .ZIP file, cpTest.zip, is now included in the SDK. If you are having trouble packaging your plug-in, compare the cpTest.zip file to your own zip file. This should help you see what's wrong.

Version 22

- Fixed mistakes in AddApplets comments.
- Added dialog.dispose() calls to each of the samples that uses AWT dialogs. This cleans up any native OS resources (such as native windows) that the dialogs might be using.

Version 21

- Various small improvements have been made to the sample plug-ins.

- The IFCTest plug-in is now lets you edit HTML text. IFCTest is just like EditRaw, except that EditRaw uses the AWT, while IFCTest uses AWT. You can compare the two plug-ins to see the differences between the two toolkits.
- The window close boxes now work correctly in all the sample plug-ins.
- The AddApplet sample now calls itself "Insert:Nervous Text", which is what it does.
- The DocumentInfo plug-in's OK button has been removed, since the close box serves the same purpose.

- The Composer Plug-in kit now comes with a dummy version of java.lang.SecurityManager. This is required so that you can compile code that calls SecurityManager.setScopePermission. SetScopePermission is a feature of the Netscape Communicator security model. You will have to call it if your plug-in is planning on using privilidged methods. For example, the following code needs to be used to load a library:

SecurityManager.setScopePermission();
System.loadLibrary(...);
SecurityManager.resetScopePermission();

The call to setScopePermission annotates the current stack frame to allow it to make privileged calls.

Version 20

- The image encoder test now creates a test image that's 512 x 512 pixels. This is large enough to help identify performace issues with your image encoder.

Version 19

- Fixed bugs related to selection comments. Added the "stickyAfter" concept. This is an obscure feature of selections that most developers can safely ignore. We added it for completeness, so that all the editor's state was represented in the Document object.
- Added an Internationalization Issues section at the bottom of these notes.

Version 18

- Removed getAbout() methods from Plugin and ImageEncoder. Developers wishing to provide about boxes should implement the functionality themselves. (For example, you could add a button to your dialog box that brings up an about box.)

Version 17

- Added a new class, netscape.plugin.composer.ImageEncoder. Image encoders extend the kinds of image file formats that Composer can write. Your Composer Plug-in can also find and use existing image encoders to write image files. See the javadoc for ImageEncoder for more information.
- Added a sample ImageEncoder called TextImageEncoder.
- Added a test framework, TestImageEncoder, for testing image encoders.
- Added a new sample Composer Plug-in, AddApplet, which documents how to use the LOCALDATA property to add arbitrary local data files to a Composer document.

Version 16

- Tokens are now Clonable.

Version 15

- The classes directory now includes all the JDK 1.1 internationalization and character reader/writer classes required to create plugins. So you can develop using a JDK 1.0.2 compatible development environment.
- The examples have been downgraded to work with JDK 1.0.2. You will get some 'deprecated' warnings when you compile under JDK 1.1.

Version 14

- Added missing classes TestDocumentReader and TestDocumentWriter.
- DocInfo example now uses JDK1.1 style resource bundles.
- Entity.entities added. This method returns an enumeration of known entities.

Version 13

- Fixed race condition in EditRaw.
- Did minor cleanup of EditRaw.
- Started AddLayer sample.

Version 12

- Fixed -in option of navigator.test.plugin.composer.Test.
- Renamed SelectedHTMLStream to SelectedHTMLReader.
- Updated code to use JDK 1.1 Beta 2 classes. Primarily this meant converting from CharInputStream to Reader and CharOutputStream to Writer.
- Use Java 1.1 version of javadoc.

Version 11

- Added class netscape.plugin.composer.io.SelectedHTMLStream.
- Reworked selection-modifying plugins to use SelectedHTMLStream.
- Removed some debugging printlns.

Version 10

- Added IFCTest example of how to use the IFC from a plugin.
- Factory.getPlugins now returns an Enumeration instead of a Vector.

Version 9

- Added Test.perform() to simplify testing. It is now easier to test your plugin from within an IDE such as Symantec Cafe.
- Test.test() now calls System.exit. This ensures that the test terminates, even if the plugin or the awt has left threads running.
- Fixed word count in DocInfo sample.
- Added more information to the DocInfo sample -- now it prints out the base URL, the working directory, and the working directory URL.

Version 8

- Renamed Plugin1 to TagStrip
- Renamed Plugin2 to EditRaw
- Renamed Plugin3 to Colorize
- Added missing Test*Stream classes so that the SDK's test actually works.
- Minor javadoc documentation improvements.

Version 7

### Samples:

- A new sample plugin: AddButton, which shows how to add an image to a document.
- A new sample plugin: DocumentInfo, which shows how to access relative and absolute image URLs.
- Upgraded Plugin2 to show how to implement an "Apply" dialog button.

### API changes:

- Now requires Java 1.1 - Uses CharInputStream, CharOutputStream.
- Removed all attempts to help with internationalization. You should use the Java 1.1 ResourceBundle framework.
- netscape.plugin.composer.Document - The document text is now accessed via Char streams, rather than String objects.
- netscape.plugin.composer.io - The Unicode stream classes have been removed in favor of the standard Java 1.1 Char streams.
- netscape.plugin.composer.Plugin - perform now returns a boolean result. "True" means the plugin succeeded. "False" means the plugin failed.

### Test changes:

- The test now allows you to set both the input file and the output file. This allows you to capture the output of the test.

### Documentation changes:

- The JavaDoc images are now supplied with the documentation, which should make the documentation easier to read.

## Notes

Plug-ins created with this API will work with Netscape Communicator b2. They will not work with Communicator pre-release 1, because that version of the Communicator uses an earlier version of the Composer Plug-in API. We are not supporting Composer Plugins on Communicator 4.0 pre-release 1.

## Internationalization Issues

The intention is that you will use the Java 1.1 internationalization classes to internationalize your composer plug-in API. Unfortunately, Java 1.1 is still in beta, and so not all of the necessary classes are available for you to use. There are several issues here:

1. The JDK 1.1 classes are still being defined, so they are buggy and their API may change.
2. Most Java IDEs support JDK 1.0.2, and so do not contain any of the JDK 1.1 classes.
3. Netscape Communicator version 4.0b2 doesn't have the full JDK 1.1 internationalization classes.

We suggest that you do the following:

- Write your UI using the new JDK 1.1 ResourceBundle classes. By putting your resource strings in a resource bundle, you will make it easier to internationalize your plugin.
- Look at the DocumentInfo sample plug-in. This shows you the style you should follow when using the ResourceBundle class. If you stick to this subset of the full ResourceBundle functionality, your plug-in will work, and will be easy to port to the final JDK 1.1 interfaces.
- We have provided a JDK 1.0.2 compatable version of the ResourceBundle classes in the Composer Plug-in Kit. This means that you can develop your plug-in using a JDK1.0.2 IDE, such as Symantec Visual Cafe.
- Expect to have to slightly tweak your use of resource bundles before Communicator 4.0 goes final.