How to Create and Open Documents for Configured Plugins

The Oxygen XML WebApp 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 Oxygen XML WebApp 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 WebApp storage services integration project that is hosted on GitHub.
  3. Deploy the plugin in the Oxygen XML WebApp.
The registered create action will appear in the New section on your Dashboard, while a registered open action will appear in the Open section.

Create a New Document

To create a new document, follow these steps:
  1. Go to your Oxygen XML WebApp Dashboard page.
  2. Click the New Document action in the New section. This opens a dialog box that allows you to select a new file template.
  3. Select a file template click OK. This opens a dialog box that allows you browse for a destination path.
  4. Select a destination path and name for the new document.
The new document will be opened in a new tab.

Open a Document

To open a document, follow these steps:
  1. Go to your Oxygen XML WebApp Dashboard page.
  2. Click the Open Document action in the Open section. This opens a dialog box that allows you to browse for a file.
  3. Select the file and click OK.
The selected document will be opened in a new tab.
Parent topic: WebApp Component How To ...