slotLessons.put(slotIndex+"-"+dayIndex, infoLessonWrapper);
if (getSlotCssClass(infoLessonWrapper, hourIndex).equalsIgnoreCase( "period-single-slot")) { LessonSlotContentRendererShift lessonSlotContentRendererShift = (LessonSlotContentRendererShift) this.lessonSlotContentRenderer; strBuffer.append(lessonSlotContentRendererShift .lastRender(infoLessonWrapper.getLessonSlot())); } slotLessons.put(slotIndex + "-" + dayIndex, infoLessonWrapper);
    public StringBuffer render(Locale locale, PageContext pageContext) {                StringBuffer strBuffer = new StringBuffer("");        HashMap slotLessons = new HashMap();        TimeTableSlot[][] grid = timeTable.getTimeTableGrid();        strBuffer.append("<table class='timetable' cellspacing='0' cellpadding='0' width='90%'>");        renderHeader(strBuffer, locale, pageContext);        for (int hourIndex = 0; hourIndex < timeTable.getNumberOfHours().intValue(); hourIndex++) {            strBuffer.append("<tr>\r\n");            strBuffer.append("<td width='15%' class='period-hours'>");            strBuffer.append(getHourLabelByIndex(hourIndex)).append("</td>\r\n");            /* iterate over days */            for (int dayIndex = 0; dayIndex < timeTable.getNumberOfDays().intValue(); dayIndex++) {                DayColumn dayColumn = timeTable.getDayColumn(dayIndex);                                TimeTableSlot timeTableSlot = grid[dayIndex][hourIndex];                if (timeTableSlot != null) {                    List colisionList = timeTableSlot.getLessonSlotList();                    InfoLessonWrapper[] lessonSlotListResolved = resolveColisions(colisionList,                            timeTable.getDayColumn(dayIndex));                    for (int slotIndex = 0; slotIndex < lessonSlotListResolved.length; slotIndex++) {                                                InfoLessonWrapper infoLessonWrapper = lessonSlotListResolved[slotIndex];                        strBuffer.append("<td ");                        if (infoLessonWrapper != null) {                            strBuffer.append("style='background-color: ").append(                                    colorPicker.getBackgroundColor(infoLessonWrapper)).append("' ");                        }                        int slotColspan = calculateColspan(infoLessonWrapper, lessonSlotListResolved,                                slotIndex, dayColumn);                        if (slotColspan > 1) {                            strBuffer.append(" colspan ='").append(slotColspan).append("'");                            slotIndex += slotColspan - 1;                        }                        strBuffer.append(" class='");                        strBuffer.append(getSlotCssClass(infoLessonWrapper, hourIndex));                        strBuffer.append("' ");                        if (infoLessonWrapper != null) {                            SimpleDateFormat dateFormat = new SimpleDateFormat("k:mm");                            Calendar start = infoLessonWrapper.getLessonSlot().getInfoLessonWrapper()                                    .getInfoShowOccupation().getInicio();                            Calendar end = infoLessonWrapper.getLessonSlot().getInfoLessonWrapper()                                    .getInfoShowOccupation().getFim();                            String startLabel = dateFormat.format(start.getTime());                            String endLabel = dateFormat.format(end.getTime());                            strBuffer.append(" title='").append(startLabel).append("-").append(endLabel)                                    .append("'");                        }                        strBuffer.append(">");                        if ((infoLessonWrapper != null)                                && (infoLessonWrapper.getLessonSlot().getStartIndex() == hourIndex)) {                            strBuffer.append(this.lessonSlotContentRenderer.render(infoLessonWrapper                                    .getLessonSlot()));                            if (this.lessonSlotContentRenderer instanceof ShiftEnrollmentTimeTableLessonContentRenderer) {                                slotLessons.put(slotIndex+"-"+dayIndex, infoLessonWrapper);                            }                        } else {                            if (this.lessonSlotContentRenderer instanceof ShiftEnrollmentTimeTableLessonContentRenderer                                    && getSlotCssClass((InfoLessonWrapper) slotLessons.get(slotIndex+"-"+dayIndex),                                            hourIndex).equalsIgnoreCase("period-last-slot")) {                                LessonSlotContentRendererShift lessonSlotContentRendererShift = (LessonSlotContentRendererShift)                                        this.lessonSlotContentRenderer;                                InfoLessonWrapper infoLessonWrapperHashMap = (InfoLessonWrapper) slotLessons                                        .get(slotIndex+"-"+dayIndex);                                strBuffer.append(lessonSlotContentRendererShift                                        .lastRender(infoLessonWrapperHashMap.getLessonSlot()));                                                            }                            else{                                                            strBuffer.append("&nbsp;");                            }                        }                        strBuffer.append("</td>\r\n");                    }                } else {                    /** no lessons */                    int colspan = dayColumn.getMaxColisionSize().intValue();                    String cssClass = getSlotCssClass(null, hourIndex);                    strBuffer.append("<td ").append(" class='").append(cssClass).append("' ");                    if (colspan > 1) {                        strBuffer.append("colspan='").append(colspan).append("'");                    }                    strBuffer.append(">").append("&nbsp;").append("</td>\r\n");                }            }            strBuffer.append("</tr>\r\n");        }        strBuffer.append("</table>");        return strBuffer;    }