src/pyams_content/shared/site/interfaces/__init__.py
changeset 300 49e8f3cef75a
parent 294 8742c8ac126c
child 380 4d6e2ed222a3
equal deleted inserted replaced
299:70de02fd0cd1 300:49e8f3cef75a
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
     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
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
    10 # FOR A PARTICULAR PURPOSE.
    10 # FOR A PARTICULAR PURPOSE.
    11 #
    11 #
    12 from pyams_i18n.schema import I18nTextLineField
       
    13 
    12 
    14 __docformat__ = 'restructuredtext'
    13 __docformat__ = 'restructuredtext'
    15 
    14 
    16 
    15 
    17 # import standard library
    16 # import standard library
    22 from pyams_workflow.interfaces import IWorkflowPublicationSupport
    21 from pyams_workflow.interfaces import IWorkflowPublicationSupport
    23 from zope.container.interfaces import IContainer, IContained
    22 from zope.container.interfaces import IContainer, IContained
    24 
    23 
    25 # import packages
    24 # import packages
    26 from pyams_content.shared.common.interfaces import ISharedSite, IWfSharedContent, ISharedContent, \
    25 from pyams_content.shared.common.interfaces import ISharedSite, IWfSharedContent, ISharedContent, \
    27     IBaseContentManagerRoles, IBaseSharedTool
    26     IBaseContentManagerRoles, IBaseSharedTool, IDeletableElement
       
    27 from pyams_i18n.schema import I18nTextLineField
    28 from pyams_sequence.schema import InternalReference
    28 from pyams_sequence.schema import InternalReference
    29 from zope.container.constraints import containers, contains
    29 from zope.container.constraints import containers, contains
    30 from zope.interface import Attribute
    30 from zope.interface import Attribute
    31 from zope.schema import Text
    31 from zope.schema import Text, Bool
    32 
    32 
    33 from pyams_content import _
    33 from pyams_content import _
    34 
    34 
    35 
    35 
    36 class ISiteElement(IContained):
    36 class ISiteElement(IContained, IDeletableElement):
    37     """Base site element interface"""
    37     """Base site element interface"""
    38 
    38 
    39     containers('.ISiteContainer')
    39     containers('.ISiteContainer')
    40 
    40 
    41 
    41 
    61 
    61 
    62 class ISiteFolderRoles(IBaseContentManagerRoles):
    62 class ISiteFolderRoles(IBaseContentManagerRoles):
    63     """Site folder roles interface"""
    63     """Site folder roles interface"""
    64 
    64 
    65 
    65 
    66 class ISiteManager(ISharedSite, ISiteContainer, IBaseSharedTool, ISequentialIdTarget):
    66 class ISiteManager(ISharedSite, ISiteContainer, IBaseSharedTool, IDeletableElement, ISequentialIdTarget):
    67     """Site manager interface"""
    67     """Site manager interface"""
    68 
    68 
    69     contains(ISiteElement)
    69     contains(ISiteElement)
    70 
    70 
    71     folder_factory = Attribute("Folder factory")
    71     folder_factory = Attribute("Folder factory")
    97 
    97 
    98     alt_title = I18nTextLineField(title=_("Alternate title"),
    98     alt_title = I18nTextLineField(title=_("Alternate title"),
    99                                   description=_("Content title, as shown in front-office"),
    99                                   description=_("Content title, as shown in front-office"),
   100                                   required=False)
   100                                   required=False)
   101 
   101 
       
   102     visible = Bool(title=_("Visible?"),
       
   103                    description=_("If 'no', link is not visible"),
       
   104                    required=True,
       
   105                    default=True)
       
   106 
   102     def get_target(self):
   107     def get_target(self):
   103         """Get reference target"""
   108         """Get reference target"""