| 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 | |
import javax.servlet.http.HttpServletResponse; |
| 20 | |
|
| 21 | |
import org.apache.struts.action.ActionForm; |
| 22 | |
import org.apache.struts.action.ActionForward; |
| 23 | |
import org.apache.struts.action.ActionMapping; |
| 24 | |
import org.kuali.rice.core.util.RiceConstants; |
| 25 | |
import org.kuali.rice.kim.service.KIMServiceLocator; |
| 26 | |
import org.kuali.rice.kim.service.UiDocumentService; |
| 27 | |
import org.kuali.rice.kim.web.struts.form.IdentityManagementDocumentFormBase; |
| 28 | |
import org.kuali.rice.kns.web.struts.action.KualiAction; |
| 29 | |
import org.kuali.rice.kns.web.struts.form.KualiTableRenderFormMetadata; |
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | 0 | public abstract class IdentityManagementBaseInquiryAction extends KualiAction { |
| 38 | |
|
| 39 | |
protected UiDocumentService uiDocumentService; |
| 40 | |
|
| 41 | |
protected UiDocumentService getUiDocumentService() { |
| 42 | 0 | if ( uiDocumentService == null ) { |
| 43 | 0 | uiDocumentService = KIMServiceLocator.getUiDocumentService(); |
| 44 | |
} |
| 45 | 0 | 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 | 0 | IdentityManagementDocumentFormBase idmForm = (IdentityManagementDocumentFormBase) form; |
| 58 | 0 | idmForm.setInquiry(true); |
| 59 | |
|
| 60 | 0 | loadKimObject( request, idmForm ); |
| 61 | |
|
| 62 | 0 | KualiTableRenderFormMetadata memberTableMetadata = idmForm.getMemberTableMetadata(); |
| 63 | 0 | memberTableMetadata.jumpToPage(memberTableMetadata.getSwitchToPageNumber(), idmForm.getMemberRows().size(), idmForm.getRecordsPerPage()); |
| 64 | |
|
| 65 | 0 | 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 | 0 | 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 | 0 | IdentityManagementDocumentFormBase idmForm = (IdentityManagementDocumentFormBase) form; |
| 80 | |
|
| 81 | 0 | KualiTableRenderFormMetadata memberTableMetadata = idmForm.getMemberTableMetadata(); |
| 82 | 0 | memberTableMetadata.jumpToPage(memberTableMetadata.getSwitchToPageNumber(), idmForm.getMemberRows().size(), idmForm.getRecordsPerPage()); |
| 83 | 0 | memberTableMetadata.setColumnToSortIndex(memberTableMetadata.getPreviouslySortedColumnIndex()); |
| 84 | 0 | return mapping.findForward(RiceConstants.MAPPING_BASIC); |
| 85 | |
} |
| 86 | |
|
| 87 | |
|
| 88 | |
} |