| java.lang.Object com.projity.pm.calendar.CalendarService
CalendarService | public class CalendarService (Code) | | Facade for manipulating calendars via a dialog or web interface
|
Method Summary | |
public void | add(WorkingCalendar cal) | final public static Object[] | allBaseCalendars() | public void | assignCalendar(WorkingCalendar destination, WorkingCalendar source) Assigns an existing calendar with the contents of another. | public String | dump(WorkingCalendar cal) | final public static WorkCalendar | findBaseCalendar(String name) | public WorkCalendar | findBaseCalendar(String name, boolean importing) | public WorkCalendar | findBaseCalendar(long id) | public WorkingCalendar | getBaseCalendar(WorkingCalendar cal) | final public ArrayList | getBaseCalendars() | public String | getCalendarName(WorkingCalendar cal) | public DayDescriptor | getDay(WorkingCalendar workingCalendar, long date) Get a descriptor for the day (its hours and modified status). | public DayDescriptor | getDay(WorkingCalendar workingCalendar, Set intervals, boolean selectedWeekDays) | public WorkingCalendar | getDefaultInstance() | final public ArrayList | getDerivedCalendars() | public static CalendarService | getInstance() | public WorkingCalendar | getStandardBasedInstance() | public WorkingCalendar | getStandardInstance() | public DayDescriptor | getWeekDay(WorkingCalendar workingCalendar, int dayNum) Get a descriptor for the week day (its hours and modified status). | public void | invalidate(WorkingCalendar cal) | public void | makeDefaultDay(WorkingCalendar workingCalendar, long date) | public void | makeDefaultDays(WorkingCalendar workingCalendar, Set intervals, boolean[] selectedDays) | public void | makeDefaultWeekDay(WorkingCalendar workingCalendar, int dayNum) Clear out any week day exceptions for the week day
Parameters: workingCalendar - Parameters: dayNum - Corresponds to constants in java.util.Calendar SUNDAY=1,MONDAY=2... | public WorkingCalendar | makeScratchCopy(WorkingCalendar from) Make a temporary copy of a calendar. | public void | reassignCalendar(HasCalendar object, WorkCalendar oldCal, WorkCalendar newCal) | public void | renameImportedBaseCalendars(String documentName) | public void | saveAndUpdate(WorkingCalendar workingCalendar) | public void | setDayNonWorking(WorkingCalendar workingCalendar, long date) | public void | setDayWorkingHours(WorkingCalendar workingCalendar, long date, WorkingHours workingHours) Set the working hours for a day. | public void | setDaysNonWorking(WorkingCalendar workingCalendar, Set intervals, boolean[] selectedDays) | public void | setDaysWorkingHours(WorkingCalendar workingCalendar, Set intervals, boolean selectedDays, WorkingHours workingHours) | public void | setWeekDayNonWorking(WorkingCalendar workingCalendar, int dayNum) Sets a week day as a non working day
Parameters: workingCalendar - Parameters: dayNum - Corresponds to constants in java.util.Calendar SUNDAY=1,MONDAY=2... | public void | setWeekDayWorkingHours(WorkingCalendar workingCalendar, int dayNum, WorkingHours workingHours) Set the working hours for a week day
Parameters: workingCalendar - -Calendar whose week day to set Parameters: dayNum - Corresponds to constants in java.util.Calendar SUNDAY=1,MONDAY=2... |
allBaseCalendars | final public static Object[] allBaseCalendars()(Code) | | |
assignCalendar | public void assignCalendar(WorkingCalendar destination, WorkingCalendar source)(Code) | | Assigns an existing calendar with the contents of another. Used when
validating the calendar dialog to copy the days back into the non-scratch
calendar
Parameters: destination - Where to copy data Parameters: source - Where to copy from |
dump | public String dump(WorkingCalendar cal)(Code) | | For debugging - returns a toString() for a calendar
Parameters: cal - String representation of calendar for debugging |
getBaseCalendar | public WorkingCalendar getBaseCalendar(WorkingCalendar cal)(Code) | | Get the base calendar for a given calendar
Parameters: cal - whose based to get base calendar or null if cal has no base |
getCalendarName | public String getCalendarName(WorkingCalendar cal)(Code) | | Gets the name of a calendar
Parameters: cal - Calendar whose name to return name of calendar or "" if cal is null |
getDay | public DayDescriptor getDay(WorkingCalendar workingCalendar, long date)(Code) | | Get a descriptor for the day (its hours and modified status). The
priority order what day is return is: 1. Derived calendar month day
exception 2. Derived calendar week day exception 3. Base calendar special
month day 4. Base calendar week day
Parameters: workingCalendar - The calendar to use Parameters: date - Midnight on the day in question (see DateTime.midnightToday()) DayDescriptor with modified info and work day |
getDay | public DayDescriptor getDay(WorkingCalendar workingCalendar, Set intervals, boolean selectedWeekDays)(Code) | | Parameters: workingCalendar - Parameters: intervals - Common day or null |
getWeekDay | public DayDescriptor getWeekDay(WorkingCalendar workingCalendar, int dayNum)(Code) | | Get a descriptor for the week day (its hours and modified status). If the
derived calendar does not have a special weekday defined, then the base
calendar weekday is used
Parameters: workingCalendar - The calendar to use Parameters: dayNum - Corresponds to constants in java.util.Calendar SUNDAY=1,MONDAY=2... SATURDAY=7 DayDescriptor with modified info and work day |
makeDefaultDay | public void makeDefaultDay(WorkingCalendar workingCalendar, long date)(Code) | | Clear out any month day exceptions for the given date
Parameters: workingCalendar - Parameters: date - |
makeDefaultDays | public void makeDefaultDays(WorkingCalendar workingCalendar, Set intervals, boolean[] selectedDays)(Code) | | Parameters: workingCalendar - Parameters: intervals - with no overlap |
makeDefaultWeekDay | public void makeDefaultWeekDay(WorkingCalendar workingCalendar, int dayNum)(Code) | | Clear out any week day exceptions for the week day
Parameters: workingCalendar - Parameters: dayNum - Corresponds to constants in java.util.Calendar SUNDAY=1,MONDAY=2... SATURDAY=7 |
makeScratchCopy | public WorkingCalendar makeScratchCopy(WorkingCalendar from)(Code) | | Make a temporary copy of a calendar. Used in the calendar dialog - A
scratch copy should be modified, and only upon validation should the
calendar data be copied back into the original calendar via a call to
assignCalendar
Parameters: from - |
renameImportedBaseCalendars | public void renameImportedBaseCalendars(String documentName)(Code) | | |
setDayNonWorking | public void setDayNonWorking(WorkingCalendar workingCalendar, long date)(Code) | | Set a month day as a non working day
Parameters: workingCalendar - Parameters: date - what date is not working |
setDayWorkingHours | public void setDayWorkingHours(WorkingCalendar workingCalendar, long date, WorkingHours workingHours) throws WorkRangeException(Code) | | Set the working hours for a day. Working hours should be filled as
follows: An existing WorkingHours should be cloned before modification in
case the modification causes an exception. WorkingHours is modified by
calls to WorkingHours.setInterval(int number, long start, long end) See
comments in this method as to what values to use (must be on the date
1/1/70 or -1 if null)
Parameters: workingCalendar - -Calendar whose day to set Parameters: date - -date of the exception Parameters: workingHours - -contains the work ranges throws: WorkRangeException - -If invalid ranges, an exception is thrown |
setWeekDayNonWorking | public void setWeekDayNonWorking(WorkingCalendar workingCalendar, int dayNum) throws InvalidCalendarException(Code) | | Sets a week day as a non working day
Parameters: workingCalendar - Parameters: dayNum - Corresponds to constants in java.util.Calendar SUNDAY=1,MONDAY=2... SATURDAY=7 |
|
|