001    /*
002     * Copyright 2007-2008 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.util;
017    
018    import java.util.HashMap;
019    import java.util.Map;
020    
021    /**
022     * This is a description of what this class does - jonathan don't forget to fill this in.
023     *
024     * @author Kuali Rice Team (rice.collab@kuali.org)
025     *
026     */
027    public class KimConstants {
028    
029            public static final String KIM_MODULE_NAMESPACE = "KIM";
030            
031            public static final String NAMESPACE_CODE = "KR-IDM";
032            public static final String KIM_TYPE_DEFAULT_NAMESPACE = "KUALI";
033            public static final String KIM_TYPE_DEFAULT_NAME = "Default";
034            public static final String KIM_GROUP_DEFAULT_NAMESPACE_CODE = "KUALI";
035            public static final String KIM_GROUP_WORKFLOW_NAMESPACE_CODE = "KR-WKFLW";
036            public static final String RESTRICTED_DATA_MASK = "Xxxxxx";
037    
038            //Kim services constants for API
039            public static final String KIM_IDENTITY_MANAGEMENT_SERVICE = "kimIdentityManagementService";
040            public static final String KIM_PERSON_SERVICE = "personService";
041            public static final String DEFAULT_KIM_TYPE_SERVICE = "kimTypeService";
042    
043            //Kim Attribute Boolean representations
044            public static final String KIM_ATTRIBUTE_BOOLEAN_TRUE_STR_VALUE_DISPLAY = "Yes";
045            public static final String KIM_ATTRIBUTE_BOOLEAN_FALSE_STR_VALUE_DISPLAY = "No";
046            public static final String KIM_ATTRIBUTE_BOOLEAN_TRUE_STR_VALUE = "Y";
047            public static final String KIM_ATTRIBUTE_BOOLEAN_FALSE_STR_VALUE = "N";
048            
049            public class EntityTypes {
050                    public static final String PERSON = "PERSON";
051                    public static final String SYSTEM = "SYSTEM";
052            }
053    
054            public class PersonExternalIdentifierTypes {
055                    public static final String TAX = "TAX";
056            }
057            public class PersonAffiliationTypes {
058                    public static final String STAFF_AFFILIATION_TYPE = "STAFF";
059                    public static final String STUDENT_AFFILIATION_TYPE = "STUDENT";
060                    public static final String AFFILIATE_AFFILIATION_TYPE = "AFFILIATE";
061                    public static final String FACULTY_AFFILIATION_TYPE = "FACULTY";
062            }
063    
064            public class PermissionTemplateNames {
065            public static final String FULL_UNMASK_FIELD = "Full Unmask Field";
066            public static final String PARTIAL_UNMASK_FIELD = "Partial Unmask Field";
067            public static final String VIEW_FIELD = "View Inquiry or Maintenance Document Field";
068            public static final String MODIFY_FIELD = "Modify Maintenance Document Field";
069            public static final String VIEW_SECTION = "View Inquiry or Maintenance Document Section";
070            public static final String MODIFY_SECTION = "Modify Maintenance Document Section";
071            public static final String CREATE_MAINTAIN_RECORDS = "Create / Maintain Record(s)";
072    
073            public static final String EDIT_DOCUMENT = "Edit Document";
074            public static final String COPY_DOCUMENT = "Copy Document";
075            public static final String OPEN_DOCUMENT = "Open Document";
076            public static final String TAKE_REQUESTED_ACTION = "Take Requested Action";
077            public static final String INITIATE_DOCUMENT = "Initiate Document";
078            public static final String BLANKET_APPROVE_DOCUMENT ="Blanket Approve Document";
079            public static final String CANCEL_DOCUMENT ="Cancel Document";
080            public static final String SAVE_DOCUMENT ="Save Document";
081            public static final String ROUTE_DOCUMENT ="Route Document";
082            public static final String APPROVE_DOCUMENT = "Approve Document";
083            public static final String AD_HOC_REVIEW_DOCUMENT = "Ad Hoc Review Document";
084            public static final String ADD_MESSAGE_TO_ROUTE_LOG = "Add Message to Route Log";
085            
086            public static final String ADD_NOTE_ATTACHMENT = "Add Note / Attachment";
087            public static final String VIEW_NOTE_ATTACHMENT = "View Note / Attachment";
088            public static final String DELETE_NOTE_ATTACHMENT = "Delete Note / Attachment";
089    
090            public static final String USE_TRANSACTIONAL_DOCUMENT = "Use Transactional Document";
091    
092            public static final String POPULATE_GROUP = "Populate Group";
093            public static final String ASSIGN_ROLE = "Assign Role";
094            public static final String GRANT_PERMISSION = "Grant Permission";
095            public static final String GRANT_RESPONSIBILITY = "Grant Responsibility";
096    
097            public static final String LOOK_UP_RECORDS = "Look Up Records";
098            public static final String INQUIRE_INTO_RECORDS = "Inquire Into Records";
099            public static final String USE_SCREEN = "Use Screen";
100    
101            public static final String PERFORM_CUSTOM_MAINTENANCE_DOCUMENT_FUNCTION ="Perform Custom Maintenance Document Function";
102            public static final String MAINTAIN_SYSTEM_PARAMETER = "Maintain System Parameter";
103            public static final String SEND_AD_HOC_REQUEST ="Send Ad Hoc Request";
104            }
105    
106            public static class PermissionNames {
107                    public static final String LOG_IN = "Log In";
108                    public static final String ADMIN_PESSIMISTIC_LOCKING = "Administer Pessimistic Locking";
109                    public static final String OVERRIDE_ENTITY_PRIVACY_PREFERENCES = "Override Entity Privacy Preferences";
110            public static final String MODIFY_ENTITY = "Modify Entity";
111            }
112    
113            public static class KimUIConstants {
114                    public static final String NAME_VALUE_SEPARATOR = " : ";
115                    public static final String COMMA_SEPARATOR = ", ";
116                    public static final String OR_OPERATOR = "|";
117                    public static final String URL_SEPARATOR = "/";
118                    public static final String PARAMETERIZED_URL_SEPARATOR = "%2F";
119                    public static final String KIM_URL_KEY = "kim.url";
120                    public static final String KIM_APPLICATION = "kim";
121                    public static final String MEMBER_ID_PREFIX = PrimaryKeyConstants.MEMBER_ID+".";
122                    public static final String MEMBER_NAME = "memberName";
123                    public static final String MEMBER_NAMESPACE_CODE = "memberNamespaceCode";
124                    public static final String MEMBER_TYPE_PRINCIPAL_CODE = "P";
125                    public static final String MEMBER_TYPE_GROUP_CODE = "G";
126                    public static final String MEMBER_TYPE_ROLE_CODE = "R";
127                    public static final String MEMBER_TYPE_PRINCIPAL = "Principal";
128                    public static final String MEMBER_TYPE_GROUP = "Group";
129                    public static final String MEMBER_TYPE_ROLE = "Role";
130                    public static final Map<String, String> KIM_MEMBER_TYPES_MAP = getKimMemberTypesMap();
131                private static Map<String, String> getKimMemberTypesMap() {
132                    Map<String, String> kimDocumentActionsMap = new HashMap<String, String>();
133                    kimDocumentActionsMap.put(MEMBER_TYPE_PRINCIPAL_CODE, MEMBER_TYPE_PRINCIPAL);
134                    kimDocumentActionsMap.put(MEMBER_TYPE_GROUP_CODE, MEMBER_TYPE_GROUP);
135                    kimDocumentActionsMap.put(MEMBER_TYPE_ROLE_CODE, MEMBER_TYPE_ROLE);
136                    return kimDocumentActionsMap;
137                }
138    
139                    public static final String KIM_ROLE_DOCUMENT_TYPE_NAME = "IdentityManagementRoleDocument";
140                    public static final String KIM_GROUP_DOCUMENT_TYPE_NAME = "IdentityManagementGroupDocument";
141                    public static final String KIM_PERSON_DOCUMENT_TYPE_NAME = "IdentityManagementPersonDocument";
142                    public static final String KIM_PERMISSION_DOCUMENT_TYPE_NAME = "IdentityManagementGenericPermissionMaintenanceDocument";
143                    public static final String KIM_REVIEW_RESPONSIBILITY_DOCUMENT_TYPE_NAME = "IdentityManagementReviewResponsibilityMaintenanceDocument";
144                    public static final String KIM_ROLE_DOCUMENT_SHORT_KEY = "IMRD";
145                    public static final String KIM_GROUP_DOCUMENT_SHORT_KEY = "IMGD";
146                    public static final String KIM_PERSON_DOCUMENT_SHORT_KEY = "IMPD";
147                    public static final String KIM_ROLE_DOCUMENT_ACTION = "identityManagementRoleDocument.do";
148                    public static final String KIM_ROLE_INQUIRY_ACTION = "identityManagementRoleInquiry.do";
149                    public static final String KIM_PERSON_DOCUMENT_ACTION = "identityManagementPersonDocument.do";
150                    public static final String KIM_PERSON_INQUIRY_ACTION = "identityManagementPersonInquiry.do";
151                    public static final String KIM_GROUP_DOCUMENT_ACTION = "identityManagementGroupDocument.do";
152                    public static final String KIM_GROUP_INQUIRY_ACTION = "identityManagementGroupInquiry.do";
153                    public static final Map<String, String> KIM_DOCUMENTS_ACTIONS_MAP = getDocumentActionsMap();
154                private static Map<String, String> getDocumentActionsMap() {
155                    Map<String, String> kimDocumentActionsMap = new HashMap<String, String>();
156                    kimDocumentActionsMap.put(KIM_ROLE_DOCUMENT_SHORT_KEY, KIM_ROLE_DOCUMENT_ACTION);
157                    kimDocumentActionsMap.put(KIM_GROUP_DOCUMENT_SHORT_KEY, KIM_GROUP_DOCUMENT_ACTION);
158                    kimDocumentActionsMap.put(KIM_PERSON_DOCUMENT_SHORT_KEY, KIM_PERSON_DOCUMENT_ACTION);
159                    return kimDocumentActionsMap;
160                }
161    
162                    public static final Map<String, String> KIM_DOCUMENT_TYPE_NAMES_MAP = getDocumentTypeNamesMap();
163                private static Map<String, String> getDocumentTypeNamesMap() {
164                    Map<String, String> kimDocumentTypeNamesMap = new HashMap<String, String>();
165                            kimDocumentTypeNamesMap.put(KIM_ROLE_DOCUMENT_SHORT_KEY, KIM_ROLE_DOCUMENT_TYPE_NAME);
166                            kimDocumentTypeNamesMap.put(KIM_GROUP_DOCUMENT_SHORT_KEY, KIM_GROUP_DOCUMENT_TYPE_NAME);
167                            kimDocumentTypeNamesMap.put(KIM_PERSON_DOCUMENT_SHORT_KEY, KIM_PERSON_DOCUMENT_TYPE_NAME);
168                            return kimDocumentTypeNamesMap;
169                }
170    
171                public static final String DELEGATION_PRIMARY = "P";
172                public static final String DELEGATION_SECONDARY = "S";
173                public static final String DELEGATION_PRIMARY_LABEL = "Primary";
174                public static final String DELEGATION_SECONDARY_LABEL = "Secondary";
175    
176                public static final Map<String, String> DELEGATION_TYPES = getDelegationTypesMap();
177                private static Map<String, String> getDelegationTypesMap() {
178                    Map<String, String> delegationTypesMap = new HashMap<String, String>();
179                    delegationTypesMap.put(DELEGATION_PRIMARY, DELEGATION_PRIMARY_LABEL);
180                    delegationTypesMap.put(DELEGATION_SECONDARY, DELEGATION_SECONDARY_LABEL);
181                    return delegationTypesMap;
182                }
183    
184                public static final String ROLE_LOOKUPABLE_IMPL = "roleLookupable";
185                public static final String KIM_DOCUMENT_ROLE_MEMBER_LOOKUPABLE_IMPL = "kimDocumentRoleMemberLookupable";
186                public static final String ROLE_MEMBER_LOOKUPABLE_IMPL = "roleMemberImplLookupable";
187                public static final String ROLE_MEMBERS_COLLECTION_NAME = "roleMembers";
188            }
189    
190            public static class PrimaryKeyConstants {
191                    public static final String ENTITY_ID = "entityId";
192                    public static final String PRINCIPAL_ID = "principalId";
193                    public static final String ROLE_ID = "roleId";
194                    public static final String GROUP_ID = "groupId";
195                    public static final String KIM_TYPE_ID = "kimTypeId";
196                    public static final String RESPONSIBILITY_ID = "responsibilityId";
197                    public static final String PERMISSION_ID = "permissionId";
198                    public static final String DELEGATION_ID = "delegationId";
199                    public static final String RESPONSIBILITY_TEMPLATE_ID = "responsibilityTemplateId";
200                    public static final String PERMISSION_TEMPLATE_ID = "permissionTemplateId";
201                    public static final String MEMBER_ID = "memberId";
202                    public static final String DELEGATION_MEMBER_ID = "delegationMemberId";
203                    public static final String ROLE_MEMBER_ID = "roleMemberId";
204                    public static final String ROLE_RESPONSIBILITY_ID = "roleResponsibilityId";
205                    public static final String ROLE_RESPONSIBILITY_ACTION_ID = "roleResponsibilityActionId";
206                    public static final String KIM_PERMISSION_REQUIRED_ATTR_ID = "kimPermissionRequiredAttributeId";
207                    public static final String KIM_ATTRIBUTE_ID = "kimAttributeId";
208                    public static final String KIM_TYPE_CODE ="code";
209            }
210    
211            public static class UniqueKeyConstants {
212                    public static final String NAMESPACE_CODE = "namespaceCode";
213                    public static final String PRINCIPAL_NAME = "principalName";
214                    public static final String GROUP_NAME = "groupName";
215                    public static final String ROLE_NAME = "roleName";
216                    public static final String PERMISSION_NAME = "name";
217                    public static final String RESPONSIBILITY_NAME = "name";
218                    public static final String PERMISSION_TEMPLATE_NAME = "name";
219                    public static final String RESPONSIBILITY_TEMPLATE_NAME = "name";
220            }
221    
222            public static class SequenceNames {
223                    public static final String KRIM_PRNCPL_ID_S = "KRIM_PRNCPL_ID_S";
224                    public static final String KRIM_ENTITY_ID_S = "KRIM_ENTITY_ID_S";
225                    public static final String KRIM_ROLE_ID_S = "KRIM_ROLE_ID_S";
226                    public static final String KRIM_GROUP_ID_S = "KRIM_GRP_ID_S";
227                    public static final String KRIM_ROLE_PERM_ID_S = "KRIM_ROLE_PERM_ID_S";
228                    public static final String KRIM_ROLE_RSP_ID_S = "KRIM_ROLE_RSP_ID_S";
229                    public static final String KRIM_ROLE_MBR_ID_S = "KRIM_ROLE_MBR_ID_S";
230                    public static final String KRIM_DLGN_MBR_ID_S = "KRIM_DLGN_MBR_ID_S";
231                    public static final String KRIM_ROLE_RSP_ACTN_ID_S = "KRIM_ROLE_RSP_ACTN_ID_S";
232                    public static final String KRIM_DLGN_ID_S = "KRIM_DLGN_ID_S";
233                    public static final String KRIM_PERM_ID_S = "KRIM_PERM_ID_S";
234                    public static final String KRIM_RSP_ID_S = "KRIM_RSP_ID_S";
235                    public static final String KRIM_ATTR_DATA_ID_S = "KRIM_ATTR_DATA_ID_S";
236            }
237            
238            public static class CacheRefreshPeriodSeconds {
239                    public static final String KIM_CACHE_PERMISSION_REFRESH_PERIOD_SECONDS = "kim.cache.permission.refresh.period.seconds";
240                    public static final String KIM_CACHE_ROLE_REFRESH_PERIOD_SECONDS = "kim.cache.role.refresh.period.seconds";
241            }       
242    
243            public static class ParameterKey {
244                    public static final String SHOW_BLANK_QUALIFIERS = "KIM_SHOW_BLANK_QUALIFIERS";
245            }
246            
247            /**
248             *
249             * KimGroupS can contain other KimGroupS and KimPrincipalS.
250             * Use these constants to flags their members with the appropriate member
251             * type code.
252             *
253             * @author Kuali Rice Team (rice.collab@kuali.org)
254             */
255            public static class KimGroupMemberTypes {
256    
257                    /**
258                     * For group members that are themselves groups
259                     */
260                    public static final String GROUP_MEMBER_TYPE = "G";
261    
262                    /**
263                     * For group members that are principals
264                     */
265                    public static final String PRINCIPAL_MEMBER_TYPE = "P";
266            }
267    
268    }