Examples of UBCSectionDetailService


Examples of com.apps.services.UBCSectionDetailService

import com.apps.services.UBCSectionDetailService;

public class UBCSectionDetailServiceFactory {
 
  public static UBCSectionDetailService getUBCSectionDetailService(){
    return new UBCSectionDetailService();
  }
View Full Code Here

Examples of com.apps.services.UBCSectionDetailService

    String course = sio.getCourseId();
    String section = sio.getSectionId();
    String day = sio.getDay();
    String term = sio.getTerm();
    BuildingModel blo = uws.search(sio.getBuilding());
    UBCSectionDetailService w = new UBCSectionDetailService();
    w.initContent(new UniqueCourseObject(dept,course,section));
    List<BookInformation> biol = w.getBookList();
   
    out += "<table>";
    out += "<tr>\n";
    out += "<td>"+dept+"&nbsp;"+course+"&nbsp;"+section+"</td>\n";
    out += "</tr>\n";
View Full Code Here

Examples of com.apps.services.UBCSectionDetailService

          String dept = (String) e.getProperty(NoSignupDatastore.DEPT_PROPERTY);
          String course = (String) e.getProperty(NoSignupDatastore.COURSE_PROPERTY);
          String section = (String) e.getProperty(NoSignupDatastore.SECTION_PROPERTY);
         
        if((Boolean)e.getProperty(NoSignupDatastore.ACTIVATED_PROPERTY)){
          UBCSectionDetailService details = new UBCSectionDetailService();
          details.init(dept, course, section);
          if(details.getGenSeatsRemain() > 0) {
            String email_str = EMAIL_NOTIFICATION.replaceAll("<DEPARTMENT>", dept).replaceAll("<COURSE>", course).replaceAll("<SECTION>", section).replaceAll("<NUMBER_OF_SEATS>", ""+details.getGenSeatsRemain()).replaceAll("<TIMESTAMP>", Calendar.getInstance(TimeZone.getTimeZone("PST")).getTime().toString());
            String phone_str = SMS_NOTIFICATION.replaceAll("<DEPARTMENT>", dept).replaceAll("<COURSE>", course).replaceAll("<SECTION>", section).replaceAll("<NUMBER_OF_SEATS>", ""+details.getGenSeatsRemain()).replaceAll("<TIMESTAMP>", Calendar.getInstance(TimeZone.getTimeZone("PST")).getTime().toString());
            EmailNotifier.sendMessage(email, email_str);
            SMSUtils.sendSMS(phone, phone_str);
            NoSignupDatastore.deleteNotifier(email, phone, dept, course, section);
          }
        }
View Full Code Here

Examples of com.apps.services.UBCSectionDetailService

    String phone = req.getParameter("phone");
    String dept = req.getParameter("dept").toUpperCase();
    String course = req.getParameter("course").toUpperCase();
    String section = req.getParameter("section").toUpperCase();
   
    UBCSectionDetailService wrapper = new UBCSectionDetailService();
    int code = wrapper.init(dept, course, section);
    if(code != 1)
      resp.sendRedirect("/error404.jsp");
   
    String key = NoSignupDatastore.addNotifier(email, phone, dept, course, section);
    String courseFormatted = dept + " " + course + " " + section;
View Full Code Here

Examples of com.apps.services.UBCSectionDetailService

  }

  private Entity createCacheEntity(Key courseKey)
      throws EntityNotFoundException {
    Key k = KeyFactory.createKey("Cache List", "CACHE_LIST");
    UBCSectionDetailService w = new UBCSectionDetailService();
    w.initContent(getUniqueCourse(courseKey));
    Entity e = new Entity("Cache", k);
    e.setProperty("courseKey", courseKey);
    e.setProperty("generalSeats", w.getGenSeatsRemain());
    e.setProperty("restrictedSeats", w.getRestrictSeatsRemain());
    datastore.put(e);
    return e;
  }
View Full Code Here

Examples of com.apps.services.UBCSectionDetailService

  public void updateCache() throws EntityNotFoundException {
    List<Entity> cel = getCacheEntityList();
    for (Iterator i = cel.iterator(); i.hasNext();) {
      Entity e = (Entity) i.next();
      UBCSectionDetailService w = new UBCSectionDetailService();
      w.initContent(getUniqueCourse((Key) e.getProperty("courseKey")));
      e.setProperty("generalSeats", w.getGenSeatsRemain());
      e.setProperty("restrictedSeats", w.getRestrictSeatsRemain());
      datastore.put(e);
      if (getContactEntryEntityList(e.getKey()).isEmpty()) {
        datastore.delete(e.getKey());
        datastore.delete((Key) e.getProperty("courseKey"));
      }
View Full Code Here

Examples of com.apps.services.UBCSectionDetailService

  @Test
  public void test() throws MalformedURLException, IOException {
   
 
   
    UBCSectionDetailService uss = UBCSectionDetailServiceFactory.getUBCSectionDetailService();
   
   
//   
//    String url = "https://courses.students.ubc.ca/cs/main?pname=subjarea&tname=subjareas&req=5&dept="
//        + "CPSC" + "&course=" + "304" + "&section=" + "101";
//
//    BufferedReader br =  new BufferedReader(new InputStreamReader(new URL(url).openStream()));
//   
//   
//    String line = br.readLine();
//    int i = 0;
//    for(; line != null; i++){
//      line = br.readLine();
//    }
//    System.out.println(i);
   
    assertTrue(uss.init("CSPC", "304", "101") >= 0);
   
 
 
 
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.