Package com.apps.datastore.dao

Examples of com.apps.datastore.dao.WorklistItemObject


    for(Iterator<Entity> i = el.iterator(); i.hasNext(); ) {
      Entity e = i.next();
      String dept = (String) e.getProperty(WORKLIST_ITEM_DEPT_PROPERTY);
      String course = (String)e.getProperty(WORKLIST_ITEM_COURSE_PROPERTY);
      String section = (String)e.getProperty(WORKLIST_ITEM_SECTION_PROPERTY);
      WorklistItemObject wio = new WorklistItemObject(dept,course,section);
      wiol.add(wio);
    }
    return wiol;
  }
View Full Code Here


          // list.
          Iterator<WorklistItemObject> itr = list.iterator();
          System.out.println("Line is " + line);
          while (itr.hasNext()) {
            WorklistItemObject model = itr.next();

            String name = getRegexString(model.getDeptId(),
                model.getCourseId(), model.getSectionId());

            // System.out.println("Line is: " + line);

            System.out.println("Name is: " + name);
            if (line.matches(name)) {

              department = model.getDeptId();
              course = model.getCourseId();
              section = model.getSectionId();

              // Found the right course and it's section. Now get
              // it's
              // time and value
              line = br.readLine();
View Full Code Here

    if (user != null) {
      if (action.equals("add")) {
        String dept = req.getParameter("dept");
        String course = req.getParameter("course");
        String section = req.getParameter("section");
        WorklistItemObject wio = new WorklistItemObject(dept, course,
            section);
        SectionInformationObject sio = spiderDatastore
            .querySectionFromId(dept, course, section);
        List<SectionInformationObject> siol = d.getWorklistAsSIO(user);
        boolean conflict = isInConflict(siol, sio);
        boolean success = false;
        if (!conflict)
          success = d.addWorklistItem(user, wio);
        if (success)
          xmlout += "\t<message>Item was successfully added to worklist</message>\n";
        else if (conflict)
          xmlout += "\t<message>Unable to add to worklist, due to schedule conflict</message>\n";
        else
          xmlout += "\t<message>Item already exists in worklist</message>\n";
      } else if (action.equals("remove")) {
        String dept = req.getParameter("dept");
        String course = req.getParameter("course");
        String section = req.getParameter("section");
        String start = req.getParameter("start");
        // String end = req.getParameter("end");
        WorklistItemObject wio = new WorklistItemObject(dept, course,
            section);
        boolean success = d.deleteWorklistItem(user, wio);
        if (success) {
          xmlout += "\t<message>Item was successfully removed from worklist</message>\n";
        } else
          xmlout += "\t<message>Item failed to remove from worklist</message>\n";
      } else if (action.equals("get")) {
        List<SectionInformationObject> siol = d.getWorklistAsSIO(user);
        for (Iterator<SectionInformationObject> i = siol.iterator(); i
            .hasNext();) {
          SectionInformationObject sio = i.next();
          xmlout += "\t<item>\n";
          xmlout += "\t\t<dept>" + sio.getDepartmentId()
              + "</dept>\n";
          xmlout += "\t\t<course>" + sio.getCourseId()
              + "</course>\n";
          xmlout += "\t\t<section>" + sio.getSectionId()
              + "</section>\n";
          xmlout += "\t\t<start>" + sio.getStart() + "</start>\n";
          xmlout += "\t\t<end>" + sio.getEnd() + "</end>\n";
          xmlout += "\t\t<day>" + sio.getDay() + "</day>\n";
          xmlout += "\t\t<term>" + sio.getTerm() + "</term>\n";
          xmlout += "\t\t<building>" + sio.getBuilding()
              + "</building>\n";
          xmlout += "\t\t<room>" + sio.getRoom() + "</room>\n";
          xmlout += "\t</item>\n";
        }
      } else if (action.equals("view")) {
        String email = req.getParameter("email");
        if (d.checkSubscriptionExists(email, user)) {
          List<SectionInformationObject> siol = d
              .getWorklistAsSIO(email);
          for (Iterator<SectionInformationObject> i = siol.iterator(); i
              .hasNext();) {
            SectionInformationObject sio = i.next();
            xmlout += "\t<item>\n";
            xmlout += "\t\t<dept>" + sio.getDepartmentId()
                + "</dept>\n";
            xmlout += "\t\t<course>" + sio.getCourseId()
                + "</course>\n";
            xmlout += "\t\t<section>" + sio.getSectionId()
                + "</section>\n";
            xmlout += "\t\t<start>" + sio.getStart() + "</start>\n";
            xmlout += "\t\t<end>" + sio.getEnd() + "</end>\n";
            xmlout += "\t\t<day>" + sio.getDay() + "</day>\n";
            xmlout += "\t\t<term>" + sio.getTerm() + "</term>\n";
            xmlout += "\t\t<building>" + sio.getBuilding()
                + "</building>\n";
            xmlout += "\t\t<room>" + sio.getRoom() + "</room>\n";
            xmlout += "\t</item>\n";
          }
        }
      } else if (action.equals("check")) {
        String dept = req.getParameter("dept");
        String course = req.getParameter("course");
        String section = req.getParameter("section");
        WorklistItemObject wio = new WorklistItemObject(dept, course,
            section);
        boolean success = d.checkWorklistItemExists(user, wio);
        if (success)
          xmlout += "\t<exist>true</exist>\n";
        else
View Full Code Here

TOP

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

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.