Implementing the CallScripter IPlugin interface will expose a set of functions and properties needed to run custom .net code and controls in a script. This interface enables you to run .net code to call web services, generate xml or handle any functionality you require allowing your control to interact with other objects in a script.
For instance, information can be returned to the script for agents to react to and for use further in the script. This could be a message or html code which will be displayed on the screen.
Within the scope of the plugin control you have access to four dictionary objects containing all the current script, field and variable data, along with several key pieces of information about the session and customer. The dictionary data is free to be updated and the changes will reflect in the script.
The plugin control can be given various attributes and set to exist alongside the standard set of script controls in the Script Editor control menu.
Once your code is complied to a dll it can be placed in the CallScripter plugin folder. CallScripter plugin manager then loads the new components into an app domain and these are then available for use via the website from this point onwards.
_______________________________________________________________________________________________
Imports CallScripter.PlugIns.Interface
Public Class ClassPluginControl
Implements IPlugIn
Public Function EditorHTML(ByVal attributes AsSystem.Collections.Generic.IDictionary(Of String, String)) As String Implements CallScripter.PlugIns.Interface.IPlugIn.EditorHTML
'HTML code of control as it appears in script editor window
End Function
Public Function GetAdvancedUrl() As String ImplementsCallScripter.PlugIns.Interface.IPlugIn.GetAdvancedUrl
'Advanced pages url for script editor
End Function
Public Function GetAttributesList() AsSystem.Collections.Generic.IDictionary(Of String, CallScripter.PlugIns.Interface.ControlAttrib) ImplementsCallScripter.PlugIns.Interface.IPlugIn.GetAttributesList
'List of control attributes to return to editor
End Function
Public Function GetControlName() As String ImplementsCallScripter.PlugIns.Interface.IPlugIn.GetControlName
'Control name to return to editor
End Function
Public Function GetFieldDescription() As String Implements CallScripter.PlugIns.Interface.IPlugIn.GetFieldDescription
'Description of control function
End Function
Public Function GetSubCatID() As Integer Implements CallScripter.PlugIns.Interface.IPlugIn.GetSubCatID
'Control sub category id for where the control should appear in the menu structure
End Function
Public ReadOnly Property Name() As String Implements CallScripter.PlugIns.Interface.IPlugIn.Name
'Control name
Get
End Get
End Property
Public ReadOnly Property PlugIn_Id() As System.Guid Implements CallScripter.PlugIns.Interface.IPlugIn.PlugIn_Id
'Plugin id – each control should have it’s own unique GUID which remains constant across different versions of the same control so the system knows which one to replace when you drop in the new version
Get
End Get
End Property
Public Function RunControl(ByRef fields As System.Collections.Generic.IDictionary(Of String, String), ByRef variables As System.Collections.Generic.IDictionary(Of String, String), ByRef other As System.Collections.Generic.IDictionary(Of String, String), ByRef attributes As System.Collections.Generic.IDictionary(Of String, String)) As String Implements CallScripter.PlugIns.Interface.IPlugIn.RunControl
'Place for custom .net code. This will run upon page load.
End Function
End Class
_______________________________________________________________________________________________