src/pyams_content/shared/view/interfaces/__init__.py
changeset 856 0e8c775ca958
parent 829 f933926ed0a1
child 956 a8723fffbaf6
--- a/src/pyams_content/shared/view/interfaces/__init__.py	Tue Jul 17 18:01:26 2018 +0200
+++ b/src/pyams_content/shared/view/interfaces/__init__.py	Tue Jul 17 18:01:54 2018 +0200
@@ -16,13 +16,15 @@
 # import standard library
 
 # import interfaces
-from pyams_content.shared.common.interfaces import ISharedContent, IWfSharedContent, ISharedTool
+from pyams_content.shared.common.interfaces import ISharedContent, IWfSharedContent, ISharedTool, \
+    CONTENT_TYPES_VOCABULARY
+from pyams_content.shared.common.interfaces.types import ALL_DATA_TYPES_VOCABULARY
 from pyams_sequence.interfaces import IInternalReferencesList
 
 # import packages
 from pyams_thesaurus.schema import ThesaurusTermsListField
 from zope.interface import Interface, Attribute
-from zope.schema import List, Choice, Bool, Int
+from zope.schema import List, Set, Choice, Bool, Int
 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
 
 from pyams_content import _
@@ -64,14 +66,28 @@
                                required=True,
                                default=False)
 
-    selected_content_types = List(title=_("Other content types"),
-                                  description=_("Selected content types; leave empty for all"),
-                                  value_type=Choice(vocabulary='PyAMS content types'),
-                                  required=False)
+    selected_content_types = Set(title=_("Other content types"),
+                                 description=_("Selected content types; leave empty for all"),
+                                 value_type=Choice(vocabulary=CONTENT_TYPES_VOCABULARY),
+                                 required=False)
 
     def get_content_types(self, context):
         """Get content types for given context"""
 
+    select_context_datatype = Bool(title=_("Select context data type?"),
+                                   description=_("If 'yes', content data type (if available) will be extracted from "
+                                                 "context"),
+                                   required=True,
+                                   default=False)
+
+    selected_datatypes = Set(title=_("Other data types"),
+                             description=_("Selected data types; leave empty for all"),
+                             value_type=Choice(vocabulary=ALL_DATA_TYPES_VOCABULARY),
+                             required=False)
+
+    def get_data_types(self, context):
+        """Get data types for given context"""
+
     order_by = Choice(title=_("Order by"),
                       description=_("Property to use to sort results"),
                       vocabulary=VIEW_ORDER_VOCABULARY,