Starting with Oxygen XML Editor 10.3 version a single bundle was introduced acting as a provider for all other extensions. The individual extensions can still be set and if present they take precedence over the single provider, but this practice is being discouraged and the single provider should be used instead. To set individual extensions, open the Preferences dialog box, go to Document Type Association, double-click a document type, and go to the extension tab.
The extensions bundle is represented by the ro.sync.ecss.extensions.api.ExtensionsBundle class. The provided implementation of the ExtensionsBundle is instantiated when the rules of the Document Type Association defined for the custom framework match a document opened in the editor. Therefor references to objects which need to be persistent throughout the application running session must not be kept in the bundle because the next detection event can result in creating another ExtensionsBundle instance.
public class SDFExtensionsBundle extends ExtensionsBundle {
public String getDocumentTypeID() {
return "Simple.Document.Framework.document.type";
}
public String getDescription() {
return "A custom extensions bundle used for the Simple Document" +
"Framework document type";
}
public AuthorExtensionStateListener createAuthorExtensionStateListener() {
return new SDFAuthorExtensionStateListener();
}
The AuthorExtensionStateListener is instantiated and notified about the activation of the framework when the rules of the Document Type Association match a document opened in the Author editor mode. The listener is notified about the deactivation when another framework is activated for the same document, the user switches to another mode or the editor is closed. A complete description and implementation of an ro.sync.ecss.extensions.api.AuthorExtensionStateListener can be found in the Implementing an Author Extension State Listener.
If Schema Aware mode is active in Oxygen XML Editor, all actions that can generate invalid content will be redirected toward the ro.sync.ecss.extensions.api.AuthorSchemaAwareEditingHandler. The handler can either resolve a specific case, let the default implementation take place or reject the edit entirely by throwing an ro.sync.ecss.extensions.api.InvalidEditException. The actions that are forwarded to this handler include typing, delete or paste.
See Implementing an Author Schema Aware Editing Handler for more details about this handler.
public SchemaManagerFilter createSchemaManagerFilter() {
return new SDFSchemaManagerFilter();
}
A detailed presentation of the schema manager filter can be found in Configuring a Content completion handler section.
public ElementLocatorProvider createElementLocatorProvider() {
return new DefaultElementLocatorProvider();
}
The section that explains how to implement an element locator provider is Configuring a Link target element finder.
public AuthorDnDListener createAuthorAWTDndListener() {
return new SDFAuthorDndListener();
}
For more details about the Author drag and drop listeners see the Configuring a custom Drag and Drop listener section.
public AuthorReferenceResolver createAuthorReferenceResolver() {
return new ReferencesResolver();
}
A more detailed description of the references resolver can be found in the Configuring a References Resolver section.
public StylesFilter createAuthorStylesFilter() {
return new SDFStylesFilter();
}
See the Configuring CSS styles filter section for more details about the styles filter extension.
public AuthorTableCellSpanProvider createAuthorTableCellSpanProvider() {
return new TableCellSpanProvider();
}
public AuthorTableColumnWidthProvider
createAuthorTableColumnWidthProvider() {
return new TableColumnWidthProvider();
}
The two table information providers are not reused for different tables. The methods are called for each table in the document so new instances should be provided every time. Read more about the cell span and column width information providers in Configuring a Table Cell Span Provider and Configuring a Table Column Width Provider sections.
If the functionality related to one of the previous extension point does not need to be modified then the developed ro.sync.ecss.extensions.api.ExtensionsBundle should not override the corresponding method and leave the default base implementation to return null.
public LinkTextResolver createLinkTextResolver() {
return new DitaLinkTextResolver();
}
Oxygen XML Editor offers built in implementations for DITA and DocBook: ro.sync.ecss.extensions.dita.link.DitaLinkTextResolver ro.sync.ecss.extensions.docbook.link.DocbookLinkTextResolver