File: interfaces.py

package info (click to toggle)
zope-cmfplone 2.5.1-4etch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 7,752 kB
  • ctags: 5,237
  • sloc: python: 28,264; xml: 3,723; php: 129; makefile: 99; sh: 2
file content (425 lines) | stat: -rw-r--r-- 12,939 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
from zope.interface import Interface, Attribute


class IDefaultPage(Interface):

    def isDefaultPage(obj):
        """Finds out if the given obj is the default page for the
        adapted object.
        """

    def getDefaultPage():
        """Returns the id of the default page for the adapted object.
        """

class INavigationQueryBuilder(Interface):
    """An object which returns a catalog query when called"""
    def __call__():
        """Returns a mapping describing a catalog query used to build a
           navigation structure.
        """

class INavtreeStrategy(Interface):

    rootPath = Attribute("The path to the root of the navtree (None means use portal root)")

    showAllParents = Attribute("Whether or not to show all parents of the current context always")

    def nodeFilter(node):
        """Return True or False to determine whether to include the given node
        in the tree. Nodes are dicts with at least one key - 'item', the
        catalog brain of the object the node represents.
        """

    def subtreeFilter(node):
        """Return True or False to determine whether to expand the given
        (folderish) node
        """

    def decoratorFactory(node):
        """Inject any additional keys in the node that are needed and return
        the new node.
        """

class INavigationBreadcrumbs(Interface):

    def breadcrumbs():
        """Breadcrumbs for Navigation.
        """

class INavigationTabs(Interface):

    def topLevelTabs(actions=None, category='portal_tabs'):
        """Top level tabs
        """

class INavigationTree(Interface):

    def navigationTreeRootPath():
        """Get the path to the root of the navigation tree
        """

    def navigationTree():
        """Navigation tree
        """

class ISiteMap(Interface):

    def siteMap():
        """Site map
        """

class INavigationRoot(Interface):
    """A marker interface for signaling the navigation root.
    """

class INavigationPortlet(Interface):
    """Interface for portlet to display navigation tree"""

    def title():
        """The title of the navigation portlet (may be '' to fall back on default)"""

    def display():
        """Whether or not the navtree should be displayed"""

    def includeTop():
        """Whether or not to include the root element in the tree"""

    def navigationRoot():
        """Get the root object"""

    def rootTypeName():
        """Get a normalized content type name for the root object"""

    def createNavTree():
        """Build the actual tree"""

    def isPortalOrDefaultChild():
        """Determine if the context is the portal or a default-document"""

class INewsPortlet(Interface):
    """Interface for portlet to display recent news items"""

    def published_news_items():
        """Returns 5 most recently published News Items in reverse
           chronological order
        """

    def all_news_link():
        """Returns URL, relative to the portal, of a page that display all
           published News Items
        """


class IEventsPortlet(Interface):
    """Interface for portlet to display recent news items"""

    def published_events():
        """Returns 5 most recently published News Items in reverse
           chronological order
        """

    def all_events_link():
        """Returns URL, relative to the portal, of a page that display all
           published News Items
        """

    def prev_events_link():
        """Returns URL, relative to the portal, of a page that display all
           past events.
        """


class IRecentPortlet(Interface):
    """Interface for portlet to display recently modified items"""

    def results():
        """Get the list of recently modified items"""


class ICalendarPortlet(Interface):

    def DateTime():
        """ """

    def current():
        """ """

    def current_day():
        """ """

    def nextYearMax():
        """ """

    def prevYearMin():
        """ """

    def year():
        """ """

    def month():
        """ """

    def prevMonthTime():
        """ """

    def nextMonthTime():
        """ """

    def weeks():
        """ """

    def showStates():
        """ """

    def showPrevMonth():
        """ """

    def showNextMonth():
        """ """

    def getYearAndMonthToDisplay():
        """ """

    def getPreviousMonth(month, year):
        """ """

    def getNextMonth(month, year):
        """ """

    def getWeekdays(self):
        """Returns a list of Messages for the weekday names."""

    def getEnglishMonthName(self, month):
        """Returns the English month name."""

    def getMonthName(self, month):
        """Returns the month name as a Message."""

    def isToday(self, day):
        """Returns True if the given day and the current month and year equals
           today, otherwise False.
        """


class ISitemapView(Interface):
    """Interface to the view that creates a site map"""

    def createSiteMap():
        """Create the site map data structure"""


class IPlone(Interface):
    """ """


    def globalize():
        """ A method which puts all of the following view attributes into the
            globals of the current tal expression context (plus the
            toLocalizedTime method):

    portal = Attribute("The portal object itself")

    portal_url = Attribute("The portal url")

    mtool = Attribute("The portal_membership tool")

    putils = Attribute("The plone_utils tool (PloneTool)")

    wtool = Attribute("The portal_workflow tool")

    ifacetool = Attribute("The portal_interface tool")

    syntool = Attribute("The portal_syndication tool")

    portal_title = Attribute("The title of the portal")

    object_title = Attribute("The title of the current object (context)")

    member = Attribute("The member object for the authenticated user in "
                       "context")

    checkPermission = Attribute("The checkPermission method of the membership"
                                " tool")

    membersfolder = Attribute("The portal's Members folder")

    isAnon = Attribute("Boolean indicating whether the current user is "
                       "anonymous")

    actions = Attribute("The result of listFilteredActionsFor(context) in the "
                        "portal_actions tool")

    keyed_actions = Attribute("A mapping of action categories to action ids "
                              "to action information: "
                              "mapping[cat][id] == actioninfo")

    user_actions = Attribute("Actions in the user category")

    workflow_actions = Attribute("Actions in the workflow category")

    folder_actions = Attribute("Actions in the folder category")

    global_actions = Attribute("Actions in the global category")

    portal_tabs = Attribute("The actions for the portal tabs")

    wf_state = Attribute("The review_state of the current object")

    portal_properties = Attribute("The portal_properties tool")

    site_properties = Attribute("The site_properties tool")

    ztu = Attribute("The ZTUtils module")

    isFolderish = Attribute("A boolean indicating whether the object is "
                            "folderish")

    slots_mapping = Attribute("A mapping containing a list of macros or "
                              "expressions for each slot")

    here_url = Attribute("The url of the current object")

    sl = Attribute("The elements in the left slot")

    sr = Attribute("The elements in the right slot")

    default_language = Attribute("The default language of the portal")

    language = Attribute("The language of the current request or context.")

    is_editable = Attribute("A boolean indicating if the current user has "
                            " edit permissions in this context")

    isLocked = Attribute("A boolean indicating that the object is webdav "
                         "locked")

    isRTL = Attribute("A boolean indicating that the current language is a "
                      "right-to-left language.")

    visible_ids = Attribute("A boolean indicating whether to show object ids "
                            "to the current user")

    current_page_url = Attribute("The full url with query string")

    isContextDefaultPage = Attribure("Boolean idicating that the context is "
                                     "the default page of its parent folder.")

    isStructuralFolder = Attribute("Boolean indicating that the context is a "
                                   "'Structural Folder'.")

    Iterator = Attribute("A factory for generating sinple integer Iterators.")

    tabindex = Attribute("An iterator for use in creating tabindexes.")

    uniqueItemIndex = Attribute("An iterator for help inc reading unique "
                                "html ids.")

    # BBB: deprecated elements
    utool = Attribute("The portal_url tool")
    portal_object = Attribute("A deprecated spelling of portal")
    atool = Attribute("The portal_actions tool")
    aitool = Attribute("The portal_actionicons tool")
    gtool = Attribute("The portal_groups tool")
    gdtool = Attribute("The portal_groupdata tool")
    wf_actions = Attribute("A deprecated variant of workflow_actions")
    hidecolumns = Attribute("The css class to use for the column container"
                            "which determines which columns to show")
    isEditable = Attribute("A deprecated spelling of is_editable")
    lockable = Attribute("A boolean indicating that the object capable of"
                             " being webdav locked")
    """

    def getCurrentUrl():
        """ Returns the actual url plus the query string. """

    def keyFilteredActions(actions=None):
        """ Returns a mapping of action categories to action ids to action
            information: mapping[cat][id] == actioninfo

            Optionally takes an action list, if ommitted it will be calculated
        """

    def visibleIdsEnabled():
        """Determines whether to show object ids based on portal and user
           settings.
        """

    def isRightToLeft(domain='plone'):
        """Is the currently selected language a right to left language"""

    def toLocalizedTime(time, long_format=None):
        """ The time parameter must be either a string that is suitable for
            initializing a DateTime or a DateTime object. Returns a localized
            string.
        """

    def isDefaultPageInFolder():
        """ Returns a boolean indicating whether the current context is the
            default page of its parent folder.
        """

    def isStructuralFolder():
        """Checks if a given object is a "structural folder".

        That is, a folderish item which does not explicitly implement
        INonStructuralFolder to declare that it doesn't wish to be treated
        as a folder by the navtree, the tab generation etc.
        """

    def hide_columns(self, column_left, column_right):
        """ Returns the CSS class used by the page layout hide empty
            portlet columns.
        """

    def navigationRootPath():
        """Get the current navigation root path
        """

    def navigationRootUrl():
        """Get the url to the current navigation root
        """

    def getParentObject():
        """Returns the parent of the current object, equivalent to
           aq_inner(aq_parent(context)), or context.aq_inner.getParentNode()
        """

    def getCurrentFolder():
        """If the context is the default page of a folder or is not itself a
           folder, the parent is returned, otherwise the object itself is
           returned.  This is useful for providing a context for methods
           which wish to act on what is considered the current folder in the
           ui.
        """

    def getCurrentFolderUrl():
        """Returns the URL of the current folder as determined by
           self.getCurrentFolder(), used heavily in actions.
        """

    def getCurrentObjectUrl():
        """Returns the URL of the current object unless that object is a
           folder default page, in which case it returns the parent.
        """

    def isFolderOrFolderDefaultPage():
        """Returns true only if the current object is either a folder (as
           determined by isStructuralFolder) or the default page in context.
        """

    def isPortalOrPortalDefaultPage():
        """Returns true only if the current object is either the portal object
           or the default page of the portal.
        """

    def getViewTemplateId():
        """Returns the template Id corresponding to the default view method of
           the context object.
        """

    def displayContentsTab():
        """Returns true if the contents tab should be displayed in the current
           context.  Evaluates whether the object is a folder or the default
           page of a folder, and checks if the user has relevant permissions.
        """