|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.plugins.calendar.service.Utils
public final class Utils
This class provides utils features to manipulate and convert calendars, date as string, ...
| Method Summary | |
|---|---|
static boolean |
checkTime(String strTime)
Return a boolean: if the time is well formed return true, else return false |
static List<AgendaResource> |
getAgendaResourcesWithEvents()
Get the multi agenda from database |
static List<AgendaResource> |
getAgendaResourcesWithOccurrences()
Get the multi agenda from database |
static List<AgendaResource> |
getAgendaResourcesWithOccurrences(javax.servlet.http.HttpServletRequest request)
Get all agendas from database checkin the security |
static List<AgendaResource> |
getAgendaResourcesWithOccurrencesIds()
Get the multi agenda from database with occurrences ordered by id |
static Agenda |
getAgendaWithEvents(String strAgenda,
javax.servlet.http.HttpServletRequest request)
Get a specified agenda from database with events |
static Agenda |
getAgendaWithOccurrences(String strAgenda,
javax.servlet.http.HttpServletRequest request)
Get a specified agenda from database with occurrences |
static Agenda |
getAgendaWithOccurrencesOrderedbyId(String strAgenda,
javax.servlet.http.HttpServletRequest request)
Get a specified agenda from database with occurrences |
static String[] |
getCalendarIds(javax.servlet.http.HttpServletRequest request)
Get all calendar ids that the user is authorized to visualize |
static String |
getDate(Calendar calendar)
Constructs a 8 digits date string YYYYMMDD |
static String |
getDate(Date dateDigit)
Constructs a digit string from a date object |
static String |
getDate(int nYear,
int nMonth,
int nDay)
Constructs a 8 digits date string code YYYYMMDD |
static Date |
getDate(String strDate)
Constructs a Date object from YYYYMMDD |
static Date |
getDateForward(Date dateDay,
int nPeriodicity,
int nOccurrence,
String[] arrayExcludedDays)
Returns a date code corresponding to a calendar roll of n days forward |
static String |
getDateToday()
Returns a the date code of today |
static int |
getDay(String strDate)
Returns the day of month from a date code |
static Date |
getDayAfter(Date dateDayAfter,
int n)
Returns a date code corresponding to a calendar roll of n days forward |
static String |
getDayAfter(String strDate,
int n)
Returns a date code corresponding to a calendar roll of n days forward |
static String |
getDayLabel(String strDate,
Locale locale)
Returns the day as an international formatted string corresponding to the date code |
static int |
getDayOfWeek(String strDate)
Get the day of week of a given date using the pattern DATE_PATTERN |
static Calendar |
getFirstDayOfWeek(String strDate)
Returns the first monday of a week as a formatted string corresponding to the date code |
static int |
getMonth(String strDate)
Returns the month from a date code |
static String |
getMonthLabel(String strDate,
Locale locale)
Returns the month as a formatted string corresponding to the date code |
static String |
getNextDay(String strDate)
Returns a date code corresponding to a calendar roll of one day forward |
static String |
getNextMonth(String strDate)
Returns a date code corresponding to a calendar roll of one month |
static String |
getNextMonth(String strDateRef,
int nCptDate)
Returns a date code corresponding to a calendar roll of one month |
static String |
getNextWeek(String strDate)
Returns a date code corresponding to a calendar roll of one week forward |
static int |
getOccurrenceWithinTwoDates(Date dateStart,
Date dateEnd,
String[] arrayExcludedDays)
Returns a date code corresponding to a calendar roll of one month |
static String |
getPreviousDay(String strDate)
Returns a date code corresponding to a calendar roll of one day backward |
static String |
getPreviousMonth(String strDate)
Returns a date code corresponding to a calendar roll of one month backward |
static String |
getPreviousWeek(String strDate)
Returns a date code corresponding to a calendar roll of one week backward |
static String |
getWeekDayLabel(String strDate,
Locale locale)
Returns the day as an international formatted string corresponding to the date code |
static String |
getWeekLabel(String strDate,
Locale locale)
Returns the Week as a formatted string corresponding to the date code |
static int |
getYear(String strDate)
Returns the year from a date code |
static boolean |
isDayExcluded(int nDayOfWeek,
String[] arrayExcludedDays)
Check if a day is in the list of excluded days |
static boolean |
isDayOff(Calendar calendar)
Checks if the day if Off (ie: Sunday) or not |
static boolean |
isValid(String strDate)
Checks a date code |
static boolean |
isValidDate(Date dateEvent)
Checks a date code |
static void |
loadAgendaEvents(AgendaResource agenda,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return the agenda |
static void |
loadAgendaOccurrences(AgendaResource agenda,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return the agenda |
static void |
loadAgendaOccurrencesOrderedById(AgendaResource agenda,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return the occurrences of an agenda ordered by id |
static String |
parseHtmlToPlainTextString(String strHTML)
Parse a HTML string into plain text |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String getDate(int nYear,
int nMonth,
int nDay)
nYear - The YearnMonth - The month index (0-11)nDay - The day of the month (1-31)
public static String getDate(Calendar calendar)
calendar - A calendar positionned on the date
public static String getDateToday()
public static int getYear(String strDate)
strDate - The date code
public static int getMonth(String strDate)
strDate - The date code
public static int getDay(String strDate)
strDate - The date code
public static String getMonthLabel(String strDate,
Locale locale)
locale - The locale used for display settingsstrDate - The date code
public static String getWeekLabel(String strDate,
Locale locale)
locale - The locale used for display settingsstrDate - The date code
public static Calendar getFirstDayOfWeek(String strDate)
strDate - The date code
public static String getDayLabel(String strDate,
Locale locale)
locale - The locale used for display settingsstrDate - The date code
public static String getWeekDayLabel(String strDate,
Locale locale)
locale - The locale used for display settingsstrDate - The date code
public static String getNextMonth(String strDate)
strDate - The date code
public static String getPreviousMonth(String strDate)
strDate - The date code
public static String getPreviousWeek(String strDate)
strDate - The date code
public static String getNextWeek(String strDate)
strDate - The date code
public static String getNextDay(String strDate)
strDate - The date code
public static String getPreviousDay(String strDate)
strDate - The date code
public static boolean isValid(String strDate)
strDate - The date code
public static boolean isDayOff(Calendar calendar)
calendar - A calendar object positionned on the day to check
public static boolean checkTime(String strTime)
strTime - The time
public static String getDayAfter(String strDate,
int n)
n - number of days to rollstrDate - The date code
public static Date getDayAfter(Date dateDayAfter,
int n)
n - number of days to rolldateDayAfter - The date
public static Date getDateForward(Date dateDay,
int nPeriodicity,
int nOccurrence,
String[] arrayExcludedDays)
dateDay - the reference datenPeriodicity - the frequence of an occurrence day, week, monthnOccurrence - the number of occurrencesarrayExcludedDays - list of excluded days
public static Date getDate(String strDate)
strDate - a 8 digits date string YYYYMMDD
public static String getDate(Date dateDigit)
dateDigit - The date code
public static String getNextMonth(String strDateRef,
int nCptDate)
strDateRef - The date referencenCptDate - The number of month to add
public static int getOccurrenceWithinTwoDates(Date dateStart,
Date dateEnd,
String[] arrayExcludedDays)
dateStart - The date startdateEnd - The date endarrayExcludedDays - list of excluded days
public static Agenda getAgendaWithEvents(String strAgenda,
javax.servlet.http.HttpServletRequest request)
strAgenda - The name of the agenda to getrequest - The HTTP request
public static Agenda getAgendaWithOccurrences(String strAgenda,
javax.servlet.http.HttpServletRequest request)
strAgenda - The agenda to getrequest - The HTTP request
public static Agenda getAgendaWithOccurrencesOrderedbyId(String strAgenda,
javax.servlet.http.HttpServletRequest request)
strAgenda - The agenda to getrequest - The HTTP request
public static List<AgendaResource> getAgendaResourcesWithOccurrences(javax.servlet.http.HttpServletRequest request)
request - The request
public static List<AgendaResource> getAgendaResourcesWithOccurrences()
public static List<AgendaResource> getAgendaResourcesWithEvents()
public static List<AgendaResource> getAgendaResourcesWithOccurrencesIds()
public static void loadAgendaOccurrences(AgendaResource agenda,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
agenda - The agendaplugin - The plugin
public static void loadAgendaOccurrencesOrderedById(AgendaResource agenda,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
agenda - The agendaplugin - The plugin
public static void loadAgendaEvents(AgendaResource agenda,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
agenda - The agendaplugin - The pluginpublic static boolean isValidDate(Date dateEvent)
dateEvent - The date code
public static String parseHtmlToPlainTextString(String strHTML)
strHTML - The HTMl to parse
public static String[] getCalendarIds(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequest
public static int getDayOfWeek(String strDate)
DATE_PATTERN
strDate - The date to parse
public static boolean isDayExcluded(int nDayOfWeek,
String[] arrayExcludedDays)
nDayOfWeek - the day to checkarrayExcludedDays - the array of excluded days
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||