Adding a Custom Operation to an Existing Framework
This task explains how to add a custom Author mode operation to an existing framework (document type).
-
Set up a sample project by following the instructions for installing the SDK.
Tip: The SDK contains a sample framework project called oxygen-sample-framework.
- A variety of classes in the simple.documentation.framework.operations package implement the ro.sync.ecss.extensions.api.AuthorOperation interface. Depending on your use-case, modify one of these classes.
- Pack the operation class inside a Java JAR library.
- Copy the JAR library to your framework directory (for example, [OXYGEN_INSTALL_DIR]/frameworks/[FRAMEWORK_DIR]).
-
Open the
Preferences dialog box , go to
Document Type Association, and edit the document type (you need
write access to the [OXYGEN_INSTALL_DIR]) to open the Document
Type configuration dialog box.
- In the Classpath tab, add a reference to your JAR library (for example, ${framework}/customAction.jar).
- Go to the Author tab, then go to the Actions subtab.
-
Click the
New button and use the Action dialog box to create a new action that uses your custom operation.
- Mount the action to the toolbars or menus. You can also define a shortcut key.
- Share the modifications with your colleagues. The files that should be shared are your customAction.jar library and the .framework configuration file from the [OXYGEN_INSTALL_DIR]/frameworks/[FRAMEWORK_DIR] directory.