Index: /WAeUP_SRP/trunk/Academics.py
===================================================================
--- /WAeUP_SRP/trunk/Academics.py	(revision 281)
+++ /WAeUP_SRP/trunk/Academics.py	(revision 282)
@@ -40,11 +40,13 @@
         """install Universityspecific Faculies from CSV values"""
         #return
-        logger = logging.getLogger('loadfaculties')
-        logger.info('Start loading Faculties')
+        name = 'faculty'
+        no_import = False
+        logger = logging.getLogger('%s_import' % name)
+        logger.info('Start loading from %s.csv' % name)
         academics = self.portal_catalog({'meta_type': 'AcademicsFolder'})[-1].getObject()
         try:
-            faculties = csv.DictReader(open("%s/import/faculty.csv" % i_home,"rb"))
+            faculties = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
         except:
-            logger.error('Error reading faculty.csv')
+            logger.error('Error reading %s.csv' % name)
             return
         l = self.portal_catalog({'meta_type': "Faculty"})
@@ -61,6 +63,12 @@
                 academics.invokeFactory('Faculty', fid)
                 f = getattr(self,fid)
-            d = {'Title': faculty['Description']}
-            f.getContent().edit(mapping=d)
+                d = {'Title': faculty['Description']}
+                f.getContent().edit(mapping=d)
+            else:
+                if not no_import:
+                    no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
+                    no_import.write('"Session","FacultyCode","Description","CollegeCode","FacultyKey","Status","degree_grade","Bankcode"\n')
+                logger.info('Faculty with ID %(FacultyCode)s %(Description)s already exists' % faculty)
+                no_import.write('"%(Session)s","%(FacultyCode)s","%(Description)s","%(CollegeCode)s","%(FacultyKey)s","%(Status)s","%(degree_grade)s","%(Bankcode)s"\n' % faculty)
     ###)
 
@@ -88,4 +96,6 @@
         """install Universityspecific Faculies from CSV values"""
         #return
+        name = 'departments'
+        no_import = False
         logger = logging.getLogger('loaddepartments')
         try:
@@ -104,4 +114,8 @@
             if f is None:
                 logger.info( "No Faculty with ID: %s" % fid)
+                if not no_import:
+                    no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
+                    no_import.write('"Session","DeptCode","Description","FacultyCode"')
+                no_import.write('"%(Session)s","%(DeptCode)s","%(Description)s","%(FacultyCode)s"\n' % dep)
             else:
                 did = dep.get('DeptCode')
@@ -120,4 +134,6 @@
         """install Universityspecific Courses from CSV values"""
         #return
+        name = 'courses'
+        no_import = False
         logger = logging.getLogger('loadcourses')
         try:
@@ -137,7 +153,7 @@
         course_list = [ c.id for c in cl]
         for course in courses:
-            logger.info('Processing %(CourseCode)s %(Description)s %(Credits)s %(Dept)s %(Semester)s %(Session)s %(PassMark)s %(CourseKey)s %(Category)s %(AdmStatus)s %(FORMERCODE)s' % course)
-            if course.get("FORMERCODE").endswith('BITS'):
-                continue
+            logger.info('Processing %(CourseCode)s %(Description)s %(Credits)s %(Dept)s %(Semester)s %(Session)s %(PassMark)s %(CourseKey)s %(Category)s %(AdmStatus)s' % course)
+##            if course.get("FORMERCODE").endswith('BITS'):
+##                continue
             depid = course.get('Dept').upper()
             if depid in deps.keys():
@@ -147,17 +163,33 @@
             else:
                 logger.info("Dep %(Dept)s for Course %(CourseCode)s not found" % course)
+                if not no_import:
+                    no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
+                    no_import.write('"CourseCode","Description","Credits","Dept","Semester","Session","PassMark","CourseKey","Category","AdmStatus"\n')
+                no_import.write('"%(CourseCode)s","%(Description)s","%(Credits)s","%(Dept)s","%(Semester)s","%(Session)s","%(PassMark)s","%(CourseKey)s","%(Category)s","%(AdmStatus)s"\n' % course)
                 continue
             course_id = ''.join(re.split('\W+',course.get('CourseCode')))
             if len(course_id) == 3:
                 course_id = "%s000" % course_id
+            elif course_id.startswith('CHEM'):
+                tid = course_id.replace('CHEM','CHE')
+                logger.info("invalid course_code %(course_id)s renaming to %(tid)s" % vars())
+                course_id = tid
+            elif course_id.startswith('DAIC'):
+                tid = course_id.replace('DAIC','DAC')
+                logger.info("invalid course_code %(course_id)s renaming to %(tid)s" % vars())
+                course_id = tid
+            elif course_id.startswith('DAIM'):
+                tid = course_id.replace('DAIM','DAM')
+                logger.info("invalid course_code %(course_id)s renaming to %(tid)s" % vars())
+                course_id = tid
             elif len(course_id) != 6:
                 logger.info("invalid course_code %(CourseCode)s" % course)
-                #print course_id,course.get('CourseCode'),course.get('Description')
-                continue
-    ##        if course_id in course_list:
-    ##            continue
+                if not no_import:
+                    no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w")
+                    no_import.write('"CourseCode","Description","Credits","Dept","Semester","Session","PassMark","CourseKey","Category","AdmStatus"')
+                no_import.write('"%(CourseCode)s","%(Description)s","%(Credits)s","%(Dept)s","%(Semester)s","%(Session)s","%(PassMark)s","%(CourseKey)s","%(Category)s","%(AdmStatus)s"\n' % course)
+                continue
             c = getattr(dept,course_id,None)
             if c is None:
-                #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
                 logger.info('Creating Course %(CourseCode)s  %(Description)s in Department %(Dept)s' % course)
                 dept.invokeFactory('Course', course_id)
@@ -166,9 +198,17 @@
             dict['code'] = course_id
             dict['org_code'] = course.get('CourseCode') 
-            dict['credits'] = icourse.get('Credits')
+            dict['credits'] = course.get('Credits')
             dict['semester'] = course.get('Semester')
             dict['session'] = course.get('Session')
             dict['category'] = course.get('Category')
-            dict['passmark'] = int(course.get('PassMark'))
+            pm = course.get('PassMark')
+            if pm.find(',') > -1:
+                pm.replace(',','.')
+            elif pm == "":
+                pm = "0.0"
+            try:
+                dict['passmark'] = int(float(pm))
+            except:
+                dict['passmark'] = 0
             c.getContent().edit(mapping=dict)
     ###)
Index: eUP_SRP/trunk/Extensions/install.py
===================================================================
--- /WAeUP_SRP/trunk/Extensions/install.py	(revision 281)
+++ 	(revision )
@@ -1,672 +1,0 @@
-#-*- mode: python; mode: fold -*-
-# $Id$
-from Products.ExternalMethod.ExternalMethod import ExternalMethod
-from Products.CPSInstaller.CPSInstaller import CPSInstaller
-from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent,AccessContentsInformation
-from Products.WAeUP.WAeUPPermissions import UniversityManage, StudentManage,FacultyManage,\
-                                            DepartmentManage,CourseManage
-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
-
-SRPP_ID = "demouni"
-SRPP_TITLE = "Demo University"
-
-class WAeUPInstaller(CPSInstaller):
-    """
-    WAeUP Installer
-    """
-    product_name = "WAeUP"
-
-    def install(self,portal):
-        "install"
-        log = []
-        prlog = log.append
-
-        def pr(msg, prlog=prlog):
-            prlog('%s<br>' % msg)
-
-        product_name = self.product_name
-        pr("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)
-        ###)
-
-        # external methods ###(
-        #
-        ext_methods = ( { 'id': 'waeup_migrate',
-                          'title': 'WAeUP (migrate from an earlier version)',
-                          'script': 'WAeUP.install',
-                          'method': 'migrate',
-                          'protected': 1,
-                        },
-                      )
-        portal_objectIds = portal.objectIds()
-        for meth in ext_methods:
-            method = meth['id']
-            if method in portal_objectIds:
-                portal._delObject(method)
-            pr('Creating %s External Method' % method)
-            ext_method = ExternalMethod(method,
-                                        meth['title'],
-                                        meth['script'],
-                                        meth['method'])
-            portal._setObject(method, ext_method)
-            if method in portal_objectIds:
-                manage_perms = portal[method].manage_permission
-                if meth['protected']:
-                    pr("Protecting %s" % method)
-                    manage_perms(View, roles=['Manager'], acquire=0)
-                    manage_perms(AccessContentsInformation, roles=['Manager'], acquire=0)
-                else:
-                    manage_perms(View, roles=['Manager'], acquire=1)
-        ###)
-
-        ##########################################
-        # Actions
-        ##########################################
-        waeup_ptypes = "'University','StudentsFolder','Student','Jamb','Faculty','Department','Course'"
-        waeup_ptypes += ",'AccoFolder','Accommodation','StudentPersonal','AcademicsFolder'"
-        waeup_ptypes += ",'StudyLevel','Semester','CourseTicket','StudentDocuments','StudentEligibility'"
-        if CPSSubscriptions: ###(
-
-            ptypes = "('Portal', 'CPSMailAccess Message', 'CPSMailAccess Box', 'CPSMailAccess Folder',"\
-                     + waeup_ptypes + ")"
-            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:
-            condition = "object.portal_type not in (%s)" % waeup_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)
-
-###)
-
-        ##########################################
-        # main_tab actions ###(
-        ##########################################
-        path = "/sections/%(SRPP_ID)s" % globals()
-        actions = ( { 'tool'      : 'portal_actions',
-                        'id'        : 'student_administration',
-                        'name'      : 'Students',
-                        'action'    : "python: portal.portal_url.getUrlFromRpath('sections/demouni/students')",
-                        #'action'    : 'string:$portal_url%(path)s/students' % vars(),
-                        'permission': (View, ),
-                        'category'  : 'main_tabs',
-                        'visible'   : 1,
-                      },
-                      { 'tool'      : 'portal_actions',
-                        'id'        : 'academics',
-                        'name'      : 'Academics',
-                        'action'    : "python: portal.portal_url.getUrlFromRpath('sections/demouni/academics')",
-                        #'action'    : 'string:${portal_url}/academics',
-                        'permission': (UniversityManage),
-                        'category'  : 'main_tabs',
-                        'visible'   : 1,
-                      },
-                      { 'tool'      : 'portal_actions',
-                        'id'        : 'accomodation',
-                        'name'      : 'Accommodation',
-                        'action'    : "python: portal.portal_url.getUrlFromRpath('sections/demouni/accommodation')",
-                        #'action'    : 'string:${portal_url}/accommodation',
-                        'permissions': (UniversityManage),
-                        #'permissions': (ModifyPortalContent,UniversityManage,StudentManage),
-                        'category'  : 'main_tabs',
-                        'visible'   : 1,
-                      },
-                      { 'tool'      : 'portal_actions',
-                        'id'        : 'chat',
-                        'name'      : 'Chat',
-                        'action'    : "python: portal.portal_url.getUrlFromRpath('sections/demouni/chat')",
-                        #'action'    : 'string:${portal_url}/accommodation',
-                        'permissions': (View),
-                        #'permissions': (ModifyPortalContent,UniversityManage,StudentManage),
-                        '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.deleteActions({'portal_actions': [action['id'] for action in actions]})
-        self.verifyActions(actions)
-        ##########################################
-###)
-
-        # skins
-        ##########################################
-        pr("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()
-
-        # Themes ###(
-        #
-        # Importing portal themes
-##        theme_container = getattr(portal, 'portal_themes')
-##            # the first theme in each category is the default theme.
-##        themes_list = {'WAeUP':    ({'id': 'waeup_plain_theme',
-##                                  'file': 'waeup_plain_theme.zexp',
-##                                  },
-##                                  {'id': 'waeup_management_theme',
-##                                   'file': 'waeup_management_theme.zexp',
-##                                  },
-##                                 ),
-##                      }
-##
-##
-##        theme_ids = theme_container.objectIds()
-##        theme_container.manage_delObjects(theme_ids)
-##        target_themes = themes_list[Target]
-##        for theme in target_themes:
-##            pr(" Importing %s theme" % theme['id'])
-##            zexppath = os.path.join(zexpdir, theme['file'])
-##            try:
-##                theme_container._importObjectFromFile(zexppath)
-##            except:
-##                pr("    Could not import theme  %s" % theme['id'])
-##
-##        # set the first theme in the list as the default one.
-##        theme_container.setDefaultTheme(target_themes[0]['id'])
-###)
-
-
-        ##########################################
-        # portal types
-        ##########################################
-        dtypes = portal.getWAeUPTypes()
-        self.verifyFlexibleTypes(dtypes)
-        self.allowContentTypes('University', ('Workspace','Section',))
-        ##########################################
-        # Schemas
-        ##########################################
-        pr("Verifying %(product_name)s schemas" % vars())
-        self.verifySchemas(portal.getWAeUPSchemas())
-        ##########################################
-        # widgets
-        ##########################################
-        pr("Verifying %(product_name)s widgets" % vars())
-        self.verifyWidgets(portal.getWAeUPWidgets())
-        ##########################################
-        # layouts
-        ##########################################
-        pr("Verifying %(product_name)s layouts" % vars())
-        self.verifyLayouts(portal.getWAeUPLayouts())
-        ##########################################
-        # Vocabularies
-        ##########################################
-        pr("Verifying %(product_name)s vocabularies" % vars())
-        self.verifyVocabularies(portal.getWAeUPVocabularies())
-        ##########################################
-        # Groups
-        ##########################################
-
-        self.installCustomWorkflows()
-        self.verifyWorkflowAssociation()
-
-        pr("End of specific %(product_name)s install" % vars())
-        #return '\n'.join(log)
-        self.finalize()
-
-    def verifyPortlets(self, portlets=(), object=None): ###(
-        """Verify the existence of given portet in the object's portlet
-        container. If not found, a portlet is instantiated.
-        Existing portlets are not affected.
-
-        'portlets' is a tuple with the dictionaries given by the export tab
-        as entries.
-        The default object is the portal itself.
-
-        return the list a new portlet ids.
-        """
-
-        if object is None:
-            object = self.portal
-
-        self.log('Verifying portlets on %s' % object.absolute_url(relative=1))
-
-        portlet_container = self.getPortletContainer(object, create=1)
-
-        ttool = self.getTool('portal_types')
-
-        returned = []
-        for new_portlet in portlets:
-            existing_portlets = portlet_container.listPortlets()
-            updated = 0
-
-            # Check if the portlet needs an update
-            identifier = new_portlet.get('identifier')
-            if identifier:
-                for portlet in existing_portlets:
-                    if identifier == portlet.identifier:
-                        self.log(" Update of portlet: %s" % portlet)
-                        portlet.edit(**new_portlet)
-                        portlet_id = portlet.getId()
-                        updated = 1
-                        continue
-            slot = new_portlet.get('slot')
-            if slot:
-                for portlet in existing_portlets:
-                    if slot == portlet.slot:
-                        self.log(" Update of portlet: %s" % portlet)
-                        portlet.edit(**new_portlet)
-                        portlet_id = portlet.getId()
-                        updated = 1
-                        continue
-
-            if not updated:
-                self.log("   Creation of portlet: %s" % new_portlet)
-                portlet_id = self.portal.portal_cpsportlets.createPortlet(
-                    ptype_id=new_portlet['type'],
-                    context=object,
-                    **new_portlet)
-            if portlet_id not in returned:
-                returned.append(portlet_id)
-        return returned
-    ###)
-
-
-    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',
-                      'AcademicsFolder': 'waeup_section_wf',
-                      'StudentsFolder': 'waeup_student_wf',
-                      'Student': 'waeup_student_wf',
-                      'StudentPersonal': 'waeup_student_wf',
-                      'StudentEligibility': 'waeup_student_wf',
-                      'StudentDocuments': 'waeup_student_wf',
-                      'Jamb': 'waeup_section_wf',
-                      'ScratchCard': 'waeup_section_wf',
-                      'Faculty': 'waeup_section_wf',
-                      'Department': 'waeup_section_wf',
-                      'Course': 'waeup_section_wf',
-                      'StudyLevel': 'waeup_student_wf',
-                      'Semester': 'waeup_student_wf',
-                      'CourseTicket': 'waeup_student_wf',
-                      'AccoFolder': 'waeup_section_wf',
-                      'Accommodation': 'waeup_section_wf',
-                      }
-
-        self.verifyLocalWorkflowChains(self.portal['workspaces'],
-                                       ws_chains,
-                                       destructive=1)
-        self.verifyLocalWorkflowChains(self.portal['sections'],
-                                       se_chains,
-                                       destructive=1)
-    ###)
-
-    def verifyFaculties(self, academics): ###(
-        """install Universityspecific Faculies with Departments"""
-        faculties = [
-##                     {'id': 'agri', ###(
-##                      'Title': 'Agriculture',
-##                      'departments': [
-##                                     { 'id': 'dep1', ###(
-##                                       'Title': 'One',
-##                                     },
-##                                     ],
-##                      },###)
-                      { 'id': 'science',
-                      'Title': 'Science',
-                      'departments': [
-                                     { 'id': 'bio', ###(
-                                       'Title': 'Biochemistry',
-                                     },
-                                     { 'id': 'bot',
-                                       'Title': 'Botany',
-                                     },
-                                     { 'id': 'che',
-                                       'Title': 'Chemistry',
-                                     },
-                                     { 'id': 'com',
-                                       'Title': 'Computer Science',
-                                     },
-                                     { 'id': 'geo',
-                                       'Title': 'Geologie',
-                                     },
-                                     { 'id': 'mat',
-                                       'Title': 'Mathematics',
-                                     },
-                                     { 'id': 'mic',
-                                       'Title': 'Microbiology',
-                                     },
-                                     { 'id': 'opt',
-                                       'Title': 'Optometry',
-                                     },
-                                     { 'id': 'phy',
-                                       'Title': 'Physics',
-                                     },
-                                     { 'id': 'zoo',
-                                       'Title': 'Zoology',
-                                     },
-                                     ],
-                      },###)
-                     ]###)
-        self.log('Verifying Faculties in %s' % academics.absolute_url(relative=1))
-        for faculty in faculties:
-            fid = faculty['id']
-            f = getattr(academics,fid,None)
-            self.log('Checking Faculty %(id)s = %(Title)s' % faculty)
-            if f is None:
-                self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
-                academics.invokeFactory('Faculty', fid)
-                f = getattr(academics,fid)
-                f.getContent().edit(mapping=faculty)
-            for department in faculty['departments']:
-                self.log('Checking Department %(id)s = %(Title)s' % department)
-                did = department['id']
-                d = getattr(f,did,None)
-                if d is None:
-                    self.log('Creating Department %(id)s = %(Title)s' % department)
-                    f.invokeFactory('Department', did)
-                    d = getattr(f,did)
-                    d.getContent().edit(mapping=department)
-    ###)
-
-
-
-def install(self): ###(
-    installer = WAeUPInstaller(self)
-    installer.install(self)
-    #dirtool = getattr(self,'portal_directories')
-    return installer.logResult()
-    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,SRPP_ID,None)
-    if not waeup:
-        sections.invokeFactory('University',SRPP_ID)
-        waeup = getattr(sections,SRPP_ID)
-        waeup.getContent().edit(mapping={'Title':SRPP_TITLE})
-        waeup.folder_localrole_add(member_ids=('group:Students',),
-                                            member_role='SectionReviewer',
-                                            )
-        waeup.invokeFactory('StudentsFolder','students')
-        students = getattr(waeup,'students').getContent()
-        students.edit(mapping={'Title':'Students'})
-        waeup.folder_localrole_add(member_ids=('group:Students',),
-                                            member_role='SectionReviewer',
-                                            )
-##        waeup.content_create(type_name='AcademicsFolder',title='academics')
-##        sections.waeup.folder_localrole_add(member_ids=('group:StudentManager',),
-##                                            member_role='SectionManager',
-##                                            )
-        waeup.students.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',))
-        waeup.invokeFactory('AcademicsFolder','academics', title='Academics')
-        academics = getattr(waeup,'academics').getContent()
-        academics.edit(mapping={'Title':'Academics'})
-        waeup.invokeFactory('AccoFolder','accommodation', title='Accommodation')
-        accommodation = getattr(waeup,'accommodation').getContent()
-        accommodation.edit(mapping={'Title':'Accommodation'})
-    academics = getattr(waeup,'academics',None)
-    if academics is None:
-        waeup.invokeFactory('AcademicsFolder','academics')
-        academics = getattr(waeup,'academics')
-        academics.getContent().edit(mapping={'Title':'Academics'})
-    installer.verifyFaculties(academics)
-    if not hasattr(waeup,'accommodation'):
-        waeup.invokeFactory('AccoFolder','accommodation')
-        accommodation = getattr(waeup,'accommodation').getContent()
-        accommodation.edit(mapping={'Title':'Accommodation'})
-    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': 0,
-              '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)
-
-###)
-    return installer.logResult()
-    ###)
-
-def migrate(self): ###(
-    "update data"
-    log = []
-    prlog = log.append
-
-    def pr(msg, prlog=prlog):
-        prlog('%s' % msg)
-
-    sections = getattr(self,'sections')
-    waeup = getattr(sections,SRPP_ID,None)
-    pr( "Start migrate")
-    pr("migrating Students")
-    students = getattr(waeup,'students')
-    pr("migrating courses")
-    academics = getattr(waeup,'academics')
-    for fac in [getattr(academics,f.id) for f in academics.contentValues(filter={'portal_type': ('Faculty',)})]:
-        pr("Faculty: %s" % fac.title_or_id())
-        for dep in [getattr(fac,d.id) for d in fac.contentValues(filter={'portal_type': ('Department',)})]:
-            pr("Department: %s" % dep.title_or_id())
-            for course in [getattr(dep,c.id) for c in dep.contentValues(filter={'portal_type': ('Course',)})]:
-                pr("Course: %s" % course.title_or_id())
-                content = course.getContent()
-                heading = getattr(content,'heading',course.id)
-                pr("heading = %(heading)s" % vars())
-                content.edit(mapping={'Title': heading})
-    pr("migrating halls")
-    for ac in [getattr(waeup,a.id) for a in waeup.contentValues(filter={'portal_type': ('AccoFolder',)})]:
-        for hall in [getattr(ac,h.id) for h in ac.contentValues(filter={'portal_type': ('Accommodation',)})]:
-            pr("Hall: %s" % hall.title_or_id())
-            content = hall.getContent()
-            heading = getattr(content,'heading',hall.id)
-            pr("heading = %(heading)s" % vars())
-            content.edit(mapping={'Title': heading})
-    return '\n'.join(log)
-
-###)
-
Index: /WAeUP_SRP/trunk/WAeUPTool.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPTool.py	(revision 281)
+++ /WAeUP_SRP/trunk/WAeUPTool.py	(revision 282)
@@ -21,5 +21,5 @@
 """
 
-from zLOG import LOG, DEBUG
+#from zLOG import LOG, DEBUG
 from Globals import InitializeClass, HTMLFile
 from AccessControl import ClassSecurityInfo
@@ -42,267 +42,267 @@
                       PortalFolder.manage_options[2:])
 
-    _actions = ()
-
-
-    #
-    # ZMI
-    #
-    _properties = (
-        {'id': 'title', 'type': 'string', 'mode': 'w', 
-         'label': 'Title'},
-        {'id': 'uni_id', 'type': 'string', 'mode': 'w', 
-         'label': 'University ID'},
-        {'id': 'uni_name', 'type': 'string', 'mode': 'w', 
-         'label': 'University Name'},
-    )
-    title = ''
-    def __init__(self,uni_id,uni_name):
-        self.manage_changeProperties(uni_id = uni_id,
-                                     uni_name = uni_name,
-                                     )
-        PortalFolder.__init__(self, self.id)
-
-
-    def verifyFaculties(self, academics): ###(
-        """install Universityspecific Faculies with Departments"""
-        faculties = [
-##                     {'id': 'agri', ###(
-##                      'Title': 'Agriculture',
+##    _actions = ()
+##
+##
+##    #
+##    # ZMI
+##    #
+##    _properties = (
+##        {'id': 'title', 'type': 'string', 'mode': 'w', 
+##         'label': 'Title'},
+##        {'id': 'uni_id', 'type': 'string', 'mode': 'w', 
+##         'label': 'University ID'},
+##        {'id': 'uni_name', 'type': 'string', 'mode': 'w', 
+##         'label': 'University Name'},
+##    )
+##    title = ''
+##    def __init__(self,uni_id,uni_name):
+##        self.manage_changeProperties(uni_id = uni_id,
+##                                     uni_name = uni_name,
+##                                     )
+##        PortalFolder.__init__(self, self.id)
+##
+##
+##    def verifyFaculties(self, academics): ###(
+##        """install Universityspecific Faculies with Departments"""
+##        faculties = [
+####                     {'id': 'agri', ###(
+####                      'Title': 'Agriculture',
+####                      'departments': [
+####                                     { 'id': 'dep1', ###(
+####                                       'Title': 'One',
+####                                     },
+####                                     ],
+####                      },###)
+##                      { 'id': 'science',
+##                      'Title': 'Science',
 ##                      'departments': [
-##                                     { 'id': 'dep1', ###(
-##                                       'Title': 'One',
+##                                     { 'id': 'bio', ###(
+##                                       'Title': 'Biochemistry',
+##                                     },
+##                                     { 'id': 'bot',
+##                                       'Title': 'Botany',
+##                                     },
+##                                     { 'id': 'che',
+##                                       'Title': 'Chemistry',
+##                                     },
+##                                     { 'id': 'com',
+##                                       'Title': 'Computer Science',
+##                                     },
+##                                     { 'id': 'geo',
+##                                       'Title': 'Geologie',
+##                                     },
+##                                     { 'id': 'mat',
+##                                       'Title': 'Mathematics',
+##                                     },
+##                                     { 'id': 'mic',
+##                                       'Title': 'Microbiology',
+##                                     },
+##                                     { 'id': 'opt',
+##                                       'Title': 'Optometry',
+##                                     },
+##                                     { 'id': 'phy',
+##                                       'Title': 'Physics',
+##                                     },
+##                                     { 'id': 'zoo',
+##                                       'Title': 'Zoology',
 ##                                     },
 ##                                     ],
 ##                      },###)
-                      { 'id': 'science',
-                      'Title': 'Science',
-                      'departments': [
-                                     { 'id': 'bio', ###(
-                                       'Title': 'Biochemistry',
-                                     },
-                                     { 'id': 'bot',
-                                       'Title': 'Botany',
-                                     },
-                                     { 'id': 'che',
-                                       'Title': 'Chemistry',
-                                     },
-                                     { 'id': 'com',
-                                       'Title': 'Computer Science',
-                                     },
-                                     { 'id': 'geo',
-                                       'Title': 'Geologie',
-                                     },
-                                     { 'id': 'mat',
-                                       'Title': 'Mathematics',
-                                     },
-                                     { 'id': 'mic',
-                                       'Title': 'Microbiology',
-                                     },
-                                     { 'id': 'opt',
-                                       'Title': 'Optometry',
-                                     },
-                                     { 'id': 'phy',
-                                       'Title': 'Physics',
-                                     },
-                                     { 'id': 'zoo',
-                                       'Title': 'Zoology',
-                                     },
-                                     ],
-                      },###)
-                     ]###)
-        #self.log('Verifying Faculties in %s' % academics.absolute_url(relative=1))
-        for faculty in faculties:
-            fid = faculty['id']
-            f = getattr(academics,fid,None)
-            #self.log('Checking Faculty %(id)s = %(Title)s' % faculty)
-            if f is None:
-                #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
-                academics.invokeFactory('Faculty', fid)
-                f = getattr(academics,fid)
-                f.getContent().edit(mapping=faculty)
-            for department in faculty['departments']:
-                #self.log('Checking Department %(id)s = %(Title)s' % department)
-                did = department['id']
-                d = getattr(f,did,None)
-                if d is None:
-                    #self.log('Creating Department %(id)s = %(Title)s' % department)
-                    f.invokeFactory('Department', did)
-                    d = getattr(f,did)
-                    d.getContent().edit(mapping=department)
-    ###)
-
-InitializeClass(WAeUPTool)
-
-def verifyPortlets(portal, portlets=(), object=None): ###(
-    """Verify the existence of given portet in the object's portlet
-    container. If not found, a portlet is instantiated.
-    Existing portlets are not affected.
-    'portlets' is a tuple with the dictionaries given by the export tab
-    as entries.
-    The default object is the portal itself.
-    return the list a new portlet ids.
-    """
-    #self.log('Verifying portlets on %s' % object.absolute_url(relative=1))
-    #portlet_container = CPSInstaller.getPortletContainer(object, create=1)
-    idpc = portal.portal_cpsportlets.getPortletContainerId()
-    if not hasattr(object, idpc):
-##            self.log("   Creating %s/%s" %
-##                (object.absolute_url(relative=1), idpc))
-        object.manage_addProduct['CPSPortlets'].addPortletsContainer()
-    portlet_container = getattr(object, idpc, None)
-    ttool = portal.portal_types
-    returned = []
-    for new_portlet in portlets:
-        existing_portlets = portlet_container.listPortlets()
-        updated = 0
-        # Check if the portlet needs an update
-        identifier = new_portlet.get('identifier')
-        if identifier:
-            for portlet in existing_portlets:
-                if identifier == portlet.identifier:
-                    #portal.log(" Update of portlet: %s" % portlet)
-                    portlet.edit(**new_portlet)
-                    portlet_id = portlet.getId()
-                    updated = 1
-                    continue
-        slot = new_portlet.get('slot')
-        if slot:
-            for portlet in existing_portlets:
-                if slot == portlet.slot:
-                    #portal.log(" Update of portlet: %s" % portlet)
-                    portlet.edit(**new_portlet)
-                    portlet_id = portlet.getId()
-                    updated = 1
-                    continue
-                
-        if not updated:
-            #portal.log("   Creation of portlet: %s" % new_portlet)
-            portlet_id = portal.portal_cpsportlets.createPortlet(
-            ptype_id=new_portlet['type'],
-            context=object,
-            **new_portlet)
-        if portlet_id not in returned:
-            returned.append(portlet_id)
-    return returned
-    ###)
-
-addWAeUPToolForm = HTMLFile('zmi/manage_addWAeUPUniversity',
-                                                globals())
-
-def addWAeUPTool(container, id,
-                             title='WAeUP University',
-                             description='',
-                             langs_list=None,
-                             manager_id='manager',
-                             manager_sn='CPS',
-                             manager_givenName='Manager',
-                             manager_email='',
-                             manager_password='',
-                             manager_password_confirmation='',
-                             REQUEST=None):
-    """Add WAeUPTool"""
-
-    _log = []
-    def pr(bla, zlog=1, _log=_log):
-        if bla == 'flush':
-            return '<br/>\n'.join(_log)
-        _log.append(bla)
-        if (bla and zlog):
-            LOG('addWAeUPUniversity:', INFO, bla)
-
-    uni_id = id.strip()
-    uni_name = title.strip()
-    description = description.strip()
-    manager_id = manager_id.strip()
-
-##    if not id:
-##        raise ValueError, "You have to provide an id for the portal!"
-##    if not manager_id:
-##        raise ValueError, "You have to provide an id for the CPS Administrator!"
-##    if not manager_email:
-##        raise ValueError, "You have to provide an email address for the CPS Administrator!"
-##    if not manager_password:
-##        raise ValueError, "You have to provide CPS Administrator password!"
-##    if manager_password != manager_password_confirmation:
-##        raise ValueError, "Password confirmation does not match password!"
-
-    email_from_name = ('%s %s' % (manager_givenName, manager_sn)).strip()
-    wt = WAeUPTool(uni_id,uni_name)
-    id = wt.getId()
-    container._setObject(id, wt)
-    sections = getattr(container,'sections')
-    workspaces = getattr(container,'workspaces') 
-    sections.invokeFactory('University',uni_id)
-    uni = getattr(sections,uni_id)
-    uni.getContent().edit(title=uni_name)
-    uni.invokeFactory('StudentsFolder','students')
-    students = getattr(uni,'students').getContent()
-    students.edit(mapping={'Title':'Students'})
-##    uni.folder_localrole_add(member_ids=('group:Students',),
-##                                            member_role='SectionReviewer',
-##                                            )
-##        uni.content_create(type_name='AcademicsFolder',title='academics')
-##        sections.uni.folder_localrole_add(member_ids=('group:StudentManager',),
-##                                            member_role='SectionManager',
-##                                            )
-##        uni.students.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',))
-    uni.invokeFactory('AcademicsFolder','academics', title='Academics')
-    academics = getattr(uni,'academics').getContent()
-    academics.edit(mapping={'Title':'Academics'})
-    uni.invokeFactory('AccoFolder','accommodation', title='Accommodation')
-    accommodation = getattr(uni,'accommodation').getContent()
-    accommodation.edit(mapping={'Title':'Accommodation'})
-    academics = getattr(uni,'academics',None)
-    if academics is None:
-        uni.invokeFactory('AcademicsFolder','academics')
-        academics = getattr(uni,'academics')
-        academics.getContent().edit(mapping={'Title':'Academics'})
-    wt.verifyFaculties(academics)
-    if not hasattr(uni,'accommodation'):
-        uni.invokeFactory('AccoFolder','accommodation')
-        accommodation = getattr(uni,'accommodation').getContent()
-        accommodation.edit(mapping={'Title':'Accommodation'})
-    #uni.manage_setLocalGroupRoles(groupid = 'role:Anonymous',roles=('SectionReader',))
-    # portlets ###(
-    #
-    portlets = (
-              {#'identifier': 'waeup_breadcrumbs',
-              'type': 'Breadcrumbs Portlet',
-              'slot': 'waeup_breadcrumbs',
-              'first_item': 0,
-              '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',
-              },
-            )
-    #verifyPortletContainer(uni)
-    verifyPortlets(container,portlets,uni)
-
-    ###)
-    if REQUEST is not None:
-        url = container.absolute_url()
-        REQUEST.RESPONSE.redirect('%s/manage_main' % url)
-
+##                     ]###)
+##        #self.log('Verifying Faculties in %s' % academics.absolute_url(relative=1))
+##        for faculty in faculties:
+##            fid = faculty['id']
+##            f = getattr(academics,fid,None)
+##            #self.log('Checking Faculty %(id)s = %(Title)s' % faculty)
+##            if f is None:
+##                #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
+##                academics.invokeFactory('Faculty', fid)
+##                f = getattr(academics,fid)
+##                f.getContent().edit(mapping=faculty)
+##            for department in faculty['departments']:
+##                #self.log('Checking Department %(id)s = %(Title)s' % department)
+##                did = department['id']
+##                d = getattr(f,did,None)
+##                if d is None:
+##                    #self.log('Creating Department %(id)s = %(Title)s' % department)
+##                    f.invokeFactory('Department', did)
+##                    d = getattr(f,did)
+##                    d.getContent().edit(mapping=department)
+##    ###)
+##
+##InitializeClass(WAeUPTool)
+##
+##def verifyPortlets(portal, portlets=(), object=None): ###(
+##    """Verify the existence of given portet in the object's portlet
+##    container. If not found, a portlet is instantiated.
+##    Existing portlets are not affected.
+##    'portlets' is a tuple with the dictionaries given by the export tab
+##    as entries.
+##    The default object is the portal itself.
+##    return the list a new portlet ids.
+##    """
+##    #self.log('Verifying portlets on %s' % object.absolute_url(relative=1))
+##    #portlet_container = CPSInstaller.getPortletContainer(object, create=1)
+##    idpc = portal.portal_cpsportlets.getPortletContainerId()
+##    if not hasattr(object, idpc):
+####            self.log("   Creating %s/%s" %
+####                (object.absolute_url(relative=1), idpc))
+##        object.manage_addProduct['CPSPortlets'].addPortletsContainer()
+##    portlet_container = getattr(object, idpc, None)
+##    ttool = portal.portal_types
+##    returned = []
+##    for new_portlet in portlets:
+##        existing_portlets = portlet_container.listPortlets()
+##        updated = 0
+##        # Check if the portlet needs an update
+##        identifier = new_portlet.get('identifier')
+##        if identifier:
+##            for portlet in existing_portlets:
+##                if identifier == portlet.identifier:
+##                    #portal.log(" Update of portlet: %s" % portlet)
+##                    portlet.edit(**new_portlet)
+##                    portlet_id = portlet.getId()
+##                    updated = 1
+##                    continue
+##        slot = new_portlet.get('slot')
+##        if slot:
+##            for portlet in existing_portlets:
+##                if slot == portlet.slot:
+##                    #portal.log(" Update of portlet: %s" % portlet)
+##                    portlet.edit(**new_portlet)
+##                    portlet_id = portlet.getId()
+##                    updated = 1
+##                    continue
+##                
+##        if not updated:
+##            #portal.log("   Creation of portlet: %s" % new_portlet)
+##            portlet_id = portal.portal_cpsportlets.createPortlet(
+##            ptype_id=new_portlet['type'],
+##            context=object,
+##            **new_portlet)
+##        if portlet_id not in returned:
+##            returned.append(portlet_id)
+##    return returned
+##    ###)
+##
+##addWAeUPToolForm = HTMLFile('zmi/manage_addWAeUPUniversity',
+##                                                globals())
+##
+##def addWAeUPTool(container, id,
+##                             title='WAeUP University',
+##                             description='',
+##                             langs_list=None,
+##                             manager_id='manager',
+##                             manager_sn='CPS',
+##                             manager_givenName='Manager',
+##                             manager_email='',
+##                             manager_password='',
+##                             manager_password_confirmation='',
+##                             REQUEST=None):
+##    """Add WAeUPTool"""
+##
+##    _log = []
+##    def pr(bla, zlog=1, _log=_log):
+##        if bla == 'flush':
+##            return '<br/>\n'.join(_log)
+##        _log.append(bla)
+##        if (bla and zlog):
+##            LOG('addWAeUPUniversity:', INFO, bla)
+##
+##    uni_id = id.strip()
+##    uni_name = title.strip()
+##    description = description.strip()
+##    manager_id = manager_id.strip()
+##
+####    if not id:
+####        raise ValueError, "You have to provide an id for the portal!"
+####    if not manager_id:
+####        raise ValueError, "You have to provide an id for the CPS Administrator!"
+####    if not manager_email:
+####        raise ValueError, "You have to provide an email address for the CPS Administrator!"
+####    if not manager_password:
+####        raise ValueError, "You have to provide CPS Administrator password!"
+####    if manager_password != manager_password_confirmation:
+####        raise ValueError, "Password confirmation does not match password!"
+##
+##    email_from_name = ('%s %s' % (manager_givenName, manager_sn)).strip()
+##    wt = WAeUPTool(uni_id,uni_name)
+##    id = wt.getId()
+##    container._setObject(id, wt)
+##    sections = getattr(container,'sections')
+##    workspaces = getattr(container,'workspaces') 
+##    sections.invokeFactory('University',uni_id)
+##    uni = getattr(sections,uni_id)
+##    uni.getContent().edit(title=uni_name)
+##    uni.invokeFactory('StudentsFolder','students')
+##    students = getattr(uni,'students').getContent()
+##    students.edit(mapping={'Title':'Students'})
+####    uni.folder_localrole_add(member_ids=('group:Students',),
+####                                            member_role='SectionReviewer',
+####                                            )
+####        uni.content_create(type_name='AcademicsFolder',title='academics')
+####        sections.uni.folder_localrole_add(member_ids=('group:StudentManager',),
+####                                            member_role='SectionManager',
+####                                            )
+####        uni.students.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',))
+##    uni.invokeFactory('AcademicsFolder','academics', title='Academics')
+##    academics = getattr(uni,'academics').getContent()
+##    academics.edit(mapping={'Title':'Academics'})
+##    uni.invokeFactory('AccoFolder','accommodation', title='Accommodation')
+##    accommodation = getattr(uni,'accommodation').getContent()
+##    accommodation.edit(mapping={'Title':'Accommodation'})
+##    academics = getattr(uni,'academics',None)
+##    if academics is None:
+##        uni.invokeFactory('AcademicsFolder','academics')
+##        academics = getattr(uni,'academics')
+##        academics.getContent().edit(mapping={'Title':'Academics'})
+##    wt.verifyFaculties(academics)
+##    if not hasattr(uni,'accommodation'):
+##        uni.invokeFactory('AccoFolder','accommodation')
+##        accommodation = getattr(uni,'accommodation').getContent()
+##        accommodation.edit(mapping={'Title':'Accommodation'})
+##    #uni.manage_setLocalGroupRoles(groupid = 'role:Anonymous',roles=('SectionReader',))
+##    # portlets ###(
+##    #
+##    portlets = (
+##              {#'identifier': 'waeup_breadcrumbs',
+##              'type': 'Breadcrumbs Portlet',
+##              'slot': 'waeup_breadcrumbs',
+##              'first_item': 0,
+##              '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',
+##              },
+##            )
+##    #verifyPortletContainer(uni)
+##    verifyPortlets(container,portlets,uni)
+##
+##    ###)
+##    if REQUEST is not None:
+##        url = container.absolute_url()
+##        REQUEST.RESPONSE.redirect('%s/manage_main' % url)
+##
Index: /WAeUP_SRP/trunk/exportimport.py
===================================================================
--- /WAeUP_SRP/trunk/exportimport.py	(revision 281)
+++ /WAeUP_SRP/trunk/exportimport.py	(revision 282)
@@ -42,481 +42,481 @@
 # WAeUP/profiles/default/ directory.
 
-def installFaculties( academics): ###(
-    """install Universityspecific Faculies with Departments"""
-    faculties = [ ###(
-                  {'id': 'agriculture', ###(
-                      'Title': 'Agriculture',
-                      'departments': [
-##                                     { 'id': 'dep1', ###(
-##                                       'Title': 'One',
-##                                     },
-                                     ],
-                      },###)
-                  ###)
-                  {'id': 'arts', ###(
-                      'Title': 'Arts',
-                      'departments': [
-##                                     { 'id': 'dep1', ###(
-##                                       'Title': 'One',
-##                                     },
-                                     ],
-                      },###)
-                  ###)
-                  {'id': 'BasicMedicalSciences', ###(
-                      'Title': 'Basic Medical Sciences',
-                      'departments': [
-##                                     { 'id': 'dep1', ###(
-##                                       'Title': 'One',
-##                                     },
-                                     ],
-                      },###)
-                  ###)
-                  {'id': 'science', ###(
-                  'Title': 'Science',
-                  'departments': [
-                                 { 'id': 'bio', ###(
-                                   'Title': 'Biochemistry',
-                                 },
-                                 { 'id': 'bot',
-                                   'Title': 'Botany',
-                                 },
-                                 { 'id': 'che',
-                                   'Title': 'Chemistry',
-                                 },
-                                 { 'id': 'com',
-                                   'Title': 'Computer Science',
-                                 },
-                                 { 'id': 'geo',
-                                   'Title': 'Geologie',
-                                 },
-                                 { 'id': 'mat',
-                                   'Title': 'Mathematics',
-                                 },
-                                 { 'id': 'mic',
-                                   'Title': 'Microbiology',
-                                 },
-                                 { 'id': 'opt',
-                                   'Title': 'Optometry',
-                                 },
-                                 { 'id': 'phy',
-                                   'Title': 'Physics',
-                                 },
-                                 { 'id': 'zoo',
-                                   'Title': 'Zoology',
-                                 },
-                                 ],
-                  },###)
-                 ]###)
-                 
-                ###)
-
-    for faculty in faculties:
-        fid = faculty['id']
-        f = getattr(academics,fid,None)
-        if f is None:
-            #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
-            academics.invokeFactory('Faculty', fid)
-            f = getattr(academics,fid)
-            f.getContent().edit(mapping=faculty)
-        for department in faculty['departments']:
-            #self.log('Checking Department %(id)s = %(Title)s' % department)
-            did = department['id']
-            d = getattr(f,did,None)
-            if d is None:
-                #self.log('Creating Department %(id)s = %(Title)s' % department)
-                f.invokeFactory('Department', did)
-                d = getattr(f,did)
-                d.getContent().edit(mapping=department)
-###)
-
-def loadFacultiesFromCSV(academics,site,context): ###(
-    """install Universityspecific Faculies from CSV values"""
-    #return
-    logger = context.getLogger('loadfaculties')
-    logger.info('Start loading Faculties')
-    try:
-        faculties = csv.DictReader(open("%s/import/faculty.csv" % i_home,"rb"))
-    except:
-        return
-    l = site.portal_catalog({'meta_type': "Faculty"})
-    facs = {}
-    for f in l:
-        facs[f.id] = f.getObject()
-    for faculty in faculties:
-        logger.info('processing %(Session)s %(FacultyCode)s %(Description)s %(CollegeCode)s %(FacultyKey)s %(Status)s %(degree_grade)s %(Bankcode)s' % faculty)
-        fid = faculty['FacultyCode']
-        f = facs.get(fid,None)
-        if f is None:
-            #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
-            logger.info('Creating Faculty with ID %(FacultyCode)s %(Description)s' % faculty)
-            academics.invokeFactory('Faculty', fid)
-            f = getattr(academics,fid)
-        d = {'Title': faculty['Description']}
-        f.getContent().edit(mapping=d)
-###)
-
-def loadDepartmentsFromCSV(academics,site,context): ###(
-    """install Universityspecific Faculies from CSV values"""
-    #return
-    logger = context.getLogger('loaddepartments')
-    try:
-        deps = csv.DictReader(open("%s/import/departments.csv" % i_home,"rb"))
-    except:
-        return
-    l = site.portal_catalog({'meta_type': "Faculty"})
-    facs = {}
-    for f in l:
-        facs[f.id] = f.getObject()
-    for dep in deps:
-        logger.info('Processing %(Session)s %(DeptCode)s %(Description)s %(FacultyCode)s' % dep)
-        fid = dep['FacultyCode']
-        f = facs.get(fid,None)
-        if f is None:
-            logger.info( "No Faculty with ID: %s" % fid)
-        else:
-            did = dep.get('DeptCode')
-            d = getattr(f,did,None)
-            if d is None or d.portal_type == "Faculty":
-                #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
-                logger.info('Creating Department %(DeptCode)s = %(Description)s' % dep)
-                f.invokeFactory('Department', did)
-                d = getattr(f,did)
-            dict = {'Title': dep['Description']}
-            d.getContent().edit(mapping=dict)
-###)
-
-def loadCoursesFromCSV(academics,site,context): ###(
-    """install Universityspecific Courses from CSV values"""
-    #return
-    logger = context.getLogger('loadcourses')
-    try:
-        courses = csv.DictReader(open("%s/import/courses.csv" % i_home,"rb"))
-    except:
-        return
-    l = site.portal_catalog({'meta_type': "Faculty"})
-    facs = {}
-    for f in l:
-        facs[f.id] = f.getObject()
-    dl = site.portal_catalog({'meta_type': "Department"})
-    deps = {}
-    for d in dl:
-        deps[d.id] = d.getObject()
-    cl = site.portal_catalog({'meta_type': "Course"})
-    course_list = [ c.id for c in cl]
-    for course in courses:
-        logger.info('Processing %(CourseCode)s %(Description)s %(Credits)s %(Dept)s %(Semester)s %(Session)s %(PassMark)s %(CourseKey)s %(Category)s %(AdmStatus)s %(FORMERCODE)s' % course)
-        if course.get("FORMERCODE").endswith('BITS'):
-            continue
-        depid = course.get('Dept').upper()
-        if depid in deps.keys():
-            dept= deps.get(depid)
-##        elif depid in facs.keys():
-##            dept= facs.get(depid)
-        else:
-            logger.info("Dep %(Dept)s for Course %(CourseCode)s not found" % course)
-            continue
-        course_id = ''.join(re.split('\W+',course.get('CourseCode')))
-        if len(course_id) == 3:
-            course_id = "%s000" % course_id
-        elif len(course_id) != 6:
-            logger.info("invalid course_code %(CourseCode)s" % course)
-            #print course_id,course.get('CourseCode'),course.get('Description')
-            continue
-##        if course_id in course_list:
-##            continue
-        c = getattr(dept,course_id,None)
-        if c is None:
-            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
-            logger.info('Creating Course %(CourseCode)s  %(Description)s in Department %(Dept)s' % course)
-            dept.invokeFactory('Course', course_id)
-            c = getattr(dept,course_id)
-        dict = {'Title': course['Description']}
-        dict['code'] = course_id
-        dict['org_code'] = course.get('CourseCode') 
-        dict['credits'] = course.get('Credits')
-        dict['semester'] = course.get('Semester')
-        dict['session'] = course.get('Session')
-        dict['category'] = course.get('Category')
-        dict['passmark'] = course.get('PassMark')
-        c.getContent().edit(mapping=dict)
-###)
-
-def loadCertificatesFromCSV(site,context): ###(
-    """install Universityspecific Certificates from CSV values"""
-    #return
-    logger = context.getLogger('loadcertificates')
-    try:
-        certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb"))
-    except:
-        return
-    f_ids = [f.id for f in site.portal_catalog({'meta_type': "Faculty"})]
-    #d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]
-    dl = site.portal_catalog({'meta_type': "Department"})
-    deps = {}
-    for d in dl:
-        deps[d.id] = d.getObject()
-    for certificate in certificates:
-        logger.info('Processing %(CertCode)s %(Description)s %(Faculty)s %(MaxPass)s %(MaxLoad)s %(session)s %(PromotionCredits)s %(Probationcredits)s %(StartLevel)s %(endLevel)s %(Nyears)s %(Ncore)s %(MaxElect)s %(MPREFIX)s %(Dept)s %(Admstatus)s %(category)s' % certificate)
-        depid = certificate.get('Dept')
-        facid = certificate.get('Faculty')
-        if facid not in f_ids:
-            logger.info('Faculty %(Faculty)s for %(CertCode)s %(Description)s not found' % certificate)
-            continue
-        if not deps.has_key(depid):
-            logger.info('Department %(Dept)s for %(CertCode)s %(Description)s not found' % certificate)
-            continue
-        certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate
-        dep = deps[depid]
-        c = getattr(dep,certificate_id,None)
-        if c is None:
-            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
-            logger.info('Creating certificate %(CertCode)s  %(Description)s in Department %(Dept)s' % certificate)
-            dep.invokeFactory('Certificate', certificate_id)
-            c = getattr(dep,certificate_id)
-        dict = {'Title': certificate['Description']}
-        code = certificate.get('CertCode')
-        code = code.replace('.','')
-        code = code.replace('(','')
-        code = code.replace(')','')
-        code = code.replace('/','')
-        code = code.replace(' ','')
-        code = code.replace('_','')
-        dict['code'] = code
-        dict['faculty'] = certificate.get('Faculty') 
-        dict['department'] = certificate.get('Dept') 
-        dict['max_pass'] = certificate.get('MaxPass')
-        dict['max_load'] = certificate.get('MaxLoad')
-        dict['admin_status'] = certificate.get('Admstatus')
-        dict['category'] = certificate.get('category')
-        dict['m_prefix'] = certificate.get('MPREFIX')
-        dict['nr_years'] = int(certificate.get('Nyears'))
-        nc = certificate.get('Ncore','1')
-        try: 
-            dict['n_core'] = int(nc)
-        except:
-            dict['n_core'] = 1
-        dict['start_level'] = certificate.get('StartLevel')
-        dict['end_level'] = certificate.get('endLevel')
-        dict['promotion_credits'] = certificate.get('PromotionCredits')
-        dict['probation_credits'] = certificate.get('ProbationCredits')
-        c.getContent().edit(mapping=dict)
-###)
-
-def oldloadCertificatesFromCSV(certfolder,site,context): ###(
-    """install Universityspecific Certificates from CSV values"""
-    logger = context.getLogger('loadcertificates')
-    certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb"))
-    f_ids = [f.id for f in site.portal_catalog({'meta_type': "Faculty"})]
-    d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]
-    for certificate in certificates:
-        depid = certificate.get('Dept')
-        facid = certificate.get('Faculty')
-        if facid not in f_ids:
-            logger.info('Faculty %(Faculty)s for %(CertCode)s %(Description)s not found' % certificate)
-            continue
-        if depid not in d_ids:
-            logger.info('Department %(Dept)s for %(CertCode)s %(Description)s not found' % certificate)
-            continue
-        certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate
-        c = getattr(certfolder,certificate_id,None)
-        if c is None:
-            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
-            logger.info('Creating certificate %(CertCode)s  %(Description)s in Department %(Dept)s' % certificate)
-            certfolder.invokeFactory('Certificate', certificate_id)
-            c = getattr(certfolder,certificate_id)
-        dict = {'Title': certificate['Description']}
-        code = certificate.get('CertCode')
-        code = code.replace('.','')
-        code = code.replace('(','')
-        code = code.replace(')','')
-        code = code.replace('/','')
-        code = code.replace(' ','')
-        code = code.replace('_','')
-        dict['code'] = code
-        dict['faculty'] = certificate.get('Faculty') 
-        dict['department'] = certificate.get('Dept') 
-        dict['max_pass'] = certificate.get('MaxPass')
-        dict['max_load'] = certificate.get('MaxLoad')
-        dict['admin_status'] = certificate.get('Admstatus')
-        dict['category'] = certificate.get('category')
-        dict['m_prefix'] = certificate.get('MPREFIX')
-        dict['nr_years'] = int(certificate.get('Nyears'))
-        nc = certificate.get('Ncore','1')
-        try: 
-            dict['n_core'] = int(nc)
-        except:
-            dict['n_core'] = 1
-        dict['start_level'] = certificate.get('StartLevel')
-        dict['end_level'] = certificate.get('endLevel')
-        dict['promotion_credits'] = certificate.get('PromotionCredits')
-        dict['probation_credits'] = certificate.get('ProbationCredits')
-        c.getContent().edit(mapping=dict)
-###)
-
-def loadCertificateCoursesFromCSV(site,context): ###(
-    """install Certificate Courses from CSV values"""
-    #return
-    logger = context.getLogger('loadcertificatecourses')
-    try:
-        cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb"))
-    except:
-        return
-    d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]
-    for cert_course in cert_courses:
-        logger.info('Processing %(CosCode)s %(CertCode)s %(CoreKey)s %(Session)s %(Level)s %(Core)s %(Elective)s %(Mandatory)s %(AdmStatus)s %(Dept)s %(Semester)s' % cert_course)
-        depid = cert_course.get('Dept')
-        code = cert_course.get('CertCode')
-        code = code.replace('.','')
-        code = code.replace('(','')
-        code = code.replace(')','')
-        code = code.replace('/','')
-        code = code.replace(' ','')
-        code = code.replace('_','')
-        if cert_course.get('Session') != '2002/2003':
-            continue
-        certificate = site.portal_catalog({'meta_type': "Certificate",
-                                           'SearchableText': code})
-        if not certificate:
-            print code
-            logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course)
-            continue
-        certificate = certificate[-1].getObject()
-        certificate_code = certificate.getId()
-        if depid not in d_ids:
-            logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course)
-            continue
-        course_code = cert_course.get('CosCode')
-        level = cert_course.get('Level')
-        l = getattr(certificate,level,None)
-        if l is None:
-            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
-            logger.info('Creating Level %(Level)s in certificate %(CertCode)s' % cert_course)
-            certificate.invokeFactory('StudyLevel', level)
-            l = getattr(certificate, level)
-            l.invokeFactory('Semester','first')
-            l.invokeFactory('Semester','second')
-        first_s = getattr(l,'first')
-        second_s = getattr(l,'second')
-        if cert_course.get('Semester') == '1':
-            semester = first_s
-        else:
-            semester = second_s
-        if hasattr(semester,course_code):
-            logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course)
-            continue
-            
-        semester.invokeFactory('CertificateCourse',course_code)
-        cc = getattr(semester,course_code)
-        dict = {}
-        dict['code'] = cert_course.get('CosCode')
-        dict['certificate_code'] = code
-        dict['certificate_code_org'] = cert_course.get('CertCode') 
-        dict['department'] = cert_course.get('Dept') 
-        dict['admin_status'] = cert_course.get('Admstatus')
-        dict['session'] = cert_course.get('Session')
-        if cert_course.get('Core') != '':
-            dict['core_or_elective'] = True
-        else:
-            dict['core_or_elective'] = False
-        dict['level'] = cert_course.get('Level')
-        cc.getContent().edit(mapping=dict)
-###)
-
-def old_loadCertificateCoursesFromCSV(certfolder,site,context): ###(
-    """install Certificate Courses from CSV values"""
-    return
-    logger = context.getLogger('loadcertificatecourses')
-    cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb"))
-    d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]
-    for cert_course in cert_courses:
-        depid = cert_course.get('Dept')
-        code = cert_course.get('CertCode')
-        code = code.replace('.','')
-        code = code.replace('(','')
-        code = code.replace(')','')
-        code = code.replace('/','')
-        code = code.replace(' ','')
-        code = code.replace('_','')
-        if cert_course.get('Session') != '2002/2003':
-            continue
-        certificate = site.portal_catalog({'meta_type': "Certificate",
-                                           'SearchableText': code})
-        if not certificate:
-            print code
-            logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course)
-            continue
-        certificate = certificate[-1].getObject()
-        certificate_code = certificate.getId()
-        if depid not in d_ids:
-            logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course)
-            continue
-        course_code = cert_course.get('CosCode')
-        level = cert_course.get('Level')
-        l = getattr(certificate,level,None)
-        if l is None:
-            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
-            logger.info('Creating Level %(Level)s in certificate %(CertCode)s' % cert_course)
-            certificate.invokeFactory('StudyLevel', level)
-            l = getattr(certificate, level)
-            l.invokeFactory('Semester','first')
-            l.invokeFactory('Semester','second')
-        first_s = getattr(l,'first')
-        second_s = getattr(l,'second')
-        if cert_course.get('Semester') == '1':
-            semester = first_s
-        else:
-            semester = second_s
-        if hasattr(semester,course_code):
-            logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course)
-            continue
-            
-        semester.invokeFactory('CertificateCourse',course_code)
-        cc = getattr(semester,course_code)
-        dict = {}
-        dict['code'] = cert_course.get('CosCode')
-        dict['certificate_code'] = code
-        dict['certificate_code_org'] = cert_course.get('CertCode') 
-        dict['department'] = cert_course.get('Dept') 
-        dict['admin_status'] = cert_course.get('Admstatus')
-        dict['session'] = cert_course.get('Session')
-        if cert_course.get('Core') != '':
-            dict['core_or_elective'] = True
-        else:
-            dict['core_or_elective'] = False
-        dict['level'] = cert_course.get('Level')
-        cc.getContent().edit(mapping=dict)
-###)
-
-def setupStructure(site,context): ###(
-    portal = getattr(site,'uniportal',None)
-    if portal is None:
-        site.invokeFactory('University','uniportal')
-        portal = getattr(site,'uniportal',None)
-        portal.getContent().edit(mapping={'Title':SRPP_TITLE})
-    students =  getattr(portal,'students',None)
-    if students is None:
-        portal.invokeFactory('StudentsFolder','students')
-        students = getattr(portal,'students').getContent()
-        students.edit(mapping={'Title':'Students'})
-    academics = getattr(portal,'academics',None)
-    if academics is None:
-        portal.invokeFactory('AcademicsFolder','academics')
-        academics = getattr(portal,'academics')
-        academics.getContent().edit(mapping={'Title':'Academics'})
-    loadFacultiesFromCSV(academics,site,context)
-    loadDepartmentsFromCSV(academics,site,context)
-    loadCoursesFromCSV(academics,site,context)
-##    certificates = getattr(academics,'certificates',None)
-##    if certificates is None:
-##        academics.invokeFactory('SCFolder','certificates')
-##        certificates = getattr(academics,'certificates')
-##        certificates.getContent().edit(mapping={'Title':'Certificates'})
-    loadCertificatesFromCSV(site,context)
-    loadCertificateCoursesFromCSV(site,context)
-    if not hasattr(portal,'accommodation'):
-        portal.invokeFactory('AccoFolder','accommodation')
-        accommodation = getattr(portal,'accommodation').getContent()
-        accommodation.edit(mapping={'Title':'Accommodation'})
-###)
+##def installFaculties( academics): ###(
+##    """install Universityspecific Faculies with Departments"""
+##    faculties = [ ###(
+##                  {'id': 'agriculture', ###(
+##                      'Title': 'Agriculture',
+##                      'departments': [
+####                                     { 'id': 'dep1', ###(
+####                                       'Title': 'One',
+####                                     },
+##                                     ],
+##                      },###)
+##                  ###)
+##                  {'id': 'arts', ###(
+##                      'Title': 'Arts',
+##                      'departments': [
+####                                     { 'id': 'dep1', ###(
+####                                       'Title': 'One',
+####                                     },
+##                                     ],
+##                      },###)
+##                  ###)
+##                  {'id': 'BasicMedicalSciences', ###(
+##                      'Title': 'Basic Medical Sciences',
+##                      'departments': [
+####                                     { 'id': 'dep1', ###(
+####                                       'Title': 'One',
+####                                     },
+##                                     ],
+##                      },###)
+##                  ###)
+##                  {'id': 'science', ###(
+##                  'Title': 'Science',
+##                  'departments': [
+##                                 { 'id': 'bio', ###(
+##                                   'Title': 'Biochemistry',
+##                                 },
+##                                 { 'id': 'bot',
+##                                   'Title': 'Botany',
+##                                 },
+##                                 { 'id': 'che',
+##                                   'Title': 'Chemistry',
+##                                 },
+##                                 { 'id': 'com',
+##                                   'Title': 'Computer Science',
+##                                 },
+##                                 { 'id': 'geo',
+##                                   'Title': 'Geologie',
+##                                 },
+##                                 { 'id': 'mat',
+##                                   'Title': 'Mathematics',
+##                                 },
+##                                 { 'id': 'mic',
+##                                   'Title': 'Microbiology',
+##                                 },
+##                                 { 'id': 'opt',
+##                                   'Title': 'Optometry',
+##                                 },
+##                                 { 'id': 'phy',
+##                                   'Title': 'Physics',
+##                                 },
+##                                 { 'id': 'zoo',
+##                                   'Title': 'Zoology',
+##                                 },
+##                                 ],
+##                  },###)
+##                 ]###)
+##                 
+##                ###)
+##
+##    for faculty in faculties:
+##        fid = faculty['id']
+##        f = getattr(academics,fid,None)
+##        if f is None:
+##            #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
+##            academics.invokeFactory('Faculty', fid)
+##            f = getattr(academics,fid)
+##            f.getContent().edit(mapping=faculty)
+##        for department in faculty['departments']:
+##            #self.log('Checking Department %(id)s = %(Title)s' % department)
+##            did = department['id']
+##            d = getattr(f,did,None)
+##            if d is None:
+##                #self.log('Creating Department %(id)s = %(Title)s' % department)
+##                f.invokeFactory('Department', did)
+##                d = getattr(f,did)
+##                d.getContent().edit(mapping=department)
+#####)
+##
+##def loadFacultiesFromCSV(academics,site,context): ###(
+##    """install Universityspecific Faculies from CSV values"""
+##    #return
+##    logger = context.getLogger('loadfaculties')
+##    logger.info('Start loading Faculties')
+##    try:
+##        faculties = csv.DictReader(open("%s/import/faculty.csv" % i_home,"rb"))
+##    except:
+##        return
+##    l = site.portal_catalog({'meta_type': "Faculty"})
+##    facs = {}
+##    for f in l:
+##        facs[f.id] = f.getObject()
+##    for faculty in faculties:
+##        logger.info('processing %(Session)s %(FacultyCode)s %(Description)s %(CollegeCode)s %(FacultyKey)s %(Status)s %(degree_grade)s %(Bankcode)s' % faculty)
+##        fid = faculty['FacultyCode']
+##        f = facs.get(fid,None)
+##        if f is None:
+##            #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)
+##            logger.info('Creating Faculty with ID %(FacultyCode)s %(Description)s' % faculty)
+##            academics.invokeFactory('Faculty', fid)
+##            f = getattr(academics,fid)
+##        d = {'Title': faculty['Description']}
+##        f.getContent().edit(mapping=d)
+#####)
+##
+##def loadDepartmentsFromCSV(academics,site,context): ###(
+##    """install Universityspecific Faculies from CSV values"""
+##    #return
+##    logger = context.getLogger('loaddepartments')
+##    try:
+##        deps = csv.DictReader(open("%s/import/departments.csv" % i_home,"rb"))
+##    except:
+##        return
+##    l = site.portal_catalog({'meta_type': "Faculty"})
+##    facs = {}
+##    for f in l:
+##        facs[f.id] = f.getObject()
+##    for dep in deps:
+##        logger.info('Processing %(Session)s %(DeptCode)s %(Description)s %(FacultyCode)s' % dep)
+##        fid = dep['FacultyCode']
+##        f = facs.get(fid,None)
+##        if f is None:
+##            logger.info( "No Faculty with ID: %s" % fid)
+##        else:
+##            did = dep.get('DeptCode')
+##            d = getattr(f,did,None)
+##            if d is None or d.portal_type == "Faculty":
+##                #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
+##                logger.info('Creating Department %(DeptCode)s = %(Description)s' % dep)
+##                f.invokeFactory('Department', did)
+##                d = getattr(f,did)
+##            dict = {'Title': dep['Description']}
+##            d.getContent().edit(mapping=dict)
+#####)
+##
+##def loadCoursesFromCSV(academics,site,context): ###(
+##    """install Universityspecific Courses from CSV values"""
+##    #return
+##    logger = context.getLogger('loadcourses')
+##    try:
+##        courses = csv.DictReader(open("%s/import/courses.csv" % i_home,"rb"))
+##    except:
+##        return
+##    l = site.portal_catalog({'meta_type': "Faculty"})
+##    facs = {}
+##    for f in l:
+##        facs[f.id] = f.getObject()
+##    dl = site.portal_catalog({'meta_type': "Department"})
+##    deps = {}
+##    for d in dl:
+##        deps[d.id] = d.getObject()
+##    cl = site.portal_catalog({'meta_type': "Course"})
+##    course_list = [ c.id for c in cl]
+##    for course in courses:
+##        logger.info('Processing %(CourseCode)s %(Description)s %(Credits)s %(Dept)s %(Semester)s %(Session)s %(PassMark)s %(CourseKey)s %(Category)s %(AdmStatus)s %(FORMERCODE)s' % course)
+##        if course.get("FORMERCODE").endswith('BITS'):
+##            continue
+##        depid = course.get('Dept').upper()
+##        if depid in deps.keys():
+##            dept= deps.get(depid)
+####        elif depid in facs.keys():
+####            dept= facs.get(depid)
+##        else:
+##            logger.info("Dep %(Dept)s for Course %(CourseCode)s not found" % course)
+##            continue
+##        course_id = ''.join(re.split('\W+',course.get('CourseCode')))
+##        if len(course_id) == 3:
+##            course_id = "%s000" % course_id
+##        elif len(course_id) != 6:
+##            logger.info("invalid course_code %(CourseCode)s" % course)
+##            #print course_id,course.get('CourseCode'),course.get('Description')
+##            continue
+####        if course_id in course_list:
+####            continue
+##        c = getattr(dept,course_id,None)
+##        if c is None:
+##            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
+##            logger.info('Creating Course %(CourseCode)s  %(Description)s in Department %(Dept)s' % course)
+##            dept.invokeFactory('Course', course_id)
+##            c = getattr(dept,course_id)
+##        dict = {'Title': course['Description']}
+##        dict['code'] = course_id
+##        dict['org_code'] = course.get('CourseCode') 
+##        dict['credits'] = course.get('Credits')
+##        dict['semester'] = course.get('Semester')
+##        dict['session'] = course.get('Session')
+##        dict['category'] = course.get('Category')
+##        dict['passmark'] = course.get('PassMark')
+##        c.getContent().edit(mapping=dict)
+#####)
+##
+##def loadCertificatesFromCSV(site,context): ###(
+##    """install Universityspecific Certificates from CSV values"""
+##    #return
+##    logger = context.getLogger('loadcertificates')
+##    try:
+##        certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb"))
+##    except:
+##        return
+##    f_ids = [f.id for f in site.portal_catalog({'meta_type': "Faculty"})]
+##    #d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]
+##    dl = site.portal_catalog({'meta_type': "Department"})
+##    deps = {}
+##    for d in dl:
+##        deps[d.id] = d.getObject()
+##    for certificate in certificates:
+##        logger.info('Processing %(CertCode)s %(Description)s %(Faculty)s %(MaxPass)s %(MaxLoad)s %(session)s %(PromotionCredits)s %(Probationcredits)s %(StartLevel)s %(endLevel)s %(Nyears)s %(Ncore)s %(MaxElect)s %(MPREFIX)s %(Dept)s %(Admstatus)s %(category)s' % certificate)
+##        depid = certificate.get('Dept')
+##        facid = certificate.get('Faculty')
+##        if facid not in f_ids:
+##            logger.info('Faculty %(Faculty)s for %(CertCode)s %(Description)s not found' % certificate)
+##            continue
+##        if not deps.has_key(depid):
+##            logger.info('Department %(Dept)s for %(CertCode)s %(Description)s not found' % certificate)
+##            continue
+##        certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate
+##        dep = deps[depid]
+##        c = getattr(dep,certificate_id,None)
+##        if c is None:
+##            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
+##            logger.info('Creating certificate %(CertCode)s  %(Description)s in Department %(Dept)s' % certificate)
+##            dep.invokeFactory('Certificate', certificate_id)
+##            c = getattr(dep,certificate_id)
+##        dict = {'Title': certificate['Description']}
+##        code = certificate.get('CertCode')
+##        code = code.replace('.','')
+##        code = code.replace('(','')
+##        code = code.replace(')','')
+##        code = code.replace('/','')
+##        code = code.replace(' ','')
+##        code = code.replace('_','')
+##        dict['code'] = code
+##        dict['faculty'] = certificate.get('Faculty') 
+##        dict['department'] = certificate.get('Dept') 
+##        dict['max_pass'] = certificate.get('MaxPass')
+##        dict['max_load'] = certificate.get('MaxLoad')
+##        dict['admin_status'] = certificate.get('Admstatus')
+##        dict['category'] = certificate.get('category')
+##        dict['m_prefix'] = certificate.get('MPREFIX')
+##        dict['nr_years'] = int(certificate.get('Nyears'))
+##        nc = certificate.get('Ncore','1')
+##        try: 
+##            dict['n_core'] = int(nc)
+##        except:
+##            dict['n_core'] = 1
+##        dict['start_level'] = certificate.get('StartLevel')
+##        dict['end_level'] = certificate.get('endLevel')
+##        dict['promotion_credits'] = certificate.get('PromotionCredits')
+##        dict['probation_credits'] = certificate.get('ProbationCredits')
+##        c.getContent().edit(mapping=dict)
+#####)
+##
+##def oldloadCertificatesFromCSV(certfolder,site,context): ###(
+##    """install Universityspecific Certificates from CSV values"""
+##    logger = context.getLogger('loadcertificates')
+##    certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb"))
+##    f_ids = [f.id for f in site.portal_catalog({'meta_type': "Faculty"})]
+##    d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]
+##    for certificate in certificates:
+##        depid = certificate.get('Dept')
+##        facid = certificate.get('Faculty')
+##        if facid not in f_ids:
+##            logger.info('Faculty %(Faculty)s for %(CertCode)s %(Description)s not found' % certificate)
+##            continue
+##        if depid not in d_ids:
+##            logger.info('Department %(Dept)s for %(CertCode)s %(Description)s not found' % certificate)
+##            continue
+##        certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate
+##        c = getattr(certfolder,certificate_id,None)
+##        if c is None:
+##            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
+##            logger.info('Creating certificate %(CertCode)s  %(Description)s in Department %(Dept)s' % certificate)
+##            certfolder.invokeFactory('Certificate', certificate_id)
+##            c = getattr(certfolder,certificate_id)
+##        dict = {'Title': certificate['Description']}
+##        code = certificate.get('CertCode')
+##        code = code.replace('.','')
+##        code = code.replace('(','')
+##        code = code.replace(')','')
+##        code = code.replace('/','')
+##        code = code.replace(' ','')
+##        code = code.replace('_','')
+##        dict['code'] = code
+##        dict['faculty'] = certificate.get('Faculty') 
+##        dict['department'] = certificate.get('Dept') 
+##        dict['max_pass'] = certificate.get('MaxPass')
+##        dict['max_load'] = certificate.get('MaxLoad')
+##        dict['admin_status'] = certificate.get('Admstatus')
+##        dict['category'] = certificate.get('category')
+##        dict['m_prefix'] = certificate.get('MPREFIX')
+##        dict['nr_years'] = int(certificate.get('Nyears'))
+##        nc = certificate.get('Ncore','1')
+##        try: 
+##            dict['n_core'] = int(nc)
+##        except:
+##            dict['n_core'] = 1
+##        dict['start_level'] = certificate.get('StartLevel')
+##        dict['end_level'] = certificate.get('endLevel')
+##        dict['promotion_credits'] = certificate.get('PromotionCredits')
+##        dict['probation_credits'] = certificate.get('ProbationCredits')
+##        c.getContent().edit(mapping=dict)
+#####)
+##
+##def loadCertificateCoursesFromCSV(site,context): ###(
+##    """install Certificate Courses from CSV values"""
+##    #return
+##    logger = context.getLogger('loadcertificatecourses')
+##    try:
+##        cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb"))
+##    except:
+##        return
+##    d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]
+##    for cert_course in cert_courses:
+##        logger.info('Processing %(CosCode)s %(CertCode)s %(CoreKey)s %(Session)s %(Level)s %(Core)s %(Elective)s %(Mandatory)s %(AdmStatus)s %(Dept)s %(Semester)s' % cert_course)
+##        depid = cert_course.get('Dept')
+##        code = cert_course.get('CertCode')
+##        code = code.replace('.','')
+##        code = code.replace('(','')
+##        code = code.replace(')','')
+##        code = code.replace('/','')
+##        code = code.replace(' ','')
+##        code = code.replace('_','')
+##        if cert_course.get('Session') != '2002/2003':
+##            continue
+##        certificate = site.portal_catalog({'meta_type': "Certificate",
+##                                           'SearchableText': code})
+##        if not certificate:
+##            print code
+##            logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course)
+##            continue
+##        certificate = certificate[-1].getObject()
+##        certificate_code = certificate.getId()
+##        if depid not in d_ids:
+##            logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course)
+##            continue
+##        course_code = cert_course.get('CosCode')
+##        level = cert_course.get('Level')
+##        l = getattr(certificate,level,None)
+##        if l is None:
+##            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
+##            logger.info('Creating Level %(Level)s in certificate %(CertCode)s' % cert_course)
+##            certificate.invokeFactory('StudyLevel', level)
+##            l = getattr(certificate, level)
+##            l.invokeFactory('Semester','first')
+##            l.invokeFactory('Semester','second')
+##        first_s = getattr(l,'first')
+##        second_s = getattr(l,'second')
+##        if cert_course.get('Semester') == '1':
+##            semester = first_s
+##        else:
+##            semester = second_s
+##        if hasattr(semester,course_code):
+##            logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course)
+##            continue
+##            
+##        semester.invokeFactory('CertificateCourse',course_code)
+##        cc = getattr(semester,course_code)
+##        dict = {}
+##        dict['code'] = cert_course.get('CosCode')
+##        dict['certificate_code'] = code
+##        dict['certificate_code_org'] = cert_course.get('CertCode') 
+##        dict['department'] = cert_course.get('Dept') 
+##        dict['admin_status'] = cert_course.get('Admstatus')
+##        dict['session'] = cert_course.get('Session')
+##        if cert_course.get('Core') != '':
+##            dict['core_or_elective'] = True
+##        else:
+##            dict['core_or_elective'] = False
+##        dict['level'] = cert_course.get('Level')
+##        cc.getContent().edit(mapping=dict)
+#####)
+##
+##def old_loadCertificateCoursesFromCSV(certfolder,site,context): ###(
+##    """install Certificate Courses from CSV values"""
+##    return
+##    logger = context.getLogger('loadcertificatecourses')
+##    cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb"))
+##    d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]
+##    for cert_course in cert_courses:
+##        depid = cert_course.get('Dept')
+##        code = cert_course.get('CertCode')
+##        code = code.replace('.','')
+##        code = code.replace('(','')
+##        code = code.replace(')','')
+##        code = code.replace('/','')
+##        code = code.replace(' ','')
+##        code = code.replace('_','')
+##        if cert_course.get('Session') != '2002/2003':
+##            continue
+##        certificate = site.portal_catalog({'meta_type': "Certificate",
+##                                           'SearchableText': code})
+##        if not certificate:
+##            print code
+##            logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course)
+##            continue
+##        certificate = certificate[-1].getObject()
+##        certificate_code = certificate.getId()
+##        if depid not in d_ids:
+##            logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course)
+##            continue
+##        course_code = cert_course.get('CosCode')
+##        level = cert_course.get('Level')
+##        l = getattr(certificate,level,None)
+##        if l is None:
+##            #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)
+##            logger.info('Creating Level %(Level)s in certificate %(CertCode)s' % cert_course)
+##            certificate.invokeFactory('StudyLevel', level)
+##            l = getattr(certificate, level)
+##            l.invokeFactory('Semester','first')
+##            l.invokeFactory('Semester','second')
+##        first_s = getattr(l,'first')
+##        second_s = getattr(l,'second')
+##        if cert_course.get('Semester') == '1':
+##            semester = first_s
+##        else:
+##            semester = second_s
+##        if hasattr(semester,course_code):
+##            logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course)
+##            continue
+##            
+##        semester.invokeFactory('CertificateCourse',course_code)
+##        cc = getattr(semester,course_code)
+##        dict = {}
+##        dict['code'] = cert_course.get('CosCode')
+##        dict['certificate_code'] = code
+##        dict['certificate_code_org'] = cert_course.get('CertCode') 
+##        dict['department'] = cert_course.get('Dept') 
+##        dict['admin_status'] = cert_course.get('Admstatus')
+##        dict['session'] = cert_course.get('Session')
+##        if cert_course.get('Core') != '':
+##            dict['core_or_elective'] = True
+##        else:
+##            dict['core_or_elective'] = False
+##        dict['level'] = cert_course.get('Level')
+##        cc.getContent().edit(mapping=dict)
+#####)
+##
+##def setupStructure(site,context): ###(
+##    portal = getattr(site,'uniportal',None)
+##    if portal is None:
+##        site.invokeFactory('University','uniportal')
+##        portal = getattr(site,'uniportal',None)
+##        portal.getContent().edit(mapping={'Title':SRPP_TITLE})
+##    students =  getattr(portal,'students',None)
+##    if students is None:
+##        portal.invokeFactory('StudentsFolder','students')
+##        students = getattr(portal,'students').getContent()
+##        students.edit(mapping={'Title':'Students'})
+##    academics = getattr(portal,'academics',None)
+##    if academics is None:
+##        portal.invokeFactory('AcademicsFolder','academics')
+##        academics = getattr(portal,'academics')
+##        academics.getContent().edit(mapping={'Title':'Academics'})
+##    loadFacultiesFromCSV(academics,site,context)
+##    loadDepartmentsFromCSV(academics,site,context)
+##    loadCoursesFromCSV(academics,site,context)
+####    certificates = getattr(academics,'certificates',None)
+####    if certificates is None:
+####        academics.invokeFactory('SCFolder','certificates')
+####        certificates = getattr(academics,'certificates')
+####        certificates.getContent().edit(mapping={'Title':'Certificates'})
+##    loadCertificatesFromCSV(site,context)
+##    loadCertificateCoursesFromCSV(site,context)
+##    if not hasattr(portal,'accommodation'):
+##        portal.invokeFactory('AccoFolder','accommodation')
+##        accommodation = getattr(portal,'accommodation').getContent()
+##        accommodation.edit(mapping={'Title':'Accommodation'})
+#####)
 
 
@@ -525,5 +525,5 @@
     """
     site = context.getSite()
-    tool = getToolByName(site, TOOL, None)
+    tool = getattr(context,"campus",None)
     if tool is None:
         logger = context.getLogger(NAME)
@@ -548,33 +548,33 @@
 # components machinery and the associations made in the configure.zcml file.
 
-class WAeUPXMLAdapter(XMLAdapterBase, PropertyManagerHelpers):
-    """XML importer and exporter for the WAeUP tool.
-
-    Hence this XMLAdapter is really simple. To get more complete examples of
-    what XMLAdapters are meant to do, please have a look at the
-    CPSSkins.exportimport.py or CPSDirectory.exportimport.py files, for
-    instance.
-    """
-
-    adapts(IWAeUPTool, ISetupEnviron)
-    implements(IBody)
-
-    _LOGGER_ID = NAME
-    name = NAME
-
-    def _exportNode(self):
-        """Export the object as a DOM node.
-        """
-        node = self._getObjectNode('object')
-        node.appendChild(self._extractProperties())
-        self._logger.info("WAeUP tool exported.")
-        return node
-
-    def _importNode(self, node):
-        """Import the object from the DOM node.
-        """
-        if self.environ.shouldPurge():
-            self._purgeProperties()
-        self._initProperties(node)
-        self._logger.info("WAeUP tool imported.")
-
+##class WAeUPXMLAdapter(XMLAdapterBase, PropertyManagerHelpers):
+##    """XML importer and exporter for the WAeUP tool.
+##
+##    Hence this XMLAdapter is really simple. To get more complete examples of
+##    what XMLAdapters are meant to do, please have a look at the
+##    CPSSkins.exportimport.py or CPSDirectory.exportimport.py files, for
+##    instance.
+##    """
+##
+##    adapts(IWAeUPTool, ISetupEnviron)
+##    implements(IBody)
+##
+##    _LOGGER_ID = NAME
+##    name = NAME
+##
+##    def _exportNode(self):
+##        """Export the object as a DOM node.
+##        """
+##        node = self._getObjectNode('object')
+##        node.appendChild(self._extractProperties())
+##        self._logger.info("WAeUP tool exported.")
+##        return node
+##
+##    def _importNode(self, node):
+##        """Import the object from the DOM node.
+##        """
+##        if self.environ.shouldPurge():
+##            self._purgeProperties()
+##        self._initProperties(node)
+##        self._logger.info("WAeUP tool imported.")
+##
Index: /WAeUP_SRP/trunk/profiles/default/catalog.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/catalog.xml	(revision 281)
+++ /WAeUP_SRP/trunk/profiles/default/catalog.xml	(revision 282)
@@ -1,152 +1,5 @@
 <?xml version="1.0"?>
 <object name="portal_catalog" meta_type="CMF Catalog">
- <property name="title"></property>
- <object name="cps_defaut_lexicon" meta_type="ZCTextIndex Lexicon">
-  <element name="Whitespace splitter" group="Word Splitter"/>
-  <element name="Case Normalizer" group="Case Normalizer"/>
- </object>
- <object name="htmltext_lexicon" meta_type="ZCTextIndex Lexicon">
-  <element name="HTML aware splitter" group="Word Splitter"/>
-  <element name="Case Normalizer" group="Case Normalizer"/>
-  <element name="Remove listed stop words only" group="Stop Words"/>
- </object>
- <object name="plaintext_lexicon" meta_type="ZCTextIndex Lexicon">
-  <element name="Whitespace splitter" group="Word Splitter"/>
-  <element name="Case Normalizer" group="Case Normalizer"/>
-  <element name="Remove listed stop words only" group="Stop Words"/>
- </object>
- <index name="Creator" meta_type="FieldIndex">
-  <indexed_attr value="Creator"/>
- </index>
- <index name="Date" meta_type="DateIndex">
-  <property name="index_naive_time_as_local">True</property>
- </index>
- <index name="Description" meta_type="ZCTextIndex">
-  <indexed_attr value="Description"/>
-  <extra name="index_type" value="Okapi BM25 Rank"/>
-  <extra name="lexicon_id" value="plaintext_lexicon"/>
- </index>
- <index name="Language" meta_type="FieldIndex">
-  <indexed_attr value="Language"/>
- </index>
- <index name="SearchableText" meta_type="ZCTextIndex">
-  <indexed_attr value="SearchableText"/>
-  <extra name="index_type" value="Okapi BM25 Rank"/>
-  <extra name="lexicon_id" value="htmltext_lexicon"/>
- </index>
- <index name="Subject" meta_type="KeywordIndex">
-  <indexed_attr value="Subject"/>
- </index>
- <index name="Title" meta_type="FieldIndex">
-  <indexed_attr value="Title"/>
- </index>
- <index name="Type" meta_type="FieldIndex">
-  <indexed_attr value="Type"/>
- </index>
- <index name="ZCTitle" meta_type="ZCTextIndex">
-  <indexed_attr value="ZCTitle"/>
-  <extra name="index_type" value="Okapi BM25 Rank"/>
-  <extra name="lexicon_id" value="cps_defaut_lexicon"/>
- </index>
- <index name="allowedRolesAndUsers" meta_type="KeywordIndex">
-  <indexed_attr value="allowedRolesAndUsers"/>
- </index>
- <index name="container_path" meta_type="FieldIndex">
-  <indexed_attr value="container_path"/>
- </index>
- <index name="cps_filter_sets" meta_type="TopicIndex">
-  <filtered_set name="default_languages" meta_type="PythonFilteredSet"
-     expression="not hasattr(o, 'isDefaultLanguage') or o.isDefaultLanguage()"/>
-  <filtered_set name="leaves" meta_type="PythonFilteredSet"
-     expression="not o.isCPSFolderish()"/>
-  <filtered_set name="nodes" meta_type="PythonFilteredSet"
-     expression="o.isCPSFolderish()"/>
-  <filtered_set name="searchable" meta_type="PythonFilteredSet"
-     expression="not filter(lambda s: s.startswith('portal_') or s and s[0] in ('.', '_'), o.getPhysicalPath())"/>
- </index>
- <index name="created" meta_type="DateIndex">
-  <property name="index_naive_time_as_local">True</property>
- </index>
- <index name="effective" meta_type="DateIndex">
-  <property name="index_naive_time_as_local">True</property>
- </index>
- <index name="end" meta_type="DateIndex">
-  <property name="index_naive_time_as_local">True</property>
- </index>
- <index name="expires" meta_type="DateIndex">
-  <property name="index_naive_time_as_local">True</property>
- </index>
- <index name="getId" meta_type="FieldIndex">
-  <indexed_attr value="getId"/>
- </index>
- <index name="id" meta_type="FieldIndex">
-  <indexed_attr value="id"/>
- </index>
- <index name="in_reply_to" meta_type="FieldIndex">
-  <indexed_attr value="in_reply_to"/>
- </index>
- <index name="listCreators" meta_type="KeywordIndex">
-  <indexed_attr value="listCreators"/>
- </index>
- <index name="localUsersWithRoles" meta_type="KeywordIndex">
-  <indexed_attr value="localUsersWithRoles"/>
- </index>
- <index name="meta_type" meta_type="FieldIndex">
-  <indexed_attr value="meta_type"/>
- </index>
- <index name="modified" meta_type="DateIndex">
-  <property name="index_naive_time_as_local">True</property>
- </index>
- <index name="path" meta_type="PathIndex"/>
- <index name="portal_type" meta_type="FieldIndex">
-  <indexed_attr value="portal_type"/>
- </index>
- <index name="position_in_container" meta_type="FieldIndex">
-  <indexed_attr value="position_in_container"/>
- </index>
- <index name="relative_path" meta_type="FieldIndex">
-  <indexed_attr value="relative_path"/>
- </index>
- <index name="relative_path_depth" meta_type="FieldIndex">
-  <indexed_attr value="relative_path_depth"/>
- </index>
- <index name="review_state" meta_type="FieldIndex">
-  <indexed_attr value="review_state"/>
- </index>
- <index name="start" meta_type="DateIndex">
-  <property name="index_naive_time_as_local">True</property>
- </index>
- <index name="time" meta_type="DateIndex">
-  <property name="index_naive_time_as_local">True</property>
- </index>
- <column value="Contributors"/>
- <column value="CreationDate"/>
- <column value="Creator"/>
- <column value="Date"/>
- <column value="Description"/>
- <column value="EffectiveDate"/>
- <column value="ExpirationDate"/>
- <column value="Language"/>
- <column value="ModificationDate"/>
- <column value="Subject"/>
- <column value="Title"/>
- <column value="Type"/>
- <column value="created"/>
  <column value="credits"/>
- <column value="effective"/>
- <column value="end"/>
- <column value="expires"/>
- <column value="getIcon"/>
- <column value="getId"/>
- <column value="getRevision"/>
- <column value="id"/>
- <column value="listCreators"/>
- <column value="modified"/>
  <column value="passmark"/>
- <column value="portal_type"/>
- <column value="position_in_container"/>
- <column value="relative_path"/>
- <column value="review_state"/>
- <column value="start"/>
- <column value="time"/>
 </object>
Index: /WAeUP_SRP/trunk/profiles/default/roots.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/roots.xml	(revision 281)
+++ /WAeUP_SRP/trunk/profiles/default/roots.xml	(revision 282)
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
 <roots>
- <object name="uniportal" portal_type="University"/>
+ <object name="campus" portal_type="University"/>
 </roots>
Index: /WAeUP_SRP/trunk/profiles/default/roots/campus.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/roots/campus.xml	(revision 282)
+++ /WAeUP_SRP/trunk/profiles/default/roots/campus.xml	(revision 282)
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<object name="campus">
+  <property name="title">University Portal</property>
+  <property name=".cpsskins_theme">waeup_plain_theme</property>
+  <object name="academics" portal_type="AcademicsFolder" />
+  <object name="accomodation" portal_type="AccoFolder" />
+  <object name="students" portal_type="StudentsFolder" />
+</object>
Index: eUP_SRP/trunk/profiles/default/roots/uniportal.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/roots/uniportal.xml	(revision 281)
+++ 	(revision )
@@ -1,8 +1,0 @@
-<?xml version="1.0"?>
-<object name="uniportal">
-  <property name="title">University Portal</property>
-  <property name=".cpsskins_theme">waeup_plain_theme</property>
-  <object name="academics" portal_type="AcademicsFolder" />
-  <object name="accomodation" portal_type="AccoFolder" />
-  <object name="students" portal_type="StudentsFolder" />
-</object>
Index: /WAeUP_SRP/trunk/profiles/default/skins/waeup_academics.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/skins/waeup_academics.xml	(revision 281)
+++ /WAeUP_SRP/trunk/profiles/default/skins/waeup_academics.xml	(revision 282)
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
-<object name="waeup_faculty" meta_type="Folder">
+<object name="waeup_academics" meta_type="Folder">
  <property name="title"></property>
 </object>
Index: /WAeUP_SRP/trunk/profiles/default/workflows.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 281)
+++ /WAeUP_SRP/trunk/profiles/default/workflows.xml	(revision 282)
@@ -19,4 +19,5 @@
  <object name="waeup_base_wf" meta_type="CPS Workflow"/>
  <object name="waeup_certificate_wf" meta_type="CPS Workflow"/>
+ <object name="waeup_certificate_course_wf" meta_type="CPS Workflow"/>
  <object name="waeup_course_wf" meta_type="CPS Workflow"/>
  <object name="waeup_department_wf" meta_type="CPS Workflow"/>
@@ -46,5 +47,5 @@
   </type>
   <type type_id="CertificateCourse">
-   <bound-workflow workflow_id="waeup_certificate_wf"/>
+   <bound-workflow workflow_id="waeup_certificate_course_wf"/>
   </type>
   <type type_id="CPS Calendar">
Index: /WAeUP_SRP/trunk/profiles/default/workflows/waeup_certificate_course_wf/definition.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/workflows/waeup_certificate_course_wf/definition.xml	(revision 282)
+++ /WAeUP_SRP/trunk/profiles/default/workflows/waeup_certificate_course_wf/definition.xml	(revision 282)
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<cps-workflow workflow_id="waeup_certificate_course_wf"
+              title="CPS Workflow Definition"
+              state_variable="review_state"
+              meta_type="CPS Workflow">
+ <permission>View</permission>
+ <state state_id="work" title="Work">
+  <exit-transition transition_id="create_content"/>
+  <exit-transition transition_id="cut_copy_paste"/>
+  <permission-map name="View" acquired="False">
+   <permission-role>Manager</permission-role>
+   <permission-role>SectionManager</permission-role>
+   <permission-role>SectionReviewer</permission-role>
+   <permission-role>SectionReader</permission-role>
+  </permission-map>
+ </state>
+ <transition transition_id="create" title="Initial creation"
+             new_state="work" trigger="USER"
+             before_script="" after_script="">
+  
+  <guard>
+   <guard-role>Manager</guard-role>
+   <guard-role>SectionManager</guard-role>
+  </guard>
+  <transition-behavior behavior_id="initial-create"/>
+ </transition>
+ <transition transition_id="create_content"
+             title="Create content" new_state="work"
+             trigger="USER" before_script="" after_script="">
+  
+  <guard>
+   <guard-role>Manager</guard-role>
+   <guard-role>SectionManager</guard-role>
+   <guard-role>SectionReviewer</guard-role>
+   <guard-role>SectionReader</guard-role>
+  </guard>
+  <transition-behavior behavior_id="allow-sub-create"/>
+  <transition-behavior behavior_id="allow-sub-publishing"/>
+ </transition>
+ <transition transition_id="cut_copy_paste"
+             title="Cut/Copy/Paste" new_state=""
+             trigger="USER" before_script="" after_script="">
+  
+  <guard>
+   <guard-role>Manager</guard-role>
+   <guard-role>SectionManager</guard-role>
+   <guard-role>SectionReviewer</guard-role>
+   <guard-role>SectionReader</guard-role>
+  </guard>
+  <transition-behavior behavior_id="allow-sub-move"/>
+  <transition-behavior behavior_id="allow-sub-delete"/>
+  <transition-behavior behavior_id="allow-sub-copy"/>
+ </transition>
+</cps-workflow>
Index: /WAeUP_SRP/trunk/profiles/default/workflows/waeup_certificate_wf/definition.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/workflows/waeup_certificate_wf/definition.xml	(revision 281)
+++ /WAeUP_SRP/trunk/profiles/default/workflows/waeup_certificate_wf/definition.xml	(revision 282)
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
-<cps-workflow workflow_id="waeup_course_wf"
+<cps-workflow workflow_id="waeup_certificate_wf"
               title="CPS Workflow Definition"
               state_variable="review_state"
Index: /WAeUP_SRP/trunk/skins/waeup_academics/level_view_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_academics/level_view_form.pt	(revision 281)
+++ /WAeUP_SRP/trunk/skins/waeup_academics/level_view_form.pt	(revision 282)
@@ -32,4 +32,5 @@
             </td>
             <td tal:content="course/Title"></td>
+            <td tal:content="course/core_or_elective"></td>
             <td tal:content="course/credits"></td>
             <td tal:content="course/passmark"></td>
Index: eUP_SRP/trunk/zmi/manage_addWAeUPUniversity.dtml
===================================================================
--- /WAeUP_SRP/trunk/zmi/manage_addWAeUPUniversity.dtml	(revision 281)
+++ 	(revision )
@@ -1,159 +1,0 @@
-<dtml-let form_title="'WAeUP'">
-<dtml-if manage_page_header>
-  <dtml-var manage_page_header>
-  <dtml-var manage_form_title>
-<dtml-else>
-  <html>
-  <head><title>&dtml-form_title;</title>
-  </head>
-  <body>
-  <h2>&dtml-form_title;</h2>
-</dtml-if>
-</dtml-let>
-
-  <div class="form-help">
-  Fill in this form to create a WAeUP Site.
-  </div>
-
-<form action="addWAeUPTool" method="post">
-<table cellspacing="0" cellpadding="2" border="0">
-  <tr>
-    <td align="left" valign="top">
-    <label for="id" class="form-label">
-      Id <span class="required" style="color: #ff0000;">*</span>
-    </label>
-    </td>
-    <td align="left" valign="top">
-    <input type="text" name="id" id="id" size="40" value="demo"/>
-    </td>
-  </tr>
-
-  <tr>
-    <td align="left" valign="top">
-    <label for="title" class="form-label">Title</label>
-    </td>
-    <td align="left" valign="top">
-    <input type="text" name="title" id="title" size="40" value=""/>
-    </td>
-  </tr>
-
-  <tr>
-    <td align="left" valign="top">
-    <label for="description" class="form-label">Description</label>
-    </td>
-    <td align="left" valign="top">
-    <textarea name="description" id="description" cols="40" rows="2"></textarea>
-    </td>
-  </tr>
-<dtml-comment>
-  <tr>
-    <td align="left" valign="top">
-    <label for="login" class="form-label">
-      WAeUP Administrator login <span class="required" style="color: #ff0000;">*</span>
-    </label>
-    </td>
-    <td align="left" valign="top">
-      <input type="text" name="manager_id" id="login" size="40" value="manager"/>
-    </td>
-  </tr>
-
-  <tr>
-    <td align="left" valign="top">
-    <label for="manager_password" class="form-label">
-      CPS Administrator Password <span class="required" style="color: #ff0000;">*</span>
-    </label>
-    </td>
-    <td align="left" valign="top">
-      <input type="password" name="manager_password" id="manager_password" size="40" value=""/>
-    </td>
-  </tr>
-
-  <tr>
-    <td align="left" valign="top">
-    <label for="manager_password_confirmation" class="form-label">
-      CPS Administrator Password Confirmation <span class="required" style="color: #ff0000;">*</span>
-    </label>
-    </td>
-    <td align="left" valign="top">
-      <input type="password" name="manager_password_confirmation" id="manager_password_confirmation" size="40" value="">
-    </td>
-  </tr>
-
-  <tr>
-    <td align="left" valign="top">
-    <label for="manager_email" class="form-label">
-      CPS Administrator E-mail <span class="required" style="color: #ff0000;">*</span>
-    </label>
-    </td>
-    <td align="left" valign="top">
-      <input type="text" name="manager_email" id="manager_email" size="40" value=""/>
-    </td>
-  </tr>
-
-  <tr>
-    <td align="left" valign="top">
-    <label for="manager_name" class="form-label">CPS Administrator Name</label>
-    </td>
-    <td align="left" valign="top">
-      <input type="text" name="manager_sn" id="manager_name" size="40" value="CPS manager"/>
-    </td>
-  </tr>
-
-  <tr>
-    <td align="left" valign="top">
-    <label for="manager_givenName" class="form-label">CPS Administrator Given Name</label>
-    </td>
-    <td align="left" valign="top">
-      <input type="text" name="manager_givenName" id="manager_givenName" size="40" value="Manager"/>
-    </td>
-  </tr>
-
-  <tr>
-    <td align="left" valign="top">
-    <div class="form-label">
-      Languages
-    </div>
-    </td>
-    <td align="left" valign="top">
-      <ul style="margin-left: 0; padding-left: 0; list-style-type: none;">
-      <dtml-in "[
-        ('nl', 'Dutch'),
-        ('en', 'English'),
-        ('fr', 'French'),
-        ('de', 'German'),
-        ('it', 'Italian'),
-        ('pt_BR', 'Portugese (Brazilian)'),
-        ('es', 'Spanish'),
-        ('mg', 'Malagasy'),
-        ('ro', 'Romanian'),
-        ('eu', 'Euskara'),
-        ]">
-        <li>
-        <dtml-let checked="_['sequence-key'] in ('fr', 'en') and 'checked=\'checked\'' or ' '">
-        <input type="checkbox" name="langs_list:list"
-               id="<dtml-var sequence-key>"
-               value="<dtml-var sequence-key>"
-               &dtml-checked;
-               />
-        </dtml-let>
-        <label for="<dtml-var sequence-key>"><dtml-var sequence-item></label>
-        </li>
-      </dtml-in>
-      </ul>
-    </td>
-  </tr>
-</dtml-comment>
-</table>
-
-<p style="text-align: center;">
-    <input type="submit" name="submit" value="Create" />
-</p>
-</form>
-
-<dtml-if manage_page_footer>
-  <dtml-var manage_page_footer>
-<dtml-else>
-
-</body>
-</html>
-</dtml-if>
