src/pyams_thesaurus/interfaces/extension.py
changeset 0 47700a43ef3f
equal deleted inserted replaced
-1:000000000000 0:47700a43ef3f
       
     1 #
       
     2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
       
     3 # All Rights Reserved.
       
     4 #
       
     5 # This software is subject to the provisions of the Zope Public License,
       
     6 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
       
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
       
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
       
    10 # FOR A PARTICULAR PURPOSE.
       
    11 #
       
    12 
       
    13 __docformat__ = 'restructuredtext'
       
    14 
       
    15 
       
    16 # import standard library
       
    17 
       
    18 # import interfaces
       
    19 from zope.interface import Interface, Attribute
       
    20 from zope.schema import TextLine, URI
       
    21 
       
    22 # import packages
       
    23 
       
    24 from pyams_thesaurus import _
       
    25 
       
    26 
       
    27 class IThesaurusTermExtension(Interface):
       
    28     """Thesaurus term extension interface
       
    29     
       
    30     An extension is a marker interface implemented by
       
    31     a term, which provides additional attributes to the term.
       
    32     
       
    33     Each available extension is defined as a named utility.
       
    34     """
       
    35 
       
    36     label = TextLine(title=_("Extension name"),
       
    37                      description=_("User name given to the extension"),
       
    38                      required=True)
       
    39 
       
    40     target_interface = Attribute(_("Extension marker interface"))
       
    41 
       
    42     target_view = URI(title=_("Extension target view"),
       
    43                       required=True)
       
    44 
       
    45     icon = URI(title=_("Extension icon URI"),
       
    46                required=True)