Java 类com.liferay.portal.kernel.util.DateUtil 实例源码

项目:OEPv2    文件:NewUserLogClp.java   
@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;
}
项目:OEPv2    文件:UserActivityClp.java   
@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;
}
项目:OEPv2    文件:UserActivityModelImpl.java   
@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;
}
项目:OEPv2    文件:NewUserLogModelImpl.java   
@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;
}
项目:OEPv2    文件:AppMessageClp.java   
@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;
}
项目:OEPv2    文件:AppMessageModelImpl.java   
@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;
}
项目:edemocracia    文件:ChatRoomClp.java   
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;
}
项目:edemocracia    文件:ChatRoomMessageModelImpl.java   
public int compareTo(ChatRoomMessage chatRoomMessage) {
    int value = 0;

    value = DateUtil.compareTo(getMessageTS(),
            chatRoomMessage.getMessageTS());

    if (value != 0) {
        return value;
    }

    return 0;
}
项目:edemocracia    文件:ChatRoomModelImpl.java   
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;
}
项目:edemocracia    文件:ChatRoomMessageClp.java   
public int compareTo(ChatRoomMessage chatRoomMessage) {
    int value = 0;

    value = DateUtil.compareTo(getMessageTS(),
            chatRoomMessage.getMessageTS());

    if (value != 0) {
        return value;
    }

    return 0;
}
项目:liferay-microsite-manager    文件:SiteRequestClp.java   
@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;
}
项目:liferay-microsite-manager    文件:SiteRequestModelImpl.java   
@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;
}
项目:role-access-lists    文件:AdminIPValidationDataClp.java   
public int compareTo(AdminIPValidationData adminIPValidationData) {
    int value = 0;

    value = DateUtil.compareTo(getModifiedDate(),
            adminIPValidationData.getModifiedDate());

    value = value * -1;

    if (value != 0) {
        return value;
    }

    return 0;
}
项目:role-access-lists    文件:AdminIPValidationDataModelImpl.java   
public int compareTo(AdminIPValidationData adminIPValidationData) {
    int value = 0;

    value = DateUtil.compareTo(getModifiedDate(),
            adminIPValidationData.getModifiedDate());

    value = value * -1;

    if (value != 0) {
        return value;
    }

    return 0;
}
项目:lims    文件:MessageClp.java   
@Override
public int compareTo(Message message) {
    int value = 0;

    value = DateUtil.compareTo(getCreatedAt(), message.getCreatedAt());

    if (value != 0) {
        return value;
    }

    return 0;
}
项目:lims    文件:MessageModelImpl.java   
@Override
public int compareTo(Message message) {
    int value = 0;

    value = DateUtil.compareTo(getCreatedAt(), message.getCreatedAt());

    if (value != 0) {
        return value;
    }

    return 0;
}
项目:gamification-portlet    文件:BadgeInstanceClp.java   
@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;
}
项目:gamification-portlet    文件:BadgeInstanceModelImpl.java   
@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;
}
项目:liferay-newsletter    文件:SubscriptionConfigurationActionImpl.java   
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");


}
项目:liferay-newsletter    文件:SubscriptionJqueryConfigurationActionImpl.java   
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");


}
项目:liferay-7-workspace    文件:PrivacyAdminPortlet.java   
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");
}
项目:liferaylms-portlet    文件:AuditEntryClp.java   
public int compareTo(AuditEntry auditEntry) {
    int value = 0;

    value = DateUtil.compareTo(getAuditDate(), auditEntry.getAuditDate());

    value = value * -1;

    if (value != 0) {
        return value;
    }

    return 0;
}
项目:liferaylms-portlet    文件:AuditEntryModelImpl.java   
public int compareTo(AuditEntry auditEntry) {
    int value = 0;

    value = DateUtil.compareTo(getAuditDate(), auditEntry.getAuditDate());

    value = value * -1;

    if (value != 0) {
        return value;
    }

    return 0;
}