23.3 Themes
Cmobilecom AF supports both Primefaces themes and jQuery UI themes.
Built-in Primefaces themes and pre-built jQuery UI themes have been installed
and available for selection, which are configured in
<cmobilecom.home>/conf/themes.xml
Add New Themes
To add new themes, configure libraries and themes as followings. For example,
add theme library "my-custom-themes" that contains theme1 and theme2.
<themes>
<lib name="my-custom-themes" version="1.0" plainImageURI="true"
switchToMinForRelease="false">
<theme name="theme1" label="Theme One" resource="theme1/theme.css"/>
<theme name="theme2" label="Theme Two" resource="theme2/theme.css"/>
</lib>
</themes>
- library name must not contain spaces, e.g., my-custom-themes.
- version: library version(optional). If specified, it will be added in resource URL.
- plainImageURI: specifies whether css contains regular image URIs without .xhtml?ln=libraryName.
default is false.
- switchToMinForRelease: whether to replace resource name extension .css with
.min.css for release build. If true, all the themes of the library must have
minified versions for release. default is false.
- theme name: theme unique name. maximum length: 30.
- theme label: theme label for display. e.g., as theme select option label.
- theme resource: theme resource name that must not contain spaces.
e.g., theme1/theme.css.
Package the themes into a jar with the following entries:
META-INF/resources/my-custom-themes/theme1/theme.css
META-INF/resources/my-custom-themes/theme1/images/image1.png
META-INF/resources/my-custom-themes/theme2/theme.css
META-INF/resources/my-custom-themes/theme2/images/image1.png
Add the jar in classpath such as WEB-INF/lib in war.
If a theme.css contains regular image URI, set library plainImageURI to "true".
Theme Setting
User can change theme, which will be remembered for current session.
The theme for a DataAccessUnit can be changed in Manage Center.
Manage Center > System -> Settings -> Parameters
Theme setting in Parameters is persisted.