Package net.sf.esims.model.entity

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


  /**
   *
   * @return valid instance of subject , NO ID is assigned
   */
  public static Subject createValidSubject(){
    return new Subject("Maths",createValidStandard(),new Boolean(true),"teach everything");
  }
View Full Code Here


  public Resolution createSubject() {
    String message = null;

    Standard standardToBeLinkedWith = this.subjectService
        .getStandardById(this.standardId);
    Subject subject = new Subject(this.name, standardToBeLinkedWith,
        this.isActive, this.syllabus);
    this.subjectService.save(subject);
    message = EsimsUtils.createInfoMessage(this.getContext()
        .getContextPath(), "<strong>" + this.name
        + "</strong> was created succesfully");
View Full Code Here

    String buttonName = "updateSubject";
    String buttonValue = "Edit Subject";
    this.getContext().setAttributeToSession("buttonName", buttonName);
    this.getContext().setAttributeToSession("buttonValue", buttonValue);
    // create the bean needed for pre-population
    Subject subject = this.subjectService.getById(new Long(this
        .getContext().getRequest().getParameter("subjectId")));
    this.getContext().setAttributeToSession("subject", subject);
    return new ForwardResolution("/WEB-INF/pages/subjectDetails.jsp");
  }
View Full Code Here

  @HandlesEvent("updateSubject")
  public Resolution updateSubject() {
    String message = null;
    // retrieve the original entities
    Subject subject = (Subject)this.getContext().getAttributeFromSession("subject");
    Standard standard = this.subjectService
        .getStandardById(this.standardId);
    subject.setName(this.name);
    subject.setStandard(standard);
    subject.setIsActive(this.isActive);
    subject.setSyllabus(this.syllabus);

    this.subjectService.save(subject);
    message = EsimsUtils.createInfoMessage(this.getContext()
        .getContextPath(), this.name
        + "</strong> was updated succesfully");
View Full Code Here

  }

  @HandlesEvent("deleteSubject")
  public Resolution deleteSubject() {
    // Deleting the subject with the passed subjectId
    Subject subject = this.subjectService.getById(new Long(this
        .getContext().getRequest().getParameter("subjectId")));
    this.subjectService.delete(subject);
    // re populating the list of exams and showing the
    // lastest list of avaialble exams based on the search criteria
    String searchCriteria = (String) this.getContext()
View Full Code Here

    academicYearDAO.save(academicYear);

    Standard standard = new Standard("1st standard", academicYear);
    standardDAO.save(standard);

    Subject subject = new Subject("Maths", standard, new Boolean(true),
        "teach everything");

    this.subjectDAO.save(subject);

    List<Subject> listOfSubjects = subjectDAO.getSubjectByName("Maths");
View Full Code Here

    academicYearDAO.save(academicYear);

    Standard standard = new Standard("1st standard", academicYear);
    standardDAO.save(standard);

    Subject subject = new Subject("Maths", standard, new Boolean(true),
        "teach everything");
    subjectDAO.save(subject);

    List<Subject> listOfSubjects = subjectDAO.getSubjectByName("Maths");
    assertEquals(1, listOfSubjects.size());

    Long id = listOfSubjects.get(0).getSubjectId();

    assertNotNull(id);

    Subject subject2 = subjectDAO.get(id);
    assertNotNull(subject2);

    listOfSubjects = subjectDAO.getAll();
    assertEquals(1, listOfSubjects.size());
View Full Code Here

    academicYearDAO.save(academicYear);

    Standard standard = new Standard("1st standard", academicYear);
    standardDAO.save(standard);

    Subject subject = new Subject("Maths", standard, new Boolean(true),
        "teach everything");
    subjectDAO.save(subject);

    List<Subject> listOfSubjects = subjectDAO.getSubjectByName("Maths");
    assertEquals(1, listOfSubjects.size());
View Full Code Here

TOP

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

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.