author | sylvain.thenault@logilab.fr |
Thu, 30 Apr 2009 00:41:10 +0200 | |
branch | tls-sprint |
changeset 1553 | 3f91ef2397d0 |
parent 1533 | bcd4bfff658b |
child 1554 | 3a3263df6cdd |
permissions | -rw-r--r-- |
1285
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
1 |
"""schema driven ui configuration. |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
2 |
|
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
3 |
set of properties configuring edition, actions box, ... rendering using tags |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
4 |
on schema relations. Those properties are defined here so we don't get module |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
5 |
reloading problems. |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
6 |
|
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
7 |
:organization: Logilab |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
8 |
:copyright: 2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
9 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
10 |
""" |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
11 |
__docformat__ = "restructuredtext en" |
1533 | 12 |
|
13 |
from cubicweb.rtags import RelationTags, RelationTagsSet |
|
1285
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
14 |
|
1498
2c6eec0b46b9
fix imports, cleanup, repair some ajax calls
sylvain.thenault@logilab.fr
parents:
1468
diff
changeset
|
15 |
# autoform.AutomaticEntityForm configuration ################################## |
1285
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
16 |
|
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
17 |
# relations'category (eg primary/secondary/generic/metadata/generated) |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
18 |
rcategories = RelationTags() |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
19 |
# use primary and not generated for eid since it has to be an hidden |
1533 | 20 |
rcategories.tag_relation('primary', ('*', 'eid', '*'), 'subject') |
21 |
rcategories.tag_relation('primary', ('*', 'in_state', '*'), 'subject') |
|
22 |
rcategories.tag_relation('secondary', ('*', 'description', '*'), 'subject') |
|
23 |
rcategories.tag_relation('metadata', ('*', 'creation_date', '*'), 'subject') |
|
24 |
rcategories.tag_relation('metadata', ('*', 'modification_date', '*'), 'subject') |
|
25 |
rcategories.tag_relation('metadata', ('*', 'owned_by', '*'), 'subject') |
|
26 |
rcategories.tag_relation('metadata', ('*', 'created_by', '*'), 'subject') |
|
27 |
rcategories.tag_relation('generated', ('*', 'has_text', '*'), 'subject') |
|
28 |
rcategories.tag_relation('generated', ('*', 'is', '*'), 'subject') |
|
29 |
rcategories.tag_relation('generated', ('*', 'is', '*'), 'object') |
|
30 |
rcategories.tag_relation('generated', ('*', 'is_instance_of', '*'), 'subject') |
|
31 |
rcategories.tag_relation('generated', ('*', 'is_instance_of', '*'), 'object') |
|
32 |
rcategories.tag_relation('generated', ('*', 'identity', '*'), 'subject') |
|
33 |
rcategories.tag_relation('generated', ('*', 'identity', '*'), 'object') |
|
34 |
rcategories.tag_relation('generated', ('*', 'require_permission', '*'), 'subject') |
|
35 |
rcategories.tag_relation('generated', ('*', 'wf_info_for', '*'), 'subject') |
|
36 |
rcategories.tag_relation('generated', ('*', 'wf_info_for', '*'), 'object') |
|
37 |
rcategories.tag_relation('generated', ('*', 'for_user', '*'), 'subject') |
|
38 |
rcategories.tag_relation('generated', ('*', 'for_user', '*'), 'object') |
|
1285
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
39 |
|
1313
9cff1eee0208
put class, not class name into rwidgets. New rfields rtags to specify a field for a relation
sylvain.thenault@logilab.fr
parents:
1285
diff
changeset
|
40 |
# relations'field class |
9cff1eee0208
put class, not class name into rwidgets. New rfields rtags to specify a field for a relation
sylvain.thenault@logilab.fr
parents:
1285
diff
changeset
|
41 |
rfields = RelationTags() |
9cff1eee0208
put class, not class name into rwidgets. New rfields rtags to specify a field for a relation
sylvain.thenault@logilab.fr
parents:
1285
diff
changeset
|
42 |
|
9cff1eee0208
put class, not class name into rwidgets. New rfields rtags to specify a field for a relation
sylvain.thenault@logilab.fr
parents:
1285
diff
changeset
|
43 |
# relations'widget class |
1285
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
44 |
rwidgets = RelationTags() |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
45 |
|
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
46 |
# inlined view flag for non final relations: when True for an entry, the |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
47 |
# entity(ies) at the other end of the relation will be editable from the |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
48 |
# form of the edited entity |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
49 |
rinlined = RelationTags() |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
50 |
|
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
51 |
# set of tags of the form <action>_on_new on relations. <action> is a |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
52 |
# schema action (add/update/delete/read), and when such a tag is found |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
53 |
# permissions checking is by-passed and supposed to be ok |
1533 | 54 |
rpermissions_overrides = RelationTagsSet() |
1285
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
55 |
|
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
56 |
|
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
57 |
# boxes.EditBox configuration ################################################# |
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
58 |
|
d5ce82d65c2b
for a correct handling of rtags, they should not ever be reloaded and they should be initialized once registration is finished
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
59 |
# 'link' / 'create' relation tags, used to control the "add entity" submenu |
1468
500ca81a344a
oos, set rmode for wf_info_for / object
sylvain.thenault@logilab.fr
parents:
1313
diff
changeset
|
60 |
rmode = RelationTags() |
1533 | 61 |
rmode.tag_relation('link', ('*', 'is', '*'), 'subject') |
62 |
rmode.tag_relation('link', ('*', 'is', '*'), 'object') |
|
63 |
rmode.tag_relation('link', ('*', 'is_instance_of', '*'), 'subject') |
|
64 |
rmode.tag_relation('link', ('*', 'is_instance_of', '*'), 'object') |
|
65 |
rmode.tag_relation('link', ('*', 'identity', '*'), 'subject') |
|
66 |
rmode.tag_relation('link', ('*', 'identity', '*'), 'object') |
|
67 |
rmode.tag_relation('link', ('*', 'owned_by', '*'), 'subject') |
|
68 |
rmode.tag_relation('link', ('*', 'created_by', '*'), 'subject') |
|
69 |
rmode.tag_relation('link', ('*', 'require_permission', '*'), 'subject') |
|
70 |
rmode.tag_relation('link', ('*', 'wf_info_for', '*'), 'subject') |
|
71 |
rmode.tag_relation('link', ('*', 'wf_info_for', '*'), 'object') |