Ignore:
Timestamp:
13 Nov 2014, 16:54:17 (10 years ago)
Author:
Henrik Bettermann
Message:

Remove tools.

rename institution company.

Remove some apis from docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/breadcrumbs.txt

    r11952 r11954  
    99===============================
    1010
    11 We create a institution to check the breadcrumb functionality.
    12 
    13     >>> from waeup.ikoba.app import Institution
     11We create a company to check the breadcrumb functionality.
     12
     13    >>> from waeup.ikoba.app import Company
    1414    >>> root = getRootFolder()
    15     >>> root['app'] = Institution()
     15    >>> root['app'] = Company()
    1616    >>> app = root['app']
    1717
     
    2525    >>> blist1 = getBreadcrumbList(app, 'index')
    2626    >>> blist1
    27     [<waeup.ikoba.browser.breadcrumbs.InstitutionBreadcrumb object at 0x...>]
     27    [<waeup.ikoba.browser.breadcrumbs.CompanyBreadcrumb object at 0x...>]
    2828
    2929A slightly more extensive list for the datacenter:
     
    3232    >>> from pprint import pprint
    3333    >>> pprint(blist2)
    34     [<waeup.ikoba.browser.breadcrumbs.InstitutionBreadcrumb object at 0x...>,
     34    [<waeup.ikoba.browser.breadcrumbs.CompanyBreadcrumb object at 0x...>,
    3535     <waeup.ikoba.browser.breadcrumbs.AdministrationBreadcrumb object at 0x...>,
    3636     <waeup.ikoba.browser.breadcrumbs.DataCenterBreadcrumb object at 0x...>]
    3737
    38 We get a breadcrumb for institution, administration area and data
     38We get a breadcrumb for company, administration area and data
    3939center in that order.
    4040
     
    4747
    4848     >>> pprint([(x.context, x.viewname) for x in blist2])
    49      [(<waeup.ikoba.app.Institution object at 0x...>, 'index'),
    50       (<waeup.ikoba.app.Institution object at 0x...>, 'administration'),
     49     [(<waeup.ikoba.app.Company object at 0x...>, 'index'),
     50      (<waeup.ikoba.app.Company object at 0x...>, 'administration'),
    5151      (<waeup.ikoba.datacenter.DataCenter object at 0x...>, 'index')]
    5252
    5353The administration area breadcrumb might be a surprise, as there is no
    5454equivalent object in the ZODB. In fact the administration area is only
    55 a certain view (the 'administration' view) on the institution object.
     55a certain view (the 'administration' view) on the company object.
    5656
    5757We will show below, how you can define breadcrumbs this way.
     
    6262
    6363This way we can make sure, that there are different breadcrumb lists
    64 generated for instance for the administration view of Institution
     64generated for instance for the administration view of Company
    6565instances and the index view. While the first should look something
    6666like::
     
    118118
    119119    >>> pprint(mybccontainer.getList())
    120     [<...breadcrumbs.InstitutionBreadcrumb object at 0x...>,
     120    [<...breadcrumbs.CompanyBreadcrumb object at 0x...>,
    121121     <...breadcrumbs.AdministrationBreadcrumb object at 0x...>,
    122122     <...breadcrumbs.UsersContainerBreadcrumb object at 0x...>]
     
    128128
    129129Now we can get breadcrumbs for contexts and view names. For example a
    130 breadcrumb for the 'index' view of our Institution object:
     130breadcrumb for the 'index' view of our Company object:
    131131
    132132    >>> from zope.component import getAdapter
     
    134134    >>> b1 = getAdapter(app, IBreadcrumb, 'index')
    135135    >>> b1
    136     <waeup.ikoba.browser.breadcrumbs.InstitutionBreadcrumb object at 0x...>
     136    <waeup.ikoba.browser.breadcrumbs.CompanyBreadcrumb object at 0x...>
    137137
    138138Breadcrumb objects provide a title:
     
    168168
    169169    >>> b2.parent
    170     (<waeup.ikoba.app.Institution object at 0x...>, 'administration')
    171 
    172 This result denotes a new context object (the Institution instance we
     170    (<waeup.ikoba.app.Company object at 0x...>, 'administration')
     171
     172This result denotes a new context object (the Company instance we
    173173created above) and a view name ('administration').
    174174
     
    188188As you can see, we get an AdministrationBreadcrumb, although the
    189189context object, for which the breadcrumb was created is also the
    190 Institution instance as above:
     190Company instance as above:
    191191
    192192    >>> b3.context is b1.context
     
    197197    >>> context, viewname = b3.parent
    198198    >>> context, viewname
    199     (<waeup.ikoba.app.Institution object at 0x...>, 'index')
     199    (<waeup.ikoba.app.Company object at 0x...>, 'index')
    200200
    201201We create last breadcrumb:
Note: See TracChangeset for help on using the changeset viewer.