Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Summary


    protected void run(SummariesManagementBean bean) {

        ServiceMonitoring.logService(this.getClass(), bean);

        if (bean.isNewSummary()) {
            new Summary(bean.getTitle(), bean.getSummaryText(), bean.getStudentsNumber(), bean.getSummaryType().equals(
                    SummariesManagementBean.SummaryType.EXTRA_SUMMARY), bean.getProfessorship(), bean.getTeacherName(),
                    bean.getTeacher(), bean.getShift(), bean.getLesson(), bean.getSummaryDate(), bean.getSummaryRoom(),
                    bean.getSummaryTime(), bean.getLessonType(), bean.getTaught());
        } else {
            bean.getSummary().edit(bean.getTitle(), bean.getSummaryText(), bean.getStudentsNumber(),
View Full Code Here


        if (summaryViewState == null) {
            summaryViewState = RenderUtils.getViewState("summariesManagementBeanWithSummary");
        }

        SummariesManagementBean bean = (SummariesManagementBean) summaryViewState.getMetaObject().getObject();
        Summary lastSummary = bean.getLastSummary();
        if (lastSummary != null) {
            bean.setSummaryText(lastSummary.getSummaryText());
            bean.setTitle(lastSummary.getTitle());
            bean.setLessonPlanning(null);
        }

        return goToSummaryManagementPageAgain(mapping, request, (DynaActionForm) form, bean);
    }
View Full Code Here

    public ActionForward prepareEditSummary(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {

        Professorship teacherLogged = ((Professorship) request.getAttribute("loggedTeacherProfessorship"));
        DynaActionForm dynaActionForm = (DynaActionForm) form;
        Summary summary = getSummaryFromParameter(request);

        SummaryType summaryType;
        if (summary.isExtraSummary()) {
            summaryType = SummaryType.EXTRA_SUMMARY;
            request.setAttribute("notShowLessonPlanningsAndSummaries", Boolean.TRUE);
        } else {
            summaryType = SummaryType.NORMAL_SUMMARY;
        }

        DateTimeFieldType[] dateTimeFieldTypes = { DateTimeFieldType.hourOfDay(), DateTimeFieldType.minuteOfHour() };
        HourMinuteSecond time = summary.getSummaryHourHourMinuteSecond();
        int[] timeArray = { time.getHour(), time.getMinuteOfHour() };
        Partial timePartial = new Partial(dateTimeFieldTypes, timeArray);

        SummariesManagementBean bean =
                new SummariesManagementBean(summary.getTitle(), summary.getSummaryText(), summary.getStudentsNumber(),
                        summaryType, summary.getProfessorship(), summary.getTeacherName(), summary.getTeacher(),
                        summary.getShift(), summary.getLesson(), summary.getSummaryDateYearMonthDay(), summary.getRoom(),
                        timePartial, summary, teacherLogged, summary.getSummaryType(), summary.getTaught());

        return goToSummaryManagementPageAgain(mapping, request, dynaActionForm, bean);
    }
View Full Code Here

    }

    public ActionForward deleteSummary(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {

        Summary summary = getSummaryFromParameter(request);
        Professorship professorshipLogged = (Professorship) request.getAttribute("loggedTeacherProfessorship");
        ExecutionCourse executionCourse = (ExecutionCourse) request.getAttribute("executionCourse");

        try {
            DeleteSummary.runDeleteSummary(executionCourse, summary, professorshipLogged);
View Full Code Here

        if (summaryViewState == null) {
            summaryViewState = RenderUtils.getViewState("summariesManagementBeanWithSummary");
        }

        SummariesManagementBean summaryBean = (SummariesManagementBean) summaryViewState.getMetaObject().getObject();
        Summary lastSummary = summaryBean.getLastSummary();
        if (lastSummary != null) {
            summaryBean.setSummaryText(lastSummary.getSummaryText());
            summaryBean.setTitle(lastSummary.getTitle());
            summaryBean.setLessonPlanning(null);
        }

        return returnToCreateComplexSummary(mapping, form, request, summaryBean, null);
    }
View Full Code Here

    @Override
    public Object provide(Object source, Object currentValue) {

        SummariesManagementBean bean = (SummariesManagementBean) source;
        Lesson lesson = bean.getLesson();
        Summary summary = bean.getSummary();
        Set<ShiftType> shiftTypes = new HashSet<ShiftType>();

        if (summary != null && summary.getSummaryType() != null) {
            shiftTypes.add(summary.getSummaryType());
        }

        if (lesson != null) {
            shiftTypes.addAll(lesson.getShift().getTypes());
        }
View Full Code Here

            public HtmlComponent createComponent(Object object, Class type) {
                if (object == null) {
                    return new HtmlText();
                }

                Summary summary = (Summary) object;
                StringBuilder builder = new StringBuilder();
                Lesson lesson = null;

                builder.append(summary.getSummaryDateYearMonthDay().getDayOfMonth()).append("/");
                builder.append(summary.getSummaryDateYearMonthDay().getMonthOfYear()).append("/");
                builder.append(summary.getSummaryDateYearMonthDay().getYear());
                builder.append(" - ").append(RenderUtils.getResourceString("DEFAULT", "label.lesson") + ": ");

                if (summary.isExtraSummary()) {

                    builder.append(RenderUtils.getEnumString(SummaryType.EXTRA_SUMMARY, null)).append(" ");
                    builder.append(" (").append(summary.getSummaryHourHourMinuteSecond().getHour());
                    builder.append(":").append(summary.getSummaryHourHourMinuteSecond().getMinuteOfHour()).append(") ");

                } else {

                    lesson = summary.getLesson();
                    if (lesson != null) {

                        builder.append(lesson.getDiaSemana().toString()).append(" (");
                        builder.append(DateFormatUtil.format("HH:mm", lesson.getInicio().getTime()));
                        builder.append("-").append(DateFormatUtil.format("HH:mm", lesson.getFim().getTime()));
View Full Code Here

        SummariesManagementBean bean = (SummariesManagementBean) source;
        Lesson lesson = bean.getLesson();
        Shift shift = bean.getShift();
        SummaryType summaryType = bean.getSummaryType();
        Summary summary = bean.getSummary();
        List<YearMonthDay> possibleSummaryDates = new ArrayList<YearMonthDay>();

        if (summaryType != null && summaryType.equals(SummaryType.NORMAL_SUMMARY)) {
            if (lesson != null) {
                possibleSummaryDates.addAll(lesson.getAllPossibleDatesToInsertSummary());
            }

            // Show SummaryDate when edit summary
            if (summary != null) {
                Shift summaryShift = summary.getShift();
                Lesson summaryLesson = summary.getLesson();
                if (shift != null && lesson != null && summaryShift != null && summaryShift.equals(shift)
                        && summaryLesson != null && summaryLesson.equals(lesson)) {
                    possibleSummaryDates.add(0, summary.getSummaryDateYearMonthDay());
                }
            }
        }
        return possibleSummaryDates;
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.Summary

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.