Skip to main content
pdf?stylesheet=default
Blackboard Help

Sample Code to Start Course/Organization Copy Testing

Use this code sample as the basis for start course/organization copy testing for all areas for event driven APIs.

Event driven API – Start course/organization copy testing

/*********** Begin testing **********/

blackboard.admin.data.course.CourseSite tgtCourse = new blackboard.admin.data.course.CourseSite();

blackboard.admin.data.course.Organization tgtOrg = new blackboard.admin.data.course.Organization();

blackboard.admin.persist.course.CloneConfig cfg = new blackboard.admin.persist.course.CloneConfig();



cfg.includeArea( blackboard.admin.persist.course.CloneConfig.Area.ALL );



tgtCourse.setBatchUid(“tgt.course”);

tgtOrg.setBatchUid(“tgt.organization”);



try

{

cPersister.clone(course.getBatchUid(),tgtCourse.getBatchUid(), cfg);

orgPersister.clone(org.getBatchUid(),tgtOrg.getBatchUid(), cfg);

}

catch(PersistenceException nfe)

{

System.out.println("insert enrollment without supporting object(s) success!");

}



ePersister.remove(enroll);

orgMemPersister.remove(orgmem);

saPersister.remove(staff);

pPersister.remove(person_1);

pPersister.remove(person_2);

cPersister.remove(course);

orgPersister.remove(org);



System.out.println("All removals successful (pre-existing)");



System.out.println("Success!");



End Persistence Test