Constant settings

Most applications contain settings that are universal across the application.  Some internal settings are defined as constants in the actual code for the application and require modification and recompile to change them.  PermeAgility allows you to change these internal settings dynamically (provided they are not declared final) without requiring you to recompile and redeploy the server.  These settings are stored in the constant table and these overrides can be added or changed by editing this table.

Any value defined in the code as 'public static' and not 'final' can be overridden using this table.  

This is an ideal mechanism to configure log messages using a DEBUG boolean variable in your code as well as other settings (see the examples in the picture above).  

An entry in this table is not required for every constant defined in the code. You only need an entry here if you want to override a value - your defaults are hard coded.

For example, in the picture above, there is a setting for a ROW_COUNT_LIMIT in the permeagility.web.Table class (This is the table editor).  This limits the number of rows that are returned into the web page in case you click on a table with millions of records and don't want to wait too long.  Note that you can set this quite high because PermeAgility is very fast and can easily handle large tables. When the table editor opens a table larger than this limit, the data is returned in pages (There is page navigation as well)

The Table class also contains other constants that you can override here is the code fragment from the Table.java file showing some of the ones that can be overridden:

public static boolean DEBUG = false;

public static int MAX_STRING_DISPLAY = 100;  // When showing a column as a cell, only show this many characters

public static int TEXT_AREA_THRESHOLD = 40;  // When the data is larger than this size, the input will be a text area

public static int TEXT_AREA_WIDTH = 80;      // All text areas will be this width

public static int ROW_COUNT_LIMIT = 500;     // Data will be paged at this limit

Exercise

If you want to change the size threshold that the Table class uses to determine if a text field should be displayed as a single line or a text area, override the TEXT_AREA_THRESHOLD value.