ImplementationURL : String;
The ImplementationURL property determines the script URL implementing object class operations, which are executed from the web application of Foresight Analytics Platform.
From the interface the script URL is set in the Object Classes dialog box on the Operations tab.
Executing the example requires that the repository contains a resources object with the OBJ_RES identifier. There must be two icons: C:\Icon_small.ico and C:\Icon_large.ico in the file system.
Sub UserProc;
Var
Mb: IMetabase;
Object: IMetabaseObject;
CustomClassExtender: IMetabaseCustomExtender;
CustClasses: IMetabaseCustomClasses;
CustomClass: IMetabaseCustomClass;
Operations: IMetabaseCustomClassOperations;
Operation: IMetabaseCustomClassOperation;
CreateInfo: IMetabaseObjectCreateInfo;
Description: IMetabaseObjectDescriptor;
ImgList: IGxImageList;
ImgList32: IGxImageList;
Icon: IGxIcon;
CustomObject: IMetabaseCustomObject;
Begin
Mb := MetabaseClass.Active;
// Creating custom class container
CreateInfo := Mb.CreateCreateInfo;
CreateInfo.ClassId := MetabaseObjectClass.KE_CLASS_CUSTOM_EXTENDER;
CreateInfo.Name := "CUSTOM_EXTENDER";
CreateInfo.Permanent := True;
CreateInfo.Parent := Mb.Root;
Description := Mb.CreateObject(CreateInfo);
Object := Description.Edit;
CustomClassExtender := Object As IMetabaseCustomExtender;
ImgList := New GxImageList.Create;
ImgList.Height := 16;
Icon := New GxIcon.CreateFromFile("C:\Icon_small.ico");
ImgList.AddIcon(Icon);
CustomClassExtender.SmallImages := ImgList;
ImgList32 := New GxImageList.Create;
ImgList32.Height := 32;
Icon := New GxIcon.CreateFromFile("C:\Icon_large.ico");
ImgList32.AddIcon(Icon);
CustomClassExtender.LargeImages := ImgList32;
CustomClassExtender.IsShared := True;
CustomClassExtender.Resource := Mb.ItemById("OBJ_RES").Bind As IResourceObject;
CustomClassExtender.NameResource := "ID_CUSTOM_EXTENDER";
// Adding the custom class to the container
CustClasses := CustomClassExtender.Classes;
CustomClass := CustClasses.Add;
CustomClass.Description := Own class;
CustomClass.ImageIndex := 0;
// URL of thenbsp;scriptnbsp;implementingnbsp;operations
CustomClass.ImplementationURL := "https://site/CoolScript.js";
Operations := CustomClass.Operations;
Operation := Operations.Add(0);
Operation.Name := New method;
Object.Save;
End Sub UserProc;
After executing the example the custom classes container that contains one class is created. An identifier of the string resource ID_CUSTOM_EXTENDER from the OBJ_RES resources will be determined for the container. One operation will be defined for a class. The custom class object will be created in the repository. The C:\Icon_large.ico file is a source of a large icon, the C:\Icon_small.ico file - of a small icon. For the class the URL of the script, implementing the handler of the operation of the object class in the Web application is set - https://site/CoolScript.js.
See also: