Package net.sf.esims.model.entity

Examples of net.sf.esims.model.entity.AcademicYear


        .getById(new Long(this.getContext().getRequest().getParameter(
            "entranceExamId"))));
    // refresh the search results
    Long academicyearid = (Long) this.getContext().getAttributeFromSession(
        "_sess_search_param");
    AcademicYear academicYear = this.academicYearService
        .getById(academicyearid);
    this.getContext().setAttributeToRequest(
        "searchResultsForEntranceExams",
        this.entranceExamService.getByAcademicYear(academicYear));
View Full Code Here


   *
   * @param startDate
   */
  @HandlesEvent("searchByAcademicYear")
  public Resolution searchByAcademicYear() {
    AcademicYear academicYear = this.standardService
        .getAcademicYearsById(this.academicYearId);
    this.getContext().setAttributeToRequest("searchResultsForExams",
        this.examService.searchByAcademicYear(academicYear));
    // setting the search criteria to session so that it can be later
    // picked up in the delete method to refresh the screen.
View Full Code Here

   * @param startDate
   */

  @HandlesEvent("beginEditing")
  public Resolution beginEditing() {
      AcademicYear academicYear = this.examService
          .getActiveAcademicYear();
      // Redirect to warning page if basic data is missing
      if (academicYear == null)
        return new ForwardResolution(
            "/WEB-INF/pages/_basic_data_missing.jsp");
View Full Code Here

    // Redirect to warning page if basic data is missing
    if (listOfSchools != null && listOfSchools.size() == 0)
      return new ForwardResolution(
          "/WEB-INF/pages/_basic_data_missing.jsp");
   
    AcademicYear activeAY = this.academicYearService.getActiveAcademicYear();
    if(activeAY != null){
      return new ForwardResolution(
      "/WEB-INF/pages/_active_academic_year_found.jsp");
    }
     
View Full Code Here

  @HandlesEvent("createAcademicYear")
  public Resolution createAcademicYear() {
    String message = EsimsConstants._BLANK_STRING;
    long days = 0;
    AcademicYear academicYear = null;
    // clear from session
    this.getContext().removeAttributeFromSession("academicYear");
    School school = this.academicYearService
        .getSchoolByItsId(this.schoolId);
   
    try {
      // this method was used since India doesnt use DST :-)
      days = (endDate.getTime() - startDate.getTime()) / 1000 / 60 / 60
          / 24;
      if (days > 365)
        throw new BusinessRuleException(
            "An academic year cannot be more than 365 days");
    } catch (BusinessRuleException businessRuleException) {
      ValidationErrors errors = new ValidationErrors();
      errors.add("endDate", new LocalizableError(
          "/admin/academicyear/tooLong"));
      getContext().setValidationErrors(errors);
      return getContext().getSourcePageResolution();
    }
    try {
      if (days < 279)
        throw new BusinessRuleException(
            "An academic year cannot be less than 279 days");

    } catch (BusinessRuleException businessRuleException) {
      ValidationErrors errors = new ValidationErrors();
      errors.add("endDate", new LocalizableError(
          "/admin/academicyear/tooShort"));
      getContext().setValidationErrors(errors);
      return getContext().getSourcePageResolution();
    }

    academicYear = new AcademicYear(this.description, school,
        this.startDate, this.endDate, this.status);
    boolean exists = this.academicYearService
        .checkForDuplicate(academicYear);
    if (exists)
      message = EsimsUtils.createWarnMessage(this.getContext()
View Full Code Here

    return new ForwardResolution("/WEB-INF/pages/academicYearList.jsp");
  }

  @HandlesEvent("editAcademicYear")
  public Resolution editAcademicYear() {
    AcademicYear academicYear;
    String buttonName = "updateAcademicYear";
    String buttonValue = "Update academic year";
    this.getContext().setAttributeToSession("buttonName", buttonName);
    this.getContext().setAttributeToSession("buttonValue", buttonValue);
    List<School> listOfSchools = this.academicYearService
View Full Code Here

  @HandlesEvent("updateAcademicYear")
  public Resolution updateAcademicYear() {
    long days = 0;
    String message = EsimsConstants._BLANK_STRING;
    AcademicYear academicYear = (AcademicYear) this.getContext()
        .getAttributeFromSession("academicYear");
    School school = this.academicYearService
        .getSchoolByItsId(this.schoolId);
    academicYear.setDescription(this.description);
    academicYear.setSchool(school);
    academicYear.setStartDate(this.startDate);
    academicYear.setEndDate(this.endDate);
    academicYear.setStatus(this.status);
    //checking for sanity of dates chosen.

   
    try {
      // this method was used since India doesnt use DST :-)
      days = (endDate.getTime() - startDate.getTime()) / 1000 / 60 / 60
          / 24;
      if (days > 365)
        throw new BusinessRuleException(
            "An academic year cannot be more than 365 days");
    } catch (BusinessRuleException businessRuleException) {
      ValidationErrors errors = new ValidationErrors();
      errors.add("endDate", new LocalizableError(
          "/admin/academicyear/tooLong"));
      getContext().setValidationErrors(errors);
      return getContext().getSourcePageResolution();
    }
    try {
      if (days < 279)
        throw new BusinessRuleException(
            "An academic year cannot be less than 279 days");

    } catch (BusinessRuleException businessRuleException) {
      ValidationErrors errors = new ValidationErrors();
      errors.add("endDate", new LocalizableError(
          "/admin/academicyear/tooShort"));
      getContext().setValidationErrors(errors);
      return getContext().getSourcePageResolution();
    }

    this.academicYearService.saveAcademicYear(academicYear);
    message = EsimsUtils.createInfoMessage(this.getContext()
        .getContextPath(), "Academic year <strong>"
        + academicYear.getDescription()
        + "</strong> was updated succesfully");
   
    this.getContext().removeAttributeFromSession("academicYear");
    this.getContext().removeAttributeFromSession("listOfAllAcademicYears");
    FlashScope.getCurrent(this.getContext().getRequest(), true).put("message", message);
View Full Code Here

  // helper method for creating essence

  private ReceivedApplicationFormEssence setPropertiesToEssence() {
    ReceivedApplicationFormEssence applicationFormEssence = new ReceivedApplicationFormEssence();

    AcademicYear academicYear = this.academicYearService
        .getById(this.academicYearId);
    applicationFormEssence.setAcademicYear(academicYear);

   
    applicationFormEssence.setBelowPovertyLine(this.belowPovertyLine);
View Full Code Here

   
    /*
     * First we get the active academic year , and from that we retrive the list of standards
     * and show it to the user
     */
    AcademicYear academicYear = academicYearService.getActiveAcademicYear();
    logger.info("AttendanceMgmtAction:showCreatePageWithListOfStandards | Retreived active academic year");
    if(academicYear == null){
      logger.error("AttendanceMgmtAction:showCreatePageWithListOfStandards | Failed to fetch active academic year");
      throw new RuntimeException("AttendanceMgmtAction:showCreatePageWithListOfStandards | Failed to fetch active academic year");
    }
    List<Standard> listOfStds = standardService.getStandardsForAcademicYear(academicYear.getAcademicYearId());
    logger.info("AttendanceMgmtAction:showCreatePageWithListOfStandards | Retreived stds for academic year");
    if(listOfStds==null || listOfStds.size()==0)
      logger.warn("AttendanceMgmtAction:showCreatePageWithListOfStandards | No standards found for active acadmic year");
    this.getContext().setAttributeToSession("listOfStds",
        listOfStds);
View Full Code Here

    Date d2 = EsimsUtils.createDate(13, Calendar.MARCH, 2007);
    SchoolEssence schoolEssence = UtilsForTestCases
        .createValidSchoolEssence();
    School school = schoolEssence.createSchool();
    this.schoolService.save(school);
    AcademicYear academicYear = new AcademicYear("2006-2007", school, d1,
        d2, "active");
    academicYearService.saveAcademicYear(academicYear);
    Standard standard = new Standard("5th standard", academicYear);
    this.standardService.save(standard);
   
View Full Code Here

TOP

Related Classes of net.sf.esims.model.entity.AcademicYear

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.