--- a/src/pyams_portal/interfaces/__init__.py Wed Jun 20 14:39:23 2018 +0200
+++ b/src/pyams_portal/interfaces/__init__.py Wed Jun 20 18:13:19 2018 +0200
@@ -159,6 +159,9 @@
target_interface = Attribute("Target interface provided by this renderer")
+PORTLET_RENDERER_SETTINGS_KEY = 'pyams_portal.renderer.settings::{0}'
+
+
class IPortletRendererSettings(Interface):
"""Portlet renderer settings interface"""
--- a/src/pyams_portal/portlet.py Wed Jun 20 14:39:23 2018 +0200
+++ b/src/pyams_portal/portlet.py Wed Jun 20 18:13:19 2018 +0200
@@ -23,7 +23,7 @@
from pyams_form.interfaces.form import IFormContextPermissionChecker
from pyams_portal.interfaces import IPortlet, IPortletSettings, IPortletConfiguration, IPortletPreviewer, \
IPortletRenderer, IPortalPortletsConfiguration, IPortalTemplate, IPortalContext, IPortalPage, \
- IPortalTemplateConfiguration, MANAGE_TEMPLATE_PERMISSION, IPortletRendererSettings
+ IPortalTemplateConfiguration, MANAGE_TEMPLATE_PERMISSION, IPortletRendererSettings, PORTLET_RENDERER_SETTINGS_KEY
from zope.traversing.interfaces import ITraversable
# import packages
@@ -169,7 +169,10 @@
"""Portlet renderer adapter"""
settings_interface = None
- settings_key = None
+
+ @property
+ def settings_key(self):
+ return PORTLET_RENDERER_SETTINGS_KEY.format(self.settings.renderer)
target_interface = None
@@ -182,6 +185,10 @@
slot_id, slot_name = config.get_portlet_slot(self.settings.configuration.portlet_id)
return config.get_slot_configuration(slot_name)
+ @property
+ def renderer_settings(self):
+ return IPortletRendererSettings(self.settings)
+
@vocabulary_config(name='PyAMS portlet renderers')
class PortletRenderersVocabulary(SimpleVocabulary):