Class BusinessCalendarModel
java.lang.Object
com.webmethods.caf.faces.data.calendar.BusinessCalendarModel
- All Implemented Interfaces:
IContentProvider
- Direct Known Subclasses:
TaskBusinessCalendarModel
The content provider for a business calendar.
Used to calculate resulting date and time based on
setting applied to the model.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the adjustment setting used in the resulting day calculation.Get the base date time to be evaluated by the selected calendar and used to calculate the result date time.protected IWorkdayCalendar
getCalendarByID
(String calendarID) protected Date
Get the base date time as a date.Get the object stored as the corporate calendar.Get the date time format used to convert a String value to a date.Object[]
Get property keys method required by IContentProvider.Calculate the resulting date time.Class<?>
Get type method required by IContentProvider.Get the object stored as the user calendar.Get value method required by IContentProvider.int
Get work days in a week.int
Get work hours for a day.int
Get the number of minutes in a work day.boolean
hasProperty
(Object propertyName) Has property method required by IContentProvider.boolean
Is the user's personal calendar being used for the result date time calculation verses the default corporate calendar.void
setBaseAdjustment
(String baseAdjustment) Adjust the base date time used in the resulting day calculation.void
setBaseDateTime
(Object baseDateTime) Set the base date time to be evaluated by the selected calendar and used to calculate the result date time.void
setCorporateCalendar
(Object corpCalendar) Set the calendar object ID or alias for the corporate calendar.void
setDateTimeFormat
(String dateFormat) Set the date time format used to convert a String value to a date.void
setUserCalendar
(Object userCalendar) Set the value for the user calendar.void
setUseUserPersonalCalendar
(boolean useUserPersonalCalendar) Use the user's personal calendar for calculation verses the default corporate calendar.void
setWorkdays
(int workdays) Set the number of work days in a week.void
setWorkhours
(int workhours) Set the number of work hours for a day.void
setWorkminutes
(int workminutes) Set the number of minutes in a work day.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.webmethods.caf.faces.data.IContentProvider
toString
-
Field Details
-
ADJUSTMENT_CURRENT_DAY_START
- See Also:
-
ADJUSTMENT_CURRENT_DAY_END
- See Also:
-
ADJUSTMENT_NEXT_DAY_START
- See Also:
-
ADJUSTMENT_NEXT_DAY_END
- See Also:
-
-
Constructor Details
-
BusinessCalendarModel
public BusinessCalendarModel()
-
-
Method Details
-
getPropertyKeys
Get property keys method required by IContentProvider.- Specified by:
getPropertyKeys
in interfaceIContentProvider
- Returns:
- The default value of null.
-
getType
Get type method required by IContentProvider.- Specified by:
getType
in interfaceIContentProvider
- Parameters:
propertyName
-- Returns:
- The default value of null.
- Throws:
PropertyNotFoundException
- if property is not supported
-
getValue
Get value method required by IContentProvider.- Specified by:
getValue
in interfaceIContentProvider
- Parameters:
propertyName
-- Returns:
- The default value of null.
- Throws:
PropertyNotFoundException
- if property is not supportedELException
-
hasProperty
Has property method required by IContentProvider.- Specified by:
hasProperty
in interfaceIContentProvider
- Parameters:
propertyName
-- Returns:
- The default value of false.
-
getResultDateTime
Calculate the resulting date time. This is base on the base date time, calendar to us, and base time adjustment. The resulting date time is cached and used on the next call to this method. The cache can be reset by changing the value of the base date time, calendar to us, or base time adjustment.- Returns:
- The cached resulting date time.
- Throws:
ContentProviderException
-
getCorporateCalendar
Get the object stored as the corporate calendar.- Returns:
- Object The calendar object ID or alias.
- See Also:
-
setCorporateCalendar
Set the calendar object ID or alias for the corporate calendar. Clears the cached resulting date time.- Parameters:
corpCalendar
- The calendar object ID or alias.- See Also:
-
getUserCalendar
Get the object stored as the user calendar.- Returns:
- A IThingID, URI, or String value that resolves a URI.
- See Also:
-
setUserCalendar
Set the value for the user calendar. The value need to be a IThingID, URI, or String value that will allow a URI to be looked up. Clears the cached resulting date time.- Parameters:
userCalendar
- A IThingID, URI, or String value that resolves a URI.- See Also:
-
isUseUserPersonalCalendar
public boolean isUseUserPersonalCalendar()Is the user's personal calendar being used for the result date time calculation verses the default corporate calendar.- Returns:
- True if the user calendar is set. False for default calendar.
-
setUseUserPersonalCalendar
public void setUseUserPersonalCalendar(boolean useUserPersonalCalendar) Use the user's personal calendar for calculation verses the default corporate calendar. Clears the cached resulting date time.- Parameters:
useUserPersonalCalendar
- True to use a personal calendar. False to use the default calendar.
-
getBaseDateTime
Get the base date time to be evaluated by the selected calendar and used to calculate the result date time.- Returns:
- The object to be use for the result date time calculations.
-
setBaseDateTime
Set the base date time to be evaluated by the selected calendar and used to calculate the result date time. Clears the cached resulting date time.- Parameters:
baseDateTime
- The object to be use for the result date time calculations.
-
getDateTimeFormat
Get the date time format used to convert a String value to a date.- Returns:
- String The String used to format parse the base date time
- See Also:
-
setDateTimeFormat
Set the date time format used to convert a String value to a date. If the method setBaseDateTime is supplied a String value then a format must be supplied before the resulting date time can be calculated. Not suppling a format will cause the calculation to throw a ParseException. Clears the cached resulting date time.- Parameters:
dateFormat
- A String to convert a date to a Date object. Example: "MM/dd/yyyy"- See Also:
-
getWorkdays
public int getWorkdays()Get work days in a week.- Returns:
- int The number of work days in a week.
-
setWorkdays
public void setWorkdays(int workdays) Set the number of work days in a week. Clears the cached resulting date time.- Parameters:
workdays
- The work days in a week
-
getWorkhours
public int getWorkhours()Get work hours for a day.- Returns:
- The number of hours in a work day.
-
setWorkhours
public void setWorkhours(int workhours) Set the number of work hours for a day. Clears the cached resulting date time.- Parameters:
workhours
- The number of work hours in a day.
-
getWorkminutes
public int getWorkminutes()Get the number of minutes in a work day.- Returns:
- The number of minutes in a work day.
-
setWorkminutes
public void setWorkminutes(int workminutes) Set the number of minutes in a work day. Clears the cached resulting date time.- Parameters:
workminutes
- The number of minutes in a work day
-
getBaseAdjustment
Get the adjustment setting used in the resulting day calculation.- Returns:
- The value set by setBaseAdjustment.
-
setBaseAdjustment
Adjust the base date time used in the resulting day calculation. One of the following values must be used or the adjustment is skipped.
Clears the cached resulting date time.
Valid values are:
ADJUSTMENT_CURRENT_DAY_START - adjust to the start of the base date.
ADJUSTMENT_CURRENT_DAY_END - adjust to the end of the base date.
ADJUSTMENT_NEXT_DAY_START - adjust to the start of the day after the base date.
ADJUSTMENT_NEXT_DAY_END - adjust to the end of the day after the base date.
Null or any other value - skip adjustment.
- Parameters:
baseAdjustment
- The setting to adjust the base time.
-
getCalendarByID
- Throws:
CalendarException
-
getCalendarEvaluatorBaseDate
Get the base date time as a date. If the base date is not set by a Date object or getResultDateTime method has not been called this method will throw an exception.- Returns:
- A Date object for base date time.
- Throws:
Exception
-