|
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 from persistent import Persistent |
|
16 from zope.interface import implementer |
|
17 from zope.schema.fieldproperty import FieldProperty |
|
18 |
|
19 from pyams_content.component.extfile.interfaces import EXTFILE_MANAGER_INFO_KEY, IExtFileManagerInfo |
|
20 from pyams_content.root import ISiteRoot |
|
21 from pyams_utils.adapter import adapter_config, get_annotation_adapter |
|
22 |
|
23 |
|
24 @implementer(IExtFileManagerInfo) |
|
25 class ExtFileManagerInfo(Persistent): |
|
26 """external files manager settings""" |
|
27 |
|
28 default_title_prefix = FieldProperty(IExtFileManagerInfo['default_title_prefix']) |
|
29 |
|
30 |
|
31 @adapter_config(context=ISiteRoot, provides=IExtFileManagerInfo) |
|
32 def site_root_extfile_manager_info_factory(context): |
|
33 return get_annotation_adapter(context, EXTFILE_MANAGER_INFO_KEY, ExtFileManagerInfo) |