יום חמישי, 13 בפברואר 2014

Siebel Open UI Manifest Expressions and System Preferences

Introduced in IP 2013, Manifest Expressions can be used to evaluate conditions whether a certain set of JavaScript files or a certain web template file should be loaded for a given user interface object.

Oracle ships some interesting standard expressions:

Some Siebel standard Manifest Expressions in 8.1.1.11
We can inspect those standard expressions by navigating to the Administration - Application screen, Manifest Expressions view.

Most of the standard expressions use either the GetProfileAttr() method or the new GetObjectAttr() methods to match the value of either a profile attribute or an attribute of an applet with a string.

My first impression was that obviously we can use Siebel Query Language to construct complex expressions. So I started experimenting...

One of my first experiments was built on the idea that it could be worthwhile having a central "switch" for enabling or disabling Open UI customizations. Here is the cookbook I came up with:

1. Create a System Preference

First, I navigated to Administration - Application - System Preferences and created a new system preference as follows:

System Preference Name
AHA Show Customizations
System Preference Value
TRUE

When set to "TRUE", the system preference should "tell" the Open UI framework to load customizations such as a custom physical renderer for an applet. When set to "FALSE", no custom files should be loaded.

2. Create a Manifest Expression

In the Manifest Expressions list, I created a new record as follows:

Name
AHA Show Customizations
Expression
SystemPreference("AHA Show Customizations") = 'TRUE'

As you can see, I resorted to the SystemPreference() method of the Siebel Query Language to get the value of my new system preference. The new expression would evaluate to "true" when the system preference has a value of "TRUE" and vice versa.

3. Use the expression

Finally, I have to employ the new expression with a user interface object. For my experiment, I associated the new expression with the Opportunity form applet which has been my victim for a while now.

Click to enlarge
As can be seen in the screenshot, I added a custom physical renderer to the Opportunity Form Applet - Child. I used my new expression and associated it with the custom JavaScript file.

As a result, the custom physical renderer should only be loaded when the system preference is set to "TRUE". A quick test proved that it worked as expected.

Here is the applet with the system preference set to TRUE:


Note the highlighted customizations (progress bar, slider and clickable account label).

And here is the same applet after setting the system preference to FALSE (and restarting the application):


As you can (or cannot) see, the customizations have disappeared; the applet is displayed in "vanilla" mode.

Summary

Open UI manifest expressions can be put to good use to evaluate almost any condition using Siebel Query Language.

Caveat

During my experiments, I found that not all Siebel Query Language "tricks" worked. For instance, I couldn't get InvokeServiceMethod() to work. If anyone wants to shed some light on this, please find the comments.

have a nice day

@lex

אין תגובות:

הוסף רשומת תגובה