Package com.apps.datastore.dao

Examples of com.apps.datastore.dao.CourseInformationObject


  public List<CourseInformationObject> getCourseList() {
    List<Entity> cel = getKindEntityList(COURSE_KIND);
    List<CourseInformationObject> ciol = new ArrayList<CourseInformationObject>();
    for (Iterator i = cel.iterator(); i.hasNext();) {
      Entity e = (Entity) i.next();
      CourseInformationObject cio = getCourseFromEntity(e);
      ciol.add(cio);
    }
    return ciol;
  }
View Full Code Here


    q.addSort(COURSE_ID_PROPERTY, SortDirection.ASCENDING);
    List<Entity> cel = datastore.prepare(q).asList(FetchOptions.Builder.withDefaults());
    List<CourseInformationObject> ciol = new ArrayList<CourseInformationObject>();
    for (Iterator i = cel.iterator(); i.hasNext();) {
      Entity e = (Entity) i.next();
      CourseInformationObject cio = getCourseFromEntity(e);
      ciol.add(cio);
    }
    return ciol;
  }
View Full Code Here

    String courseId = (String) e.getProperty(COURSE_ID_PROPERTY);
    String courseTitle = (String) e.getProperty(COURSE_TITLE_PROPERTY);
    String prereq = (String) e.getProperty(PREREQ_PROPERTY);
    String coreq = (String) e.getProperty(COREQ_PROPERTY);
    long credits = (Long) e.getProperty(CREDIT_PROPERTY);
    return new CourseInformationObject(departmentId, courseId, courseTitle,
        prereq, coreq, credits);
  }
View Full Code Here

              // Long.parseLong(WrapperUtils.stringInBwtn("Credits: ","\n",
              // line2));
            }
            line2 = br2.readLine();
          }
          CourseInformationObject cio = new CourseInformationObject(
              dio.getDepartmentId(), id, title, prereq, coreq,
              credits);
          if (id != "" && id != null)
            ciol.add(cio);
          id = "";
View Full Code Here

            }
          }
          if(diol.size() == 1)
            firstDept = diol.get(0);
        }
      CourseInformationObject firstCourse = null;
        if (searchTerms.length == 2 || firstDept != null) {
          if(firstDept != null)
            dept = firstDept.getDepartmentId();
          else
            dept = searchTerms[0];
          if(searchTerms.length == 2)
            prefix = searchTerms[1];
          else
            prefix = "";
          List<CourseInformationObject> ciol = d.queryCourseByPrefix(dept, prefix);
          if(!ciol.isEmpty()){
            for(Iterator<CourseInformationObject> i = ciol.iterator(); i.hasNext();) {
              CourseInformationObject cio = i.next();
              String deptId = "<b>"+cio.getDepartmentId()+"</b>";
              String courseId = cio.getCourseId();
              String courseTitle ="<i>"+ cio.getCourseTitle()+"</i>";
              courseId =  "<b>"+prefix+"</b>" + courseId.substring(prefix.length());
              String out =  deptId +" " + courseId + " " +courseTitle +"\n";
              if(!response.contains(out))
                response += out;
            }
View Full Code Here

  }
 
  private SectionModel getSectionModel(String d, String c, String s){
    UBCCourseSpiderDatastore sd = new UBCCourseSpiderDatastore();
    SectionInformationObject sio = sd.querySectionFromId(d, c, s);
    CourseInformationObject cio = sd.queryCourseFromId(d, c);
   
    UBCWayfindingService uws = UBCWayfindingServiceFactory.getUBCWayfindingService();
    BuildingModel blo = uws.search(sio.getBuilding());
   
    String lat = "";
    String lng = "";
    if (blo != null) {
      lat = blo.getLatitude();
      lng = blo.getLongitude();
    }
   
    String dept = sio.getDepartmentId();
    String course = sio.getCourseId();
    String section = sio.getSectionId();
    String day = sio.getDay();
    String term = sio.getTerm();
    String building = sio.getBuilding();
    String room = sio.getRoom();
    String activity = sio.getActivity();
    String title = cio.getCourseTitle();
    String instructor = sio.getInstructor();
    String drop = sio.getDropNoWDate();
    String withdraw = sio.getDropWDate();
    String start = sio.getStart();
    String cdf = "No";
View Full Code Here

      }
      else {
        xmlout += "<type>none</type>\n";
      }
    } else if (dept !=null && course != null && !dept.isEmpty()&& !course.isEmpty()) {
      CourseInformationObject cio = d.queryCourseFromId(dept.toUpperCase(), course.toUpperCase());
      if (cio != null) {
        xmlout += "<type>course</type>\n";
        List<SectionInformationObject> siol = d.getSectionList(cio);
        for(Iterator<SectionInformationObject> i = siol.iterator(); i.hasNext();)
          xmlout += formatXml(i.next());
View Full Code Here

    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);
      }
View Full Code Here

TOP

Related Classes of com.apps.datastore.dao.CourseInformationObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.