protected List<SelectItem> readExecutionYearItems() {
    final List<SelectItem> result = new ArrayList<SelectItem>();

    final Collection<ExecutionDegree> executionDegrees =
        getDegreeCurricularPlan().getExecutionDegreesSet();

    if (executionDegrees.isEmpty()) {
      final ExecutionYear executionYear =
          getDegreeCurricularPlan().getRoot().getMinimumExecutionPeriod().getExecutionYear();
      result.add(new SelectItem(executionYear.getExternalId(), executionYear.getYear()));
      return result;
    }

    for (ExecutionDegree executionDegree : executionDegrees) {
      result.add(
          new SelectItem(
              executionDegree.getExecutionYear().getExternalId(),
              executionDegree.getExecutionYear().getYear()));
    }

    if (getExecutionYearID() == null) {
      setExecutionYearID(
          getDegreeCurricularPlan()
              .getMostRecentExecutionDegree()
              .getExecutionYear()
              .getExternalId());
    }

    return result;
  }
Exemplo n.º 2
0
  private VirtualPath getVirtualPath(Site site, Container container) {

    List<Content> contents = site.getPathTo(container);

    final VirtualPath filePath = new VirtualPath();

    for (Content content : contents.subList(1, contents.size())) {
      filePath.addNode(
          0,
          new VirtualPathNode(
              content.getClass().getSimpleName().substring(0, 1) + content.getExternalId(),
              content.getName().getContent()));
    }

    String authorName = site.getAuthorName();
    filePath.addNode(
        0,
        new VirtualPathNode(
            "Site" + site.getExternalId(),
            authorName == null ? "Site" + site.getExternalId() : authorName));

    ExecutionSemester executionSemester = site.getExecutionPeriod();
    if (executionSemester == null) {
      filePath.addNode(0, new VirtualPathNode("Intemporal", "Intemporal"));
    } else {
      filePath.addNode(
          0,
          new VirtualPathNode(
              "EP" + executionSemester.getExternalId(), executionSemester.getName()));

      ExecutionYear executionYear = executionSemester.getExecutionYear();
      filePath.addNode(
          0, new VirtualPathNode("EY" + executionYear.getExternalId(), executionYear.getYear()));
    }

    filePath.addNode(0, new VirtualPathNode("Courses", "Courses"));
    return filePath;
  }