1 | Property manager section |
---|
2 | ======================== |
---|
3 | |
---|
4 | The marshall section blueprint name is |
---|
5 | ``quintagroup.transmogrifier.propertymanager``. |
---|
6 | |
---|
7 | Property manager needs at least 1 piece of information: the path to the object |
---|
8 | to update. To determine the path, the marshall section inspects each |
---|
9 | item and looks for one key, as described below. Any item missing this piece of |
---|
10 | information will be skipped. Similarly, items with a path that doesn't exist |
---|
11 | or are not objects that provide OFS.interfaces.IPropertyManager will be skipped as well. |
---|
12 | |
---|
13 | Paths to objects are always interpreted as relative to the context. |
---|
14 | |
---|
15 | >>> import pprint |
---|
16 | >>> propertymanager = """ |
---|
17 | ... [transmogrifier] |
---|
18 | ... pipeline = |
---|
19 | ... propertymanagersource |
---|
20 | ... propertymanager |
---|
21 | ... printer |
---|
22 | ... dataprinter |
---|
23 | ... |
---|
24 | ... [propertymanagersource] |
---|
25 | ... blueprint = quintagroup.transmogrifier.tests.propertymanagersource |
---|
26 | ... |
---|
27 | ... [propertymanager] |
---|
28 | ... blueprint = quintagroup.transmogrifier.propertymanager |
---|
29 | ... exclude = |
---|
30 | ... propone |
---|
31 | ... proptwo |
---|
32 | ... notexistentprop |
---|
33 | ... |
---|
34 | ... [printer] |
---|
35 | ... blueprint = collective.transmogrifier.sections.tests.pprinter |
---|
36 | ... |
---|
37 | ... [dataprinter] |
---|
38 | ... blueprint = quintagroup.transmogrifier.tests.dataprinter |
---|
39 | ... print = |
---|
40 | ... _files |
---|
41 | ... propertymanager |
---|
42 | ... data |
---|
43 | ... """ |
---|
44 | >>> registerConfig(u'quintagroup.transmogrifier.tests.propertymanager', propertymanager) |
---|
45 | >>> transmogrifier(u'quintagroup.transmogrifier.tests.propertymanager') # doctest: +ELLIPSIS, +REPORT_NDIFF |
---|
46 | {'_excluded_properties': ('proptwo', 'propthree'), |
---|
47 | '_files': {'propertymanager': {'data': ... |
---|
48 | 'name': '.properties.xml'}}, |
---|
49 | '_path': 'spam/eggs/foo'} |
---|
50 | <?xml version="1.0" encoding="utf-8"?> |
---|
51 | <properties> |
---|
52 | <property name="propfour"> |
---|
53 | value |
---|
54 | </property> |
---|
55 | </properties> |
---|
56 | <BLANKLINE> |
---|
57 | {'_path': 'not/existing/bar'} |
---|
58 | {} |
---|
59 | {'_path': 'spam/eggs/notatcontent'} |
---|
60 | >>> pprint.pprint(plone.updated) |
---|
61 | ('spam/eggs/foo',) |
---|