Displaying the Siebel Server name you’re connected to in Open UI

The practice many of us had in the HI-past is to configure the “Application Title” parameter on the object manager level, to display or include a reference to the Siebel Server. This enables one in a multi-server environment to know in case of trouble which server the user was connected to, just by looking at the screen. Well, Open UI changes the game a bit. The “Application Title” is not longer used, and the document.title of the application is populated in a dynamic way. That is, Siebel will display the view name and record-context information instead of the static Application Title.

Well, overriding this standard behavior would not be the best idea, probably.

So I thought of an alternative, and with the hint of Oracle’s Duncan Ford I realized the following simple solution (see the read text “Connected to DEMOHOST”).

siebelserverhost

How was this done?

1) Create a small generic BS to get a System Variable using the Clib.getenv method ():

bscode

2) Created a System Preference “SiebelHostEnvVar”. This would contain e.g. “COMPUTERNAME”:


syspref

3) Created two new fields in the Personalization Profile buscomp to load the SiebelHostEnvVar into a Profile Attribute. The beauty of this buscomp which is not broadly known, is that it loads while logging into an object manager session. At which time Profile Attributes are created, alike the Field name in the buscomp. Typically these are Employee/User related. If you can join from S_PARTY, you can set Employee related data as profile attributes. But also calculated fields are possible, which are used here. 

pers

 
<code><span style="font-family:Georgia, serif;">4) Created custom post loader (http://jsfiddle.net/wSsSk/): </span>
<pre>if (typeof (SiebelAppFacade.Postload) == "undefined") {
 Namespace('SiebelAppFacade.Postload');
if (typeof (SiebelAppFacade.Postload) == "undefined") {
    Namespace('SiebelAppFacade.Postload');

    (function(){
        SiebelApp.EventManager.addListner( "postload", OnPostload, this );
        function OnPostload( ){
            try
            {
                console.log("Loaded custom postload to display server name in MsgLayer");

                var sSiebelServerHost = SiebelApp.S_App.GetProfileAttr("SiebelServerHost");

                if (sSiebelServerHost.length == 0)
                    sSiebelServerHost = "COULD NOT RETRIEVE SIEBEL SERVER HOST";

                console.log("Retrieved servername: " + sSiebelServerHost);

                if ($(".siebelServerHost").length==0)
                    $("#MsgLayer").after($("&lt;div&gt;").addClass("siebelServerHost"));

                $(".siebelServerHost").html("Connected to " + sSiebelServerHost);
            }
            catch(error)
            {
                // silent catch 
            }
        }
    }());
}</pre></code>

5) And some CSS to make it visually attractive:

 
<code><pre>.siebelServerHost {
 float: left;
 position: relative;
 top: 5px;
 margin-left: 10px;
 margin-top: 7px;
 font-weight: bold;
 padding-top: 0px;
 padding-right: 10px;
 display: block;
 color: red;
 font-size: 0.8em;
 }</pre></code>

Voilá, done.

Advertisements

31 thoughts on “Displaying the Siebel Server name you’re connected to in Open UI

  1. Hi ,

    Was wondering if the environment is multi-server environment, how does the System Preference get updated with respective Server name?
    Is it that we have to set the server name there instead of “COMPUTERNAME”? In that case how is it dynamic for multi-server case?

  2. Hi Jeroen. Thanks for the reply.
    I understood it later. 🙂 However I wanted to ask one thing: Can we make the title of the document as fixed to SiebelServerHost value which for eg. is SERVER1.

    We can use this : $(document).attr(“title”, “THE SERVER NAME VALUE IN PROFILE ATTR”);

    But my question is how do you limit it from not changing on different screens while navigating?

      • Hi Jeroen, Thanks for a good tip on showing application Server name connected. But I do have a quick question. Where was the HTML code written. Is it generated automatically or written and copied the file somewhere. Please let me know.

        Thanks,
        SM

      • Hello Jeroen:

        Also the system preference value must be hard coded to “COMPUTERNAME” or something else. What should be done if you have multiple Siebel App Servers?

      • COMPUTERNAME is the name of the environment variable holding the string you want to display. So on every server you need to define an OS environment variable holding a string like ‘Server 1’ etc. Hope you grasp the idea.

      • Hello:

        Could you please tell me where did you wrote the JS script and how it is being invoked?

        Appreciate your help.

        Thanks,
        SM

  3. Hello Jeroen:

    Thanks a lot for your prompt reply. I was able to understand the COMPUTERNAME. but still not able to understand where the post load handler should go into.

  4. Hello Jeroen:

    Could you please tell me how to display it next to Application menu as you showed in the Picture? Which JS file and CSS were modified?

    Thanks,
    SM

  5. Hello Jeroen:

    Under User Preferences..Behavior, we do not have any Theme specified. So I guess its the default Theme. When I defined the js script under Manifest Adminstration, I used the “Siebel Sales Enterprise” as the expression. I even tried increasing or decreasing the pixels in the css file, but no use. It is somewhere pretty small adjustment and it will show up correctly.

    Thanks,
    SM

  6. Hello Jeroen:

    I do not see “theme_aurora.css” file in our environment. I do see “theme-base.css”, “theme-gray.css”, “theme-tangerine.css”. Can I add to any one of these? Since these are Siebel CSS files, if I add my entries to these CSS, I have to copy them under Custom folder.

    Thanks,
    SM

    • Alright, you are on IP13, Aurora got introduced in IP14, which makes it easier to add custom CSS through manifest admin. In your case, add it to the bottom of theme_base.css. You should use the CSS from my initial post, which was for IP13. Anyways, I would advice to move to IP14 or prepare for IP15.

  7. Hello Jeroen:

    Thanks a lot. Appreciate your suggestion. It is now working in our development environment. Many many thanks for being patience with me. As of now I haven’t added to theme_base.css and instead added to our custom .css file. It is working but with a slight difference. Yes we are still on IP13. We tried to move to IP14 but it doesn’t solve few defects that are still valid on IP14. So our Org. thought of staying on IP13 and validate how IP15 will do.

  8. Yes we are in Prod with IP13. We are now looking at IP15 and see what benefits we gonna get. Since it’s new we will give out some time to settle.

  9. Hello Jeroen:

    Just a quick question. Do you know why some mvg pop-ups in IP2013 doesn’t open. For example, we have a pop up at Runtime events called Condition Expression. When we try to open the mvg, it simply displays a blank small popup with no contents. Is there a way to resolve these?

    Thanks,
    SM

  10. Hi Jeroen,

    post was very helpful.
    does this work in unix based in server also?
    Please confirm.

    i have tried but computername comes as null value but there is no error.
    even i tried to change it to HOSTNAME but it didn’t work.

    thanks and Regards
    rajesh

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s