Tag Archives: javascript

siebelhub JavaScript library – reworked solution

Downloaded siebelhub library published by @lex and had a look at the code. It is fantastic piece of coding with modularized code and well-structured functions. It also helps in understanding basic JavaScript concepts required for Siebel OpenUI development.

The best part was the way to dynamically attach custom functions with PM events such as Field Change or Record Change.  This concept can help us develop truly global functionalities without needing the use of individual PM & PR’s for applets or views.  I used to this to develop a really useful functionality of favorite records. I will share the use case and implementations where this will be useful in future posts but this post is about siebelhub.js. I would recommend everyone to go and download the library and study it as a reference for Siebel OpenUI development.

The only thing that I didn’t like about it is the way the siebelhub object has been made global. Many of you might already know that if in JavaScript we declare a variable without the keyword “var” it becomes part of global namespace and can be accessed by any script that is part of that page.This is very similar to concept of Profile Attributes in Siebel, once you have set a profile attribute you can access its value from anywhere in application. Using this concept @lex has created siebelhub object and attached all the library function to this object. This choice has been made probably because @lex has published this library for educational purpose.

I started looking for other ways by which we can make this library part of Siebel OpenUI framework. I studied few oracle provided js files that have defined similar objects that we use in our custom PM & PR code. My reworked solution is to define siebelhub object as part of “SiebelApp.S_App” Namespace rather than pollute the global namespace and define the library function using prototype object.

The basic structure of library would look like this:

if (typeof(SiebelApp.S_App.siebelHub) === "undefined") {

    SiebelApp.S_App.siebelHub = (function(){

      function sHub(){
          //you can define private properties here
      };//end of sHub function
      //define all your library functions like this
      sHub.prototype.GoToTheHub = function(){
      sHub.prototype.GoToSiebelUnleashed = function(){
return sHub; //return the object 
}())//end of function as object 
};//end of if 

All the functions of the library would be attached to this function object as shown above. The way to instantiate this library would also change and would be done like this

var sHub = new SiebelApp.S_App.siebelHub(this);

Here is the link to reworked version of SiebelHub Library. I have not included each an every function defined in the original library and it doesn’t have the server side part also. I am not sure if this is best way to do things but I believe that it will certainly make it more compatible with Siebel OpenUI framework. Looking forward to you feeedback/comments and making contributions to make this library better.

Web Notifications – Making Siebel Notifications better

Web Notifications is little known feature that allows websites to display desktop style notification based on user permissions. Now it is extensively used by websites such as New Sites, What’s app web to display desktop style notifications. When I came across this feature the thought that immediately that came to my mind was can this… Continue Reading

Siebel Open UI – Useful JavaScript tips

We are moving away from eScript and going towards JavaScript and in future you will be writing more code in JavaScript than in eScript. I believe that eventually Oracle will dump eScript and move to pure JavaScript since it is better, faster and leaner than eScript. It becomes really important that we understand small nuisance… Continue Reading