Edit online

Registering Browsing Functionality for a File Server

Oxygen XML Web Author has a user-friendly Dashboard where you can open and create new documents for particular repository services (such as WebDAV or Git). The default repository services include file browsing functionality in the Dashboard and in the file choosers in the editor (for example, actions to create new files, browse for existing files, upload files, change the server/repository/branch, and login/logout). The API used for this default browsing functionality can be used to register a file server that will provide the browsing functionality.

Register Browsing Functions for a File Server

To register the browsing functions, 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 the JavaScript API.
  3. Deploy the plugin in the Oxygen XML Web Author.

Result: The browsing functionality will appear in your Dashboard in the tab for your particular file storage service and in the file chooser in the editor.