8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
10 # FOR A PARTICULAR PURPOSE. |
10 # FOR A PARTICULAR PURPOSE. |
11 # |
11 # |
12 |
12 |
13 __docformat__ = 'restructuredtext' |
|
14 |
|
15 from collections import OrderedDict |
13 from collections import OrderedDict |
16 |
14 |
17 from zope.interface import Attribute, Interface |
15 from zope.interface import Attribute, Interface |
18 from zope.schema import Bool, Choice, Int, Set |
16 from zope.schema import Bool, Choice, Int, Set |
19 from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary |
17 from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary |
20 |
18 |
21 from pyams_content import _ |
|
22 from pyams_content.shared.common.interfaces import ISharedContent, ISharedTool, IWfSharedContent, \ |
19 from pyams_content.shared.common.interfaces import ISharedContent, ISharedTool, IWfSharedContent, \ |
23 SHARED_CONTENT_TYPES_VOCABULARY |
20 SHARED_CONTENT_TYPES_VOCABULARY |
24 from pyams_content.shared.common.interfaces.types import ALL_DATA_TYPES_VOCABULARY |
21 from pyams_content.shared.common.interfaces.types import ALL_DATA_TYPES_VOCABULARY |
25 from pyams_sequence.interfaces import IInternalReferencesList |
22 from pyams_sequence.interfaces import IInternalReferencesList |
26 from pyams_sequence.schema import InternalReferencesListField |
23 from pyams_sequence.schema import InternalReferencesListField |
27 from pyams_thesaurus.schema import ThesaurusTermsListField |
24 from pyams_thesaurus.schema import ThesaurusTermsListField |
|
25 |
|
26 |
|
27 __docformat__ = 'restructuredtext' |
|
28 |
|
29 from pyams_content import _ |
28 |
30 |
29 |
31 |
30 VIEW_CONTENT_TYPE = 'view' |
32 VIEW_CONTENT_TYPE = 'view' |
31 VIEW_CONTENT_NAME = _('View') |
33 VIEW_CONTENT_NAME = _('View') |
32 |
34 |
271 default=False) |
273 default=False) |
272 |
274 |
273 themes = ThesaurusTermsListField(title=_("Other themes"), |
275 themes = ThesaurusTermsListField(title=_("Other themes"), |
274 required=False) |
276 required=False) |
275 |
277 |
|
278 include_subthemes = Bool(title=_("Include all subthemes?"), |
|
279 description=_("If 'yes', subthemes of selected themes will also " |
|
280 "be used to search contents"), |
|
281 required=False, |
|
282 default=False) |
|
283 |
276 def get_themes(self, context): |
284 def get_themes(self, context): |
277 """Get all themes for given context""" |
285 """Get all themes for given context""" |
278 |
286 |
279 def get_themes_index(self, context): |
287 def get_themes_index(self, context): |
280 """Get all themes index values for given context""" |
288 """Get all themes index values for given context""" |