How to Register Actions to Create or Open Documents for Configured Plugins
This topic describes how you can register actions for creating and opening documents and they will appear in the Oxygen XML WebApp Component Dashboard for configured plugins.
The Oxygen XML WebApp 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 WebApp Component Dashboard
To register Create and Open actions, follow these steps:- Create a plugin that has a plugin.js file in its web folder.
- 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 Component storage services integration project that is hosted on GitHub. - Deploy the plugin in the Oxygen XML WebApp Component.