Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions news/1050.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Add deprecation warnings to all BBB controlpanel adapters.
Use ``registry.forInterface(ISchema, prefix="plone")`` instead.
@jensens
9 changes: 9 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/editing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@
from zope.component import getUtility
from zope.interface import implementer

import warnings


@adapter(IPloneSiteRoot)
@implementer(IEditingSchema)
class EditingControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated. "
"Use registry.forInterface(plone.base.interfaces.IEditingSchema, prefix='plone') instead. "
"It will be removed in Plone 7.",
DeprecationWarning,
stacklevel=2,
)
registry = getUtility(IRegistry)
self.settings = registry.forInterface(IEditingSchema, prefix="plone")

Expand Down
9 changes: 9 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@
from zope.component import getUtility
from zope.interface import implementer

import warnings


@adapter(IPloneSiteRoot)
@implementer(IFilterSchema)
class FilterControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated. "
"Use registry.forInterface(plone.base.interfaces.IFilterSchema, prefix='plone') instead. "
"It will be removed in Plone 7.",
DeprecationWarning,
stacklevel=2,
)
registry = getUtility(IRegistry)
self.settings = registry.forInterface(IFilterSchema, prefix="plone")

Expand Down
9 changes: 9 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@
from zope.component import getUtility
from zope.interface import implementer

import warnings


@adapter(IPloneSiteRoot)
@implementer(ILanguageSchema)
class LanguageControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated. "
"Use registry.forInterface(plone.base.interfaces.ILanguageSchema, prefix='plone') instead. "
"It will be removed in Plone 7.",
DeprecationWarning,
stacklevel=2,
)
self.context = context
registry = getUtility(IRegistry)
self.settings = registry.forInterface(ILanguageSchema, prefix="plone")
Expand Down
9 changes: 9 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@
from zope.component.hooks import getSite
from zope.interface import implementer

import warnings


@adapter(IPloneSiteRoot)
@implementer(IMailSchema)
class MailControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated. "
"Use registry.forInterface(plone.base.interfaces.IMailSchema, prefix='plone') instead. "
"It will be removed in Plone 7.",
DeprecationWarning,
stacklevel=2,
)
self.context = context
self.portal = getSite()
registry = getUtility(IRegistry)
Expand Down
9 changes: 9 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@
from zope.component import getUtility
from zope.interface import implementer

import warnings


@adapter(IPloneSiteRoot)
@implementer(IMaintenanceSchema)
class MaintenanceControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated. "
"Use registry.forInterface(plone.base.interfaces.IMaintenanceSchema, prefix='plone') instead. "
"It will be removed in Plone 7.",
DeprecationWarning,
stacklevel=2,
)
self.context = context
registry = getUtility(IRegistry)
self.maintenance_settings = registry.forInterface(
Expand Down
9 changes: 9 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/markup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@
from zope.component import getUtility
from zope.interface import implementer

import warnings


@adapter(IPloneSiteRoot)
@implementer(IMarkupSchema)
class MarkupControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated. "
"Use registry.forInterface(plone.base.interfaces.IMarkupSchema, prefix='plone') instead. "
"It will be removed in Plone 7.",
DeprecationWarning,
stacklevel=2,
)
registry = getUtility(IRegistry)
self.settings = registry.forInterface(IMarkupSchema, prefix="plone")

Expand Down
8 changes: 8 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@
from zope.component import getUtility
from zope.interface import implementer

import warnings


@adapter(IPloneSiteRoot)
@implementer(INavigationSchema)
class NavigationControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated."
"Use registry record plone.base.interfaces.INavigationSchema instead."
"It will be removed in Plone 6.1",
DeprecationWarning,
)
self.context = context
registry = getUtility(IRegistry)
self.navigation_settings = registry.forInterface(
Expand Down
9 changes: 9 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@
from zope.component.hooks import getSite
from zope.interface import implementer

import warnings


@adapter(IPloneSiteRoot)
@implementer(ISearchSchema)
class SearchControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated. "
"Use registry.forInterface(plone.base.interfaces.ISearchSchema, prefix='plone') instead. "
"It will be removed in Plone 7.",
DeprecationWarning,
stacklevel=2,
)
self.portal = getSite()
registry = getUtility(IRegistry)
self.search_settings = registry.forInterface(ISearchSchema, prefix="plone")
Expand Down
9 changes: 9 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@
from zope.component.hooks import getSite
from zope.interface import implementer

import warnings


@adapter(IPloneSiteRoot)
@implementer(ISecuritySchema)
class SecurityControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated. "
"Use registry.forInterface(plone.base.interfaces.ISecuritySchema, prefix='plone') instead. "
"It will be removed in Plone 7.",
DeprecationWarning,
stacklevel=2,
)
self.portal = getSite()
self.pmembership = getToolByName(context, "portal_membership")
registry = getUtility(IRegistry)
Expand Down
9 changes: 9 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@
from zope.interface import implementer
from zope.schema.fieldproperty import FieldProperty

import warnings


@adapter(IPloneSiteRoot)
@implementer(ISiteSchema)
class SiteControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated. "
"Use registry.forInterface(plone.base.interfaces.ISiteSchema, prefix='plone') instead. "
"It will be removed in Plone 7.",
DeprecationWarning,
stacklevel=2,
)
registry = getUtility(IRegistry)
self.settings = registry.forInterface(ISiteSchema, prefix="plone")

Expand Down
9 changes: 9 additions & 0 deletions src/Products/CMFPlone/controlpanel/bbb/usergroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@
from zope.component.hooks import getSite
from zope.interface import implementer

import warnings


@adapter(IPloneSiteRoot)
@implementer(IUserGroupsSettingsSchema)
class UserGroupsSettingsControlPanelAdapter:
def __init__(self, context):
warnings.warn(
f"Usage of bbb controlpanel '{self.__class__.__name__}' is deprecated. "
"Use registry.forInterface(plone.base.interfaces.IUserGroupsSettingsSchema, prefix='plone') instead. "
"It will be removed in Plone 7.",
DeprecationWarning,
stacklevel=2,
)
self.context = context
self.portal = getSite()
registry = getUtility(IRegistry)
Expand Down
Loading