[1536] | 1 | browserlayer archetype sub-template |
---|
| 2 | =================================== |
---|
| 3 | |
---|
| 4 | The browserlayer sub-template allows you to extend package, created with |
---|
| 5 | archetype zopeskel template. |
---|
| 6 | |
---|
| 7 | So, first create archetype base package: |
---|
| 8 | |
---|
| 9 | >>> paster('create -t archetype plone.example --no-interactive --overwrite') |
---|
| 10 | paster create -t archetype plone.example --no-interactive |
---|
| 11 | ... |
---|
| 12 | |
---|
| 13 | Go into the package and check presence of *interfaces* and *profiles* directories |
---|
| 14 | |
---|
| 15 | >>> cd('plone.example','plone','ploneexample') |
---|
| 16 | >>> ls('.') |
---|
| 17 | README.txt |
---|
| 18 | ... |
---|
| 19 | interfaces |
---|
| 20 | ... |
---|
| 21 | profiles |
---|
| 22 | ... |
---|
| 23 | |
---|
| 24 | Now verify if interface/__init__.py contains IPloneExample browser layer interface, |
---|
| 25 | and there is no profiles/default/browserlayer.xml section in default generic setup |
---|
| 26 | profile. |
---|
| 27 | |
---|
| 28 | >>> cat('interfaces/__init__.py') |
---|
| 29 | # -*- extra stuff goes here -*- |
---|
| 30 | <BLANKLINE> |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | Check that there is no browserlayer.xml present in the default profile |
---|
| 34 | |
---|
| 35 | >>> cat('profiles', 'default', 'browserlayer.xml') |
---|
| 36 | No file named profiles/default/browserlayer.xml |
---|
| 37 | |
---|
| 38 | Add browser layer ... |
---|
| 39 | |
---|
| 40 | >>> paster('addcontent browserlayer') |
---|
| 41 | paster ... |
---|
| 42 | Inserting ... into .../plone.example/plone/ploneexample/interfaces/__init__.py |
---|
| 43 | ... |
---|
| 44 | Copying ... to .../plone.example/plone/ploneexample/profiles/default/browserlayer.xml |
---|
| 45 | |
---|
| 46 | Now IPlonePloneexample interface must be added to interfaces/__init__.py module |
---|
| 47 | |
---|
| 48 | >>> cat('interfaces/__init__.py') |
---|
| 49 | # -*- extra stuff goes here -*- |
---|
| 50 | ... |
---|
| 51 | class IPlonePloneexample(Interface): |
---|
| 52 | ... |
---|
| 53 | |
---|
| 54 | And browserlayer.xml step must present in default generic setup profile: |
---|
| 55 | |
---|
| 56 | >>> cat('profiles', 'default', 'browserlayer.xml') |
---|
| 57 | <?xml version="1.0"?> |
---|
| 58 | <layers> |
---|
| 59 | <layer name="plone.ploneexample" |
---|
| 60 | interface="plone.ploneexample.interfaces.IPlonePloneexample"/> |
---|
| 61 | </layers> |
---|
| 62 | <BLANKLINE> |
---|
| 63 | |
---|