~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/webapp/doc/zcmldirectives.txt

  • Committer: Curtis Hovey
  • Date: 2011-12-24 18:33:21 UTC
  • mto: This revision was merged to the branch mainline in revision 14602.
  • Revision ID: curtis.hovey@canonical.com-20111224183321-hvgfx01s9yi2iliy
Fix includes to webapp zcml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
    >>> from zope.configuration import xmlconfig
137
137
    >>> zcmlcontext = xmlconfig.string("""
138
138
    ... <configure xmlns:browser="http://namespaces.zope.org/browser"
139
 
    ...     package="canonical.launchpad">
 
139
    ...     package="lp.services">
140
140
    ...   <include file="webapp/meta-overrides.zcml" />
141
141
    ...   <browser:page
142
142
    ...     for="lp.testing.IFoo"
200
200
    >>> P.page(context, name, facet=facet)
201
201
    >>> P.page(context, "OTHER NAME")
202
202
 
203
 
# This is a pointless test. See pointless test comment above
204
 
# -- StuartBishop 20060411
205
 
#     >>> context
206
 
#     ((None,
207
 
#       <function provideInterface>,
208
 
#       ('', 'FOR_')),
209
 
#      (('view',
210
 
#        'FOR_',
211
 
#        'NAME',
212
 
#        <InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest>,
213
 
#        <InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest>),
214
 
#       <function handler>,
215
 
#       ('Adapters',
216
 
#        'register',
217
 
#        ('FOR_',
218
 
#         <InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest>),
219
 
#        <InterfaceClass zope.interface.Interface>,
220
 
#        'NAME',
221
 
#        <class 'zope.app.publisher.browser.viewmeta.SimpleLaunchpadViewClass'>,
222
 
#        'INFO')),
223
 
#      (None,
224
 
#       <function provideInterface>,
225
 
#       ('', 'FOR_')),
226
 
#      (('view',
227
 
#        'FOR_',
228
 
#        'OTHER NAME',
229
 
#        <InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest>,
230
 
#        <InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest>),
231
 
#       <function handler>,
232
 
#       ('Adapters',
233
 
#        'register',
234
 
#        ('FOR_',
235
 
#         <InterfaceClass zope.publisher.interfaces.browser.IBrowserRequest>),
236
 
#        <InterfaceClass zope.interface.Interface>,
237
 
#        'OTHER NAME',
238
 
#        <class 'zope.app.publisher.browser.viewmeta.SimpleLaunchpadViewClass'>,
239
 
#        'INFO')))
240
 
 
241
 
 
242
203
Look for the SimpleLaunchpadViewClass in the data structure above, and check
243
204
its __launchpad_facetname__ attribute.
244
205
 
260
221
 
261
222
    >>> zcmlcontext = xmlconfig.string("""
262
223
    ... <configure xmlns:browser="http://namespaces.zope.org/browser"
263
 
    ...     package="canonical.launchpad">
 
224
    ...     package="lp.services">
264
225
    ...   <include file="webapp/meta-overrides.zcml" />
265
226
    ...   <browser:pages
266
227
    ...     for="lp.testing.IFoo"
354
315
 
355
316
    >>> zcmlcontext = xmlconfig.string("""
356
317
    ... <configure xmlns:browser="http://namespaces.zope.org/browser"
357
 
    ...     package="canonical.launchpad">
 
318
    ...     package="lp.services">
358
319
    ...   <include file="webapp/meta-overrides.zcml" />
359
320
    ...   <browser:editform
360
321
    ...     for="lp.testing.IFoo"
437
398
 
438
399
    >>> zcmlcontext = xmlconfig.string("""
439
400
    ... <configure xmlns:browser="http://namespaces.zope.org/browser"
440
 
    ...     package="canonical.launchpad">
 
401
    ...     package="lp.services">
441
402
    ...   <include file="webapp/meta-overrides.zcml" />
442
403
    ...   <browser:addform
443
404
    ...     for="lp.testing.IFoo"
517
478
 
518
479
    >>> zcmlcontext = xmlconfig.string("""
519
480
    ... <configure xmlns:browser="http://namespaces.zope.org/browser"
520
 
    ...     package="canonical.launchpad">
 
481
    ...     package="lp.services">
521
482
    ...   <include file="webapp/meta-overrides.zcml" />
522
483
    ...   <browser:schemadisplay
523
484
    ...     for="lp.testing.IFoo"
561
522
    >>> zcmlcontext = xmlconfig.string("""
562
523
    ... <configure xmlns="http://namespaces.zope.org/zope"
563
524
    ...            xmlns:browser="http://namespaces.zope.org/browser"
564
 
    ...     package="canonical.launchpad">
 
525
    ...     package="lp.services">
565
526
    ...   <include file="webapp/meta.zcml" />
566
527
    ...   <include file="webapp/meta-overrides.zcml" />
567
528
    ...   <facet facet="whole-facet">
634
595
    >>> zcmlcontext = xmlconfig.string("""
635
596
    ... <configure xmlns="http://namespaces.zope.org/zope"
636
597
    ...     i18n_domain="canonical">
637
 
    ...   <include file="lib/canonical/launchpad/webapp/meta-overrides.zcml" />
 
598
    ...   <include file="lib/lp/services/webapp/meta-overrides.zcml" />
638
599
    ...   <permission id="foo.bar" title="Foo Bar" access_level="read" />
639
600
    ... </configure>
640
601
    ... """)