AppRolePortlet.java 文件源码

java
阅读 16 收藏 0 点赞 0 评论 0

项目:OEPv2 作者:
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));
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号