| 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.commons.lang.StringUtils; |
| 21 | |
import org.apache.log4j.Logger; |
| 22 | |
import org.kuali.rice.core.util.RiceKeyConstants; |
| 23 | |
import org.kuali.rice.kim.bo.group.dto.GroupInfo; |
| 24 | |
import org.kuali.rice.kim.service.KIMServiceLocator; |
| 25 | |
import org.kuali.rice.kim.util.KimConstants; |
| 26 | |
import org.kuali.rice.kim.web.struts.form.IdentityManagementDocumentFormBase; |
| 27 | |
import org.kuali.rice.kim.web.struts.form.IdentityManagementGroupDocumentForm; |
| 28 | |
import org.kuali.rice.kns.util.GlobalVariables; |
| 29 | |
import org.kuali.rice.kns.util.KNSConstants; |
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | 0 | public class IdentityManagementGroupInquiry extends IdentityManagementBaseInquiryAction { |
| 38 | 0 | private static final Logger LOG = Logger.getLogger(IdentityManagementGroupInquiry.class); |
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
@Override |
| 46 | |
protected void loadKimObject(HttpServletRequest request, IdentityManagementDocumentFormBase form) { |
| 47 | 0 | IdentityManagementGroupDocumentForm groupDocumentForm = (IdentityManagementGroupDocumentForm) form; |
| 48 | 0 | String groupId = request.getParameter(KimConstants.PrimaryKeyConstants.GROUP_ID); |
| 49 | |
|
| 50 | 0 | GroupInfo group = null; |
| 51 | 0 | if (StringUtils.isNotEmpty(groupId)) { |
| 52 | 0 | group = KIMServiceLocator.getGroupService().getGroupInfo(groupId); |
| 53 | |
} else { |
| 54 | 0 | String namespaceCode = request.getParameter(KimConstants.UniqueKeyConstants.NAMESPACE_CODE); |
| 55 | 0 | String groupName = request.getParameter(KimConstants.UniqueKeyConstants.GROUP_NAME); |
| 56 | |
|
| 57 | 0 | if (!StringUtils.isBlank(namespaceCode) && !StringUtils.isBlank(groupName)) { |
| 58 | 0 | group = KIMServiceLocator.getGroupService().getGroupInfoByName(namespaceCode, groupName); |
| 59 | |
} |
| 60 | |
} |
| 61 | 0 | if (group != null) { |
| 62 | 0 | getUiDocumentService().loadGroupDoc(groupDocumentForm.getGroupDocument(), group); |
| 63 | |
} else { |
| 64 | 0 | LOG.error("No records found for Group Inquiry."); |
| 65 | 0 | GlobalVariables.getMessageMap().putError(KNSConstants.GLOBAL_ERRORS, RiceKeyConstants.ERROR_INQUIRY); |
| 66 | |
} |
| 67 | 0 | } |
| 68 | |
|
| 69 | |
} |