src/pyams_content/shared/view/portlet/interfaces.py
changeset 1171 41310cefa42a
parent 992 8fd039f79d30
child 1257 6027118fcde9
equal deleted inserted replaced
1170:49cba50f36cb 1171:41310cefa42a
    10 # FOR A PARTICULAR PURPOSE.
    10 # FOR A PARTICULAR PURPOSE.
    11 #
    11 #
    12 
    12 
    13 __docformat__ = 'restructuredtext'
    13 __docformat__ = 'restructuredtext'
    14 
    14 
       
    15 from zope.schema import Bool, Choice, Int
       
    16 from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
    15 
    17 
    16 # import standard library
    18 from pyams_content.shared.view import WfView
    17 
       
    18 # import interfaces
       
    19 from pyams_content.shared.view.interfaces import VIEWS_MERGERS_VOCABULARY
    19 from pyams_content.shared.view.interfaces import VIEWS_MERGERS_VOCABULARY
    20 from pyams_portal.interfaces import IPortletSettings
       
    21 
       
    22 # import packages
       
    23 from pyams_content.shared.view import WfView
       
    24 from pyams_content.shared.view.merge import CONCAT_VIEWS_MERGE_MODE
    20 from pyams_content.shared.view.merge import CONCAT_VIEWS_MERGE_MODE
    25 from pyams_i18n.schema import I18nTextLineField
    21 from pyams_i18n.schema import I18nTextLineField
       
    22 from pyams_portal.interfaces import IPortletSettings
    26 from pyams_sequence.schema import InternalReferencesListField
    23 from pyams_sequence.schema import InternalReferencesListField
    27 from zope.schema import Choice, Int
       
    28 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
       
    29 
    24 
    30 from pyams_content import _
    25 from pyams_content import _
    31 
    26 
    32 
    27 
    33 #
    28 #
    42     {'id': VIEW_CONTENT_CONTEXT, 'title': _("Content context")}
    37     {'id': VIEW_CONTENT_CONTEXT, 'title': _("Content context")}
    43 )
    38 )
    44 
    39 
    45 VIEW_CONTEXT_VOCABULARY = SimpleVocabulary([SimpleTerm(item['id'], title=item['title'])
    40 VIEW_CONTEXT_VOCABULARY = SimpleVocabulary([SimpleTerm(item['id'], title=item['title'])
    46                                             for item in VIEW_CONTEXTS])
    41                                             for item in VIEW_CONTEXTS])
       
    42 
       
    43 SEARCH_EXCLUDED_ITEMS = 'search.excluded'
    47 
    44 
    48 
    45 
    49 #
    46 #
    50 # Views merge modes
    47 # Views merge modes
    51 #
    48 #
    97                 required=False,
    94                 required=False,
    98                 default=1)
    95                 default=1)
    99 
    96 
   100     def get_items(self):
    97     def get_items(self):
   101         """Get iterator over items returned by selected views, using selected merger"""
    98         """Get iterator over items returned by selected views, using selected merger"""
       
    99 
       
   100     exclude_from_search = Bool(title=_("Exclude from search results"),
       
   101                                description=_("If 'yes', and if this portlet is associated with a search engine in the "
       
   102                                              "same page template, items displayed by this portlet will be excluded "
       
   103                                              "from search results"),
       
   104                                required=True,
       
   105                                default=False)