encodeSubtitles();
encodeSubtitles(facesContext);
    public void encodeBegin(FacesContext facesContext) throws IOException {        if (!isRendered()) {            return;        }        final DegreeCurricularPlan dcp = (DegreeCurricularPlan) this.getAttributes().get("dcp");        if (dcp.getDegree().isBolonhaDegree()) {            this.toEdit = (this.getBooleanAttribute("toEdit") != null) ? (Boolean) this.getBooleanAttribute("toEdit") : Boolean.FALSE;            this.showRules = (this.getBooleanAttribute("showRules") != null) ? (Boolean) this.getBooleanAttribute("showRules") : Boolean.FALSE;            final String organizeBy = (this.getAttributes().get("organizeBy") != null) ? (String) this.getAttributes().get("organizeBy") : "groups";            final Boolean onlyStructure = (this.getBooleanAttribute("onlyStructure") != null) ? (Boolean) this.getBooleanAttribute("onlyStructure") : Boolean.FALSE;            final Boolean toOrder = (this.getBooleanAttribute("toOrder") != null) ? (Boolean) this.getBooleanAttribute("toOrder") : Boolean.FALSE;            final Boolean hideCourses = (this.getBooleanAttribute("hideCourses") != null) ? (Boolean) this.getBooleanAttribute("hideCourses") : Boolean.FALSE;            final Boolean reportsAvailable = (this.getBooleanAttribute("reportsAvailable") != null) ? (Boolean) this.getBooleanAttribute("reportsAvailable") : Boolean.FALSE;            if (this.getAttributes().get("executionYear") != null) {                executionYear = (ExecutionYear) this.getAttributes().get("executionYear");             }                        if (incorrectUseOfComponent(organizeBy, onlyStructure, toOrder, hideCourses)) {                throw new IOException("incorrect.component.usage");            }                        if (organizeBy.equalsIgnoreCase("years")) {                encodeByYears(facesContext, dcp);            } else {                StringBuilder dcpBuffer = new StringBuilder();                dcpBuffer.append("[DCP ").append(dcp.getIdInternal()).append("] ").append(dcp.getName());                //System.out.println(dcpBuffer);                new UICourseGroup(dcp.getRoot(), null, this.toEdit, this.showRules, ROOT_DEPTH, "", onlyStructure, toOrder, hideCourses, reportsAvailable, executionYear).encodeBegin(facesContext);            }                        if (dcp.hasDegreeStructure() && dcp.getDegreeStructure().hasAnyChilds()) {                encodeSubtitles();            }        }    }