src/pyams_content/shared/common/portlet/content/zmi/__init__.py
branchdev-dc
changeset 934 437971f8a969
parent 933 b53fe7dcb4a0
parent 930 814f7c5e04d1
child 935 8a7ec586dce1
equal deleted inserted replaced
933:b53fe7dcb4a0 934:437971f8a969
     1 #
       
     2 # Copyright (c) 2008-2018 Thierry Florac <tflorac AT ulthar.net>
       
     3 # All Rights Reserved.
       
     4 #
       
     5 # This software is subject to the provisions of the Zope Public License,
       
     6 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
       
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
       
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
       
    10 # FOR A PARTICULAR PURPOSE.
       
    11 #
       
    12 
       
    13 __docformat__ = 'restructuredtext'
       
    14 
       
    15 
       
    16 # import standard library
       
    17 
       
    18 # import interfaces
       
    19 from pyams_content.shared.common.portlet.content.interfaces import ISharedContentPortletSettings
       
    20 from pyams_pagelet.interfaces import IPagelet
       
    21 from pyams_portal.interfaces import IPortletPreviewer
       
    22 from pyams_skin.layer import IPyAMSLayer
       
    23 from pyams_utils.interfaces import VIEW_SYSTEM_PERMISSION
       
    24 
       
    25 # import packages
       
    26 from pyams_form.form import AJAXEditForm
       
    27 from pyams_pagelet.pagelet import pagelet_config
       
    28 from pyams_portal.portlet import PortletPreviewer
       
    29 from pyams_portal.zmi.portlet import PortletSettingsEditor
       
    30 from pyams_template.template import template_config
       
    31 from pyams_utils.adapter import adapter_config
       
    32 from zope.interface import Interface
       
    33 
       
    34 
       
    35 @pagelet_config(name='properties.html', context=ISharedContentPortletSettings, layer=IPyAMSLayer,
       
    36                 permission=VIEW_SYSTEM_PERMISSION)
       
    37 class SharedContentPortletSettingsEditor(PortletSettingsEditor):
       
    38     """Shared content portlet settings editor"""
       
    39 
       
    40     settings = ISharedContentPortletSettings
       
    41 
       
    42 
       
    43 @adapter_config(name='properties.json', context=(ISharedContentPortletSettings, IPyAMSLayer), provides=IPagelet)
       
    44 class SharedContentPortletConfigurationAJAXEditor(AJAXEditForm, SharedContentPortletSettingsEditor):
       
    45     """Shared content portlet settings editor, JSON renderer"""
       
    46 
       
    47 
       
    48 @adapter_config(context=(Interface, IPyAMSLayer, Interface, ISharedContentPortletSettings),
       
    49                 provides=IPortletPreviewer)
       
    50 @template_config(template='preview.pt', layer=IPyAMSLayer)
       
    51 class SharedContentPortletPreviewer(PortletPreviewer):
       
    52     """Shared content portlet previewer"""