else if (req.getParameter("type").equals("coursebydept")){
String departmentId = req.getParameter("departmentId");
DepartmentInformationObject dio = d.queryDepartmentFromId(departmentId);
List<CourseInformationObject> ciol = spider.getCourses(dio);
for(Iterator j = ciol.iterator(); j.hasNext();){
CourseInformationObject cio = (CourseInformationObject) j.next();
d.addCourse(cio);
}
}
else if (req.getParameter("type").equals("sectionbydept")){
String departmentId = req.getParameter("departmentId");
DepartmentInformationObject dio = d.queryDepartmentFromId(departmentId);
List<CourseInformationObject> ciol = spider.getCourses(dio);
for(Iterator j = ciol.iterator(); j.hasNext();){
CourseInformationObject cio = (CourseInformationObject) j.next();
q.add(TaskOptions.Builder.withUrl("/spider").param("type","sectionbycourse").param("departmentId", cio.getDepartmentId()).param("courseId", cio.getCourseId()));
}
}
else if (req.getParameter("type").equals("sectionbycourse")){
String departmentId = req.getParameter("departmentId");
String courseId = req.getParameter("courseId");
CourseInformationObject cio = d.queryCourseFromId(departmentId, courseId);
List<SectionInformationObject> siol = spider.getSections(cio);
for(Iterator k = siol.iterator(); k.hasNext();){
SectionInformationObject sio = (SectionInformationObject) k.next();
d.addSection(sio);
}