|
@@ -1,75 +1,74 @@
|
1
|
1
|
#-*- coding: utf-8 -*-
|
2
|
2
|
|
3
|
|
-##@defgroup lodel2_plugins Plugins
|
4
|
|
-#@ingroup lodel2_leapi
|
|
3
|
+## @defgroup lodel2_plugins Plugins
|
|
4
|
+# @ingroup lodel2_leapi
|
5
|
5
|
#
|
6
|
|
-#Groups all stuff that concerns plugins
|
|
6
|
+# Groups all stuff that concerns plugins
|
7
|
7
|
|
8
|
8
|
## @page plugin_doc Lodel2 plugin documentation
|
9
|
|
-#@ingroup lodel2_plugins
|
|
9
|
+# @ingroup lodel2_plugins
|
10
|
10
|
# @section plugin_doc_type Plugin types
|
11
|
11
|
#
|
12
|
|
-# Plugins are organized into types. A type specify a behavior. For the moment
|
13
|
|
-# Lodel2 has 4 plugin types :
|
14
|
|
-# - **datasource** : A datasource connector plugin expose CRUD operation on a
|
15
|
|
-#particular datasource
|
16
|
|
-# - **ui** : A user interface plugin provide an interface to lodel2. For the
|
17
|
|
-#moment two ui are implemented
|
|
12
|
+# In Lodel2, plugins are organized into types. Each type helps specifying a
|
|
13
|
+# behavior. As of now, we have four plugin types :
|
|
14
|
+# - **datasource** : a connector exposing C.R.U.D. (Create/Read/Update/Delete)
|
|
15
|
+# operations on a particular datasource (a database, a remote service, etc ...)
|
|
16
|
+# - **ui** : a user interface that will provide a way to interact with Lodel2.
|
|
17
|
+# As of now, we have the following "ui" plugins :
|
18
|
18
|
# - interactive python : the default interface, provides access to LeApi
|
19
|
|
-#through interactive python interpreter
|
20
|
|
-# - webui : a plugin providing a web interface to lodel2
|
21
|
|
-# - **session_handler** : A session handler plugin expose functions that handles
|
22
|
|
-#user sessions.
|
23
|
|
-# - **extensions** : An extension plugin can define 2 kinds of objects :
|
24
|
|
-# - hooks using @ref lodel.plugin.hooks.LodelHook decorator
|
|
19
|
+# through an interactive python interpreter
|
|
20
|
+# - webui : a web interface to lodel2
|
|
21
|
+# - **session_handler** : handles user sessions
|
|
22
|
+# - **extensions** : a basic plugin that will extend Lodel2 functionalities.
|
|
23
|
+# It can define two kinds of objects :
|
|
24
|
+# - hooks using @ref lodel.plugin.hooks.LodelHook decorator
|
25
|
25
|
# - custom LeApi obect methods using @ref lodel.plugin.plugins.CustomMethod
|
26
|
|
-#decorator
|
|
26
|
+# decorator
|
27
|
27
|
#
|
28
|
28
|
# @subsection Lodel2 scripts
|
29
|
29
|
#
|
30
|
|
-# In instances an utility is provided : @ref install.lodel_admin . This
|
31
|
|
-# utility can be runned as a CLI script
|
32
|
|
-#<code>usage: lodel_admin.py [-h] [-L] [ACTION] [OPTIONS [OPTIONS ...]]</code>
|
|
30
|
+# In every instances of Lodel, one can use a manager script to execute some
|
|
31
|
+# defined administration commands that can be launched as CLI commands.
|
|
32
|
+# This utility script is provided by @ref install.lodel_admin. The syntax
|
|
33
|
+# to execute it is :
|
|
34
|
+# <code>usage: lodel_admin.py [-h] [-L] [ACTION] [OPTIONS [OPTIONS ...]]</code>
|
33
|
35
|
#
|
34
|
|
-# Each actions is a "lodel2 script". Thoses scripts are parts of plugins.
|
|
36
|
+# Each action is a "lodel2 script". All those scripts are parts of plugins.
|
35
|
37
|
# @ref lodel2_script "More informations on lodel2 scripting utilities"
|
36
|
38
|
#
|
37
|
39
|
# @section plugin_doc_struct Common plugin structure
|
38
|
40
|
#
|
39
|
|
-# All plugin types has to provide mandatories information in order to be
|
40
|
|
-# loaded :
|
41
|
|
-#
|
|
41
|
+# All plugin, whatever its type, has to provide mandatory informations in
|
|
42
|
+# order to be loaded :
|
42
|
43
|
# - A plugin name
|
43
|
44
|
# - A plugin version
|
44
|
45
|
# - A confspec indicating where to find the wanted plugin list (for example
|
45
|
|
-#datasources plugins list are indicated in lodel2.datasource_connectors
|
46
|
|
-#configuration key see @ref datasource_plugin.DatasourcePlugin::_plist_confspecs ). In
|
47
|
|
-#fact settings MUST begin by loading wanted plugin list in order to build
|
48
|
|
-#a "full" confspec
|
49
|
|
-# - A confspec indicating the plugins allowed settings (will be merged with
|
50
|
|
-#lodel2 confspecs)
|
51
|
|
-# - A loader module filename. This module is imported once settings are
|
52
|
|
-#fully bootstraped and loader. It triggers the module "startup".
|
53
|
|
-#
|
54
|
|
-# In order to provide this informations the develloper can use the plugin's
|
55
|
|
-#package <code>__init__.py</code> file. Some informations are stored in
|
56
|
|
-#variables in this file. Available variables are documented in
|
57
|
|
-#@ref plugin_init_specs . Here a list of basics variables :
|
|
46
|
+# datasources plugins list are indicated in lodel2.datasource_connectors
|
|
47
|
+# configuration key see @ref datasource_plugin.DatasourcePlugin::_plist_confspecs ).
|
|
48
|
+# In fact settings MUST begin by loading wanted plugin list in order to build a "full" confspec
|
|
49
|
+# - A confspec indicating the plugins allowed settings (will be merged with lodel2 confspecs)
|
|
50
|
+# - A loader module filename. This module is imported once settings are fully bootstraped and loader.
|
|
51
|
+# It triggers the module "startup".
|
|
52
|
+#
|
|
53
|
+# In order to provide these informations, the developper can use the plugin's
|
|
54
|
+# package <code>__init__.py</code> file. Some informations are stored in
|
|
55
|
+# variables in this file. Available variables are documented in
|
|
56
|
+# @ref plugin_init_specs . Here a list of basics variables :
|
58
|
57
|
# - the plugin's name @ref plugins.PLUGIN_NAME_VARNAME
|
59
|
58
|
# - the plugin's version @ref plugins.PLUGIN_VERSION_VARNAME
|
60
|
59
|
# - the plugin's loader filename @ref plugins.LOADER_FILENAME_VARNAME
|
61
|
|
-# - the plugin's confspec filename @ref plugins.CONFSPEC_FILENAME_VARNAME (
|
62
|
|
-#set this variable only if you want your confspecs to be in a separated file,
|
63
|
|
-#else you can put the confspecs directly in a CONFSPEC variable in the
|
64
|
|
-#<code>__init__.py</code> file see @ref plugins.CONFSPEC_VARNAME )
|
|
60
|
+# - the plugin's confspec filename @ref plugins.CONFSPEC_FILENAME_VARNAME
|
|
61
|
+# (set this variable only if you want your confspecs to be in a separated file,
|
|
62
|
+# else you can put the confspecs directly in a CONFSPEC variable in the
|
|
63
|
+# <code>__init__.py</code> file see @ref plugins.CONFSPEC_VARNAME )
|
65
|
64
|
# - the plugin's type @ref plugins.PLUGIN_TYPE_VARNAME (if not set use
|
66
|
65
|
# @ref plugins.DEFAULT_PLUGIN_TYPE )
|
67
|
66
|
# - the plugin's dependencies list @ref plugins.PLUGIN_DEPS_VARNAME
|
68
|
67
|
#
|
69
|
68
|
# This was the variable specification of the <code>__init__.py</code> file.
|
70
|
|
-#plugins can provide (in the same file) an _activate function (
|
71
|
|
-#<code>def _activate(): returns bool</code>) that return True if the plugin
|
72
|
|
-#is activable else False
|
|
69
|
+# plugins can provide (in the same file) an _activate function (
|
|
70
|
+# <code>def _activate(): returns bool</code>) that return True if the plugin
|
|
71
|
+# is activable else False
|
73
|
72
|
#
|
74
|
73
|
#An example dummy plugin exists in @ref plugins.dummy
|
75
|
74
|
#
|
|
@@ -87,11 +86,10 @@
|
87
|
86
|
#
|
88
|
87
|
#More informations :
|
89
|
88
|
# - @ref lodel.plugin.datasource_plugin.DatasourcePlugin "DatasourcePlugin"
|
90
|
|
-# - @ref lodel2_datasources "datasources"
|
|
89
|
+# - @ref lodel2_datasources "datasources"
|
91
|
90
|
# - @ref lodel.plugin.extensions.Extension "Extensions"
|
92
|
91
|
# - @ref lodel.plugin.interface.InterfacePlugin "InterfacePlugin"
|
93
|
92
|
# - @ref lodel.plugin.sessionhandler.SessionHandlerPlugin "SessionHandlerPlugin"
|
94
|
|
-#
|
95
|
93
|
|
96
|
94
|
from lodel.context import LodelContext
|
97
|
95
|
LodelContext.expose_modules(globals(), {
|