de.uplanet.lucy.server.auxiliaries.calendar
Class CalHelper

java.lang.Object
  extended by de.uplanet.lucy.server.auxiliaries.calendar.CalHelper

@VelocityCallable(value="instance")
public final class CalHelper
extends java.lang.Object

Version:
$Revision: 74080 $

Constructor Summary
CalHelper()
           
 
Method Summary
 int compare(java.lang.String p_strIso1)
           
 int compare(java.lang.String p_strIso1, java.lang.String p_strIso2)
           
 java.lang.String convertDateForInput(java.lang.String p_strInValue)
          Method convertDateForInput.
 java.lang.String convertDateForOutput(java.lang.String p_strValue)
          Method convertDateForOutput.
 java.lang.String convertDateTimeForInput(java.lang.String p_strInValue)
          Method convertDateTimeForInput.
 java.lang.String convertDateTimeForOutput(java.util.Date p_value)
          Method convertDateTimeForOutput.
 java.lang.String convertDateTimeForOutput(long p_value)
           
 java.lang.String convertDateTimeForOutput(java.lang.String p_strValue)
          Method convertDateTimeForOutput.
 java.lang.String convertDateTimeForVCalendar(java.lang.String p_strInValue)
          Method convertDateTimeForVCalendar.
 java.lang.String convertValueHolderForVCalendar(IValueHolder<?> p_vh)
          Method convertDateTimeForVCalendar.
 java.lang.String format(java.lang.String p_strDateTimeISOinUTC, java.lang.String p_pattern)
           
 java.lang.String format(UpCalendar p_cal, java.lang.String p_pattern)
           
 UpCalendar getCalendar(java.lang.String p_strAdjust)
           
 java.util.Date getDateFromString(java.lang.String p_strDate, java.util.TimeZone p_tz)
           
 java.lang.String getDefaultIso(java.lang.String p_strAdjust)
          returns the adjusted iso time string realted to the users timezone
 java.lang.String getDefaultIso(java.lang.String p_strAdjust, java.lang.String p_strTimeZone)
          returns the adjusted iso time string
 java.util.List<ApplicationInfo> getDeSelectedApps()
          Method getDeSelectedApps.
 java.util.List<ApplicationInfo> getDeSelectedApps(java.lang.String p_strUserGuid)
          Method getDeSelectedApps.
 int getDiffInDays(java.lang.String p_strIso)
           
 long getDiffInMillis(java.lang.String p_strIso)
           
 long getDiffInMillis(java.lang.String p_strIso1, java.lang.String p_strIso2)
           
 UpCalendar getNowCalendar()
           
 UpCalendar getNowCalendar(java.util.TimeZone p_tz)
           
 java.util.List<ApplicationInfo> getSelectedApps()
          Method getSelectedApps.
 java.util.List<ApplicationInfo> getSelectedApps(java.lang.String p_strUserGuid)
          Method getSelectedApps by User Guid.
 UpCalendar getUpCalendarFromString(java.lang.String p_strDate, java.util.TimeZone p_tz)
           
 IValueHolder<?> getVHFromDateString(java.lang.String p_strInValue)
          Converts the given UTC date string to a value holder.
 IValueHolder<?> getVHFromDateString(java.lang.String p_strInValue, java.lang.String p_strTimeZone)
          Converts the given date string to a value holder.
 IValueHolder<?> getVHFromDateString(java.lang.String p_strInValue, java.util.TimeZone p_timeZone)
          Converts the given date string to a value holder.
 IValueHolder<?> getVHFromDateStringWithAdjust(java.lang.String p_strInValue, java.lang.String p_strAdjust, java.util.TimeZone p_timeZone)
          Converts the given string to a date value holder.
 IValueHolder<?> getVHFromDateTimeString(java.lang.String p_strInValue)
          Converts the given UTC date-time string to a value holder.
 IValueHolder<?> getVHFromDateTimeString(java.lang.String p_strInValue, java.lang.String p_strTimeZone)
          Converts the given date-time string to a value holder.
 IValueHolder<?> getVHFromDateTimeString(java.lang.String p_strInValue, java.util.TimeZone p_timeZone)
          Converts the given date-time string to a value holder.
 IValueHolder<?> getVHFromDateTimeStringWithAdjust(java.lang.String p_strInValue, java.lang.String p_strAdjust, java.util.TimeZone p_timeZone)
          Converts the given date-time string to a value holder.
 IValueHolder<?> getVHFromTimeString(java.lang.String p_strInValue)
          Converts the given time string to a value holder.
 IValueHolder<?> getVHFromTimeString(java.lang.String p_strInValue, java.lang.String p_strTimeZone)
          Converts the given time string to a value holder.
 IValueHolder<?> getVHFromTimeString(java.lang.String p_strInValue, java.util.TimeZone p_timeZone)
          Converts the given time string to a value holder.
 IValueHolder<?> getVHFromTimeStringWithAdjust(java.lang.String p_strInValue, java.lang.String p_strAdjust, java.util.TimeZone p_timeZone)
          Converts the given time string to a value holder.
 int getWeekNumber(java.util.Calendar p_cal)
           
 void init(IServerBridgeRequest p_request)
          Method init.
 boolean isToday(java.lang.String p_strIso)
           
 boolean isToday(UpCalendar p_cal)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalHelper

public CalHelper()
Method Detail

init

public void init(IServerBridgeRequest p_request)
Method init.

Parameters:
p_request -

getVHFromDateTimeString

public IValueHolder<?> getVHFromDateTimeString(java.lang.String p_strInValue)
Converts the given UTC date-time string to a value holder.

Parameters:
p_strInValue - The UTC date time string.

getVHFromDateTimeString

public IValueHolder<?> getVHFromDateTimeString(java.lang.String p_strInValue,
                                               java.lang.String p_strTimeZone)
Converts the given date-time string to a value holder.

Parameters:
p_strInValue - The date time string.
p_strTimeZone - The time zone to be used.

getVHFromDateTimeString

public IValueHolder<?> getVHFromDateTimeString(java.lang.String p_strInValue,
                                               java.util.TimeZone p_timeZone)
Converts the given date-time string to a value holder.

Parameters:
p_strInValue - The date time string.
p_timeZone - The time zone to be used.

getVHFromDateTimeStringWithAdjust

public IValueHolder<?> getVHFromDateTimeStringWithAdjust(java.lang.String p_strInValue,
                                                         java.lang.String p_strAdjust,
                                                         java.util.TimeZone p_timeZone)
Converts the given date-time string to a value holder.

Parameters:
p_strInValue - The date time string.
p_strAdjust - The adjust string.
p_timeZone - The time zone.

getVHFromDateString

public IValueHolder<?> getVHFromDateString(java.lang.String p_strInValue)
Converts the given UTC date string to a value holder.

Parameters:
p_strInValue - The UTC date string.

getVHFromDateString

public IValueHolder<?> getVHFromDateString(java.lang.String p_strInValue,
                                           java.lang.String p_strTimeZone)
Converts the given date string to a value holder.

Parameters:
p_strInValue - The date string.
p_strTimeZone - The time zone to be used.

getVHFromDateString

public IValueHolder<?> getVHFromDateString(java.lang.String p_strInValue,
                                           java.util.TimeZone p_timeZone)
Converts the given date string to a value holder.

Parameters:
p_strInValue - The date time string.
p_timeZone - The time zone to be used.

getVHFromDateStringWithAdjust

public IValueHolder<?> getVHFromDateStringWithAdjust(java.lang.String p_strInValue,
                                                     java.lang.String p_strAdjust,
                                                     java.util.TimeZone p_timeZone)
Converts the given string to a date value holder.

Parameters:
p_strInValue - The DateTime string.
p_strAdjust - The adjust string.
p_timeZone - The time zone.

getVHFromTimeString

public IValueHolder<?> getVHFromTimeString(java.lang.String p_strInValue)
Converts the given time string to a value holder.

The date part of the value holder created contains the current date in the UTC time zone.

Parameters:
p_strInValue - The time string.

getVHFromTimeString

public IValueHolder<?> getVHFromTimeString(java.lang.String p_strInValue,
                                           java.lang.String p_strTimeZone)
Converts the given time string to a value holder.

The date part of the value holder created contains the current date in the given time zone.

Parameters:
p_strInValue - The time string.
p_strTimeZone - The time zone to be used.

getVHFromTimeString

public IValueHolder<?> getVHFromTimeString(java.lang.String p_strInValue,
                                           java.util.TimeZone p_timeZone)
Converts the given time string to a value holder.

The date part of the value holder created contains the current date in the given time zone.

Parameters:
p_strInValue - The time string.
p_timeZone - The time zone to be used.

getVHFromTimeStringWithAdjust

public IValueHolder<?> getVHFromTimeStringWithAdjust(java.lang.String p_strInValue,
                                                     java.lang.String p_strAdjust,
                                                     java.util.TimeZone p_timeZone)
Converts the given time string to a value holder.

The date part of the value holder created contains the current date in the given time zone.

Parameters:
p_strInValue - The time string.
p_strAdjust - The adjust string.
p_timeZone - The time zone to be used.

convertDateForInput

public java.lang.String convertDateForInput(java.lang.String p_strInValue)
Method convertDateForInput.

Parameters:
p_strInValue -
Returns:
String

convertDateTimeForInput

public java.lang.String convertDateTimeForInput(java.lang.String p_strInValue)
Method convertDateTimeForInput.

Parameters:
p_strInValue -
Returns:
String

convertDateTimeForVCalendar

public java.lang.String convertDateTimeForVCalendar(java.lang.String p_strInValue)
Method convertDateTimeForVCalendar.

Parameters:
p_strInValue -
Returns:
String

convertValueHolderForVCalendar

public java.lang.String convertValueHolderForVCalendar(IValueHolder<?> p_vh)
Method convertDateTimeForVCalendar.

Parameters:
p_strInValue -
Returns:
String

convertDateForOutput

public java.lang.String convertDateForOutput(java.lang.String p_strValue)
Method convertDateForOutput.

Parameters:
p_strValue -
Returns:
String

convertDateTimeForOutput

public java.lang.String convertDateTimeForOutput(java.lang.String p_strValue)
Method convertDateTimeForOutput.

Parameters:
p_strValue -
Returns:
String

convertDateTimeForOutput

public java.lang.String convertDateTimeForOutput(long p_value)

convertDateTimeForOutput

public java.lang.String convertDateTimeForOutput(java.util.Date p_value)
Method convertDateTimeForOutput.

Parameters:
p_value -
Returns:
String

getSelectedApps

public java.util.List<ApplicationInfo> getSelectedApps()
Method getSelectedApps.

Returns:
List

getSelectedApps

public java.util.List<ApplicationInfo> getSelectedApps(java.lang.String p_strUserGuid)
Method getSelectedApps by User Guid.

Parameters:
p_strUserGuid - used for profile settings
Returns:
List

getDeSelectedApps

public java.util.List<ApplicationInfo> getDeSelectedApps()
Method getDeSelectedApps.

Returns:
List

getDeSelectedApps

public java.util.List<ApplicationInfo> getDeSelectedApps(java.lang.String p_strUserGuid)
Method getDeSelectedApps.

Parameters:
p_strUserGuid - used for profile settings
Returns:
List

getDefaultIso

public java.lang.String getDefaultIso(java.lang.String p_strAdjust)
returns the adjusted iso time string realted to the users timezone

Parameters:
p_strAdjust - eg. ",+1,1,0,0,0"
Returns:
String e.g. "2003-09-01 00:00:00"

getDefaultIso

public java.lang.String getDefaultIso(java.lang.String p_strAdjust,
                                      java.lang.String p_strTimeZone)
returns the adjusted iso time string

Parameters:
p_strAdjust - eg. ",+1,1,0,0,0"
p_strTimeZone - as Stirng
Returns:
String e.g. "2003-09-01 00:00:00"

format

public java.lang.String format(UpCalendar p_cal,
                               java.lang.String p_pattern)
Parameters:
p_cal -
p_pattern -
Returns:
a format date time string using the sessions language locale

format

public java.lang.String format(java.lang.String p_strDateTimeISOinUTC,
                               java.lang.String p_pattern)
Parameters:
p_strDateTimeISOinUTC -
p_pattern -
Returns:
a format date time string using the sessions language locale

getDiffInMillis

public long getDiffInMillis(java.lang.String p_strIso)
Parameters:
p_strIso -
Returns:
the difference between today(now) and the given date in millisecons (negative if the given date is before now)

compare

public int compare(java.lang.String p_strIso1,
                   java.lang.String p_strIso2)

compare

public int compare(java.lang.String p_strIso1)

getDiffInMillis

public long getDiffInMillis(java.lang.String p_strIso1,
                            java.lang.String p_strIso2)
Parameters:
p_strIso1 -
p_strIso2 -
Returns:
the difference between p_strIso2 and the given date p_strIso1 in millisecons (p_strIso2 - p_strIso1)

isToday

public boolean isToday(java.lang.String p_strIso)
Parameters:
p_strIso -
Returns:
Boolean

isToday

public boolean isToday(UpCalendar p_cal)
Parameters:
p_cal - a UpCalendar
Returns:
boolean true if the calendar is today

getDiffInDays

public int getDiffInDays(java.lang.String p_strIso)
Parameters:
p_strIso -
Returns:
the difference between today(now) and the given date in days (negative if the given date is before now)

getWeekNumber

public int getWeekNumber(java.util.Calendar p_cal)
Parameters:
p_cal -
Returns:
the number o the week

getDateFromString

public java.util.Date getDateFromString(java.lang.String p_strDate,
                                        java.util.TimeZone p_tz)
Parameters:
p_strDate - A string representing a date.
p_tz - The time zone to be used.
Returns:
Date

getUpCalendarFromString

public UpCalendar getUpCalendarFromString(java.lang.String p_strDate,
                                          java.util.TimeZone p_tz)
Parameters:
p_strDate - A string representing a date.
p_tz - The time zone to be used.
Returns:
UpCalendar

getNowCalendar

public UpCalendar getNowCalendar(java.util.TimeZone p_tz)
Parameters:
p_tz -
Returns:
UpCalendar at now using the given timezone

getNowCalendar

public UpCalendar getNowCalendar()
Returns:
UpCalendar at now using the context users timezone

getCalendar

public UpCalendar getCalendar(java.lang.String p_strAdjust)


Last updated: 2011-01-27
Copyright 2000-2010 United Planet. All Rights Reserved.