Custom actions using Client Scripts
The Sophora MobileClient can execute client scripts designed for the DeskClient with certain restrictions.
Triggering client scripts from the Sophora MobileClient
Scripts can be directly triggered from the Toolbar. They can also be configured to be ran during save operations of documents. To do so, include the external IDs of the published scripts in the application.yml (See section Configuring the MobileClient) and have them running whenever a document is saved.
The MobileClient will track changes to the scripts and uses the most recently published versions of the scripts automatically. Modifications to the application.yml however are just read when restarting the MobileClient's backend.
Configurations to the script document besides the trigger, the valid node types and the actual script code won't be taken into account since they are just relevant to the DeskClient.
Restrictions to the client script code
Not all functions of client scripts are supported by the MobileClient.
Input is only one single document which always is taken from the editor. The script context's methods getSelectedDocumentSummaries()
and getSelectedComponentsAndBoxes()
will always return empty lists. All methods requiring user interactions (like dialogs, or merging) won't have an effect.
Operations like saving, publishing or cloning a document however are supported.