Advanced Settings
Field Class -
[PRO] The specific Java class that will be used internally to store the data contained in the field. These classes usually have specialized formatting or display information built in that can be used for fields containing certain types of data. For example, when the planetj.database.field.PasswordField class is selected for a field descriptor, fields using that field descriptor will hide their content with asterisk characters. Users with WOW Professional Edition may create their own Field Subclasses.
WOW has a number of pre-set field class parameters that you do not need to manually set. These class parameters will automatically set character or numeric fields in your database to whatever field class you set, ie credit card, area code, dates, etc. These are set in the field's field descriptor manager in the advanced section and include parameters in the following three screen shots:
Field Class Parameters - If you manually enter the Field Class, you can optionally enter special parameters. These parameters indicate features or attributes of the Field Class. The following are Field Class parameters that you can enter:minLength=xx where xx is the minimum length of the field (ex. minLength=7).To enter a Field Class parameter, you must enter the full package and className followed by a comma (,) followed by a paramater=value where parameter is the Field Class parameter. If there is more than one parameter, they should be separated by a comma (,). Example: planetj.database.field.PasswordField,minLength=7,digitRequired=trueSome
The class and parameters should be coded into the Field Descriptors field class. TODO: Add example screen shot.
Field Classes have special Field Class parameters that are specified only to that field. For instance on a DateField, you can specify the date format. In the above example, you will notice the digitRequired=true Field Class parameter is used; that is a special parameter for the PasswordField.
Here are the existing WOW supplied Field Classes:
Address1 - Designates the field as the first line of a street address (for use elsewhere in the application). No specified validation is performed.
Address2 - Designates the field as the second line of a street address (for use elsewhere in the application). No specified validation is performed.
Area Code - The validation of an area code field ensures that the length of the area code is the correct length and only contains numeric digits. If the values contains (, ), or -, they are also accounted for.
Auto Update Timestamp - This sets a new timestamp value when a record is being inserted or updated. Alternatively, the field's Default Value and Auto Update Value can be set to *CURRENT. This will achieve the same effect on TimeStamp fields.
City - Designates the field as a city (for use elsewhere in the application). No specific validation is performed.
Credit Card Expiration Month - If no other Possible Value Key or Operation is specified, this Field Class uses the Possible Value Key *MONTHS_OF_THE_YEAR* to return a list of all months.
Credit Card Expiration Year - If no other Possible Value Key or Operation is specified, this Field Class uses the Possible Value Key *CC_EXPIRE_YEAR*.
Credit Card Number - The validation of a credit card number ensures that the length of the number is the correct length (16 or less digits).
Credit Card Type - If no other Possible Value Key or Operation is specified, this Field Class uses the Possible Value Key CC_TYPE to return a list of standard credit card types (Visa, MasterCard, etc.).
All records in the last 6 months
SELECT…WHERE…DATE ((CENTURY * 100 + YEAR) || '-' || MONTH || '-' DAY) > CURRENT DATE - 6 months
All records in the last 3 months
SELECT…WHERE…DATE ((CENTURY * 100 + YEAR) || '-' || MONTH || '-' DAY) > CURRENT DATE - 3 months
Date - In the database, a date field might not necessarily be a Date object. It could be a String or a number. To allow for proper reading and setting to the database, a Field's Field Class could be set to DateField followed by a comma and any user-defined pattern for date formatting. The pattern should be the format the value should be written as when inserted or updated to the database.
Example:
In the database, we have a field that is a CHAR with a length of 8. It takes the format 2 month, 2 day, and 4 year. When we read the value from the database, it needs to be modified from a string of characters into a date before it is displayed. If we set the field class to DateField, then a Java Date object will be generated, which gives the field’s value more meaning and flexibility. In this case, we would set the field class to this value: planetj.database.field.DateField,MMddyyy This is the fully qualified class name of the field descriptor followed by a comma and then the pattern that the date needs to be in order to be written to the database. This lets WOW know that the field contains a date value and the format in which that value is stored. There are many formats that you can use and are used in different databases; here are the available formats (case sensitive):
All of these formats are used as shown above and allow the application to handle any date input.
Additional examples include:
If you wish to have the value of a DateField set to the current date, set the Default Value to *CURRENT.
Tags: Date field, calendar, date picker prompt, Map numeric to date, map character to date
SQL can also be used to convert data such as Julian format to SQL Dates formats.
See this reference:
https://www.jdelist.com/vb4/showthread.php/46835-Converting-Julian-dates-using-SQL-in-DB2
Special Case: Multi-field Dates
A commonly encountered date scenario for customers is to have date information stored in multiple database fields. For example, individual fields that store century (19, 20), year (95, 06), month (1-12), and day (1-31). Currently, this cannot be handled through the Field Descriptors, so we'll use the operation's SQL to remedy the situation.
Often, during SQL selection, it is desirable to allow the end user to select the multi-field date as a single date field. Doing so can also enable the use of SQL data arithmetic which is very powerful. In the example below, we will use a multi-field date in the WHERE clause of an SQL operation. To enable this date selection, we need to build a String in a format such as "2004-4-3" and use the DATE function on it. First, add the following SQL segments to your test operation:SELECT…WHERE…DATE ((CENTURY * 100 + YEAR) || '-' || MONTH || '-' DAY) BETWEEN ?555 AND ?555Since you are concatenating fields to produce a date, WOW doesn’t know what type of prompt you need. Therefore, you must create a derived Field Descriptor and set its data type to DATE. Substitute the ID of the derived FD in place of 555 in the SQL above. WOW will then know to prompt with a date picker. Doing this will also allow some very nice "fixed date" queries such as:
DisplayAssociationValueField- Displays the value(s) returned by the association instead of a link to the association. Only uses the 1st field returned. For multiple rows are comma seperated.
Email - In the database an email column's value might be support@planetjavainc.com. By setting the Field Class to Email, the proper display value will be generated automatically. Also, the proper validation will automatically be performed to check for correct email address syntax. In particular, it ensures the value contains an '@' symbol as well as a '.' in the domain. It will also create the HTML mailto link automatically for that display value:<a href="mailto:support@planetjavainc.com">support@planetjavainc.com</a> Thus, a user could click on the link, then type and send an email to the address. This would especially be beneficial if you wanted to display a list of emails. Rather than manually coding each email link, by setting the Field class to Email, they would automatically be generated.
Fax Number - The validation of a fax number field ensures that the length of the fax number is the correct length and only contains digits. If the value contains (, ), or - they are also accounted for.
First Name - The validation of a first name field ensures that the field is not blank, has at least 2 characters, and is not completely numeric.
Gender M/F - If no other Possible Value Key or Operation is specified, this Field Class uses the Possible Value Key *GENDER* to return a list of genders (Male, Female).
HTML Code - Allows the field value to contain HTML tags and be rendered as HTML code by the browser. Otherwise, those tags would be mostly likely stripped out, leaving only the text.
Image URL Reference - This class takes the field’s value and uses it as the source for an HTML image tag. For instance, if the field contained the value "images/planetj.gif", it would be sent to the browser as the source attribute of an image tag: <img src="images/planetj.gif">. This allows the user to visually display the contents of a field containing image references.
Last Name - The validation of a first name field ensures that the field is not blank, has at least 2 characters, and is not completely numeric.
Password - This field class ensures that when a password field is displayed, it will be replaced by asterisks. This can be very useful for sensitive information such as passwords.
Field Class Parameters
If you manually enter the Field Class, you can optionally enter special parameters. These parameters indicate features or attributes of the Field Class. The following are Field Class parameters that you can enter for a PasswordField only:digitRequired=true - This forces the user to enter at least one digit/number in the passwordExample: planetj.database.field.PasswordField,minLength=7,digitRequired=true
In the example above, a valid password would be: abcd123. Invalid passwords would be: abc123 (too short), abcdefgh (no digits).
Phone Number - The validation of a phone number field ensures that the length of the phone number is the correct length and only contains digits. If the value contains (, ), or - they are also accounted for.
Running Total Field - This Field Class allows a field to display a running total of a field. For example, if a RowCollection has 3 rows with values 4, 6, 8, the running total of row 2 is 10 or 4 + 6. This is useful for read only reporting and is generally set up on a derived field.
Show Changed Values Only - This can be set on any desired field that you want to only render that value only once for each occurrence. Here is an example of showing only one occurrence for the Departments, Department Manager, and the Department Phone number. Click here for more information.
Show Row Index - The Row Index field feature is a setting for the Field Class property in the Field Descriptor Manager. This setting for a field will allow the ability to use a derived field descriptor as a column that displays a number systematically for each row. The first row starts at one and the results will look as shown in the example below. Click here for more information.
Note: This feature will only display an accurate row count for each page separately, which means as you click on the next link to view the next page, the row count will start all over again at one.
Social Security Number - The validation of a social security field ensures that the length of the social security number is correct and its value contains only digits. If the value contains any -, they are also accounted for.
State - If no other Possible Value Key or Operation is specified, this Field Class uses the Possible Value Key *US_STATES* to return a list of all US states.
T/F Boolean - This field can be used when you want the value in the database to be of type CHAR and length 1. Since the field is a boolean field, it will be displayed in the form of a checkbox. Thus, the user cannot enter the wrong value. When setting the value programmatically, a boolean true or false can be used, which will in turn set the value to T or F.
Timestamp - Stores date and time values in ISO format (yyyy-MM-dd-HH.mm.ss.nnnnnnnnn) and displays to the user in a more readable format (MM/dd/yyyy HH:mm:ss). Use this field in conjunction with *CURRENT as the field's Default or Auto Update Value to automatically insert the current date and time.
Upper Case - This field ensures that its value is always upper case both when displaying and inserting or updating to the database.
URL Reference - For fields containing URL references (e.g. http://www.google.com), this field class wraps the field's value in HTML anchor tags so that it is rendered to the user as a hyperlink rather than plain text.
User ID - Designates the field as a user ID, which is needed when the field is used for authentication or authorization. No specific validation is performed.
Wild Card % Prepended Field - This is a prebuilt java class that will prepend "%" in front of it's value to enable wild card searches for data types of char. Click here on how to use the wildcard in WOW.
YBlank Boolean - Same as T/F Boolean, except uses 'Y' and ' ' instead of 'T' and 'F'.
YN Boolean - Same as T/F Boolean, except uses 'Y' and 'N' instead of 'T' and 'F'.
Zip Code - The validation of a zip code ensures the zip code is correct length and contains only digits. If the value contains a -, it is also accounted for.
Zip Code Suffix - The validation of a zip code suffix field ensures the zip code suffix is the correct length and contains only digits. If the value contains a -, it is also accounted for.
Field Descriptor Type - This is where you can select which field descriptor type, if any, you would like to be using.
Default - This descriptor type is the default setting and applies to most FD definitions
Derived - The FD represents a derived field used in SQL statements (e.g. View as d_viewfld where the text View is shown for each row and the field is represented with the name d_viewfld). A derived field does not exist in the table and its value is used for display only.
Table Descriptor - This field descriptor represents a table (instead of a field) and has the same name as the table, except it is prefixed with a tilde (~). There can only be one table descriptor for each table. The table descriptor is created automatically by WOW when "Create FDs" is selected.
Formatter Class - Specify the Java class that will be used to format the data for a report. This setting only affects how the data is displayed. For example, setting a CHAR 10 to a "Phone Number" would result in 1234567890 to be shown as (123)456-7890. Some examples of formatter classes include:
ISO Date - This formatter class will change the format of the field to ISO YYYY-MM-DD format. To set up this formatter, enter planetj.formatters.DateFormatterISOYearMonthDay in the Field Descriptors Formatter Class field.
Day/Month/Year Date - This formatter class will change the format of the field to DD/MM/YYYY format, the format generally used throughout Europe. To set up this formatter, enter planetj.formatters.DateFormatterDayMonthYear in the FD formatter class field.
Day.Month.Year Date - This formatter class will change the format of the field to DD.MM.YYYY format, the format generally used throughout Europe with the EURO separator as well. To set up this formatter, enter planetj.formatters.DateFormatterEUDayMonthYear in the FD formatter class field.
Locale-specific Date - This formatter class will change the format of the specified field to the locale-based standard date format, utilizing the locale set on Apache Tomcat's Java settings. To set up this formatter, enter planetj.formatters.LocaleSpecificDateFormatter in the FD formatter class field.
German Number - This formatter class will change the format of number fields to use a period for the separator and a comma as the decimal, as is done in Germany and some other places in Europe. To set up this formatter, enter planetj.formatters.GermanNumberFormatter in the FD formatter class field.
Locale-specific Number - This formatter class will change the format of the specified field to the locale-based standard number format, utilizing the locale set on Apache Tomcat's Java settings. To set up this formatter, enter planetj.formatters.LocaleSpecificNumberFormatter in the FD formatter class field. As an example, if you would like to have a "," automatically displayed as 0,000,000 open the FD on the field in which you want this applied. In this case, we will change the Qty In Stock field format. Currently, there is no formatting set:
Scroll down to the advanced section and change the Formatter Class to "Locale-Specific (server) Number" and update.
Re running the application shows a "," now in the Qty In Stock numbers demonstrating the formatting change:
Concurrency - [EE] Regulates the concurrent updating or deleting of a row or field by users. A concurrent update occurs when user A views a field, user B then updates that field, and then user A tries to update that same field, overwriting user B’s changes. A concurrent delete is when user A views a field, user B updates that field, then user A deletes the row, erasing user B’s changes. You can adjust this setting to allow or disallow concurrent updates and deletes on the described field.
NO_CONCURRENT_ALTERATIONS_ALLOWED - If user A reads a field with this concurrencu value from the database, and then user B makes changes to the field, user A cannot update the field or delete the row containing the field without first rereading it.
CONCURRENT_DELETES_ALLOWED - If user A reads a field with this concurrency value from the database, and then user B makes changes to the field, user A is allowed to delete the row containing the field without first rereading it.
CONCURRENT_UPDATES_ALLOWED - If user A reads a field with this concurrency value from the database, and then user B makes changes to the field, user A is allowed to update the field without first rereading it.
CONCURRENT_UPDATES_AND_DELETES_ALLOWED - If user A reads a field with this concurrency value from the database, and then user B makes changes to the field, user A is allowed to update the field or delete the row containing the field without first rereading it. This is the default value.
Getter Method - [EE] This attribute is only used for Derived Fields. The DataEngine parses the getter method String to get the method to call and parameters to use. Then Java reflection is used to invoke the proper method to get the Derived Field’s value.
Setter Method - [EE] This attribute is only used for Derived Fields. The DataEngine parses the setter method String to get the method to call and parameters to use. Then java reflection is used to invoke the proper method to set the correct Field(s) value.
Association Operation - The pull down for this attribute will show any associated operations (1-1, 1-many, etc.) available. Setting this attribute to an operation causes that associated operation to execute when the field is clicked on.
Notify Status Change -
Tells whether or not changes the user makes to this field value will triggers a “status change” or not. A status change notifies the server that the field has been given a new value, and allows the server to re-render either the entire page, or other fields on the page.
No – Do not notify the server when the field’s value changes. This is the default value.
Yes – Notify the server whenever the value of the field changes. The round-trip back to the server will re-render the entire page, and any possible value operations shown on the page will be executed again. Therefore, if another field’s possible values operation depends on the value of this field, the possible value operation will be executed again, but this time it will contain the new value.
Ajax – Notify the server whenever the value of the field changes. Instead of re-rendering the entire page, only the fields in the current row will be re-rendered. Any new values or possible values for those fields will be sent back to the browser from the server, and those fields on the screen will be updated without reloading the whole page.
Remarks - User documentation for field only.
XML Tag - This defines the XML tag to be used for this field when the XML icon is clicked.