Developing

Client scripts in Sophora Web

Sophora Web can execute Client scripts with certain restrictions.

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() and getSelectedComponentsAndBoxes() always return empty lists.
  • All methods requiring user interactions (such as dialogs or merging) will not have an effect in Sophora Web.

Last modified on 11/30/20

The content of this page is licensed under the CC BY 4.0 License. Code samples are licensed under the MIT License.

Icon