Custom actions using Client scripts
Sophora Web can execute Sophora Client scripts with a few restrictions. Operations such as saving, publishing, or cloning a document, are supported.
Triggering Client scripts from Sophora Web
You can directly trigger scripts from the toolbar. You can also configure them to run during save operations of documents.
To do so, include the external IDs of the published scripts in the application.yml and ensure they run whenever a document is saved.
Sophora Web tracks changes to the scripts and uses the most recently published versions automatically. Modifications to the application.yml, however, are only read when restarting the Sophora web backend.
Restrictions
Configurations to the script document other than the trigger, the valid node types, and the actual script code will not be taken into account because they are only relevant to the DeskClient.
Not all functions of Client scripts are supported by Sophora Web.
- Input is only a single document that is always taken from the editor.
- The script context methods
getSelectedDocumentSummaries()andgetSelectedComponentsAndBoxes()always return empty lists. - All methods requiring user interactions (such as dialogs or merging) will not have an effect in Sophora Web.