21 from pyams_content.component.theme.interfaces import IThemesTarget |
21 from pyams_content.component.theme.interfaces import IThemesTarget |
22 from pyams_content.features.preview.interfaces import IPreviewTarget |
22 from pyams_content.features.preview.interfaces import IPreviewTarget |
23 from pyams_content.features.review.interfaces import IReviewTarget |
23 from pyams_content.features.review.interfaces import IReviewTarget |
24 from pyams_content.shared.blog.interfaces import IWfBlogPost, BLOG_CONTENT_TYPE, BLOG_CONTENT_NAME, IBlogPost, \ |
24 from pyams_content.shared.blog.interfaces import IWfBlogPost, BLOG_CONTENT_TYPE, BLOG_CONTENT_NAME, IBlogPost, \ |
25 IWfBlogPostFactory |
25 IWfBlogPostFactory |
26 from pyams_portal.interfaces import IPortalContext, IPortalPage, PORTAL_PAGE_KEY |
|
27 from pyams_workflow.interfaces import IWorkflow, IWorkflowVersions, IWorkflowState |
26 from pyams_workflow.interfaces import IWorkflow, IWorkflowVersions, IWorkflowState |
28 |
27 |
29 # import packages |
28 # import packages |
30 from pyams_content.shared.common import WfSharedContent, register_content_type, SharedContent, IWfSharedContentFactory |
29 from pyams_content.shared.common import WfSharedContent, register_content_type, SharedContent, IWfSharedContentFactory |
31 from pyams_content.shared.common.portal import SharedContentPortalPage |
30 from pyams_utils.adapter import adapter_config |
32 from pyams_utils.adapter import adapter_config, get_annotation_adapter |
|
33 from zope.interface import implementer, provider |
31 from zope.interface import implementer, provider |
34 |
32 |
35 |
33 |
36 @implementer(IWfBlogPost, IParagraphContainerTarget, IThemesTarget, IIllustrationTarget, |
34 @implementer(IWfBlogPost, IParagraphContainerTarget, IThemesTarget, IIllustrationTarget, |
37 IPortalContext, IPreviewTarget, IReviewTarget) |
35 IPreviewTarget, IReviewTarget) |
38 class WfBlogPost(WfSharedContent): |
36 class WfBlogPost(WfSharedContent): |
39 """Base blog post""" |
37 """Base blog post""" |
40 |
38 |
41 content_type = BLOG_CONTENT_TYPE |
39 content_type = BLOG_CONTENT_TYPE |
42 content_name = BLOG_CONTENT_NAME |
40 content_name = BLOG_CONTENT_NAME |
58 |
56 |
59 |
57 |
60 @adapter_config(context=IWfBlogPostFactory, provides=IWfSharedContentFactory) |
58 @adapter_config(context=IWfBlogPostFactory, provides=IWfSharedContentFactory) |
61 def blog_post_content_factory(context): |
59 def blog_post_content_factory(context): |
62 return WfBlogPost |
60 return WfBlogPost |
63 |
|
64 |
|
65 @adapter_config(context=IWfBlogPost, provides=IPortalPage) |
|
66 def blog_post_portal_page_adapter(context): |
|
67 """Blog post portal page adapter""" |
|
68 return get_annotation_adapter(context, PORTAL_PAGE_KEY, SharedContentPortalPage) |
|