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 org.apache.struts.action.ActionForm;
19 import org.apache.struts.action.ActionForward;
20 import org.apache.struts.action.ActionMapping;
21 import org.kuali.rice.core.api.util.RiceConstants;
22 import org.kuali.rice.kim.service.KIMServiceLocatorInternal;
23 import org.kuali.rice.kim.service.UiDocumentService;
24 import org.kuali.rice.kim.web.struts.form.IdentityManagementDocumentFormBase;
25 import org.kuali.rice.kns.web.struts.action.KualiAction;
26 import org.kuali.rice.kns.web.struts.form.KualiTableRenderFormMetadata;
27
28 import javax.servlet.http.HttpServletRequest;
29 import javax.servlet.http.HttpServletResponse;
30
31
32
33
34
35
36
37 public abstract class IdentityManagementBaseInquiryAction extends KualiAction {
38
39 protected UiDocumentService uiDocumentService;
40
41 protected UiDocumentService getUiDocumentService() {
42 if ( uiDocumentService == null ) {
43 uiDocumentService = KIMServiceLocatorInternal.getUiDocumentService();
44 }
45 return uiDocumentService;
46 }
47
48
49
50
51
52
53 @Override
54 public ActionForward execute(ActionMapping mapping, ActionForm form,
55 HttpServletRequest request, HttpServletResponse response)
56 throws Exception {
57 IdentityManagementDocumentFormBase idmForm = (IdentityManagementDocumentFormBase) form;
58 idmForm.setInquiry(true);
59
60 loadKimObject( request, idmForm );
61
62 KualiTableRenderFormMetadata memberTableMetadata = idmForm.getMemberTableMetadata();
63 memberTableMetadata.jumpToPage(memberTableMetadata.getSwitchToPageNumber(), idmForm.getMemberRows().size(), idmForm.getRecordsPerPage());
64
65 return super.execute(mapping, form, request, response);
66 }
67
68 protected abstract void loadKimObject( HttpServletRequest request, IdentityManagementDocumentFormBase form );
69
70 public ActionForward inquiry(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
71 return mapping.findForward(RiceConstants.MAPPING_BASIC);
72 }
73
74
75
76
77
78 public ActionForward switchToPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
79 IdentityManagementDocumentFormBase idmForm = (IdentityManagementDocumentFormBase) form;
80
81 KualiTableRenderFormMetadata memberTableMetadata = idmForm.getMemberTableMetadata();
82 memberTableMetadata.jumpToPage(memberTableMetadata.getSwitchToPageNumber(), idmForm.getMemberRows().size(), idmForm.getRecordsPerPage());
83 memberTableMetadata.setColumnToSortIndex(memberTableMetadata.getPreviouslySortedColumnIndex());
84 return mapping.findForward(RiceConstants.MAPPING_BASIC);
85 }
86
87
88 }