OpenCOR has its own URI scheme, which gets registered the first time OpenCOR is run. The scheme takes the form:
opencor://[pluginName.]command[/argument1[|argument2|argument3|...|argumentN]]
It can be used in a Web browser, as well as in a Web document (e.g., the Plugins page).
Both pluginName
and command
are case insensitive while it depends on the command when it comes to argument1
, argument2
, argument3
, …, argumentN
.
For a command to be executable, no modal dialog must be active in OpenCOR.
The following commands are supported by OpenCOR itself:
openPluginsDialog
: open the Plugins dialog.
Example: opencor://openPluginsDialog
.
openPreferencesDialog
: open the Preferences dialog.
Example: opencor://openPreferencesDialog
.
openAboutDialog
: open the About dialog.
Example: opencor://openAboutDialog
.
importFile
: import a file (or open it if it cannot be imported), which path/URL is given as an argument.
Example #1: opencor://importFile//home/user/file
to import /home/user/file
.
Example #2: opencor://importFile/https://my.domain.com/file
to import https://my.domain.com/file
.
importFiles
: import several files (or open one/several of them if it/they cannot be imported), which path/URL is given as arguments, separated by |
.
Example #1: opencor://importFiles//home/user/file1|/home/user/file2
to import /home/user/file1
and /home/user/file2
.
Example #2: opencor://importFiles/https://my.domain.com/file1|https://my.domain.com/file2
to import https://my.domain.com/file1
and https://my.domain.com/file2
.
openFile
: open a file, which path/URL is given as an argument.
Example #1: opencor://openFile//home/user/file
to open /home/user/file
.
Example #2: opencor://openFile/https://models.physiomeproject.org/.../cell-model.sedml
to open https://models.physiomeproject.org/.../cell-model.sedml
.
openFiles
: open several files, which path/URL is given as arguments, separated by |
.
Example #1: opencor://openFiles//home/user/file1|/home/user/file2
to open /home/user/file1
and /home/user/file2
.
Example #2: opencor://openFiles/https://models.physiomeproject.org/.../cell-model.xml|https://models.physiomeproject.org/.../cell-model.sedml
to open https://models.physiomeproject.org/.../cell-model.xml
and https://models.physiomeproject.org/.../cell-model.sedml
.
As hinted above, a command can be sent to a given plugin. For example, we can ask the Core plugin to select a particular mode or view.
Example #1: opencor://Core.selectMode/SimulationMode
to select the Simulation mode.
Example #2: opencor://Core.selectView/RawTextView
to select the Raw Text view.