Page Previews

Page previews are produced by running theclient-with-previews build target. This will generate static HTML pages for the default locale that can be opened in a browser to give you an impression of what the page will look like when the application is running. The HTML pages are located in the <client-dir>/WebContent/Previews folder. You do not need to start a server to view the pages. The pages display a default value for each field but do not support any user-interaction (buttons, links, pop-ups, etc. do not function). The preview page represents only the main content area of the page (the part specified in UIM) and not the sidebar or page header or footer.

The default values for the fields are defined by associating a default value with the domain definition of the field. These default values are used only for the preview pages and are defined in the domain-defaults.xml file in <client-dir>/components/core. Overriding this file in other components is not currently supported so it must be modified in place.

The file uses a simple XML format, a sample of which is shown below. The root element is DOMAIN_DEFAULTS. This element contains one DOMAIN element for each domain definition for which a default value is to be defined. The DOMAIN element requires a NAME attribute specifying the domain name, and a DEFAULT attribute specifying the default value for that domain.

Figure 1. Default Preview Values for Domain Definitions
<DOMAIN_DEFAULTS>
  <DOMAIN NAME="MY_DOMAIN" DEFAULT="My value"/>
  <DOMAIN NAME="YOUR_DOMAIN" DEFAULT="Your value"/>
</DOMAIN_DEFAULTS>

When generating preview pages, if there is no default value defined for a domain, a warning message will be displayed. These warnings will not prevent the preview page from being generated and a fall-back value will be used in the generated page (for example, "[field-value]"). Note that fields that have a complex domain value are not parsed or processed in the normal manner. Most of these are simply replaced by an image of the typical output and no default value is required. Complex fields like this are described in Domain Specific Controls.