Defining Enumeration Options
If any of your query type definitions contain enumeration fields, then
you will need to define the options for the enumerations in a
properties file in the common configuration layer. Open
configuration-root/com/escenic/framework/ui/Enumerations.properties
(or create it if it does not exist), and add option definitions as
follows:
option.enum-name.order.value=enum-value option.enum-name.order.label=enum-label
where:
-
enum-name is the name of an enumeration field in one or more of your query type definitions
-
order is an integer defining the option's position in the list of options. Real numbers containing decimal points are not allowed
-
enum-value is the internal value of the option
-
enum-label is the label displayed in the list of options
The label definition entry is optional. If you do not define a label for an option, then the value is used as a label.
For a field definition like this, for example:
<field name="sort" type="enumeration" enum="sortByTag" />
You might enter:
option.sortByTag.1.label=Time modified (ascending) option.sortByTag.1.value=modified_date_asc option.sortByTag.2.label=Time modified (descending) option.sortByTag.2.value=modified_date_dec option.sortByTag.3.label=Time published (ascending) option.sortByTag.3.value=publish_date_asc option.sortByTag.4.label=Time published (descending) option.sortByTag.4.value=publish_date_dec option.sortByTag.5.value=relevance
Note that since no label is defined for the last option in the above
example, the value relevance
will be used as a
label.
You can define a default value for an enumeration as follows:
default.enum-name=default-value
For example:
default.sortByTag=modified_date_asc
If two of your query definitions contain enumeration fields with the
same name, then they will share the same option definitions in
Enumerations.properties
. If you want them to have
different option definitions, then you must give them different
names.