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.

Location:
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser
Files:
13 edited
2 moved

Legend:

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

    r11952 r11954  
    2121Create a site:
    2222
    23     >>> from waeup.ikoba.app import Institution
    24     >>> getRootFolder()['app'] = Institution()
     23    >>> from waeup.ikoba.app import Company
     24    >>> getRootFolder()['app'] = Company()
    2525    >>> from zope.component.hooks import setSite
    2626    >>> setSite(getRootFolder()['app'])
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/breadcrumbs.py

    r11952 r11954  
    2828from waeup.ikoba.browser.interfaces import (
    2929    IBreadcrumb, IBreadcrumbIgnorable, IBreadcrumbContainer, IIkobaObject,
    30     IInstitution, IUsersContainer, IDataCenter,
     30    ICompany, IUsersContainer, IDataCenter,
    3131    )
    3232from waeup.ikoba.reports import IReportsContainer
     
    8686        return self.viewname
    8787
    88 class InstitutionBreadcrumb(Breadcrumb):
    89     """A breadcrumb for institution index pages.
    90     """
    91     grok.context(IInstitution)
     88class CompanyBreadcrumb(Breadcrumb):
     89    """A breadcrumb for company index pages.
     90    """
     91    grok.context(ICompany)
    9292    title = _(u'Home')
    9393    parent = None
     
    9797
    9898    Here we need a special `parent()` implementation, because the
    99     parent object is not a real parent (the Institution object has no
     99    parent object is not a real parent (the Company object has no
    100100    valid parent in terms of breadcrumbs). Instead it is the
    101101    ``administration`` view of the same context the ``manage`` page
    102102    itself is bound to.
    103103    """
    104     grok.context(IInstitution)
     104    grok.context(ICompany)
    105105    grok.name('manage')
    106106    title = _(u'Portal Settings')
     
    113113
    114114class AdministrationBreadcrumb(Breadcrumb):
    115     """A breadcrumb for administration areas of Institution instances.
    116     """
    117     grok.context(IInstitution)
     115    """A breadcrumb for administration areas of Company instances.
     116    """
     117    grok.context(ICompany)
    118118    grok.name('administration')
    119119    title = _(u'Administration')
  • 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:
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/browser.txt

    r11952 r11954  
    44Here we visit all parts of a Ikoba portal using a browser.
    55
    6 Institution
     6Company
    77==========
    88
    99We can watch universities in the browser.
    1010
    11 We create an institution object and put into the ZODB root::
     11We create an company object and put into the ZODB root::
    1212
    1313  >>> root = getRootFolder()
     
    1515  []
    1616
    17   >>> from waeup.ikoba.app import Institution
    18   >>> u = Institution()
    19   >>> root['myinstitution'] = u
     17  >>> from waeup.ikoba.app import Company
     18  >>> u = Company()
     19  >>> root['mycompany'] = u
    2020  >>> list(root)
    21   [u'myinstitution']
     21  [u'mycompany']
    2222
    2323  >>> from zope.component.hooks import setSite
    24   >>> setSite(root['myinstitution'])
     24  >>> setSite(root['mycompany'])
    2525
    2626To make sure, we can 'watch' pages, we first have to initialize out
     
    3030  >>> browser = Browser()
    3131
    32 Let's get the default view of a institution::
    33 
    34   >>> browser.open('http://localhost/myinstitution')
     32Let's get the default view of a company::
     33
     34  >>> browser.open('http://localhost/mycompany')
    3535  >>> print browser.contents
    3636  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    5555The contact form for anonymous users is called 'Enquiries'::
    5656
    57   >>> browser.open('http://localhost/myinstitution')
     57  >>> browser.open('http://localhost/mycompany')
    5858  >>> browser.getLink('Enquiries').click()
    5959  >>> browser.getControl('Send').click()
     
    7474Registered users with an email address can request a password change:
    7575
    76   >>> root['myinstitution']['users'].addUser('forgetful', 'secret',title='Bob Forgetful',
     76  >>> root['mycompany']['users'].addUser('forgetful', 'secret',title='Bob Forgetful',
    7777  ...                               description='A forgetful user', email='aa@aa.ng')
    78   >>> browser.open('http://localhost/myinstitution/changepw')
     78  >>> browser.open('http://localhost/mycompany/changepw')
    7979  >>> browser.getControl(name="form.identifier").value = 'forgetful'
    8080  >>> browser.getControl(name="form.email").value = 'aa@aa.ng'
     
    9191We can then get an edit view of the configuration container::
    9292
    93   >>> browser.open('http://localhost/myinstitution/configuration')
    94   >>> print browser.contents
    95   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
    96   ...<form action="http://localhost/myinstitution/configuration/@@index"
    97   ...
    98 
    99 The edit form contains the default value for the institution name::
    100 
    101   >>> 'Sample Institution' in browser.contents
     93  >>> browser.open('http://localhost/mycompany/configuration')
     94  >>> print browser.contents
     95  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     96  ...<form action="http://localhost/mycompany/configuration/@@index"
     97  ...
     98
     99The edit form contains the default value for the company name::
     100
     101  >>> 'Sample Company' in browser.contents
    102102  True
    103103
     
    110110  ...
    111111
    112   >>> browser.open('http://localhost/myinstitution/configuration')
     112  >>> browser.open('http://localhost/mycompany/configuration')
    113113  >>> browser.getControl("Update plugins").click()
    114114  >>> print browser.contents
     
    120120and is properly rendered on the frontpage of the portal:
    121121
    122   >>> browser.open('http://localhost/myinstitution')
     122  >>> browser.open('http://localhost/mycompany')
    123123  >>> print browser.contents
    124124  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    134134If we change to German so that the German part of frontpage.rst is rendered:
    135135
    136   >>> browser.open('http://localhost/myinstitution//@@change_language?lang=de')
     136  >>> browser.open('http://localhost/mycompany//@@change_language?lang=de')
    137137  >>> print browser.contents
    138138  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    147147Switch back to English:
    148148
    149   >>> browser.open('http://localhost/myinstitution//@@change_language?lang=en')
     149  >>> browser.open('http://localhost/mycompany//@@change_language?lang=en')
    150150
    151151
     
    153153============
    154154
    155   >>> browser.open('http://localhost/myinstitution')
     155  >>> browser.open('http://localhost/mycompany')
    156156  >>> browser.getLink('Portal Users').click()
    157157  >>> print browser.contents
     
    187187manually by setting the roles attribute:
    188188
    189   >>> print root['myinstitution']['users']['bob'].roles
     189  >>> print root['mycompany']['users']['bob'].roles
    190190  []
    191   >>> root['myinstitution']['users']['bob'].roles = ['waeup.UsersManager']
    192   >>> print root['myinstitution']['users']['bob'].roles
     191  >>> root['mycompany']['users']['bob'].roles = ['waeup.UsersManager']
     192  >>> print root['mycompany']['users']['bob'].roles
    193193  ['waeup.UsersManager']
    194   >>> browser.open('http://localhost/myinstitution/users')
     194  >>> browser.open('http://localhost/mycompany/users')
    195195  >>> print browser.contents
    196196  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    200200Users can't be added twice:
    201201
    202   >>> browser.open('http://localhost/myinstitution/users/add')
     202  >>> browser.open('http://localhost/mycompany/users/add')
    203203  >>> browser.getControl(name="form.name").value = 'bob'
    204204  >>> browser.getControl(name="form.title").value = 'Bob The User'
     
    215215Users can be deleted:
    216216
    217   >>> browser.open('http://localhost/myinstitution/users')
     217  >>> browser.open('http://localhost/mycompany/users')
    218218  >>> browser.getControl("Remove", index=0).click()
    219219  >>> 'User account bob successfully deleted' in browser.contents
     
    227227Let's enter the contact form::
    228228
    229   >>> browser.open('http://localhost/myinstitution/contactadmin')
     229  >>> browser.open('http://localhost/mycompany/contactadmin')
    230230  >>> print browser.contents
    231231  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    236236contact@waeup.org)::
    237237
    238   >>> browser.open('http://localhost/myinstitution/contactadmin')
     238  >>> browser.open('http://localhost/mycompany/contactadmin')
    239239  >>> browser.getControl(name='form.body').value = "test message"
    240240  >>> browser.getControl('Send').click()
     
    253253The data center helps us uploading files for later import or similar.
    254254
    255   >>> browser.open('http://localhost/myinstitution')
     255  >>> browser.open('http://localhost/mycompany')
    256256  >>> browser.getLink('Data Center').click()
    257257
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/captcha.py

    r11952 r11954  
    3232    ICaptchaRequest, ICaptchaResponse, ICaptcha, ICaptchaConfig,
    3333    ICaptchaManager)
    34 from waeup.ikoba.interfaces import IInstitution
     34from waeup.ikoba.interfaces import ICompany
    3535
    3636#
     
    322322    # A test page to see a captcha in action
    323323    grok.name('captcha')
    324     grok.context(IInstitution)
     324    grok.context(ICompany)
    325325    grok.require('waeup.Public')
    326326    title = 'Captcha Test'
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/exceptions.py

    r11952 r11954  
    6464    """A page rendered when an object cannot be found.
    6565
    66     XXX: This page won't work for objects above a w.k.Institution.
     66    XXX: This page won't work for objects above a w.k.Company.
    6767    """
    6868    grok.context(INotFound)
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/interfaces.py

    r11952 r11954  
    2121from zope.interface import Interface, Attribute
    2222from waeup.ikoba.interfaces import (
    23     IIkobaObject, IInstitution, IUsersContainer, IDataCenter, validate_email)
     23    IIkobaObject, ICompany, IUsersContainer, IDataCenter, validate_email)
    2424from waeup.ikoba.interfaces import MessageFactory as _
    2525
     
    161161
    162162        If no `headerline` is given, a default will be rendered (name
    163         of institution).
     163        of company).
    164164
    165165        If no `title` is given, nothing will be rendered.
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/layout.py

    r11952 r11954  
    227227
    228228    def getAppTitle(self):
    229         return getattr(grok.getSite()['configuration'], 'name', u'Sample Institution')
     229        return getattr(grok.getSite()['configuration'], 'name', u'Sample Company')
    230230
    231231    def getAppAcronym(self):
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/pages.py

    r11952 r11954  
    4646    IkobaDisplayFormPage, NullValidator)
    4747from waeup.ikoba.browser.interfaces import (
    48     IInstitution, ICaptchaManager, IChangePassword)
     48    ICompany, ICaptchaManager, IChangePassword)
    4949from waeup.ikoba.browser.layout import jsaction, action, UtilityView
    5050from waeup.ikoba.interfaces import MessageFactory as _
     
    325325class ContactAdminForm(IkobaForm):
    326326    grok.name('contactadmin')
    327     #grok.context(IInstitution)
     327    #grok.context(ICompany)
    328328    grok.template('contactform')
    329329    grok.require('waeup.Authenticated')
     
    405405
    406406#
    407 # Institution related pages...
     407# Company related pages...
    408408#
    409409
    410 class InstitutionPage(IkobaDisplayFormPage):
    411     """ The main institution page.
     410class CompanyPage(IkobaDisplayFormPage):
     411    """ The main company page.
    412412    """
    413413    grok.require('waeup.Public')
    414414    grok.name('index')
    415     grok.context(IInstitution)
     415    grok.context(ICompany)
    416416    pnav = 0
    417417    label = ''
     
    434434    """
    435435    grok.name('administration')
    436     grok.context(IInstitution)
     436    grok.context(ICompany)
    437437    grok.require('waeup.managePortal')
    438438    label = _(u'Administration')
     
    443443    """
    444444    grok.name('feed.rss')
    445     grok.context(IInstitution)
     445    grok.context(ICompany)
    446446    grok.require('waeup.Public')
    447     grok.template('institutionrss20feed')
     447    grok.template('companyrss20feed')
    448448
    449449    name = 'General news feed'
     
    457457    @property
    458458    def title(self):
    459         return getattr(grok.getSite(), 'name', u'Sample Institution')
     459        return getattr(grok.getSite(), 'name', u'Sample Company')
    460460
    461461    @property
     
    15681568    """Captcha'd page for all kind of users to request a password change.
    15691569    """
    1570     grok.context(IInstitution)
     1570    grok.context(ICompany)
    15711571    grok.name('changepw')
    15721572    grok.require('waeup.Anonymous')
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/pdf.py

    r11952 r11954  
    710710            doc, 'ikoba_headtitle', getattr(
    711711                site_config, 'name',
    712                 u'Sample Institution'))
     712                u'Sample Company'))
    713713        canvas.setFont("Helvetica-Bold", 18)
    714714        if self.header_logo_left_path is not None:
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/tests/test_async.py

    r11952 r11954  
    88from zope.security.interfaces import Unauthorized
    99from zope.testbrowser.testing import Browser
    10 from waeup.ikoba.app import Institution
     10from waeup.ikoba.app import Company
    1111from waeup.ikoba.async import AsyncJob, get_job_id
    1212from waeup.ikoba.interfaces import IJobManager
     
    2929        self.storage = os.path.join(self.workdir, 'storage')
    3030        os.mkdir(self.storage)
    31         app = Institution()
     31        app = Company()
    3232        app['datacenter'].setStoragePath(self.storage)
    3333
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/tests/test_permissions.py

    r11952 r11954  
    3131from zope.security.interfaces import Unauthorized
    3232from zope.testbrowser.testing import Browser
    33 from waeup.ikoba.app import Institution
     33from waeup.ikoba.app import Company
    3434from waeup.ikoba.testing import (
    3535    FunctionalLayer, FunctionalTestCase, get_all_loggers, remove_new_loggers,
     
    5858    def setUp(self):
    5959        super(PermissionTest, self).setUp()
    60         # Set up a complete institution to have every page available...
    61         app = Institution()
     60        # Set up a complete company to have every page available...
     61        app = Company()
    6262        self.getRootFolder()['app'] = app
    6363        setSite(self.getRootFolder()['app'])
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/viewlets.py

    r11952 r11954  
    2424from zope.traversing.browser import absoluteURL
    2525from waeup.ikoba.browser.pages import (
    26     InstitutionPage, DatacenterPage,
     26    CompanyPage, DatacenterPage,
    2727    UsersContainerPage, UserManageFormPage)
    2828from waeup.ikoba.browser.interfaces import (
    29     IBreadcrumbContainer, IInstitution, IUsersContainer)
     29    IBreadcrumbContainer, ICompany, IUsersContainer)
    3030from waeup.ikoba.interfaces import (
    3131    IIkobaUtils, IIkobaObject, IIkobaXMLExporter,
Note: See TracChangeset for help on using the changeset viewer.