Package org.libreplan.business.calendars.entities

Examples of org.libreplan.business.calendars.entities.CalendarException


    }

    private void addChristmasAsExceptionDay(BaseCalendar calendar) {
        CalendarExceptionType type = calendarExceptionTypeDAO.list(
                CalendarExceptionType.class).get(0);
        CalendarException christmasDay = CalendarException.create(
                BaseCalendarTest.CHRISTMAS_DAY_LOCAL_DATE,
                EffortDuration.zero(), type);
        calendar.addExceptionDay(christmasDay);
    }
View Full Code Here


        if (calendar == null) {
            return "";
        }

        LocalDate date = baseCalendarModel.getSelectedDay();
        CalendarException exceptionDay = calendar.getExceptionDay(date);
        if (exceptionDay != null) {
            if (calendar.getOwnExceptionDay(date) != null) {
                return _("Exception: {0}", exceptionDay.getType().getName());
            } else {
                return _("Exception: {0} (Inh)", exceptionDay.getType()
                        .getName());
            }
        }

        if (calendar.getCapacityOn(PartialDay.wholeDay(date)).isZero()) {
View Full Code Here

    public void onSelectException(Event event) {
        Listbox listBox = (Listbox) event.getTarget();
        Listitem item = (Listitem) listBox.getSelectedItem();
        if (item != null) {
            CalendarException calendarException = (CalendarException) item
                .getValue();
            setSelectedDay(calendarException.getDate());
            reloadDayInformation();
        }
    }
View Full Code Here

    public class CalendarExceptionRenderer implements ListitemRenderer {

        @Override
        public void render(Listitem item, Object data) {
            CalendarException calendarException = (CalendarException) data;
            item.setValue(calendarException);

            appendDayListcell(item, calendarException);
            appendExceptionTypeListcell(item, calendarException);
            appendStandardEffortListcell(item, calendarException.getCapacity());
            appendExtraEffortListcell(item, calendarException.getCapacity());
            appendCodeListcell(item, calendarException);
            appendOriginListcell(item, calendarException);
            appendOperationsListcell(item, calendarException);

            markAsSelected(item, calendarException);
View Full Code Here

                    throw new ValidationException(
                            "missing date in a calendar exception");
                }
                // find by code
                try {
                    CalendarException exception = baseCalendar
                            .getCalendarExceptionByCode(exceptionDTO.code);
                    update(exception, exceptionDTO);
                } catch (InstanceNotFoundException e) {
                    // find by date
                    CalendarException exception = baseCalendar
                            .getOwnExceptionDay(DateConverter
                                    .toLocalDate(exceptionDTO.date));
                    if (exception != null) {
                        throw new ValidationException(
                                "exception date already exists");
View Full Code Here

        for (LocalDate date = startDate; date.compareTo(endDate) <= 0; date = date
                .plusDays(1)) {
            if (baseCalendar.getOwnExceptionDay(date) != null) {
                getBaseCalendar().updateExceptionDay(date, capacity, type);
            } else {
                CalendarException day = CalendarException.create("", date,
                        capacity, type);
                getBaseCalendar().addExceptionDay(day);
            }
        }
    }
View Full Code Here

    public boolean isExceptional() {
        if (getBaseCalendar() == null) {
            return false;
        }

        CalendarException day = getBaseCalendar().getOwnExceptionDay(selectedDate);
        return (day != null);
    }
View Full Code Here

                } else {
                    getBaseCalendar().updateExceptionDay(date, capacity, type);
                }
            } else {
                if (type != null) {
                    CalendarException day = CalendarException.create(date,
                            capacity, type);
                    getBaseCalendar().addExceptionDay(day);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.libreplan.business.calendars.entities.CalendarException

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.