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


Java PortletProvider类代码示例

本文整理汇总了Java中com.liferay.portal.kernel.portlet.PortletProvider的典型用法代码示例。如果您正苦于以下问题:Java PortletProvider类的具体用法?Java PortletProvider怎么用?Java PortletProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PortletProvider类属于com.liferay.portal.kernel.portlet包,在下文中一共展示了PortletProvider类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TaskRecordSearch

import com.liferay.portal.kernel.portlet.PortletProvider; //导入依赖的package包/类
public TaskRecordSearch(PortletRequest portletRequest, String curParam, PortletURL iteratorURL) {

        super(portletRequest, new TaskRecordDisplayTerms(portletRequest), new TaskRecordSearchTerms(portletRequest),
                curParam, DEFAULT_DELTA, iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);

        PortletConfig portletConfig = (PortletConfig) portletRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);

        TaskRecordDisplayTerms displayTerms = (TaskRecordDisplayTerms) getDisplayTerms();
        TaskRecordSearchTerms searchTerms = (TaskRecordSearchTerms) getSearchTerms();

        String portletId = PortletProviderUtil.getPortletId(User.class.getName(), PortletProvider.Action.VIEW);
        String portletName = portletConfig.getPortletName();

        if (!portletId.equals(portletName)) {
            displayTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
            searchTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
        }

        iteratorURL.setParameter(TaskRecordDisplayTerms.TASKRECORDID, String.valueOf(displayTerms.getTaskRecordId()));
        iteratorURL.setParameter(TaskRecordDisplayTerms.STATUS, String.valueOf(displayTerms.getStatus()));
        iteratorURL.setParameter(TaskRecordDisplayTerms.WORK_PACKAGE, displayTerms.getWorkPackage());
        iteratorURL.setParameter(TaskRecordDisplayTerms.DESCRIPTION, displayTerms.getDescription());
        iteratorURL.setParameter(TaskRecordDisplayTerms.USER_NAME, displayTerms.getUserName());
        iteratorURL.setParameter(TaskRecordDisplayTerms.TICKET_URL, displayTerms.getTicketURL());
        iteratorURL.setParameter(TaskRecordDisplayTerms.CREATE_DATE, displayTerms.getCreateDate());
        iteratorURL.setParameter(TaskRecordDisplayTerms.MODIFIED_DATE, displayTerms.getModifiedDate());
        iteratorURL.setParameter(TaskRecordDisplayTerms.FROM_DATE, displayTerms.getFromDate());
        iteratorURL.setParameter(TaskRecordDisplayTerms.UNTIL_DATE, displayTerms.getUntilDate());
        iteratorURL.setParameter(TaskRecordDisplayTerms.DURATION, String.valueOf(displayTerms.getDuration()));

        try {
            PortalPreferences preferences = PortletPreferencesFactoryUtil.getPortalPreferences(portletRequest);

            String orderByCol = ParamUtil.getString(portletRequest, "orderByCol");
            String orderByType = ParamUtil.getString(portletRequest, "orderByType");

            if (Validator.isNotNull(orderByCol) && Validator.isNotNull(orderByType)) {
                preferences.setValue(portletId, "task-records-order-by-col", orderByCol);
                preferences.setValue(portletId, "task-records-order-by-type", orderByType);
            } else {
                orderByCol = preferences.getValue(portletId, "task-records-order-by-col", "modified-date");
                orderByType = preferences.getValue(portletId, "task-records-order-by-type", "asc");
            }

            setOrderableHeaders(orderableHeaders);

            if (Validator.isNotNull(orderableHeaders.get(orderByCol))) {
                setOrderByCol(orderableHeaders.get(orderByCol));
            } else {
                _log.error(orderByCol + " is not an orderable header.");
                setOrderByCol(orderByCol);
            }

            setOrderByType(orderByType);

        } catch (Exception e) {
            _log.error(e);
        }
    }
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:60,代码来源:TaskRecordSearch.java

示例2: ContactSearch

import com.liferay.portal.kernel.portlet.PortletProvider; //导入依赖的package包/类
public ContactSearch(PortletRequest portletRequest, String curParam, PortletURL iteratorURL) {

        super(portletRequest, new ContactDisplayTerms(portletRequest), new ContactSearchTerms(portletRequest), curParam,
                DEFAULT_DELTA, iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);

        PortletConfig portletConfig = (PortletConfig) portletRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);

        ContactDisplayTerms displayTerms = (ContactDisplayTerms) getDisplayTerms();
        ContactSearchTerms searchTerms = (ContactSearchTerms) getSearchTerms();

        String portletId = PortletProviderUtil.getPortletId(User.class.getName(), PortletProvider.Action.VIEW);
        String portletName = portletConfig.getPortletName();

        if (!portletId.equals(portletName)) {
            displayTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
            searchTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
        }

        iteratorURL.setParameter(ContactDisplayTerms.COMPANY, String.valueOf(displayTerms.getCompany()));
        iteratorURL.setParameter(ContactDisplayTerms.CONTACT_ID, String.valueOf(displayTerms.getContactId()));
        iteratorURL.setParameter(ContactDisplayTerms.CREATE_DATE, String.valueOf(displayTerms.getCreateDate()));
        iteratorURL.setParameter(ContactDisplayTerms.EMAIL, String.valueOf(displayTerms.getEmail()));
        iteratorURL.setParameter(ContactDisplayTerms.FAX, String.valueOf(displayTerms.getFax()));
        iteratorURL.setParameter(ContactDisplayTerms.FULL_NAME, String.valueOf(displayTerms.getFullName()));
        // TODO: add default impp
        iteratorURL.setParameter(ContactDisplayTerms.MODIFIED_DATE, String.valueOf(displayTerms.getModifiedDate()));
        iteratorURL.setParameter(ContactDisplayTerms.NAME, String.valueOf(displayTerms.getName()));
        iteratorURL.setParameter(ContactDisplayTerms.PHONE, String.valueOf(displayTerms.getPhone()));
        iteratorURL.setParameter(ContactDisplayTerms.USER_NAME, String.valueOf(displayTerms.getUserName()));

        try {
            PortalPreferences preferences = PortletPreferencesFactoryUtil.getPortalPreferences(portletRequest);

            String orderByCol = ParamUtil.getString(portletRequest, "orderByCol");
            String orderByType = ParamUtil.getString(portletRequest, "orderByType");

            if (Validator.isNotNull(orderByCol) && Validator.isNotNull(orderByType)) {

                preferences.setValue(portletId, "contacts-order-by-col", orderByCol);
                preferences.setValue(portletId, "contacts-order-by-type", orderByType);
            } else {
                orderByCol = preferences.getValue(portletId, "contacts-order-by-col", "modified-date");
                orderByType = preferences.getValue(portletId, "contacts-order-by-type", "asc");
            }

            setOrderableHeaders(orderableHeaders);

            if (Validator.isNotNull(orderableHeaders.get(orderByCol))) {
                setOrderByCol(orderableHeaders.get(orderByCol));
            } else {
                _log.error(orderByCol + " is not an orderable header.");
                setOrderByCol(orderByCol);
            }

            setOrderByType(orderByType);

        } catch (Exception e) {
            _log.error(e);
        }
    }
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:61,代码来源:ContactSearch.java

示例3: MeasurementSearch

import com.liferay.portal.kernel.portlet.PortletProvider; //导入依赖的package包/类
public MeasurementSearch(PortletRequest portletRequest, String curParam, PortletURL iteratorURL) {

        super(portletRequest, new MeasurementDisplayTerms(portletRequest), new MeasurementSearchTerms(portletRequest),
                curParam, DEFAULT_DELTA, iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);

        PortletConfig portletConfig = (PortletConfig) portletRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);

        MeasurementDisplayTerms displayTerms = (MeasurementDisplayTerms) getDisplayTerms();
        MeasurementSearchTerms searchTerms = (MeasurementSearchTerms) getSearchTerms();

        String portletId = PortletProviderUtil.getPortletId(User.class.getName(), PortletProvider.Action.VIEW);
        String portletName = portletConfig.getPortletName();

        if (!portletId.equals(portletName)) {
            displayTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
            searchTerms.setStatus(WorkflowConstants.STATUS_APPROVED);
        }

        iteratorURL.setParameter(MeasurementDisplayTerms.CREATE_DATE, displayTerms.getCreateDate());
        iteratorURL.setParameter(MeasurementDisplayTerms.DATA, displayTerms.getData());
        iteratorURL.setParameter(MeasurementDisplayTerms.MEASUREMENT_ID,
                String.valueOf(displayTerms.getMeasurementId()));
        iteratorURL.setParameter(MeasurementDisplayTerms.STATUS, String.valueOf(displayTerms.getStatus()));
        iteratorURL.setParameter(MeasurementDisplayTerms.USER_NAME, displayTerms.getUserName());
        iteratorURL.setParameter(MeasurementDisplayTerms.MODIFIED_DATE, displayTerms.getModifiedDate());
        iteratorURL.setParameter(MeasurementDisplayTerms.FROM, String.valueOf(displayTerms.getFrom()));
        iteratorURL.setParameter(MeasurementDisplayTerms.UNTIL, String.valueOf(displayTerms.getUntil()));

        try {
            PortalPreferences preferences = PortletPreferencesFactoryUtil.getPortalPreferences(portletRequest);

            String orderByCol = ParamUtil.getString(portletRequest, "orderByCol");
            String orderByType = ParamUtil.getString(portletRequest, "orderByType");

            if (Validator.isNotNull(orderByCol) && Validator.isNotNull(orderByType)) {
                preferences.setValue(portletId, "measurements-order-by-col", orderByCol);
                preferences.setValue(portletId, "measurements-order-by-type", orderByType);
            } else {
                orderByCol = preferences.getValue(portletId, "measurements-order-by-col", "modified-date");
                orderByType = preferences.getValue(portletId, "measurements-order-by-type", "asc");
            }

            setOrderableHeaders(orderableHeaders);

            if (Validator.isNotNull(orderableHeaders.get(orderByCol))) {
                setOrderByCol(orderableHeaders.get(orderByCol));
            } else {
                _log.error(orderByCol + " is not an orderable header.");
                setOrderByCol(orderByCol);
            }

            setOrderByType(orderByType);

        } catch (Exception e) {
            _log.error(e);
        }
    }
 
开发者ID:inofix,项目名称:ch-inofix-data-manager,代码行数:58,代码来源:MeasurementSearch.java


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