Ignore:
Timestamp:
13 Dec 2014, 07:30:38 (10 years ago)
Author:
Henrik Bettermann
Message:

Make necessary changes in root and in customer browser test.

Add plugin to create documents folder.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/documents/container.py

    r12005 r12207  
    2121import grok
    2222from grok import index
     23from waeup.ikoba.interfaces import IIkobaPluggable
    2324from waeup.ikoba.documents.interfaces import IDocumentsContainer, IDocument
    2425from waeup.ikoba.utils.helpers import attrs_to_fields
     
    3940
    4041DocumentsContainer = attrs_to_fields(DocumentsContainer)
     42
     43class DocumentsPlugin(grok.GlobalUtility):
     44    """A plugin that creates container for documents inside a company.
     45    """
     46    grok.implements(IIkobaPluggable)
     47    grok.name('documents')
     48
     49    def setup(self, site, name, logger):
     50        if 'documents' in site.keys():
     51            logger.warn('Could not create container for documents.')
     52            return
     53        site['documents'] = DocumentsContainer()
     54        logger.info('Container for documents created')
     55        return
     56
     57    def update(self, site, name, logger):
     58        if not 'documents' in site.keys():
     59            self.setup(site, name, logger)
Note: See TracChangeset for help on using the changeset viewer.