public final class Utilities extends Object implements SignupBeanConstants, org.sakaiproject.signup.model.MeetingTypes
This Utility class provides the common used logic by Signup tool.
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
logger |
static String |
MESSAGE_UIBEAN
Defined a constant name for ,essageUIBean
|
static org.sakaiproject.util.ResourceLoader |
rb
Get the resource bundle for messages.properties file
|
static org.sakaiproject.util.ResourceLoader |
rbConf
Get the resource bundle for signupConfig.properties file
|
ADD_MEETING_PAGE_URL, ADD_MEETING_STEP1_PAGE_URL, ADD_MEETING_STEP2_PAGE_URL, ALL_FUTURE, ATTACH_COPY, ATTACH_MODIFY, ATTACH_RECURRING, ATTACH_TEMP, ATTENDANCE_PAGE_URL, ATTENDEE_ADD_COMMENT_PAGE_URL, ATTENDEE_MEETING_PAGE_URL, ATTENDEE_USER_ID, CANCEL_ADD_MEETING_PAGE_URL, CATERGORY_FILER_ALL, COPTY_MEETING_PAGE_URL, CUSTOM_DEFINED_TIMESLOT_PAGE_URL, DATA_VERSION, dataRefreshInterval, DAY_IN_MILLISEC, DAY_IN_MINUTES, DAYS, FULL_DATA_BOTH_VERSION, FULL_VERSION, HALF_YEAR, Hour_In_MINUTES, HOURS, MAIN_EVENTS_LIST_PAGE_URL, MAX_NUM_PARTICIPANTS_FOR_DROPDOWN_BEFORE_AUTO_SWITCH_TO_EID_INPUT_MODE, MAX_NUMBER_OF_RETRY, MINUTE_IN_MILLISEC, MINUTES, MODIFY_MEETING_PAGE_URL, MOVE_ACTION, NINTY_DAYS, OLD_DAYS, ON_BOTTOM_LIST, ON_TOP_LIST, onceOnly, ORGANIZER_MEETING_PAGE_URL, perBiweek, perDay, perWeek, PRE_ASSIGN_ATTENDEE_PAGE_URL, REPLACE_ACTION, SHORT_VERSION, SIXTY_DAYS, START_NOW, SWAP_ACTION, THIRTY_DAYS, VIEW_ALL, VIEW_COMMENT_PAGE_URL, VIEW_IMMEDIATE_AVAIL, VIEW_MY_SIGNED_UP| Constructor and Description |
|---|
Utilities() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addErrorMessage(String errorMsg)
Add the error message to mssageUIBean for UI purpose.
|
static void |
addInfoMessage(String infoMsg)
Add the info message to messageUIBean for UI purpose.
|
static List<SelectItem> |
getMeetingTypeSelectItems(String mSelectedType,
boolean disableNotSelectedOnes)
It provides a list of meeting type choices for user.
|
static int |
getRelativeTimeValue(String timeScaleType,
long timeLength)
Get the relative time value according to the time unit type.
|
static String |
getRequestParam(String attrName)
This method will retrieve the value from Request object by the Request
parameter/attribute name
|
static String |
getSelectedCoordinators(List<org.sakaiproject.signup.logic.SignupUser> coordinators,
String organizerId)
Turn list of signup users into list of ids for storage into db.
|
static boolean |
getSignupConfigParamVal(String paramname,
boolean defaultValue)
Gets a boolean value for a configuration, instead of a string value.
|
static String |
getSignupConfigParamVal(String paramName,
String defaultValue) |
static SignupMeetingsBean |
getSignupMeetingsBean()
Get the SignupMeetingsBean in JSF as a session bean
|
static String |
getTimeScaleType(long timeLength)
Get the Signup tool defined time unit type.
|
static Date |
getUserDefinedDate(int days)
This method will convert int days to a Date object
|
static boolean |
isDataIntegritySafe(boolean isUserDefinedTS,
String callerBeanType,
UserDefineTimeslotBean uBean) |
static void |
postEventTracking(String mainSignupEventType,
String eventActionInfo)
This method will post user action event to DB by using
Sakai-event-tracking mechanism.
|
static Date |
reAllocateTimeslots(Date startTime,
int timeSlotDuration,
int numOfTimeslot,
List<org.sakaiproject.signup.model.SignupTimeslot> tsList)
Relocate the timeslots in the event/meeting around according to the new
data.
|
static void |
resetMeetingList()
Reset the meetings in the SignupMeetingsBean to null so we will fetch all
the up-to-date meeting data again
|
static String |
retrieveAvailStatus(org.sakaiproject.signup.model.SignupMeeting meeting,
String currentUserId,
org.sakaiproject.signup.logic.SakaiFacade sakaiFacade)
It will obtain user current sign-up status in an event.
|
static Date |
subTractTimeToDate(Date date,
int time,
String dateType)
Calculate the time according to the input parameters.
|
static boolean |
testSignupBeginStartNowType(List<org.sakaiproject.signup.model.SignupMeeting> recurringMeetings)
This method will determine whether the recurring events have been previously setup by 'Start_Now'
type.
|
public static org.sakaiproject.util.ResourceLoader rb
public static org.sakaiproject.util.ResourceLoader rbConf
public static final String MESSAGE_UIBEAN
protected static org.apache.commons.logging.Log logger
public static void addErrorMessage(String errorMsg)
errorMsg - a error message string.public static void addInfoMessage(String infoMsg)
infoMsg - an info message string.public static String getRequestParam(String attrName)
attrName - a string valuepublic static void resetMeetingList()
public static SignupMeetingsBean getSignupMeetingsBean()
public static Date reAllocateTimeslots(Date startTime, int timeSlotDuration, int numOfTimeslot, List<org.sakaiproject.signup.model.SignupTimeslot> tsList)
startTime - a Date object.timeSlotDuration - an int value, which indicate the length of the time slot.numOfTimeslot - an int value, which indicate how many time slots are there.tsList - a list of SignupTimeslot objects. This object is a reference
object and after this call, it will hold the relocated new
data.public static Date subTractTimeToDate(Date date, int time, String dateType)
date - a Date object.time - an int value.dateType - a string value.public static String getTimeScaleType(long timeLength)
timeLength - a long value.public static int getRelativeTimeValue(String timeScaleType, long timeLength)
timeScaleType - a string value.timeLength - a long valuepublic static boolean testSignupBeginStartNowType(List<org.sakaiproject.signup.model.SignupMeeting> recurringMeetings)
recurringMeetings - a list of SignupMeeting objects.public static List<SelectItem> getMeetingTypeSelectItems(String mSelectedType, boolean disableNotSelectedOnes)
mSelectedType - a String value, which indicates that the passed-in meeting
type will not disabled.disableNotSelectedOnes - a boolean value which indicate whether to disable other
meeting types except this one.public static void postEventTracking(String mainSignupEventType, String eventActionInfo)
mainSignupEventType - a sign-up event type stringeventActionInfo - a detailed action info stringpublic static String retrieveAvailStatus(org.sakaiproject.signup.model.SignupMeeting meeting, String currentUserId, org.sakaiproject.signup.logic.SakaiFacade sakaiFacade)
meeting - a SignupMeeting objectcurrentUserId - a unique user internal id.sakaiFacade - a SakaiFacade objectpublic static Date getUserDefinedDate(int days)
days - it indicates how many days from current time into the futurepublic static String getSignupConfigParamVal(String paramName, String defaultValue)
public static boolean getSignupConfigParamVal(String paramname, boolean defaultValue)
paramname - the name of the config parameterdefaultValue - the default boolean value to usetrue if and only if the config parameter is "true".public static boolean isDataIntegritySafe(boolean isUserDefinedTS,
String callerBeanType,
UserDefineTimeslotBean uBean)
public static String getSelectedCoordinators(List<org.sakaiproject.signup.logic.SignupUser> coordinators, String organizerId)
coordinators - organizerId - Copyright © 2007-2015 Sakai Project. All Rights Reserved.