source: trunk/ShoeBox/ShoeBox.py @ 5

Revision 5, 1.8 KB checked in by nigel.sim, 5 years ago (diff)
Line 
1#
2# ShoeBox
3#  A start product for Plone - ShoeBox
4#
5# ShoeBox.py
6#  The Product
7#
8# Author: Christian Koller <admin@iecw.net>
9#
10# Released under GNU GPL v2 or later
11#
12
13from Products.Archetypes.public import *
14from Products.ShoeBox.config import PROJECTNAME
15from Products.CMFCore import CMFCorePermissions
16from Products.validation import V_REQUIRED
17from AccessControl import ClassSecurityInfo
18
19from Products.ShoeBox.config import PROJECTNAME
20
21class ShoeBox(BaseFolder):
22    """ Shoe Box container """
23    meta_type = 'ShoeBox'
24   
25    security  = ClassSecurityInfo()
26   
27    allowed_content_types = (
28        'ShoeBoxEntry',
29        'ShoeBoxAccount',
30        )
31    ##
32    ##  The Schema includes two variables, on for the Repository itself and one for a Path within the Repository
33    ##
34   
35    ## Set the icon for the ShoeBox
36    content_icon = 'shoebox.png'
37   
38    ##
39    ##  Redefine the view tab (action) for ShoeBox
40    ##
41    actions = (
42            {
43                    'id': 'view',
44                    'name': 'View',
45                    'action': 'string:${folder_url}/shoebox_view',
46                    'permissions': (CMFCorePermissions.View,),
47                    'category':'object',
48            },
49    )
50    aliases = {
51            '(Default)'  : 'view',
52            'view'       : '',
53            'index.html' : '',
54            'edit'       : 'base_edit',
55            'properties' : 'base_metadata',
56            'sharing'    : 'folder_localrole_form',
57            'gethtml'    : '',
58            'mkdir'      : '',
59            }
60
61    def getAccounts(self):
62        """
63        Returns a list of accounts available to this entry
64        """
65        accounts = self.getFolderContents(batch=False,
66           contentFilter={'portal_type' : 'ShoeBoxAccount'}, full_objects=True)
67
68        return accounts
69
70## Register the new type within Zope
71registerType(ShoeBox,PROJECTNAME)
Note: See TracBrowser for help on using the repository browser.