Index: waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py
===================================================================
--- waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py	(revision 100)
+++ waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py	(revision 101)
@@ -925,4 +925,105 @@
 ###)
 
+accomodation = { ###(
+    'widgets': {
+        'heading': Heading,
+        'text': Text,
+        '': {
+            'type': 'String Widget',
+            'data': {
+                'title': '',
+                'fields': ('level',),
+                'is_required': True,
+                'label': 'Level',
+                'label_edit': 'Level',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },
+        'code': {
+            'type': 'String Widget',
+            'data': {
+                'title': 'Code',
+                'fields': ('code',),
+                'is_required': True,
+                'label': 'Code',
+                'label_edit': 'Code',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },
+        'semester': {
+            'type': 'Boolean Widget',
+            'data': {
+                'title': '',
+                'fields': ('semester',),
+                'is_required': True,
+                'label': 'Semester',
+                'label_edit': 'Semester',
+                'label_false': 'Second Semester',
+                'label_true': 'First Semester',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },
+        'credit': {
+            'type': 'Int Widget',
+            'data': {
+                'title': '',
+                'fields': ('credit',),
+                'is_required': True,
+                'label': 'Credit',
+                'label_edit': 'Credit',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'display_width': 2,
+                'size_max': 0,
+            },
+        },
+        'core_elective': {
+            'type': 'Boolean Widget',
+            'data': {
+                'title': '',
+                'fields': ('core_elective',),
+                'is_required': True,
+                'label': 'Core or elective',
+                'label_edit': 'Core or elective',
+                'label_true': 'Core Course',
+                'label_false': 'Elective Course',
+                'description': '',
+                'help': '',
+                'is_i18n': False,
+                'display_width': 10,
+                'size_max': 0,
+            },
+        },
+    },
+   'layout': {
+        'style_prefix': 'layout_waeup_',
+        'flexible_widgets': (),
+        'ncols': 1,
+        'rows': [
+            [{'widget_id': 'heading', 'ncols': 1},],
+            [{'widget_id': 'text', 'ncols': 1},],
+            [{'widget_id': 'level', 'ncols': 1},],
+            [{'widget_id': 'code', 'ncols': 1},],
+            [{'widget_id': 'semester', 'ncols': 1},],
+            [{'widget_id': 'credit', 'ncols': 1},],
+            [{'widget_id': 'core_elective', 'ncols': 1},],
+        ]
+    },
+}
+###)
+
 layouts = {}
 layouts['university'] = common_layout
Index: waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py
===================================================================
--- waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py	(revision 100)
+++ waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py	(revision 101)
@@ -254,4 +254,56 @@
     },
     'level': {
+        'type': 'CPS String Field',
+        'data': {
+            'default_expr': 'string:',
+            'is_searchabletext': True,
+        },
+    },
+    'code': {
+        'type': 'CPS String Field',
+        'data': {
+            'default_expr': 'string:',
+            'is_searchabletext': True,
+        },
+    },
+    'semester': {
+        'type': 'CPS Boolean Field',
+        'data': {
+            'default_expr': 'python:True',
+            'is_searchabletext': False,
+        },
+    },
+    'credit': {
+        'type': 'CPS Int Field',
+        'data': {
+            'default_expr': 'string:',
+            'is_searchabletext': False,
+        },
+    },
+    'core_elective': {
+        'type': 'CPS Boolean Field',
+        'data': {
+            'default_expr': 'python:True',
+            'is_searchabletext': False,
+        },
+    },
+}###)
+
+accomodation_schema = { ###(
+    'heading': {
+        'type': 'CPS String Field',
+        'data': {
+            'default_expr': 'string:',
+            'is_searchabletext': True,
+        },
+    },
+    'text': {
+        'type': 'CPS String Field',
+        'data': {
+            'default_expr': 'string:',
+            'is_searchabletext': True,
+        },
+    },
+    '': {
         'type': 'CPS String Field',
         'data': {
Index: waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py
===================================================================
--- waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py	(revision 100)
+++ waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py	(revision 101)
@@ -1,568 +1,377 @@
 #-*- mode: python; mode: fold -*-
 # $Id$
-"""Return custom document types."""
-# permissions
-from Products.CMFCore.permissions import View
-from Products.CMFCore.permissions import ModifyPortalContent
-from Products.CMFCore.permissions import AddPortalContent
+from Products.CPSInstaller.CPSInstaller import CPSInstaller
+from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent
 from Products.WAeUP.WAeUPPermissions import UniversityManage, StudentManage,FacultyManage,\
                                             DepartmentManage,CourseManage
-ChangePermissions = 'Change permissions'
-
-university_type = { ###(
-    'title': 'WAeUP Base Folder',
-    'description': 'The WAeUP Container',
-    'content_icon': 'students_folder.gif',
-    'content_meta_type': 'University',
-    'product': 'WAeUP',
-    'factory': 'addUniversity',
-    'immediate_view': 'university_view',
-    'global_allow': 1,
-    'filter_content_types': 1,
-    'allowed_content_types': ('StudentsFolder','Faculty'),
-    'allow_discussion': 0,
-    'cps_is_searchable': 1,
-    'cps_display_as_document_in_listing': 1,
-    'cps_proxy_type': 'folder',
-    'schemas': ['metadata', 'common', 'folder'],
-    'layouts': ['common', 'university'],
-    'layout_clusters': ['metadata:metadata'],
-    'cps_section_wf': 'waeup_section_wf',
-    'actions': ({'id': 'view',
-                 'name': 'action_view',
-                 'action': 'university_view',
-                 'condition': "python:member and 'Manager' in member.getRoles()",
-                 'permissions': (View,)},
-                {'id': 'add_faculty',
-                 'name': 'Add a Faculty',
-                 'action'    : 'string:${object/absolute_url}/create_common?type_name=Faculty',
-                 #'action': 'folder_factories',
-                 'permissions': (ModifyPortalContent,UniversityManage,)},
-                {'id': 'contents',
-                 'name': 'action_folder_contents',
-                 'action': 'folder_contents',
-                 'condition': "python:member and 'Manager' in member.getRoles()",
-                 'permissions': (ModifyPortalContent,UniversityManage,)},
-                {'id': 'edit',
-                 'name': 'action_edit',
-                 'action': 'cpsdocument_edit_form',
-                 'condition': "python:member and 'Manager' in member.getRoles()",
-                 'permissions': (ModifyPortalContent,UniversityManage,)},
-                {'id': 'metadata',
-                 'name': 'action_metadata',
-                 'action': 'cpsdocument_metadata',
-                 'condition': "python:member and 'Manager' in member.getRoles()",
-                 'permissions': (ModifyPortalContent,)},
-                {'id': 'localroles',
-                 'name': 'action_local_roles',
-                 'action': 'folder_localrole_form',
-                 'condition': 'python:0',
-                 'permissions': (ModifyPortalContent,)},
-                 )
+try:
+  from Products.CPSSubscriptions.permissions import CanNotifyContent
+  CPSSubscriptions = True
+except ImportError:
+  CPSSubscriptions = False
+try:
+  from Products.CPSForum.CPSForumPermissions import ForumManageComments
+  CPSForum = True
+except ImportError:
+  CPSForum = False
+
+from Products.WAeUP.Students import addStudentsFolder
+
+class WAeUPInstaller(CPSInstaller):
+    """
+    WAeUP Installer
+    """
+    product_name = "WAeUP"
+
+    def install(self,portal):
+        "install"
+
+        product_name = self.product_name
+        self.log("Starting %(product_name)s install" % vars() )
+    
+        # Roles and Permissions ###(
+        #
+        self.verifyRoles((
+            # A role that can manage the University.
+            'UniversityManager',
+            # A role that can manage the StudentsRecords.
+            'StudentManager',
+            # A role that can manage a Faculty.
+            'FacultyManager',
+            # A role that can manage a department.
+            'DepartmentManager',
+            # A role that can manage a Course.
+            'CourseManager',
+            # The Student Role
+            'Student',
+        ))
+        waeup_perms = {
+            UniversityManage:
+                ('Manager', 'SectionManager','UniversityManager', 
+                 ),
+            StudentManage:
+                ('Manager', 'SectionManager','UniversityManager', 'StudentManager' 
+                 ),
+            FacultyManage:
+                ('Manager', 'SectionManager','UniversityManager', 'FacultyManager' 
+                 ),
+            DepartmentManage:
+                ('Manager', 'SectionManager','UniversityManager', 'DepartmentManager' 
+                 ),
+            CourseManage:
+                ('Manager', 'SectionManager','UniversityManager', 'CourseManager' 
+                 ),
         }
+        self.setupPortalPermissions(waeup_perms)
+
 ###)
 
-students_folder_type = { ###(
-    'title': 'WAeUP Student Folder',
-    'description': 'The WAeUP Student Folder',
-    'content_icon': 'students_folder.gif',
-    'content_meta_type': 'StudentsFolder',
-    'product': 'CPSDefault',
-    'factory': 'addFolder',
-    'immediate_view': 'folder_view',
-    'global_allow': 1,
-    'filter_content_types': 1,
-    'allowed_content_types': ('Student'),
-    #'allowed_content_types': ('Student','ScratchCard'),
-    'allow_discussion': 0,
-    'cps_is_searchable': 1,
-    'cps_display_as_document_in_listing': 1,
-    'cps_proxy_type': 'folder',
-    'schemas': ['metadata', 'common', 'folder'],
-    'layouts': ['waeup_common','folder'],
-    'layout_clusters': ['metadata:metadata'],
-    'cps_section_wf': 'waeup_section_wf',
-    'actions': ({'id': 'view',
-                 'name': 'Students',
-                 'action': 'students_folder_view',
-                 'condition': "python:member and 'Manager' in member.getRoles()",
-                 'permissions': (View,)},
-##                {
-##                'id'        : 'add_content',
-##                'name'      : 'Add Content',
-##                'action'    : 'string:${object/absolute_url}/folder_factories',
-##                'condition': "python:member and 'Manager' in member.getRoles()",
-##                'permissions': (StudentManage,)},
-                {
-                'id'        : 'add_jamb',
-                'name'      : 'Add Student JAMB',
-                'action'    : 'string:${object/absolute_url}/create_jamb',
-                'permissions': (UniversityManage,StudentManage)},
-##                {'id': 'contents',
-##                 'name': 'action_folder_contents',
-##                 'action': 'folder_contents',
-##                 'permissions': (UniversityManage,)},
-##                {'id': 'edit',
-##                 'name': 'action_edit',
-##                 'action': 'cpsdocument_edit_form',
-##                 'permissions': (UniversityManage,)},
-##                {'id': 'metadata',
-##                 'name': 'action_metadata',
-##                 'action': 'cpsdocument_metadata',
-##                 'permissions': (UniversityManage,)},
-##                {'id': 'localroles',
-##                 'name': 'action_local_roles',
-##                 'action': 'folder_localrole_form',
-##                 'permissions': (UniversityManage,)},
-    )
-}
+        ##########################################
+        # Actions 
+        ##########################################
+        if CPSSubscriptions: ###(
+            ptypes = "('Portal', 'CPSMailAccess Message', 'CPSMailAccess Box', 'CPSMailAccess Folder',"\
+                     +  "'University', 'StudentsFolder', 'Student', 'Jamb', 'Faculty', 'Department','Course')"
+            condition = "object.portal_type not in %s" % ptypes
+    
+            action = {'id' : 'notify_content',
+                      'name' : 'action_notify_content',
+                      'action' : 'string:${object_url}/content_notify_email_form',
+                      'condition' : 'python:%s' % condition,
+                      'permission' :  (CanNotifyContent,),
+                      'category' : 'object',
+                      }
+            self.deleteActions({'portal_subscriptions': ['notify_content',]})
+            self.verifyAction('portal_subscriptions', **action)
+        if CPSForum:
+            ptypes = "('University','StudentsFolder','Student', 'Jamb','Faculty', 'Department','Course')"
+            condition = "object.portal_type not in %s" % ptypes
+    
+            action = {'id' : 'activate_comments',
+                      'name': 'action_activate_comments',
+                      'action': 'string:${object/absolute_url}/set_comment_mode?mode=1',
+                      'condition' : 'python:%s' % condition,
+                      'permission': (ForumManageComments,),
+                      'category' : 'object',
+                      }
+            self.deleteActions({'portal_subscriptions': ['activate_comments',]})
+            self.verifyAction('portal_subscriptions', **action)
+            # now portal_discussion
+            self.deleteActions({'portal_discussion': ['comment',
+                                                      'activate_comments',
+                                                      'deactivate_comments',
+                                                      'manage_comments']})
+            action = {'id' : 'comment',
+                      'name': 'action_comment',
+                      'action': "string:${object/absolute_url}/post_comment",
+                      'condition' : "python:getattr(object.getContent(), 'allow_discussion' , None) and object.hasCommentAction()",
+                      'permission': (View,),
+                      'category' : 'object',
+                      }
+            self.verifyAction('portal_discussion', **action)
+            action = {'id' : 'activate_comments',
+                      'name': 'action_activate_comments',
+                      'action': "string:${object/absolute_url}/set_comment_mode?mode=1",
+                      'condition' : "python:getattr(object.getTypeInfo(),'cps_proxy_type','') in ('document', 'folderishdocument') and getattr(object.getContent(), 'allow_discussion' , None) == 1",
+                      'permission': (ForumManageComments,),
+                      'category' : 'object',
+                      }
+            self.verifyAction('portal_discussion', **action)
+            action = {'id' : 'deactivate_comments',
+                      'name': 'action_deactivate_comments',
+                      'action': "string:${object/absolute_url}/set_comment_mode?mode=0",
+                      'condition' : "python:getattr(object.getTypeInfo(),'cps_proxy_type','') in ('document', 'folderishdocument') and getattr(object.getContent(), 'allow_discussion' , None) == 1",
+                      'permission': (ForumManageComments,),
+                      'category' : 'object',
+                      }
+            self.verifyAction('portal_discussion', **action)
+            action = {'id' : 'manage_comments',
+                      'name': 'action_manage_comments',
+                      'action': "string:${object/absolute_url}/manage_comment",
+                      'condition' : "python:getattr(object.getTypeInfo(),'cps_proxy_type','') in ('document', 'folderishdocument') and getattr(object.getContent(), 'allow_discussion' , None) == 1",
+                      'permission': (ForumManageComments,),
+                      'category' : 'object',
+                      }
+            self.verifyAction('portal_discussion', **action)
+        
 ###)
 
-student_type = { ###(
-    'title': 'WAeUP Student',
-    'description': '',
-    'content_icon': 'student.gif',
-    'content_meta_type': 'Student',
-    'product': 'WAeUP',
-    'factory': 'addStudent',
-    'immediate_view': 'cpsdocument_view',
-    'global_allow': True,
-    'filter_content_types': True,
-    'allowed_content_types': ('Jamb','StudentPersonal'),
-    'allow_discussion': False,
-    'cps_is_searchable': True,
-    'cps_proxy_type': 'document',
-    'cps_display_as_document_in_listing': True,
-    'schemas': ['metadata','common','student'],
-    'layouts': ['waeup_common','student'],
-    'flexible_layouts': (),
-    'layout_clusters': ['metadata:metadata'],
-    'cps_section_wf': 'waeup_section_wf',
-    'use_content_status_history': 0,
-    'actions': (
-         {'id': 'view',
-          'name': 'action_view',
-          'action': 'string:${object_url}/student_index_html',
-          #'action': 'string:${object_url}/cpsdocument_view',
-          'condition': '',
-          'permission': (View,),
-          'category': 'object',
-          'visible': True,},
-         {'id': 'metadata',
-          'name': 'action_metadata',
-          'action': 'cpsdocument_metadata',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (UniversityManage,)},
-          )
-}
+        ##########################################
+        # main_tab actions ###(
+        ##########################################
+        actions = ( { 'tool'      : 'portal_actions',
+                        'id'        : 'student_administration',
+                        'name'      : 'Student Administration',
+                        'action'    : 'string:${portal_url}/sections/waeup/students',
+                        'permission': (View, ),
+                        'category'  : 'main_tabs',
+                        'visible'   : 1,
+                      },
+                      { 'tool'      : 'portal_actions',
+                        'id'        : 'faculties',
+                        'name'      : 'Faculties',
+                        'action'    : 'string:${portal_url}/sections/waeup/faculties',
+                        'permission': (View ),
+                        'category'  : 'main_tabs',
+                        'visible'   : 1,
+                      },
+##                      { 'tool'      : 'portal_actions',
+##                        'id'        : 'add_jamb',
+##                        'name'      : 'Add Student JAMB',
+##                        'action'    : 'string:${object/absolute_url}/create_jamb',
+##                        'permission': (),
+##                        'condition' : 'python: member and here.portal_type in ("StudentsFolder",) and "StudentManager" in member.getGroups()',
+##                        'category'  : 'student',
+##                        'visible'   : 1,
+##                      },
+##                      { 'tool'      : 'portal_actions',
+##                        'id'        : 'add_faculty',
+##                        'name'      : 'Add New Faculty',
+##                        'action'    : 'string:${object/absolute_url}/addFaculty',
+##                        'permission': (),
+##                        'condition' : 'python: member and here.portal_type in ("University",) and "StudentManager" in member.getGroups()',
+##                        'category'  : 'student',
+##                        'visible'   : 1,
+##                      },
+##                      { 'tool'      : 'portal_actions',
+##                        'id'        : 'add_department',
+##                        'name'      : 'Add New Department',
+##                        'action'    : 'string:${object/absolute_url}/addDepartment',
+##                        'permission': (),
+##                        'condition' : 'python: member and here.portal_type in ("Faculty",) and "StudentManager" in member.getGroups()',
+##                        'category'  : 'student',
+##                        'visible'   : 1,
+##                      },
+##                      { 'tool'      : 'portal_actions',
+##                        'id'        : 'add_course',
+##                        'name'      : 'Add New Course',
+##                        'action'    : 'string:${object/absolute_url}/addCourse',
+##                        'permission': (),
+##                        'condition' : 'python: member and here.portal_type in ("Department",) and "StudentManager" in member.getGroups()',
+##                        'category'  : 'student',
+##                        'visible'   : 1,
+##                      },
+##                      { 'tool'      : 'portal_actions',
+##                        'id'        : 'add_personal',
+##                        'name'      : 'Add personal Data',
+##                        'action'    : 'string:${object/absolute_url}/create_personal_form',
+##                        'permission': (),
+##                        'condition' : 'python: 0 and member and not here.portal_type in ("Jamb","StudentsFolder") and not "StudentManager" in member.getGroups()',
+##                        'category'  : 'student',
+##                        'visible'   : 1,
+##                      },
+##                      { 'tool'      : 'portal_actions',
+##                        'id'        : 'edit_jamb',
+##                        'name'      : 'Edit Jamb Data',
+##                        'action'    : 'cpsdocument_edit_form',
+##                        'permission': ( ),
+##                        'condition' : 'python: member and here.portal_type in ("Student",) and "StudentManager" in member.getGroups()',
+##                        'category'  : 'student',
+##                        'visible'   : 1,
+##                      },
+                    )
+        self.verifyActions(actions)
+        ##########################################
 ###)
 
-scratch_card = { ###(
-    'title': 'WAeUP Scratchcard',
-    'description': '',
-    'content_icon': 'student.gif',
-    'content_meta_type': 'Scratch Card',
-    'product': 'CPSDocument',
-    'factory': 'addCPSDocument',
-    'immediate_view': 'cpsdocument_view',
-    'global_allow': True,
-    'filter_content_types': True,
-    'allowed_content_types': (),
-    'allow_discussion': False,
-    'cps_is_searchable': True,
-    'cps_proxy_type': 'document',
-    'cps_display_as_document_in_listing': True,
-    'schemas': ('scratch_card'),
-    'layouts': ('scratch_card'),
-    'cps_workspace_wf': 'waeup_workspace_wf',
-    'cps_section_wf': 'waeup_section_wf',
-##    'actions': (
-##         {'id': 'view',
-##          'name': 'action_view',
-##          'action': 'string:${object_url}/document_view',
-##          'condition': '',
-##          'permission': ('View',),
-##          'category': 'object',
-##          'visible': True,},
-##         {'id': 'new_content',
-##          'name': 'Add a scratch card',
-##          'action': 'string:${object_url}/folder_factories',
-##          'condition': "python:len(object.contentItems()) == 0 ",
-##          'permission': ('Modify portal content',),
-##          'category': 'object',
-##          'visible': True,},
-##         {'id': 'contents',
-##          'name': 'action_folder_contents',
-##          'action': 'string:${object_url}/folder_contents',
-##          'condition': "python:object.getTypeInfo().cps_proxy_type != 'document'",
-##          'permission': ('Modify portal content',),
-##          'category': 'object',
-##          'visible': True,},
-##         {'id': 'edit',
-##          'name': 'action_edit',
-##          'action': 'string:${object_url}/cpsdocument_edit_form',
-##          'condition': '',
-##          'permission': ('Modify portal content',),
-##          'category': 'object',
-##          'visible': True,},
-##    )
-}
-#
+        # skins 
+        ##########################################
+        self.log("Verifying %(product_name)s skinss" % vars())
+        wskins = { 'waeup_default' : 'Products/WAeUP/skins/waeup_default',
+                   'waeup_faculty' : 'Products/WAeUP/skins/waeup_faculty',
+                   'waeup_student' : 'Products/WAeUP/skins/waeup_student',
+                 }
+        self.verifySkins(wskins)
+        self.resetSkinCache()
+        
+        ##########################################
+        # portal types
+        ##########################################
+        dtypes = portal.getWAeUPTypes()
+        self.verifyFlexibleTypes(dtypes)
+        self.allowContentTypes('University', ('Workspace','Section',))
+        ##########################################
+        # Schemas
+        ##########################################
+        self.log("Verifying %(product_name)s schemas" % vars())
+        self.verifySchemas(portal.getWAeUPSchemas())
+        ##########################################
+        # widgets
+        ##########################################
+        self.log("Verifying %(product_name)s widgets" % vars())
+        self.verifyWidgets(portal.getWAeUPWidgets())
+        ##########################################
+        # layouts
+        ##########################################
+        self.log("Verifying %(product_name)s layouts" % vars())
+        self.verifyLayouts(portal.getWAeUPLayouts())
+        ##########################################
+        # Vocabularies
+        ##########################################
+        self.log("Verifying %(product_name)s vocabularies" % vars())
+        self.verifyVocabularies(portal.getWAeUPVocabularies())
+        ##########################################
+        # Groups
+        ##########################################
+            
+        self.installCustomWorkflows()
+        self.verifyWorkflowAssociation()
+        
+        self.log("End of specific %(product_name)s install" % vars())
+        self.finalize()
+        
+
+    def installCustomWorkflows(self):
+        """Installs custom workflows
+        """
+        from Products.WAeUP.Workflows.WAeUPWorkflow import \
+             waeupWorkflowsInstall
+
+        waeupWorkflowsInstall(self.context)
+
+
+    def verifyWorkflowAssociation(self):
+        """Verify workflow association
+        """
+        ws_chains = { 
+                      'Student': 'waeup_workspace_wf',
+                      'Jamb': 'waeup_workspace_wf',
+                      }
+
+        se_chains = { 'University': 'waeup_section_wf',
+                      'StudentsFolder': 'waeup_section_wf',
+                      'Student': 'waeup_section_wf',
+                      'StudentPersonal': 'waeup_section_wf',
+                      'Jamb': 'waeup_section_wf',
+                      'ScratchCard': 'waeup_section_wf',
+                      'Faculty': 'waeup_section_wf',
+                      'Department': 'waeup_section_wf',
+                      'Course': 'waeup_section_wf',
+                      }
+
+        self.verifyLocalWorkflowChains(self.portal['workspaces'],
+                                       ws_chains,
+                                       destructive=1)
+        self.verifyLocalWorkflowChains(self.portal['sections'],
+                                       se_chains,
+                                       destructive=1)
+
+
+def install(self):
+    installer = WAeUPInstaller(self)
+    installer.install(self)
+    dirtool = getattr(self,'portal_directories')
+    groups = dirtool.groups
+    for delEntry in ('StudentManager',):
+        if delEntry in groups.listEntryIds():
+            groups.deleteEntry(delEntry)  
+    for newEntry in ('Students',):
+        if newEntry not in groups.listEntryIds():
+            groups.createEntry({'group': newEntry, 
+                                'members': []})  
+    #groups.manage_setLocalGroupRoles(groupid = 'StudentManager',roles=('Manager',))
+    #groups.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',))
+    sections = getattr(self,'sections')
+    waeup = getattr(sections,'waeup',None)
+    if not waeup:
+        sections.content_create(type_name='University',title='waeup')
+        sections.waeup.folder_localrole_add(member_ids=('group:Students',),
+                                            member_role='SectionReviewer',
+                                            )
+        sections.waeup.content_create(type_name='StudentsFolder',title='students')
+        sections.waeup.folder_localrole_add(member_ids=('group:Students',),
+                                            member_role='SectionReviewer',
+                                            )
+##        sections.waeup.folder_localrole_add(member_ids=('group:StudentManager',),
+##                                            member_role='SectionManager',
+##                                            )
+        sections.waeup.students.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',))
+    sections.waeup.manage_setLocalGroupRoles(groupid = 'role:Anonymous',roles=('SectionReader',))
+    # portlets ###(
+    #
+    portlets = (
+##              {'identifier': 'waeup_main_tabs',
+##              'type': 'Custom Portlet',
+##              'slot': 'main_tabs',
+##              'order': 0,
+##              'render_method': 'portlet_main_navigation',
+##              'Title': 'main tabs',
+##              },
+              {'identifier': 'waeup_breadcrumbs',
+              'type': 'Breadcrumbs Portlet',
+              'slot': 'waeup_breadcrumbs',
+              'first_item': 2,
+              'display_site_root': 0,
+              'Title': 'waeup_breadcrumbs',
+              'display': 'horizontal_trail',
+              'display_hidden_folders': 0,
+              'order': 0,
+              },
+              {'identifier': 'waeup_main_tab_actions',
+              'type': 'Actions Portlet',
+              'slot': 'main_tabs',
+              'order': 0,
+              'categories': ['main_tabs',],
+              'Title': 'waep_main_tab_actions',
+              },
+              {'identifier': 'waeup_object_actions',
+              'type': 'Actions Portlet',
+              'slot': 'waeup_object_actions',
+              'order': 0,
+              'categories': ['object',],
+              'Title': 'waep_manager_actions',
+              },
+              {'identifier': 'waeup_left_top',
+              'type': 'Custom Portlet',
+              'slot': 'left_top',
+              'order': 0,
+              'render_method': 'portlet_session_info',
+              'Title': 'Session Info',
+              },
+            )
+    installer.verifyPortletContainer(waeup)
+    installer.verifyPortlets(portlets,waeup)
+
 ###)
 
-course_type = { ###(  
-    'title': 'WAeUP Course',
-    'description': '',
-    'content_icon': 'student.gif',
-    'content_meta_type': 'Course',
-    'product': 'WAeUP',
-    'factory': 'addCourse',
-    'immediate_view': 'cpsdocument_view',
-    'global_allow': True,
-    'filter_content_types': True,
-    'allowed_content_types': (),
-    'allow_discussion': False,
-    'cps_is_searchable': True,
-    'cps_proxy_type': 'document',
-    'cps_display_as_document_in_listing': True,
-    'schemas': ['metadata','common','course'],
-    'layouts': ['course',],
-    'flexible_layouts': (),
-    'layout_clusters': ['metadata:metadata','coursetotal:metadata,course'],
-    'cps_section_wf': 'waeup_section_wf',
-    'use_content_status_history': 0,
-    'actions': (
-         {'id': 'view',
-          'name': 'action_view',
-          'action': 'string:${object_url}/course_index_html',
-          'condition': '',
-          'permission': ('View',),
-          'category': 'object',
-          'visible': True,},
-         {'id': 'edit',
-          'name': 'action_edit',
-          'action': 'string:${object_url}/waeup_edit_form',
-          'condition': '',
-          'permission': (CourseManage,),
-          'category': 'object',
-          'visible': True,},
-          {'id': 'contents',
-          'name': 'action_folder_contents',
-          'action': 'folder_contents',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,UniversityManage,)},
-          {'id': 'edit',
-          'name': 'action_edit',
-          'action': 'cpsdocument_edit_form',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,UniversityManage,)},
-          {'id': 'metadata',
-          'name': 'action_metadata',
-          'action': 'cpsdocument_metadata',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,)},
-          {'id': 'localroles',
-          'name': 'action_local_roles',
-          'action': 'folder_localrole_form',
-          'condition': 'python:0',
-          'permissions': (ModifyPortalContent,)},
-          )
-}
-###)
-
-jamb_type = { ###(
-    'title': "JAMB data",
-    'description': 'The data from JAMB',
-    'content_icon': '',
-    'content_meta_type': 'CPS Document',
-    'product': 'CPSDocument',
-    'factory': 'addCPSDocument',
-    'immediate_view': 'cpsdocument_view',
-    'global_allow': True,
-    'filter_content_types': True,
-    'allowed_content_types': (),
-    'allow_discussion': False,
-    'cps_is_searchable': True,
-    'cps_proxy_type': 'document',
-    'cps_display_as_document_in_listing': True,
-    'cps_is_portalbox': False,
-    #'schemas': ['common','metadata','jamb'],
-    'schemas': ['jamb'],
-    'layouts': ['jamb'],
-    'flexible_layouts': (),
-    'storage_methods': ('admitted:store_admission_pin'),
-    'cps_workspace_wf': 'workspace_content_wf',
-    'cps_section_wf': 'section_content_wf',
-    'actions': (
-         {'id': 'view',
-          'name': 'action_view',
-          'action': 'string:${object_url}/jamb_index_html',
-          'condition': '',
-          'permission': (View,),
-          'visible': True,},
-         {'id': 'edit',
-          'name': 'action_edit',
-          'action': 'string:${object_url}/waeup_edit_form',
-          'condition': '',
-          'permission': (ModifyPortalContent,StudentManage),
-          },
-          {
-          'id'        : 'add_content',
-          'name'      : 'Add Content',
-          'action'    : 'string:${object/absolute_url}/folder_factories',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (StudentManage,)},
-         {'id': 'metadata',
-          'name': 'action_metadata',
-          'action': 'cpsdocument_metadata',
-          'condition': "python:'Manager' in member.getRoles()",
-          'permissions': (UniversityManage,)},
-          )
-}
-###)
-
-student_personal_type = { ###(
-    'title': "Student personal data",
-    'description': '',
-    'content_icon': '',
-    'content_meta_type': 'CPS Document',
-    'product': 'WAeUP',
-    'factory': 'addStudentPersonal',
-    'immediate_view': 'student_personal_index_html',
-    'global_allow': True,
-    'filter_content_types': True,
-    'allowed_content_types': (),
-    'allow_discussion': False,
-    'cps_is_searchable': True,
-    'cps_proxy_type': 'document',
-    'cps_display_as_document_in_listing': True,
-    'cps_is_portalbox': False,
-    #'schemas': ['common','metadata','jamb'],
-    'schemas': ['student_personal'],
-    'layouts': ['student_personal'],
-    'flexible_layouts': (),
-    'storage_methods': (),
-    'cps_workspace_wf': 'workspace_content_wf',
-    'cps_section_wf': 'section_content_wf',
-    'actions': (
-         {'id': 'view',
-          'name': 'action_view',
-          'action': 'string:${object_url}/student_personal_index_html',
-          #'action': 'string:${object_url}/cpsdocument_view',
-          'condition': '',
-          'permission': ('View',),
-          'category': 'object',
-          'visible': True,},
-         {'id': 'edit',
-          'name': 'action_edit',
-          'action': 'string:${object_url}/student_personal_edit_form',
-          'condition': '',
-          'permission': ('View',),
-          'category': 'object',
-          'visible': True,},
-         {'id': 'metadata',
-          'name': 'action_metadata',
-          'action': 'cpsdocument_metadata',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (UniversityManage,)},
-          )
-}
-###)
-
-faculty_type = { ###(
-    'title': 'WAeUP Faculty',
-    'description': '',
-    'content_icon': '',
-    'content_meta_type': 'Faculty',
-    'product': 'WAeUP',
-    'factory': 'addFaculty',
-    'immediate_view': 'folder_view',
-    'global_allow': True,
-    'filter_content_types': True,
-    'allowed_content_types': ('Department'),
-    'allow_discussion': 0,
-    'cps_is_searchable': True,
-    'cps_proxy_type': 'folder',
-    'cps_display_as_document_in_listing': True,
-    'schemas': ['metadata','common','faculty'],
-    'layouts': ['faculty'],
-    'flexible_layouts': (),
-    'layout_clusters': ['metadata:metadata',],
-    'cps_section_wf': 'waeup_section_wf',
-    'use_content_status_history': 0,
-    'actions': (
-         {'id': 'view',
-          'name': 'action_view',
-          'action': 'string:${object_url}/faculty_index_html',
-          'condition': '',
-          'permission': (View,),
-          'visible': True,},
-         {'id': 'edit',
-          'name': 'action_edit',
-          'action': 'string:${object_url}/waeup_edit_form',
-          'condition': '',
-          'permission': (UniversityManage,),
-          'visible': True,},
-          {'id': 'add_department',
-          'name': 'Add a Department',
-          'action'    : 'string:${object/absolute_url}/create_common?type_name=Department',
-          'permissions': (ModifyPortalContent,UniversityManage,)},
-          {'id': 'contents',
-          'name': 'action_folder_contents',
-          'action': 'folder_contents',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,UniversityManage,)},
-          {'id': 'edit',
-          'name': 'action_edit',
-          'action': 'cpsdocument_edit_form',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,UniversityManage,)},
-          {'id': 'metadata',
-          'name': 'action_metadata',
-          'action': 'cpsdocument_metadata',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,)},
-          {'id': 'localroles',
-          'name': 'action_local_roles',
-          'action': 'folder_localrole_form',
-          'condition': 'python:0',
-          'permissions': (ModifyPortalContent,)},
-          )
-}
-###)
-
-department_type = { ###(
-    'title': 'WAeUP Department',
-    'description': '',
-    'content_icon': '',
-    'content_meta_type': 'Department',
-    'product': 'WAeUP',
-    'factory': 'addDepartment',
-    'immediate_view': 'folder_view',
-    'global_allow': True,
-    'filter_content_types': True,
-    'allowed_content_types': ('Student','Course'),
-    'allow_discussion': False,
-    'cps_is_searchable': True,
-    'cps_proxy_type': 'folder',
-    'cps_display_as_document_in_listing': True,
-    'schemas': ['metadata','common','department'],
-    'layouts': ['department',],
-    'flexible_layouts': (),
-    'layout_clusters': ['metadata:metadata',],
-    'cps_section_wf': 'waeup_section_wf',
-    'use_content_status_history': 0,
-    'actions': (
-         {'id': 'view',
-          'name': 'action_view',
-          'action': 'string:${object_url}/department_index_html',
-          'condition': '',
-          'permission': ('View',),
-          'visible': True,},
-         {'id': 'edit',
-          'name': 'action_edit',
-          'action': 'string:${object_url}/waeup_edit_form',
-          'condition': '',
-          'permission': (FacultyManage,),
-          'visible': True,},
-          {'id': 'create_course',
-          'name': 'Add a Course',
-          'action'    : 'string:${object/absolute_url}/create_course',
-          'permissions': (ModifyPortalContent,UniversityManage,)},
-          {'id': 'contents',
-          'name': 'action_folder_contents',
-          'action': 'folder_contents',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,UniversityManage,)},
-          {'id': 'edit',
-          'name': 'action_edit',
-          'action': 'cpsdocument_edit_form',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,UniversityManage,)},
-          {'id': 'metadata',
-          'name': 'action_metadata',
-          'action': 'cpsdocument_metadata',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,)},
-          {'id': 'localroles',
-          'name': 'action_local_roles',
-          'action': 'folder_localrole_form',
-          'condition': 'python:0',
-          'permissions': (ModifyPortalContent,)},
-          )
-}
-###)
-
-course_type = { ###(  
-    'title': 'WAeUP Course',
-    'description': '',
-    'content_icon': 'student.gif',
-    'content_meta_type': 'Course',
-    'product': 'WAeUP',
-    'factory': 'addCourse',
-    'immediate_view': 'cpsdocument_view',
-    'global_allow': True,
-    'filter_content_types': True,
-    'allowed_content_types': (),
-    'allow_discussion': False,
-    'cps_is_searchable': True,
-    'cps_proxy_type': 'document',
-    'cps_display_as_document_in_listing': True,
-    'schemas': ['metadata','common','course'],
-    'layouts': ['course',],
-    'flexible_layouts': (),
-    'layout_clusters': ['metadata:metadata','coursetotal:metadata,course'],
-    'cps_section_wf': 'waeup_section_wf',
-    'use_content_status_history': 0,
-    'actions': (
-         {'id': 'view',
-          'name': 'action_view',
-          'action': 'string:${object_url}/course_index_html',
-          'condition': '',
-          'permission': ('View',),
-          'category': 'object',
-          'visible': True,},
-         {'id': 'edit',
-          'name': 'action_edit',
-          'action': 'string:${object_url}/waeup_edit_form',
-          'condition': '',
-          'permission': (CourseManage,),
-          'category': 'object',
-          'visible': True,},
-          {'id': 'contents',
-          'name': 'action_folder_contents',
-          'action': 'folder_contents',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,UniversityManage,)},
-          {'id': 'edit',
-          'name': 'action_edit',
-          'action': 'cpsdocument_edit_form',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,UniversityManage,)},
-          {'id': 'metadata',
-          'name': 'action_metadata',
-          'action': 'cpsdocument_metadata',
-          'condition': "python:member and 'Manager' in member.getRoles()",
-          'permissions': (ModifyPortalContent,)},
-          {'id': 'localroles',
-          'name': 'action_local_roles',
-          'action': 'folder_localrole_form',
-          'condition': 'python:0',
-          'permissions': (ModifyPortalContent,)},
-          )
-}
-###)
-
-types = {}
-types['University'] = university_type
-types['StudentsFolder'] = students_folder_type
-types['Student'] = student_type
-types['StudentPersonal'] = student_personal_type
-types['ScratchCard'] = scratch_card
-types['Jamb'] = jamb_type
-types['Faculty'] = faculty_type
-types['Department'] = department_type
-types['Course'] = course_type
-
-return types
-
+    return installer.logResult()
