How to customize the file type URL for dynamic host names in Siebel Open UI
24. 2. 2020
How to customize the file type URL for dynamic host names in Siebel Open UI
In the dynamic enterprise enviroment due to migration to the cloud, rembranding, fusion the host names of the dms are changing.
OOTB Siebel CRM stores URL type file attachments static in the DB column. This is a challenge, when the host names are changed due mentioned reasons.
Update of these urls is needed what is not very challenging tasks. Siebel CRM has more features which can help to keep these links dynamic.
1. Symbolic URLs. Under Administration Integration -> Symbolic URLs you can administrate your URLs and deploy them according to the enviroment stage or change of foreign hosts such as DMS.
2. Presentation Model of the Siebel Open UI. You can catch the method Drilldown and control the processing of the method and synthethise the URL using Symbolic URL, in the DB column stored document ID and open new window.
Here are the steps needed to achieve dynamic URL for file attachmens of URL type :
1. Configure Symbolic URL unde Administration Integration -> Symbolic URL ...
2. Read the Symbolic URL within Application Start Script. We use ecmGGURL Profile Attribute.
function Get_URL_GG ()
{
var boSymbURL:BusObject;
var bcSymbURL:BusComp;
try {
var strLanguage:chars = TheApplication().InvokeMethod("Language");
boSymbURL = TheApplication().GetBusObject("WI Symbolic URL");
bcSymbURL = boSymbURL.GetBusComp("WI Symbolic URL");
bcSymbURL.ActivateField("Name");
bcSymbURL.ActivateField("URL");
bcSymbURL.ClearToQuery();
bcSymbURL.SetSearchExpr("[Name] LIKE 'MOBI_GG*'");
bcSymbURL.ExecuteQuery(ForwardOnly);
var isRecord:bool = bcSymbURL.FirstRecord();
if (!isRecord) { //Error Handling
Write_To_Log(Name(),"No URL Records to initialize Jump-Off URLs found","TheApplication.GET_URL()","Error",urlId);
return;
}
//Loop through the found records in order to set the profile Attributes with the URL of each target system
while (isRecord) {
var nameStr:chars = bcSymbURL.GetFieldValue("Name");
var urlStr:chars = bcSymbURL.GetFieldValue("URL");
var urlId:chars = bcSymbURL.GetFieldValue("Id");
switch (nameStr) {
case "MOBI_GG24_AB": //KOA 14.05.2019 added
//TheApplication().SetProfileAttr("mapsTrGGURL", urlStr); - not used in FINS application
break;
case "MOBI_GG25_XX":
TheApplication().SetProfileAttr("mobiLisaGGURL", urlStr);
break;
default:
Write_To_Log(Name(),"The Value "+nameStr+" in the name field is not valid","TheApplication.GET_URL()","Error",urlId);
break;
} //end switch
isRecord = bcSymbURL.NextRecord();
}
} finally {
bcSymbURL = null;
boSymbURL = null;
}
}
3. Write PM script and register the script for the attachment applet. We will customize the applet Asset Mgmt Asset Attachment.
Here is the full version :
//CCW 2020 Martin Piekov
//13.01.2020 Martin Piekov
//this is to calculate url based on profile for drilldown
if (typeof(SiebelAppFacade.AssetMgmtAssetAttachmentListAppletPM) === "undefined") {
SiebelJS.Namespace("SiebelAppFacade.AssetMgmtAssetAttachmentListAppletPM");
define("siebel/custom/AssetMgmtAssetAttachmentListAppletPM", ["siebel/listpmodel"],
function () {
SiebelAppFacade.AssetMgmtAssetAttachmentListAppletPM = (function () {
function AssetMgmtAssetAttachmentListAppletPM(pm) {
SiebelAppFacade.AssetMgmtAssetAttachmentListAppletPM.superclass.constructor.apply(this, arguments);
}
SiebelJS.Extend(AssetMgmtAssetAttachmentListAppletPM, SiebelAppFacade.ListPresentationModel);
AssetMgmtAssetAttachmentListAppletPM.prototype.Init = function () {
// Init is called each time the object is initialised.
// Add code here that should happen before default processing
SiebelAppFacade.AssetMgmtAssetAttachmentListAppletPM.superclass.Init.apply(this, arguments);
// Add code here that should happen after default processing
this.AddMethod( "InvokeMethod", PreInvokeProcess, { sequence : true, scope : this } ); //pre handler
}
AssetMgmtAssetAttachmentListAppletPM.prototype.Setup = function (propSet) {
// Setup is called each time the object is initialised.
// Add code here that should happen before default processing
SiebelAppFacade.AssetMgmtAssetAttachmentListAppletPM.superclass.Setup.apply(this, arguments);
// Add code here that should happen after default processing
}
function PreInvokeProcess( methodName, psInputArgs, lp, returnStructure)
{
if( methodName === "Drilldown"){
var sURL="";
var BC=this.Get("GetBusComp");
//get the needed params
var sDocId = BC.GetFieldValue("FileNameExt");
var sURLPrefix = SiebelApp.S_App.GetProfileAttr("ecmGGURL");
sURL = sURLPrefix + sDocId+"/profiles/SiebelB2C/formats/original/disposition/inline";
if (sURL.length > 0) {
var win = window.open(sURL, '_new');
returnStructure ["CancelOperation"] = true;
}
}
returnStructure ["ContinueOperation"] = true;
}
return AssetMgmtAssetAttachmentListAppletPM;
}()
);
return "SiebelAppFacade.AssetMgmtAssetAttachmentListAppletPM";
})
}
Using this if approach by changing the host name for the file DMS you just change symbolic URL within the administration screen or via deployment and you attachment files URL point to correct host.
For more information contact us.
Back to Blog