|
||||||||||
| 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, ...
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | |
|---|---|
static boolean |
checkTime(java.lang.String strTime)
Return a boolean: if the time is well formed return true, else return false |
static java.util.List<AgendaResource> |
getAgendaResourcesWithEvents()
Get the multi agenda from database |
static java.util.List<AgendaResource> |
getAgendaResourcesWithOccurrences()
Get the multi agenda from database |
static java.util.List<AgendaResource> |
getAgendaResourcesWithOccurrences(javax.servlet.http.HttpServletRequest request)
Get all agendas from database checkin the security |
static java.util.List<AgendaResource> |
getAgendaResourcesWithOccurrencesIds()
Get the multi agenda from database with occurrences ordered by id |
static Agenda |
getAgendaWithEvents(java.lang.String strAgenda,
javax.servlet.http.HttpServletRequest request)
Get a specified agenda from database with events |
static Agenda |
getAgendaWithOccurrences(java.lang.String strAgenda,
javax.servlet.http.HttpServletRequest request)
Get a specified agenda from database with occurrences |
static Agenda |
getAgendaWithOccurrencesOrderedbyId(java.lang.String strAgenda,
javax.servlet.http.HttpServletRequest request)
Get a specified agenda from database with occurrences |
static java.lang.String |
getDate(java.util.Calendar calendar)
Constructs a 8 digits date string YYYYMMDD |
static java.lang.String |
getDate(java.util.Date dateDigit)
Constructs a digit string from a date object |
static java.lang.String |
getDate(int nYear,
int nMonth,
int nDay)
Constructs a 8 digits date string code YYYYMMDD |
static java.util.Date |
getDate(java.lang.String strDate)
Constructs a Date object from YYYYMMDD |
static java.util.Date |
getDateForward(java.util.Date dateDay,
int nPeriodicity,
int nOccurrence)
Returns a date code corresponding to a calendar roll of n days forward |
static java.lang.String |
getDateToday()
Returns a the date code of today |
static int |
getDay(java.lang.String strDate)
Returns the day of month from a date code |
static java.util.Date |
getDayAfter(java.util.Date dateDayAfter,
int n)
Returns a date code corresponding to a calendar roll of n days forward |
static java.lang.String |
getDayAfter(java.lang.String strDate,
int n)
Returns a date code corresponding to a calendar roll of n days forward |
static java.lang.String |
getDayLabel(java.lang.String strDate,
java.util.Locale locale)
Returns the day as an international formatted string corresponding to the date code |
static java.util.Calendar |
getFirstDayOfWeek(java.lang.String strDate)
Returns the first monday of a week as a formatted string corresponding to the date code |
static int |
getMonth(java.lang.String strDate)
Returns the month from a date code |
static java.lang.String |
getMonthLabel(java.lang.String strDate,
java.util.Locale locale)
Returns the month as a formatted string corresponding to the date code |
static java.lang.String |
getNextDay(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one day forward |
static java.lang.String |
getNextMonth(java.lang.String strDate)
|
static java.lang.String |
getNextMonth(java.lang.String strDateRef,
int nCptDate)
Returns a date code corresponding to a calendar roll of one month |
static java.lang.String |
getNextWeek(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one week forward |
static int |
getOccurrenceWithinTwoDates(java.util.Date dateStart,
java.util.Date dateEnd)
Returns a date code corresponding to a calendar roll of one month |
static java.lang.String |
getPreviousDay(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one day backward |
static java.lang.String |
getPreviousMonth(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one month backward |
static java.lang.String |
getPreviousWeek(java.lang.String strDate)
Returns a date code corresponding to a calendar roll of one week backward |
static java.lang.String |
getWeekDayLabel(java.lang.String strDate,
java.util.Locale locale)
Returns the day as an international formatted string corresponding to the date code |
static java.lang.String |
getWeekLabel(java.lang.String strDate,
java.util.Locale locale)
Returns the Week as a formatted string corresponding to the date code |
static int |
getYear(java.lang.String strDate)
Returns the year from a date code |
static boolean |
isDayOff(java.util.Calendar calendar)
Checks if the day if Off (ie: Sunday) or not |
static boolean |
isValid(java.lang.String strDate)
Checks a date code |
static boolean |
isValidDate(java.util.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 java.lang.String |
ParseHtmlToPlainTextString(java.lang.String strHTML)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static java.lang.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 java.lang.String getDate(java.util.Calendar calendar)
calendar - A calendar positionned on the date
public static java.lang.String getDateToday()
public static int getYear(java.lang.String strDate)
strDate - The date code
public static int getMonth(java.lang.String strDate)
strDate - The date code
public static int getDay(java.lang.String strDate)
strDate - The date code
public static java.lang.String getMonthLabel(java.lang.String strDate,
java.util.Locale locale)
locale - The locale used for display settingsstrDate - The date code
public static java.lang.String getWeekLabel(java.lang.String strDate,
java.util.Locale locale)
locale - The locale used for display settingsstrDate - The date code
public static java.util.Calendar getFirstDayOfWeek(java.lang.String strDate)
strDate - The date code
public static java.lang.String getDayLabel(java.lang.String strDate,
java.util.Locale locale)
locale - The locale used for display settingsstrDate - The date code
public static java.lang.String getWeekDayLabel(java.lang.String strDate,
java.util.Locale locale)
locale - The locale used for display settingsstrDate - The date code
public static java.lang.String getNextMonth(java.lang.String strDate)
strDate -
public static java.lang.String getPreviousMonth(java.lang.String strDate)
strDate - The date code
public static java.lang.String getPreviousWeek(java.lang.String strDate)
strDate - The date code
public static java.lang.String getNextWeek(java.lang.String strDate)
strDate - The date code
public static java.lang.String getNextDay(java.lang.String strDate)
strDate - The date code
public static java.lang.String getPreviousDay(java.lang.String strDate)
strDate - The date code
public static boolean isValid(java.lang.String strDate)
strDate - The date code
public static boolean isDayOff(java.util.Calendar calendar)
calendar - A calendar object positionned on the day to check
public static boolean checkTime(java.lang.String strTime)
strTime - The time
public static java.lang.String getDayAfter(java.lang.String strDate,
int n)
n - number of days to rollstrDate - The date code
public static java.util.Date getDayAfter(java.util.Date dateDayAfter,
int n)
n - number of days to rolldateDayAfter - The date
public static java.util.Date getDateForward(java.util.Date dateDay,
int nPeriodicity,
int nOccurrence)
dateDay - the reference dateperiodicity - the frequence of an occurrence day, week, monthoccurrence -
public static java.util.Date getDate(java.lang.String strDate)
strDate - a 8 digits date string YYYYMMDD
public static java.lang.String getDate(java.util.Date dateDigit)
The - date code
public static java.lang.String getNextMonth(java.lang.String strDateRef,
int nCptDate)
strDateRef - The date reference
public static int getOccurrenceWithinTwoDates(java.util.Date dateStart,
java.util.Date dateEnd)
strDateRef - The date reference
public static Agenda getAgendaWithEvents(java.lang.String strAgenda,
javax.servlet.http.HttpServletRequest request)
request - The HTTP request
public static Agenda getAgendaWithOccurrences(java.lang.String strAgenda,
javax.servlet.http.HttpServletRequest request)
request - The HTTP request
public static Agenda getAgendaWithOccurrencesOrderedbyId(java.lang.String strAgenda,
javax.servlet.http.HttpServletRequest request)
request - The HTTP request
public static java.util.List<AgendaResource> getAgendaResourcesWithOccurrences(javax.servlet.http.HttpServletRequest request)
public static java.util.List<AgendaResource> getAgendaResourcesWithOccurrences()
public static java.util.List<AgendaResource> getAgendaResourcesWithEvents()
public static java.util.List<AgendaResource> getAgendaResourcesWithOccurrencesIds()
public static void loadAgendaOccurrences(AgendaResource agenda,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
agenda - The agenda
public static void loadAgendaOccurrencesOrderedById(AgendaResource agenda,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
agenda - The agenda
public static void loadAgendaEvents(AgendaResource agenda,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
agenda - The agendapublic static boolean isValidDate(java.util.Date dateEvent)
dateEvent - The date code
public static java.lang.String ParseHtmlToPlainTextString(java.lang.String strHTML)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||