Integrating Web Author with a DITA-aware CMSEdit online
Oxygen XML Web Author supports the use of some API extensions and a method from
Oxygen XML Editor that can be used to customize nodes within the DITA
Map view. The following are supported:
- ro.sync.exml.workspace.api.standalone.ditamap.TopicRefTargetInfoProvider - API extension can be used to provide titles for topic references. This should be implemented as an optimization by a CMS that already has the titles of the topics cached in the database. By default, Web Author fetches each topic from the CMS, parses it, and extracts the title.
- ro.sync.exml.workspace.api.editor.page.ditamap.DITAMapNodeRendererCustomizer - API extension allows you to customize the rendering of information in the DITA Map view (for example, titles for topic references). This method is called after Web Author computes the title for topic references.
- ro.sync.ecss.extensions.api.webapp.access.WebappPluginWorkspace.setDITAKeyDefinitionManagerProvider - This method sets an object that provides a DITA keys manager for each open document. This will override the Web Author's default behavior that will fetch the main DITA map and all the nested sub-maps from the CMS, parse them, and determine the keys.
Changing the DITA context after the editor is loaded
When a topic is reused in multiple DITA contexts defined by a DITA map and DITAVAL filter,
a CMS may provide the user a widget to switch between these contexts. To implement this
behavior, you need to use the JavaScript API as in the following
example:
var map = "http://example.com/path/to/ditamap"; var filter = "http://example.com/path/to/ditaval"; var isDirty = editor.isDirty(); editor.getActionsManager() .invokeOperation('ro.sync.servlet.operation.SetDitaMapOperation', { ditamap: map, ditaval: filter }) .then(function(result) { if (result === 'SUCCESS') { var editingContextManager = workspace.getEditingContextManager(); editingContextManager.updateDitaContext(new sync.api.DitaContext(map, filter)); } else { alert('FAILED'); } }) .thenAlways(function () { editor.setDirty(isDirty); });
where map
and filter
are the OXY-URLs of the DITA map and DITAVAL filter files, respectively.