1 | """Interfaces for viewing components. |
---|
2 | """ |
---|
3 | from zope import schema |
---|
4 | from zope.interface import Interface, Attribute |
---|
5 | from waeup.sirp.interfaces import ( |
---|
6 | IWAeUPObject, IUniversity, IUserContainer, IDataCenter) |
---|
7 | from waeup.sirp.university.interfaces import ( |
---|
8 | IFacultyContainer, IFaculty, IDepartment, ICourseContainer, ICourse, |
---|
9 | ICertificateContainer, ICertificate, ICertificateCourse) |
---|
10 | |
---|
11 | class IBreadcrumb(Interface): |
---|
12 | """Provide breadcrumbs. |
---|
13 | """ |
---|
14 | title = schema.TextLine( |
---|
15 | title = u'Context description', |
---|
16 | readonly = True, |
---|
17 | ) |
---|
18 | viewname = schema.TextLine( |
---|
19 | title = u'The viewname, for which the breadcrumb is provided.', |
---|
20 | readonly = True, |
---|
21 | default = u'index' |
---|
22 | ) |
---|
23 | parent_viewname = schema.TextLine( |
---|
24 | title = u'The viewname of the parent to use.', |
---|
25 | readonly = True, |
---|
26 | default = u'index' |
---|
27 | ) |
---|
28 | parent = Attribute("The parent object.") |
---|
29 | context = Attribute("The context of the breadcrumb.") |
---|
30 | |
---|
31 | |
---|
32 | def getURL(view=None): |
---|
33 | """Return a URL to the breadcrumb target. |
---|
34 | """ |
---|
35 | |
---|
36 | class IBreadcrumbIgnorable(Interface): |
---|
37 | """A marker interface for breadcrumbs that should be skipped in output. |
---|
38 | |
---|
39 | If a breadcrumb wants to be skipped in real output (for instance, |
---|
40 | because it is set on a layer in site hierarchy that should not be |
---|
41 | accessed by users), it can also provide this interface. The |
---|
42 | getBreadcrumbList() function defined here will exclude IIgnorables |
---|
43 | by default. |
---|
44 | """ |
---|
45 | pass |
---|
46 | |
---|
47 | class IBreadcrumbContainer(Interface): |
---|
48 | """A container of breadcrumbs. |
---|
49 | """ |
---|
50 | def __iter__(): |
---|
51 | """Allow iteration over the container. |
---|
52 | """ |
---|
53 | |
---|
54 | def getList(): |
---|
55 | """Get the list of breadcrumbs as real Python list. |
---|
56 | """ |
---|