1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kim.web.struts.action; |
17 | |
|
18 | |
import javax.servlet.http.HttpServletRequest; |
19 | |
|
20 | |
import org.apache.log4j.Logger; |
21 | |
import org.kuali.rice.core.util.RiceKeyConstants; |
22 | |
import org.kuali.rice.kim.api.role.Role; |
23 | |
import org.kuali.rice.kim.api.services.KimApiServiceLocator; |
24 | |
import org.kuali.rice.kim.util.KimConstants; |
25 | |
import org.kuali.rice.kim.web.struts.form.IdentityManagementDocumentFormBase; |
26 | |
import org.kuali.rice.kim.web.struts.form.IdentityManagementRoleDocumentForm; |
27 | |
import org.kuali.rice.krad.util.GlobalVariables; |
28 | |
import org.kuali.rice.krad.util.KRADConstants; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | 0 | public class IdentityManagementRoleInquiry extends IdentityManagementBaseInquiryAction { |
37 | 0 | private static final Logger LOG = Logger.getLogger(IdentityManagementRoleInquiry.class); |
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
@Override |
45 | |
protected void loadKimObject(HttpServletRequest request, |
46 | |
IdentityManagementDocumentFormBase form) { |
47 | 0 | IdentityManagementRoleDocumentForm roleDocumentForm = (IdentityManagementRoleDocumentForm) form; |
48 | 0 | String roleId = request.getParameter(KimConstants.PrimaryKeyConstants.SUB_ROLE_ID); |
49 | 0 | roleDocumentForm.setRoleId(roleId); |
50 | 0 | Role role = KimApiServiceLocator.getRoleService().getRole(roleId); |
51 | 0 | if (role != null) { |
52 | 0 | getUiDocumentService().loadRoleDoc(roleDocumentForm.getRoleDocument(), role); |
53 | |
} else { |
54 | 0 | LOG.error("No records found for Role Inquiry."); |
55 | 0 | GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS, RiceKeyConstants.ERROR_INQUIRY); |
56 | |
} |
57 | 0 | } |
58 | |
|
59 | |
} |