Package net.sf.esims.model.entity

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


 
  @DefaultHandler
  @HandlesEvent("createSchool")
  public Resolution createSchool(){
    String message=EsimsConstants._BLANK_STRING;
    School school = this.setPropertiesToSchool();   
    this.schoolService.save(school);
    message= EsimsUtils.createInfoMessage(this.getContext().getContextPath(), "<strong>The school named "+ this.schoolName +" was created sucessfully</strong>");
    FlashScope.getCurrent(this.getContext().getRequest(),true).put("message", message);
    return new RedirectResolution(DisplayMessageAction.class,  "forwardToMessagePage");
  }
View Full Code Here


 
 
 
  @HandlesEvent("showFirstPageToUpdate")
  public Resolution showFirstPageToUpdate(){
    School school=null;
    String buttonName="updateFirstPageAndShowSecond";
    String buttonValue="Continue";
    this.getContext().setAttributeToSession("buttonName", buttonName);
    this.getContext().setAttributeToSession("buttonValue", buttonValue);
    school = this.schoolService.getById((new Long(this.getContext().getRequest().getParameter("schoolId"))));
View Full Code Here

    return new ForwardResolution("/WEB-INF/pages/schoolDetails.jsp");
  }
 
  @HandlesEvent("updateFirstPageAndShowSecond")
  public Resolution updateFirstPageAndShowSecond(){
    School school=null;
    String buttonName="updateSchoolOnSecondPage";
    String buttonValue="Update school";
    school = (School)this.getContext().getAttributeFromSession("school");
    //setting the values supplied from the 1st screen
    school.setSchoolName(this.schoolName);
    school.setAddressLine1(this.addressLine1);
    school.setAddressLine2(this.addressLine2);
    school.setAddressLine3(this.addressLine3);
    school.setBoardOfEducation(this.boardOfEducation);
    school.setCountry("India");
    school.setDistrict(this.district);
    school.setEmail(this.email);
    school.setFax(this.fax);
    school.setState(this.state);
    school.setPhone1(this.phone1);
    school.setPhone2(this.phone2);
    school.setPincode(this.pincode);
    this.getContext().setAttributeToSession("school", school);
    this.getContext().setAttributeToSession("buttonName", buttonName);
    this.getContext().setAttributeToSession("buttonValue", buttonValue);
    return new ForwardResolution("/WEB-INF/pages/schoolMgmtDetails.jsp");
  }
View Full Code Here

  }
 
 
  @HandlesEvent("updateSchoolOnSecondPage")
  public Resolution updateSchoolOnSecondPage(){
    School school=null;
    String message = EsimsConstants._BLANK_STRING;
    //getting the partially updated object from the request scope
    school = (School)this.getContext().getAttributeFromSession("school");
   
    //updating the present values with the ones dsplayed in the second page
    school.setPrincipalFirstName(this.principalFirstName);
    school.setPrincipalMiddleName(this.principalMiddleName);
    school.setPrincipalLastName(this.principalLastName);
    school.setVicePrincipalFirstName(this.vicePrincipalFirstName);
    school.setVicePrincipalMiddleName(this.vicePrincipalMiddleName);
    school.setVicePrincipalLastName(this.vicePrincipalLastName);
    this.schoolService.save(school);
    message = EsimsUtils.createInfoMessage(this.getContext()
        .getContextPath(), "School named<strong> "
        + school.getSchoolName() + "</strong> was updated succesfully");
    //clean up the session stuff after update is over
    this.getContext().removeAttributeFromSession("school");
    FlashScope.getCurrent(this.getContext().getRequest(),true).put("message", message);
    return new RedirectResolution(DisplayMessageAction.class,  "forwardToMessagePage");
  }
View Full Code Here

    return new RedirectResolution(DisplayMessageAction.class,  "forwardToMessagePage");
  }
 
  @HandlesEvent("deleteSchool")
  public Resolution deleteSchool(){     
      School school = this.schoolService.getById(new Long(this.getContext().getRequest().getParameter("schoolId")));
      this.schoolService.delete(school);     
      List <School> listOfSchools=this.schoolService.getAllSchools();
      this.getContext().setAttributeToRequest("listOfSchools",listOfSchools)
      return new ForwardResolution("/WEB-INF/pages/schoolList.jsp");
  }
View Full Code Here

 
   
  //helper method
 
  private School setPropertiesToSchool(){
    School school = new School();
   
    school.setAddressLine1(this.addressLine1);
    school.setAddressLine2(this.addressLine2);
    school.setAddressLine3(this.addressLine3);
    school.setBoardOfEducation(this.boardOfEducation);
    school.setCountry("India");
    school.setDistrict(this.district);
    school.setEmail(this.email);
    school.setFax(this.fax);
    school.setIsActive(this.isActive);
    school.setManagement(this.management);
    school.setPhone1(this.phone1);
    school.setPhone2(this.phone2);
    school.setPincode(this.pincode);
    school.setPrincipalFirstName(this.principalFirstName);
    school.setPrincipalMiddleName(this.principalMiddleName);
    school.setPrincipalLastName(this.principalLastName);
    school.setSchoolName(this.schoolName);
    school.setSchoolCode(this.schoolCode);
    school.setState(this.state);
    school.setVicePrincipalFirstName(this.vicePrincipalFirstName);
    school.setVicePrincipalMiddleName(this.vicePrincipalMiddleName);
    school.setVicePrincipalLastName(this.vicePrincipalLastName);
   
    return school;
  }
View Full Code Here

    DatabaseOperation.DELETE_ALL.execute(connection, schoolDataSet);
   
    Date startDate = EsimsUtils.createDate(1, Calendar.JUNE, 2005);
    Date endDate = EsimsUtils.createDate(15, Calendar.MARCH, 2006);
    SchoolEssence schoolEssence = UtilsForTestCases.createValidSchoolEssence();
    School school = schoolEssence.createSchool();

    schoolDAO.save(school);
    AcademicYear academicYear = new AcademicYear("2005-2006", school,
        startDate, endDate, "active");
    academicYearDAO.save(academicYear);
View Full Code Here

   
   
    Date startDate = EsimsUtils.createDate(1, Calendar.JUNE, 2005);
    Date endDate = EsimsUtils.createDate(15, Calendar.MARCH, 2006);
    SchoolEssence schoolEssence = UtilsForTestCases.createValidSchoolEssence();
    School school = schoolEssence.createSchool();

    schoolDAO.save(school);
    AcademicYear academicYear = new AcademicYear("2005-2006", school,
        startDate, endDate, "active");
    academicYearDAO.save(academicYear);
View Full Code Here

   
   
    Date startDate = EsimsUtils.createDate(1, Calendar.JUNE, 2005);
    Date endDate = EsimsUtils.createDate(15, Calendar.MARCH, 2006);
    SchoolEssence schoolEssence = UtilsForTestCases.createValidSchoolEssence();
    School school = schoolEssence.createSchool();

    schoolDAO.save(school);
    AcademicYear academicYear = new AcademicYear("2005-2006", school,
        startDate, endDate, "active");
    academicYearDAO.save(academicYear);
View Full Code Here

    assertEquals(0,this.studentDAO.getCountOfAdmissions().intValue());
   
    Date startDate = EsimsUtils.createDate(1, Calendar.JUNE, 2005);
    Date endDate = EsimsUtils.createDate(15, Calendar.MARCH, 2006);
    SchoolEssence schoolEssence = UtilsForTestCases.createValidSchoolEssence();
    School school = schoolEssence.createSchool();

    schoolDAO.save(school);
    AcademicYear academicYear = new AcademicYear("2005-2006", school,
        startDate, endDate, "active");
    academicYearDAO.save(academicYear);
View Full Code Here

TOP

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

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.