@Override public int compareTo(NewUserLog newUserLog) { int value = 0; value = DateUtil.compareTo(getCreateDate(), newUserLog.getCreateDate()); value = value * -1; if (value != 0) { return value; } return 0; }
@Override public int compareTo(UserActivity userActivity) { int value = 0; value = DateUtil.compareTo(getCreateDate(), userActivity.getCreateDate()); value = value * -1; if (value != 0) { return value; } return 0; }
@Override public int compareTo(AppMessage appMessage) { int value = 0; value = DateUtil.compareTo(getCreateDate(), appMessage.getCreateDate()); value = value * -1; if (value != 0) { return value; } return 0; }
public int compareTo(ChatRoom chatRoom) { int value = 0; value = DateUtil.compareTo(getCreateDate(), chatRoom.getCreateDate()); value = value * -1; if (value != 0) { return value; } if (getRoomId() < chatRoom.getRoomId()) { value = -1; } else if (getRoomId() > chatRoom.getRoomId()) { value = 1; } else { value = 0; } value = value * -1; if (value != 0) { return value; } return 0; }
public int compareTo(ChatRoomMessage chatRoomMessage) { int value = 0; value = DateUtil.compareTo(getMessageTS(), chatRoomMessage.getMessageTS()); if (value != 0) { return value; } return 0; }
@Override public int compareTo(SiteRequest siteRequest) { int value = 0; value = DateUtil.compareTo(getCreateDate(), siteRequest.getCreateDate()); value = value * -1; if (value != 0) { return value; } return 0; }
public int compareTo(AdminIPValidationData adminIPValidationData) { int value = 0; value = DateUtil.compareTo(getModifiedDate(), adminIPValidationData.getModifiedDate()); value = value * -1; if (value != 0) { return value; } return 0; }
@Override public int compareTo(Message message) { int value = 0; value = DateUtil.compareTo(getCreatedAt(), message.getCreatedAt()); if (value != 0) { return value; } return 0; }
@Override public int compareTo(BadgeInstance badgeInstance) { int value = 0; if (getUserId() < badgeInstance.getUserId()) { value = -1; } else if (getUserId() > badgeInstance.getUserId()) { value = 1; } else { value = 0; } if (value != 0) { return value; } value = DateUtil.compareTo(getCreateDate(), badgeInstance.getCreateDate()); if (value != 0) { return value; } return 0; }
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { String cmd = ParamUtil.getString(actionRequest, Constants.CMD); if (!cmd.equals(Constants.UPDATE)) { return; } String newsletterEmail = ParamUtil.getString(actionRequest, "newsletterEmail"); String portletResource = ParamUtil.getString(actionRequest, "portletResource"); PortletPreferences preferences = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portletResource); Calendar calendar = new GregorianCalendar(); calendar.setTime(DateUtil.newDate()); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MILLISECOND, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MINUTE, 0); calendar.getTime(); preferences.setValue("newsletterEmail", newsletterEmail); preferences.store(); PortletSession portletSession = actionRequest.getPortletSession(); SessionMessages.add(actionRequest, portletConfig.getPortletName() + ".doConfigure"); }
public void saveSettings( ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException { ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute( WebKeys.THEME_DISPLAY); long companyId = themeDisplay.getCompanyId(); long groupId = themeDisplay.getScopeGroupId(); String privacyPolicyArticleId = ParamUtil.getString( actionRequest, "privacyPolicyArticleId"); String privacyInfoMessageArticleId = ParamUtil.getString( actionRequest, "privacyInfoMessageArticleId"); boolean privacyEnabled = ParamUtil.getBoolean( actionRequest, "privacyEnabled", false); int cookieExpiration = ParamUtil.getInteger( actionRequest, "cookieExpiration", 30); boolean resetPreviousCookies = ParamUtil.getBoolean( actionRequest, "resetPreviousCookies", false); try { PortletPreferences preferences = PrivacyUtil.getPrivacyAdminSettings(companyId, groupId); preferences.setValue( "privacyPolicyArticleId", privacyPolicyArticleId); preferences.setValue( "privacyInfoMessageArticleId", privacyInfoMessageArticleId); preferences.setValue( "privacyEnabled", String.valueOf(privacyEnabled)); preferences.setValue( "cookieExpiration", String.valueOf(cookieExpiration)); if (resetPreviousCookies) { long now = DateUtil.newTime(); preferences.setValue("nameExtend", String.valueOf(now)); } preferences.store(); } catch (SystemException e) { _log.error(e, e); SessionErrors.add(actionRequest, e.getMessage()); } _log.info("saveSettings"); }
public int compareTo(AuditEntry auditEntry) { int value = 0; value = DateUtil.compareTo(getAuditDate(), auditEntry.getAuditDate()); value = value * -1; if (value != 0) { return value; } return 0; }