Changeset 152 for waeup_product/trunk/Extensions
- Timestamp:
- 4 Nov 2005, 17:07:18 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup_product/trunk/Extensions/install.py
r143 r152 110 110 waeup_ptypes = "'University','StudentsFolder','Student','Jamb','Faculty','Department','Course'" 111 111 waeup_ptypes += ",'AccoFolder','Accommodation','StudentPersonal','AcademicsFolder'" 112 waeup_ptypes += ",'StudyLevel','Semester','CourseTicket'" 112 113 if CPSSubscriptions: ###( 113 114 … … 349 350 350 351 351 def installCustomWorkflows(self): 352 def verifyPortlets(self, portlets=(), object=None): ###( 353 """Verify the existence of given portet in the object's portlet 354 container. If not found, a portlet is instantiated. 355 Existing portlets are not affected. 356 357 'portlets' is a tuple with the dictionaries given by the export tab 358 as entries. 359 The default object is the portal itself. 360 361 return the list a new portlet ids. 362 """ 363 364 if object is None: 365 object = self.portal 366 367 self.log('Verifying portlets on %s' % object.absolute_url(relative=1)) 368 369 portlet_container = self.getPortletContainer(object, create=1) 370 371 ttool = self.getTool('portal_types') 372 373 returned = [] 374 for new_portlet in portlets: 375 existing_portlets = portlet_container.listPortlets() 376 updated = 0 377 378 # Check if the portlet needs an update 379 identifier = new_portlet.get('identifier') 380 if identifier: 381 for portlet in existing_portlets: 382 if identifier == portlet.identifier: 383 self.log(" Update of portlet: %s" % portlet) 384 portlet.edit(**new_portlet) 385 portlet_id = portlet.getId() 386 updated = 1 387 continue 388 slot = new_portlet.get('slot') 389 if slot: 390 for portlet in existing_portlets: 391 if slot == portlet.slot: 392 self.log(" Update of portlet: %s" % portlet) 393 portlet.edit(**new_portlet) 394 portlet_id = portlet.getId() 395 updated = 1 396 continue 397 398 if not updated: 399 self.log(" Creation of portlet: %s" % new_portlet) 400 portlet_id = self.portal.portal_cpsportlets.createPortlet( 401 ptype_id=new_portlet['type'], 402 context=object, 403 **new_portlet) 404 if portlet_id not in returned: 405 returned.append(portlet_id) 406 return returned 407 408 ###) 409 410 def installCustomWorkflows(self): ###( 352 411 """Installs custom workflows 353 412 """ … … 357 416 waeupWorkflowsInstall(self.context) 358 417 359 360 def verifyWorkflowAssociation(self): 418 ###) 419 420 def verifyWorkflowAssociation(self): ###( 361 421 """Verify workflow association 362 422 """ … … 368 428 se_chains = { 'University': 'waeup_section_wf', 369 429 'AcademicsFolder': 'waeup_section_wf', 370 'StudentsFolder': 'waeup_s ection_wf',371 'Student': 'waeup_s ection_wf',372 'StudentPersonal': 'waeup_s ection_wf',430 'StudentsFolder': 'waeup_student_wf', 431 'Student': 'waeup_student_wf', 432 'StudentPersonal': 'waeup_student_wf', 373 433 'Jamb': 'waeup_section_wf', 374 434 'ScratchCard': 'waeup_section_wf', … … 376 436 'Department': 'waeup_section_wf', 377 437 'Course': 'waeup_section_wf', 438 'StudyLevel': 'waeup_student_wf', 439 'Semester': 'waeup_student_wf', 440 'CourseTicket': 'waeup_student_wf', 378 441 'AccoFolder': 'waeup_section_wf', 379 442 'Accommodation': 'waeup_section_wf', … … 387 450 destructive=1) 388 451 389 390 def install(self): 452 ###) 453 454 455 def install(self): ###( 391 456 installer = WAeUPInstaller(self) 392 457 installer.install(self) … … 447 512 ## 'Title': 'main tabs', 448 513 ## }, 449 { 'identifier': 'waeup_breadcrumbs',514 {#'identifier': 'waeup_breadcrumbs', 450 515 'type': 'Breadcrumbs Portlet', 451 516 'slot': 'waeup_breadcrumbs', 452 'first_item': 2,517 'first_item': 0, 453 518 'display_site_root': 0, 454 519 'Title': 'waeup_breadcrumbs', … … 457 522 'order': 0, 458 523 }, 459 { 'identifier': 'waeup_main_tab_actions',524 {#'identifier': 'waeup_main_tab_actions', 460 525 'type': 'Actions Portlet', 461 526 'slot': 'main_tabs', … … 464 529 'Title': 'waep_main_tab_actions', 465 530 }, 466 { 'identifier': 'waeup_object_actions',531 {#'identifier': 'waeup_object_actions', 467 532 'type': 'Actions Portlet', 468 533 'slot': 'waeup_object_actions', … … 471 536 'Title': 'waep_manager_actions', 472 537 }, 473 { 'identifier': 'waeup_left_top',538 {#'identifier': 'waeup_left_top', 474 539 'type': 'Custom Portlet', 475 540 'slot': 'left_top', … … 483 548 484 549 ###) 485 486 550 return installer.logResult() 487 488 def migrate(self): 551 ###) 552 553 def migrate(self): ###( 489 554 "update data" 490 555 log = [] … … 519 584 return '\n'.join(log) 520 585 586 ###) 587
Note: See TracChangeset for help on using the changeset viewer.