View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kim.api;
17  
18  import org.kuali.rice.core.api.CoreConstants;
19  import org.kuali.rice.core.api.membership.MemberType;
20  
21  import java.util.HashMap;
22  import java.util.Map;
23  
24  public final class KimConstants {
25  
26  	public static final String KIM_MODULE_NAMESPACE = "KIM";
27  	
28  	public static final String NAMESPACE_CODE = "KR-IDM";
29  	public static final String KIM_TYPE_DEFAULT_NAMESPACE = "KUALI";
30  	public static final String KIM_TYPE_RICE_NAMESPACE = "RICE";
31  	public static final String KIM_TYPE_DEFAULT_NAME = "Default";
32  	public static final String KIM_GROUP_DEFAULT_NAMESPACE_CODE = "KUALI";
33  	public static final String KIM_GROUP_WORKFLOW_NAMESPACE_CODE = "KR-WKFLW";
34  	public static final String RESTRICTED_DATA_MASK = "Xxxxxx";
35  
36  	public static final String KIM_PERSON_SERVICE = "personService";
37  	public static final String DEFAULT_KIM_TYPE_SERVICE = "kimTypeService";
38  
39  	//Kim Attribute Boolean representations
40  	public static final String KIM_ATTRIBUTE_BOOLEAN_TRUE_STR_VALUE_DISPLAY = "Yes";
41  	public static final String KIM_ATTRIBUTE_BOOLEAN_FALSE_STR_VALUE_DISPLAY = "No";
42  	public static final String KIM_ATTRIBUTE_BOOLEAN_TRUE_STR_VALUE = "Y";
43  	public static final String KIM_ATTRIBUTE_BOOLEAN_FALSE_STR_VALUE = "N";
44  
45      public static final String KIM_ENABLE_HISTORY_KEY = "kim.enable.history";
46  	
47  	public static final class EntityTypes {
48  		public static final String PERSON = "PERSON";
49  		public static final String SYSTEM = "SYSTEM";
50  		
51  		private EntityTypes() {
52  			throw new UnsupportedOperationException("do not call");
53  		}
54  	}
55  
56      public static final class AddressTypes {
57          public static final String HOME = "HM";
58  		public static final String WORK = "WRK";
59          public static final String OTHER= "OTH";
60  
61  		private AddressTypes() {
62  			throw new UnsupportedOperationException("do not call");
63  		}
64      }
65  
66      public static final class NameTypes {
67          public static final String PREFERRED = "PRFR";
68  		public static final String PRIMARY = "PRM";
69          public static final String OTHER= "OTH";
70  
71  		private NameTypes() {
72  			throw new UnsupportedOperationException("do not call");
73  		}
74      }
75  
76      public static final class GenderChangeCodes {
77  		public static final String MALE_TO_FEMALE = "ChangeFemale";
78          public static final String FEMALE_TO_MALE = "ChangeMale";
79  
80  		private GenderChangeCodes() {
81  			throw new UnsupportedOperationException("do not call");
82  		}
83      }
84  
85  	public static final class PersonExternalIdentifierTypes {
86  		public static final String TAX = "TAX";
87  		
88  		private PersonExternalIdentifierTypes() {
89  			throw new UnsupportedOperationException("do not call");
90  		}
91  	}
92  	public static final class PersonAffiliationTypes {
93  		public static final String STAFF_AFFILIATION_TYPE = "STAFF";
94  		public static final String STUDENT_AFFILIATION_TYPE = "STUDENT";
95  		public static final String AFFILIATE_AFFILIATION_TYPE = "AFFILIATE";
96  		public static final String FACULTY_AFFILIATION_TYPE = "FACULTY";
97  		
98  		private PersonAffiliationTypes() {
99  			throw new UnsupportedOperationException("do not call");
100 		}
101 	}
102 
103 	public static final class PermissionTemplateNames {
104         public static final String FULL_UNMASK_FIELD = "Full Unmask Field";
105     	public static final String PARTIAL_UNMASK_FIELD = "Partial Unmask Field";
106     	public static final String VIEW_MAINTENANCE_INQUIRY_FIELD = "View Inquiry or Maintenance Document Field";
107     	public static final String MODIFY_FIELD = "Modify Maintenance Document Field";
108     	public static final String VIEW_SECTION = "View Inquiry or Maintenance Document Section";
109     	public static final String MODIFY_SECTION = "Modify Maintenance Document Section";
110     	public static final String CREATE_MAINTAIN_RECORDS = "Create / Maintain Record(s)";
111 
112     	public static final String EDIT_DOCUMENT = "Edit Document";
113     	public static final String COPY_DOCUMENT = "Copy Document";
114     	public static final String OPEN_DOCUMENT = "Open Document";
115     	public static final String TAKE_REQUESTED_ACTION = "Take Requested Action";
116     	public static final String INITIATE_DOCUMENT = "Initiate Document";
117     	public static final String BLANKET_APPROVE_DOCUMENT ="Blanket Approve Document";
118     	public static final String CANCEL_DOCUMENT ="Cancel Document";
119     	public static final String SAVE_DOCUMENT ="Save Document";
120     	public static final String ROUTE_DOCUMENT ="Route Document";
121     	public static final String APPROVE_DOCUMENT = "Approve Document";
122     	public static final String AD_HOC_REVIEW_DOCUMENT = "Ad Hoc Review Document";
123     	public static final String ADD_MESSAGE_TO_ROUTE_LOG = "Add Message to Route Log";
124     	
125     	public static final String ADD_NOTE_ATTACHMENT = "Add Note / Attachment";
126     	public static final String VIEW_NOTE_ATTACHMENT = "View Note / Attachment";
127     	public static final String DELETE_NOTE_ATTACHMENT = "Delete Note / Attachment";
128 
129     	public static final String USE_TRANSACTIONAL_DOCUMENT = "Use Transactional Document";
130         public static final String USE_VIEW = "Use View";
131 
132     	public static final String POPULATE_GROUP = "Populate Group";
133     	public static final String ASSIGN_ROLE = "Assign Role";
134     	public static final String GRANT_PERMISSION = "Grant Permission";
135     	public static final String GRANT_RESPONSIBILITY = "Grant Responsibility";
136 
137     	public static final String LOOK_UP_RECORDS = "Look Up Records";
138     	public static final String INQUIRE_INTO_RECORDS = "Inquire Into Records";
139     	public static final String USE_SCREEN = "Use Screen";
140         public static final String BACKDOOR_RESTRICTION = "Backdoor Restriction";
141 
142         public static final String PERFORM_CUSTOM_MAINTENANCE_DOCUMENT_FUNCTION ="Perform Custom Maintenance Document Function";
143     	public static final String MAINTAIN_SYSTEM_PARAMETER = "Maintain System Parameter";
144     	public static final String SEND_AD_HOC_REQUEST ="Send Ad Hoc Request";
145 
146         public static final String EDIT_VIEW = "Edit View";
147     	public static final String OPEN_VIEW = "Open View";
148         public static final String EDIT_FIELD = "Edit Field";
149         public static final String VIEW_FIELD = "View Field";
150         public static final String EDIT_GROUP = "Edit Group";
151         public static final String VIEW_GROUP = "View Group";
152         public static final String EDIT_WIDGET = "Edit Widget";
153         public static final String VIEW_WIDGET = "View Widget";
154         public static final String PERFORM_ACTION = "Perform Action";
155         public static final String EDIT_LINE = "Edit Line";
156         public static final String VIEW_LINE = "View Line";
157         public static final String EDIT_LINE_FIELD = "Edit Line Field";
158         public static final String VIEW_LINE_FIELD = "View Line Field";
159         public static final String PERFORM_LINE_ACTION = "Perform Line Action";
160         // KULRICE-12281: Turn off the ability to export results from the person lookup
161 		public static final String VIEW_RESULTS_EXPORT_ACTION = "Export Records";
162 
163 		private PermissionTemplateNames() {
164 			throw new UnsupportedOperationException("do not call");
165 		}
166 	}
167 
168 	public final static class PermissionNames {
169 		public static final String LOG_IN = "Log In Kuali Portal";
170 		public static final String ADMIN_PESSIMISTIC_LOCKING = "Administer Pessimistic Locking";
171 		public static final String OVERRIDE_ENTITY_PRIVACY_PREFERENCES = "Override Entity Privacy Preferences";
172     	public static final String MODIFY_ENTITY = "Modify Entity";
173     	public static final String ACCESS_LOCKED_MODULE = "Access Locked Module";
174     	
175 		private PermissionNames() {
176 			throw new UnsupportedOperationException("do not call");
177 		}
178 	}
179 
180 	public final static class KimUIConstants {
181 		public static final String NAME_VALUE_SEPARATOR = " : ";
182 		public static final String COMMA_SEPARATOR = ", ";
183 		public static final String OR_OPERATOR = "|";
184 		public static final String URL_SEPARATOR = "/";
185 		public static final String PARAMETERIZED_URL_SEPARATOR = "%2F";
186 		public static final String KIM_URL_KEY = "kim.url";
187 		public static final String KIM_APPLICATION = "kim";
188 		public static final String MEMBER_ID_PREFIX = PrimaryKeyConstants.MEMBER_ID+".";
189 		public static final String MEMBER_NAME = "memberName";
190 		public static final String MEMBER_NAMESPACE_CODE = "memberNamespaceCode";
191 		public static final String MEMBER_TYPE_PRINCIPAL = "Principal";
192 		public static final String MEMBER_TYPE_GROUP = "Group";
193 		public static final String MEMBER_TYPE_ROLE = "Role";
194 		public static final Map<String, String> KIM_MEMBER_TYPES_MAP = getKimMemberTypesMap();
195 	    private static Map<String, String> getKimMemberTypesMap() {
196 	    	Map<String, String> kimDocumentActionsMap = new HashMap<String, String>();
197 	    	kimDocumentActionsMap.put(MemberType.PRINCIPAL.getCode(), MEMBER_TYPE_PRINCIPAL);
198 	    	kimDocumentActionsMap.put(MemberType.GROUP.getCode(), MEMBER_TYPE_GROUP);
199 	    	kimDocumentActionsMap.put(MemberType.ROLE.getCode(), MEMBER_TYPE_ROLE);
200 	        return kimDocumentActionsMap;
201 	    }
202 
203 		public static final String KIM_ROLE_DOCUMENT_TYPE_NAME = "IdentityManagementRoleDocument";
204 		public static final String KIM_GROUP_DOCUMENT_TYPE_NAME = "IdentityManagementGroupDocument";
205 		public static final String KIM_PERSON_DOCUMENT_TYPE_NAME = "IdentityManagementPersonDocument";
206 		public static final String KIM_PERMISSION_DOCUMENT_TYPE_NAME = "IdentityManagementGenericPermissionMaintenanceDocument";
207 		public static final String KIM_REVIEW_RESPONSIBILITY_DOCUMENT_TYPE_NAME = "IdentityManagementReviewResponsibilityMaintenanceDocument";
208 		public static final String KIM_ROLE_DOCUMENT_SHORT_KEY = "IMRD";
209 		public static final String KIM_GROUP_DOCUMENT_SHORT_KEY = "IMGD";
210         public static final String KIM_PERSON_DOCUMENT_SHORT_KEY = "IMPD";
211         public static final String KIM_GROUP_INQUIRY_SORT_DESC_VALUE = "KIM_GROUP_INQUIRY_SORT_DESC_VALUE";
212         public static final String KIM_GROUP_INQUIRY_SORT_PREV_COL_NM = "KIM_GROUP_INQUIRY_SORT_PREV_COL_NM";
213         public static final String KIM_ROLE_INQUIRY_SORT_DESC_VALUE = "KIM_ROLE_INQUIRY_SORT_DESC_VALUE";
214         public static final String KIM_ROLE_INQUIRY_SORT_PREV_COL_NM = "KIM_ROLE_INQUIRY_SORT_PREV_COL_NM";
215 
216         public static final String KIM_ROLE_DOCUMENT_ACTION = "identityManagementRoleDocument.do";
217 		public static final String KIM_ROLE_INQUIRY_ACTION = "identityManagementRoleInquiry.do";
218 		public static final String KIM_PERSON_DOCUMENT_ACTION = "identityManagementPersonDocument.do";
219 		public static final String KIM_PERSON_INQUIRY_ACTION = "identityManagementPersonInquiry.do";
220 		public static final String KIM_GROUP_DOCUMENT_ACTION = "identityManagementGroupDocument.do";
221 		public static final String KIM_GROUP_INQUIRY_ACTION = "identityManagementGroupInquiry.do";
222 		public static final Map<String, String> KIM_DOCUMENTS_ACTIONS_MAP = getDocumentActionsMap();
223 	    private static Map<String, String> getDocumentActionsMap() {
224 	    	Map<String, String> kimDocumentActionsMap = new HashMap<String, String>();
225 	    	kimDocumentActionsMap.put(KIM_ROLE_DOCUMENT_SHORT_KEY, KIM_ROLE_DOCUMENT_ACTION);
226 	    	kimDocumentActionsMap.put(KIM_GROUP_DOCUMENT_SHORT_KEY, KIM_GROUP_DOCUMENT_ACTION);
227 	    	kimDocumentActionsMap.put(KIM_PERSON_DOCUMENT_SHORT_KEY, KIM_PERSON_DOCUMENT_ACTION);
228 	        return kimDocumentActionsMap;
229 	    }
230 
231 		public static final Map<String, String> KIM_DOCUMENT_TYPE_NAMES_MAP = getDocumentTypeNamesMap();
232 	    private static Map<String, String> getDocumentTypeNamesMap() {
233 	    	Map<String, String> kimDocumentTypeNamesMap = new HashMap<String, String>();
234 			kimDocumentTypeNamesMap.put(KIM_ROLE_DOCUMENT_SHORT_KEY, KIM_ROLE_DOCUMENT_TYPE_NAME);
235 			kimDocumentTypeNamesMap.put(KIM_GROUP_DOCUMENT_SHORT_KEY, KIM_GROUP_DOCUMENT_TYPE_NAME);
236 			kimDocumentTypeNamesMap.put(KIM_PERSON_DOCUMENT_SHORT_KEY, KIM_PERSON_DOCUMENT_TYPE_NAME);
237 			return kimDocumentTypeNamesMap;
238 	    }
239 
240 	    public static final String DELEGATION_PRIMARY = "P";
241 	    public static final String DELEGATION_SECONDARY = "S";
242 	    public static final String DELEGATION_PRIMARY_LABEL = "Primary";
243 	    public static final String DELEGATION_SECONDARY_LABEL = "Secondary";
244 
245 	    public static final Map<String, String> DELEGATION_TYPES = getDelegationTypesMap();
246 	    private static Map<String, String> getDelegationTypesMap() {
247 	    	Map<String, String> delegationTypesMap = new HashMap<String, String>();
248 	    	delegationTypesMap.put(DELEGATION_PRIMARY, DELEGATION_PRIMARY_LABEL);
249 	    	delegationTypesMap.put(DELEGATION_SECONDARY, DELEGATION_SECONDARY_LABEL);
250 	    	return delegationTypesMap;
251 	    }
252 
253 	    public static final String ROLE_LOOKUPABLE_IMPL = "roleLookupable";
254 	    public static final String KIM_DOCUMENT_ROLE_MEMBER_LOOKUPABLE_IMPL = "kimDocumentRoleMemberLookupable";
255 	    public static final String ROLE_MEMBER_LOOKUPABLE_IMPL = "roleMemberImplLookupable";
256 	    public static final String ROLE_MEMBERS_COLLECTION_NAME = "roleMembers";
257 	    
258 		private KimUIConstants() {
259 			throw new UnsupportedOperationException("do not call");
260 		}
261 	}
262 
263 	public final static class PrimaryKeyConstants {
264 		public static final String ENTITY_ID = "id";
265         public static final String SUB_ENTITY_ID = "entityId";
266 		public static final String PRINCIPAL_ID = "principalId";
267 		public static final String ROLE_ID = "id";
268         public static final String SUB_ROLE_ID = "roleId";
269 		public static final String GROUP_ID = "id";
270 		public static final String KIM_TYPE_ID = "id";
271 		public static final String RESPONSIBILITY_ID = "id";
272 		public static final String PERMISSION_ID = "id";
273 		public static final String DELEGATION_ID = "delegationId";
274 		public static final String MEMBER_ID = "memberId";
275 		public static final String DELEGATION_MEMBER_ID = "delegationMemberId";
276 		public static final String ROLE_MEMBER_ID = "roleMemberId";
277 		public static final String ROLE_RESPONSIBILITY_ID = "roleResponsibilityId";
278 		public static final String ROLE_RESPONSIBILITY_ACTION_ID = "roleResponsibilityActionId";
279 		public static final String KIM_PERMISSION_REQUIRED_ATTR_ID = "kimPermissionRequiredAttributeId";
280 		public static final String KIM_ATTRIBUTE_ID = "id";
281 		public static final String KIM_TYPE_CODE ="id";
282         public static final String ID = "id";
283         public static final String CODE = "code";
284 		
285 		private PrimaryKeyConstants() {
286 			throw new UnsupportedOperationException("do not call");
287 		}
288 	}
289 
290 	public final static class UniqueKeyConstants {
291 		public static final String NAMESPACE_CODE = "namespaceCode";
292 		public static final String PRINCIPAL_NAME = "principalName";
293 		public static final String GROUP_NAME = "name";
294 		public static final String ROLE_NAME = "name";
295 		public static final String PERMISSION_NAME = "name";
296 		public static final String RESPONSIBILITY_NAME = "name";
297 		public static final String PERMISSION_TEMPLATE_NAME = "name";
298 		public static final String RESPONSIBILITY_TEMPLATE_NAME = "name";
299         public static final String NAME = "name";
300 		
301 		private UniqueKeyConstants() {
302 			throw new UnsupportedOperationException("do not call");
303 		}
304 	}
305 
306 	public final static class SequenceNames {
307 		public static final String KRIM_PRNCPL_ID_S = "KRIM_PRNCPL_ID_S";
308 		public static final String KRIM_ENTITY_ID_S = "KRIM_ENTITY_ID_S";
309 		public static final String KRIM_ROLE_ID_S = "KRIM_ROLE_ID_S";
310 		public static final String KRIM_GROUP_ID_S = "KRIM_GRP_ID_S";
311 		public static final String KRIM_ROLE_PERM_ID_S = "KRIM_ROLE_PERM_ID_S";
312 		public static final String KRIM_ROLE_RSP_ID_S = "KRIM_ROLE_RSP_ID_S";
313 		public static final String KRIM_ROLE_MBR_ID_S = "KRIM_ROLE_MBR_ID_S";
314 		public static final String KRIM_DLGN_MBR_ID_S = "KRIM_DLGN_MBR_ID_S";
315 		public static final String KRIM_ROLE_RSP_ACTN_ID_S = "KRIM_ROLE_RSP_ACTN_ID_S";
316 		public static final String KRIM_DLGN_ID_S = "KRIM_DLGN_ID_S";
317 		public static final String KRIM_PERM_ID_S = "KRIM_PERM_ID_S";
318 		public static final String KRIM_RSP_ID_S = "KRIM_RSP_ID_S";
319 		public static final String KRIM_ATTR_DATA_ID_S = "KRIM_ATTR_DATA_ID_S";
320 		
321 		private SequenceNames() {
322 			throw new UnsupportedOperationException("do not call");
323 		}
324 	}
325 
326     public final static class AttributeConstants {
327         public static final String PRINCIPAL_ID = "principalId";
328         public static final String PRINCIPAL_NAME = "principalName";
329         public static final String BUTTON_NAME = "buttonName";
330         public static final String BEAN_NAME = "beanName";
331         public static final String ACTION_CLASS = "actionClass";
332         public static final String NAME = "name";
333         public static final String NAMESPACE_CODE = "namespaceCode";
334         public static final String COMPONENT_NAME = "componentName";
335         public static final String PROPERTY_NAME = "propertyName";
336         public static final String EXISTING_RECORDS_ONLY = "existingRecordsOnly";
337         public static final String CREATED_BY_SELF = "createdBySelf";
338         public static final String CREATED_BY_SELF_ONLY = "createdBySelfOnly";
339         public static final String ATTACHMENT_TYPE_CODE = "attachmentTypeCode";
340         public static final String EDIT_MODE = "editMode";
341         public static final String PARAMETER_NAME = "parameterName";
342         public static final String CAMPUS_CODE = "campusCode";
343         public static final String ACTION_REQUEST_CD = "actionRequestCd";
344         public static final String ROUTE_STATUS_CODE = "routeStatusCode";
345         public static final String APP_DOC_STATUS = "appDocStatus";
346         public static final String ROUTE_NODE_NAME = "routeNodeName";
347         public static final String ROLE_NAME = "roleName";
348         public static final String PERMISSION_NAME = "permissionName";
349         public static final String RESPONSIBILITY_NAME = "responsibilityName";
350         public static final String ATTRIBUTE_NAME = "attributeName";
351         public static final String GROUP_NAME = "groupName";
352         public static final String REQUIRED = "required";
353         public static final String ACTION_DETAILS_AT_ROLE_MEMBER_LEVEL = "actionDetailsAtRoleMemberLevel";
354         public static final String DOCUMENT_NUMBER = "documentNumber";
355         public static final String DOCUMENT_TYPE_NAME = "documentTypeName";
356         public static final String APP_CODE = "appCode";
357         public static final String SECTION_ID = "sectionId";
358         public static final String KIM_TYPE_ID = PrimaryKeyConstants.KIM_TYPE_ID;
359         public static final String KIM_TYPE_NAME = "kimTypeName";
360         public static final String QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER = "qualifierResolverProvidedIdentifier";
361         public static final String VIEW_ID = "viewId";
362         public static final String ACTION_EVENT = "actionEvent";
363         public static final String COLLECTION_PROPERTY_NAME = "collectionPropertyName";
364         public static final String FIELD_ID = "fieldId";
365         public static final String GROUP_ID = "groupId";
366         public static final String WIDGET_ID = "widgetId";
367     }
368 
369 	/**
370 	 *
371 	 * KimGroupS can contain other KimGroupS and KimPrincipalS.
372 	 * Use these constants to flags their members with the appropriate member
373 	 * type code.
374 	 *
375 	 * @author Kuali Rice Team (rice.collab@kuali.org)
376 	 */
377 	public final static class KimGroupMemberTypes {
378 
379 		/**
380 		 * For group members that are themselves groups
381 		 */
382 		public static final MemberType GROUP_MEMBER_TYPE = MemberType.GROUP;
383 
384 		/**
385 		 * For group members that are principals
386 		 */
387 		public static final MemberType PRINCIPAL_MEMBER_TYPE = MemberType.PRINCIPAL;
388 
389 		private KimGroupMemberTypes() {
390 			throw new UnsupportedOperationException("do not call");
391 		}
392 	}
393 
394 	private KimConstants() {
395 		throw new UnsupportedOperationException("do not call");
396 	}
397 
398     public final static String SERVICE_PATH_SOAP = "soap/" + Namespaces.MODULE_NAME + "/" + CoreConstants.Versions.VERSION_2_0;
399 
400     public final static class Namespaces {
401         public static final String MODULE_NAME = "kim";
402         public static final String KIM_NAMESPACE_PREFIX = CoreConstants.Namespaces.ROOT_NAMESPACE_PREFIX + "/" + MODULE_NAME;
403 
404         public static final String KIM_NAMESPACE_2_0 = KIM_NAMESPACE_PREFIX + "/" + CoreConstants.Versions.VERSION_2_0;
405     }
406     
407     public static class ParameterKey {
408     	public static final String SHOW_BLANK_QUALIFIERS = "KIM_SHOW_BLANK_QUALIFIERS";
409 	}
410     
411 }