src/pyams_content/shared/view/__init__.py
changeset 81 3e37d4dd8e3b
child 92 3facc843c06f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content/shared/view/__init__.py	Tue Jun 06 17:11:11 2017 +0200
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import interfaces
+from pyams_content.component.links.interfaces import ILinkContainerTarget
+from pyams_content.shared.view.interfaces import IWfView, IView, VIEW_CONTENT_TYPE, VIEW_CONTENT_NAME
+
+# import packages
+from pyams_content.shared.common import WfSharedContent, register_content_type, SharedContent
+from zope.interface import implementer
+from zope.schema.fieldproperty import FieldProperty
+
+
+@implementer(IWfView)
+class WfView(WfSharedContent):
+    """Base view"""
+
+    content_type = VIEW_CONTENT_TYPE
+    content_name = VIEW_CONTENT_NAME
+
+    selected_content_types = FieldProperty(IWfView['selected_content_types'])
+    order_by = FieldProperty(IWfView['order_by'])
+    reversed_order  =FieldProperty(IWfView['reversed_order'])
+
+register_content_type(WfView)
+
+
+@implementer(IView)
+class View(SharedContent):
+    """Workflow managed view class"""
+
+    content_class = WfView