Changeset 282
- Timestamp:
- 3 Jul 2006, 14:11:56 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 deleted
- 10 edited
- 1 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Academics.py
r280 r282 40 40 """install Universityspecific Faculies from CSV values""" 41 41 #return 42 logger = logging.getLogger('loadfaculties') 43 logger.info('Start loading Faculties') 42 name = 'faculty' 43 no_import = False 44 logger = logging.getLogger('%s_import' % name) 45 logger.info('Start loading from %s.csv' % name) 44 46 academics = self.portal_catalog({'meta_type': 'AcademicsFolder'})[-1].getObject() 45 47 try: 46 faculties = csv.DictReader(open("%s/import/ faculty.csv" % i_home,"rb"))48 faculties = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb")) 47 49 except: 48 logger.error('Error reading faculty.csv')50 logger.error('Error reading %s.csv' % name) 49 51 return 50 52 l = self.portal_catalog({'meta_type': "Faculty"}) … … 61 63 academics.invokeFactory('Faculty', fid) 62 64 f = getattr(self,fid) 63 d = {'Title': faculty['Description']} 64 f.getContent().edit(mapping=d) 65 d = {'Title': faculty['Description']} 66 f.getContent().edit(mapping=d) 67 else: 68 if not no_import: 69 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 70 no_import.write('"Session","FacultyCode","Description","CollegeCode","FacultyKey","Status","degree_grade","Bankcode"\n') 71 logger.info('Faculty with ID %(FacultyCode)s %(Description)s already exists' % faculty) 72 no_import.write('"%(Session)s","%(FacultyCode)s","%(Description)s","%(CollegeCode)s","%(FacultyKey)s","%(Status)s","%(degree_grade)s","%(Bankcode)s"\n' % faculty) 65 73 ###) 66 74 … … 88 96 """install Universityspecific Faculies from CSV values""" 89 97 #return 98 name = 'departments' 99 no_import = False 90 100 logger = logging.getLogger('loaddepartments') 91 101 try: … … 104 114 if f is None: 105 115 logger.info( "No Faculty with ID: %s" % fid) 116 if not no_import: 117 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 118 no_import.write('"Session","DeptCode","Description","FacultyCode"') 119 no_import.write('"%(Session)s","%(DeptCode)s","%(Description)s","%(FacultyCode)s"\n' % dep) 106 120 else: 107 121 did = dep.get('DeptCode') … … 120 134 """install Universityspecific Courses from CSV values""" 121 135 #return 136 name = 'courses' 137 no_import = False 122 138 logger = logging.getLogger('loadcourses') 123 139 try: … … 137 153 course_list = [ c.id for c in cl] 138 154 for course in courses: 139 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)140 if course.get("FORMERCODE").endswith('BITS'):141 continue155 logger.info('Processing %(CourseCode)s %(Description)s %(Credits)s %(Dept)s %(Semester)s %(Session)s %(PassMark)s %(CourseKey)s %(Category)s %(AdmStatus)s' % course) 156 ## if course.get("FORMERCODE").endswith('BITS'): 157 ## continue 142 158 depid = course.get('Dept').upper() 143 159 if depid in deps.keys(): … … 147 163 else: 148 164 logger.info("Dep %(Dept)s for Course %(CourseCode)s not found" % course) 165 if not no_import: 166 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 167 no_import.write('"CourseCode","Description","Credits","Dept","Semester","Session","PassMark","CourseKey","Category","AdmStatus"\n') 168 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) 149 169 continue 150 170 course_id = ''.join(re.split('\W+',course.get('CourseCode'))) 151 171 if len(course_id) == 3: 152 172 course_id = "%s000" % course_id 173 elif course_id.startswith('CHEM'): 174 tid = course_id.replace('CHEM','CHE') 175 logger.info("invalid course_code %(course_id)s renaming to %(tid)s" % vars()) 176 course_id = tid 177 elif course_id.startswith('DAIC'): 178 tid = course_id.replace('DAIC','DAC') 179 logger.info("invalid course_code %(course_id)s renaming to %(tid)s" % vars()) 180 course_id = tid 181 elif course_id.startswith('DAIM'): 182 tid = course_id.replace('DAIM','DAM') 183 logger.info("invalid course_code %(course_id)s renaming to %(tid)s" % vars()) 184 course_id = tid 153 185 elif len(course_id) != 6: 154 186 logger.info("invalid course_code %(CourseCode)s" % course) 155 #print course_id,course.get('CourseCode'),course.get('Description') 156 continue 157 ## if course_id in course_list: 158 ## continue 187 if not no_import: 188 no_import = open("%s/import/%s_not_imported.csv" % (i_home,name),"w") 189 no_import.write('"CourseCode","Description","Credits","Dept","Semester","Session","PassMark","CourseKey","Category","AdmStatus"') 190 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) 191 continue 159 192 c = getattr(dept,course_id,None) 160 193 if c is None: 161 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)162 194 logger.info('Creating Course %(CourseCode)s %(Description)s in Department %(Dept)s' % course) 163 195 dept.invokeFactory('Course', course_id) … … 166 198 dict['code'] = course_id 167 199 dict['org_code'] = course.get('CourseCode') 168 dict['credits'] = icourse.get('Credits')200 dict['credits'] = course.get('Credits') 169 201 dict['semester'] = course.get('Semester') 170 202 dict['session'] = course.get('Session') 171 203 dict['category'] = course.get('Category') 172 dict['passmark'] = int(course.get('PassMark')) 204 pm = course.get('PassMark') 205 if pm.find(',') > -1: 206 pm.replace(',','.') 207 elif pm == "": 208 pm = "0.0" 209 try: 210 dict['passmark'] = int(float(pm)) 211 except: 212 dict['passmark'] = 0 173 213 c.getContent().edit(mapping=dict) 174 214 ###) -
WAeUP_SRP/trunk/WAeUPTool.py
r197 r282 21 21 """ 22 22 23 from zLOG import LOG, DEBUG23 #from zLOG import LOG, DEBUG 24 24 from Globals import InitializeClass, HTMLFile 25 25 from AccessControl import ClassSecurityInfo … … 42 42 PortalFolder.manage_options[2:]) 43 43 44 _actions = () 45 46 47 # 48 # ZMI 49 # 50 _properties = ( 51 {'id': 'title', 'type': 'string', 'mode': 'w', 52 'label': 'Title'}, 53 {'id': 'uni_id', 'type': 'string', 'mode': 'w', 54 'label': 'University ID'}, 55 {'id': 'uni_name', 'type': 'string', 'mode': 'w', 56 'label': 'University Name'}, 57 ) 58 title = '' 59 def __init__(self,uni_id,uni_name): 60 self.manage_changeProperties(uni_id = uni_id, 61 uni_name = uni_name, 62 ) 63 PortalFolder.__init__(self, self.id) 64 65 66 def verifyFaculties(self, academics): ###( 67 """install Universityspecific Faculies with Departments""" 68 faculties = [ 69 ## {'id': 'agri', ###( 70 ## 'Title': 'Agriculture', 44 ## _actions = () 45 ## 46 ## 47 ## # 48 ## # ZMI 49 ## # 50 ## _properties = ( 51 ## {'id': 'title', 'type': 'string', 'mode': 'w', 52 ## 'label': 'Title'}, 53 ## {'id': 'uni_id', 'type': 'string', 'mode': 'w', 54 ## 'label': 'University ID'}, 55 ## {'id': 'uni_name', 'type': 'string', 'mode': 'w', 56 ## 'label': 'University Name'}, 57 ## ) 58 ## title = '' 59 ## def __init__(self,uni_id,uni_name): 60 ## self.manage_changeProperties(uni_id = uni_id, 61 ## uni_name = uni_name, 62 ## ) 63 ## PortalFolder.__init__(self, self.id) 64 ## 65 ## 66 ## def verifyFaculties(self, academics): ###( 67 ## """install Universityspecific Faculies with Departments""" 68 ## faculties = [ 69 #### {'id': 'agri', ###( 70 #### 'Title': 'Agriculture', 71 #### 'departments': [ 72 #### { 'id': 'dep1', ###( 73 #### 'Title': 'One', 74 #### }, 75 #### ], 76 #### },###) 77 ## { 'id': 'science', 78 ## 'Title': 'Science', 71 79 ## 'departments': [ 72 ## { 'id': 'dep1', ###( 73 ## 'Title': 'One', 80 ## { 'id': 'bio', ###( 81 ## 'Title': 'Biochemistry', 82 ## }, 83 ## { 'id': 'bot', 84 ## 'Title': 'Botany', 85 ## }, 86 ## { 'id': 'che', 87 ## 'Title': 'Chemistry', 88 ## }, 89 ## { 'id': 'com', 90 ## 'Title': 'Computer Science', 91 ## }, 92 ## { 'id': 'geo', 93 ## 'Title': 'Geologie', 94 ## }, 95 ## { 'id': 'mat', 96 ## 'Title': 'Mathematics', 97 ## }, 98 ## { 'id': 'mic', 99 ## 'Title': 'Microbiology', 100 ## }, 101 ## { 'id': 'opt', 102 ## 'Title': 'Optometry', 103 ## }, 104 ## { 'id': 'phy', 105 ## 'Title': 'Physics', 106 ## }, 107 ## { 'id': 'zoo', 108 ## 'Title': 'Zoology', 74 109 ## }, 75 110 ## ], 76 111 ## },###) 77 { 'id': 'science', 78 'Title': 'Science', 79 'departments': [ 80 { 'id': 'bio', ###( 81 'Title': 'Biochemistry', 82 }, 83 { 'id': 'bot', 84 'Title': 'Botany', 85 }, 86 { 'id': 'che', 87 'Title': 'Chemistry', 88 }, 89 { 'id': 'com', 90 'Title': 'Computer Science', 91 }, 92 { 'id': 'geo', 93 'Title': 'Geologie', 94 }, 95 { 'id': 'mat', 96 'Title': 'Mathematics', 97 }, 98 { 'id': 'mic', 99 'Title': 'Microbiology', 100 }, 101 { 'id': 'opt', 102 'Title': 'Optometry', 103 }, 104 { 'id': 'phy', 105 'Title': 'Physics', 106 }, 107 { 'id': 'zoo', 108 'Title': 'Zoology', 109 }, 110 ], 111 },###) 112 ]###) 113 #self.log('Verifying Faculties in %s' % academics.absolute_url(relative=1)) 114 for faculty in faculties: 115 fid = faculty['id'] 116 f = getattr(academics,fid,None) 117 #self.log('Checking Faculty %(id)s = %(Title)s' % faculty) 118 if f is None: 119 #self.log('Creating Faculty %(id)s = %(Title)s' % faculty) 120 academics.invokeFactory('Faculty', fid) 121 f = getattr(academics,fid) 122 f.getContent().edit(mapping=faculty) 123 for department in faculty['departments']: 124 #self.log('Checking Department %(id)s = %(Title)s' % department) 125 did = department['id'] 126 d = getattr(f,did,None) 127 if d is None: 128 #self.log('Creating Department %(id)s = %(Title)s' % department) 129 f.invokeFactory('Department', did) 130 d = getattr(f,did) 131 d.getContent().edit(mapping=department) 132 ###) 133 134 InitializeClass(WAeUPTool) 135 136 def verifyPortlets(portal, portlets=(), object=None): ###( 137 """Verify the existence of given portet in the object's portlet 138 container. If not found, a portlet is instantiated. 139 Existing portlets are not affected. 140 'portlets' is a tuple with the dictionaries given by the export tab 141 as entries. 142 The default object is the portal itself. 143 return the list a new portlet ids. 144 """ 145 #self.log('Verifying portlets on %s' % object.absolute_url(relative=1)) 146 #portlet_container = CPSInstaller.getPortletContainer(object, create=1) 147 idpc = portal.portal_cpsportlets.getPortletContainerId() 148 if not hasattr(object, idpc): 149 ## self.log(" Creating %s/%s" % 150 ## (object.absolute_url(relative=1), idpc)) 151 object.manage_addProduct['CPSPortlets'].addPortletsContainer() 152 portlet_container = getattr(object, idpc, None) 153 ttool = portal.portal_types 154 returned = [] 155 for new_portlet in portlets: 156 existing_portlets = portlet_container.listPortlets() 157 updated = 0 158 # Check if the portlet needs an update 159 identifier = new_portlet.get('identifier') 160 if identifier: 161 for portlet in existing_portlets: 162 if identifier == portlet.identifier: 163 #portal.log(" Update of portlet: %s" % portlet) 164 portlet.edit(**new_portlet) 165 portlet_id = portlet.getId() 166 updated = 1 167 continue 168 slot = new_portlet.get('slot') 169 if slot: 170 for portlet in existing_portlets: 171 if slot == portlet.slot: 172 #portal.log(" Update of portlet: %s" % portlet) 173 portlet.edit(**new_portlet) 174 portlet_id = portlet.getId() 175 updated = 1 176 continue 177 178 if not updated: 179 #portal.log(" Creation of portlet: %s" % new_portlet) 180 portlet_id = portal.portal_cpsportlets.createPortlet( 181 ptype_id=new_portlet['type'], 182 context=object, 183 **new_portlet) 184 if portlet_id not in returned: 185 returned.append(portlet_id) 186 return returned 187 ###) 188 189 addWAeUPToolForm = HTMLFile('zmi/manage_addWAeUPUniversity', 190 globals()) 191 192 def addWAeUPTool(container, id, 193 title='WAeUP University', 194 description='', 195 langs_list=None, 196 manager_id='manager', 197 manager_sn='CPS', 198 manager_givenName='Manager', 199 manager_email='', 200 manager_password='', 201 manager_password_confirmation='', 202 REQUEST=None): 203 """Add WAeUPTool""" 204 205 _log = [] 206 def pr(bla, zlog=1, _log=_log): 207 if bla == 'flush': 208 return '<br/>\n'.join(_log) 209 _log.append(bla) 210 if (bla and zlog): 211 LOG('addWAeUPUniversity:', INFO, bla) 212 213 uni_id = id.strip() 214 uni_name = title.strip() 215 description = description.strip() 216 manager_id = manager_id.strip() 217 218 ## if not id: 219 ## raise ValueError, "You have to provide an id for the portal!" 220 ## if not manager_id: 221 ## raise ValueError, "You have to provide an id for the CPS Administrator!" 222 ## if not manager_email: 223 ## raise ValueError, "You have to provide an email address for the CPS Administrator!" 224 ## if not manager_password: 225 ## raise ValueError, "You have to provide CPS Administrator password!" 226 ## if manager_password != manager_password_confirmation: 227 ## raise ValueError, "Password confirmation does not match password!" 228 229 email_from_name = ('%s %s' % (manager_givenName, manager_sn)).strip() 230 wt = WAeUPTool(uni_id,uni_name) 231 id = wt.getId() 232 container._setObject(id, wt) 233 sections = getattr(container,'sections') 234 workspaces = getattr(container,'workspaces') 235 sections.invokeFactory('University',uni_id) 236 uni = getattr(sections,uni_id) 237 uni.getContent().edit(title=uni_name) 238 uni.invokeFactory('StudentsFolder','students') 239 students = getattr(uni,'students').getContent() 240 students.edit(mapping={'Title':'Students'}) 241 ## uni.folder_localrole_add(member_ids=('group:Students',), 242 ## member_role='SectionReviewer', 243 ## ) 244 ## uni.content_create(type_name='AcademicsFolder',title='academics') 245 ## sections.uni.folder_localrole_add(member_ids=('group:StudentManager',), 246 ## member_role='SectionManager', 247 ## ) 248 ## uni.students.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',)) 249 uni.invokeFactory('AcademicsFolder','academics', title='Academics') 250 academics = getattr(uni,'academics').getContent() 251 academics.edit(mapping={'Title':'Academics'}) 252 uni.invokeFactory('AccoFolder','accommodation', title='Accommodation') 253 accommodation = getattr(uni,'accommodation').getContent() 254 accommodation.edit(mapping={'Title':'Accommodation'}) 255 academics = getattr(uni,'academics',None) 256 if academics is None: 257 uni.invokeFactory('AcademicsFolder','academics') 258 academics = getattr(uni,'academics') 259 academics.getContent().edit(mapping={'Title':'Academics'}) 260 wt.verifyFaculties(academics) 261 if not hasattr(uni,'accommodation'): 262 uni.invokeFactory('AccoFolder','accommodation') 263 accommodation = getattr(uni,'accommodation').getContent() 264 accommodation.edit(mapping={'Title':'Accommodation'}) 265 #uni.manage_setLocalGroupRoles(groupid = 'role:Anonymous',roles=('SectionReader',)) 266 # portlets ###( 267 # 268 portlets = ( 269 {#'identifier': 'waeup_breadcrumbs', 270 'type': 'Breadcrumbs Portlet', 271 'slot': 'waeup_breadcrumbs', 272 'first_item': 0, 273 'display_site_root': 0, 274 'Title': 'waeup_breadcrumbs', 275 'display': 'horizontal_trail', 276 'display_hidden_folders': 0, 277 'order': 0, 278 }, 279 {#'identifier': 'waeup_main_tab_actions', 280 'type': 'Actions Portlet', 281 'slot': 'main_tabs', 282 'order': 0, 283 'categories': ['main_tabs',], 284 'Title': 'waep_main_tab_actions', 285 }, 286 {#'identifier': 'waeup_object_actions', 287 'type': 'Actions Portlet', 288 'slot': 'waeup_object_actions', 289 'order': 0, 290 'categories': ['object',], 291 'Title': 'waep_manager_actions', 292 }, 293 {#'identifier': 'waeup_left_top', 294 'type': 'Custom Portlet', 295 'slot': 'left_top', 296 'order': 0, 297 'render_method': 'portlet_session_info', 298 'Title': 'Session Info', 299 }, 300 ) 301 #verifyPortletContainer(uni) 302 verifyPortlets(container,portlets,uni) 303 304 ###) 305 if REQUEST is not None: 306 url = container.absolute_url() 307 REQUEST.RESPONSE.redirect('%s/manage_main' % url) 308 112 ## ]###) 113 ## #self.log('Verifying Faculties in %s' % academics.absolute_url(relative=1)) 114 ## for faculty in faculties: 115 ## fid = faculty['id'] 116 ## f = getattr(academics,fid,None) 117 ## #self.log('Checking Faculty %(id)s = %(Title)s' % faculty) 118 ## if f is None: 119 ## #self.log('Creating Faculty %(id)s = %(Title)s' % faculty) 120 ## academics.invokeFactory('Faculty', fid) 121 ## f = getattr(academics,fid) 122 ## f.getContent().edit(mapping=faculty) 123 ## for department in faculty['departments']: 124 ## #self.log('Checking Department %(id)s = %(Title)s' % department) 125 ## did = department['id'] 126 ## d = getattr(f,did,None) 127 ## if d is None: 128 ## #self.log('Creating Department %(id)s = %(Title)s' % department) 129 ## f.invokeFactory('Department', did) 130 ## d = getattr(f,did) 131 ## d.getContent().edit(mapping=department) 132 ## ###) 133 ## 134 ##InitializeClass(WAeUPTool) 135 ## 136 ##def verifyPortlets(portal, portlets=(), object=None): ###( 137 ## """Verify the existence of given portet in the object's portlet 138 ## container. If not found, a portlet is instantiated. 139 ## Existing portlets are not affected. 140 ## 'portlets' is a tuple with the dictionaries given by the export tab 141 ## as entries. 142 ## The default object is the portal itself. 143 ## return the list a new portlet ids. 144 ## """ 145 ## #self.log('Verifying portlets on %s' % object.absolute_url(relative=1)) 146 ## #portlet_container = CPSInstaller.getPortletContainer(object, create=1) 147 ## idpc = portal.portal_cpsportlets.getPortletContainerId() 148 ## if not hasattr(object, idpc): 149 #### self.log(" Creating %s/%s" % 150 #### (object.absolute_url(relative=1), idpc)) 151 ## object.manage_addProduct['CPSPortlets'].addPortletsContainer() 152 ## portlet_container = getattr(object, idpc, None) 153 ## ttool = portal.portal_types 154 ## returned = [] 155 ## for new_portlet in portlets: 156 ## existing_portlets = portlet_container.listPortlets() 157 ## updated = 0 158 ## # Check if the portlet needs an update 159 ## identifier = new_portlet.get('identifier') 160 ## if identifier: 161 ## for portlet in existing_portlets: 162 ## if identifier == portlet.identifier: 163 ## #portal.log(" Update of portlet: %s" % portlet) 164 ## portlet.edit(**new_portlet) 165 ## portlet_id = portlet.getId() 166 ## updated = 1 167 ## continue 168 ## slot = new_portlet.get('slot') 169 ## if slot: 170 ## for portlet in existing_portlets: 171 ## if slot == portlet.slot: 172 ## #portal.log(" Update of portlet: %s" % portlet) 173 ## portlet.edit(**new_portlet) 174 ## portlet_id = portlet.getId() 175 ## updated = 1 176 ## continue 177 ## 178 ## if not updated: 179 ## #portal.log(" Creation of portlet: %s" % new_portlet) 180 ## portlet_id = portal.portal_cpsportlets.createPortlet( 181 ## ptype_id=new_portlet['type'], 182 ## context=object, 183 ## **new_portlet) 184 ## if portlet_id not in returned: 185 ## returned.append(portlet_id) 186 ## return returned 187 ## ###) 188 ## 189 ##addWAeUPToolForm = HTMLFile('zmi/manage_addWAeUPUniversity', 190 ## globals()) 191 ## 192 ##def addWAeUPTool(container, id, 193 ## title='WAeUP University', 194 ## description='', 195 ## langs_list=None, 196 ## manager_id='manager', 197 ## manager_sn='CPS', 198 ## manager_givenName='Manager', 199 ## manager_email='', 200 ## manager_password='', 201 ## manager_password_confirmation='', 202 ## REQUEST=None): 203 ## """Add WAeUPTool""" 204 ## 205 ## _log = [] 206 ## def pr(bla, zlog=1, _log=_log): 207 ## if bla == 'flush': 208 ## return '<br/>\n'.join(_log) 209 ## _log.append(bla) 210 ## if (bla and zlog): 211 ## LOG('addWAeUPUniversity:', INFO, bla) 212 ## 213 ## uni_id = id.strip() 214 ## uni_name = title.strip() 215 ## description = description.strip() 216 ## manager_id = manager_id.strip() 217 ## 218 #### if not id: 219 #### raise ValueError, "You have to provide an id for the portal!" 220 #### if not manager_id: 221 #### raise ValueError, "You have to provide an id for the CPS Administrator!" 222 #### if not manager_email: 223 #### raise ValueError, "You have to provide an email address for the CPS Administrator!" 224 #### if not manager_password: 225 #### raise ValueError, "You have to provide CPS Administrator password!" 226 #### if manager_password != manager_password_confirmation: 227 #### raise ValueError, "Password confirmation does not match password!" 228 ## 229 ## email_from_name = ('%s %s' % (manager_givenName, manager_sn)).strip() 230 ## wt = WAeUPTool(uni_id,uni_name) 231 ## id = wt.getId() 232 ## container._setObject(id, wt) 233 ## sections = getattr(container,'sections') 234 ## workspaces = getattr(container,'workspaces') 235 ## sections.invokeFactory('University',uni_id) 236 ## uni = getattr(sections,uni_id) 237 ## uni.getContent().edit(title=uni_name) 238 ## uni.invokeFactory('StudentsFolder','students') 239 ## students = getattr(uni,'students').getContent() 240 ## students.edit(mapping={'Title':'Students'}) 241 #### uni.folder_localrole_add(member_ids=('group:Students',), 242 #### member_role='SectionReviewer', 243 #### ) 244 #### uni.content_create(type_name='AcademicsFolder',title='academics') 245 #### sections.uni.folder_localrole_add(member_ids=('group:StudentManager',), 246 #### member_role='SectionManager', 247 #### ) 248 #### uni.students.manage_setLocalGroupRoles(groupid = 'Students',roles=('Contributor',)) 249 ## uni.invokeFactory('AcademicsFolder','academics', title='Academics') 250 ## academics = getattr(uni,'academics').getContent() 251 ## academics.edit(mapping={'Title':'Academics'}) 252 ## uni.invokeFactory('AccoFolder','accommodation', title='Accommodation') 253 ## accommodation = getattr(uni,'accommodation').getContent() 254 ## accommodation.edit(mapping={'Title':'Accommodation'}) 255 ## academics = getattr(uni,'academics',None) 256 ## if academics is None: 257 ## uni.invokeFactory('AcademicsFolder','academics') 258 ## academics = getattr(uni,'academics') 259 ## academics.getContent().edit(mapping={'Title':'Academics'}) 260 ## wt.verifyFaculties(academics) 261 ## if not hasattr(uni,'accommodation'): 262 ## uni.invokeFactory('AccoFolder','accommodation') 263 ## accommodation = getattr(uni,'accommodation').getContent() 264 ## accommodation.edit(mapping={'Title':'Accommodation'}) 265 ## #uni.manage_setLocalGroupRoles(groupid = 'role:Anonymous',roles=('SectionReader',)) 266 ## # portlets ###( 267 ## # 268 ## portlets = ( 269 ## {#'identifier': 'waeup_breadcrumbs', 270 ## 'type': 'Breadcrumbs Portlet', 271 ## 'slot': 'waeup_breadcrumbs', 272 ## 'first_item': 0, 273 ## 'display_site_root': 0, 274 ## 'Title': 'waeup_breadcrumbs', 275 ## 'display': 'horizontal_trail', 276 ## 'display_hidden_folders': 0, 277 ## 'order': 0, 278 ## }, 279 ## {#'identifier': 'waeup_main_tab_actions', 280 ## 'type': 'Actions Portlet', 281 ## 'slot': 'main_tabs', 282 ## 'order': 0, 283 ## 'categories': ['main_tabs',], 284 ## 'Title': 'waep_main_tab_actions', 285 ## }, 286 ## {#'identifier': 'waeup_object_actions', 287 ## 'type': 'Actions Portlet', 288 ## 'slot': 'waeup_object_actions', 289 ## 'order': 0, 290 ## 'categories': ['object',], 291 ## 'Title': 'waep_manager_actions', 292 ## }, 293 ## {#'identifier': 'waeup_left_top', 294 ## 'type': 'Custom Portlet', 295 ## 'slot': 'left_top', 296 ## 'order': 0, 297 ## 'render_method': 'portlet_session_info', 298 ## 'Title': 'Session Info', 299 ## }, 300 ## ) 301 ## #verifyPortletContainer(uni) 302 ## verifyPortlets(container,portlets,uni) 303 ## 304 ## ###) 305 ## if REQUEST is not None: 306 ## url = container.absolute_url() 307 ## REQUEST.RESPONSE.redirect('%s/manage_main' % url) 308 ## -
WAeUP_SRP/trunk/exportimport.py
r274 r282 42 42 # WAeUP/profiles/default/ directory. 43 43 44 def installFaculties( academics): ###(45 """install Universityspecific Faculies with Departments"""46 faculties = [ ###(47 {'id': 'agriculture', ###(48 'Title': 'Agriculture',49 'departments': [50 ## { 'id': 'dep1', ###(51 ## 'Title': 'One',52 ## },53 ],54 },###)55 ###)56 {'id': 'arts', ###(57 'Title': 'Arts',58 'departments': [59 ## { 'id': 'dep1', ###(60 ## 'Title': 'One',61 ## },62 ],63 },###)64 ###)65 {'id': 'BasicMedicalSciences', ###(66 'Title': 'Basic Medical Sciences',67 'departments': [68 ## { 'id': 'dep1', ###(69 ## 'Title': 'One',70 ## },71 ],72 },###)73 ###)74 {'id': 'science', ###(75 'Title': 'Science',76 'departments': [77 { 'id': 'bio', ###(78 'Title': 'Biochemistry',79 },80 { 'id': 'bot',81 'Title': 'Botany',82 },83 { 'id': 'che',84 'Title': 'Chemistry',85 },86 { 'id': 'com',87 'Title': 'Computer Science',88 },89 { 'id': 'geo',90 'Title': 'Geologie',91 },92 { 'id': 'mat',93 'Title': 'Mathematics',94 },95 { 'id': 'mic',96 'Title': 'Microbiology',97 },98 { 'id': 'opt',99 'Title': 'Optometry',100 },101 { 'id': 'phy',102 'Title': 'Physics',103 },104 { 'id': 'zoo',105 'Title': 'Zoology',106 },107 ],108 },###)109 ]###)110 111 ###)112 113 for faculty in faculties:114 fid = faculty['id']115 f = getattr(academics,fid,None)116 if f is None:117 #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)118 academics.invokeFactory('Faculty', fid)119 f = getattr(academics,fid)120 f.getContent().edit(mapping=faculty)121 for department in faculty['departments']:122 #self.log('Checking Department %(id)s = %(Title)s' % department)123 did = department['id']124 d = getattr(f,did,None)125 if d is None:126 #self.log('Creating Department %(id)s = %(Title)s' % department)127 f.invokeFactory('Department', did)128 d = getattr(f,did)129 d.getContent().edit(mapping=department)130 ### )131 132 def loadFacultiesFromCSV(academics,site,context): ###(133 """install Universityspecific Faculies from CSV values"""134 #return135 logger = context.getLogger('loadfaculties')136 logger.info('Start loading Faculties')137 try:138 faculties = csv.DictReader(open("%s/import/faculty.csv" % i_home,"rb"))139 except:140 return141 l = site.portal_catalog({'meta_type': "Faculty"})142 facs = {}143 for f in l:144 facs[f.id] = f.getObject()145 for faculty in faculties:146 logger.info('processing %(Session)s %(FacultyCode)s %(Description)s %(CollegeCode)s %(FacultyKey)s %(Status)s %(degree_grade)s %(Bankcode)s' % faculty)147 fid = faculty['FacultyCode']148 f = facs.get(fid,None)149 if f is None:150 #self.log('Creating Faculty %(id)s = %(Title)s' % faculty)151 logger.info('Creating Faculty with ID %(FacultyCode)s %(Description)s' % faculty)152 academics.invokeFactory('Faculty', fid)153 f = getattr(academics,fid)154 d = {'Title': faculty['Description']}155 f.getContent().edit(mapping=d)156 ### )157 158 def loadDepartmentsFromCSV(academics,site,context): ###(159 """install Universityspecific Faculies from CSV values"""160 #return161 logger = context.getLogger('loaddepartments')162 try:163 deps = csv.DictReader(open("%s/import/departments.csv" % i_home,"rb"))164 except:165 return166 l = site.portal_catalog({'meta_type': "Faculty"})167 facs = {}168 for f in l:169 facs[f.id] = f.getObject()170 for dep in deps:171 logger.info('Processing %(Session)s %(DeptCode)s %(Description)s %(FacultyCode)s' % dep)172 fid = dep['FacultyCode']173 f = facs.get(fid,None)174 if f is None:175 logger.info( "No Faculty with ID: %s" % fid)176 else:177 did = dep.get('DeptCode')178 d = getattr(f,did,None)179 if d is None or d.portal_type == "Faculty":180 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)181 logger.info('Creating Department %(DeptCode)s = %(Description)s' % dep)182 f.invokeFactory('Department', did)183 d = getattr(f,did)184 dict = {'Title': dep['Description']}185 d.getContent().edit(mapping=dict)186 ### )187 188 def loadCoursesFromCSV(academics,site,context): ###(189 """install Universityspecific Courses from CSV values"""190 #return191 logger = context.getLogger('loadcourses')192 try:193 courses = csv.DictReader(open("%s/import/courses.csv" % i_home,"rb"))194 except:195 return196 l = site.portal_catalog({'meta_type': "Faculty"})197 facs = {}198 for f in l:199 facs[f.id] = f.getObject()200 dl = site.portal_catalog({'meta_type': "Department"})201 deps = {}202 for d in dl:203 deps[d.id] = d.getObject()204 cl = site.portal_catalog({'meta_type': "Course"})205 course_list = [ c.id for c in cl]206 for course in courses:207 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)208 if course.get("FORMERCODE").endswith('BITS'):209 continue210 depid = course.get('Dept').upper()211 if depid in deps.keys():212 dept= deps.get(depid)213 ## elif depid in facs.keys():214 ## dept= facs.get(depid)215 else:216 logger.info("Dep %(Dept)s for Course %(CourseCode)s not found" % course)217 continue218 course_id = ''.join(re.split('\W+',course.get('CourseCode')))219 if len(course_id) == 3:220 course_id = "%s000" % course_id221 elif len(course_id) != 6:222 logger.info("invalid course_code %(CourseCode)s" % course)223 #print course_id,course.get('CourseCode'),course.get('Description')224 continue225 ## if course_id in course_list:226 ## continue227 c = getattr(dept,course_id,None)228 if c is None:229 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)230 logger.info('Creating Course %(CourseCode)s %(Description)s in Department %(Dept)s' % course)231 dept.invokeFactory('Course', course_id)232 c = getattr(dept,course_id)233 dict = {'Title': course['Description']}234 dict['code'] = course_id235 dict['org_code'] = course.get('CourseCode')236 dict['credits'] = course.get('Credits')237 dict['semester'] = course.get('Semester')238 dict['session'] = course.get('Session')239 dict['category'] = course.get('Category')240 dict['passmark'] = course.get('PassMark')241 c.getContent().edit(mapping=dict)242 ### )243 244 def loadCertificatesFromCSV(site,context): ###(245 """install Universityspecific Certificates from CSV values"""246 #return247 logger = context.getLogger('loadcertificates')248 try:249 certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb"))250 except:251 return252 f_ids = [f.id for f in site.portal_catalog({'meta_type': "Faculty"})]253 #d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]254 dl = site.portal_catalog({'meta_type': "Department"})255 deps = {}256 for d in dl:257 deps[d.id] = d.getObject()258 for certificate in certificates:259 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)260 depid = certificate.get('Dept')261 facid = certificate.get('Faculty')262 if facid not in f_ids:263 logger.info('Faculty %(Faculty)s for %(CertCode)s %(Description)s not found' % certificate)264 continue265 if not deps.has_key(depid):266 logger.info('Department %(Dept)s for %(CertCode)s %(Description)s not found' % certificate)267 continue268 certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate269 dep = deps[depid]270 c = getattr(dep,certificate_id,None)271 if c is None:272 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)273 logger.info('Creating certificate %(CertCode)s %(Description)s in Department %(Dept)s' % certificate)274 dep.invokeFactory('Certificate', certificate_id)275 c = getattr(dep,certificate_id)276 dict = {'Title': certificate['Description']}277 code = certificate.get('CertCode')278 code = code.replace('.','')279 code = code.replace('(','')280 code = code.replace(')','')281 code = code.replace('/','')282 code = code.replace(' ','')283 code = code.replace('_','')284 dict['code'] = code285 dict['faculty'] = certificate.get('Faculty')286 dict['department'] = certificate.get('Dept')287 dict['max_pass'] = certificate.get('MaxPass')288 dict['max_load'] = certificate.get('MaxLoad')289 dict['admin_status'] = certificate.get('Admstatus')290 dict['category'] = certificate.get('category')291 dict['m_prefix'] = certificate.get('MPREFIX')292 dict['nr_years'] = int(certificate.get('Nyears'))293 nc = certificate.get('Ncore','1')294 try:295 dict['n_core'] = int(nc)296 except:297 dict['n_core'] = 1298 dict['start_level'] = certificate.get('StartLevel')299 dict['end_level'] = certificate.get('endLevel')300 dict['promotion_credits'] = certificate.get('PromotionCredits')301 dict['probation_credits'] = certificate.get('ProbationCredits')302 c.getContent().edit(mapping=dict)303 ### )304 305 def oldloadCertificatesFromCSV(certfolder,site,context): ###(306 """install Universityspecific Certificates from CSV values"""307 logger = context.getLogger('loadcertificates')308 certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb"))309 f_ids = [f.id for f in site.portal_catalog({'meta_type': "Faculty"})]310 d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]311 for certificate in certificates:312 depid = certificate.get('Dept')313 facid = certificate.get('Faculty')314 if facid not in f_ids:315 logger.info('Faculty %(Faculty)s for %(CertCode)s %(Description)s not found' % certificate)316 continue317 if depid not in d_ids:318 logger.info('Department %(Dept)s for %(CertCode)s %(Description)s not found' % certificate)319 continue320 certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate321 c = getattr(certfolder,certificate_id,None)322 if c is None:323 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)324 logger.info('Creating certificate %(CertCode)s %(Description)s in Department %(Dept)s' % certificate)325 certfolder.invokeFactory('Certificate', certificate_id)326 c = getattr(certfolder,certificate_id)327 dict = {'Title': certificate['Description']}328 code = certificate.get('CertCode')329 code = code.replace('.','')330 code = code.replace('(','')331 code = code.replace(')','')332 code = code.replace('/','')333 code = code.replace(' ','')334 code = code.replace('_','')335 dict['code'] = code336 dict['faculty'] = certificate.get('Faculty')337 dict['department'] = certificate.get('Dept')338 dict['max_pass'] = certificate.get('MaxPass')339 dict['max_load'] = certificate.get('MaxLoad')340 dict['admin_status'] = certificate.get('Admstatus')341 dict['category'] = certificate.get('category')342 dict['m_prefix'] = certificate.get('MPREFIX')343 dict['nr_years'] = int(certificate.get('Nyears'))344 nc = certificate.get('Ncore','1')345 try:346 dict['n_core'] = int(nc)347 except:348 dict['n_core'] = 1349 dict['start_level'] = certificate.get('StartLevel')350 dict['end_level'] = certificate.get('endLevel')351 dict['promotion_credits'] = certificate.get('PromotionCredits')352 dict['probation_credits'] = certificate.get('ProbationCredits')353 c.getContent().edit(mapping=dict)354 ### )355 356 def loadCertificateCoursesFromCSV(site,context): ###(357 """install Certificate Courses from CSV values"""358 #return359 logger = context.getLogger('loadcertificatecourses')360 try:361 cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb"))362 except:363 return364 d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]365 for cert_course in cert_courses:366 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)367 depid = cert_course.get('Dept')368 code = cert_course.get('CertCode')369 code = code.replace('.','')370 code = code.replace('(','')371 code = code.replace(')','')372 code = code.replace('/','')373 code = code.replace(' ','')374 code = code.replace('_','')375 if cert_course.get('Session') != '2002/2003':376 continue377 certificate = site.portal_catalog({'meta_type': "Certificate",378 'SearchableText': code})379 if not certificate:380 print code381 logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course)382 continue383 certificate = certificate[-1].getObject()384 certificate_code = certificate.getId()385 if depid not in d_ids:386 logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course)387 continue388 course_code = cert_course.get('CosCode')389 level = cert_course.get('Level')390 l = getattr(certificate,level,None)391 if l is None:392 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)393 logger.info('Creating Level %(Level)s in certificate %(CertCode)s' % cert_course)394 certificate.invokeFactory('StudyLevel', level)395 l = getattr(certificate, level)396 l.invokeFactory('Semester','first')397 l.invokeFactory('Semester','second')398 first_s = getattr(l,'first')399 second_s = getattr(l,'second')400 if cert_course.get('Semester') == '1':401 semester = first_s402 else:403 semester = second_s404 if hasattr(semester,course_code):405 logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course)406 continue407 408 semester.invokeFactory('CertificateCourse',course_code)409 cc = getattr(semester,course_code)410 dict = {}411 dict['code'] = cert_course.get('CosCode')412 dict['certificate_code'] = code413 dict['certificate_code_org'] = cert_course.get('CertCode')414 dict['department'] = cert_course.get('Dept')415 dict['admin_status'] = cert_course.get('Admstatus')416 dict['session'] = cert_course.get('Session')417 if cert_course.get('Core') != '':418 dict['core_or_elective'] = True419 else:420 dict['core_or_elective'] = False421 dict['level'] = cert_course.get('Level')422 cc.getContent().edit(mapping=dict)423 ### )424 425 def old_loadCertificateCoursesFromCSV(certfolder,site,context): ###(426 """install Certificate Courses from CSV values"""427 return428 logger = context.getLogger('loadcertificatecourses')429 cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb"))430 d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})]431 for cert_course in cert_courses:432 depid = cert_course.get('Dept')433 code = cert_course.get('CertCode')434 code = code.replace('.','')435 code = code.replace('(','')436 code = code.replace(')','')437 code = code.replace('/','')438 code = code.replace(' ','')439 code = code.replace('_','')440 if cert_course.get('Session') != '2002/2003':441 continue442 certificate = site.portal_catalog({'meta_type': "Certificate",443 'SearchableText': code})444 if not certificate:445 print code446 logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course)447 continue448 certificate = certificate[-1].getObject()449 certificate_code = certificate.getId()450 if depid not in d_ids:451 logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course)452 continue453 course_code = cert_course.get('CosCode')454 level = cert_course.get('Level')455 l = getattr(certificate,level,None)456 if l is None:457 #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep)458 logger.info('Creating Level %(Level)s in certificate %(CertCode)s' % cert_course)459 certificate.invokeFactory('StudyLevel', level)460 l = getattr(certificate, level)461 l.invokeFactory('Semester','first')462 l.invokeFactory('Semester','second')463 first_s = getattr(l,'first')464 second_s = getattr(l,'second')465 if cert_course.get('Semester') == '1':466 semester = first_s467 else:468 semester = second_s469 if hasattr(semester,course_code):470 logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course)471 continue472 473 semester.invokeFactory('CertificateCourse',course_code)474 cc = getattr(semester,course_code)475 dict = {}476 dict['code'] = cert_course.get('CosCode')477 dict['certificate_code'] = code478 dict['certificate_code_org'] = cert_course.get('CertCode')479 dict['department'] = cert_course.get('Dept')480 dict['admin_status'] = cert_course.get('Admstatus')481 dict['session'] = cert_course.get('Session')482 if cert_course.get('Core') != '':483 dict['core_or_elective'] = True484 else:485 dict['core_or_elective'] = False486 dict['level'] = cert_course.get('Level')487 cc.getContent().edit(mapping=dict)488 ### )489 490 def setupStructure(site,context): ###(491 portal = getattr(site,'uniportal',None)492 if portal is None:493 site.invokeFactory('University','uniportal')494 portal = getattr(site,'uniportal',None)495 portal.getContent().edit(mapping={'Title':SRPP_TITLE})496 students = getattr(portal,'students',None)497 if students is None:498 portal.invokeFactory('StudentsFolder','students')499 students = getattr(portal,'students').getContent()500 students.edit(mapping={'Title':'Students'})501 academics = getattr(portal,'academics',None)502 if academics is None:503 portal.invokeFactory('AcademicsFolder','academics')504 academics = getattr(portal,'academics')505 academics.getContent().edit(mapping={'Title':'Academics'})506 loadFacultiesFromCSV(academics,site,context)507 loadDepartmentsFromCSV(academics,site,context)508 loadCoursesFromCSV(academics,site,context)509 ## certificates = getattr(academics,'certificates',None)510 ## if certificates is None:511 ## academics.invokeFactory('SCFolder','certificates')512 ## certificates = getattr(academics,'certificates')513 ## certificates.getContent().edit(mapping={'Title':'Certificates'})514 loadCertificatesFromCSV(site,context)515 loadCertificateCoursesFromCSV(site,context)516 if not hasattr(portal,'accommodation'):517 portal.invokeFactory('AccoFolder','accommodation')518 accommodation = getattr(portal,'accommodation').getContent()519 accommodation.edit(mapping={'Title':'Accommodation'})520 ### )44 ##def installFaculties( academics): ###( 45 ## """install Universityspecific Faculies with Departments""" 46 ## faculties = [ ###( 47 ## {'id': 'agriculture', ###( 48 ## 'Title': 'Agriculture', 49 ## 'departments': [ 50 #### { 'id': 'dep1', ###( 51 #### 'Title': 'One', 52 #### }, 53 ## ], 54 ## },###) 55 ## ###) 56 ## {'id': 'arts', ###( 57 ## 'Title': 'Arts', 58 ## 'departments': [ 59 #### { 'id': 'dep1', ###( 60 #### 'Title': 'One', 61 #### }, 62 ## ], 63 ## },###) 64 ## ###) 65 ## {'id': 'BasicMedicalSciences', ###( 66 ## 'Title': 'Basic Medical Sciences', 67 ## 'departments': [ 68 #### { 'id': 'dep1', ###( 69 #### 'Title': 'One', 70 #### }, 71 ## ], 72 ## },###) 73 ## ###) 74 ## {'id': 'science', ###( 75 ## 'Title': 'Science', 76 ## 'departments': [ 77 ## { 'id': 'bio', ###( 78 ## 'Title': 'Biochemistry', 79 ## }, 80 ## { 'id': 'bot', 81 ## 'Title': 'Botany', 82 ## }, 83 ## { 'id': 'che', 84 ## 'Title': 'Chemistry', 85 ## }, 86 ## { 'id': 'com', 87 ## 'Title': 'Computer Science', 88 ## }, 89 ## { 'id': 'geo', 90 ## 'Title': 'Geologie', 91 ## }, 92 ## { 'id': 'mat', 93 ## 'Title': 'Mathematics', 94 ## }, 95 ## { 'id': 'mic', 96 ## 'Title': 'Microbiology', 97 ## }, 98 ## { 'id': 'opt', 99 ## 'Title': 'Optometry', 100 ## }, 101 ## { 'id': 'phy', 102 ## 'Title': 'Physics', 103 ## }, 104 ## { 'id': 'zoo', 105 ## 'Title': 'Zoology', 106 ## }, 107 ## ], 108 ## },###) 109 ## ]###) 110 ## 111 ## ###) 112 ## 113 ## for faculty in faculties: 114 ## fid = faculty['id'] 115 ## f = getattr(academics,fid,None) 116 ## if f is None: 117 ## #self.log('Creating Faculty %(id)s = %(Title)s' % faculty) 118 ## academics.invokeFactory('Faculty', fid) 119 ## f = getattr(academics,fid) 120 ## f.getContent().edit(mapping=faculty) 121 ## for department in faculty['departments']: 122 ## #self.log('Checking Department %(id)s = %(Title)s' % department) 123 ## did = department['id'] 124 ## d = getattr(f,did,None) 125 ## if d is None: 126 ## #self.log('Creating Department %(id)s = %(Title)s' % department) 127 ## f.invokeFactory('Department', did) 128 ## d = getattr(f,did) 129 ## d.getContent().edit(mapping=department) 130 #####) 131 ## 132 ##def loadFacultiesFromCSV(academics,site,context): ###( 133 ## """install Universityspecific Faculies from CSV values""" 134 ## #return 135 ## logger = context.getLogger('loadfaculties') 136 ## logger.info('Start loading Faculties') 137 ## try: 138 ## faculties = csv.DictReader(open("%s/import/faculty.csv" % i_home,"rb")) 139 ## except: 140 ## return 141 ## l = site.portal_catalog({'meta_type': "Faculty"}) 142 ## facs = {} 143 ## for f in l: 144 ## facs[f.id] = f.getObject() 145 ## for faculty in faculties: 146 ## logger.info('processing %(Session)s %(FacultyCode)s %(Description)s %(CollegeCode)s %(FacultyKey)s %(Status)s %(degree_grade)s %(Bankcode)s' % faculty) 147 ## fid = faculty['FacultyCode'] 148 ## f = facs.get(fid,None) 149 ## if f is None: 150 ## #self.log('Creating Faculty %(id)s = %(Title)s' % faculty) 151 ## logger.info('Creating Faculty with ID %(FacultyCode)s %(Description)s' % faculty) 152 ## academics.invokeFactory('Faculty', fid) 153 ## f = getattr(academics,fid) 154 ## d = {'Title': faculty['Description']} 155 ## f.getContent().edit(mapping=d) 156 #####) 157 ## 158 ##def loadDepartmentsFromCSV(academics,site,context): ###( 159 ## """install Universityspecific Faculies from CSV values""" 160 ## #return 161 ## logger = context.getLogger('loaddepartments') 162 ## try: 163 ## deps = csv.DictReader(open("%s/import/departments.csv" % i_home,"rb")) 164 ## except: 165 ## return 166 ## l = site.portal_catalog({'meta_type': "Faculty"}) 167 ## facs = {} 168 ## for f in l: 169 ## facs[f.id] = f.getObject() 170 ## for dep in deps: 171 ## logger.info('Processing %(Session)s %(DeptCode)s %(Description)s %(FacultyCode)s' % dep) 172 ## fid = dep['FacultyCode'] 173 ## f = facs.get(fid,None) 174 ## if f is None: 175 ## logger.info( "No Faculty with ID: %s" % fid) 176 ## else: 177 ## did = dep.get('DeptCode') 178 ## d = getattr(f,did,None) 179 ## if d is None or d.portal_type == "Faculty": 180 ## #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 181 ## logger.info('Creating Department %(DeptCode)s = %(Description)s' % dep) 182 ## f.invokeFactory('Department', did) 183 ## d = getattr(f,did) 184 ## dict = {'Title': dep['Description']} 185 ## d.getContent().edit(mapping=dict) 186 #####) 187 ## 188 ##def loadCoursesFromCSV(academics,site,context): ###( 189 ## """install Universityspecific Courses from CSV values""" 190 ## #return 191 ## logger = context.getLogger('loadcourses') 192 ## try: 193 ## courses = csv.DictReader(open("%s/import/courses.csv" % i_home,"rb")) 194 ## except: 195 ## return 196 ## l = site.portal_catalog({'meta_type': "Faculty"}) 197 ## facs = {} 198 ## for f in l: 199 ## facs[f.id] = f.getObject() 200 ## dl = site.portal_catalog({'meta_type': "Department"}) 201 ## deps = {} 202 ## for d in dl: 203 ## deps[d.id] = d.getObject() 204 ## cl = site.portal_catalog({'meta_type': "Course"}) 205 ## course_list = [ c.id for c in cl] 206 ## for course in courses: 207 ## 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) 208 ## if course.get("FORMERCODE").endswith('BITS'): 209 ## continue 210 ## depid = course.get('Dept').upper() 211 ## if depid in deps.keys(): 212 ## dept= deps.get(depid) 213 #### elif depid in facs.keys(): 214 #### dept= facs.get(depid) 215 ## else: 216 ## logger.info("Dep %(Dept)s for Course %(CourseCode)s not found" % course) 217 ## continue 218 ## course_id = ''.join(re.split('\W+',course.get('CourseCode'))) 219 ## if len(course_id) == 3: 220 ## course_id = "%s000" % course_id 221 ## elif len(course_id) != 6: 222 ## logger.info("invalid course_code %(CourseCode)s" % course) 223 ## #print course_id,course.get('CourseCode'),course.get('Description') 224 ## continue 225 #### if course_id in course_list: 226 #### continue 227 ## c = getattr(dept,course_id,None) 228 ## if c is None: 229 ## #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 230 ## logger.info('Creating Course %(CourseCode)s %(Description)s in Department %(Dept)s' % course) 231 ## dept.invokeFactory('Course', course_id) 232 ## c = getattr(dept,course_id) 233 ## dict = {'Title': course['Description']} 234 ## dict['code'] = course_id 235 ## dict['org_code'] = course.get('CourseCode') 236 ## dict['credits'] = course.get('Credits') 237 ## dict['semester'] = course.get('Semester') 238 ## dict['session'] = course.get('Session') 239 ## dict['category'] = course.get('Category') 240 ## dict['passmark'] = course.get('PassMark') 241 ## c.getContent().edit(mapping=dict) 242 #####) 243 ## 244 ##def loadCertificatesFromCSV(site,context): ###( 245 ## """install Universityspecific Certificates from CSV values""" 246 ## #return 247 ## logger = context.getLogger('loadcertificates') 248 ## try: 249 ## certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb")) 250 ## except: 251 ## return 252 ## f_ids = [f.id for f in site.portal_catalog({'meta_type': "Faculty"})] 253 ## #d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})] 254 ## dl = site.portal_catalog({'meta_type': "Department"}) 255 ## deps = {} 256 ## for d in dl: 257 ## deps[d.id] = d.getObject() 258 ## for certificate in certificates: 259 ## 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) 260 ## depid = certificate.get('Dept') 261 ## facid = certificate.get('Faculty') 262 ## if facid not in f_ids: 263 ## logger.info('Faculty %(Faculty)s for %(CertCode)s %(Description)s not found' % certificate) 264 ## continue 265 ## if not deps.has_key(depid): 266 ## logger.info('Department %(Dept)s for %(CertCode)s %(Description)s not found' % certificate) 267 ## continue 268 ## certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate 269 ## dep = deps[depid] 270 ## c = getattr(dep,certificate_id,None) 271 ## if c is None: 272 ## #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 273 ## logger.info('Creating certificate %(CertCode)s %(Description)s in Department %(Dept)s' % certificate) 274 ## dep.invokeFactory('Certificate', certificate_id) 275 ## c = getattr(dep,certificate_id) 276 ## dict = {'Title': certificate['Description']} 277 ## code = certificate.get('CertCode') 278 ## code = code.replace('.','') 279 ## code = code.replace('(','') 280 ## code = code.replace(')','') 281 ## code = code.replace('/','') 282 ## code = code.replace(' ','') 283 ## code = code.replace('_','') 284 ## dict['code'] = code 285 ## dict['faculty'] = certificate.get('Faculty') 286 ## dict['department'] = certificate.get('Dept') 287 ## dict['max_pass'] = certificate.get('MaxPass') 288 ## dict['max_load'] = certificate.get('MaxLoad') 289 ## dict['admin_status'] = certificate.get('Admstatus') 290 ## dict['category'] = certificate.get('category') 291 ## dict['m_prefix'] = certificate.get('MPREFIX') 292 ## dict['nr_years'] = int(certificate.get('Nyears')) 293 ## nc = certificate.get('Ncore','1') 294 ## try: 295 ## dict['n_core'] = int(nc) 296 ## except: 297 ## dict['n_core'] = 1 298 ## dict['start_level'] = certificate.get('StartLevel') 299 ## dict['end_level'] = certificate.get('endLevel') 300 ## dict['promotion_credits'] = certificate.get('PromotionCredits') 301 ## dict['probation_credits'] = certificate.get('ProbationCredits') 302 ## c.getContent().edit(mapping=dict) 303 #####) 304 ## 305 ##def oldloadCertificatesFromCSV(certfolder,site,context): ###( 306 ## """install Universityspecific Certificates from CSV values""" 307 ## logger = context.getLogger('loadcertificates') 308 ## certificates = csv.DictReader(open("%s/import/certificates.csv" % i_home,"rb")) 309 ## f_ids = [f.id for f in site.portal_catalog({'meta_type': "Faculty"})] 310 ## d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})] 311 ## for certificate in certificates: 312 ## depid = certificate.get('Dept') 313 ## facid = certificate.get('Faculty') 314 ## if facid not in f_ids: 315 ## logger.info('Faculty %(Faculty)s for %(CertCode)s %(Description)s not found' % certificate) 316 ## continue 317 ## if depid not in d_ids: 318 ## logger.info('Department %(Dept)s for %(CertCode)s %(Description)s not found' % certificate) 319 ## continue 320 ## certificate_id = "%(category)s_%(Admstatus)s_%(Dept)s" % certificate 321 ## c = getattr(certfolder,certificate_id,None) 322 ## if c is None: 323 ## #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 324 ## logger.info('Creating certificate %(CertCode)s %(Description)s in Department %(Dept)s' % certificate) 325 ## certfolder.invokeFactory('Certificate', certificate_id) 326 ## c = getattr(certfolder,certificate_id) 327 ## dict = {'Title': certificate['Description']} 328 ## code = certificate.get('CertCode') 329 ## code = code.replace('.','') 330 ## code = code.replace('(','') 331 ## code = code.replace(')','') 332 ## code = code.replace('/','') 333 ## code = code.replace(' ','') 334 ## code = code.replace('_','') 335 ## dict['code'] = code 336 ## dict['faculty'] = certificate.get('Faculty') 337 ## dict['department'] = certificate.get('Dept') 338 ## dict['max_pass'] = certificate.get('MaxPass') 339 ## dict['max_load'] = certificate.get('MaxLoad') 340 ## dict['admin_status'] = certificate.get('Admstatus') 341 ## dict['category'] = certificate.get('category') 342 ## dict['m_prefix'] = certificate.get('MPREFIX') 343 ## dict['nr_years'] = int(certificate.get('Nyears')) 344 ## nc = certificate.get('Ncore','1') 345 ## try: 346 ## dict['n_core'] = int(nc) 347 ## except: 348 ## dict['n_core'] = 1 349 ## dict['start_level'] = certificate.get('StartLevel') 350 ## dict['end_level'] = certificate.get('endLevel') 351 ## dict['promotion_credits'] = certificate.get('PromotionCredits') 352 ## dict['probation_credits'] = certificate.get('ProbationCredits') 353 ## c.getContent().edit(mapping=dict) 354 #####) 355 ## 356 ##def loadCertificateCoursesFromCSV(site,context): ###( 357 ## """install Certificate Courses from CSV values""" 358 ## #return 359 ## logger = context.getLogger('loadcertificatecourses') 360 ## try: 361 ## cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb")) 362 ## except: 363 ## return 364 ## d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})] 365 ## for cert_course in cert_courses: 366 ## 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) 367 ## depid = cert_course.get('Dept') 368 ## code = cert_course.get('CertCode') 369 ## code = code.replace('.','') 370 ## code = code.replace('(','') 371 ## code = code.replace(')','') 372 ## code = code.replace('/','') 373 ## code = code.replace(' ','') 374 ## code = code.replace('_','') 375 ## if cert_course.get('Session') != '2002/2003': 376 ## continue 377 ## certificate = site.portal_catalog({'meta_type': "Certificate", 378 ## 'SearchableText': code}) 379 ## if not certificate: 380 ## print code 381 ## logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course) 382 ## continue 383 ## certificate = certificate[-1].getObject() 384 ## certificate_code = certificate.getId() 385 ## if depid not in d_ids: 386 ## logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course) 387 ## continue 388 ## course_code = cert_course.get('CosCode') 389 ## level = cert_course.get('Level') 390 ## l = getattr(certificate,level,None) 391 ## if l is None: 392 ## #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 393 ## logger.info('Creating Level %(Level)s in certificate %(CertCode)s' % cert_course) 394 ## certificate.invokeFactory('StudyLevel', level) 395 ## l = getattr(certificate, level) 396 ## l.invokeFactory('Semester','first') 397 ## l.invokeFactory('Semester','second') 398 ## first_s = getattr(l,'first') 399 ## second_s = getattr(l,'second') 400 ## if cert_course.get('Semester') == '1': 401 ## semester = first_s 402 ## else: 403 ## semester = second_s 404 ## if hasattr(semester,course_code): 405 ## logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course) 406 ## continue 407 ## 408 ## semester.invokeFactory('CertificateCourse',course_code) 409 ## cc = getattr(semester,course_code) 410 ## dict = {} 411 ## dict['code'] = cert_course.get('CosCode') 412 ## dict['certificate_code'] = code 413 ## dict['certificate_code_org'] = cert_course.get('CertCode') 414 ## dict['department'] = cert_course.get('Dept') 415 ## dict['admin_status'] = cert_course.get('Admstatus') 416 ## dict['session'] = cert_course.get('Session') 417 ## if cert_course.get('Core') != '': 418 ## dict['core_or_elective'] = True 419 ## else: 420 ## dict['core_or_elective'] = False 421 ## dict['level'] = cert_course.get('Level') 422 ## cc.getContent().edit(mapping=dict) 423 #####) 424 ## 425 ##def old_loadCertificateCoursesFromCSV(certfolder,site,context): ###( 426 ## """install Certificate Courses from CSV values""" 427 ## return 428 ## logger = context.getLogger('loadcertificatecourses') 429 ## cert_courses = csv.DictReader(open("%s/import/course_level_courses.csv" % i_home,"rb")) 430 ## d_ids = [d.id for d in site.portal_catalog({'meta_type': "Department"})] 431 ## for cert_course in cert_courses: 432 ## depid = cert_course.get('Dept') 433 ## code = cert_course.get('CertCode') 434 ## code = code.replace('.','') 435 ## code = code.replace('(','') 436 ## code = code.replace(')','') 437 ## code = code.replace('/','') 438 ## code = code.replace(' ','') 439 ## code = code.replace('_','') 440 ## if cert_course.get('Session') != '2002/2003': 441 ## continue 442 ## certificate = site.portal_catalog({'meta_type': "Certificate", 443 ## 'SearchableText': code}) 444 ## if not certificate: 445 ## print code 446 ## logger.info('CertCode %(CertCode)s for %(CosCode)s not found' % cert_course) 447 ## continue 448 ## certificate = certificate[-1].getObject() 449 ## certificate_code = certificate.getId() 450 ## if depid not in d_ids: 451 ## logger.info('Department %(Dept)s for %(CertCode)s not found' % cert_course) 452 ## continue 453 ## course_code = cert_course.get('CosCode') 454 ## level = cert_course.get('Level') 455 ## l = getattr(certificate,level,None) 456 ## if l is None: 457 ## #self.log('Creating Department %(DeptCode)s = %(Description)s' % dep) 458 ## logger.info('Creating Level %(Level)s in certificate %(CertCode)s' % cert_course) 459 ## certificate.invokeFactory('StudyLevel', level) 460 ## l = getattr(certificate, level) 461 ## l.invokeFactory('Semester','first') 462 ## l.invokeFactory('Semester','second') 463 ## first_s = getattr(l,'first') 464 ## second_s = getattr(l,'second') 465 ## if cert_course.get('Semester') == '1': 466 ## semester = first_s 467 ## else: 468 ## semester = second_s 469 ## if hasattr(semester,course_code): 470 ## logger.info('Duplicate %(CosCode)s in Level %(Level)s' % cert_course) 471 ## continue 472 ## 473 ## semester.invokeFactory('CertificateCourse',course_code) 474 ## cc = getattr(semester,course_code) 475 ## dict = {} 476 ## dict['code'] = cert_course.get('CosCode') 477 ## dict['certificate_code'] = code 478 ## dict['certificate_code_org'] = cert_course.get('CertCode') 479 ## dict['department'] = cert_course.get('Dept') 480 ## dict['admin_status'] = cert_course.get('Admstatus') 481 ## dict['session'] = cert_course.get('Session') 482 ## if cert_course.get('Core') != '': 483 ## dict['core_or_elective'] = True 484 ## else: 485 ## dict['core_or_elective'] = False 486 ## dict['level'] = cert_course.get('Level') 487 ## cc.getContent().edit(mapping=dict) 488 #####) 489 ## 490 ##def setupStructure(site,context): ###( 491 ## portal = getattr(site,'uniportal',None) 492 ## if portal is None: 493 ## site.invokeFactory('University','uniportal') 494 ## portal = getattr(site,'uniportal',None) 495 ## portal.getContent().edit(mapping={'Title':SRPP_TITLE}) 496 ## students = getattr(portal,'students',None) 497 ## if students is None: 498 ## portal.invokeFactory('StudentsFolder','students') 499 ## students = getattr(portal,'students').getContent() 500 ## students.edit(mapping={'Title':'Students'}) 501 ## academics = getattr(portal,'academics',None) 502 ## if academics is None: 503 ## portal.invokeFactory('AcademicsFolder','academics') 504 ## academics = getattr(portal,'academics') 505 ## academics.getContent().edit(mapping={'Title':'Academics'}) 506 ## loadFacultiesFromCSV(academics,site,context) 507 ## loadDepartmentsFromCSV(academics,site,context) 508 ## loadCoursesFromCSV(academics,site,context) 509 #### certificates = getattr(academics,'certificates',None) 510 #### if certificates is None: 511 #### academics.invokeFactory('SCFolder','certificates') 512 #### certificates = getattr(academics,'certificates') 513 #### certificates.getContent().edit(mapping={'Title':'Certificates'}) 514 ## loadCertificatesFromCSV(site,context) 515 ## loadCertificateCoursesFromCSV(site,context) 516 ## if not hasattr(portal,'accommodation'): 517 ## portal.invokeFactory('AccoFolder','accommodation') 518 ## accommodation = getattr(portal,'accommodation').getContent() 519 ## accommodation.edit(mapping={'Title':'Accommodation'}) 520 #####) 521 521 522 522 … … 525 525 """ 526 526 site = context.getSite() 527 tool = get ToolByName(site, TOOL,None)527 tool = getattr(context,"campus",None) 528 528 if tool is None: 529 529 logger = context.getLogger(NAME) … … 548 548 # components machinery and the associations made in the configure.zcml file. 549 549 550 class WAeUPXMLAdapter(XMLAdapterBase, PropertyManagerHelpers):551 """XML importer and exporter for the WAeUP tool.552 553 Hence this XMLAdapter is really simple. To get more complete examples of554 what XMLAdapters are meant to do, please have a look at the555 CPSSkins.exportimport.py or CPSDirectory.exportimport.py files, for556 instance.557 """558 559 adapts(IWAeUPTool, ISetupEnviron)560 implements(IBody)561 562 _LOGGER_ID = NAME563 name = NAME564 565 def _exportNode(self):566 """Export the object as a DOM node.567 """568 node = self._getObjectNode('object')569 node.appendChild(self._extractProperties())570 self._logger.info("WAeUP tool exported.")571 return node572 573 def _importNode(self, node):574 """Import the object from the DOM node.575 """576 if self.environ.shouldPurge():577 self._purgeProperties()578 self._initProperties(node)579 self._logger.info("WAeUP tool imported.")580 550 ##class WAeUPXMLAdapter(XMLAdapterBase, PropertyManagerHelpers): 551 ## """XML importer and exporter for the WAeUP tool. 552 ## 553 ## Hence this XMLAdapter is really simple. To get more complete examples of 554 ## what XMLAdapters are meant to do, please have a look at the 555 ## CPSSkins.exportimport.py or CPSDirectory.exportimport.py files, for 556 ## instance. 557 ## """ 558 ## 559 ## adapts(IWAeUPTool, ISetupEnviron) 560 ## implements(IBody) 561 ## 562 ## _LOGGER_ID = NAME 563 ## name = NAME 564 ## 565 ## def _exportNode(self): 566 ## """Export the object as a DOM node. 567 ## """ 568 ## node = self._getObjectNode('object') 569 ## node.appendChild(self._extractProperties()) 570 ## self._logger.info("WAeUP tool exported.") 571 ## return node 572 ## 573 ## def _importNode(self, node): 574 ## """Import the object from the DOM node. 575 ## """ 576 ## if self.environ.shouldPurge(): 577 ## self._purgeProperties() 578 ## self._initProperties(node) 579 ## self._logger.info("WAeUP tool imported.") 580 ## -
WAeUP_SRP/trunk/profiles/default/catalog.xml
r280 r282 1 1 <?xml version="1.0"?> 2 2 <object name="portal_catalog" meta_type="CMF Catalog"> 3 <property name="title"></property>4 <object name="cps_defaut_lexicon" meta_type="ZCTextIndex Lexicon">5 <element name="Whitespace splitter" group="Word Splitter"/>6 <element name="Case Normalizer" group="Case Normalizer"/>7 </object>8 <object name="htmltext_lexicon" meta_type="ZCTextIndex Lexicon">9 <element name="HTML aware splitter" group="Word Splitter"/>10 <element name="Case Normalizer" group="Case Normalizer"/>11 <element name="Remove listed stop words only" group="Stop Words"/>12 </object>13 <object name="plaintext_lexicon" meta_type="ZCTextIndex Lexicon">14 <element name="Whitespace splitter" group="Word Splitter"/>15 <element name="Case Normalizer" group="Case Normalizer"/>16 <element name="Remove listed stop words only" group="Stop Words"/>17 </object>18 <index name="Creator" meta_type="FieldIndex">19 <indexed_attr value="Creator"/>20 </index>21 <index name="Date" meta_type="DateIndex">22 <property name="index_naive_time_as_local">True</property>23 </index>24 <index name="Description" meta_type="ZCTextIndex">25 <indexed_attr value="Description"/>26 <extra name="index_type" value="Okapi BM25 Rank"/>27 <extra name="lexicon_id" value="plaintext_lexicon"/>28 </index>29 <index name="Language" meta_type="FieldIndex">30 <indexed_attr value="Language"/>31 </index>32 <index name="SearchableText" meta_type="ZCTextIndex">33 <indexed_attr value="SearchableText"/>34 <extra name="index_type" value="Okapi BM25 Rank"/>35 <extra name="lexicon_id" value="htmltext_lexicon"/>36 </index>37 <index name="Subject" meta_type="KeywordIndex">38 <indexed_attr value="Subject"/>39 </index>40 <index name="Title" meta_type="FieldIndex">41 <indexed_attr value="Title"/>42 </index>43 <index name="Type" meta_type="FieldIndex">44 <indexed_attr value="Type"/>45 </index>46 <index name="ZCTitle" meta_type="ZCTextIndex">47 <indexed_attr value="ZCTitle"/>48 <extra name="index_type" value="Okapi BM25 Rank"/>49 <extra name="lexicon_id" value="cps_defaut_lexicon"/>50 </index>51 <index name="allowedRolesAndUsers" meta_type="KeywordIndex">52 <indexed_attr value="allowedRolesAndUsers"/>53 </index>54 <index name="container_path" meta_type="FieldIndex">55 <indexed_attr value="container_path"/>56 </index>57 <index name="cps_filter_sets" meta_type="TopicIndex">58 <filtered_set name="default_languages" meta_type="PythonFilteredSet"59 expression="not hasattr(o, 'isDefaultLanguage') or o.isDefaultLanguage()"/>60 <filtered_set name="leaves" meta_type="PythonFilteredSet"61 expression="not o.isCPSFolderish()"/>62 <filtered_set name="nodes" meta_type="PythonFilteredSet"63 expression="o.isCPSFolderish()"/>64 <filtered_set name="searchable" meta_type="PythonFilteredSet"65 expression="not filter(lambda s: s.startswith('portal_') or s and s[0] in ('.', '_'), o.getPhysicalPath())"/>66 </index>67 <index name="created" meta_type="DateIndex">68 <property name="index_naive_time_as_local">True</property>69 </index>70 <index name="effective" meta_type="DateIndex">71 <property name="index_naive_time_as_local">True</property>72 </index>73 <index name="end" meta_type="DateIndex">74 <property name="index_naive_time_as_local">True</property>75 </index>76 <index name="expires" meta_type="DateIndex">77 <property name="index_naive_time_as_local">True</property>78 </index>79 <index name="getId" meta_type="FieldIndex">80 <indexed_attr value="getId"/>81 </index>82 <index name="id" meta_type="FieldIndex">83 <indexed_attr value="id"/>84 </index>85 <index name="in_reply_to" meta_type="FieldIndex">86 <indexed_attr value="in_reply_to"/>87 </index>88 <index name="listCreators" meta_type="KeywordIndex">89 <indexed_attr value="listCreators"/>90 </index>91 <index name="localUsersWithRoles" meta_type="KeywordIndex">92 <indexed_attr value="localUsersWithRoles"/>93 </index>94 <index name="meta_type" meta_type="FieldIndex">95 <indexed_attr value="meta_type"/>96 </index>97 <index name="modified" meta_type="DateIndex">98 <property name="index_naive_time_as_local">True</property>99 </index>100 <index name="path" meta_type="PathIndex"/>101 <index name="portal_type" meta_type="FieldIndex">102 <indexed_attr value="portal_type"/>103 </index>104 <index name="position_in_container" meta_type="FieldIndex">105 <indexed_attr value="position_in_container"/>106 </index>107 <index name="relative_path" meta_type="FieldIndex">108 <indexed_attr value="relative_path"/>109 </index>110 <index name="relative_path_depth" meta_type="FieldIndex">111 <indexed_attr value="relative_path_depth"/>112 </index>113 <index name="review_state" meta_type="FieldIndex">114 <indexed_attr value="review_state"/>115 </index>116 <index name="start" meta_type="DateIndex">117 <property name="index_naive_time_as_local">True</property>118 </index>119 <index name="time" meta_type="DateIndex">120 <property name="index_naive_time_as_local">True</property>121 </index>122 <column value="Contributors"/>123 <column value="CreationDate"/>124 <column value="Creator"/>125 <column value="Date"/>126 <column value="Description"/>127 <column value="EffectiveDate"/>128 <column value="ExpirationDate"/>129 <column value="Language"/>130 <column value="ModificationDate"/>131 <column value="Subject"/>132 <column value="Title"/>133 <column value="Type"/>134 <column value="created"/>135 3 <column value="credits"/> 136 <column value="effective"/>137 <column value="end"/>138 <column value="expires"/>139 <column value="getIcon"/>140 <column value="getId"/>141 <column value="getRevision"/>142 <column value="id"/>143 <column value="listCreators"/>144 <column value="modified"/>145 4 <column value="passmark"/> 146 <column value="portal_type"/>147 <column value="position_in_container"/>148 <column value="relative_path"/>149 <column value="review_state"/>150 <column value="start"/>151 <column value="time"/>152 5 </object> -
WAeUP_SRP/trunk/profiles/default/roots.xml
r263 r282 1 1 <?xml version="1.0"?> 2 2 <roots> 3 <object name=" uniportal" portal_type="University"/>3 <object name="campus" portal_type="University"/> 4 4 </roots> -
WAeUP_SRP/trunk/profiles/default/roots/campus.xml
r279 r282 1 1 <?xml version="1.0"?> 2 <object name=" uniportal">2 <object name="campus"> 3 3 <property name="title">University Portal</property> 4 4 <property name=".cpsskins_theme">waeup_plain_theme</property> -
WAeUP_SRP/trunk/profiles/default/skins/waeup_academics.xml
r280 r282 1 1 <?xml version="1.0"?> 2 <object name="waeup_ faculty" meta_type="Folder">2 <object name="waeup_academics" meta_type="Folder"> 3 3 <property name="title"></property> 4 4 </object> -
WAeUP_SRP/trunk/profiles/default/workflows.xml
r256 r282 19 19 <object name="waeup_base_wf" meta_type="CPS Workflow"/> 20 20 <object name="waeup_certificate_wf" meta_type="CPS Workflow"/> 21 <object name="waeup_certificate_course_wf" meta_type="CPS Workflow"/> 21 22 <object name="waeup_course_wf" meta_type="CPS Workflow"/> 22 23 <object name="waeup_department_wf" meta_type="CPS Workflow"/> … … 46 47 </type> 47 48 <type type_id="CertificateCourse"> 48 <bound-workflow workflow_id="waeup_certificate_ wf"/>49 <bound-workflow workflow_id="waeup_certificate_course_wf"/> 49 50 </type> 50 51 <type type_id="CPS Calendar"> -
WAeUP_SRP/trunk/profiles/default/workflows/waeup_certificate_course_wf/definition.xml
r256 r282 1 1 <?xml version="1.0"?> 2 <cps-workflow workflow_id="waeup_c ourse_wf"2 <cps-workflow workflow_id="waeup_certificate_course_wf" 3 3 title="CPS Workflow Definition" 4 4 state_variable="review_state" -
WAeUP_SRP/trunk/profiles/default/workflows/waeup_certificate_wf/definition.xml
r256 r282 1 1 <?xml version="1.0"?> 2 <cps-workflow workflow_id="waeup_c ourse_wf"2 <cps-workflow workflow_id="waeup_certificate_wf" 3 3 title="CPS Workflow Definition" 4 4 state_variable="review_state" -
WAeUP_SRP/trunk/skins/waeup_academics/level_view_form.pt
r280 r282 32 32 </td> 33 33 <td tal:content="course/Title"></td> 34 <td tal:content="course/core_or_elective"></td> 34 35 <td tal:content="course/credits"></td> 35 36 <td tal:content="course/passmark"></td>
Note: See TracChangeset for help on using the changeset viewer.