コード例 #1
0
  private void encodeChildCurricularCourses(int width, int courseGroupIndent) throws IOException {
    writer.startElement("div", this);
    writer.writeAttribute(
        "class",
        (this.courseGroup.isRoot()) ? "indent3" : "indent" + (courseGroupIndent + 3),
        null);
    writer.startElement("table", this);
    writer.writeAttribute("class", "showinfo3 mvert0", null);
    writer.writeAttribute("style", "width: " + (width - (this.depth * 3) - 3) + "em;", null);

    for (Context context :
        this.courseGroup.getSortedOpenChildContextsWithCurricularCourses(executionYear)) {
      new UICurricularCourse(
              context.getChildDegreeModule(),
              context,
              this.toEdit,
              this.showRules,
              this.depth,
              this.tabs + "\t",
              this.executionYear,
              this.module)
          .encodeBegin(facesContext);
    }

    writer.endElement("table");
    writer.endElement("div");
  }
コード例 #2
0
  @Service
  public static void run(
      CurricularCourse curricularCourse,
      Context context,
      CourseGroup courseGroup,
      Integer year,
      Integer semester,
      Integer beginExecutionPeriodID,
      Integer endExecutionPeriodID) {

    final CurricularPeriod degreeCurricularPeriod =
        context.getParentCourseGroup().getParentDegreeCurricularPlan().getDegreeStructure();

    // ********************************************************
    /*
     * TODO: Important - change this code (must be generic to support
     * several curricularPeriodInfoDTOs, instead of year and semester)
     */
    CurricularPeriod curricularPeriod = null;
    CurricularPeriodInfoDTO curricularPeriodInfoYear = null;
    if (courseGroup.getParentDegreeCurricularPlan().getDegree().getDegreeType().getYears() > 1) {
      curricularPeriodInfoYear = new CurricularPeriodInfoDTO(year, AcademicPeriod.YEAR);
    }
    final CurricularPeriodInfoDTO curricularPeriodInfoSemester =
        new CurricularPeriodInfoDTO(semester, AcademicPeriod.SEMESTER);

    if (curricularPeriodInfoYear != null) {
      curricularPeriod =
          degreeCurricularPeriod.getCurricularPeriod(
              curricularPeriodInfoYear, curricularPeriodInfoSemester);
      if (curricularPeriod == null) {
        curricularPeriod =
            degreeCurricularPeriod.addCurricularPeriod(
                curricularPeriodInfoYear, curricularPeriodInfoSemester);
      }
    } else {
      curricularPeriod = degreeCurricularPeriod.getCurricularPeriod(curricularPeriodInfoSemester);
      if (curricularPeriod == null) {
        curricularPeriod = degreeCurricularPeriod.addCurricularPeriod(curricularPeriodInfoSemester);
      }
    }

    // ********************************************************

    context.edit(
        courseGroup,
        curricularPeriod,
        getBeginExecutionPeriod(beginExecutionPeriodID),
        getEndExecutionPeriod(endExecutionPeriodID));
  }
コード例 #3
0
 private void encodeChildCourseGroups() throws IOException {
   for (Context context :
       this.courseGroup.getSortedOpenChildContextsWithCourseGroups(this.executionYear)) {
     new UICourseGroup(
             context.getChildDegreeModule(),
             context,
             this.toEdit,
             this.showRules,
             this.depth + 1,
             this.tabs + "\t",
             this.onlyStructure,
             this.toOrder,
             this.hideCourses,
             this.reportsAvailable,
             this.executionYear,
             this.module)
         .encodeBegin(facesContext);
   }
 }