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


Java ActionResponse類代碼示例

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


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

示例1: processAction

import javax.portlet.ActionResponse; //導入依賴的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

示例2: processAction

import javax.portlet.ActionResponse; //導入依賴的package包/類
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest,
		ActionResponse arg2) throws Exception {
	if (!Constants.UPDATE.equals(actionRequest.getParameter(Constants.CMD))) 
		return;
	
	PortletPreferences prefs;
	String portletResource = ParamUtil.getString(actionRequest, "portletResource");	
	if (Validator.isNotNull(portletResource)){
		prefs = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portletResource);
	} else {
		prefs = actionRequest.getPreferences();
	}
	prefs.setValue("numerateModules", actionRequest.getParameter("numerateModules"));
	
	prefs.store();
	SessionMessages.add(actionRequest,portletConfig.getPortletName() + ".doConfigure");
	
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:20,代碼來源:ModuleTitleConfigurationAction.java

示例3: doProcessAction

import javax.portlet.ActionResponse; //導入依賴的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

示例4: actionSaveGlobal

import javax.portlet.ActionResponse; //導入依賴的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

示例5: actionSaveFacetConfig

import javax.portlet.ActionResponse; //導入依賴的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

示例6: actionDeleteTab

import javax.portlet.ActionResponse; //導入依賴的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

示例7: doProcessAction

import javax.portlet.ActionResponse; //導入依賴的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

示例8: doProcessAction

import javax.portlet.ActionResponse; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest request, ActionResponse response) {

	try {
		DummyGenerator<OrgContext> dummyGenerator = _orgDummyFactory.create(request);
		dummyGenerator.create(request);

	} catch (Exception e) {
		hideDefaultSuccessMessage(request);
		_log.error(e, e);
	}

	response.setRenderParameter("mvcRenderCommandName", LDFPortletKeys.COMMON);
	SessionMessages.add(request, "success");
	
}
 
開發者ID:yasuflatland-lf,項目名稱:liferay-dummy-factory,代碼行數:17,代碼來源:OrganizationMVCActionCommand.java

示例9: doProcessAction

import javax.portlet.ActionResponse; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest request, ActionResponse response) throws Exception {

	try {
		response.setRenderParameter("mvcRenderCommandName", LDFPortletKeys.COMMON);

		DummyGenerator<MBContext> dummyGenerator = _MBDummyFactory.create(request);
		dummyGenerator.create(request);

		SessionMessages.add(request, "success");

	} catch (Exception e) {
		hideDefaultSuccessMessage(request);
		SessionErrors.add(request,Exception.class);
		_log.error(e, e);
	}

}
 
開發者ID:yasuflatland-lf,項目名稱:liferay-dummy-factory,代碼行數:19,代碼來源:MBMVCActionCommand.java

示例10: doProcessAction

import javax.portlet.ActionResponse; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest request, ActionResponse response) {

	try {
		DummyGenerator<CategoryContext> dummyGenerator = _categoryDummyFactory.create(request);
		dummyGenerator.create(request);

	} catch (Exception e) {
		hideDefaultSuccessMessage(request);
		_log.error(e, e);
		return;
	}

	response.setRenderParameter("mvcRenderCommandName", LDFPortletKeys.COMMON);
	SessionMessages.add(request, "success");

}
 
開發者ID:yasuflatland-lf,項目名稱:liferay-dummy-factory,代碼行數:18,代碼來源:CategoryMVCActionCommand.java

示例11: doProcessAction

import javax.portlet.ActionResponse; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest request, ActionResponse response) {

	try {
		DummyGenerator<DLContext> dummyGenerator = _dlDummyFactory.create(request);
		dummyGenerator.create(request);

	} catch (Exception e) {
		hideDefaultSuccessMessage(request);
		_log.error(e, e);
	}

	response.setRenderParameter("mvcRenderCommandName", LDFPortletKeys.COMMON);
	SessionMessages.add(request, "success");

}
 
開發者ID:yasuflatland-lf,項目名稱:liferay-dummy-factory,代碼行數:17,代碼來源:DocumentMVCActionCommand.java

示例12: processAction

import javax.portlet.ActionResponse; //導入依賴的package包/類
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse)
		throws Exception {

	String linkList = ParamUtil.getString(actionRequest, DummyFactoryConfiguration.CONF_LINKLIST);
	String urlList = ParamUtil.getString(actionRequest, DummyFactoryConfiguration.CONF_URLLIST);
	
	if (_log.isDebugEnabled()) {
		_log.debug("Link List :" + linkList);
		_log.debug("URL List  :" + urlList);
	}

	List<String> errors = Lists.newArrayList();
	if (validate(linkList, errors)) {
		setPreference(actionRequest, DummyFactoryConfiguration.CONF_LINKLIST, linkList);
		setPreference(actionRequest, DummyFactoryConfiguration.CONF_URLLIST, urlList);

		SessionMessages.add(actionRequest, "prefs-success");
	}

	super.processAction(portletConfig, actionRequest, actionResponse);
}
 
開發者ID:yasuflatland-lf,項目名稱:liferay-dummy-factory,代碼行數:23,代碼來源:DummyFactoryConfigurationAction.java

示例13: doProcessAction

import javax.portlet.ActionResponse; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest request, ActionResponse response) {

	try {
		DummyGenerator<JournalContext> dummyGenerator = _journalDummyFactory.create(request);
		dummyGenerator.create(request);

	} catch (Exception e) {
		hideDefaultSuccessMessage(request);
		_log.error(e, e);
	}

	response.setRenderParameter("mvcRenderCommandName", LDFPortletKeys.COMMON);
	SessionMessages.add(request, "success");

}
 
開發者ID:yasuflatland-lf,項目名稱:liferay-dummy-factory,代碼行數:17,代碼來源:JournalMVCActionCommand.java

示例14: doProcessAction

import javax.portlet.ActionResponse; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest request, ActionResponse response) {

	try {
		DummyGenerator<PageContext> dummyGenerator = _pageDummyFactory.create(request);
		dummyGenerator.create(request);

	} catch (Exception e) {
		hideDefaultSuccessMessage(request);
		_log.error(e, e);
	}

	response.setRenderParameter("mvcRenderCommandName", LDFPortletKeys.COMMON);
	SessionMessages.add(request, "success");

}
 
開發者ID:yasuflatland-lf,項目名稱:liferay-dummy-factory,代碼行數:17,代碼來源:PageMVCActionCommand.java

示例15: determineDefaultPhase

import javax.portlet.ActionResponse; //導入依賴的package包/類
private String determineDefaultPhase(Method handlerMethod) {
	if (void.class != handlerMethod.getReturnType()) {
		return PortletRequest.RENDER_PHASE;
	}
	for (Class<?> argType : handlerMethod.getParameterTypes()) {
		if (ActionRequest.class.isAssignableFrom(argType) || ActionResponse.class.isAssignableFrom(argType) ||
				InputStream.class.isAssignableFrom(argType) || Reader.class.isAssignableFrom(argType)) {
			return PortletRequest.ACTION_PHASE;
		}
		else if (RenderRequest.class.isAssignableFrom(argType) || RenderResponse.class.isAssignableFrom(argType) ||
				OutputStream.class.isAssignableFrom(argType) || Writer.class.isAssignableFrom(argType)) {
			return PortletRequest.RENDER_PHASE;
		}
		else if (ResourceRequest.class.isAssignableFrom(argType) || ResourceResponse.class.isAssignableFrom(argType)) {
			return PortletRequest.RESOURCE_PHASE;
		}
		else if (EventRequest.class.isAssignableFrom(argType) || EventResponse.class.isAssignableFrom(argType)) {
			return PortletRequest.EVENT_PHASE;
		}
	}
	return "";
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:23,代碼來源:AnnotationMethodHandlerAdapter.java


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