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.api;
017    
018    import org.kuali.rice.core.api.CoreConstants;
019    import org.kuali.rice.core.api.membership.MemberType;
020    
021    import java.util.HashMap;
022    import java.util.Map;
023    
024    public final class KimConstants {
025    
026            public static final String KIM_MODULE_NAMESPACE = "KIM";
027            
028            public static final String NAMESPACE_CODE = "KR-IDM";
029            public static final String KIM_TYPE_DEFAULT_NAMESPACE = "KUALI";
030            public static final String KIM_TYPE_DEFAULT_NAME = "Default";
031            public static final String KIM_GROUP_DEFAULT_NAMESPACE_CODE = "KUALI";
032            public static final String KIM_GROUP_WORKFLOW_NAMESPACE_CODE = "KR-WKFLW";
033            public static final String RESTRICTED_DATA_MASK = "Xxxxxx";
034    
035            public static final String KIM_PERSON_SERVICE = "personService";
036            public static final String DEFAULT_KIM_TYPE_SERVICE = "kimTypeService";
037    
038            //Kim Attribute Boolean representations
039            public static final String KIM_ATTRIBUTE_BOOLEAN_TRUE_STR_VALUE_DISPLAY = "Yes";
040            public static final String KIM_ATTRIBUTE_BOOLEAN_FALSE_STR_VALUE_DISPLAY = "No";
041            public static final String KIM_ATTRIBUTE_BOOLEAN_TRUE_STR_VALUE = "Y";
042            public static final String KIM_ATTRIBUTE_BOOLEAN_FALSE_STR_VALUE = "N";
043            
044            public static final class EntityTypes {
045                    public static final String PERSON = "PERSON";
046                    public static final String SYSTEM = "SYSTEM";
047                    
048                    private EntityTypes() {
049                            throw new UnsupportedOperationException("do not call");
050                    }
051            }
052    
053        public static final class AddressTypes {
054            public static final String HOME = "HM";
055                    public static final String WORK = "WRK";
056            public static final String OTHER= "OTH";
057    
058                    private AddressTypes() {
059                            throw new UnsupportedOperationException("do not call");
060                    }
061        }
062    
063        public static final class NameTypes {
064            public static final String PREFERRED = "PRFR";
065                    public static final String PRIMARY = "PRM";
066            public static final String OTHER= "OTH";
067    
068                    private NameTypes() {
069                            throw new UnsupportedOperationException("do not call");
070                    }
071        }
072    
073        public static final class GenderChangeCodes {
074                    public static final String MALE_TO_FEMALE = "ChangeFemale";
075            public static final String FEMALE_TO_MALE = "ChangeMale";
076    
077                    private GenderChangeCodes() {
078                            throw new UnsupportedOperationException("do not call");
079                    }
080        }
081    
082            public static final class PersonExternalIdentifierTypes {
083                    public static final String TAX = "TAX";
084                    
085                    private PersonExternalIdentifierTypes() {
086                            throw new UnsupportedOperationException("do not call");
087                    }
088            }
089            public static final class PersonAffiliationTypes {
090                    public static final String STAFF_AFFILIATION_TYPE = "STAFF";
091                    public static final String STUDENT_AFFILIATION_TYPE = "STUDENT";
092                    public static final String AFFILIATE_AFFILIATION_TYPE = "AFFILIATE";
093                    public static final String FACULTY_AFFILIATION_TYPE = "FACULTY";
094                    
095                    private PersonAffiliationTypes() {
096                            throw new UnsupportedOperationException("do not call");
097                    }
098            }
099    
100            public static final class PermissionTemplateNames {
101            public static final String FULL_UNMASK_FIELD = "Full Unmask Field";
102            public static final String PARTIAL_UNMASK_FIELD = "Partial Unmask Field";
103            public static final String VIEW_MAINTENANCE_INQUIRY_FIELD = "View Inquiry or Maintenance Document Field";
104            public static final String MODIFY_FIELD = "Modify Maintenance Document Field";
105            public static final String VIEW_SECTION = "View Inquiry or Maintenance Document Section";
106            public static final String MODIFY_SECTION = "Modify Maintenance Document Section";
107            public static final String CREATE_MAINTAIN_RECORDS = "Create / Maintain Record(s)";
108    
109            public static final String EDIT_DOCUMENT = "Edit Document";
110            public static final String COPY_DOCUMENT = "Copy Document";
111            public static final String OPEN_DOCUMENT = "Open Document";
112            public static final String TAKE_REQUESTED_ACTION = "Take Requested Action";
113            public static final String INITIATE_DOCUMENT = "Initiate Document";
114            public static final String BLANKET_APPROVE_DOCUMENT ="Blanket Approve Document";
115            public static final String CANCEL_DOCUMENT ="Cancel Document";
116            public static final String SAVE_DOCUMENT ="Save Document";
117            public static final String ROUTE_DOCUMENT ="Route Document";
118            public static final String APPROVE_DOCUMENT = "Approve Document";
119            public static final String AD_HOC_REVIEW_DOCUMENT = "Ad Hoc Review Document";
120            public static final String ADD_MESSAGE_TO_ROUTE_LOG = "Add Message to Route Log";
121            
122            public static final String ADD_NOTE_ATTACHMENT = "Add Note / Attachment";
123            public static final String VIEW_NOTE_ATTACHMENT = "View Note / Attachment";
124            public static final String DELETE_NOTE_ATTACHMENT = "Delete Note / Attachment";
125    
126            public static final String USE_TRANSACTIONAL_DOCUMENT = "Use Transactional Document";
127    
128            public static final String POPULATE_GROUP = "Populate Group";
129            public static final String ASSIGN_ROLE = "Assign Role";
130            public static final String GRANT_PERMISSION = "Grant Permission";
131            public static final String GRANT_RESPONSIBILITY = "Grant Responsibility";
132    
133            public static final String LOOK_UP_RECORDS = "Look Up Records";
134            public static final String INQUIRE_INTO_RECORDS = "Inquire Into Records";
135            public static final String USE_SCREEN = "Use Screen";
136    
137            public static final String PERFORM_CUSTOM_MAINTENANCE_DOCUMENT_FUNCTION ="Perform Custom Maintenance Document Function";
138            public static final String MAINTAIN_SYSTEM_PARAMETER = "Maintain System Parameter";
139            public static final String SEND_AD_HOC_REQUEST ="Send Ad Hoc Request";
140    
141            public static final String EDIT_VIEW = "Edit View";
142            public static final String OPEN_VIEW = "Open View";
143            public static final String EDIT_FIELD = "Edit Field";
144            public static final String VIEW_FIELD = "View Field";
145            public static final String EDIT_GROUP = "Edit Group";
146            public static final String VIEW_GROUP = "View Group";
147            public static final String EDIT_WIDGET = "Edit Widget";
148            public static final String VIEW_WIDGET = "View Widget";
149            public static final String PERFORM_ACTION = "Perform Action";
150            public static final String EDIT_LINE = "Edit Line";
151            public static final String VIEW_LINE = "View Line";
152            public static final String EDIT_LINE_FIELD = "Edit Line Field";
153            public static final String VIEW_LINE_FIELD = "View Line Field";
154            public static final String PERFORM_LINE_ACTION = "Perform Line Action";
155    
156                    private PermissionTemplateNames() {
157                            throw new UnsupportedOperationException("do not call");
158                    }
159            }
160    
161            public final static class PermissionNames {
162                    public static final String LOG_IN = "Log In Kuali Portal";
163                    public static final String ADMIN_PESSIMISTIC_LOCKING = "Administer Pessimistic Locking";
164                    public static final String OVERRIDE_ENTITY_PRIVACY_PREFERENCES = "Override Entity Privacy Preferences";
165            public static final String MODIFY_ENTITY = "Modify Entity";
166            public static final String ACCESS_LOCKED_MODULE = "Access Locked Module";
167            
168                    private PermissionNames() {
169                            throw new UnsupportedOperationException("do not call");
170                    }
171            }
172    
173            public final static class KimUIConstants {
174                    public static final String NAME_VALUE_SEPARATOR = " : ";
175                    public static final String COMMA_SEPARATOR = ", ";
176                    public static final String OR_OPERATOR = "|";
177                    public static final String URL_SEPARATOR = "/";
178                    public static final String PARAMETERIZED_URL_SEPARATOR = "%2F";
179                    public static final String KIM_URL_KEY = "kim.url";
180                    public static final String KIM_APPLICATION = "kim";
181                    public static final String MEMBER_ID_PREFIX = PrimaryKeyConstants.MEMBER_ID+".";
182                    public static final String MEMBER_NAME = "memberName";
183                    public static final String MEMBER_NAMESPACE_CODE = "memberNamespaceCode";
184                    public static final String MEMBER_TYPE_PRINCIPAL = "Principal";
185                    public static final String MEMBER_TYPE_GROUP = "Group";
186                    public static final String MEMBER_TYPE_ROLE = "Role";
187                    public static final Map<String, String> KIM_MEMBER_TYPES_MAP = getKimMemberTypesMap();
188                private static Map<String, String> getKimMemberTypesMap() {
189                    Map<String, String> kimDocumentActionsMap = new HashMap<String, String>();
190                    kimDocumentActionsMap.put(MemberType.PRINCIPAL.getCode(), MEMBER_TYPE_PRINCIPAL);
191                    kimDocumentActionsMap.put(MemberType.GROUP.getCode(), MEMBER_TYPE_GROUP);
192                    kimDocumentActionsMap.put(MemberType.ROLE.getCode(), MEMBER_TYPE_ROLE);
193                    return kimDocumentActionsMap;
194                }
195    
196                    public static final String KIM_ROLE_DOCUMENT_TYPE_NAME = "IdentityManagementRoleDocument";
197                    public static final String KIM_GROUP_DOCUMENT_TYPE_NAME = "IdentityManagementGroupDocument";
198                    public static final String KIM_PERSON_DOCUMENT_TYPE_NAME = "IdentityManagementPersonDocument";
199                    public static final String KIM_PERMISSION_DOCUMENT_TYPE_NAME = "IdentityManagementGenericPermissionMaintenanceDocument";
200                    public static final String KIM_REVIEW_RESPONSIBILITY_DOCUMENT_TYPE_NAME = "IdentityManagementReviewResponsibilityMaintenanceDocument";
201                    public static final String KIM_ROLE_DOCUMENT_SHORT_KEY = "IMRD";
202                    public static final String KIM_GROUP_DOCUMENT_SHORT_KEY = "IMGD";
203                    public static final String KIM_PERSON_DOCUMENT_SHORT_KEY = "IMPD";
204                    public static final String KIM_ROLE_DOCUMENT_ACTION = "identityManagementRoleDocument.do";
205                    public static final String KIM_ROLE_INQUIRY_ACTION = "identityManagementRoleInquiry.do";
206                    public static final String KIM_PERSON_DOCUMENT_ACTION = "identityManagementPersonDocument.do";
207                    public static final String KIM_PERSON_INQUIRY_ACTION = "identityManagementPersonInquiry.do";
208                    public static final String KIM_GROUP_DOCUMENT_ACTION = "identityManagementGroupDocument.do";
209                    public static final String KIM_GROUP_INQUIRY_ACTION = "identityManagementGroupInquiry.do";
210                    public static final Map<String, String> KIM_DOCUMENTS_ACTIONS_MAP = getDocumentActionsMap();
211                private static Map<String, String> getDocumentActionsMap() {
212                    Map<String, String> kimDocumentActionsMap = new HashMap<String, String>();
213                    kimDocumentActionsMap.put(KIM_ROLE_DOCUMENT_SHORT_KEY, KIM_ROLE_DOCUMENT_ACTION);
214                    kimDocumentActionsMap.put(KIM_GROUP_DOCUMENT_SHORT_KEY, KIM_GROUP_DOCUMENT_ACTION);
215                    kimDocumentActionsMap.put(KIM_PERSON_DOCUMENT_SHORT_KEY, KIM_PERSON_DOCUMENT_ACTION);
216                    return kimDocumentActionsMap;
217                }
218    
219                    public static final Map<String, String> KIM_DOCUMENT_TYPE_NAMES_MAP = getDocumentTypeNamesMap();
220                private static Map<String, String> getDocumentTypeNamesMap() {
221                    Map<String, String> kimDocumentTypeNamesMap = new HashMap<String, String>();
222                            kimDocumentTypeNamesMap.put(KIM_ROLE_DOCUMENT_SHORT_KEY, KIM_ROLE_DOCUMENT_TYPE_NAME);
223                            kimDocumentTypeNamesMap.put(KIM_GROUP_DOCUMENT_SHORT_KEY, KIM_GROUP_DOCUMENT_TYPE_NAME);
224                            kimDocumentTypeNamesMap.put(KIM_PERSON_DOCUMENT_SHORT_KEY, KIM_PERSON_DOCUMENT_TYPE_NAME);
225                            return kimDocumentTypeNamesMap;
226                }
227    
228                public static final String DELEGATION_PRIMARY = "P";
229                public static final String DELEGATION_SECONDARY = "S";
230                public static final String DELEGATION_PRIMARY_LABEL = "Primary";
231                public static final String DELEGATION_SECONDARY_LABEL = "Secondary";
232    
233                public static final Map<String, String> DELEGATION_TYPES = getDelegationTypesMap();
234                private static Map<String, String> getDelegationTypesMap() {
235                    Map<String, String> delegationTypesMap = new HashMap<String, String>();
236                    delegationTypesMap.put(DELEGATION_PRIMARY, DELEGATION_PRIMARY_LABEL);
237                    delegationTypesMap.put(DELEGATION_SECONDARY, DELEGATION_SECONDARY_LABEL);
238                    return delegationTypesMap;
239                }
240    
241                public static final String ROLE_LOOKUPABLE_IMPL = "roleLookupable";
242                public static final String KIM_DOCUMENT_ROLE_MEMBER_LOOKUPABLE_IMPL = "kimDocumentRoleMemberLookupable";
243                public static final String ROLE_MEMBER_LOOKUPABLE_IMPL = "roleMemberImplLookupable";
244                public static final String ROLE_MEMBERS_COLLECTION_NAME = "roleMembers";
245                
246                    private KimUIConstants() {
247                            throw new UnsupportedOperationException("do not call");
248                    }
249            }
250    
251            public final static class PrimaryKeyConstants {
252                    public static final String ENTITY_ID = "id";
253            public static final String SUB_ENTITY_ID = "entityId";
254                    public static final String PRINCIPAL_ID = "principalId";
255                    public static final String ROLE_ID = "id";
256            public static final String SUB_ROLE_ID = "roleId";
257                    public static final String GROUP_ID = "id";
258                    public static final String KIM_TYPE_ID = "id";
259                    public static final String RESPONSIBILITY_ID = "id";
260                    public static final String PERMISSION_ID = "id";
261                    public static final String DELEGATION_ID = "delegationId";
262                    public static final String MEMBER_ID = "memberId";
263                    public static final String DELEGATION_MEMBER_ID = "delegationMemberId";
264                    public static final String ROLE_MEMBER_ID = "roleMemberId";
265                    public static final String ROLE_RESPONSIBILITY_ID = "roleResponsibilityId";
266                    public static final String ROLE_RESPONSIBILITY_ACTION_ID = "roleResponsibilityActionId";
267                    public static final String KIM_PERMISSION_REQUIRED_ATTR_ID = "kimPermissionRequiredAttributeId";
268                    public static final String KIM_ATTRIBUTE_ID = "id";
269                    public static final String KIM_TYPE_CODE ="id";
270            public static final String ID = "id";
271            public static final String CODE = "code";
272                    
273                    private PrimaryKeyConstants() {
274                            throw new UnsupportedOperationException("do not call");
275                    }
276            }
277    
278            public final static class UniqueKeyConstants {
279                    public static final String NAMESPACE_CODE = "namespaceCode";
280                    public static final String PRINCIPAL_NAME = "principalName";
281                    public static final String GROUP_NAME = "name";
282                    public static final String ROLE_NAME = "roleName";
283                    public static final String PERMISSION_NAME = "name";
284                    public static final String RESPONSIBILITY_NAME = "name";
285                    public static final String PERMISSION_TEMPLATE_NAME = "name";
286                    public static final String RESPONSIBILITY_TEMPLATE_NAME = "name";
287            public static final String NAME = "name";
288                    
289                    private UniqueKeyConstants() {
290                            throw new UnsupportedOperationException("do not call");
291                    }
292            }
293    
294            public final static class SequenceNames {
295                    public static final String KRIM_PRNCPL_ID_S = "KRIM_PRNCPL_ID_S";
296                    public static final String KRIM_ENTITY_ID_S = "KRIM_ENTITY_ID_S";
297                    public static final String KRIM_ROLE_ID_S = "KRIM_ROLE_ID_S";
298                    public static final String KRIM_GROUP_ID_S = "KRIM_GRP_ID_S";
299                    public static final String KRIM_ROLE_PERM_ID_S = "KRIM_ROLE_PERM_ID_S";
300                    public static final String KRIM_ROLE_RSP_ID_S = "KRIM_ROLE_RSP_ID_S";
301                    public static final String KRIM_ROLE_MBR_ID_S = "KRIM_ROLE_MBR_ID_S";
302                    public static final String KRIM_DLGN_MBR_ID_S = "KRIM_DLGN_MBR_ID_S";
303                    public static final String KRIM_ROLE_RSP_ACTN_ID_S = "KRIM_ROLE_RSP_ACTN_ID_S";
304                    public static final String KRIM_DLGN_ID_S = "KRIM_DLGN_ID_S";
305                    public static final String KRIM_PERM_ID_S = "KRIM_PERM_ID_S";
306                    public static final String KRIM_RSP_ID_S = "KRIM_RSP_ID_S";
307                    public static final String KRIM_ATTR_DATA_ID_S = "KRIM_ATTR_DATA_ID_S";
308                    
309                    private SequenceNames() {
310                            throw new UnsupportedOperationException("do not call");
311                    }
312            }
313    
314        public final static class AttributeConstants {
315            public static final String PRINCIPAL_ID = "principalId";
316            public static final String BUTTON_NAME = "buttonName";
317            public static final String BEAN_NAME = "beanName";
318            public static final String ACTION_CLASS = "actionClass";
319            public static final String NAME = "name";
320            public static final String NAMESPACE_CODE = "namespaceCode";
321            public static final String COMPONENT_NAME = "componentName";
322            public static final String PROPERTY_NAME = "propertyName";
323            public static final String EXISTING_RECORDS_ONLY = "existingRecordsOnly";
324            public static final String CREATED_BY_SELF = "createdBySelf";
325            public static final String CREATED_BY_SELF_ONLY = "createdBySelfOnly";
326            public static final String ATTACHMENT_TYPE_CODE = "attachmentTypeCode";
327            public static final String EDIT_MODE = "editMode";
328            public static final String PARAMETER_NAME = "parameterName";
329            public static final String CAMPUS_CODE = "campusCode";
330            public static final String ACTION_REQUEST_CD = "actionRequestCd";
331            public static final String ROUTE_STATUS_CODE = "routeStatusCode";
332            public static final String APP_DOC_STATUS = "appDocStatus";
333            public static final String ROUTE_NODE_NAME = "routeNodeName";
334            public static final String ROLE_NAME = "roleName";
335            public static final String PERMISSION_NAME = "permissionName";
336            public static final String RESPONSIBILITY_NAME = "responsibilityName";
337            public static final String GROUP_NAME = "groupName";
338            public static final String REQUIRED = "required";
339            public static final String ACTION_DETAILS_AT_ROLE_MEMBER_LEVEL = "actionDetailsAtRoleMemberLevel";
340            public static final String DOCUMENT_NUMBER = "documentNumber";
341            public static final String DOCUMENT_TYPE_NAME = "documentTypeName";
342            public static final String SECTION_ID = "sectionId";
343            public static final String KIM_TYPE_ID = PrimaryKeyConstants.KIM_TYPE_ID;
344            public static final String QUALIFIER_RESOLVER_PROVIDED_IDENTIFIER = "qualifierResolverProvidedIdentifier";
345            public static final String VIEW_ID = "viewId";
346            public static final String ACTION_EVENT = "actionEvent";
347            public static final String COLLECTION_PROPERTY_NAME = "collectionPropertyName";
348            public static final String FIELD_ID = "fieldId";
349            public static final String GROUP_ID = "groupId";
350            public static final String WIDGET_ID = "widgetId";
351        }
352    
353            /**
354             *
355             * KimGroupS can contain other KimGroupS and KimPrincipalS.
356             * Use these constants to flags their members with the appropriate member
357             * type code.
358             *
359             * @author Kuali Rice Team (rice.collab@kuali.org)
360             */
361            public final static class KimGroupMemberTypes {
362    
363                    /**
364                     * For group members that are themselves groups
365                     */
366                    public static final MemberType GROUP_MEMBER_TYPE = MemberType.GROUP;
367    
368                    /**
369                     * For group members that are principals
370                     */
371                    public static final MemberType PRINCIPAL_MEMBER_TYPE = MemberType.PRINCIPAL;
372    
373                    private KimGroupMemberTypes() {
374                            throw new UnsupportedOperationException("do not call");
375                    }
376            }
377    
378            private KimConstants() {
379                    throw new UnsupportedOperationException("do not call");
380            }
381    
382        public final static String SERVICE_PATH_SOAP = "soap/" + Namespaces.MODULE_NAME + "/" + CoreConstants.Versions.VERSION_2_0;
383    
384        public final static class Namespaces {
385            public static final String MODULE_NAME = "kim";
386            public static final String KIM_NAMESPACE_PREFIX = CoreConstants.Namespaces.ROOT_NAMESPACE_PREFIX + "/" + MODULE_NAME;
387    
388            public static final String KIM_NAMESPACE_2_0 = KIM_NAMESPACE_PREFIX + "/" + CoreConstants.Versions.VERSION_2_0;
389        }
390        
391        public static class ParameterKey {
392            public static final String SHOW_BLANK_QUALIFIERS = "KIM_SHOW_BLANK_QUALIFIERS";
393            }
394        
395    }