Package com.apps.datastore.dao

Examples of com.apps.datastore.dao.UniqueCourseObject


     courseInformation = new String[6];
     bookList = new ArrayList<BookInformation>();
  }
 
  public int init(String dept, String course, String section){
    UniqueCourseObject uco = new UniqueCourseObject(dept.toUpperCase(),course,section);
    return initContent(uco);
  }
View Full Code Here


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

      if((phoneNumber.isEmpty() || carrier.name().equals("NULL")) && notifycfg == 2)
        xmlout += "\t<message>Invalid carrier or phone number, check your account preferences</message>\n";
      else {
        boolean success;
        try {
          UniqueCourseObject uco = new UniqueCourseObject(dept,course,section);
          d.addCourse(uco);
          success = d.addNotifier(uco, new ContactInformationObject(email,phoneNumber,seatcfg,notifycfg,carrier));
          if(success)
            xmlout += "\t<message>Notification request was successfully added</message>\n";
          else
View Full Code Here

  public void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws IOException {
    dept = req.getParameter("dept").toUpperCase();
    course = req.getParameter("course");
    section = req.getParameter("section");
    UniqueCourseObject uco = new UniqueCourseObject(dept, course, section);
    int out = wrapper.initContent(uco);
    switch (out) {
    case 1:
      resp.sendRedirect("/courseInfo.jsp");
      break;
View Full Code Here

  }

  private UniqueCourseObject getUniqueCourse(Key courseKey)
      throws EntityNotFoundException {
    Entity e = datastore.get(courseKey);
    UniqueCourseObject uco = new UniqueCourseObject(
        (String) e.getProperty("departmentName"),
        (String) e.getProperty("courseNumber"),
        (String) e.getProperty("sectionNumber"));
    return uco;
  }
View Full Code Here

  }

  public void notifyAvailableCourses() throws EntityNotFoundException {
    List<UniqueCourseObject> cucol = getCacheUniqueCourseObjectList();
    for (Iterator i = cucol.iterator(); i.hasNext();) {
      UniqueCourseObject uco = (UniqueCourseObject) i.next();
      Entity e = getCacheEntity(uco);
      long gSeats = (Long) e.getProperty("generalSeats");
      long rSeats = (Long) e.getProperty("restrictedSeats");
      List<Entity> ceel = getContactEntryEntityList(e.getKey());
      for (Iterator j = ceel.iterator(); j.hasNext();) {
        Entity ce = (Entity)j.next();
        ContactInformationObject cio = getContactInformation((Key)ce.getProperty("contactKey"));
        if (cio.getSeatConfig() == 1 && gSeats > 0) {
          // notify gen seats avail
          if (cio.getNotifyConfig() == 1
              && cio.getEmailAddress() != null
              && cio.getEmailAddress() != "") {
            // email notify
            EmailNotifier en = new EmailNotifier();
            String msg = prepareMessage(EMAIL_NOTIFICATION,
                uco.getDepartmentName(), uco.getCourseNumber(),
                uco.getSectionNumber(), gSeats, "general");
            EmailNotifier.sendMessage(cio.getEmailAddress(), msg);
            destroyContactEntry(ce.getKey());
          }
          if (cio.getNotifyConfig() == 2
              && cio.getPhoneNumber() != null
              && cio.getPhoneNumber() != ""
              && cio.getCarrier() != CARRIER.NULL) {
            // sms notify
            SMSNotifier smsn = new SMSNotifier();
            String msg = prepareMessage(SMS_NOTIFICATION,
                uco.getDepartmentName(), uco.getCourseNumber(),
                uco.getSectionNumber(), gSeats, "general");
            SMSNotifier.sendMessage(cio.getPhoneNumber(),
                cio.getCarrier(), msg);
            destroyContactEntry(ce.getKey());
          }
        }
        if (cio.getSeatConfig() == 2 && rSeats > 0) {
          // notify res seats avail
          if (cio.getNotifyConfig() == 1
              && cio.getEmailAddress() != null
              && cio.getEmailAddress() != "") {
            // email notify
            EmailNotifier en = new EmailNotifier();
            String msg = prepareMessage(EMAIL_NOTIFICATION,
                uco.getDepartmentName(), uco.getCourseNumber(),
                uco.getSectionNumber(), rSeats, "restricted");
            EmailNotifier.sendMessage(cio.getEmailAddress(), msg);
            destroyContactEntry(ce.getKey());
          }
          if (cio.getNotifyConfig() == 2
              && cio.getPhoneNumber() != null
              && cio.getPhoneNumber() != ""
              && cio.getCarrier() != CARRIER.NULL) {
            // sms notify
            SMSNotifier smsn = new SMSNotifier();
            String msg = prepareMessage(SMS_NOTIFICATION,
                uco.getDepartmentName(), uco.getCourseNumber(),
                uco.getSectionNumber(), rSeats, "restricted");
            SMSNotifier.sendMessage(cio.getPhoneNumber(),
                cio.getCarrier(), msg);
            destroyContactEntry(ce.getKey());
          }
        }
View Full Code Here

TOP

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

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.