// Faculty names are not added to the external courses by default
 // this method should fix ssp-3041 - Scody
 private void updateFactultyNames(ExternalStudentRecordsTO recordTO) {
   List<ExternalStudentTranscriptCourseTO> courses = recordTO.getTerms();
   if (courses != null) {
     for (ExternalStudentTranscriptCourseTO course : courses) {
       try {
         Person person =
             !StringUtils.isNotBlank(course.getFacultySchoolId())
                 ? null
                 : personService.getInternalOrExternalPersonBySchoolId(
                     course.getFacultySchoolId(),
                     false); // TODO: getInternalOrExternalPersonBySchoolId is slow refactor?
         if (person != null) {
           course.setFacultyName(person.getFullName());
         }
       } catch (ObjectNotFoundException e) {
         course.setFacultyName("None Listed");
         LOGGER.debug(
             "FACULTY SCHOOL ID WAS NOT RESOLVED WHILE LOADING TRANSCRIPT RECORD.  Faculty School_id: "
                 + course.getFacultySchoolId()
                 + " Student ID: "
                 + course.getSchoolId()
                 + " Course: "
                 + course.getFormattedCourse());
       }
     }
   }
 }
  @RequestMapping(value = "/transcript/currentcourses", method = RequestMethod.GET)
  @PreAuthorize(Permission.SECURITY_PERSON_READ)
  public @ResponseBody List<ExternalStudentTranscriptCourseTO> loadCurrentCourses(
      final @PathVariable UUID id) throws ObjectNotFoundException {
    String schoolId = getStudentId(id);

    Term currentTerm;
    try {
      currentTerm = termService.getCurrentTerm();
    } catch (ObjectNotFoundException e) {
      currentTerm = new Term();
      LOGGER.error(
          "CURRENT TERM NOT SET, org.jasig.ssp.web.api.external.ExternalStudentRecordsController.loadCurrentCourses(UUID) is being called but will not function properly");
    }
    List<ExternalStudentTranscriptCourseTO> courses =
        externalStudentTranscriptCourseFactory.asTOList(
            externalStudentTranscriptCourseService.getTranscriptsBySchoolIdAndTermCode(
                schoolId, currentTerm.getCode()));
    Collection<EnrollmentStatus> mappings = statusCodeMappings();

    String defaultStatusCode = getDefaultStatusCode(mappings);

    for (ExternalStudentTranscriptCourseTO course : courses) {
      try {
        Person person =
            !StringUtils.isNotBlank(course.getFacultySchoolId())
                ? null
                : personService.getInternalOrExternalPersonBySchoolId(
                    course.getFacultySchoolId(),
                    false); // TODO: getInternalOrExternalPersonBySchoolId is slow refactor?
        if (person != null) {
          course.setFacultyName(person.getFullName());
        }
      } catch (ObjectNotFoundException e) {
        course.setFacultyName("None Listed");
        LOGGER.debug(
            "FACULTY SCHOOL ID WAS NOT RESOLVED WHILE LOADING TRANSCRIPT RECORD.  Factulty School_id: "
                + course.getFacultySchoolId()
                + " Student ID: "
                + course.getSchoolId()
                + " Course: "
                + course.getFormattedCourse());
      }

      if (StringUtils.isBlank(course.getStatusCode())) {
        course.setStatusCode(defaultStatusCode);
      } else if (mappings != null && !mappings.isEmpty()) {
        for (EnrollmentStatus enrollmentStatus : mappings) {
          if (enrollmentStatus.getCode().equals(course.getStatusCode())) {
            course.setStatusCode(enrollmentStatus.getName());
          }
        }
      }
    }
    return courses;
  }
Beispiel #3
0
  /** @param args the command line arguments */
  public static void main(String[] args) {
    System.out.println("Hola Mundo");
    Person p1;
    Calendar f1;
    f1 = GregorianCalendar.getInstance();
    f1.set(1995, 5, 10);

    p1 = new Person("Roberto", "Diaz", f1);
    System.out.println(p1.getBirthDay());
    System.out.println(p1.getFullName());
    System.out.println(p1.getAge());
  }
  // uses the list in the contacts adapter to add the contact to the view
  // will use a list widget in the future
  public void AddContactListToView(ContactListAdapter cList) {

    for (Person person : cList.ContactList) {

      LinearLayout list = (LinearLayout) findViewById(R.id.List);
      Button contactCard = new Button(this);
      contactCard.setText(person.getFullName());
      contactCard.setBackgroundColor(Color.parseColor("#0096fb"));
      LinearLayout.LayoutParams layout =
          new LinearLayout.LayoutParams(
              LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
      layout.weight = 0.07f;
      contactCard.setLayoutParams(layout);

      list.addView(contactCard);
    }
  }
  public static void main(String[] args) {

    // read the course catalog from the XML file
    CatalogJDOM catalogJDOM = new CatalogJDOM();
    Catalog catalog = null;

    try {
      catalog =
          catalogJDOM.readXMLFile(
              "C:\\Users\\Our\\JavaCourse\\StudentRegistration\\StudentRegistration\\data\\catalog.xml");
    } catch (Exception e) {

      e.printStackTrace();
    }

    if (catalog == null) {
      System.out.println("Could not read course list, exiting program");
      return;
    }

    int numCourses = catalog.size();
    int index;

    for (index = 0; index < numCourses; ++index) {
      Course course = catalog.getCourse(index);
      System.out.println("course = " + course.getName());
    }

    // read the people (students) from the XML file
    CrowdJDOM crowdJDOM = new CrowdJDOM();
    Crowd crowd = null;

    try {
      crowd =
          crowdJDOM.readXMLFile(
              "C:\\Users\\Our\\JavaCourse\\StudentRegistration\\StudentRegistration\\data\\crowd.xml");
    } catch (Exception e) {

      e.printStackTrace();
    }

    if (crowd == null) {
      System.out.println("Could not read list of people, exiting program");
      return;
    }

    // read the logins from the XML file
    LoginJDOM loginJDOM = new LoginJDOM();
    LoginList loginList = null;

    try {
      loginList =
          loginJDOM.readXMLFile(
              "C:\\Users\\Our\\JavaCourse\\StudentRegistration\\StudentRegistration\\data\\logins.xml");
    } catch (Exception e) { // TODO Auto-generated catch block
      e.printStackTrace();
    }

    if (loginList == null) {
      System.out.println("Could not read list of log in IDs and passwords, exiting program");
      return;
    }

    // TODO:  read in the Enrollment collection

    // first log in the student
    String loginID = UserLoginUI.getValidLoginID(loginList);

    // get the person associated with this list
    // for now loginID == Social Security Number
    Person person = crowd.findPersonWithSSN(loginID);

    if (person == null) {
      System.out.println("Could not locate a person with SSN = '" + loginID + "'");
      return;
    }

    System.out.println("Student " + person.getFullName() + " logged in");

    // read the main menu options from the XML file
    MenuOptionJDOM mainMenuJDOM = new MenuOptionJDOM();
    MenuOptionsList mainMenuList = new MenuOptionsList();

    try {
      mainMenuList =
          mainMenuJDOM.readXMLFile(
              "C:\\Users\\Our\\JavaCourse\\StudentRegistration\\StudentRegistration\\data\\mainmenu.xml");
    } catch (Exception e) {

      e.printStackTrace();
    }

    if (mainMenuList == null) {
      System.out.println("Could not read mainmenu entries, exiting program");
      return;
    }

    // main menu
    MainMenuUI.mainMenu(person, mainMenuList);

    // logout

  }
 public PersonFullNameCity(Person person) {
   this.fullName = person.getFullName();
   this.city = person.getCity();
 }