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.identity.principal.Principal; 026 import org.kuali.rice.kim.api.role.Role; 027 import org.kuali.rice.kim.api.role.RoleMember; 028 import org.kuali.rice.kim.api.type.KimAttributeField; 029 import org.kuali.rice.kim.bo.ui.KimDocumentRoleMember; 030 import org.kuali.rice.kim.document.IdentityManagementGroupDocument; 031 import org.kuali.rice.kim.document.IdentityManagementPersonDocument; 032 import org.kuali.rice.kim.document.IdentityManagementRoleDocument; 033 import org.kuali.rice.kim.impl.common.delegate.DelegateTypeBo; 034 import org.kuali.rice.kim.impl.role.RoleMemberBo; 035 import org.kuali.rice.kim.impl.role.RoleResponsibilityActionBo; 036 import org.kuali.rice.krad.bo.BusinessObject; 037 import org.springframework.cache.annotation.CacheEvict; 038 039 import java.util.List; 040 import java.util.Map; 041 042 /** 043 * This is a description of what this class does - shyu don't forget to fill this in. 044 * 045 * @author Kuali Rice Team (rice.collab@kuali.org) 046 * 047 */ 048 public interface UiDocumentService { 049 /** 050 * 051 * This method to populate Entity tables from person document pending tables when it is approved. 052 * 053 * @param identityManagementPersonDocument 054 */ 055 @CacheEvict(value={Entity.Cache.NAME, EntityDefault.Cache.NAME, Principal.Cache.NAME, GroupMember.Cache.NAME, RoleMember.Cache.NAME}, allEntries = true) 056 void saveEntityPerson(IdentityManagementPersonDocument identityManagementPersonDocument); 057 058 /** 059 * 060 * This method is to set up the DD attribute entry map for role qualifiers, so it can be rendered. 061 * 062 * @param definitions 063 */ 064 Map<String,Object> getAttributeEntries( List<KimAttributeField> definitions ); 065 /** 066 * 067 * This method is to load identity to person document pending Bos when user 'initiate' a document for 'editing' identity. 068 * 069 * @param identityManagementPersonDocument 070 * @param principalId 071 */ 072 void loadEntityToPersonDoc(IdentityManagementPersonDocument identityManagementPersonDocument, String principalId); 073 074 /** 075 * 076 * This method loads a role document 077 * 078 * @param identityManagementRoleDocument 079 */ 080 public void loadRoleDoc(IdentityManagementRoleDocument identityManagementRoleDocument, Role kimRole); 081 082 /** 083 * 084 * This method ... 085 * 086 * @param identityManagementRoleDocument 087 */ 088 @CacheEvict(value={Role.Cache.NAME, RoleMember.Cache.NAME, Permission.Cache.NAME}, allEntries = true) 089 public void saveRole(IdentityManagementRoleDocument identityManagementRoleDocument); 090 091 092 /** 093 * 094 * This method loads a role document 095 * 096 * @param identityManagementGroupDocument 097 */ 098 public void loadGroupDoc(IdentityManagementGroupDocument identityManagementGroupDocument, Group kimGroup); 099 100 /** 101 * 102 * This method ... 103 * 104 * @param identityManagementGroupDocument 105 */ 106 @CacheEvict(value={Group.Cache.NAME,GroupMember.Cache.NAME}, allEntries = true) 107 public void saveGroup(IdentityManagementGroupDocument identityManagementGroupDocument); 108 109 public BusinessObject getMember(MemberType memberType, String memberId); 110 111 public String getMemberName(MemberType memberType, String memberId); 112 113 public String getMemberNamespaceCode(MemberType memberType, String memberId); 114 115 public String getMemberName(MemberType memberType, BusinessObject member); 116 117 public String getMemberNamespaceCode(MemberType memberType, BusinessObject member); 118 119 public List<RoleResponsibilityActionBo> getRoleMemberResponsibilityActionImpls(String roleMemberId); 120 121 public List<DelegateTypeBo> getRoleDelegations(String roleId); 122 123 public KimDocumentRoleMember getKimDocumentRoleMember(MemberType memberType, String memberId, String roleId); 124 125 public String getMemberIdByName(MemberType memberType, String memberNamespaceCode, String memberName); 126 127 public void setDelegationMembersInDocument(IdentityManagementRoleDocument identityManagementRoleDocument); 128 129 public RoleMemberBo getRoleMember(String roleMemberId); 130 131 public List<KimDocumentRoleMember> getRoleMembers(Map<String,String> fieldValues); 132 133 public boolean canModifyEntity( String currentUserPrincipalId, String toModifyPrincipalId ); 134 public boolean canOverrideEntityPrivacyPreferences( String currentUserPrincipalId, String toModifyPrincipalId ); 135 136 public List<EntityEmployment> getEntityEmploymentInformationInfo(String entityId); 137 }