public static String getRFC822() { return getRFC822(new Date()); }
public static String getShortTimestamp() { return getShortTimestamp(new Date()); }
public static String getTimestamp() { return getTimestamp(new Date()); }
public static String getShortTimestamp(Date date) { return getSimpleDate(date, SHORT_TIMESTAMP_FORMAT); }
public static Date getDate(Date date, TimeZone tz) { Calendar cal = CalendarFactoryUtil.getCalendar(tz); cal.setTime(date); return getDate(cal); }
@Override public PortletPreferences deleteData( PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences) throws PortletDataException { long startTime = 0; if (_log.isInfoEnabled()) { _log.info("Deleting portlet " + portletId); startTime = System.currentTimeMillis(); } try { return doDeleteData( portletDataContext, portletId, portletPreferences); } catch (Exception e) { throw _handleException( e, PortletDataException.DELETE_PORTLET_DATA, portletId); } finally { if (_log.isInfoEnabled()) { long duration = System.currentTimeMillis() - startTime; _log.info("Deleted portlet in " + Time.getDuration(duration)); } } }
public static String getDescription(long milliseconds) { return getDescription(milliseconds, false); }
public static String getTimestamp(Date date) { return getSimpleDate(date, TIMESTAMP_FORMAT); }
public static Date getDate(TimeZone tz) { Calendar cal = CalendarFactoryUtil.getCalendar(tz); return getDate(cal); }
@Override public PortletPreferences addDefaultData( PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences) throws PortletDataException { long startTime = 0; if (_log.isInfoEnabled()) { _log.info("Adding default data to portlet " + portletId); startTime = System.currentTimeMillis(); } try { return doAddDefaultData( portletDataContext, portletId, portletPreferences); } catch (PortletDataException pde) { throw pde; } catch (Exception e) { throw new PortletDataException(e); } finally { if (_log.isInfoEnabled()) { long duration = System.currentTimeMillis() - startTime; _log.info( "Added default data to portlet in " + Time.getDuration(duration)); } } }
public static String getRFC822() { return getRFC822(new Date()); }
public static String getTimestamp() { return getTimestamp(new Date()); }
public static String getRFC822(Date date) { return getSimpleDate(date, RFC822_FORMAT); }
public static String getShortTimestamp() { return getShortTimestamp(new Date()); }
public static Date getDate(Date date, TimeZone tz) { Calendar cal = CalendarFactoryUtil.getCalendar(tz); cal.setTime(date); return getDate(cal); }
long duration = System.currentTimeMillis() - startTime; _log.info("Imported portlet in " + Time.getDuration(duration));
private static void _addReservedEl( Element rootElement, Map<String, String> tokens, String name, double value) { _addReservedEl(rootElement, tokens, name, String.valueOf(value)); }
@Override public ZipWriter getLayoutSetZipWriter(long groupId) { StringBundler sb = new StringBundler(4); sb.append(groupId); sb.append(StringPool.DASH); sb.append(Time.getTimestamp()); sb.append(".lar"); return getZipWriter(sb.toString()); }
public static String getDuration(long milliseconds) { return getSimpleDate(new Date(milliseconds), DURATION_FORMAT); }
@Override public String getPortletExportFileName(Portlet portlet) { return StringBundler.concat( StringUtil.replace(portlet.getDisplayName(), ' ', '_'), "-", Time.getShortTimestamp(), ".portlet.lar"); }