|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.arsdigita.acs.calendar.CalendarProcs
This is the first pass at the Java version of the Calendar package. Right now, this is pretty much a straight port. Near term future plans:
Constructor Summary | |
CalendarProcs()
|
Method Summary | |
static String[] |
buildWeekMap(String forDate,
String dayDateTarget,
String dayDateHREFAppend,
Integer groupId,
boolean noLinkForCurrentDate)
Assigns days to days of the week in a given month. |
static String |
calendarDayView(CalendarInfo calendarInfo,
String currentDate,
Integer loggedInUserId,
Integer groupId,
String compressDayViewP,
Integer beginCalHour,
Integer endCalHour)
Generates the HTML for a day view. |
static String |
calendarDayView(CalendarInfo calendarInfo,
String currentDate,
Integer loggedInUserId,
Integer groupId,
String compressDayViewP,
Integer beginCalHour,
Integer endCalHour,
String viewMode)
|
static String |
calendarDayView(CalendarInfo calendarInfo,
String currentDate,
Integer loggedInUserId,
Integer groupId,
String compressDayViewP,
Integer beginCalHour,
Integer endCalHour,
String viewMode,
String addLink)
|
static Integer |
calendarFolderId(Integer userId,
Integer groupId)
Gets id of calendar's file-storage folder for specified group. |
static String |
calendarMonthEmptyDays(CalendarInfo calendarInfo,
String month,
Vector monthList,
int baseJulianDate,
int startJulianDate,
int endJulianDate)
Generate HTML for calendar month days containing no items. |
static String |
calendarViewTitle(HttpServletRequest request)
Returns view title bar (a small table with title & left & right linked arrows). |
static String |
calendarWeekEmptyDays(CalendarInfo calendarInfo,
Vector weekDays,
int baseJulianDate,
int startJulianDate,
int endJulianDate)
Generate HTML for calendar week days containing no items. |
static String |
calMiniCalendarWidget(String baseURL)
|
static String |
calMiniCalendarWidget(String baseURL,
String currentView)
|
static String |
calMiniCalendarWidget(String baseURL,
String currentView,
String currentDate)
|
static String |
calMiniCalendarWidget(String baseURL,
String currentView,
String currentDate,
Integer groupId)
This proc creates a mini calendar useful for navigating various calendar views. |
static String |
calMiniMonthCalendar(String currentYear,
String month)
|
static String |
calMiniMonthCalendar(String currentYear,
String month,
Integer groupId)
|
static String |
calMiniMonthCalendar(String currentYear,
String month,
Integer groupId,
String viewMode)
This proc creates a mini month calendar useful for navigating on a month calendar. |
static String |
calPrettyCurrentDate(String current_date,
Database db)
Yet another pretty date function. |
static String |
calRelatedURLHtml(String title,
String name,
String url,
String text)
Builds HREF string for related URLs. |
static String |
calYearCalendar(Integer groupId,
String viewMode,
String currentYear,
String currentDate)
Generates the HTML for 12 mini calendar widgets, 3 across and 4 down. |
static String |
displayMonthItem(CalendarInfo calendarInfo,
String startDate)
Displays calendar items for a particular day of the month for user or group. |
static String |
displayNew(CalendarInfo calendarInfo,
Integer newItemsAge)
|
static String |
displayNew(CalendarInfo calendarInfo,
Integer newItemsAge,
String orderBy)
Display items added in the last new_items_age days. |
static String |
displayUpcoming(CalendarInfo calendarInfo,
Integer upcomingItemsDays,
Integer pastItemsDays,
String upcomingItemsLength,
String orderby)
Displays list of calendar items for the next upcoming_items_days and in to the past for past_items_day. |
static String |
formatDateTimeString(String value,
String granularity)
|
static String |
formatDateTimeString(String value,
String granularity,
boolean useAmPm)
|
static String |
formatDateTimeString(String value,
String granularity,
boolean useAmPm,
boolean showDate)
|
static String |
formatDateTimeString(String value,
String granularity,
boolean useAmPm,
boolean showDate,
String dateTimeSep)
Formats date/time See description of getWidgetDatetime |
static String |
getCategoriesWidget()
|
static String |
getCategoriesWidget(String scope,
Integer id)
|
static String |
getCategoriesWidget(String scope,
Integer id,
Vector defaultCategoryIdList)
|
static String |
getCategoriesWidget(String scope,
Integer id,
Vector defaultCategoryIdList,
String defaultReturn)
|
static String |
getCategoriesWidget(String scope,
Integer id,
Vector defaultCategoryIdList,
String defaultReturn,
int selectSize)
|
static String |
getCategoriesWidget(String scope,
Integer id,
Vector defaultCategoryIdList,
String defaultReturn,
int selectSize,
String varName)
|
static String |
getLeadingZeros(Integer number,
int nDesiredDigits)
Adds leading zeros to a String to give it the desired number of digits. |
static String |
getLeadingZeros(int number,
int nDesiredDigits)
Adds leading zeros to an int to give it the desired number of digits. |
static String[] |
getMonthNames()
Non-internationalized version of calendar_util_month_names_by_locale. |
static String |
getWidgetDatetime(String name,
String value,
String granularity)
|
static String |
getWidgetDatetime(String name,
String value,
String granularity,
boolean useAmPm)
|
static String |
getWidgetDatetime(String name,
String value,
String granularity,
boolean useAmPm,
boolean showDate)
|
static String |
getWidgetDatetime(String name,
String value,
String granularity,
boolean useAmPm,
boolean showDate,
String dateTimeSep)
Yet another date/time widget! You'd think we'd have a super-duper canonical version somewhere in the ACS. |
static String |
getWidgetMaybeRange(boolean askForValue,
String name,
int startRange,
int endRange,
String defaultValue)
|
static String |
getWidgetMaybeRange(boolean askForValue,
String name,
int startRange,
int endRange,
String defaultValue,
int interval)
|
static String |
getWidgetMaybeRange(boolean askForValue,
String name,
int startRange,
int endRange,
String defaultValue,
int interval,
boolean withLeadingZeros)
|
static String |
getWidgetMaybeRange(boolean askForValue,
String name,
int startRange,
int endRange,
String defaultValue,
int interval,
boolean withLeadingZeros,
String hiddenValue)
Taken from templating system. |
static String |
getWidgetMonth(String name,
int defVal)
Builds a picklist of months of the year. |
static String |
getWidgetNumericRange(String name,
int begin,
int end)
|
static String |
getWidgetNumericRange(String name,
int begin,
int end,
String defVal)
|
static String |
getWidgetNumericRange(String name,
int begin,
int end,
String defVal,
int interval)
|
static String |
getWidgetNumericRange(String name,
int begin,
int end,
String defVal,
int interval,
boolean withLeadingZeros)
Taken (unmodified, for once!) from First Tuesday's templating system |
static CalendarInfo |
initializeCalendarParameters(HttpServletRequest request,
Integer viewedUserId,
UserInfo loggedInUser,
Integer groupId,
String currentView,
String currentDate,
String compressDayViewP,
String viewMode,
String action)
Initializes calinfo variable and populates it with information used on calendar pages. |
static Integer |
insertItem(Integer item_id,
Integer instance_id,
String title,
SqlStatement startDate,
SqlStatement endDate,
Integer user_id,
Integer group_id,
String description,
Integer creation_user_id)
same as insertItem, defaults editable_p to true. |
static Integer |
insertItem(Integer item_id,
Integer instance_id,
String title,
SqlStatement startDate,
SqlStatement endDate,
Integer user_id,
Integer group_id,
String description,
Integer creation_user_id,
Boolean editable_p)
Inserts a new calendar item into the appropriate calendar. |
static boolean |
isWriteAccessAllowed(UserInfo user,
Integer itemId)
|
static boolean |
isWriteAccessAllowed(UserInfo user,
Integer itemId,
Integer groupId)
Replaces calendar_item_write_access_p. |
static int[] |
parseDateTimeString(String dateTimeString)
Parses the passed in string into a list of year, month, day, hour, minutes, seconds. |
protected static String |
parseOracleErrorForNullConstraintViolation(String errorMessage)
This function parses an oracle error message looking for a violation of a null constraint. |
static String |
parseOracleErrorForUniqueConstraintViolation(String errorMessage)
Parses Oracle error message looking for a violation of a unique constraint. |
static int |
roundToPrecision(int number,
int precision)
Rounds the given number to the given precision. |
static String |
transformDatetime(AdSet date,
boolean truncate)
|
static String |
transformDatetime(AdSet date,
boolean truncate,
AdSet fallbackDate)
Stolen and slightly modified from templating system fallbackDate is a quick hack added to let end_date pull some of its data from start_date if date wasn't displayed. |
static String |
trimLeadingZeros(String str)
Returns a string w/ leading zeros trimmed. |
static Integer |
userCalendarFolderId(Integer userId)
Gets id of calendar's file-storage folder for specified user. |
static void |
utilAddToSQLBuffer(StringBuffer buf,
String str)
Simple stupid utility macro for building up a sequence of selects in a string. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public CalendarProcs()
Method Detail |
protected static String parseOracleErrorForNullConstraintViolation(String errorMessage)
errorMessage
- Oracle error message.public static String parseOracleErrorForUniqueConstraintViolation(String errorMessage)
errorMessage
- Oracle error message.public static String[] buildWeekMap(String forDate, String dayDateTarget, String dayDateHREFAppend, Integer groupId, boolean noLinkForCurrentDate) throws SQLException, IOException, DataSourceException
forDate
- Date to build map for.dayDateTarget
- base URL to link days to (i.e. baseURL or "").dayDateHREFAppend
- extra info to append to day link URL (i.e. &var="value" or ""). Should be URL encoded and begin with &.groupId
- group Id #, 0 if not viewing a group calendar.bool
- noLinkForCurrentDate flags if "forDate" day should not be linked.public static String calMiniCalendarWidget(String baseURL) throws SQLException, ACSException, DataSourceException, IOException
#calMiniCalendarWidget(String, String, String, int)
public static String calMiniCalendarWidget(String baseURL, String currentView) throws SQLException, ACSException, DataSourceException, IOException
#calMiniCalendarWidget(String, String, String, int)
public static String calMiniCalendarWidget(String baseURL, String currentView, String currentDate) throws SQLException, ACSException, DataSourceException, IOException
#calMiniCalendarWidget(String, String, String, int)
public static String calMiniCalendarWidget(String baseURL, String currentView, String currentDate, Integer groupId) throws SQLException, ACSException, IOException, DataSourceException
baseURL
- Base URL to which this mini calendar will navigate.currentView
- list, day, week, month, or year.currentDate
- YYYY-MM-DD format.groupId
- Non-zero if viewing group calendar, zero otherwise.public static String calMiniMonthCalendar(String currentYear, String month) throws SQLException, ACSException, DataSourceException, IOException
#calMiniMonthCalendar(String, String, int, String).
public static String calMiniMonthCalendar(String currentYear, String month, Integer groupId) throws SQLException, ACSException, DataSourceException, IOException
#calMiniMonthCalendar(String, String, int, String).
public static String calMiniMonthCalendar(String currentYear, String month, Integer groupId, String viewMode) throws SQLException, ACSException, DataSourceException, IOException
currentYear
- Year currently being displayed.month
- Month currently being displayed.groupId
- If viewing group calendar.viewMode
- "full" or "modular".public static String calYearCalendar(Integer groupId, String viewMode, String currentYear, String currentDate) throws SQLException, ACSException, IOException, DataSourceException
groupId
- Just for pass-through.viewMode
- Flag for portals to adjust the display with. Defaults to "full".currentYear
- The current year.currendDate
- Date to hilite.public static String calRelatedURLHtml(String title, String name, String url, String text)
title
- Title (only used if text is empty, then displayed before " - Name").name
- Name.url
- URL.text
- Text of link, displayed before " - Name"public static String calendarDayView(CalendarInfo calendarInfo, String currentDate, Integer loggedInUserId, Integer groupId, String compressDayViewP, Integer beginCalHour, Integer endCalHour) throws SQLException, ACSException
public static String calendarDayView(CalendarInfo calendarInfo, String currentDate, Integer loggedInUserId, Integer groupId, String compressDayViewP, Integer beginCalHour, Integer endCalHour, String viewMode) throws SQLException, ACSException
public static String calendarDayView(CalendarInfo calendarInfo, String currentDate, Integer loggedInUserId, Integer groupId, String compressDayViewP, Integer beginCalHour, Integer endCalHour, String viewMode, String addLink) throws SQLException, ACSException
public static String calendarWeekEmptyDays(CalendarInfo calendarInfo, Vector weekDays, int baseJulianDate, int startJulianDate, int endJulianDate)
public static Integer userCalendarFolderId(Integer userId) throws SQLException, ACSException
userId
- User Id.public static Integer calendarFolderId(Integer userId, Integer groupId) throws SQLException, ACSException
userId
- User Id.groupId
- Group Id (will lookup user calendar if null or 0).public static CalendarInfo initializeCalendarParameters(HttpServletRequest request, Integer viewedUserId, UserInfo loggedInUser, Integer groupId, String currentView, String currentDate, String compressDayViewP, String viewMode, String action) throws SQLException, ACSException
request
- Servlet request object, used to short circuit all this evaluation and just return the previously calculated calendarInfo object (if it exists).viewMode
- "full" or "modular": view page with the minicalendar for navigation (full) or view page in isolation.public static String calendarViewTitle(HttpServletRequest request) throws SQLException, ACSException
request
- Used for CalendarInfo object and request's db.public static String calPrettyCurrentDate(String current_date, Database db) throws SQLException, ACSException
current_date
- Date in Oracle YYYY-MM-DD format.public static String displayMonthItem(CalendarInfo calendarInfo, String startDate) throws SQLException
public static String calendarMonthEmptyDays(CalendarInfo calendarInfo, String month, Vector monthList, int baseJulianDate, int startJulianDate, int endJulianDate)
public static String displayUpcoming(CalendarInfo calendarInfo, Integer upcomingItemsDays, Integer pastItemsDays, String upcomingItemsLength, String orderby) throws SQLException
public static String displayNew(CalendarInfo calendarInfo, Integer newItemsAge) throws SQLException
public static String displayNew(CalendarInfo calendarInfo, Integer newItemsAge, String orderBy) throws SQLException
public static boolean isWriteAccessAllowed(UserInfo user, Integer itemId) throws SQLException, ACSException
public static boolean isWriteAccessAllowed(UserInfo user, Integer itemId, Integer groupId) throws SQLException, ACSException
public static String trimLeadingZeros(String str)
public static int[] parseDateTimeString(String dateTimeString)
public static void utilAddToSQLBuffer(StringBuffer buf, String str)
public static String getWidgetDatetime(String name, String value, String granularity) throws SQLException, ACSException
public static String getWidgetDatetime(String name, String value, String granularity, boolean useAmPm) throws SQLException, ACSException
public static String getWidgetDatetime(String name, String value, String granularity, boolean useAmPm, boolean showDate) throws SQLException, ACSException
public static String getWidgetDatetime(String name, String value, String granularity, boolean useAmPm, boolean showDate, String dateTimeSep) throws SQLException, ACSException
public static int roundToPrecision(int number, int precision)
public static String getWidgetMonth(String name, int defVal) throws SQLException, ACSException
public static String[] getMonthNames() throws SQLException, ACSException
public static String getWidgetMaybeRange(boolean askForValue, String name, int startRange, int endRange, String defaultValue)
public static String getWidgetMaybeRange(boolean askForValue, String name, int startRange, int endRange, String defaultValue, int interval)
public static String getWidgetMaybeRange(boolean askForValue, String name, int startRange, int endRange, String defaultValue, int interval, boolean withLeadingZeros)
public static String getWidgetMaybeRange(boolean askForValue, String name, int startRange, int endRange, String defaultValue, int interval, boolean withLeadingZeros, String hiddenValue)
public static String getWidgetNumericRange(String name, int begin, int end)
public static String getWidgetNumericRange(String name, int begin, int end, String defVal)
public static String getWidgetNumericRange(String name, int begin, int end, String defVal, int interval)
public static String getWidgetNumericRange(String name, int begin, int end, String defVal, int interval, boolean withLeadingZeros)
public static String getLeadingZeros(int number, int nDesiredDigits)
public static String getLeadingZeros(Integer number, int nDesiredDigits)
public static String formatDateTimeString(String value, String granularity) throws SQLException, ACSException
public static String formatDateTimeString(String value, String granularity, boolean useAmPm) throws SQLException, ACSException
public static String formatDateTimeString(String value, String granularity, boolean useAmPm, boolean showDate) throws SQLException, ACSException
public static String formatDateTimeString(String value, String granularity, boolean useAmPm, boolean showDate, String dateTimeSep) throws SQLException, ACSException
getWidgetDatetime(java.lang.String, java.lang.String, java.lang.String)
public static String getCategoriesWidget() throws SQLException, ACSException
public static String getCategoriesWidget(String scope, Integer id) throws SQLException, ACSException
public static String getCategoriesWidget(String scope, Integer id, Vector defaultCategoryIdList) throws SQLException, ACSException
public static String getCategoriesWidget(String scope, Integer id, Vector defaultCategoryIdList, String defaultReturn) throws SQLException, ACSException
public static String getCategoriesWidget(String scope, Integer id, Vector defaultCategoryIdList, String defaultReturn, int selectSize) throws SQLException, ACSException
public static String getCategoriesWidget(String scope, Integer id, Vector defaultCategoryIdList, String defaultReturn, int selectSize, String varName) throws SQLException, ACSException
public static String transformDatetime(AdSet date, boolean truncate) throws ACSException
public static String transformDatetime(AdSet date, boolean truncate, AdSet fallbackDate) throws ACSException
public static Integer insertItem(Integer item_id, Integer instance_id, String title, SqlStatement startDate, SqlStatement endDate, Integer user_id, Integer group_id, String description, Integer creation_user_id) throws SQLException, ACSException
public static Integer insertItem(Integer item_id, Integer instance_id, String title, SqlStatement startDate, SqlStatement endDate, Integer user_id, Integer group_id, String description, Integer creation_user_id, Boolean editable_p) throws SQLException, ACSException
-item_id
- and @param -instance_id support passing in an item_id
and instance_id for double-click protection. If @param -item_id
isn't passed in, then both will be generated. Specifying @param -item_id
without @param -instance_id is an error.-title
- -start_date_sql
- and @param -end_date_sql are used to directly
specify the start_date and end_date to be inserted into the DB. These
parameters override the following parameters.
These parameters are used to calculate start_date and end_date based on a
combination of date, time and duration:-date
- assumes 'YYYY-MM-DD'.-start_time
- and @param -end_time assume 'HH24:MI'. If-start_time
- is not specified, then a No Time item will be created
and the value of @param -end_time will be ignored.
If @param -end_time is not specified, then the value of @param -duration will
be used.
At a bare minimum, either @param -start_date_sql or @param -date must be
specified.-user_id
- indicates a personal item.-group_id
- indicates a group item.
Specifying neither or both is currently undefined but will not cause an
error.-description
- -html_p
- indicates whether or not description has html tags;
default is 'f'-related_url
- if not specified, then no link will appear in the
item details.-related_url_text
- if not specified, then the value of -related_url
will be displayed as the link text.-related_url_p
- if 'f' then @param title will be displayed for the item
on the various views as a link to details about the items.related_url
- and @param related_url_text will be used to display a
link on the details page.
if 't' then @param related_url and @param related_url_text will be used to
form the link that appears in the various views.
The default is 'f'.-creation_user
- is required. Generally it will be the logged in user.-on_what_id
- and @param -on_which_table throws an error if one but
not both are specified. If both are specified, then a row will be added
to the mapping table.-editable_p
- indicates whether or not the item can be edited by
anyone or only deleted.
Throws error if insert fails.
Returns instance_id (from whence item_id can be derived) on success.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |