Salome HOME
box #29458 Merge branch 'CR29458'
[modules/gui.git] / doc / salome / gui / input / extend_salome.rst
1 .. _extend_salome: 
2
3 ******************************
4 Add/remove modules dynamically
5 ******************************
6
7 .. contents:: Table of Contents
8
9 "SALOME on demand" feature provides a possibility to dynamically add or remove
10 SALOME modules directly from GUI.
11
12 .. _hp_salomex_format:
13
14 Description file
15 ================
16
17 **"SALOME on demand"** feature introduces notion of a module description file.
18 This is the file in JSON format that has `.salomex` extension. The description
19 file provides some parameters of the module; two parameters are mandatory:
20 name of the module and path to its root directory.
21
22 Example:
23
24 .. code-block:: json
25
26     {
27       "name": "PYHELLO",
28       "root": "/home/user/salome/modules/PYHELLO"
29     }
30
31 .. note:: In the description file, the `name` parameter is an **internal** name of the module,
32           in contrast to its **title** which is described in `SalomeApp.xml` or `LightApp.xml`
33           resource file.
34
35 .. note:: One `.salomex` file may describe one SALOME module only.
36
37 .. _hp_modules_toolbar:
38
39 Modules toolbar
40 ===============
41
42 The *Modules* toolbar provides two additional buttons, which allow adding or removing
43 modules directly from GUI.
44
45 .. figure:: ../images/modules_toolbar.png
46    :align: center
47    :alt: Modules toolbar
48
49 .. |add| image:: ../images/modules_add.png
50   :height: 24px
51
52 .. |remove| image:: ../images/modules_remove.png
53   :height: 24px
54
55 .. _hp_modules_add:
56
57 Adding modules
58 --------------
59
60 Pressing the first button |add| shows a standard *Open File* dialog that allows
61 selecting one or more `.salomex` files. Each module correctly configured in the
62 corresponding `.salomex` file is then added to the SALOME session and appears in the
63 *Modules* toolbar. As soon as it is done, the user may work with the module in the same
64 way as with any other module: all features are available after activating module from
65 *Modules* toolbar.
66
67 The modules added in this way become *persistent*. This means that after restarting
68 SALOME these modules are available in the *Modules* toolbar.
69
70 .. _hp_modules_remove:
71
72 Removing modules
73 ----------------
74
75 Pressing a small arrow near the second button |remove| shows a drop-down menu with
76 the list of manually added modules, where the user may select a module to remove. As soon
77 as user selects a module to remove, a message box is shown asking the user if it is
78 necessary also to remove a directory, containing the module, from disk. If user
79 confirms removal of the directory, it will be necessary to save the study, in order to
80 avoid possible data loss.
81
82 .. note:: The module libraries are not removed from RAM until exit from the current
83           SALOME session, so some its functionality may be still accessible, for example,
84           via Python API. However, using module functionality may have unpredicted
85           behavior.