Customization and Theme Selection

When a GBC application displays, it displays using a specific customization and theme. In this topic, we explain what determines which customization and theme is chosen.

Which Customization?

Read through the scenarios below to understand which customization is chosen. These customizations assume you have deployed your customizations to the Genero Application Server (GAS).

The default customization

If you have deployed your customizations to the Genero Application Server (GAS), you have the option to set one customization as the default. The application server uses the default customization when the application is served, unless a different customization is specifically requested for an application (as described below).

TIP: It is recommended that you specify a customization to serve as the default customization.

Use the DeploymentApp to deploy a customization and specify a default.

NOTE : If you are not using the latest version of GAS, the DeploymentApp may not be available. Consult your GAS manual for further details.

You can also use the gasadmin tool, or you can manually configure the _default file. To read on alternate methods, see Deploy on GAS or refer to the Genero Application Server User Guide.

Specify customization in the application configuration

You can specify a customization with the GBC element in the application configuration file. In this example, the "sample" customization is specified:

<?xml version="1.0" encoding="UTF-8" ?>
<APPLICATION Parent="defaultgwc" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/3.10/cfextwa.xsd">
  <EXECUTION>
    <PATH>$(res.deployment.path)</PATH>
    <MODULE></MODULE>
  </EXECUTION>
  <UA_OUTPUT>
    <GBC>sample</GBC>
    <PUBLIC_IMAGEPATH>$(res.public.resources)</PUBLIC_IMAGEPATH>
  </UA_OUTPUT>
</APPLICATION>

Specify customization in the URL

You can specify a customization in the application URL, by setting the gbc query string parameter: http://localhost:6394/ua/r/gwc-demo?gbc=sample

For more information on query string parameters, see URL reference

Which Theme?

With a customization selected, what theme is used?

By default, the first valid theme is used

The themes available are specified in the config.json file for the customization. The order in which the themes are listed in this file is important. Barring any other configuration, the first valid theme listed -- that means the first theme that is not excluded based on a condition such as isDesktop or isMobile -- is the theme that is used by default.

For more information on theme conditions, see Theme conditions

Your theme selection is remembered

The GBC will remember which theme the end user last selected for an application. If the end user switches themes while using an application, the system remembers which theme the end user last chose and will use that theme when the end user next accesses the application.

The application can specify the theme

The application programmer can write code that specifies what theme to use.

For more information, search for the topics relating to the "Theme front calls" in the Genero Business Development Language User Guide.

Specify theme in the URL

The application URL can specify which theme to use, by setting the theme query string parameter: http://localhost:6394/ua/r/gwc-demo?gbc=sample&theme=highcontrast

For more information on query string parameters, see URL reference

Changing the theme

When an application is running, the end user can change the theme used by clicking the Settings icon in the chromebar and selecting from the themes listed in the Interface theme combobox. To learn more about the chromebar, see Application page.