RecurringScheduleService.java
RecurringScheduleService.java
This file is the java class
RecurringScheduleService
, which contains the public java interface for the Recurring Schedules module. The following are the public methods in the class that are available for external use:
Method | Description |
---|---|
List<Date> RecurringScheduleService.getDatesList(Date startDate, Date endDate, String ruleStr) |
Generates and returns the XML string representation of the current recurrence schedule pattern displayed in the User Interface (UI). Store this string in any text field (minimum size of 96 characters) in any table that you wish. Do not parse or modify this string, as the format is internal to the Recurrence Schedules toolkit and subject to change.
This method returns a list of all the dates between
You must first create a new instance of the
final RecurringScheduleService recurringService = new RecurringScheduleService();
Note:
|
RecurringScheduleService. setRecurringSchedulePattern(Date startDate, Date endDate, String ruleStr) | This method just sets up the recurring schedule pattern without calculating any dates. This gives you an opportunity to call other methods that retrieve information about the pattern, without having to compute any dates. |
List<Date> RecurringScheduleService.getDatesList() |
This method performs the same function as getDatesList(startDate, endDate, ruleStr) above, except it is meant to be called after you have used setRecurringSchedulePattern to set the pattern and the dates. For example:
final RecurringScheduleService recurringService = new RecurringScheduleService();
|
String RecurringScheduleService.getRecurringRuleDescription (String ruleStr) | Returns a localized readable description of the recurring pattern encoded in XML in ruleStr. |
String RecurringScheduleService.getRecurringRuleDescription () |
Returns a localized readable description of the recurring pattern already set in the class. This method is meant to be called after you have used setRecurringSchedulePattern to set the pattern and the dates. For example:
final RecurringScheduleService recurringService = new RecurringScheduleService();
|
RecurringScheduleService.setSchedulingLimits(int dayVal, int weekVal, int monthVal, int yearVal) | Sets the scheduling limit in years for each recurring type. This only applies to a specific recurring schedule (i.e. class instance). A value of (-1) indicates no limit. However, the date generation code still enforces a limit of 999 maximum occurrences for all recurring types, regardless of the scheduling limit values set or the End Date. If you do not set any limits, the default limits in the application parameter AbCommonResources-RecurringSchedulingLimits are used. If the application parameter does not exist, then the default limits of 5, 5, 5, 10 years are used. |
static String getRecurrenceXMLPattern(String recurringType, int interval, int totalOccurrences, String daysOfWeek, int dayOfMonth, int weekOfMonth, int monthOfYear) |
Constructs and returns an XML recurring schedule pattern string from the given parameters:
|
String RecurringScheduleService.getRecurringType() | Returns the recurrence type, using the same format as specified for the recurringType parameter in the getRecurrenceXMLPattern method. |
String RecurringScheduleService.getInterval() | Returns the recurrence interval, using the same format as specified for the interval parameter in the getRecurrenceXMLPattern method. |
String RecurringScheduleService.getTotal() | Returns the maximum number of occurrences, using the same format as specified for the totalOccurrences parameter in the getRecurrenceXMLPattern method. |
String RecurringScheduleService.getDaysOfWeek() | Returns the day(s) of the week, using the same format as specified for the daysOfWeek parameter in the getRecurrenceXMLPattern method. |
String RecurringScheduleService.getDayOfMonth() |
Returns the day of the month, using the same format as specified for the dayOfMonth parameter in the getRecurrenceXMLPattern method. |
String RecurringScheduleService.getWeekOfMonth() | Returns the week of the month, using the same format as specified for the weekOfMonth parameter in the getRecurrenceXMLPattern method. |
String RecurringScheduleService.getMonthOfYear() | Returns the month of the year, using the same format as specified for the monthOfYear parameter in the getRecurrenceXMLPattern method. |
Application Parameter
AbCommonResources-RecurringSchedulingLimits |
This application parameter stores the default scheduling limit in years for each recurring type. A value of (-1) indicates no limit. However, the date generation code still enforces a limit of 999 maximum occurrences for all recurring types, regardless of the scheduling limit values set or the End Date. The application parameter string value has the following format: “day;5;week;5;month;5;year;10” The recurrence type and limit value pairs can be in any order, and you can omit a type;value pair for any recurrence type. For example: “year;20;day;2” will change the default limits for yearly and daily patterns, but will leave the limits for weekly and monthly patterns at the built-in default of 5 years. |