|
@@ -0,0 +1,81 @@
|
|
1
|
+#-*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+from lodel.settings.validator import SettingValidator
|
|
4
|
+
|
|
5
|
+CONFSPEC = {}
|
|
6
|
+
|
|
7
|
+##@page lodel2_datasources Lodel2 datasources
|
|
8
|
+#
|
|
9
|
+#@par lodel2_datasources_intro Intro
|
|
10
|
+# A single lodel2 website can interact with multiple datasources. This page
|
|
11
|
+# aims to describe configuration & organisation of datasources in lodel2.
|
|
12
|
+# Each object is attached to a datasource. This association is done in the
|
|
13
|
+# editorial model, the datasource is identified by a name.
|
|
14
|
+#
|
|
15
|
+#@par Datasources declaration
|
|
16
|
+# To define a datasource you have to write something like this in confs file :
|
|
17
|
+#<pre>
|
|
18
|
+#[lodel2.datasources.DATASOURCE_NAME]
|
|
19
|
+#identifier = DATASOURCE_FAMILY.SOURCE_NAME
|
|
20
|
+#</pre>
|
|
21
|
+# See below for DATASOURCE_FAMILY & SOURCE_NAME
|
|
22
|
+#
|
|
23
|
+#@par Datasources plugins
|
|
24
|
+# Each datasource family is a plugin. For example mysql or a mongodb plugins.
|
|
25
|
+# Here is the CONFSPEC variable templates for datasources plugins
|
|
26
|
+#<pre>
|
|
27
|
+#CONFSPEC = {
|
|
28
|
+# 'lodel2.datasource.example.*' : {
|
|
29
|
+# 'conf1' : VALIDATOR_OPTS,
|
|
30
|
+# 'conf2' : VALIDATOR_OPTS,
|
|
31
|
+# ...
|
|
32
|
+# }
|
|
33
|
+#}
|
|
34
|
+#</pre>
|
|
35
|
+#MySQL example
|
|
36
|
+#<pre>
|
|
37
|
+#CONFSPEC = {
|
|
38
|
+# 'lodel2.datasource.mysql.*' : {
|
|
39
|
+# 'host': ( 'localhost',
|
|
40
|
+# SettingValidator('host')),
|
|
41
|
+# 'db_name': ( 'lodel',
|
|
42
|
+# SettingValidator('string')),
|
|
43
|
+# 'username': ( None,
|
|
44
|
+# SettingValidator('string')),
|
|
45
|
+# 'password': ( None,
|
|
46
|
+# SettingValidator('string')),
|
|
47
|
+# }
|
|
48
|
+#}
|
|
49
|
+#</pre>
|
|
50
|
+#
|
|
51
|
+#@par Configuration example
|
|
52
|
+#<pre>
|
|
53
|
+# [lodel2.datasources.main]
|
|
54
|
+# identifier = mysql.Core
|
|
55
|
+# [lodel2.datasources.revues_write]
|
|
56
|
+# identifier = mysql.Revues
|
|
57
|
+# [lodel2.datasources.revues_read]
|
|
58
|
+# identifier = mysql.Revues
|
|
59
|
+# [lodel2.datasources.annuaire_persons]
|
|
60
|
+# identifier = persons_web_api.example
|
|
61
|
+# ;
|
|
62
|
+# ; Then, in the editorial model you are able to use "main", "revues_write",
|
|
63
|
+# ; etc as datasource
|
|
64
|
+# ;
|
|
65
|
+# ; Here comes the datasources declarations
|
|
66
|
+# [lodel2.datasource.mysql.Core]
|
|
67
|
+# host = db.core.labocleo.org
|
|
68
|
+# db_name = core
|
|
69
|
+# username = foo
|
|
70
|
+# password = bar
|
|
71
|
+# ;
|
|
72
|
+# [lodel2.datasource.mysql.Revues]
|
|
73
|
+# host = revues.org
|
|
74
|
+# db_name = RO
|
|
75
|
+# username = foo
|
|
76
|
+# password = bar
|
|
77
|
+# ;
|
|
78
|
+# [lodel2.datasource.persons_web_api.example]
|
|
79
|
+# host = foo.bar
|
|
80
|
+# username = cleo
|
|
81
|
+#</pre>
|