本文整理汇总了Java中javax.portlet.ActionRequest类的典型用法代码示例。如果您正苦于以下问题:Java ActionRequest类的具体用法?Java ActionRequest怎么用?Java ActionRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActionRequest类属于javax.portlet包,在下文中一共展示了ActionRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processAction
import javax.portlet.ActionRequest; //导入依赖的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);
}
示例2: getSaveAndContinueRedirect
import javax.portlet.ActionRequest; //导入依赖的package包/类
protected String getSaveAndContinueRedirect(
ActionRequest actionRequest, TaskRecord taskRecord, Layout layout, String redirect)
throws Exception {
PortletConfig portletConfig = (PortletConfig)actionRequest.getAttribute(
JavaConstants.JAVAX_PORTLET_CONFIG);
LiferayPortletURL portletURL = PortletURLFactoryUtil.create(actionRequest, portletConfig.getPortletName(), layout, PortletRequest.RENDER_PHASE);
portletURL.setParameter("mvcRenderCommandName", "editTaskRecord");
portletURL.setParameter(Constants.CMD, Constants.UPDATE, false);
portletURL.setParameter("redirect", redirect, false);
portletURL.setParameter(
"groupId", String.valueOf(taskRecord.getGroupId()), false);
portletURL.setParameter(
"taskRecordId", String.valueOf(taskRecord.getTaskRecordId()), false);
portletURL.setWindowState(actionRequest.getWindowState());
return portletURL.toString();
}
示例3: doProcessAction
import javax.portlet.ActionRequest; //导入依赖的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);
}
}
示例4: actionSaveGlobal
import javax.portlet.ActionRequest; //导入依赖的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);
}
}
示例5: actionSaveFacetConfig
import javax.portlet.ActionRequest; //导入依赖的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);
}
}
示例6: actionDeleteTab
import javax.portlet.ActionRequest; //导入依赖的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);
}
}
示例7: getSaveAndContinueRedirect
import javax.portlet.ActionRequest; //导入依赖的package包/类
protected String getSaveAndContinueRedirect(
ActionRequest actionRequest, Contact contact, Layout layout, String redirect)
throws Exception {
_log.info("getSaveAndContinueRedirect()");
PortletConfig portletConfig = (PortletConfig)actionRequest.getAttribute(
JavaConstants.JAVAX_PORTLET_CONFIG);
LiferayPortletURL portletURL = PortletURLFactoryUtil.create(actionRequest, portletConfig.getPortletName(), layout, PortletRequest.RENDER_PHASE);
portletURL.setParameter("mvcRenderCommandName", "editContact");
portletURL.setParameter(Constants.CMD, Constants.UPDATE, false);
portletURL.setParameter("redirect", redirect, false);
portletURL.setParameter(
"groupId", String.valueOf(contact.getGroupId()), false);
portletURL.setParameter(
"contactId", String.valueOf(contact.getContactId()), false);
portletURL.setWindowState(actionRequest.getWindowState());
return portletURL.toString();
}
示例8: doProcessAction
import javax.portlet.ActionRequest; //导入依赖的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);
}
}
示例9: ContactGroupTerm
import javax.portlet.ActionRequest; //导入依赖的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);
}
示例10: create
import javax.portlet.ActionRequest; //导入依赖的package包/类
@Override
public DummyGenerator<JournalContext> create(ActionRequest request) {
long createContentsType = 0;
DummyGenerator<JournalContext> generator = _JournalSimpleDummyGenerator;
createContentsType = ParamUtil.getLong(request, "createContentsType", LDFPortletKeys.MB_CATEGORY_CREATE);
if (createContentsType == LDFPortletKeys.WCM_DUMMY_CONTENTS_CREATE) {
generator = _JournalRandomDummyGenerator;
} else if (createContentsType == LDFPortletKeys.WCM_STRUCTURE_TEMPLATE_SELECT_CREATE) {
generator = _JournalStructureTemplateDummyGenerator;
}
return generator;
}
示例11: doProcessAction
import javax.portlet.ActionRequest; //导入依赖的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");
}
示例12: doProcessAction
import javax.portlet.ActionRequest; //导入依赖的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);
}
}
示例13: doProcessAction
import javax.portlet.ActionRequest; //导入依赖的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");
}
示例14: doProcessAction
import javax.portlet.ActionRequest; //导入依赖的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");
}
示例15: processAction
import javax.portlet.ActionRequest; //导入依赖的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);
}