Case-Sensitivity in Archibus
Archibus controls the case of strings entered into forms based on the “String Format” setting of the strings as defined in the Archibus Fields table. For instance, Account Code (ac.ac_id) has a String Format of UPPER, so Archibus forms force all values to uppercase. If you want to change this behavior on a field, you change that fields String Format setting.
This same String Format property controls the case behavior of the User Name and Password fields of the Archibus Users table. If you want to change the default behavior (which is to use uppercase for User Name), then change the String Format property of these fields in the Archibus Fields table.
If you are using SSO or LDAP configurations, see LDAP Configuration and SSO Configuration.
Technical Details
In the Archibus schema, you can specify
afm_flds.string_format = Upper, UpperAlpha, UpperAlphaNum
values (among others). Those values mean that:
1. The corresponding value should be converted to uppercase when crossing the boundary of Archibus products:
- While being entered by the user in the user interface (JS client, C# client, etc.).
- Workflow Rules: the caller (UI client) supplies the value in the uppercase (and receives the value in the uppercase).
- Web Services: the caller supplies the value in the uppercase (and receives the value in the uppercase).
- HTTP requests (from the SSO server etc.): The Java code that extracts the value from the HTTP request converts the value to uppercase.
- LDAP return value: The Java code that extracts the value from LDAP converts the value to uppercase.
- DataTransfer, Import: The Java code that extracts the value from the file converts the value to uppercase.
- Values from AutoCAD and Revit: convert them right after getting the values from AutoCAD and Revit.
2. As a consequence, the corresponding variable will have uppercase value in memory (JS, C#, Java, etc. memory).
3. As a consequence, the corresponding field will have an uppercase value in the database.
Rule to Remember
By applying the case-sensitivity setting at the border, the system guarantees that all values will have the correct values in memory (JS, C#, Java, etc. memory) and in the database.
Values, generated in memory:
The developer must apply the case-sensitivity setting to the values of the fields generated in memory (hardcoded, concatenated, etc.that is, values not coming from the user interface, memory, or database) .
This means that when you are generating programmatically values for any string-type based fields (e.g. any non-numeric, non-date/time type), your code must check the value of its Upper property of the FieldDef.Formatting
, and if it is true, convert the value to uppercase.
Case and String Format Fields
- Archibus Type fields. These fields must be:
- Dwgname: Upper
- Ehandle: UpperAlphaNum
- Hierarchical: Upper
- Hierachical-Concat: Upper
- Archibus Username (afm_users.username). “Upper” by default. The system manager can change them to mixed-case.
- Archibus Password (afm_users.username). Case-sensitive by default. The system manager can change them to case-insensitive.
- SQL username (afm_users.sql_uid, afm_roles.sql_uid). Case-sensitive by default. The system manager can change them to case-insensitive.
- SQL password (afm_users.sql_pwd, afm_roles.sql_pwd). Case-sensitive by default. The system manager can change them to case-insensitive.
- Primary Key fields. Can be of mixed case, although the default schema uses uppercase for some of them to make data entry more consistent.
Case-Sensitivity and File Names
- Drawing File Names on disk. Can be of mixed case (e.g. Hq17.dwg). Sites often get drawings from outside Archibus, and cannot control their case.
- File Folders. Paths beneath the “archibus” or “webapps” folder are all lowercase, e.g. c:\Documents and Settings\All Users\archibus\projects\hq\graphics\. This is so that Unix and Linux application servers will not encounter subtle case problems with Archibus files.
- Enterprise Graphics files (e.g. .swf, .json., .emf files). Are all lowercase for the same reason.
- Schema Files (e.g. .axvw, .js, .png) Are also all lowercase for the same reason.
Note: The system uses uppercase the drawing file names when it enters the names in the user interface. The system uses lowercase the files when it publishes enterprise graphics. But the original DWG file name on disk can be mixed case. This means that after the system stores the names of files in the database, the names don’t match the names on the disk anymore (unless the OS is case-insensitive).
The same thing occurs with enterprise graphics files. However, the system can use the enterprise graphics because it consistently uses lowercase for them. For CAD files, this situation works since the CAD editing tools are available only on Windows and Windows is case-insensitive
Password
Password is a special case. If you specify:
afm_flds.string_format = Upper, UpperAlpha, UpperAlphaNum
for a password field (afm_users.user_pwd, afm_users.sql_pwd , afm_roles.sql_pwd):
- The password value will be converted to uppercase on the SignIn form (unless security configuration is LDAP), and on the edit form (e.g. password change form).
- As a consequence, the corresponding variable will have an uppercase value in memory (JS, C#, Java, etc. memory).
- The password value will be encoded (for afm_users.user_pwd if useEncoding=true in passwordManager.xml; for afm_users.sql_pwd, afm_roles.sql_pwd if SQL password decoder bean is specified in WEB-INF/config/context/security/afm_users/sql-security/password-encoder.xml).
- The encoded value will be converted to uppercase.
- As a consequence, the corresponding variable will have an uppercase value in memory (JS, C#, Java, etc. memory);
- As a consequence, the corresponding field will have an uppercase value in the database.