当前位置: 首页>>代码示例>>Java>>正文


Java PortalUtil.getDate方法代码示例

本文整理汇总了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;

    }
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:70,代码来源:ExportTaskRecordsMVCResourceCommand.java


注:本文中的com.liferay.portal.kernel.util.PortalUtil.getDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。