Edit online

Integrating Web Author with a DITA-aware CMS

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:

Setting the DITA Context Used to Load the Editor

To open a topic with a specific DITA context, there are two options:

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.