當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。