本文整理汇总了Java中com.liferay.portal.kernel.servlet.SessionMessages类的典型用法代码示例。如果您正苦于以下问题:Java SessionMessages类的具体用法?Java SessionMessages怎么用?Java SessionMessages使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SessionMessages类属于com.liferay.portal.kernel.servlet包,在下文中一共展示了SessionMessages类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processAction
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的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");
}
示例2: actionSaveGlobal
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的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);
}
}
示例3: actionSaveFacetConfig
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的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);
}
}
示例4: actionDeleteTab
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的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);
}
}
示例5: doProcessAction
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的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");
}
示例6: doProcessAction
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的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");
}
示例7: doProcessAction
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的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");
}
示例8: processAction
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的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);
}
示例9: doProcessAction
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的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");
}
示例10: doProcessAction
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的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");
}
示例11: addDocTemplate
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的package包/类
public void addDocTemplate(ActionRequest actionRequest,
ActionResponse actionResponse) throws PortletException {
ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();
try {
String templateNo = ParamUtil.getString(actionRequest, "templateNo");
String title = ParamUtil.getString(actionRequest, "title");
String enTitle = ParamUtil.getString(actionRequest, "enTitle");
String _uuid = ParamUtil.getString(actionRequest, "fileEntryUuid");
DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.getFileEntryByUuidAndGroupId(_uuid, serviceContext.getScopeGroupId());
DocTemplate docTemplate = DocTemplateLocalServiceUtil.addDocTemplate(templateNo, title, enTitle, fileEntry.getFileEntryId(), serviceContext);
if (docTemplate != null) {
SessionMessages.add(actionRequest.getPortletSession(), DocTemplateKeys.SuccessMessageKeys.ORG_OEP_CORE_UTILITIES_DOSSIERMGT_PORTLET_DOCTEMPLATE_SUCCESS_ADDNEW);
_log.info("doc template have been added successfylly");
} else {
_log.error("There is an Erron in adding doc template");
}
actionResponse.setRenderParameter("mvcPath",
"/html/dossiermgt/portlet/doctemplate/edit_doctemplate.jsp");
} catch (Exception e) {
e.printStackTrace();
}
}
示例12: addEditUserSync
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的package包/类
public void addEditUserSync(ActionRequest request, ActionResponse response) throws SystemException, PortalException, IOException {
if (SessionErrors.isEmpty(request)) {
String appUserName = ParamUtil.getString(request, UserSyncKeys.AddEditAttributes.APP_USERNAME, PortletKeys.TEXT_BOX);
Long editId = ParamUtil.getLong(request, UserSyncKeys.AddEditAttributes.EDIT_ID, PortletKeys.LONG_DEFAULT);
if (editId == PortletKeys.LONG_DEFAULT) {
} else {
UserSync userSync = UserSyncLocalServiceUtil.getUserSync(editId);
userSync.setAppUserName(appUserName);
userSync.setCheckpoint(new Date());
UserSyncLocalServiceUtil.updateUserSync(userSync);
}
}
SessionMessages.add(request, PortalUtil.getPortletId(request) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
if (!SessionErrors.isEmpty(request)) {
PortalUtil.copyRequestParameters(request, response);
} else {
response.sendRedirect(ParamUtil.getString(request, PortletKeys.REDIRECT_PAGE));
}
}
示例13: addEditAppRole2JobPos
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的package包/类
public void addEditAppRole2JobPos(ActionRequest request, ActionResponse response) throws SystemException, PortalException, IOException {
if (SessionErrors.isEmpty(request)) {
ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();
long appRoleId = ParamUtil.getLong(request, AppRole2JobPosKeys.AddEditAttributes.APPROLE_ID, PortletKeys.LONG_DEFAULT);
long jobPosId = ParamUtil.getLong(request, AppRole2JobPosKeys.AddEditAttributes.JOBPOS_ID, PortletKeys.LONG_DEFAULT);
Long editId = ParamUtil.getLong(request, AppRole2JobPosKeys.AddEditAttributes.EDIT_ID, PortletKeys.LONG_DEFAULT);
if (editId == PortletKeys.LONG_DEFAULT) {
AppRole2JobPosLocalServiceUtil.addAppRole2JobPos(appRoleId, jobPosId, serviceContext);
SessionMessages.add(request, AssignRoleKeys.SuccessMessageKeys.ORG_OEP_SSOMGT_PORTLET_APPROLE_ASSIGNROLE2JOBPOS_SUCCESS_ADDNEW);
} else {
}
}
SessionMessages.add(request, PortalUtil.getPortletId(request) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
if (!SessionErrors.isEmpty(request)) {
PortalUtil.copyRequestParameters(request, response);
} else {
response.sendRedirect(ParamUtil.getString(request, PortletKeys.REDIRECT_PAGE));
}
}
示例14: deleteEP
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的package包/类
public void deleteEP(ActionRequest request, ActionResponse response) throws PortalException, SystemException, IOException {
long deleteId = ParamUtil.getLong(request, AppRole2JobPosKeys.BaseAppRole2JobPosAttributes.DELETE_ID, PortletKeys.LONG_DEFAULT);
try {
AppRole2Employee a2e = AppRole2EmployeeLocalServiceUtil.getAppRole2Employee(deleteId);
if (a2e != null) {
try {
AppRole role = AppRoleLocalServiceUtil.getAppRole(a2e.getAppRoleId());
UserSync userSync = UserSyncLocalServiceUtil.findByApplicationEmployee(role.getApplicationId(), a2e.getEmployeeId());
userSync.setCheckpoint(new Date());
userSync.setAccessibleStatus(0);
UserSyncLocalServiceUtil.updateUserSync(userSync);
}
catch (Exception e) {
e.printStackTrace();
}
}
AppRole2EmployeeLocalServiceUtil.removeAppRole2Employee(deleteId);
SessionMessages.add(request, AssignRoleKeys.SuccessMessageKeys.ORG_OEP_SSOMGT_PORTLET_APPROLE_ASSIGNROLE2EMPLOYEE_SUCCESS_DELETE);
}
catch (Exception ex) {
SessionMessages.add(request, AssignRoleKeys.ErrorMessageKeys.ORG_OEP_SSOMGT_PORTLET_APPROLE_ASSIGNROLE2EMPLOYEE_ERROR_DELETE);
}
response.sendRedirect(ParamUtil.getString(request, PortletKeys.REDIRECT_PAGE));
}
示例15: addEditAppRole
import com.liferay.portal.kernel.servlet.SessionMessages; //导入依赖的package包/类
public void addEditAppRole(ActionRequest request, ActionResponse response) throws SystemException, PortalException, IOException {
validateParamsIntoSessionError(request);
if (SessionErrors.isEmpty(request)) {
ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();
long applicationId = ParamUtil.getLong(request, AppRoleKeys.AddEditAttributes.APPLICATION_ID, PortletKeys.LONG_DEFAULT);
String roleCode = ParamUtil.getString(request, AppRoleKeys.AddEditAttributes.ROLE_CODE, PortletKeys.TEXT_BOX);
String roleName = ParamUtil.getString(request, AppRoleKeys.AddEditAttributes.ROLE_NAME, PortletKeys.TEXT_BOX);
Long editId = ParamUtil.getLong(request, AppRoleKeys.AddEditAttributes.EDIT_ID, PortletKeys.LONG_DEFAULT);
if (editId == PortletKeys.LONG_DEFAULT) {
AppRoleLocalServiceUtil.addAppRole(applicationId, roleCode, roleName, serviceContext);
SessionMessages.add(request, AppRoleKeys.SuccessMessageKeys.ORG_OEP_SSOMGT_PORTLET_APPROLE_SUCCESS_ADDNEW);
} else {
AppRoleLocalServiceUtil.updateAppRole(editId, applicationId, roleCode, roleName, serviceContext);
SessionMessages.add(request, AppRoleKeys.SuccessMessageKeys.ORG_OEP_SSOMGT_PORTLET_APPROLE_SUCCESS_UPDATE);
}
}
SessionMessages.add(request, PortalUtil.getPortletId(request) + SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_ERROR_MESSAGE);
if (!SessionErrors.isEmpty(request)) {
PortalUtil.copyRequestParameters(request, response);
} else {
response.sendRedirect(ParamUtil.getString(request, PortletKeys.REDIRECT_PAGE));
}
}