public final class EventHelper extends Object implements LogEnabled, Serviceable
Modifier and Type | Field and Description |
---|---|
protected static ContentTypeExtensionPoint |
_contentTypeEP
The extension point for content types
|
private static Logger |
_logger |
protected static AmetysObjectResolver |
_resolver
The Ametys object resolver
|
Constructor and Description |
---|
EventHelper() |
Modifier and Type | Method and Description |
---|---|
void |
enableLogging(Logger logger) |
static boolean |
inMonth(String monthStartStr,
String eventStartStr,
String eventEndStr)
Tests if the given event occurs in the given month.
|
static boolean |
isBetween(String dateStr,
String startStr,
String endStr)
Tests if the given date is either:
- equal to the first, if there is no end date.
|
static boolean |
isDatetime(String contentId,
String metadataName)
Tests if the given metadata for the given content is of type
MetadataType.DATETIME |
static String |
nextDay(String dateStr)
Tests if the given date is either:
|
static String |
nextDay(String dateStr,
String format)
Tests if the given date is either:
|
void |
service(ServiceManager manager) |
protected static AmetysObjectResolver _resolver
protected static ContentTypeExtensionPoint _contentTypeEP
public EventHelper()
public void enableLogging(Logger logger)
enableLogging
in interface LogEnabled
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public static boolean isBetween(String dateStr, String startStr, String endStr)
dateStr
- the date to test.startStr
- start of the interval.endStr
- end of the interval.public static boolean inMonth(String monthStartStr, String eventStartStr, String eventEndStr)
monthStartStr
- The month first day, cannot be null or blank.eventStartStr
- The event start date, can be null or blank only if the end date is set.eventEndStr
- The event end date, can be null or blank only if the end date is set.public static String nextDay(String dateStr)
dateStr
- the date to test.public static String nextDay(String dateStr, String format)
dateStr
- the date to test.format
- the format ("date" or "basicDate").public static boolean isDatetime(String contentId, String metadataName)
MetadataType.DATETIME
contentId
- The id of the contentmetadataName
- The metadata nameMetadataType.DATETIME