1 | from zope import interface, schema |
---|
2 | from zope.schema import vocabulary |
---|
3 | |
---|
4 | from Products.CMFCore.utils import getToolByName |
---|
5 | from quintagroup.mobileextender import mobileextenderMessageFactory as _ |
---|
6 | |
---|
7 | try: |
---|
8 | from plone.app import vocabularies |
---|
9 | except: |
---|
10 | PT_VOCABULARY = "quintagroup.mobileextender.ptypes" |
---|
11 | WF_VOCABULARY = "quintagroup.mobileextender.wfstates" |
---|
12 | else: |
---|
13 | PT_VOCABULARY = "plone.app.vocabularies.PortalTypes" |
---|
14 | WF_VOCABULARY = "plone.app.vocabularies.WorkflowStates" |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | class IMobileConfiglet(interface.Interface): |
---|
19 | """A portlet which can render a classic Plone portlet macro |
---|
20 | """ |
---|
21 | |
---|
22 | path = schema.TextLine( |
---|
23 | title=_(u"label_path", default=u"Path"), |
---|
24 | description=_(u"help_path", |
---|
25 | default=u"The Physical path for objects found. " |
---|
26 | "Leave blank to ignore this criterion."), |
---|
27 | default=u"", |
---|
28 | required=False, |
---|
29 | ) |
---|
30 | ptypes = schema.List( |
---|
31 | title=_(u'Portal Types'), |
---|
32 | description=_(u"You may search for and choose portal type(s) " |
---|
33 | "of object(s) to find. Leave blank to ignore this criterion."), |
---|
34 | default=[], |
---|
35 | value_type = schema.Choice( title=u"ptypes", source=PT_VOCABULARY ), |
---|
36 | required=False, |
---|
37 | ) |
---|
38 | wfstates = schema.List( |
---|
39 | title=_(u'Workflow States'), |
---|
40 | description=_(u"You may search for and choose workflow review state(s) " |
---|
41 | "of object(s) to find. Leave blank to ignore this criterion."), |
---|
42 | default=[], |
---|
43 | value_type = schema.Choice( title=u"review_states", source=WF_VOCABULARY ), |
---|
44 | required=False, |
---|
45 | ) |
---|
46 | excludeids = schema.Text( |
---|
47 | title=_(u'Exclude Ids'), |
---|
48 | description=_(u"List ids, for exclude from mobile content marking. Ids must be separated " |
---|
49 | "by new line. Leave blank to ignore this criterion."), |
---|
50 | default=u"", |
---|
51 | #value_type = schema.TextLine(), |
---|
52 | required=False |
---|
53 | ) |
---|
54 | excludepaths = schema.Text( |
---|
55 | title=_(u'Exclude by Physical Paths'), |
---|
56 | description=_(u"All objects, which physical path starts with one of specified one - will " |
---|
57 | "be excluded from mobile content marking. Paths must start with portal id " |
---|
58 | "(as in 'Path' field), and seaprated by new line. Leave blank to ignore this criterion."), |
---|
59 | default=u"", |
---|
60 | required=False |
---|
61 | ) |
---|
62 | #sorton = schema.Choice( |
---|
63 | #title=_(u'Sort index'), |
---|
64 | #description=_(u"Check sort index."), |
---|
65 | #vocabulary = "quintagroup.mobileextender.sortindices", |
---|
66 | #default='', |
---|
67 | #required=False |
---|
68 | #) |
---|
69 | |
---|
70 | #@interface.invariant |
---|
71 | #def checkForACriterion(formdata): |
---|
72 | #if not formdata.ptypes \ |
---|
73 | #and not formdata.path: |
---|
74 | #raise interface.Invalid("Path of portal type(s) must be entered") |
---|