Skip to main content

Themes with Page Definition UI & Stylesheets

Overview

Themes are used in Enactor to allow for styling and branding and layout of an application.

This document will show show how to create a new theme using Eclipse and apply it to your POS.

Theming Using The Enactor Tools

Create a new Theme

To create a new theme, there are three main components involved

  • Images
  • Page Definitions
  • Style Sheets

To begin, we need to create the following structure within the <CUSTOMER NAME> Extension - Pos Project.

|-- "src"
| |-- "META-INF"
| | `-- "deployments"
| | |-- "Image"
| | |-- "PageDefinition"
| | `-- "StyleSheet"
1Create the Packages.xml by right clicking on META-INF → New → OtherCreate New Process Debug
2From the Wizard selection prompt, expand Enactor Development collection and select Package.
Click Next
Select Package
3Change the generated Package ID to <CUSTOMER NAME>Pos
And set the Name to <CUSTOMER_NAME> Extension - Pos
Click Finish
Create Packages File
4Open the Packages.xml and select Themes tabSelect Themes Tab
5Under the Themes header, click Add to add a new theme
Select the new theme
Set the Theme ID to <CUSTOMER NAME>
Set the Name to <CUSTOMER NAME>
Save your changes
Configure Themes

Style Sheet

1Create a new folder within the StyleSheet directory by right clicking on folder and selecting:
New → Folder
Create New Folder
2Name the Folder the same as the Theme ID you configured above.
Click Finish
Name the Folder the same as the Theme ID
3Create a new file within the folder by right clicking on New → Other
Expand the Web collection and select CSS File
Click Next
Select CSS File
4Enter a file name of pos.css
Click Next
Enter File Name
5Deselect Use CSS Template
Click Finish
Deselect CSS Template
6Create a new style by adding the following css.
Click Save
CSS
7Return to the Pos Terminal Maintenance Application in the Estate Manager.
Select to edit the same Pos Terminal you did previously (pos1@0001.enactor)
Navigate to User Interface → Branding/Style
Set Operator View Theme to blank
Click Save

This allows us to specify the theme using the command line options (which are ignored if there is a theme configured in the database)
8Open the Run Menu → Run Configurations
Under Java application, select POS
Select the Arguments tab
Select Argument Tab
9Set the theme argument to -theme:<THEME ID>/NextGen1024x768Set Theme Argument
10Terminate the POS if it is already running and then relaunch it.
You should see your new theme on the POS

Page Definition Theme Overrides

1Back in the <CUSTOMER NAME> Extension - Pos project, create a new folder within the PageDefinition directory named the same as the Theme ID you created earlier
2Open the Open Resource… menu using either the top-level menu:
Navigate → Open Resource…
or using the following key combination:
CTRL + SHIFT + R (Windows and Linux) or CMD + SHIFT + R (Mac)
Navigate Open Resource
3Search for the resource EnterUser.xml
Select the file located within NextGen1024x768/Pos/SignOn
Click Open
Search Resource
4Open the Properties View by Opening Window Menu → Show View → Other
From the General collection select Properties
Open Properties
5Open the Outline View by Opening Window Menu → Show View → Outline
Ensure both Outline and Properties views are visible
6From the Outline View, select the root of Page Definition Tree named Pos PromptTree Named Pos Prompt
7From the Properties View, note the Page definition URL Property omitting the theme NextGen1024x768Page Definition URL
8Return to your <CUSTOMER NAME> Extensions - Pos project.
Under the PageDefintion/<THEME_ID> folder, create a new folder with the following name:
Pos/SignOn
Copy the previously located file into this new folder
Create New Folder
9Open the copied file and close the original
Selecting the root of the Page Definition again from the Outline view
Locate the page Definition URL from the Properties view
Replace the NextGen1024x768 part with your theme name so that the URL now correctly matches the location within the file system:

<CUSTOMER NAME>/Pos/SignOn/EnterUser.xml
Locate Page Definition URL
10Make a change to the file such as removing LABEL_1
Save the file when you are done
11Open the Packages.xml and select the Themes tab
Expand the Page Definitions Section and select Add
In the search dialog Enter the file name EnterUser.xml
Select the file within your themed folder
Click OK
Save your changes
Select File
12Terminate and relaunch your POS application.
You should see your POS has updated to display your new screen