private final static RequiredEnvironmentDescriptor[] requiredEnvironmentDescriptors = new RequiredEnvironmentDescriptor[] {
new RequiredEnvironmentDescriptor(LOCALE, Store.SESSION, new DefaultMessage("message/requiredEnvironment/locale"), new LocaleValueDescriptor(), new LocaleValue(Locale.getDefault()))
};
public Result process(Map parameters, Context context) throws Exception {
DateValue date = (DateValue)parameters.get(DATE);
String dateFormat = parameters.get(DATE_FORMAT).toString();
String timeFormat = parameters.get(TIME_FORMAT).toString();
Locale locale = ((LocaleValue)context.getStore(Store.SESSION).get(LOCALE)).getLocale();
String formattedDate = getDateFormatter(dateFormat, timeFormat, locale).format(date.getDate());
return new Result(StateDescriptor.OK, SimpleProcessor.OUTPUT, new StringValue(formattedDate));
}