1 | #-*- mode: python; mode: fold -*- |
---|
2 | from Globals import InitializeClass |
---|
3 | from AccessControl import ClassSecurityInfo |
---|
4 | |
---|
5 | from Products.CMFCore.utils import UniqueObject, getToolByName |
---|
6 | from Products.CMFCore.permissions import View |
---|
7 | from Products.CMFCore.permissions import ModifyPortalContent |
---|
8 | from Products.CPSCore.CPSBase import CPSBase_adder, CPSBaseFolder |
---|
9 | #from Products.CPSCore.CPSBase import CPSBaseDocument as BaseDocument |
---|
10 | from Products.CPSDocument.CPSDocument import CPSDocument |
---|
11 | from Products.CPSCore.CPSBase import CPSBaseBTreeFolder as BaseBTreeFolder |
---|
12 | |
---|
13 | accofolder_fti = { ###( |
---|
14 | 'title': 'WAeUP AccoFolder', |
---|
15 | 'description': '', |
---|
16 | 'content_icon': '', |
---|
17 | 'content_meta_type': 'AccoFolder', |
---|
18 | 'factory': 'addAccoFolder', |
---|
19 | 'immediate_view': 'cpsdocument_view', |
---|
20 | 'global_allow': True, |
---|
21 | 'filter_content_types': True, |
---|
22 | 'allowed_content_types': ('Accommodation',), |
---|
23 | 'allow_discussion': False, |
---|
24 | } |
---|
25 | ###) |
---|
26 | |
---|
27 | class AccoFolder(CPSDocument): ###( |
---|
28 | """ |
---|
29 | WAeUP AccoFolder containing Accommodation halls |
---|
30 | """ |
---|
31 | meta_type = 'AccoFolder' |
---|
32 | portal_type = meta_type |
---|
33 | security = ClassSecurityInfo() |
---|
34 | |
---|
35 | InitializeClass(AccoFolder) |
---|
36 | |
---|
37 | def addAccoFolder(container, id, REQUEST=None, **kw): |
---|
38 | """Add a AccoFolder.""" |
---|
39 | ob = AccoFolder(id, **kw) |
---|
40 | return CPSBase_adder(container, ob, REQUEST=REQUEST) |
---|
41 | ###) |
---|
42 | |
---|
43 | accommodation_fti = { ###( |
---|
44 | 'title': 'WAeUP Accommodation', |
---|
45 | 'description': '', |
---|
46 | 'content_icon': '', |
---|
47 | 'content_meta_type': 'Accommodation', |
---|
48 | 'factory': 'addAccommodation', |
---|
49 | 'immediate_view': 'cpsdocument_view', |
---|
50 | 'global_allow': True, |
---|
51 | 'filter_content_types': True, |
---|
52 | 'allowed_content_types': (), |
---|
53 | 'allow_discussion': False, |
---|
54 | } |
---|
55 | ###) |
---|
56 | |
---|
57 | class Accommodation(CPSDocument): ###( |
---|
58 | """ |
---|
59 | WAeUP Accommodation containing Departments |
---|
60 | """ |
---|
61 | meta_type = 'Accommodation' |
---|
62 | portal_type = meta_type |
---|
63 | security = ClassSecurityInfo() |
---|
64 | |
---|
65 | ## security.declareProtected(View,"Title") |
---|
66 | ## def Title(self): |
---|
67 | ## """ the Title """ |
---|
68 | ## return self.heading |
---|
69 | |
---|
70 | |
---|
71 | InitializeClass(Accommodation) |
---|
72 | |
---|
73 | def addAccommodation(container, id, REQUEST=None, **kw): |
---|
74 | """Add a Accommodation.""" |
---|
75 | ob = Accommodation(id, **kw) |
---|
76 | return CPSBase_adder(container, ob, REQUEST=REQUEST) |
---|
77 | ###) |
---|