Siebel Open UI Theme (Siebel Open UI Training – Part 6)

So far we have discussed what is Siebel Open UI, its architecturecustomization of Presentation Model, Physical Renderer and Manifest File. In this sixth module of Siebel Open UI training series, we will discuss about Siebel Open UI theme.

After you complete this module, you will know

– What is Cascading Style Sheet (CSS)

– What is Siebel Open UI Theme

– Siebel Open UI theme customization

So lets start with Cascading Style Sheet definition.

CSS file is

– a collection of styling rules that determine how HTML elements will be displayed on user interface

– reusable, one CSS file can be used to build multiple web pages

– easy to modify, you can update CSS rules only in one place and it will be referred in all web pages

– It provides consistent look and feel through out the application

– CSS rules consist of one or more property value pairs

Example:

Generic CSS rules                                                                      Open UI Specific CSS rules

h1 {                                                                                                   .applicationMenu {
color: blue;                                                                                              margin-left: 10px;
font-style: Italic;                                                                                     float: left;   }
text-align: center;   }                                                                     .header-top {
                                                                                                                  float: right;   }

Styling with CSS browser extensions:

– CSS browser extensions are browser specific style properties but not (yet) part of official CSS specification. Each browser has its own CSS extensions. Also styling rules for one browser do not work with other browsers.

– CSS extensions are definied by a dash (-), then browser short name (e.g. webkit, moz, ms, o), another dash and style name.

            Example: -webkit-text-shadow: 1px 1px 2px black or -moz-text-shadow: 1px 1px 2px black;

– Browser extensions enhance the interactivity features of web pages

– If the browser does not support any rule, it strikes through the rule

– Siebel Open UI CSS files can use browser extension propeSiebel Open Ui theme - Styling with CSS browser extensionsrties and values

We hope you got a fair understanding of CSS. To read more about CSS, click here: Cascading Style Sheet

Now what is Siebel Open UI Theme?

Siebel Open UI theme is a collection of SWT, JavaScript and CSS files used to build user interface. It defines the rules for UI elements like color, font size, style. As delivered Open UI application comes with a small set of themes. But web developers can build custom themes or update vanilla themes as per requirement. As delivered Siebel Open UI themes are characterized by application primary color (Gray or Tangerine) and navigation controls (Tab or Tree structure).

How an user can change a theme in Siebel Open UI application?

Well, to change a theme

– Login into Siebel Open UI Application

– Navigate to Tools > User Preferences > Behavior

– Choose Navigation Control – Tab or Tree

– Choose Theme – Gray or Tangerine

– Logout and Login again to see the new theme

If the new theme is not applied after logout-login, clear all historical data from the browser and reload the application again.

To modify existing theme or create a new theme, you could

– Add new or modify existing Siebel Web template files (SWT)

– Add new or modify existing JavaScript and JQuery

– Add new or modify existing Cascading Style Sheet

To keep this article simple, we will use CSS only to modify an existing theme and create a new Open UI theme. Advanced customization (Add or modify JavaScript, JQuery, SWT files) of Siebel Open UI theme will be discussed in our next article.

Where to keep all custom files like SWT, JS or CSS during Siebel Open UI theme customization?

SWT File:

– It is advisable not to update any out of box SWT file. If you have to modify any out of box SWT file, copy it first and then update it. You keep all custom SWT files under siebsrvr_root\WEBTEMPL\ OUIWEBTEMPL\custom in Siebel server.

– To render user interface, Siebel Open UI looks for SWT file

  • first under the directory siebsrvr_root\WEBTEMPL\OUIWEBTEMPL\custom
  • If not found, then siebsrvr_root\WEBTEMPL\OUIWEBTEMPL
  • If not found, then siebsrvr_root\WEBTEMPL\custom
  • If not found, then siebsrvr_root\WEBTEMPL

JavaScript File:

– Out of Box JavaScript files are located under SWEApp\PUBLIC\files\SCRIPTS\siebel

– Keep all custom JS files under SWEApp\PUBLIC\files\SCRIPTS\siebel\custom

– Like SWT file, do not update any vanilla JavaScript file directly, copy it first and then update it

CSS File:

– As delivered Siebel Open UI CSS files are located under SWEApp\PUBLIC\files folder

– 3rd Party provided CSS files are located under SWEApp\PUBLIC\files\3rdParty

– Place all custom CSS files under SWEApp\PUBLIC\files\custom folder to avoid issues during application upgrade

Now how will you decide that creating a new theme is better option or just modify existing Siebel Open UI theme?

If your new theme slightly differs from as-delivered theme, then modify the existing Siebel Open UI theme. You can copy vanilla CSS files, modify it as per requirement and place it under CUSTOM folder. But if the new theme differs significantly from as-delivered Open UI theme, create new style sheet file/s altogether.

For example, if it is just font size or font color change, modify existing CSS file. But if you want your Open UI application looks like Facebook, build a new CSS file.

Now first we will discuss steps to modify an existing Siebel Open UI theme and then create a new theme.

Steps to modify an existing Siebel Open UI theme:

  1. Identify the styling rules
  2. Modify rules inline and test it
  3. Modify or build the CSS file
  4. Add the CSS file to the theme
  5. Test the modified theme

1. Identify the styling rules

– Use ‘Inspect Element’ browser tool to identify CSS rules and sequence.

– Almost every modern browser has ‘Inspect Element’ tool to verify various elements of web pages.

Example: In Google Chrome, right click on any web page and choose ‘Inspect’ option to see all HTML, CSS, JavaScript objects used to build the web page

– Inspector displays all rules in the order of priority. If a CSS property appears in multiple rules, then the property value from the highest priority rule will be applied. Inspector element strikes through the text to designate that the property is not applied.Siebel Open UI theme customization

2. Modify rules inline and test it

– Use ‘Inspect Element’ developer tool to modify existing rules or add new CSS rules from the browser.

– It enables you to test changes immediately on the browser without modifying the actual CSS file

– Copy all custom CSS rules and check the CSS file name. File name appears under ‘Styles’ tab on top right hand corner.

– Once you refresh the webpage, all inline custom changes will be removed.

3. Modify or build CSS file

– If it is small CSS change, you can modify vanilla CSS file/s directly. You can also copy the vanilla CSS file, paste it in ‘Custom’ folder and update it.

– If you want to create a completely new CSS file,  copy-paste entire set of CSS rules into one text file and save the file with .CSS extension. 

4. Add the CSS file to the theme

– If you modify the vanilla CSS file, no need to define the file in theme.js. You can go to Step 5 to verify changes.

– If it is new CSS file, then you have to register it in theme.js file. You must use an unique id to define the CSS file in theme.js file.

– Register new CSS file using SiebelApp.ThemeManager.addTheme function

Example: SiebelApp.ThemeManager.addTheme(
                     “GRAY_TAB”, {
                             css : {
                             red_tab_theme : “files/theme-red-tab.css”,
                             }, objList : [] });

5. Test the modified theme

– Clear browser cache

– Login into Siebel Open UI application and verify all changes

– Use ‘Inspect Element’ to verify that all new CSS rules have been applied

Next we will discuss how to build a new Siebel Open UI theme altogether.

Steps to build new Siebel Open UI theme:

  1. Create new CSS file/s
  2. Define the new theme
  3. Add the new theme to the Theme List of Values
  4. Verify the custom theme

1. Create new CSS file/s

– You know, if the custom theme differs significantly from as-delivered Open UI theme, it is better to create new style sheet file/s.

– To create the new CSS file, use ‘Inspect Element’ browser tool – add or edit CSS rules inline, test all rules and then copy-paste the entire set of rules into new CSS file.

2. Define the new theme

– Every theme has to be defined in theme.js file. To avoid theme related issues during application upgrade, add all custom themes under \custom\theme.js file.

– Add the new theme using SiebelApp.ThemeManager.addTheme function

– You can can include all custom CSS files as well as vanilla CSS files

Example: SiebelApp.ThemeManager.addTheme(
                     “RED_TAB”, {
                                     css : {
                                               sb_theme : “files/theme-base.css”,
                                               sc_theme : “files/theme-gray.css”,
                                               sn_theme : “files/theme-nav-tab.css”,
                                               sca_theme : “files/theme-calendar.css”,
                                               red_tab_theme : “files/theme-red-tab.css”,
                                               sd_theme : IE8inc
                                               }, objList : [] });

3. Add the new theme to the Theme List of Values

– To display the new theme under Tools >User Preferences >Behavior > Theme, add the theme to the theme list of values

– Navigate to Administration-data> List of values and create a new record with below specification
                                        Type = OUI_THEME_SELECTION
                                        Display Value = Any value of user’s choice
                                        LIC = theme name as it is in theme.js
                                        Parent LIC = NAVIGATION_TAB or NAVIGATION_TREE

– Clear the cache

Open UI theme

4. Verify the custom theme

–  Clear browser cache

– Login into Siebel Open UI application and select the new theme from Tools >User Preferences >Behavior > Theme

– Refresh the application and verify all changes

Siebel Open UI theme customization

This end our sixth module on Siebel Open UI theme.

If you have any question, please feel free to comment below.

Keep in touch, follow TechOneStop on Facebook / Twitter / LinkedIn / Goolge+.

<< Module 5: Manifest File Customization                     Module 7: Debugging in Siebel Open UI >>

Watch our YouTube Video on Manifest File Customization:

Create horizontal menu bar using HTML and CSS

For any web developer, it is almost mandatory to know how to create horizontal or vertical menu bar using HTML and CSS.  Menu bar helps to categorize contents and increases the website readability. In this article, we will discuss how to create horizontal menu bar using HTML/CSS step by step and in the next article, how to create vertical menu bar using HTML/CSS. This is the simplest way to create css dropdown menu bar but best for new web developer. To get more interactive menu bar, you could use JQuery, HTML 5 and CSS3.  

To write the script, you could use any html css editor software but don’t forget to save the file with .HTML extension. Here I have used Notepad++ to write the script.


Step 1: Open any HTML editor and write HTML script in ul-li order without any CSS script and save the file with .html extension.

<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Horizontal CSS Menu Bar</title>
<body>
<ul id=”menu”>
    <li><a href=”#”>Link1</a></li>
    <li><a href=”#”>Link2</a>
          <ul>

            <li><a href=”#”>Link2.1</a></li>
            <li><a href=”#”>Link2.2</a></li>
            <li><a href=”#”>Link2.3</a></li>
         </ul>
    </li>
    <li><a href=”#”>Link3</a>
          <ul>
          <li><a href=”#”>Link3.1</a></li>
          <li><a href=”#”>Link3.2</a></li>
          </ul></li>   
    <li><a href=”#”>Link4</a></li>
</ul>
</body>
</html>


Now if you open this html page in any browser, it looks like below, without any formatting. Next we will add CSS script to organize menus horizontally.

Step 2: Here we will write CSS script inside html file. This type of css script is called internal css and another one is external. In external css, we write script in a separate file, save it as .css and include that file in the html page. The benefit of using external css is reusability, one css file can be used for more than one webpage. To make it simple, we have added internal CSS. To add internal css, create a ‘Style’ tag under HEAD section of HTML and write the css script inside <style> block. First we shall add few basic css tags to set width, height, background color.
<style>
/* Main */
    #menu{
    width: 100%;
    margin: 0;
    padding: 10px 0 0 0;
    list-style: none; 
    background: #111;
    }
</style>


After adding CSS:


Step 3: Now add curve corner to give it a beautiful looks. To do this, use css command border-radius. set it to 50px.
    #menu{
    width: 100%;
    margin: 0;
    padding: 10px 0 0 0;
    list-style: none; 
    background: #111;
    border-radius: 50px;
}


After adding CSS: 


It looks better, right! well, once we complete css script, it will look good. 

Step 4: Now give a nice floating looks where all ‘li’ elements will be in one line and all ‘ul’ elements will be below that line.

    #menu li{
    float: left;
    padding: 0 0 10px 0;
    position: relative; }


After adding CSS:        


Step 5: Set properties for ‘A’ (hover) tag like color, text decoration, font
    #menu a{

    float: left;
    height: 25px;
    padding: 0 25px;
    color: #CC6600;
    font: bold 12px/25px Arial, Helvetica;
    text-decoration: none;
    text-shadow: 0 1px 0 #000; }


After adding CSS:    


Step 6: Add one more property to change the color once you keep the mouse on those links
    #menu li:hover > a{
    color: #CC3333; }


Step 7: Now add two css blocks for ‘ul’ items. First block will hide all ‘ul’ items, also set display properties like color, padding, position. Second block is to display all ‘ul’ items once we hover the ‘li’ items.
   #menu ul{
    list-style: none;
    margin: 0;
    padding: 0;   
    display: none;
    position: absolute;
    top: 35px;
    left: 0;
    background: #222; }
   #menu li:hover > ul{
    display: block; }


After adding CSS:


Step 8: Set padding to 0, margin 0 for all items to make look and feel better

    #menu ul li{
    float: none;
    margin: 0;
    padding: 0;
    display: block; }


Step 9: Set properties for all ‘a’ items which come under ‘ul’ tag
    #menu ul a{   
    padding: 10px;
    height: auto;
    line-height: 1;
    display: block;
    white-space: nowrap;
    float: none;
    text-transform: none; }


Step 9: Now add few more lines to improve visual effects, set the proper size for the black background, display of all elements

    #menu:after{
    visibility: hidden;
    display: block;
    font-size: 0;
    content: ” “;
    clear: both;
    height: 0; }


After adding CSS: 


That’s all. We have successfully created the horizontal CSS menu bar. Now we will add few more lines to give our css menu bar more professional look.


Additional Step 1: To display a pointer under the hover link, add the below script

#menu ul li:first-child a:after{
    content: ”;
    position: absolute;
    left: 30px;
    top: -8px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid #FF0000;
}


After adding CSS: 


Additional Step 2: Set border-radius property to 5px under ‘#menu ul’ element which will give small carve for all ul tags
border-radius: 5px;

After adding CSS: 


Isn’t it nice!!! simple to create but great in looks. We could add many more properties to give it more professional looks. But as it is our first horizontal menu bar, don’t want to make it complex. We will discuss all other properties in subsequent articles. 

If you have any doubt or question, feel free to ask us. To get more updates on recent activities, follow ‘TechOneStop’ on Facebook/Twitter/LinkedIn or join our website as followers.
                                                                                                      How to create vertical menu bar  using HTML and CSS>>

Manifest File Customization (Siebel Open UI Training – Part 5)

In this fifth module of Siebel Open UI training series, we will discuss about Manifest File customization. Once your Presentation Model and Physical Render JS files are ready, next step is to embed these JS files with Siebel objects like applets, views or screens. In our last couple of modules, we have discussed about customization of Presentation Model and Physical Render.

After you complete this module, you will know

– What is Manifest File

– It’s role in Siebel Open UI application configuration

– Manifest File Customization steps

So lets start our discussion with Manifest File definition.

What is Manifest file in Siebel Open UI?

In Siebel Open UI, Manifest file identifies the JavaScript files that must be downloaded from Siebel server to client machine to render user interface like screens, views or applets.

Here we will discuss how to configure manifest file on Siebel Open UI 8.1.1.11. There is a difference in manifest file customization between 8.1.1.11 and prior version of 8.1.1.11. Before 8.1.1.11, there were two manifest files located under ../siebsrvr/OBJECTS.

core_manifest.xml  contains the rendering keys for vanilla application

custom_manifest.xml contains custom rendering keys

For any addition or deletion of PM or PR files, you had to update custom_manifest.xml file.

But from Siebel Open UI  8.1.1.11 and 8.2.2.4 onward, you don’t modify these two manifest files any more. You will configure manifest file from client itself without scripting. This is a major improvement that Oracle has introduced from Siebel Open UI IP 2013 onward.

Steps for Manifest File Customization:

1) Verify Presentation Model and Physical Renderer JS files include Define method

2) Register all custom JS files

3) Configure Manifest Administration

4) Verify customization

Note: All these steps are applicable from Siebel Open UI 8.1.1.11 onward.

Step 1: Verify Presentation Model and Physical Renderer JS files include Define method

– You can use any JavaScript editor to open custom PM and PR JS files and verify ‘Define’ method is declared or not.

– Define method should include the file name with relative file path and without .js extension. You will use the same file path to register the JS file in next step.

Step 2: Register all custom JS files

– Log in to Siebel Open UI application and navigate to Administration – Application > Manifest Files

– Query for the custom JS files on ‘Manifest Files’ view

If not available, create a new record to register the JS file. File name must be same as ‘Define’ method but with .js extension.

Step 3: Configure Manifest Administration

– Associate the JS files with Siebel Open UI objects like Applet, View, Screen

  • Navigate to Administration – Application > Manifest Administration and create new UI object. It will tell Siebel Open UI engine to download all JS files when that particular object is loading on UI.
  • Every UI object has three parameters – Type, Usage Type and Name.
  • By default all UI objects are active. To inactivate any particular object, mark ‘Inactive Flag’ as ‘Y’.

– Configure the group under ‘Object Expression’ tab

  • It decides how to download JS files and in what sequence
  • You can write simple or complex expression using AND/OR operators

– Specify the files

  • If you have added more than one expression under ‘Object Expression’ tab, then make sure you have selected the correct expression.
  • Click on ‘Add’ button on the ‘File’ tab to get the file list
  • Query the file name and click OK to add it with Siebel object

Step 4: Verify Customization

– Do ‘Clear Cache’ and reload the browser to verify all changes

– You can use browser tool ‘Inspect Element’ to see all files have been downloaded properly or not.

You may face errors on the Step 4 – Verify Customization.
But don’t worry!! we will discuss about debugging techniques in our last module – Debugging in Siebel Open UI.

This ends our Manifest File Customization module.

However we would like to share an interesting question that one of our readers faced in Siebel Open UI interview. Question was ‘how does Siebel Open UI behave when custom manifest record matches with vanilla manifest record?’

If the custom manifest record and vanilla manifest record have same values for Type, Usage Type and Name fields on UI object applet, Siebel Open UI gives priority to custom manifest. If you want to download all files from both vanilla manifest and custom manifest, then either add all custom files with vanilla manifest record and delete custom manifest or add all files with custom manifest record.

There are few exceptional cases as well, we will discuss those in later module.

To know more about Siebel Open UI interview question, read our article: Siebel Open UI Interview Questions

Also you can take our Siebel Open UI quiz – Siebel Open UI Quiz 

If you have any question about Manifest File Customization, Please feel free to comment below.

Keep in touch, follow TechOneStop on Facebook / Twitter / LinkedIn / Goolge+.

<< Module 4: Physical Renderer Customization                      Module 6: Siebel Open UI Theme >>

Watch our YouTube Video on Manifest File Customization: