source: products/quintagroup.transmogrifier/trunk/quintagroup/transmogrifier/marshall.txt @ 275

Last change on this file since 275 was 275, checked in by mylan, 18 years ago

Removed file/folder

File size: 2.0 KB
Line 
1Marshall section
2================
3
4The marshall section blueprint name is
5``quintagroup.transmogrifier.marshall``.
6
7Marshall needs at least 1 piece of information: the path to the object
8to update. To determine the path, the marshall section inspects each
9item and looks for one key, as described below. Any item missing this piece of
10information will be skipped. Similarly, items with a path that doesn't exist
11or are not Archetypes objects will be skipped as well.
12
13For the object path, it'll look (in order) for
14``_plone.app.transmogrifier.atschemaupdater_[sectionname]_path``,
15``_plone.app.transmogrifier.atschemaupdater_path``, ``_[sectionname]_path``
16and ``_path``, where ``[sectionname]`` is replaced with the name given to the
17current section. This allows you to target the right section precisely if
18needed. Alternatively, you can specify what key to use for the path by
19specifying the ``path-key`` option, which should be a list of keys to try (one
20key per line, use a ``re:`` or ``regexp:`` prefix to specify regular
21expressions).
22
23Paths to objects are always interpreted as relative to the context.
24
25>>> import pprint
26>>> marshall = """
27... [transmogrifier]
28... pipeline =
29...     marshallsource
30...     marshall
31...     printer
32...     
33... [marshallsource]
34... blueprint = quintagroup.transmogrifier.tests.marshallsource
35...
36... [marshall]
37... blueprint = quintagroup.transmogrifier.marshall
38...
39... [printer]
40... blueprint = collective.transmogrifier.sections.tests.pprinter
41... """
42>>> registerConfig(u'quintagroup.transmogrifier.tests.marshall', marshall)
43>>> transmogrifier(u'quintagroup.transmogrifier.tests.marshall')  # doctest: +REPORT_NDIFF
44{'_excluded_fields': ('fieldone', 'fieldtwo'),
45 '_files': {'marshall': {'data': 'marshalled', 'name': '.marshall.xml'}},
46 '_path': 'spam/eggs/foo'}
47{'_files': {'marshall': {'data': None, 'name': '.marshall.xml'}},
48 '_path': 'topic/criterion'}
49{'_path': 'not/existing/bar'}
50{}
51{'_path': 'spam/eggs/notatcontent'}
52>>> pprint.pprint(plone.exported)
53(('spam/eggs/foo', ('fieldone', 'fieldtwo')), ('topic/criterion', ()))
Note: See TracBrowser for help on using the repository browser.