public static List createTeacherList() { List lstTeacher = new ArrayList(); try { midonnet = DataFactory.createTeacher("Midonnet", "jeCpasSonPrenom", "*****@*****.**"); lstTeacher.add(midonnet); revuz = DataFactory.createTeacher("Revuz", "Dominiqueuniquenique", "*****@*****.**"); lstTeacher.add(revuz); roussel = DataFactory.createTeacher("Roussel", "Gilles", "*****@*****.**"); lstTeacher.add(roussel); } catch (FlexiException e) { // TODO Auto-generated catch block e.printStackTrace(); } return lstTeacher; }
public static void generate() throws RemoteException { try { midonnet = DataFactory.createTeacher("Midonnet", "jeCpasSonPrenom", "*****@*****.**"); revuz = DataFactory.createTeacher("Revuz", "Dominiqueuniquenique", "*****@*****.**"); roussel = DataFactory.createTeacher("Roussel", "Gilles", "*****@*****.**"); teacherLst = new ArrayList(3); teacherLst.add(midonnet); teacherLst.add(revuz); teacherLst.add(roussel); copernic = DataFactory.createBuilding("Copernic"); lavoisier = DataFactory.createBuilding("Lavoisier"); premier = DataFactory.createFloor("1er etage", copernic); deuxiemme = DataFactory.createFloor("2eme etage", copernic); troisieme = DataFactory.createFloor("3eme etage", copernic); salleAuditorium = DataFactory.createRoom("Auditorium", RoomImpl.TYPE_COURS, 200, premier); salle2027 = DataFactory.createRoom("2027", RoomImpl.TYPE_MACHINE, 24, deuxiemme); salle2031 = DataFactory.createRoom("2031", RoomImpl.TYPE_MACHINE, 24, deuxiemme); salle2017 = DataFactory.createRoom("2017", RoomImpl.TYPE_COURS, 60, deuxiemme); salle3012 = DataFactory.createRoom("3012", RoomImpl.TYPE_COURS, 70, troisieme); videoproj1 = DataFactory.createDevice("VideoProj1", IDevice.VIDEOPROJECTOR); videoproj2 = DataFactory.createDevice("VideoProj2", IDevice.VIDEOPROJECTOR); tv1 = DataFactory.createDevice("TV1", IDevice.TV); tv2 = DataFactory.createDevice("TV2", IDevice.TV); magneto1 = DataFactory.createDevice("magneto1", IDevice.VIDEO_TAPE_RECORDER); magneto2 = DataFactory.createDevice("magneto2", IDevice.VIDEO_TAPE_RECORDER); ir = DataFactory.createTrack("Informatique & Réseaux"); mfpi = DataFactory.createTrack("MFPI"); gm = DataFactory.createTrack("GM"); ir1 = DataFactory.createClass("1ere année", ir); ir2 = DataFactory.createClass("2eme année", ir); ir3 = DataFactory.createClass("3eme année", ir); mfpi1 = DataFactory.createClass("1ere année", mfpi); mfpi2 = DataFactory.createClass("2eme année", mfpi); mfpi3 = DataFactory.createClass("3eme année", mfpi); gm1 = DataFactory.createClass("1ere année", gm); gm2 = DataFactory.createClass("2eme année", gm); gm3 = DataFactory.createClass("3eme année", gm); ir1_grp1 = DataFactory.createGroup("groupe 1", 24, ir1); ir1_grp2 = DataFactory.createGroup("groupe 2", 24, ir1); ir2_grp1 = DataFactory.createGroup("groupe 1", 24, ir2); ir2_grp2 = DataFactory.createGroup("groupe 2", 24, ir2); ir3_grp1 = DataFactory.createGroup("groupe 1", 24, ir3); ir3_grp2 = DataFactory.createGroup("groupe 2", 24, ir3); mfpi1_grp = DataFactory.createGroup("groupe 1", 50, mfpi1); mfpi2_grp = DataFactory.createGroup("groupe 1", 50, mfpi2); mfpi3_grp = DataFactory.createGroup("groupe 1", 50, mfpi3); gm1_grp1 = DataFactory.createGroup("groupe 1", 24, gm1); gm1_grp2 = DataFactory.createGroup("groupe 2", 24, gm1); gm1_grp3 = DataFactory.createGroup("groupe 3", 24, gm1); gm2_grp1 = DataFactory.createGroup("groupe 1", 24, gm2); gm2_grp2 = DataFactory.createGroup("groupe 2", 24, gm2); gm3_grp1 = DataFactory.createGroup("groupe 2", 24, gm3); ts_ir1 = DataFactory.createTeachingStructure("ts ir 1", ir1); ts_ir2 = DataFactory.createTeachingStructure("ts ir 2", ir2); ts_ir3 = DataFactory.createTeachingStructure("ts ir 3", ir3); ts_gm1 = DataFactory.createTeachingStructure("ts gm 1", gm1); ts_gm2 = DataFactory.createTeachingStructure("ts gm 2", gm2); ts_gm3 = DataFactory.createTeachingStructure("ts gm 3", gm3); ir1_bloc1 = DataFactory.createSubjectsGroup("General", ts_ir1); ir1_bloc2 = DataFactory.createSubjectsGroup("Math", ts_ir1); ir2_bloc1 = DataFactory.createSubjectsGroup("General", ts_ir2); ir2_bloc2 = DataFactory.createSubjectsGroup("developpement!!!", ts_ir2); ir3_bloc1 = DataFactory.createSubjectsGroup("General", ts_ir3); ir3_bloc2 = DataFactory.createSubjectsGroup("Rezo", ts_ir3); ir3_bloc1_sub1 = DataFactory.createSubject("J2EE", ir3_bloc1); ir3_bloc1_sub2 = DataFactory.createSubject("GL", ir3_bloc1); ir3_bloc1_sub3 = DataFactory.createSubject("Exposé système", ir3_bloc1); ir3_bloc2_sub1 = DataFactory.createSubject("Corba", ir3_bloc2); ir3_bloc2_sub2 = DataFactory.createSubject("Modelisation des ReZo", ir3_bloc2); ir3_bloc2_sub3 = DataFactory.createSubject("Exposé ReZo", ir3_bloc2); j2ee_cours = DataFactory.createCourse( "Cours J2EE", ir3_bloc1_sub1, ICourse.CM, 120, 20, Color.MAGENTA, createList(roussel)); j2ee_td = DataFactory.createCourse( "TD J2EE", ir3_bloc1_sub1, ICourse.TD, 240, 20, Color.MAGENTA, createList(roussel)); gl_cours = DataFactory.createCourse( "Cours GL", ir3_bloc1_sub2, ICourse.CM, 120, 20, Color.CYAN, createList(revuz)); gl_td = DataFactory.createCourse( "TD GL", ir3_bloc1_sub2, ICourse.TD, 120, 20, Color.BLUE, createList(revuz)); corba_cours = DataFactory.createCourse( "Cours Corba", ir3_bloc2_sub1, ICourse.CM, 120, 20, Color.CYAN, createList(midonnet)); corba_td = DataFactory.createCourse( "TD Corba", ir3_bloc2_sub1, ICourse.TD, 120, 20, Color.BLUE, createList(midonnet)); IGroupBusy busyGrp = DataFactory.createGroupBusy( new Gap(2005, 1, 24, 8, 30, 2005, 1, 24, 10, 30), ir3_grp2, IGroupBusy.REASON_HOLLYDAYS, "Vacances de Noel"); IGroupBusy busyGrp1 = DataFactory.createGroupBusy( new Gap(2005, 1, 25, 8, 30, 2005, 1, 25, 10, 30), ir3_grp2, IGroupBusy.REASON_WORK); IGroupBusy busyGrp2 = DataFactory.createGroupBusy( new Gap(2005, 1, 26, 8, 30, 2005, 1, 26, 10, 30), ir3_grp2, IGroupBusy.REASON_HOLLYDAYS); List<IGroup> groups_td = new ArrayList(1); groups_td.add(ir3_grp2); List<IGroup> groups_cm = new ArrayList(1); groups_cm.add(ir3_grp1); groups_cm.add(ir3_grp2); lesson1 = DataFactory.createLesson( new Gap(2005, 1, 3, 8, 30, 2005, 1, 3, 10, 30), j2ee_cours, groups_cm, roussel); lesson2 = DataFactory.createLesson( new Gap(2005, 1, 3, 13, 45, 2005, 1, 3, 15, 45), corba_cours, groups_cm, midonnet); lesson3 = DataFactory.createLesson( new Gap(2005, 1, 4, 16, 00, 2005, 1, 4, 18, 00), gl_cours, groups_cm, revuz); lesson4 = DataFactory.createLesson( new Gap(2005, 1, 5, 8, 30, 2005, 1, 5, 10, 30), gl_td, groups_td, revuz); lesson5 = DataFactory.createLesson( new Gap(2005, 1, 6, 8, 30, 2005, 1, 6, 10, 30), corba_td, groups_td, roussel); lesson6 = DataFactory.createLesson( new Gap(2005, 1, 11, 8, 30, 2005, 1, 11, 10, 30), corba_td, groups_td, roussel); lesson7 = DataFactory.createLesson( new Gap(2005, 1, 19, 8, 30, 2005, 1, 19, 10, 30), corba_td, groups_td, roussel); lesson8 = DataFactory.createLesson( new Gap(2005, 1, 21, 8, 30, 2005, 1, 21, 10, 30), corba_td, groups_td, roussel); lesson9 = DataFactory.createLesson( new Gap(2005, 1, 28, 8, 30, 2005, 1, 28, 10, 30), corba_td, groups_td, roussel); // LocalDataManager.getManager().deleteLesson(lesson9); // for(IResource r : lesson1.getAllResources()) // { // System.out.println(r.getName()+" " +r); // for(IBusy b : r.getSetBusy()) // System.out.println("\t" + b); // } // System.out.println("Groupe 2"); // for(IBusy b : ir3_grp2.getSetBusy()) // System.out.println("\t" + b); // System.exit(0); lesson1.addResource(ir1_grp1); // LocalDataManager.getManager().saveOrUpdateLesson(lesson1, // lesson1.getAllResources()); // LocalDataManager.getManager().deleteLesson(lesson1); lesson2.addResource(salle2017); lesson3.addResource(salle2017); lesson4.addResource(salle2027); lesson5.addResource(salle2027); /*ir3_grp2.addBusy(lesson1); ir3_grp2.addBusy(lesson2); ir3_grp2.addBusy(lesson3); ir3_grp2.addBusy(lesson4); ir3_grp2.addBusy(lesson5); roussel.addBusy(lesson1); midonnet.addBusy(lesson2); revuz.addBusy(lesson3); revuz.addBusy(lesson4); roussel.addBusy(lesson5); salle2017.addBusy(lesson1); salle2017.addBusy(lesson2); salle2017.addBusy(lesson3); salle2027.addBusy(lesson4); salle2027.addBusy(lesson5);*/ } catch (FlexiException e) { // TODO Auto-generated catch block e.printStackTrace(); } // to be continued... }