001 /** 002 * Copyright 2005-2012 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.rice.kim.service; 017 018 import org.kuali.rice.core.api.membership.MemberType; 019 import org.kuali.rice.kim.api.group.Group; 020 import org.kuali.rice.kim.api.group.GroupMember; 021 import org.kuali.rice.kim.api.identity.employment.EntityEmployment; 022 import org.kuali.rice.kim.api.identity.entity.Entity; 023 import org.kuali.rice.kim.api.identity.entity.EntityDefault; 024 import org.kuali.rice.kim.api.permission.Permission; 025 import org.kuali.rice.kim.api.role.Role; 026 import org.kuali.rice.kim.api.role.RoleMember; 027 import org.kuali.rice.kim.api.type.KimAttributeField; 028 import org.kuali.rice.kim.bo.ui.KimDocumentRoleMember; 029 import org.kuali.rice.kim.document.IdentityManagementGroupDocument; 030 import org.kuali.rice.kim.document.IdentityManagementPersonDocument; 031 import org.kuali.rice.kim.document.IdentityManagementRoleDocument; 032 import org.kuali.rice.kim.impl.common.delegate.DelegateTypeBo; 033 import org.kuali.rice.kim.impl.role.RoleMemberBo; 034 import org.kuali.rice.kim.impl.role.RoleResponsibilityActionBo; 035 import org.kuali.rice.krad.bo.BusinessObject; 036 import org.springframework.cache.annotation.CacheEvict; 037 038 import java.util.List; 039 import java.util.Map; 040 041 /** 042 * This is a description of what this class does - shyu don't forget to fill this in. 043 * 044 * @author Kuali Rice Team (rice.collab@kuali.org) 045 * 046 */ 047 public interface UiDocumentService { 048 /** 049 * 050 * This method to populate Entity tables from person document pending tables when it is approved. 051 * 052 * @param identityManagementPersonDocument 053 */ 054 @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME, GroupMember.Cache.NAME, RoleMember.Cache.NAME}, allEntries = true) 055 void saveEntityPerson(IdentityManagementPersonDocument identityManagementPersonDocument); 056 057 /** 058 * 059 * This method is to set up the DD attribute entry map for role qualifiers, so it can be rendered. 060 * 061 * @param definitions 062 */ 063 Map<String,Object> getAttributeEntries( List<KimAttributeField> definitions ); 064 /** 065 * 066 * This method is to load identity to person document pending Bos when user 'initiate' a document for 'editing' identity. 067 * 068 * @param identityManagementPersonDocument 069 * @param principalId 070 */ 071 void loadEntityToPersonDoc(IdentityManagementPersonDocument identityManagementPersonDocument, String principalId); 072 073 /** 074 * 075 * This method loads a role document 076 * 077 * @param identityManagementRoleDocument 078 */ 079 public void loadRoleDoc(IdentityManagementRoleDocument identityManagementRoleDocument, Role kimRole); 080 081 /** 082 * 083 * This method ... 084 * 085 * @param identityManagementRoleDocument 086 */ 087 @CacheEvict(value={Role.Cache.NAME, RoleMember.Cache.NAME, Permission.Cache.NAME}, allEntries = true) 088 public void saveRole(IdentityManagementRoleDocument identityManagementRoleDocument); 089 090 091 /** 092 * 093 * This method loads a role document 094 * 095 * @param identityManagementGroupDocument 096 */ 097 public void loadGroupDoc(IdentityManagementGroupDocument identityManagementGroupDocument, Group kimGroup); 098 099 /** 100 * 101 * This method ... 102 * 103 * @param identityManagementGroupDocument 104 */ 105 @CacheEvict(value={Group.Cache.NAME,GroupMember.Cache.NAME}, allEntries = true) 106 public void saveGroup(IdentityManagementGroupDocument identityManagementGroupDocument); 107 108 public BusinessObject getMember(MemberType memberType, String memberId); 109 110 public String getMemberName(MemberType memberType, String memberId); 111 112 public String getMemberNamespaceCode(MemberType memberType, String memberId); 113 114 public String getMemberName(MemberType memberType, BusinessObject member); 115 116 public String getMemberNamespaceCode(MemberType memberType, BusinessObject member); 117 118 public List<RoleResponsibilityActionBo> getRoleMemberResponsibilityActionImpls(String roleMemberId); 119 120 public List<DelegateTypeBo> getRoleDelegations(String roleId); 121 122 public KimDocumentRoleMember getKimDocumentRoleMember(MemberType memberType, String memberId, String roleId); 123 124 public String getMemberIdByName(MemberType memberType, String memberNamespaceCode, String memberName); 125 126 public void setDelegationMembersInDocument(IdentityManagementRoleDocument identityManagementRoleDocument); 127 128 public RoleMemberBo getRoleMember(String roleMemberId); 129 130 public List<KimDocumentRoleMember> getRoleMembers(Map<String,String> fieldValues); 131 132 public boolean canModifyEntity( String currentUserPrincipalId, String toModifyPrincipalId ); 133 public boolean canOverrideEntityPrivacyPreferences( String currentUserPrincipalId, String toModifyPrincipalId ); 134 135 public List<EntityEmployment> getEntityEmploymentInformationInfo(String entityId); 136 }