Changeset 8973 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 11 Jul 2012, 09:27:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/batchprocessing.txt
r8947 r8973 99 99 'Student Payment Processor', 'Student Processor', 100 100 'StudentStudyCourse Processor (update only)', 101 'StudentStudyLevel Processor', 'Verdict Processor (update only)'] 101 'StudentStudyLevel Processor', 102 'User Processor', 103 'Verdict Processor (update only)'] 102 104 103 105 >>> importerselect.getControl('Faculty Processor').selected = True … … 420 422 ...File:...mycertcourses_zope.mgr.csv... 421 423 424 Batch processing users 425 ====================== 426 427 >>> browser.open('http://localhost/app/datacenter') 428 429 Prepare a CSV file for certificate courses: 430 431 >>> open('users.csv', 'wb').write( 432 ... """name,title,public_name,email,phone,local_roles 433 ... uli,Uli Fouquet,Chief Developer,uli@abc.de,+49-234-567 434 ... henrik, Henrik Bettermann,Admin,henrik@abc.de,+49-234-567,['waeup.PortalManager'] 435 ... """) 436 437 Upload the file: 438 439 >>> import cStringIO 440 >>> browser.getLink('Upload CSV file').click() 441 >>> filecontents = cStringIO.StringIO( 442 ... open('users.csv', 'rb').read()) 443 >>> filewidget = browser.getControl(name='uploadfile:file') 444 >>> filewidget.add_file(filecontents, 'text/plain', 'users.csv') 445 >>> browser.getControl(name='SUBMIT').click() 446 447 Step 1: start batch processing: 448 449 >>> browser.getLink('Batch processing').click() 450 >>> button = lookup_submit_value( 451 ... 'select', 'users_zope.mgr.csv', browser) 452 >>> button.click() 453 454 Step 2: select a processor and mode: 455 456 >>> importerselect = browser.getControl(name='importer') 457 >>> importerselect.getControl('User Processor').selected = True 458 >>> modeselect = browser.getControl(name='mode') 459 >>> modeselect.getControl(value='create').selected = True 460 >>> browser.getControl('Proceed to step 3').click() 461 462 Step 3: Fix headerlines 463 464 We get informed that there are no problems with the current header: 465 466 >>> print browser.contents 467 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 468 ... 469 Header fields OK 470 ... 471 472 The submit button is enabled: 473 474 >>> browser.getControl('Perform import').disabled 475 False 476 477 >>> browser.getControl('Perform import').click() 478 479 Step 4: See import results 480 481 The import was successful: 482 483 >>> print browser.contents 484 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 485 ...Successfully processed 2 rows... 486 ...Batch processing finished... 487 ...File:...users_zope.mgr.csv... 422 488 423 489 Pending files … … 551 617 >>> sorted(os.listdir(dc_path + '/finished')) 552 618 ['certificates_zope.mgr.create.finished.csv', ..., 553 'newfaculties_zope.mgr.create.finished.csv', 554 'newfaculties_zope.mgr.csv'] 619 'users_zope.mgr.create.finished.csv', 'users_zope.mgr.csv'] 555 620 556 621
Note: See TracChangeset for help on using the changeset viewer.