1 # |
|
2 # Copyright (c) 2008-2016 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 zope.container.constraints import containers, contains |
|
16 from zope.container.interfaces import IContainer |
|
17 from zope.interface import Attribute, Interface |
|
18 from zope.schema import Text |
|
19 |
|
20 from pyams_content.shared.common.interfaces import ISharedSite, IBaseSharedTool, ISharedContent, \ |
|
21 IDeletableElement, IWfSharedContentPortalContext |
|
22 from pyams_i18n.schema import I18nTextField |
|
23 from pyams_sequence.interfaces import ISequentialIdTarget |
|
24 from pyams_workflow.interfaces import IWorkflowPublicationSupport |
|
25 |
|
26 from pyams_content import _ |
|
27 |
|
28 |
|
29 BLOG_CONTENT_TYPE = 'blog' |
|
30 BLOG_CONTENT_NAME = _("Blog post") |
|
31 |
|
32 |
|
33 class IWfBlogPost(IWfSharedContentPortalContext): |
|
34 """Blog topic interface""" |
|
35 |
|
36 |
|
37 class IWfBlogPostFactory(Interface): |
|
38 """Blog post factory interface""" |
|
39 |
|
40 |
|
41 class IBlogPost(ISharedContent, IDeletableElement): |
|
42 """Workflow managed blog post interface""" |
|
43 |
|
44 containers('.IBlogFolder') |
|
45 |
|
46 |
|
47 class IBlogFolder(IContainer, IDeletableElement): |
|
48 """Blog folder interface""" |
|
49 |
|
50 containers('.IBlogManager', '.IBlogFolder') |
|
51 contains('.IBlogFolder', '.IBlogPost') |
|
52 |
|
53 |
|
54 class IBlogFolderFactory(Interface): |
|
55 """Blog folder factory interface""" |
|
56 |
|
57 |
|
58 class IBlogManager(ISharedSite, IBaseSharedTool, IWorkflowPublicationSupport, IDeletableElement, ISequentialIdTarget): |
|
59 """Blog manager interface""" |
|
60 |
|
61 contains(IBlogFolder) |
|
62 |
|
63 folder_factory = Attribute("Blog folder factory") |
|
64 |
|
65 topic_content_type = Attribute("Topic content type") |
|
66 topic_content_factory = Attribute("Topic content factory") |
|
67 |
|
68 description = I18nTextField(title=_("Meta-description"), |
|
69 description=_("The blog's description is 'hidden' into HTML's page headers; but it " |
|
70 "can be seen, for example, in some search engines results as content's " |
|
71 "description; if description is empty, content's header will be used."), |
|
72 required=False) |
|
73 |
|
74 notepad = Text(title=_("Notepad"), |
|
75 description=_("Internal information to be known about this content"), |
|
76 required=False) |
|
77 |
|
78 |
|
79 class IBlogManagerFactory(Interface): |
|
80 """Blog manager factory interface""" |
|