本文整理汇总了Java中com.liferay.portal.kernel.util.PortalUtil.getDate方法的典型用法代码示例。如果您正苦于以下问题:Java PortalUtil.getDate方法的具体用法?Java PortalUtil.getDate怎么用?Java PortalUtil.getDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.kernel.util.PortalUtil
的用法示例。
在下文中一共展示了PortalUtil.getDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTaskRecords
import com.liferay.portal.kernel.util.PortalUtil; //导入方法依赖的package包/类
protected List<TaskRecord> getTaskRecords(PortletRequest request) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
PortletURL iteratorURL = PortletURLFactoryUtil.create(request, PortletKeys.TIMETRACKER,
themeDisplay.getLayout(), PortletRequest.RENDER_PHASE);
String description = ParamUtil.getString(request, "description");
boolean advancedSearch = ParamUtil.getBoolean(request, "advancedSearch", false);
boolean andOperator = ParamUtil.getBoolean(request, "andOperator", true);
int end = ParamUtil.getInteger(request, "end");
boolean ignoreFromDate = ParamUtil.getBoolean(request, "ignoreFromDate");
Date fromDate = null;
if (!ignoreFromDate) {
int fromDateDay = ParamUtil.getInteger(request, "fromDateDay");
int fromDateMonth = ParamUtil.getInteger(request, "fromDateMonth");
int fromDateYear = ParamUtil.getInteger(request, "fromDateYear");
fromDate = PortalUtil.getDate(fromDateMonth, fromDateDay, fromDateYear);
}
String keywords = ParamUtil.getString(request, "keywords");
String orderByCol = ParamUtil.getString(request, "orderByCol", "modifiedDate");
String orderByType = ParamUtil.getString(request, "orderByType", "desc");
long ownerUserId = ParamUtil.getLong(request, "ownerUserId");
int start = ParamUtil.getInteger(request, "start");
int status = ParamUtil.getInteger(request, Field.STATUS);
TaskRecordSearch taskRecordSearch = new TaskRecordSearch(request, iteratorURL);
orderByCol = taskRecordSearch.getOrderByCol();
boolean ignoreUntilDate = ParamUtil.getBoolean(request, "ignoreUntilDate");
Date untilDate = null;
if (!ignoreUntilDate) {
int untilDateDay = ParamUtil.getInteger(request, "untilDateDay");
int untilDateMonth = ParamUtil.getInteger(request, "untilDateMonth");
int untilDateYear = ParamUtil.getInteger(request, "untilDateYear");
untilDate = PortalUtil.getDate(untilDateMonth, untilDateDay, untilDateYear);
}
String workPackage = ParamUtil.getString(request, "workPackage");
boolean reverse = "desc".equals(orderByType);
Sort sort = new Sort(orderByCol, reverse);
Hits hits = null;
if (advancedSearch) {
hits = TaskRecordServiceUtil.search(themeDisplay.getUserId(), themeDisplay.getScopeGroupId(), ownerUserId,
workPackage, description, status, fromDate, untilDate, null, andOperator, advancedSearch, start,
end, sort);
} else {
hits = TaskRecordServiceUtil.search(themeDisplay.getUserId(), themeDisplay.getScopeGroupId(), 0, keywords,
start, end, sort);
}
List<TaskRecord> taskRecords = TimetrackerUtil.getTaskRecords(hits);
return taskRecords;
}