View Javadoc

1   /*
2    * Copyright 2007-2008 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.util;
17  
18  import org.kuali.rice.core.api.CoreConstants;
19  
20  import java.util.HashMap;
21  import java.util.Map;
22  
23  /**
24   * This is a description of what this class does - jonathan don't forget to fill this in.
25   *
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   *
28   */
29  public final class KimConstants {
30  
31  	public static final String KIM_MODULE_NAMESPACE = "KIM";
32  	
33  	public static final String NAMESPACE_CODE = "KR-IDM";
34  	public static final String KIM_TYPE_DEFAULT_NAMESPACE = "KUALI";
35  	public static final String KIM_TYPE_DEFAULT_NAME = "Default";
36  	public static final String KIM_GROUP_DEFAULT_NAMESPACE_CODE = "KUALI";
37  	public static final String KIM_GROUP_WORKFLOW_NAMESPACE_CODE = "KR-WKFLW";
38  	public static final String RESTRICTED_DATA_MASK = "Xxxxxx";
39  
40  	//Kim services constants for API
41  	public static final String KIM_IDENTITY_MANAGEMENT_SERVICE = "kimIdentityManagementService";
42  	public static final String KIM_PERSON_SERVICE = "personService";
43  	public static final String DEFAULT_KIM_TYPE_SERVICE = "kimTypeService";
44  
45  	//Kim Attribute Boolean representations
46  	public static final String KIM_ATTRIBUTE_BOOLEAN_TRUE_STR_VALUE_DISPLAY = "Yes";
47  	public static final String KIM_ATTRIBUTE_BOOLEAN_FALSE_STR_VALUE_DISPLAY = "No";
48  	public static final String KIM_ATTRIBUTE_BOOLEAN_TRUE_STR_VALUE = "Y";
49  	public static final String KIM_ATTRIBUTE_BOOLEAN_FALSE_STR_VALUE = "N";
50  	
51  	public static final class EntityTypes {
52  		public static final String PERSON = "PERSON";
53  		public static final String SYSTEM = "SYSTEM";
54  		
55  		private EntityTypes() {
56  			throw new UnsupportedOperationException("do not call");
57  		}
58  	}
59  
60  	public static final class PersonExternalIdentifierTypes {
61  		public static final String TAX = "TAX";
62  		
63  		private PersonExternalIdentifierTypes() {
64  			throw new UnsupportedOperationException("do not call");
65  		}
66  	}
67  	public static final class PersonAffiliationTypes {
68  		public static final String STAFF_AFFILIATION_TYPE = "STAFF";
69  		public static final String STUDENT_AFFILIATION_TYPE = "STUDENT";
70  		public static final String AFFILIATE_AFFILIATION_TYPE = "AFFILIATE";
71  		public static final String FACULTY_AFFILIATION_TYPE = "FACULTY";
72  		
73  		private PersonAffiliationTypes() {
74  			throw new UnsupportedOperationException("do not call");
75  		}
76  	}
77  
78  	public static final class PermissionTemplateNames {
79          public static final String FULL_UNMASK_FIELD = "Full Unmask Field";
80      	public static final String PARTIAL_UNMASK_FIELD = "Partial Unmask Field";
81      	public static final String VIEW_FIELD = "View Inquiry or Maintenance Document Field";
82      	public static final String MODIFY_FIELD = "Modify Maintenance Document Field";
83      	public static final String VIEW_SECTION = "View Inquiry or Maintenance Document Section";
84      	public static final String MODIFY_SECTION = "Modify Maintenance Document Section";
85      	public static final String CREATE_MAINTAIN_RECORDS = "Create / Maintain Record(s)";
86  
87      	public static final String EDIT_DOCUMENT = "Edit Document";
88      	public static final String COPY_DOCUMENT = "Copy Document";
89      	public static final String OPEN_DOCUMENT = "Open Document";
90      	public static final String TAKE_REQUESTED_ACTION = "Take Requested Action";
91      	public static final String INITIATE_DOCUMENT = "Initiate Document";
92      	public static final String BLANKET_APPROVE_DOCUMENT ="Blanket Approve Document";
93      	public static final String CANCEL_DOCUMENT ="Cancel Document";
94      	public static final String SAVE_DOCUMENT ="Save Document";
95      	public static final String ROUTE_DOCUMENT ="Route Document";
96      	public static final String APPROVE_DOCUMENT = "Approve Document";
97      	public static final String AD_HOC_REVIEW_DOCUMENT = "Ad Hoc Review Document";
98      	public static final String ADD_MESSAGE_TO_ROUTE_LOG = "Add Message to Route Log";
99      	
100     	public static final String ADD_NOTE_ATTACHMENT = "Add Note / Attachment";
101     	public static final String VIEW_NOTE_ATTACHMENT = "View Note / Attachment";
102     	public static final String DELETE_NOTE_ATTACHMENT = "Delete Note / Attachment";
103 
104     	public static final String USE_TRANSACTIONAL_DOCUMENT = "Use Transactional Document";
105 
106     	public static final String POPULATE_GROUP = "Populate Group";
107     	public static final String ASSIGN_ROLE = "Assign Role";
108     	public static final String GRANT_PERMISSION = "Grant Permission";
109     	public static final String GRANT_RESPONSIBILITY = "Grant Responsibility";
110 
111     	public static final String LOOK_UP_RECORDS = "Look Up Records";
112     	public static final String INQUIRE_INTO_RECORDS = "Inquire Into Records";
113     	public static final String USE_SCREEN = "Use Screen";
114 
115     	public static final String PERFORM_CUSTOM_MAINTENANCE_DOCUMENT_FUNCTION ="Perform Custom Maintenance Document Function";
116     	public static final String MAINTAIN_SYSTEM_PARAMETER = "Maintain System Parameter";
117     	public static final String SEND_AD_HOC_REQUEST ="Send Ad Hoc Request";
118     	
119 		private PermissionTemplateNames() {
120 			throw new UnsupportedOperationException("do not call");
121 		}
122 	}
123 
124 	public final static class PermissionNames {
125 		public static final String LOG_IN = "Log In";
126 		public static final String ADMIN_PESSIMISTIC_LOCKING = "Administer Pessimistic Locking";
127 		public static final String OVERRIDE_ENTITY_PRIVACY_PREFERENCES = "Override Entity Privacy Preferences";
128     	public static final String MODIFY_ENTITY = "Modify Entity";
129     	
130 		private PermissionNames() {
131 			throw new UnsupportedOperationException("do not call");
132 		}
133 	}
134 
135 	public final static class KimUIConstants {
136 		public static final String NAME_VALUE_SEPARATOR = " : ";
137 		public static final String COMMA_SEPARATOR = ", ";
138 		public static final String OR_OPERATOR = "|";
139 		public static final String URL_SEPARATOR = "/";
140 		public static final String PARAMETERIZED_URL_SEPARATOR = "%2F";
141 		public static final String KIM_URL_KEY = "kim.url";
142 		public static final String KIM_APPLICATION = "kim";
143 		public static final String MEMBER_ID_PREFIX = PrimaryKeyConstants.MEMBER_ID+".";
144 		public static final String MEMBER_NAME = "memberName";
145 		public static final String MEMBER_NAMESPACE_CODE = "memberNamespaceCode";
146 		public static final String MEMBER_TYPE_PRINCIPAL_CODE = "P";
147 		public static final String MEMBER_TYPE_GROUP_CODE = "G";
148 		public static final String MEMBER_TYPE_ROLE_CODE = "R";
149 		public static final String MEMBER_TYPE_PRINCIPAL = "Principal";
150 		public static final String MEMBER_TYPE_GROUP = "Group";
151 		public static final String MEMBER_TYPE_ROLE = "Role";
152 		public static final Map<String, String> KIM_MEMBER_TYPES_MAP = getKimMemberTypesMap();
153 	    private static Map<String, String> getKimMemberTypesMap() {
154 	    	Map<String, String> kimDocumentActionsMap = new HashMap<String, String>();
155 	    	kimDocumentActionsMap.put(MEMBER_TYPE_PRINCIPAL_CODE, MEMBER_TYPE_PRINCIPAL);
156 	    	kimDocumentActionsMap.put(MEMBER_TYPE_GROUP_CODE, MEMBER_TYPE_GROUP);
157 	    	kimDocumentActionsMap.put(MEMBER_TYPE_ROLE_CODE, MEMBER_TYPE_ROLE);
158 	        return kimDocumentActionsMap;
159 	    }
160 
161 		public static final String KIM_ROLE_DOCUMENT_TYPE_NAME = "IdentityManagementRoleDocument";
162 		public static final String KIM_GROUP_DOCUMENT_TYPE_NAME = "IdentityManagementGroupDocument";
163 		public static final String KIM_PERSON_DOCUMENT_TYPE_NAME = "IdentityManagementPersonDocument";
164 		public static final String KIM_PERMISSION_DOCUMENT_TYPE_NAME = "IdentityManagementGenericPermissionMaintenanceDocument";
165 		public static final String KIM_REVIEW_RESPONSIBILITY_DOCUMENT_TYPE_NAME = "IdentityManagementReviewResponsibilityMaintenanceDocument";
166 		public static final String KIM_ROLE_DOCUMENT_SHORT_KEY = "IMRD";
167 		public static final String KIM_GROUP_DOCUMENT_SHORT_KEY = "IMGD";
168 		public static final String KIM_PERSON_DOCUMENT_SHORT_KEY = "IMPD";
169 		public static final String KIM_ROLE_DOCUMENT_ACTION = "identityManagementRoleDocument.do";
170 		public static final String KIM_ROLE_INQUIRY_ACTION = "identityManagementRoleInquiry.do";
171 		public static final String KIM_PERSON_DOCUMENT_ACTION = "identityManagementPersonDocument.do";
172 		public static final String KIM_PERSON_INQUIRY_ACTION = "identityManagementPersonInquiry.do";
173 		public static final String KIM_GROUP_DOCUMENT_ACTION = "identityManagementGroupDocument.do";
174 		public static final String KIM_GROUP_INQUIRY_ACTION = "identityManagementGroupInquiry.do";
175 		public static final Map<String, String> KIM_DOCUMENTS_ACTIONS_MAP = getDocumentActionsMap();
176 	    private static Map<String, String> getDocumentActionsMap() {
177 	    	Map<String, String> kimDocumentActionsMap = new HashMap<String, String>();
178 	    	kimDocumentActionsMap.put(KIM_ROLE_DOCUMENT_SHORT_KEY, KIM_ROLE_DOCUMENT_ACTION);
179 	    	kimDocumentActionsMap.put(KIM_GROUP_DOCUMENT_SHORT_KEY, KIM_GROUP_DOCUMENT_ACTION);
180 	    	kimDocumentActionsMap.put(KIM_PERSON_DOCUMENT_SHORT_KEY, KIM_PERSON_DOCUMENT_ACTION);
181 	        return kimDocumentActionsMap;
182 	    }
183 
184 		public static final Map<String, String> KIM_DOCUMENT_TYPE_NAMES_MAP = getDocumentTypeNamesMap();
185 	    private static Map<String, String> getDocumentTypeNamesMap() {
186 	    	Map<String, String> kimDocumentTypeNamesMap = new HashMap<String, String>();
187 			kimDocumentTypeNamesMap.put(KIM_ROLE_DOCUMENT_SHORT_KEY, KIM_ROLE_DOCUMENT_TYPE_NAME);
188 			kimDocumentTypeNamesMap.put(KIM_GROUP_DOCUMENT_SHORT_KEY, KIM_GROUP_DOCUMENT_TYPE_NAME);
189 			kimDocumentTypeNamesMap.put(KIM_PERSON_DOCUMENT_SHORT_KEY, KIM_PERSON_DOCUMENT_TYPE_NAME);
190 			return kimDocumentTypeNamesMap;
191 	    }
192 
193 	    public static final String DELEGATION_PRIMARY = "P";
194 	    public static final String DELEGATION_SECONDARY = "S";
195 	    public static final String DELEGATION_PRIMARY_LABEL = "Primary";
196 	    public static final String DELEGATION_SECONDARY_LABEL = "Secondary";
197 
198 	    public static final Map<String, String> DELEGATION_TYPES = getDelegationTypesMap();
199 	    private static Map<String, String> getDelegationTypesMap() {
200 	    	Map<String, String> delegationTypesMap = new HashMap<String, String>();
201 	    	delegationTypesMap.put(DELEGATION_PRIMARY, DELEGATION_PRIMARY_LABEL);
202 	    	delegationTypesMap.put(DELEGATION_SECONDARY, DELEGATION_SECONDARY_LABEL);
203 	    	return delegationTypesMap;
204 	    }
205 
206 	    public static final String ROLE_LOOKUPABLE_IMPL = "roleLookupable";
207 	    public static final String KIM_DOCUMENT_ROLE_MEMBER_LOOKUPABLE_IMPL = "kimDocumentRoleMemberLookupable";
208 	    public static final String ROLE_MEMBER_LOOKUPABLE_IMPL = "roleMemberImplLookupable";
209 	    public static final String ROLE_MEMBERS_COLLECTION_NAME = "roleMembers";
210 	    
211 		private KimUIConstants() {
212 			throw new UnsupportedOperationException("do not call");
213 		}
214 	}
215 
216 	public final static class PrimaryKeyConstants {
217 		public static final String ENTITY_ID = "entityId";
218 		public static final String PRINCIPAL_ID = "principalId";
219 		public static final String ROLE_ID = "roleId";
220 		public static final String GROUP_ID = "id";
221 		public static final String KIM_TYPE_ID = "id";
222 		public static final String RESPONSIBILITY_ID = "id";
223 		public static final String PERMISSION_ID = "permissionId";
224 		public static final String DELEGATION_ID = "delegationId";
225 		public static final String MEMBER_ID = "memberId";
226 		public static final String DELEGATION_MEMBER_ID = "delegationMemberId";
227 		public static final String ROLE_MEMBER_ID = "roleMemberId";
228 		public static final String ROLE_RESPONSIBILITY_ID = "roleResponsibilityId";
229 		public static final String ROLE_RESPONSIBILITY_ACTION_ID = "roleResponsibilityActionId";
230 		public static final String KIM_PERMISSION_REQUIRED_ATTR_ID = "kimPermissionRequiredAttributeId";
231 		public static final String KIM_ATTRIBUTE_ID = "kimAttributeId";
232 		public static final String KIM_TYPE_CODE ="code";
233 		
234 		private PrimaryKeyConstants() {
235 			throw new UnsupportedOperationException("do not call");
236 		}
237 	}
238 
239 	public final static class UniqueKeyConstants {
240 		public static final String NAMESPACE_CODE = "namespaceCode";
241 		public static final String PRINCIPAL_NAME = "principalName";
242 		public static final String GROUP_NAME = "name";
243 		public static final String ROLE_NAME = "roleName";
244 		public static final String PERMISSION_NAME = "name";
245 		public static final String RESPONSIBILITY_NAME = "name";
246 		public static final String PERMISSION_TEMPLATE_NAME = "name";
247 		public static final String RESPONSIBILITY_TEMPLATE_NAME = "name";
248 		
249 		private UniqueKeyConstants() {
250 			throw new UnsupportedOperationException("do not call");
251 		}
252 	}
253 
254 	public final static class SequenceNames {
255 		public static final String KRIM_PRNCPL_ID_S = "KRIM_PRNCPL_ID_S";
256 		public static final String KRIM_ENTITY_ID_S = "KRIM_ENTITY_ID_S";
257 		public static final String KRIM_ROLE_ID_S = "KRIM_ROLE_ID_S";
258 		public static final String KRIM_GROUP_ID_S = "KRIM_GRP_ID_S";
259 		public static final String KRIM_ROLE_PERM_ID_S = "KRIM_ROLE_PERM_ID_S";
260 		public static final String KRIM_ROLE_RSP_ID_S = "KRIM_ROLE_RSP_ID_S";
261 		public static final String KRIM_ROLE_MBR_ID_S = "KRIM_ROLE_MBR_ID_S";
262 		public static final String KRIM_DLGN_MBR_ID_S = "KRIM_DLGN_MBR_ID_S";
263 		public static final String KRIM_ROLE_RSP_ACTN_ID_S = "KRIM_ROLE_RSP_ACTN_ID_S";
264 		public static final String KRIM_DLGN_ID_S = "KRIM_DLGN_ID_S";
265 		public static final String KRIM_PERM_ID_S = "KRIM_PERM_ID_S";
266 		public static final String KRIM_RSP_ID_S = "KRIM_RSP_ID_S";
267 		public static final String KRIM_ATTR_DATA_ID_S = "KRIM_ATTR_DATA_ID_S";
268 		
269 		private SequenceNames() {
270 			throw new UnsupportedOperationException("do not call");
271 		}
272 	}
273 	
274 	public static class CacheRefreshPeriodSeconds {
275 		public static final String KIM_CACHE_PERMISSION_REFRESH_PERIOD_SECONDS = "kim.cache.permission.refresh.period.seconds";
276 		public static final String KIM_CACHE_ROLE_REFRESH_PERIOD_SECONDS = "kim.cache.role.refresh.period.seconds";
277 	}
278 
279     public final static class AttributeConstants {
280 
281         public static final String PRINCIPAL_ID = KIMPropertyConstants.Person.PRINCIPAL_ID;
282         public static final String BUTTON_NAME = "buttonName";
283         public static final String BEAN_NAME = "beanName";
284         public static final String ACTION_CLASS = "actionClass";
285         public static final String NAMESPACE_CODE = "namespaceCode";
286         public static final String COMPONENT_NAME = "componentName";
287         public static final String PROPERTY_NAME = "propertyName";
288         public static final String EXISTING_RECORDS_ONLY = "existingRecordsOnly";
289         public static final String CREATED_BY_SELF = "createdBySelf";
290         public static final String CREATED_BY_SELF_ONLY = "createdBySelfOnly";
291         public static final String ATTACHMENT_TYPE_CODE = "attachmentTypeCode";
292         public static final String EDIT_MODE = "editMode";
293         public static final String PARAMETER_NAME = "parameterName";
294         public static final String CAMPUS_CODE = "campusCode";
295         public static final String ACTION_REQUEST_CD = "actionRequestCd";
296         public static final String ROUTE_STATUS_CODE = "routeStatusCode";
297         public static final String ROUTE_NODE_NAME = "routeNodeName";
298         public static final String ROLE_NAME = "roleName";
299         public static final String PERMISSION_NAME = "permissionName";
300         public static final String RESPONSIBILITY_NAME = "responsibilityName";
301         public static final String GROUP_NAME = "groupName";
302         public static final String REQUIRED = "required";
303         public static final String ACTION_DETAILS_AT_ROLE_MEMBER_LEVEL = "actionDetailsAtRoleMemberLevel";
304         public static final String DOCUMENT_NUMBER = "documentNumber";
305         public static final String DOCUMENT_TYPE_NAME = "documentTypeName";
306         public static final String SECTION_ID = "sectionId";
307         public static final String KIM_TYPE_ID = PrimaryKeyConstants.KIM_TYPE_ID;
308         public static final String QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER = "qualifierResolverProvidedIdentifier";
309     }
310 
311 	/**
312 	 *
313 	 * KimGroupS can contain other KimGroupS and KimPrincipalS.
314 	 * Use these constants to flags their members with the appropriate member
315 	 * type code.
316 	 *
317 	 * @author Kuali Rice Team (rice.collab@kuali.org)
318 	 */
319 	public final static class KimGroupMemberTypes {
320 
321 		/**
322 		 * For group members that are themselves groups
323 		 */
324 		public static final String GROUP_MEMBER_TYPE = "G";
325 
326 		/**
327 		 * For group members that are principals
328 		 */
329 		public static final String PRINCIPAL_MEMBER_TYPE = "P";
330 		
331 		private KimGroupMemberTypes() {
332 			throw new UnsupportedOperationException("do not call");
333 		}
334 	}
335 
336 	private KimConstants() {
337 		throw new UnsupportedOperationException("do not call");
338 	}
339 
340     public final static class Namespaces {
341         public static final String KIM_NAMESPACE_PREFIX = CoreConstants.Namespaces.ROOT_NAMESPACE_PREFIX + "/kim";
342 
343         public static final String KIM_NAMESPACE_2_0 = KIM_NAMESPACE_PREFIX + "/" + CoreConstants.Versions.VERSION_2_0;
344     }
345 }