當前位置: 首頁>>代碼示例>>Java>>正文


Java ParamUtil類代碼示例

本文整理匯總了Java中com.liferay.portal.kernel.util.ParamUtil的典型用法代碼示例。如果您正苦於以下問題:Java ParamUtil類的具體用法?Java ParamUtil怎麽用?Java ParamUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ParamUtil類屬於com.liferay.portal.kernel.util包,在下文中一共展示了ParamUtil類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TaskRecordDisplayTerms

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
public TaskRecordDisplayTerms(PortletRequest portletRequest) {

        super(portletRequest);

        createDate = ParamUtil.getString(portletRequest, CREATE_DATE);
        description = ParamUtil.getString(portletRequest, DESCRIPTION);
        duration = ParamUtil.getLong(portletRequest, DURATION);
        fromDate = ParamUtil.getString(portletRequest, FROM_DATE);
        groupId = ParamUtil.getLong(portletRequest, GROUP_ID);
        ownerUserId = ParamUtil.getLong(portletRequest, OWNER_USER_ID);
        modifiedDate = ParamUtil.getString(portletRequest, MODIFIED_DATE);
        String statusString = ParamUtil.getString(portletRequest, STATUS);

        if (Validator.isNotNull(statusString)) {
            status = GetterUtil.getInteger(statusString);
        }
        ticketURL = ParamUtil.getString(portletRequest, TICKET_URL);
        taskRecordId = ParamUtil.getLong(portletRequest, TASKRECORDID);
        untilDate = ParamUtil.getString(portletRequest, UNTIL_DATE);
        userName = ParamUtil.getString(portletRequest, USER_NAME);
        workPackage = ParamUtil.getString(portletRequest, WORK_PACKAGE);
    }
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:23,代碼來源:TaskRecordDisplayTerms.java

示例2: processAction

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse)
        throws Exception {

    String columns = ParamUtil.getString(actionRequest, "columns");
    String[] exportFileNames = actionRequest.getParameterValues("exportFileName"); 
    String[] exportNames = actionRequest.getParameterValues("exportName"); 
    String[] exportScripts = actionRequest.getParameterValues("exportScript");      

    setPreference(actionRequest, "columns", columns.split(","));
    setPreference(actionRequest, "exportFileName", exportFileNames);
    setPreference(actionRequest, "exportName", exportNames);
    setPreference(actionRequest, "exportScript", exportScripts);

    super.processAction(portletConfig, actionRequest, actionResponse);
}
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:17,代碼來源:TimetrackerConfigurationAction.java

示例3: doServeResource

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
@Override
protected void doServeResource(ResourceRequest request, ResourceResponse response)
		throws Exception {
	String cmd = ParamUtil.getString(request, Constants.CMD);
	String serializedJson = "";
	
	if(cmd.equals(CMD_PAGELIST)) {
		serializedJson = getPageLists(request,response );
	} else {
		_log.error("Unknown command is passed <" + cmd + ">");
	}
	
	HttpServletResponse servletResponse = _portal.getHttpServletResponse(
			response);

	servletResponse.setContentType(ContentTypes.APPLICATION_JSON);

	ServletResponseUtil.write(servletResponse, serializedJson);		
}
 
開發者ID:yasuflatland-lf,項目名稱:liferay-dummy-factory,代碼行數:20,代碼來源:PageMVCResourceCommand.java

示例4: doServeResource

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
@Override
protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
        throws Exception {
    
    String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);

    PortletRequestDispatcher portletRequestDispatcher = null;

    if (cmd.equals(Constants.IMPORT)) {
        portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/processes_list/view.jsp");
    } else {
        portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest,
                "/import/new_import/import_task_records_resources.jsp");
    }

    portletRequestDispatcher.include(resourceRequest, resourceResponse);
}
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:18,代碼來源:ImportTaskRecordsMVCResourceCommand.java

示例5: getTaskRecord

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
public static TaskRecord getTaskRecord(HttpServletRequest request) throws Exception {

        long taskRecordId = ParamUtil.getLong(request, "taskRecordId");

        TaskRecord taskRecord = null;

        if (taskRecordId > 0) {
            taskRecord = TaskRecordServiceUtil.getTaskRecord(taskRecordId);

            // TODO: Add TrashBin support
            // if (taskRecord.isInTrash()) {
            // throw new NoSuchTaskRecordException("{taskRecordId=" +
            // taskRecordId + "}");
            // }
        }

        return taskRecord;
    }
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:19,代碼來源:ActionUtil.java

示例6: doProcessAction

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    _log.info("doProcessAction()");
    
    String cmd = ParamUtil.getString(actionRequest, Constants.CMD);

    _log.info("cmd = " + cmd);

    if (cmd.equals(Constants.DELETE)) {
        deleteBackgroundTasks(actionRequest, actionResponse);
    } else if (cmd.equals(Constants.EXPORT)) {
        exportTaskRecords(actionRequest, actionResponse);
    }

    String redirect = ParamUtil.getString(actionRequest, "redirect");

    if (Validator.isNotNull(redirect)) {
        sendRedirect(actionRequest, actionResponse, redirect);
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:22,代碼來源:ExportTaskRecordsMVCActionCommand.java

示例7: doEdit

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
/**
 * Routes between global configuration editing and tab editing
 *
 * @param request  The request
 * @param response The response
 * @throws PortletException If something goes wrong
 * @throws IOException      If something goes wrong
 */
@Override
protected void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    // Very, very simple routing. That's all we need, folks.
    String editModeParam = ParamUtil.get(request, PortletRequestParameter.EDIT_MODE.getName(), StringPool.BLANK);
    EditMode editMode = EditMode.getEditMode(editModeParam);

    switch(editMode) {
        case TAB:
            this.doEditTab(request, response);
        break;
        case FACET:
            this.doEditFacet(request, response);
        break;
        default:
            this.doEditGlobal(request, response);
        break;
    }

}
 
開發者ID:savoirfairelinux,項目名稱:flashlight-search,代碼行數:28,代碼來源:FlashlightSearchPortlet.java

示例8: actionSaveGlobal

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
/**
 * Saves the global aspect of the configuration
 *
 * @param request  The request
 * @param response The response
 * @throws IOException      If something goes wrong
 * @throws PortletException If something goes wrong
 */
@ProcessAction(name = ACTION_NAME_SAVE_GLOBAL)
public void actionSaveGlobal(ActionRequest request, ActionResponse response) throws IOException, PortletException {
    String redirectUrl = ParamUtil.get(request, FORM_FIELD_REDIRECT_URL, StringPool.BLANK);
    String adtUuid = ParamUtil.get(request, FORM_FIELD_ADT_UUID, StringPool.BLANK);
    boolean doSearchOnStartup = ParamUtil.getBoolean(request, FORM_FIELD_DO_SEARCH_ON_STARTUP, false);

    if (!PATTERN_UUID.matcher(adtUuid).matches()) {
        adtUuid = StringPool.BLANK;
    }

    String doSearchOnStartupKeywords = ParamUtil.getString(request, FORM_FIELD_DO_SEARCH_ON_STARTUP_KEYWORDS, FlashlightSearchService.CONFIGURATION_DEFAULT_SEARCH_KEYWORDS);
    this.searchService.saveGlobalSettings(adtUuid, doSearchOnStartup, doSearchOnStartupKeywords, request.getPreferences());

    SessionMessages.add(request, SESSION_MESSAGE_CONFIG_SAVED);
    if (!redirectUrl.isEmpty()) {
        response.sendRedirect(redirectUrl);
    }
}
 
開發者ID:savoirfairelinux,項目名稱:flashlight-search,代碼行數:27,代碼來源:FlashlightSearchPortlet.java

示例9: actionSaveFacetConfig

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
/**
 * This action saves the Liferay facet configuration for a given tab
 *
 * @param request The request
 * @param response The response
 * @throws PortletException If something goes wrong
 * @throws IOException If something goes wrong
 */
@ProcessAction(name = ACTION_NAME_SAVE_FACET_CONFIG)
public void actionSaveFacetConfig(ActionRequest request, ActionResponse response) throws PortletException, IOException {
    String tabId = ParamUtil.get(request, PortletRequestParameter.TAB_ID.getName(), StringPool.BLANK);
    String facetClassName = ParamUtil.get(request, FORM_FIELD_FACET_CLASS_NAME, StringPool.BLANK);
    String redirectUrl = ParamUtil.get(request, FORM_FIELD_REDIRECT_URL, StringPool.BLANK);
    PortletPreferences preferences = request.getPreferences();
    FlashlightSearchConfiguration configuration = this.searchService.readConfiguration(preferences);
    SearchFacet targetFacet = this.getSearchFacetFromRequest(tabId, facetClassName, configuration);

    if(targetFacet != null) {
        JSONObject facetConfiguration = targetFacet.getJSONData(request);
        targetFacet.getFacetConfiguration().setDataJSONObject(facetConfiguration);
        this.searchService.saveSearchFacetConfig(configuration.getTabs().get(tabId), targetFacet, preferences);
        SessionMessages.add(request, SESSION_MESSAGE_CONFIG_SAVED);
        response.sendRedirect(redirectUrl);
    }
}
 
開發者ID:savoirfairelinux,項目名稱:flashlight-search,代碼行數:26,代碼來源:FlashlightSearchPortlet.java

示例10: actionDeleteTab

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
/**
 * Deletes a tab from the configuration
 *
 * @param request  The request
 * @param response The response
 * @throws PortletException If something goes wrong
 * @throws IOException      If something goes wrong
 */
@ProcessAction(name = ACTION_NAME_DELETE_TAB)
public void actionDeleteTab(ActionRequest request, ActionResponse response) throws PortletException, IOException {
    String tabId = ParamUtil.get(request, PortletRequestParameter.TAB_ID.getName(), StringPool.BLANK);
    String redirectUrl = ParamUtil.get(request, FORM_FIELD_REDIRECT_URL, StringPool.BLANK);

    if (tabId != null && PATTERN_UUID.matcher(tabId).matches()) {
        PortletPreferences preferences = request.getPreferences();
        Map<String, FlashlightSearchConfigurationTab> tabs = this.searchService.readConfiguration(preferences).getTabs();
        if (tabs.containsKey(tabId)) {
            this.searchService.deleteConfigurationTab(tabId, preferences);
        }
    }

    SessionMessages.add(request, SESSION_MESSAGE_CONFIG_SAVED);

    if (!redirectUrl.isEmpty()) {
        response.sendRedirect(redirectUrl);
    }
}
 
開發者ID:savoirfairelinux,項目名稱:flashlight-search,代碼行數:28,代碼來源:FlashlightSearchPortlet.java

示例11: ContactDisplayTerms

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
public ContactDisplayTerms(PortletRequest portletRequest) {
    super(portletRequest);

    company = ParamUtil.getString(portletRequest, COMPANY);
    contactId = ParamUtil.getString(portletRequest, CONTACT_ID);
    createDate = ParamUtil.getString(portletRequest, CREATE_DATE);
    email = ParamUtil.getString(portletRequest, EMAIL);
    fax = ParamUtil.getString(portletRequest, FAX);
    fullName = ParamUtil.getString(portletRequest, FULL_NAME);
    // TODO: add default IMPP
    name = ParamUtil.getString(portletRequest, NAME);
    modifiedDate = ParamUtil.getString(portletRequest, MODIFIED_DATE);
    String statusString = ParamUtil.getString(portletRequest, STATUS);

    if (Validator.isNotNull(statusString)) {
        status = GetterUtil.getInteger(statusString);
    }

    phone = ParamUtil.getString(portletRequest, PHONE);
    userName = ParamUtil.getString(portletRequest, USER_NAME);
}
 
開發者ID:inofix,項目名稱:ch-inofix-contact-manager,代碼行數:22,代碼來源:ContactDisplayTerms.java

示例12: doServeResource

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
@Override
protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
        throws Exception {
    
    String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);

    PortletRequestDispatcher portletRequestDispatcher = null;

    if (cmd.equals(Constants.IMPORT)) {
        portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/processes_list/view.jsp");
    } else {
        portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest,
                "/import/new_import/import_contacts_resources.jsp");
    }

    portletRequestDispatcher.include(resourceRequest, resourceResponse);
}
 
開發者ID:inofix,項目名稱:ch-inofix-contact-manager,代碼行數:18,代碼來源:ImportContactsMVCResourceCommand.java

示例13: doProcessAction

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    String cmd = ParamUtil.getString(actionRequest, Constants.CMD);

    if (cmd.equals(Constants.DELETE)) {
        deleteBackgroundTasks(actionRequest, actionResponse);
    } else if (cmd.equals(Constants.EXPORT)) {
        exportContacts(actionRequest, actionResponse);
    }

    String redirect = ParamUtil.getString(actionRequest, "redirect");

    if (Validator.isNotNull(redirect)) {
        sendRedirect(actionRequest, actionResponse, redirect);
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-contact-manager,代碼行數:18,代碼來源:ExportContactsMVCActionCommand.java

示例14: getContact

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
public static Contact getContact(HttpServletRequest request) throws Exception {

        long contactId = ParamUtil.getLong(request, "contactId");

        Contact contact = null;

        if (contactId > 0) {
            contact = ContactServiceUtil.getContact(contactId);

            // TODO: Add TrashBin support
            // if (contact.isInTrash()) {
            // throw new NoSuchContactException("{contactId=" +
            // contactId + "}");
            // }
        }

        return contact;
    }
 
開發者ID:inofix,項目名稱:ch-inofix-contact-manager,代碼行數:19,代碼來源:ActionUtil.java

示例15: ContactGroupTerm

import com.liferay.portal.kernel.util.ParamUtil; //導入依賴的package包/類
public ContactGroupTerm(ActionRequest request) {
	ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);

	contactGroupId = ParamUtil.getLong(request, CONTACT_GROUP_ID);
	groupId = themeDisplay.getScopeGroupId();
	companyId = themeDisplay.getCompanyId();
	userId = themeDisplay.getUserId();
	createDate = ParamUtil.getDate(request, CREATE_DATE,
			DateTimeUtils.getDateTimeFormat(DateTimeUtils._VN_DATE_TIME_FORMAT));
	modifiedDate = ParamUtil.getDate(request, MODIFIED_DATE,
			DateTimeUtils.getDateTimeFormat(DateTimeUtils._VN_DATE_TIME_FORMAT));
	groupName = ParamUtil.getString(request, GROUP_NAME);
	contactList = ParamUtil.getString(request, CONTACT_LIST);
	shared = ParamUtil.getInteger(request, SHARED);
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:16,代碼來源:ContactGroupTerm.java


注:本文中的com.liferay.portal.kernel.util.ParamUtil類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。