User Manual - dudelis/k2-ado.net-helper GitHub Wiki

Installation of the ServiceBroker

In order to install the ServiceBroker and all other artifacts, you need to run the Install.ps1 file in the Release package, which will do the following:

  • copy the ServiceBroker binaries (K2Field.AdoNetHelper.ServiceBroker.dll) to the ..\K2 Blackpearl\ServiceBroker\ folder;
  • register the Service Type with the name 'K2Field_AdoNetHelper_ServiceBroker';
  • deploys the Test package, which contains the following artifacts:
    • ServiceInstance;
    • SmartObjects, some of which already contain data for testing;
    • Examples of Views and Forms, which demonstrate various application of the Broker;

Service Authentication

Since the main idea of the Service Broker is to run the ADO.NET queries dynamically, the following Authentication Modes may be used with the Service Type:

  • Impersonate;
  • ServiceAccount;

But you need to take into account, that all the SmartObjects, which will be subsequently called from ADO.NET queries, will use the authentication of their Service Instances.

Configuration of the Service Instance

After you run the installer, you will have a pre-configured Service Instance, installed on your K2 Server. But you can configure the Service Instance manually. Below you can see the description of the Service Instance Configuration parameters:

  • Service Objects Definition - this is a json of the following format, which is parsed by the Service Broker when the Service instance is created and, therefore, multiple service objects can be created for different Ado.Net calls to different SmartObjects:
[  
   {  
      "SoName":"ServiceObject_Name1",
      "Properties":[  
         {  
            "Name":"Property1_Name",
            "Type":"Text"
         },
         {  
            "Name":"Property2_Name",
            "Type":"Number"
         }
      ]
   },
   {  
      "SoName":"ServiceObject_Name1",
      "Properties":[  
         {  
            "Name":"Property1_Name",
            "Type":"Text"
         },
         {  
            "Name":"Property2_Name",
            "Type":"Number"
         }
      ]
   }
]

Below you can find the explanation of the json:

  • SoName - a unique name of your ServiceObject;
  • Properties - a list of properties, which will be returned from ADO.NET query and mapped to the returned columns:
    • Name - Name of your property, which should be unique within 1 ServiceObject;
    • Type - Type of your property, returned from ADO.NET query. Here are the available SmartObject property types:
      • Text
      • Memo
      • Number
      • Decimal
      • Autonumber
      • YesNo
      • DateTime
      • Image
      • File
      • MultiValue
      • Xml
      • HyperLink
      • Guid
      • AutoGuid
      • Date
      • Time