Tuesday, 4 November 2014

Siebel Open UI : Profile Attributes vs Browser Cookies

Profile Attribute Security

If you have used Siebel profile attributes, you know that these are name-value pairs used to store any information including user profile and retrieved any time during the application session. If the session is closed, the profile attributes will get nullified. This is custom functionality in HI client. 

In earlier versions like 8.1.1.3 or before, we can set profile attributes by entering code like the below line in browser address bar. 

Javascript: theApplication().setprofileAttr("ABC","ABC");

This has been disabled to fix security issues. Now that Oracle has identified security vulnerabilities in the browser scripting, in Open UI, they have disabled setting profile attributes. But for users who are OK with security constraints, the profile attribute setting from browser scripts are enable after setting server parameter EditProfileAttr = TRUE. Now, the security reasons for disabling the profile attribute setting are unknown, but if it is a consideration for you, we have another option in Open UI. 

Browser Cookies

We might have heard of this term many times, but a few really know about these. Browser cookies are name value pairs of data that a browser saves from the sites the user visit. Follow this link to know more about cookies.

Now, let us observe the similarities between Profile attributes and cookies. 

1. Scope: Both are name value pairs, profile attributes are used almost everywhere in application like browser scripts, server scripts and business services or workflows. You do not need a browser session for profile attributes to work. But, cookies need a browser session. They work only for javascripted objects like PM, PR or postload.js or preload.js and so on. 

2. Security: Cookies are vulnerable to attacks from hackers or people in same network who are trying to steal information. But, they are secure if you are using them to write non-sensitive information. If you are writing a view name in cookie, it is fine but do not consider saving phone number, credit card information etc in cookies. There are ways to create secure cookies. Profile attributes have some security issues when used in browser script.

3. Life time: Profile attributes get nullified after session is closed. Cookies on the other hand has a life time. We can set the end date of a cookie to a future date. But, each browser stores cookies in a separate location. There are ways to share cookies across browsers, but this is not in the scope of this post. If you clear your browser cookies, the cookies get deleted even when you have a session open. 

Overall, for a Siebel developer, Profile attributes is the preferable option. But web developers will look to use cookies as much as they can. Siebel is in a phase of moving to a web standard application with Open UI and cookies are going to play their role in future. It would be interesting to see how useful cookies are going to be when used in Open UI.

Sunday, 2 November 2014

Siebel Open UI Vertical Scrollbar Continued..

Here is the final version of the PR to move the List Applet horizontal play bar to vertical scrollbar. The PR is tested for basic functionalities like query, resize, save record etc. I have fixed another issue where the list applet header getting aligned with list columns in the script.


if( typeof( SiebelAppFacade.vscrollpr ) === "undefined" ){

    SiebelJS.Namespace( "SiebelAppFacade.vscrollpr" );

    //Module with its dependencies


    define("siebel/custom/vscrollpr", ["siebel/jqgridrenderer"], function () {
        SiebelAppFacade.vscrollpr = ( function(){
            function vscrollpr( pm ){
                SiebelAppFacade.vscrollpr.superclass.constructor.call( this, pm );    
            }
            SiebelJS.Extend( vscrollpr, SiebelAppFacade.JQGridRenderer );
   vscrollpr.prototype.Init = function () {
            SiebelAppFacade.vscrollpr.superclass.Init.call(this);    
            };
   vscrollpr.prototype.ShowUI = function(){
                SiebelAppFacade.vscrollpr.superclass.ShowUI.call( this );
     var currbwidth = $(".ui-jqgrid-bdiv").width(); //get current body width
     var btabwidth = currbwidth - 60; // provide 60px space for scroll bar
var currhwidth = $(".ui-state-default.ui-jqgrid-hdiv").width(); // get current header width
var htabwidth = currhwidth - 60; // provide 60px space for scroll bar
$(".ui-state-default.ui-jqgrid-hdiv").css("width",htabwidth); // set header width
$(".ui-state-default.ui-jqgrid-hdiv").css("float","left"); // float it to left
     $(".ui-jqgrid-bdiv").css("width",btabwidth); // set body width
     $(".ui-jqgrid-bdiv").css("float","left");   // float it to left
     var html = $(".ui-pager-control").html(); // get the play bar html
     $('.ui-pager-control').appendTo('.ui-jqgrid-view'); // remove the playbar and append it to grid 
     $(".ui-pager-control").css("float","left"); // float it to left
     $(".ui-pager-control").css("width","60"); // set playbar width to 60 px;
     $(".ui-pager-control").css("-ms-transform","rotate(90deg)"); // rotate 90 degrees in IE
     $(".ui-pager-control").css("-webkit-transform","rotate(90deg)"); // rotate 90 deg in chrome
     $("span.ui-separator").parent().css("width","45"); // set separator width to 45px. this should be calculated based on height of applet
            };       
  vscrollpr.prototype.resize = function( )
          { // recalculate the widths after resize
 SiebelAppFacade.vscrollpr.superclass.resize.call( this );  
var currbwidth = $(".ui-jqgrid-bdiv").width();
     var btabwidth = currbwidth - 60;
var currhwidth = $(".ui-state-default.ui-jqgrid-hdiv").width();
var htabwidth = currhwidth - 60;
$(".ui-state-default.ui-jqgrid-hdiv").css("width",htabwidth);
$(".ui-state-default.ui-jqgrid-hdiv").css("float","left");
     $(".ui-jqgrid-bdiv").css("width",btabwidth);
     $(".ui-jqgrid-bdiv").css("float","left");   
     var html = $(".ui-pager-control").html();
     $('.ui-pager-control').appendTo('.ui-jqgrid-view');     
     $(".ui-pager-control").css("float","left");
     $(".ui-pager-control").css("width","60");
     $(".ui-pager-control").css("-ms-transform","rotate(90deg)");
     $(".ui-pager-control").css("-webkit-transform","rotate(90deg)");
     $("span.ui-separator").parent().css("width","45");
 }
return vscrollpr;
    } ());
        return "SiebelAppFacade.vscrollpr";
    });
}



Note: The code needs full testing before implementing. Also, I have hardcoded the value in below line. You need to do the calculation in this case for list applets with different heights.
$("span.ui-separator").parent().css("width","45");

Disclaimer: This is not production ready code. Do not use this code without proper testing. The JQGrid model provides this scroll bars by default as horizontal playbars. So, this is vanilla and it is not a good idea to modify it. 

Thursday, 30 October 2014

Siebel Open UI Vertical Scrollbar

Siebel Open UI vertical scrollbar in List Applets

In Open UI, the traditional vertical scroll bar is replaced by horizontal play bar buttons. These buttons perform the same functionality as that of vertical scroll bar in HI applications. But a lot of people are not liking this feature as compare to HI mode. This might confuse the users with horizontal scroll bar which is used to see columns to the right of the table. 




Oracle has used JQGrid model to render the OUI list applets. The horizontal play bar is a feature of JQGrid plugin. This makes it different from HI mode applets in many ways. I have discussed the differences and comparisons of these two type of applets in another post. It is not technically correct to have JavaScript scroll bar.

Here , I have tried to make this horizontal play bar align vertically. For this purpose I have written custom PR to render the existing play bar to rotate vertically and place it next to the list.

Here is how it looks. 


The PR contains the following code in ShowUI method.

     var currwidth = $(".ui-jqgrid-bdiv").width(); // get current width of list table
var tabwidth = currwidth - 40; // 
$(".ui-jqgrid-bdiv").css("width",tabwidth); // leave 40 pixel space for scroll bar
$(".ui-jqgrid-bdiv").css("float","left"); // set the table to left
var html = $(".ui-pager-control").html(); // get the horizontal play bar html - this is not required
$('.ui-pager-control').appendTo('.ui-jqgrid-view'); // remove the play bar and move it next to list
$(".ui-pager-control").css("float","left"); // make it float to left
$(".ui-pager-control").css("width","40"); // place it in 40 pixel room we created
$(".ui-pager-control").css("-ms-transform","rotate(90deg)"); // rotate the horiontal scroll bar by 90 deg. to align vertically..for IE browser
$(".ui-pager-control").css("-webkit-transform","rotate(90deg)"); // same as above.. for chrome,opere,safari browsers

$("span.ui-separator").parent().css("width","45"); // set the separator width to fit the list table height

This actually is just moving the existing play bar to right of the list and rotating the play bar. The PR file can be viewed here

Note: This is just a sample code and only written in Show UI method. The same should be taken care in other events like browser restore/resize. The same code should be replicated wherever necessary.

Check out the full code at below link. This is for educational purpose only.
Part-2

Also check this out for creating a scrollbar that looks and works similar to a browser scrollbar. 

Open UI and HI list applets vertical scrolling

If you had chance to work on Open UI, you would have observed a lot of difference in UI level objects like MVG, Query Assistant buttons, list applets etc when compared to HI mode. Well, since the base technology in rendering the UI is changed, the changes are required for technical reasons. One such feature is vertical scroll bar being replaced by horizontal play bar. Let us see why this change is probably made. 

Consider vertical scrolling using normal javascript for a table. We can have a vertical scroll bar in a list applet like this. But for the js scroll to work, the table html should have all the table rows (tr) and columns (td) tags and values which should show when we scroll.

So if I have 100 records with 10 fields each, I should have 1100 html tags (100 rows, 1000 columns). This will make my HTML very big. But the actual problem is, we need to get the field values of 100 records and place them into 1000 columns. You know, 1000 GetFieldValue() functions need to get executed. Consider the joins, MVGs and links, the performance will kill your browser. This rules out the JavaScript scroll bar.

Actually, this is the reason why even in HI mode, we have GotoNextSet, GotoPreviousSet, GotoNext, GotoPrevious methods in vertical scroll bar. These are the same methods we have in Open UI list applets also. So, we query a set of records (generally 10) and place them in UI. If user wants to get more records, user has to click on scroll buttons. 

But the visual difference we observe is the slider is missing in Open UI.




Open UI used JQGrid plugin which is a JQuery based plug-in which has built in methods to access/set/modify the Grid/table elements in the HTML. The horizontal play bar is a feature of JQGrid. So, Oracle used it in Open UI. JQGrid is currently used by many web based technologies. 

The horizontal play bar can be aligned vertically and made to look like vertical scroll bar except without slider. I am going to post the script required to make this change. If we can add a slider to this and make it work, then we can have the same vertical scroll bar as in HI mode. 

Please leave a comment about your thoughts on this.

Thursday, 23 October 2014

Siebel High Interactivity Framework vs Open UI Framework

Siebel High Interactivity Framework

If you are browsing YouTube in any browser, it needs an add-on or plug-in to run the video. The browser does not have capability to play the video all by itself (although, latest HTLM5 enabled browsers have this capacity). It requires an add-on or plug-in. Similarly, for a Siebel application UI to work, it requires additional add-ons.

Before Open UI framework is introduced, Siebel High Interactivity application can only be opened in IE browser. The Siebel application is rendered using Internet Explorer's ActiveX Controls. The application requires the ActiveX controls for proper rendering and functionality of UI.
ActiveX objects are programs (add-ons) that supplements and enhance the browser experience. The ActiveX objects for Siebel are included as part of the installation and are placed in SWSE/public/enu/23030/applets location. (This location varies based on version; 23030 is for 8.1.1.11) Below is the location of ActiveX objects in local web client.

 When you access the application, the browser will prompt for the download of ActiveX and if user allows the prompt, it downloads ActiveX from your SWSE folder location. These ActiveX controls are installed in your IE. This is how Siebel High Interactivity Framework works. This can be viewed from Internet Settings -> Manage Add-ons


Users can not open HI application in any other browsers. Moreover, for ActiveX controls to download and work, user has to change internet settings which have a risk of decreasing the browser security. ActiveX objects are more prone to security risk as they are installed in your local computer and can access your computer.

Open UI framework:

Open UI is a framework for customising User Interface of Siebel. This uses Javascript, JQuery, CSS etc to render the Siebel application and function as per the requirements. Just like ActiveX, JQuery is a JavaScript based plug-in. There are other extended plug-ins to JQuery like JQuery-UI which are used in Siebel Open UI framework.

Why Open UI?

There are many reasons why Open UI framework is built when there is an already working, tested High Interactivity framework available.
Unlike before, the number of browsers and operating systems has increased beyond IE and Microsoft windows. Forcing the users to keep using IE and using only windows environment is not a good idea. It is not easy to recreate add-ons for other browsers and test them. Windows 8 does not support ActiveX anymore. Check this link. This seems to be the death blow for HI framework.

What Open UI offers?

Here are the few advantages in Open UI compared to HI ActiveX framework.
1.   Support to all browsers. Earlier Siebel application can only be opened in IE browser. This is due to the dependency on ActiveX controls. Open UI framework is based on Javascript, JQuery, CSS which is supported in all browsers.   
2. Siebel Application in Mobile. Access Siebel application from any device.
3.   Custom user experience. Provides capabilities to UI customisations which HI framework does not provide. 
4. Working offline.


Tuesday, 16 September 2014

SIEBEL: Extract SIF file from SRF

This post is a response to one of my friend's question. Can we get a SIF file of an applet from a SRF file? 

Scenario: We have a customized SRF file, connection to server DB and sample DB. Now we know that the Contact list applet is customized and compiled onto this SRF. Now we want to get a SIF file of the SRF.

Solution: Most of the people I approached, said it is not possible. But there is a solution!!

If you have a SIF file, try opening it with Notepad++ and observe that the SIF file is a Structured XML.




This gave me the idea. If I can build an XML similar to the SIF and save it as .SIF file, I will have my SIF file ready.

Step 1: First I created a dummy applet with all the child entities like Applet Browser Script,Controls, Menu Items etc. This step is to make sure that you have a dummy XML with all the applet elements in it. Exported it as a SIF file. Open the file with notepad++ and copy the XML. Using any online source, convert this XML to XSD. (I used this). Create an Integration Object using this XSD (use EAI XSD Wizard). Now this is the structure we want to get a new SIF file. Name the IO as Siebel Information IO.

Step 2: Create a new Siebel BO based IO (EAI Siebel Wizard) using BO Repository Applet. This is a vanilla BO. Make sure to include all the child items (Applet Menu, Web template Item,Applet Server Script etc) while creation. Name it as Repository Applet IO.

Step 3: Create a new IO data mapper under Administration Integration with destination IO as Siebel Information IO and source as Repository Applet IO.
Make sure you map all the fields properly. Get the project and repository details from Repository Applet IC fields (Project Name, Repository Name etc) and map the same. Compile the changes to your custom srf.

Step 4: Create a workflow with first step to query Repository Applet IO using EAI Siebel Adapter. Provide the Applet name as Input to query. In second Step, map the Repository Applet IO to Siebel Information IO using EAI Data Transformation Engine service. In the subsequent steps, convert the EAI Siebel Message to XML (EAI XML Converter) and write the file (EAI XML Write to File) to a location with name "Contact Form Applet.sif". 

Simulate the Workflow in your application connecting to your DB after opening it using your custom SRF and voila!! you have your SIF file with object definitions from your custom SRF.

What I did was: identified how siebel stored information in sif files, identify how siebel repository BO stores the information, query a siebel BO based IO, map to sif structure and write to sif file.

Go ahead and try it. It is a time taking process but it is worth if you have this kind of requirement. We can extract SIFs like Business Components, Business Services etc using Repository Business Component, Repository Business Service IOs. We can do this for all the objects in tools.

Let me know your thoughts on this!!

Monday, 8 September 2014

Salesforce WSDL testing using Soap UI

In this post I am going to discuss about how to test Salesforce WSDL using Soap UI. This is pretty basic stuff but for beginners this might be helpful.

You need to download the WSDL from your application from Setup -> Develop -> API -> Generate Enterprise WSDL. 

Copy and save the WSDL into a .wsdl file.

Import this WSDL in Soap UI. It will import methods like Create, Convert Lead, login, update, upsert etc.

First we need to get a session Id to access data in salesforce. To get this, we need to call login method in the WSDL.

The login method input should look like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
   <soapenv:Header></soapenv:Header>
   <soapenv:Body>
      <urn:login>
          <!--Salesforce Username:-->
         <urn:username>khadar.pathan@gmail.com</urn:username>
           <!--password appended with session token:-->    <urn:password>NewPasswordc4w5ePZbF3dBokl1BrWr</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope> 

You need to get the session token from below location in the application. 
This will send an email to your account with session token. You need to append your password and this token if you are trying to login to application from anything apart from a browser (like SOAP, Force.com IDE etc). 

You might get this error if you do not give session token "Invalid username, password, security token; or user locked out."

The output of above request gives server URL and session Id.

Using this session Id in Soap header and URL as service end point, you can create, delete, update, upsert or do any operation from the WSDL. If you do not change the service end point, you will get error "Destination URL not reset. The URL returned from login must be set in the SforceService".

In the below example, I have created a new Account. Sample Soap messages to create the data can be found at https://developer.salesforce.com/page/Sample_SOAP_Messages


Hope this helps!!

Monday, 21 July 2014

MS CRM: CRM for Outlook configuration

MS CRM application can be created as a profile in Outlook by installing and configuring CRM for outlook plug in. Download it here.

Once you install the application, you need to configure the profile.

Run the configuration wizard, enter your credentials and synchronize the organisation data.
Close the wizard and open outlook. You can find the application related information in Outlook folder structure as a profile in outlook.
This way, instead of relying on a browser, we can use application in outlook more efficiently. Advantages include working offline capability, synchronization with emails, reminders for Alerts and meetings and so on.

MS CRM: System Administration

In this post, I am going to introduce some basics of System Administration in MS CRM. 

You can access Administration options from Microsoft Dynamics CRM -> Settings -> Administration. Few important options/features are defined below. 

Auto Numbering: We can specify a format of auto numbering like below. 
Business Units: We can create the organisation hierarchy by using Business Units. We can define a BU, add users, teams, child BU etc to it. If I disable a BU, no user in the BU will be able to access the application.
Security Roles: Security role is the entity where we mention which objects should be accessible and upto which access level for a user role. We assign security role to user. This is the most important security feature of MS CRM.

Teams: We can define teams of users and group them as a logical entity.
System Settings: We can define calendar settings, currency settings, format of numbers, email tracking options etc for the organisation in this section.
Field Security Profiles: We can define a security profile for users to provide access to modify certain field data. (Example: only a manager can edit quote amount)

MS CRM: Default Solution, Managed and Unmanaged Solutions

Solutions: All the configurations in an MS CRM application is maintained in a solution. It is a repository of configuration items like Entities, Fields, Forms, reports, Dashboards etc. People who are new to MS CRM can get confused easily by terms like Default Solution, Managed Solution and Unmanaged Solution.

Every application will have one default solution defined with all the basic entities. Default solution is a vanilla solution. It is recommended not to modify anything in a default solution. We should create our own custom solution. Every custom solution once created is a unmanaged solution. Once you are done with your customization, you need to make it a managed solution, meaning that you do not let anyone modify the solution. It is locked and can be moved to other environments as a package.

We can add unmanaged solutions, do our customizations in it, export it as a Managed solution and import it to higher environments as a Managed solution. If a managed solution is deleted, it deletes all the customizations. For testing in unmanaged solutions, we need to publish the customizations.

Navigate to Microsoft Dynamics CRM -> Settings -> Customizations

You can access default solution by clicking Customize the System link.

You can create, access or modify custom solutions by clicking Solutions link.


A default solution looks like this.



MS CRM: Application UI Sections and Navigation Basics

This series of posts on MS CRM will be targeted for a novice developer. I will start with basics and later on extend it to complex functionalities. I will be providing some video tutorials later covering these topics with a use case.

Microsoft Dynamics CRM is a software package developed by Microsoft. MS CRM is gaining a lot of CRM market lately.


Microsoft Dynamics CRM is available in two primary delivery mechanisms:
Dynamics CRM On-Premises and Dynamics CRM Online.
The on-premises version of CRM is hosted by the customer in an on-premises server. With CRM Online, Microsoft takes over the hosting responsibilities. Decision points like direct access to SQL tables and expanded backup capabilities can drive the decision to go on-premises or online.

I am going to use CRM Online only in my posts as I have limited access to a trial version of MS CRM application. You can get one month trial access by registering in the link

After registering, the application will look like this. By default, we will have Sales, Service and Marketing modules. I am going to explain basic navigation steps below.


The red box indicates the application bar where on clicking the Microsoft Dynamics CRM drop down, the available apps and the settings can be accessed.

On selecting an App (like Sales dropdown), the available entities will be shown like below.
On selecting an entity, it will show the recent records and the records of the entities in below section.

We have a quick Create option also.

The green box shows the default view of the entity selected (Dashboard in this case), the one which we want to see on home page. We can change the default any time by changing our preferences. 

The yellow box is a what's new section, showing recently created, updated records information. We can follow a particular record and the updates will be shown in follow section in the right.

I will explain about the steps to configure application in further posts.

Sunday, 20 July 2014

SIEBEL:XML Hierarchy, Binary XML, XML Encoding and other usages in Siebel

A lot of people get confused with using terminologies like XML Hierarchy, Binary XML, Encoding in XML, XML Hierarchy etc. Siebel has a lot of functionality built on XML and uses vanilla business services for this purpose.

First of all, an XML document is just a valid XML. Data in any XML file can be considered as a XML document. A well formed XML is a standard to create and use XML documents. Now let us look at how siebel uses XML. 

XML is a transport language. We use XML to transfer data from one system to another in a well formed readable format. During Siebel EAI transactions, data is sent and received in XML formats. Consider this example where we send account information to external system from siebel.

I will call EAI Siebel Adapter BS, Query method to create an instance of Integration Object. The output is a property set of type SiebelMessage. It will have properties with Name as Integration Component field name. When I send this information to external system, it will send the xml name of the field. When external system sends data,it is an XML but when we receive it, it will be a property set message. We process the message using EAI Siebel Adapter service. 

As in the below example, if I have a field 'Integration Id' in IC, it will be the same in SiebelMessage but in XML, it will be IntegrationId.




An XML can be converted to Property Set or Siebel Message using EAI XML Converter business service. 

If I do a EAI Siebel Adapter query, we get property set output. If I convert the property set to an XML document using EAI XML converter, it gives XML as a string in output of type <Value>. 


If you look at above screenshot, the test case 1 is as output of EAI siebel adapter query method. I used it to convert the property set to XML Document (as seen in Value field) using EAI XML converter BS. I got test case 2 record as output. I used the XML document and converted it to XML Hierarchy which is again a property set with XML tags as properties.

I have exported the structure of data from BS simulator.

Siebel Message looks like this.



An XML Doc looks like this.

An XML Hierarchy looks like this.




Below table describes few differences of the terminology.



XML Encoding is a standard which we use to make sure that every character is unique. I can send special characters in an XML document. Every character should be understood by the receiving system. If I use English and the other person use French, we should be able to communicate with each other properly. For this, a standard called Unicode is in place. It has a unique code for each character in almost all the languages. This way, data transfer can occur without loss of meaning. 

Unicode is an industry standard for character encoding of text documents. It deļ¬nes (nearly) every possible international character by a name and a number.

If you look at the below line, the attribute encoding denotes the type of Unicode used for encoding. UTF-8 is commonly used encoding. 

<?xml version="1.0" encoding="UTF-8"?>

Binary XML is an XML with encoded binary data. The text is converted to binary data and the XML is formed with the binary information. This makes the XML as not readable by humans. This has an added advantage of performance. I will cover this topic in another post.

Hope this explains the XML usage in Siebel terms.

Friday, 18 July 2014

SIEBEL: Displaying Images and Static HTML Content in an Applet

Requirement: I want to display an image and a message or a static html content with look and feel like a webpage in an Applet.

Solution: Most of the developers will say symbolic URL is the only method to display a Web based content in an applet. This approach will give you another great option that many people do not know.

Have you ever seen Field Retrieval Type property in a Control? You might have used it for Symbolic Url. But have you got a chance to see other available options in this property. I am going to tell you about Field Retrieval Type = Service. 


If you set this to Service, you need to provide a Control User Prop to the control.

Name = Field Retrieval Service : Value = ContentBase - Asset Publish Service

This is the only available service for the retrieval type. It checks the value of the control and looks up the value of Row Id of record in Administration - Content Center -> Content Assets. If it finds a record with the same id, it shows the asset content that is added in this content view. 



If you click on Edit HTML in the top applet, it opens a HTML editor popup. You can enter text or links, with different fonts and other settings similar to a word document. Once you are done with editing, you can add an image also in the same applet if needed. Remember to checkout and check in the asset using buttons in top applet.



Once you are done with creating the Content Asset, you can be able to see the content in desired applet. This is documented in bookshelf.

You might get strucked up by this error. Record cannot be found or is not visible to you.(SBL-CTM-00326)
This is because we do not have access to the content Asset records. The access is group based, so add you access group in the Access Group sub view in Content Assets. 



Alternatively if you need to open a popup window with the required Static HTML content with images etc, you can use SWE commands like this: 
http://localhost:8080/start.swe?SWEMethod=GetPublishedContent&SWECmd=InvokeMethod&SWEService=ContentBase+-+Asset+Version+Publish+Service&&ContentIdentifier=1-282F8

Provide the content Id in the last argument in below url.

If you are looking for ways to display an image or a service level agreement or an offer that should look and behave like a webpage, this is the best way to achieve the requirement.

Thursday, 17 July 2014

SIEBEL: Invoking and Cancelling Methods

Every Siebel developer might have faced this error. 

"The method %1 is not supported on Business Component %2 in Business Object %3"

This is a common error if you are configuring new custom methods. Why do we get this error?

You know how to Walk, how to Run but you don't know how to dance. If I tell you to dance, will you? You will say I don't know. This is Siebel's way of saying I don't know :)

Siebel Objects are built on classes and dll files. Every business component is built on a class. Now every class has common methods like NewRecord, WriteRecord, DeleteRecord etc., internally defined. If I ask a BC to do something that is not internally defined in its class, it throws this error. If I invoke a custom method in a BC, it will not understand what it need to do. 

You could have observed similar error and behavior when using Business Services with custom methods. 

Why do we use custom methods? We use them to achieve custom functionality. But, once our custom functionality is achieved, we should cancel the method to go till Business Component level and avoid such errors. 

The solution is to use CancelOperation in return to the custom methods.

return(CancelOperation);

Always remember to give this statement in your custom method scripts at the end for events like PreInvokeMethod and InvokeMethod in Applet or Business Component. This will fix your issue.

Event Cancel FlagWe can do CancelOperation from a workflow also. On the start step connector of the Workflow, we can define an event and cancel the event also.

If I have to call a workflow on invoking a custom method in an applet then I will define the properties of the connector as below.



Event Object Type : Applet
Event: InvokeMethod
Event Object: Applet Name
Subevent: CustomMethod
EventCancelFlag: TRUE

The event cancel flag will cancel the operation automatically. Once you Deploy the workflow, it will create a Run time Event automatically based on above properties. You do not need any custom code to Cancel Operation. 

This is an useful option if you want to do custom actions on method invocations without writing any scripts.

---------------------------------------------------------------------------------------------

But wait!! There is another way to teach you how to dance!! If I tell you to move your leg, move your hip etc., if I give you exact commands that you understand, you can as well dance. But every time I want you to dance, i will tell you to do the routine as above (only synchronously, if I am not giving instructions and engaged to you, you cant dance!!). I can also tell you to mix and match the steps according to the type of dance (Mode).

Similarly, I can tell a method to do something the system knows using Signals. Signals are supported only in Order Management enabled applications.

Signals are synchronously used and will not work if I use them asynchronously. Also, signals work according to Modes like the type of objects.

If you create a custom method and do not specify any script or user property for the method, system will use Signals to perform the action. 


If you look at the above screenshot, we have prepared a cheat sheet (Ordered actions) in form of a signal for the system to run a workflow once you call a Method from Quote (Mode) business component. Signals is an important feature of Order Management. I will discuss more on order management and its entities in future posts.

SIEBEL: Web Service, WSDL and Namespace Explained ..

Siebel has a lot of options to integrate with other applications. I am going to discuss about Web Services in this post. This post contains generic concepts that may not be related specifically to Siebel.

A Web Service is, as the name says is a Web based Service using which we can send and receive data. A Web Service is defined in a standard format called Web Service Definition Language (WSDL). WSDL is written in XML. 

Basically WSDL contains the definition of the Service, which URL to call, what is the type and format of inputs and outputs to the Service etc. You can get a good idea about WSDL here

The basic components of a WSDL are 


1. types - Data types of input or output arguments of the service. They have simple data types like String, Number as well as complex hierarchical data types. They are defined in XML schema standards. When we import a web service in siebel, external integration objects will get created. If you generate schema of the IO structure as XML Schema, you will basically get the same as types section of the WSDL you imported. Try to compare this.



2. message - Message tags contain the business service arguments. They will refer the defined types above. This will actually refer the input and output arguments of a proxy business service when we import the WSDL.


3. portType - Port Type is the reference to the operations we perform when we execute a Web Service. This refers to the Methods of the proxy business service and its input and output arguments.


4. binding - Binding denotes the type of protocol used to call and the style of the transport of arguments. We use SOAP protocol to communicate using HTTP as type of transport in this scenario. Basically SOAP is Simple Object Access Protocol which is a standard set of rules that many systems use to communicate. I will write another post about the available binding options and the styles of transport. For the moment, I am using a document style with arguments sent as literal texts rather than encoding the data.

5. Service definition - Finally we give the details of the service like the available ports and their end points.


So basically we can correlate the Web Service call similar invoke a business service internally in siebel as below.

Imagine that I am calling a Siebel Business service, I'll write code as below. The same thing can be compared to a Web Service call.

Input = TheApplication().NewPropertySet();
Output = TheApplication().NewPropertySet(); 
ChildProperty = TheApplication().NewPropertySet();
Input.AddProperty("Name","Value");
Input.AddChild(ChildProperty);
TheApplication().GetService("Test").InvokeMethod("Abc", Input, Ouput);

Input, Output and child property Type of data and Structure in first 5 lines refers to <Types>
The Input, Output in the last line refers to <message> . Abc method can be referenced to <portType>
Test is the <Service Definition>
The only missing item is SOAP binding with HTTP transport which is a way to interact with external source.

Name Space: We have another element within the Web Services called NameSpace. NameSpace is nothing but a unique identifier given to differentiate similar objects. I can have two Web Services with same names but different namespaces. 



Imagine that I have an XML with data like this:

<Account>
<Id>1-ABC</Id>
<Contact>
<Id>1-QWE</Id>
<Contact>
</Account>

Now if I tell you to give me the Id value from this XML, can you get the value? You will ask me which Id I need, Account's or Contact's. Similarly a system will also get confused to get Id value from this.

To avoid confusion, we define a namespace and write XML like this:

<definitions xmlns:A = "Unique URI for Account" xmlns:C = "Unique URI for Contact"/>
<A:Account>
<A:Id>1-ABC</A:Id>
<C:Contact>
<C:Id>1-QWE</C:Id>
<C:Contact>
</A:Account>

Now I can clearly ask the system to get me the C:Id tag value. 

Note: xmlns stands for xml namespace. It is a standard to provide a unique resource identifier (URI) to identify a Namespace. If you do not specify a URI, then also Namespace works till the time the value is unique.