Registering Actions to Create or Open Documents for Configured Plugins

The Oxygen XML Web Author Component has a user-friendly Dashboard and if a particular plugin registers a create or open action, then it will include sections for creating and opening documents for plugin integrations.

Register Create and Open actions for the Oxygen XML Web Author Component Dashboard

To register Create and Open actions, follow these steps:

  1. Create a plugin that has a plugin.js file in its web folder.
  2. In the plugin.js file, add code similar to the following example:
    // The base url to browse.
    var initialUrl = 'file:/[PATH_TO_RESOURCE_FOLDER]';
    
    var createAction = new sync.api.CreateDocumentAction(
        new sync.api.FileBrowsingDialog({initialUrl : initialUrl}));
    createAction.setActionName('New Document');
    
    var openAction =new sync.actions.OpenAction(
        new sync.api.FileBrowsingDialog({initialUrl : initialUrl}));
    openAction.setActionName('Open Document');
    
    var actionsManager = workspace.getActionsManager();
    actionsManager.registerCreateAction(createAction);
    actionsManager.registerOpenAction(openAction);

    Note

    This example will provide browsing capabilities on your local file system. More complex connectors can be implemented using our Java and JavaScript API. Also, to see information for a more complex example, you can also look at our Oxygen XML Web Author Component storage services integration project that is hosted on GitHub.
  3. Deploy the plugin in the Oxygen XML Web Author Component.

Result: The registered create action will appear in the New section on your Dashboard, while a registered open action will appear in the Open section.

Was this helpful?