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 java.util.HashMap;
19  import java.util.Map;
20  
21  /**
22   * This is a description of what this class does - jonathan don't forget to fill this in.
23   *
24   * @author Kuali Rice Team (rice.collab@kuali.org)
25   *
26   */
27  public class KimConstants {
28  
29  	public static final String KIM_MODULE_NAMESPACE = "KIM";
30  	
31  	public static final String NAMESPACE_CODE = "KR-IDM";
32  	public static final String KIM_TYPE_DEFAULT_NAMESPACE = "KUALI";
33  	public static final String KIM_TYPE_DEFAULT_NAME = "Default";
34  	public static final String KIM_GROUP_DEFAULT_NAMESPACE_CODE = "KUALI";
35  	public static final String KIM_GROUP_WORKFLOW_NAMESPACE_CODE = "KR-WKFLW";
36  	public static final String RESTRICTED_DATA_MASK = "Xxxxxx";
37  
38  	//Kim services constants for API
39  	public static final String KIM_IDENTITY_MANAGEMENT_SERVICE = "kimIdentityManagementService";
40  	public static final String KIM_PERSON_SERVICE = "personService";
41  	public static final String DEFAULT_KIM_TYPE_SERVICE = "kimTypeService";
42  
43  	//Kim Attribute Boolean representations
44  	public static final String KIM_ATTRIBUTE_BOOLEAN_TRUE_STR_VALUE_DISPLAY = "Yes";
45  	public static final String KIM_ATTRIBUTE_BOOLEAN_FALSE_STR_VALUE_DISPLAY = "No";
46  	public static final String KIM_ATTRIBUTE_BOOLEAN_TRUE_STR_VALUE = "Y";
47  	public static final String KIM_ATTRIBUTE_BOOLEAN_FALSE_STR_VALUE = "N";
48  	
49  	public class EntityTypes {
50  		public static final String PERSON = "PERSON";
51  		public static final String SYSTEM = "SYSTEM";
52  	}
53  
54  	public class PersonExternalIdentifierTypes {
55  		public static final String TAX = "TAX";
56  	}
57  	public class PersonAffiliationTypes {
58  		public static final String STAFF_AFFILIATION_TYPE = "STAFF";
59  		public static final String STUDENT_AFFILIATION_TYPE = "STUDENT";
60  		public static final String AFFILIATE_AFFILIATION_TYPE = "AFFILIATE";
61  		public static final String FACULTY_AFFILIATION_TYPE = "FACULTY";
62  	}
63  
64  	public class PermissionTemplateNames {
65          public static final String FULL_UNMASK_FIELD = "Full Unmask Field";
66      	public static final String PARTIAL_UNMASK_FIELD = "Partial Unmask Field";
67      	public static final String VIEW_FIELD = "View Inquiry or Maintenance Document Field";
68      	public static final String MODIFY_FIELD = "Modify Maintenance Document Field";
69      	public static final String VIEW_SECTION = "View Inquiry or Maintenance Document Section";
70      	public static final String MODIFY_SECTION = "Modify Maintenance Document Section";
71      	public static final String CREATE_MAINTAIN_RECORDS = "Create / Maintain Record(s)";
72  
73      	public static final String EDIT_DOCUMENT = "Edit Document";
74      	public static final String COPY_DOCUMENT = "Copy Document";
75      	public static final String OPEN_DOCUMENT = "Open Document";
76      	public static final String TAKE_REQUESTED_ACTION = "Take Requested Action";
77      	public static final String INITIATE_DOCUMENT = "Initiate Document";
78      	public static final String BLANKET_APPROVE_DOCUMENT ="Blanket Approve Document";
79      	public static final String CANCEL_DOCUMENT ="Cancel Document";
80      	public static final String SAVE_DOCUMENT ="Save Document";
81      	public static final String ROUTE_DOCUMENT ="Route Document";
82      	public static final String APPROVE_DOCUMENT = "Approve Document";
83      	public static final String AD_HOC_REVIEW_DOCUMENT = "Ad Hoc Review Document";
84      	public static final String ADD_MESSAGE_TO_ROUTE_LOG = "Add Message to Route Log";
85      	
86      	public static final String ADD_NOTE_ATTACHMENT = "Add Note / Attachment";
87      	public static final String VIEW_NOTE_ATTACHMENT = "View Note / Attachment";
88      	public static final String DELETE_NOTE_ATTACHMENT = "Delete Note / Attachment";
89  
90      	public static final String USE_TRANSACTIONAL_DOCUMENT = "Use Transactional Document";
91  
92      	public static final String POPULATE_GROUP = "Populate Group";
93      	public static final String ASSIGN_ROLE = "Assign Role";
94      	public static final String GRANT_PERMISSION = "Grant Permission";
95      	public static final String GRANT_RESPONSIBILITY = "Grant Responsibility";
96  
97      	public static final String LOOK_UP_RECORDS = "Look Up Records";
98      	public static final String INQUIRE_INTO_RECORDS = "Inquire Into Records";
99      	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 }