diff -r 1fe028e17f70 -r 34e6d07ea2e9 src/pyams_content/component/theme/interfaces/__init__.py --- a/src/pyams_content/component/theme/interfaces/__init__.py Mon Nov 05 13:20:10 2018 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -# -# Copyright (c) 2008-2015 Thierry Florac -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. -# - -__docformat__ = 'restructuredtext' - - -# import standard library - -# import interfaces -from pyams_thesaurus.interfaces.thesaurus import IThesaurusContextManager, IThesaurusContextManagerTarget - -# import packages -from pyams_sequence.schema import InternalReferenceField -from pyams_thesaurus.schema import ThesaurusTermsListField -from zope.interface import Interface, invariant, Invalid -from zope.schema import Bool - -from pyams_content import _ - - -# -# Tags management -# - -TAGS_MANAGER_KEY = 'pyams_content.tags.manager' -TAGS_INFO_KEY = 'pyams_content.tags.info' - - -class ITagsManager(IThesaurusContextManager): - """Tags manager interface""" - - enable_tags_search = Bool(title=_("Enable search by tag?"), - description=_("If 'yes', displayed tags will lead to a search engine " - "displaying contents matching given tag"), - required=True, - default=False) - - tags_search_target = InternalReferenceField(title=_("Tags search target"), - description=_("Site or folder where tags search is displayed"), - required=False) - - @invariant - def check_search_target(self): - if self.enable_tags_search and not self.tags_search_target: - raise Invalid(_("You must specify search target when activating search by tags!")) - - -class ITagsManagerTarget(IThesaurusContextManagerTarget): - """Marker interface for tags manager""" - - -class ITagsInfo(Interface): - """Tags information interface""" - - tags = ThesaurusTermsListField(title=_("Tags"), - required=False) - - -class ITagsTarget(Interface): - """Tags target interface""" - - -PORTLET_SETTINGS_TAGS_KEY = 'pyams_content.portlet.tags.settings' - - -class IPortletTagsSettings(Interface): - """Interface for portlet settings managing tags""" - - tags = ThesaurusTermsListField(title=_("Tags"), - required=False) - - -class IPortletTagsSettingsTarget(Interface): - """Marker interface for portlet settings managing tags""" - - -# -# Themes management -# - -THEMES_MANAGER_KEY = 'pyams_content.themes.manager' -THEMES_INFO_KEY = 'pyams_content.themes.info' - - -class IThemesManager(IThesaurusContextManager): - """Themes manager interface""" - - -class IThemesManagerTarget(IThesaurusContextManagerTarget): - """Marker interface for tools managing themes""" - - -class IThemesInfo(Interface): - """Themes information interface""" - - themes = ThesaurusTermsListField(title=_("Themes"), - required=False) - - -class IThemesTarget(Interface): - """Themes target interface""" - - -PORTLET_SETTINGS_THEMES_KEY = 'pyams_content.portlet.themes.settings' - - -class IPortletThemesSettings(Interface): - """Interface for portlet settings managing themes""" - - themes = ThesaurusTermsListField(title=_("Themes"), - required=False) - - -class IPortletThemesSettingsTarget(Interface): - """Marker interface for portlet settings managing themes""" - - -# -# Collections management -# - -COLLECTIONS_MANAGER_KEY = 'pyams_content.collections.manager' -COLLECTIONS_INFO_KEY = 'pyams_content.collections.info' - - -class ICollectionsManager(IThesaurusContextManager): - """Collections manager interface""" - - -class ICollectionsManagerTarget(IThesaurusContextManagerTarget): - """Marker interface for tools managing collections""" - - -class ICollectionsInfo(Interface): - """Collections information interface""" - - collections = ThesaurusTermsListField(title=_("Collections"), - required=False) - - -class ICollectionsTarget(Interface): - """Collections target interface""" - - -PORTLET_SETTINGS_COLLECTIONS_KEY = 'pyams_content.portlet.collections.settings' - - -class IPortletCollectionsSettings(Interface): - """Interface for portlet settings managing collections""" - - collections = ThesaurusTermsListField(title=_("Collections"), - required=False) - - -class IPortletCollectionsSettingsTarget(Interface): - """Marker interface for portlet settings managing collections"""