# HG changeset patch # User Thierry Florac # Date 1466418289 -7200 # Node ID 48aa4de90de291a8abee9697b423b42af4e42154 # Parent ef0e560a869967b09e8519ba6e8da5122d560dbf Added base site management classes diff -r ef0e560a8699 -r 48aa4de90de2 src/pyams_content/shared/site/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/site/__init__.py Mon Jun 20 12:24:49 2016 +0200 @@ -0,0 +1,41 @@ +# +# 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_content.shared.common.interfaces import ISharedSite +from zope.schema.interfaces import IVocabularyFactory + +# import packages +from pyams_utils.container import BTreeOrderedContainer +from zope.componentvocabulary.vocabulary import UtilityVocabulary +from zope.interface import provider, implementer +from zope.schema.vocabulary import getVocabularyRegistry + + +@implementer(ISharedSite) +class SharedSite(BTreeOrderedContainer): + """Shared site persistent class""" + + +@provider(IVocabularyFactory) +class SharedSiteVocabulary(UtilityVocabulary): + """Shared sites vocabulary""" + + interface = ISharedSite + nameOnly = True + +getVocabularyRegistry().register('PyAMS shared sites', SharedSiteVocabulary) diff -r ef0e560a8699 -r 48aa4de90de2 src/pyams_content/shared/site/interfaces/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/site/interfaces/__init__.py Mon Jun 20 12:24:49 2016 +0200 @@ -0,0 +1,20 @@ +# +# 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 + +# import packages diff -r ef0e560a8699 -r 48aa4de90de2 src/pyams_content/shared/site/zmi/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/shared/site/zmi/__init__.py Mon Jun 20 12:24:49 2016 +0200 @@ -0,0 +1,20 @@ +# +# 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 + +# import packages diff -r ef0e560a8699 -r 48aa4de90de2 src/pyams_content/site/__init__.py --- a/src/pyams_content/site/__init__.py Mon Jun 20 12:24:28 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +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_content.site.interfaces import ISite -from zope.schema.interfaces import IVocabularyFactory - -# import packages -from pyams_utils.container import BTreeOrderedContainer -from zope.componentvocabulary.vocabulary import UtilityVocabulary -from zope.interface import provider, implementer -from zope.schema.vocabulary import getVocabularyRegistry - - -@implementer(ISite) -class Site(BTreeOrderedContainer): - """Site persistent class""" - - -@provider(IVocabularyFactory) -class SiteVocabulary(UtilityVocabulary): - """Sites vocabulary""" - - interface = ISite - nameOnly = True - -getVocabularyRegistry().register('PyAMS content sites', SiteVocabulary) diff -r ef0e560a8699 -r 48aa4de90de2 src/pyams_content/site/interfaces/__init__.py --- a/src/pyams_content/site/interfaces/__init__.py Mon Jun 20 12:24:28 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +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 - -# import packages -from zope.interface import Interface - - -class ISite(Interface): - """Site interface"""