Documentation

Advanced Cabinet Properties Login Tab Settings


How to define advanced cabinet properties Login tab settings
The Login property settings tab is where you can define the XML for the cabinet properties, or the external source to retrieve the XML properties from, such as an SQL Query from a database, a URL web service, or a command line application. The XML must be defined as shown within the image above and must escape all xml special characters. Review documentation online for the XML language syntax and escaping if you are not familiar with the XML language.
Defining the XML statement for the properties
The Property element defines the attributes for a cabinet property.
The name attribute of the Property element is how you will refer/call the property element within other areas within IntelliCabinet. For example, the first Property defined above has its name attribute defined as App. To call this property you would enter $CAB_PROP[App] within supporting fields within IntelliCabinet. The result for $CAB_PROP[App] would be the text text that is defined for the value attribute, in the image above the value attribute is defined with MyApp. So $CAB_PROP[App] would resolve to MyApp
The display attribute allows you to define whether or not to display the defined property within the cabinet's details panel, the default is true if it is not defined. This is utilized when you define properties that you do not want to be seen but want to reference via the $CAB_PROP variable
To define the displayed field as a Text Area with scroll bar you would include a height attribute with its defined dimension, as shown in the image above for the UserPic property
All properties are displayed as a Java text field. To define the displayed item as a label you would include a type attribute defined as label, as shown in the image above for the UserPic property. A label type also allows you to define it with an icon and/or image by including an icon attribute defined with the path to the icon or image, C:\Pictures\ProfilePicture.jpg for example as shown in the image above for the UserPic attribute.
When defining an icon/image label type you can also include the following attributes for further customization. halign for the horizontal alignment of the icon, values can be left, center, or right. htpos for the horizontal text position relative to the label icon, values can be left, center, or right. valign for the vertical alignment of the icon, values can be top, center, or bottom. vtpos for the vertical text position relative to the label icon, values can be top, center, or bottom.
To trigger the display of form fields within a login panel, as shown in the image above, you would enter $FIELD[Any Field Name] anywhere within the XML syntax, as shown in the image above within the XML tab. When the form is filled out and submitted via the login button the $FORM variables will resolve to their values you have defined them for within the Field Settings tab.
Include a Message element to display a message to the user upon login. A message element must contain a mesg_title attribute defining the title of the message window, a mesg_type attribute defining the icon for the type of message (valid mesg_type values include: error, information, warning, and question), and a mesg_text attribute containing the text to display within the message window.
Include a Valid element to control whether the login can complete or not. The Valid element must contain the word true within its value attribute for the login to be completed successfully. Typically this would be utilized in conjuction with the Message element; controlling versioning of a cabinet for example.
You can reference the variable $CABINET_REVISION within a Login definition method (e.g. XML, SQL, URL) to pass the Cabinet's revision level to your login method, to log or control the versioning of your solution.
Defining property form $FIELD variable settings

Field Settings (reference the image above)
The field settings Name column lists all of the fields, defined with the $FIELD variable, that were found within the Property XML statement.
The field settings Type column lists and allows you to define the form field type that will be displayed. Click on a cell to select the field type from the drop down list.
Once a type has been defined, upon its row selection you will see a list of settings to define for the specific type.
Field Type Settings
Text :
The Default Value allows you to specify a default value for the text field upon its initial display within the login form.
The Value Passed If Not Assigned allows you to specify the value that will be submitted if no user entered value has been entered for this field.
The Password Character allows you to specify a character to display, typically an asterisk *, in order to hide the actual text that is entered in this field by a user.
The Value Regex Validation allows you to specify a the Java regular expression to validate the data entered within this field. View the Java Regular Expression API for details if you are not familiar with regular expressions.
The Value Validation Message allows you to specify a message to display to the user if the data entered within this field does not pass the Value Regex Validation.
List :
The Default Value allows you to specify which list item will be selected upon its initial display within the login form. This text should be defined as one of the Displayed Values.
The Displayed Values allows you to specify comma separated text that will define the possible options to select within the drop down list.
The Passed Values allows you to specify comma separated text that will define the drop down list's value to send upon the form's submission.
Checkbox :
Enter true for the Default Value to have the checkbox checked on upon initial display of the login form.
The Value If Checked allows you to specify the text that will be sent upon the login forms submission if the checkbox has its check on.
The Value If Not Checked allows you to specify the text that will be sent upon the login forms submission if the checkbox has its check off.


Form Script settings

Form Script settings (reference the image above)
View the Java Programmer's Guide for javax.scripting with the nashorn engine for details on how to utilize this feature
Toggle on the Enable checkbox to tell IntelliCabinet to utilize the defined script for the login form. This allows you to create your own custom form by populating a JPanel for IntelliCabinet to display.
In order to utilize this feature you will need to define the JPanel from the pre-defined JPanel accessed from the variable called CUSTOM_PANEL, as shown in the image above. And, you will need to modify the FIELDS_HASH with the field values each time a user makes a change to a field within your JPanel. All pre-defined fields defined by the $FIELD variable within the XML properties statement are pre-added to the FIELDS_HASH for you, you just need to modify the field's value of the Hashtable<String,String> to what a user defines it as from what you provide to them for inputs within the CUSTOM_PANEL JPanel.
All pre-conifgured field settings are exposed for your to reference via the Hashtabe<String,Hashtable<String,String>> FIELD_SETTINGS_HASH, as shown in the image above. To get the field settings for a defined $FIELD[User] you would access it within the Script Interface by calling FIELD_SETTINGS_HASH.get("User").get("default_value"). See below for the field settings hash keys.
Field Settings / Form Script access definition
Default Value called by FIELD_SETTINGS_HASH.get("User").get("default_value")
Value Passed If Not Assigned called by FIELD_SETTINGS_HASH.get("User").get("value_passed_if_not_assigned")
Value If Checked called by FIELD_SETTINGS_HASH.get("User").get("value_if_checked")
Value If Not Checked called by FIELD_SETTINGS_HASH.get("User").get("value_if_not_checked")
Displayed Values called by FIELD_SETTINGS_HASH.get("User").get("displayed_values")
Passed Values called by FIELD_SETTINGS_HASH.get("User").get("passed_values")
Password Character called by FIELD_SETTINGS_HASH.get("User").get("pass_echo_char")
Value Regex Validation called by FIELD_SETTINGS_HASH.get("User").get("value_validation")
Value Validation Message called by FIELD_SETTINGS_HASH.get("User").get("value_validation_msg")

Custom Form Script Example Code
// Available variables
// FIELDS_HASH
// Hashtable<String, String>

// FIELD_SETTINGS_HASH
// Hashtable<String, Hashtable<String, String>>

// CUSTOM_PANEL
// JPanel

// Assign defaults
FIELDS_HASH.put("User", FIELD_SETTINGS_HASH.get("User").get("default_value"));

// Add label
var UserNameLabel = new javax.swing.JLabel("User Name");
UserNameLabel.setForeground(java.awt.Color.blue);
CUSTOM_PANEL.add(UserNameLabel);

// Add Text Field
var UserNameField = new javax.swing.JTextField(FIELD_SETTINGS_HASH.get("User").get("default_value"));
UserNameField.addKeyListener(new java.awt.event.KeyListener()  {
	keyPressed:  function(e) {

	},
	keyReleased:  function(e)  {
		
		if ( UserNameField.getText().length() == 0 ) {
			//
			FIELDS_HASH.put("User", FIELD_SETTINGS_HASH.get("User").get("value_passed_if_not_assigned"));
		} else {
			//
			FIELDS_HASH.put("User", UserNameField.getText());
		}

	},
	keyTyped:  function(e)  {

	}	
});
UserNameField.setPreferredSize(new java.awt.Dimension(100,25));

CUSTOM_PANEL.add(UserNameField);

Results from the example script code




Defining Login Form Audit Script Settings

Audit Script settings (reference the image above)
Audit Script allows you to validate the login form fields prior to their submission.
The variable FIELDS_HASH is a Java Hashtable<String, String> containing the form fields and their defined values for you to audit.
The variable RETURN_VALID is a Java Boolean that must be defined. This variable will tell IntelliCabinet whether the form fields passed your audit or not.
The variable RETURN_MESG is a Java String for you to define text to display to the user if the RETURN_VALID variable is set to false.


Defining Cabinet Properties From SQL Settings

Define By SQL settings (reference the image above)
The Define By SQL toggle allows you to retrieve the cabinet's properties from an SQL Query. The SQL result set rows will define the XML elements and the columns will define the XML element attribute names and their values.
The Server Driver is the Java class name for the SQL server driver, com.mysql.jdbc.Driver for example to connect to a mysql database.
The variable Connection URL is the Java connection URL to the database,
jdbc:mysql://192.168.2.1:3306/databasename?user=username&password=passwd&useOldAliasMetadataBehavior=true for example.
The SQL Statement is the SQL SELECT statement. This SQL result set must contain at least an element, name, and value column. The result set values for the element column will define the XML element tag name.
Complete list of accepted column names: element, name, value, display, height, type, icon, opaque, halign, valign, htpos, vtpos


Defining Cabinet Properties From URL Settings

Define By URL settings (reference the image above)
The Define By URL toggle allows you to retrieve the cabinet's properties from a web service, such as a PHP or ASP script.
The URL field is where you will enter the URL that will provide the XML property statement.
The URL must only return the XML statement text as shown at the top of this documentation for Defining Properties by XML. The XML must be strict XML syntax, escaping all special characters.


Defining Cabinet Properties From a Command Settings

Define By Command settings (reference the image above)
The Define By Command toggle allows you to retrieve the cabinet's properties from a command line application.
The Command field is where you will enter the command to execute that will provide the XML property statement printed via its STDOUT stream.
The Command must only return the XML statement text as shown at the top of this documentation for Defining Properties by XML. The XML must be strict XML syntax, escaping all special characters.