Categories

A category in your plugin will be an action category in Touch Portal. Users can open that category and select actions, events and/or connectors from that to use in their buttons or sliders. A plugin can include as many categories as you want, but best practise is to use them as actual categories. Group actions for the same software integration in one category. This will allow the users have the best experience. Also keep in mind that if the users do not like the additions of your setup, they can just remove the plugins.

Categories are defined in the Description file as an array. Each item in the array is a JSON object. This object has the following attributes in its root. On the right is an example of how it could look like. Each array component will be explain in their own documentation.

Key Type Req. API Description
id Text Yes 1.0 This is the id of the category.
name Text Yes 1.0 This is the name of the category.
imagepath Text No 1.0 This is the absolute path to an icon for the category. You should place this in your plugin folder and reference it. If you use %TP_PLUGIN_FOLDER% in the text here, it will be replaced with the path to the folder containing all plug-ins.

Image specs:
Format32bit PNG
Size24x24
ColorWhite icon with transparent background


Although colored icons are possible, they will be removed in the near future.
actions Array Yes 1.0 This is the collection that holds all the actions. More on this in the actions section.
events Array Yes 1.0 This is the collection that holds all the events. More on this in the events section.
connectors Array No 4.0 This is the collection that holds all the connectors. More on this in the connectors section.
states Array Yes 1.0 This is the collection that holds all the states. More on this in the states section.
subCategories Array No 7.0 This is the collection of sub categories that you can define. You can assign actions, events and connectors to these categories. This will allow you to add subcategories for you plugin that will be shown in the action selection control.

Category Object JSON Structure

{
  "id":"tp_tut_001_cat_01",
  "name":"Tools",
  "imagepath":"%TP_PLUGIN_FOLDER%ExamplePlugin/images/tools.png",
  "actions": [ ],
  "events": [ ],
  "connectors": [ ],
  "states": [ ]
}

This describes a Category object. The image will be shown in front of the name of the category within Touch Portal in the actions category lists. It will only show up if the category contains elements that can be used by the users. For example, if the category does not have any connectors, this category will not be shown in the Slider Connectors Category list in Touch Portal.

Plugin JSON with a Category

{
  "sdk":7,
  "version":1,
  "name":"Tutorial SDK Plugin",
  "id":"tp_tut_001",
  "configuration" : {
    "colorDark" : "#FF0000",
    "colorLight" : "#00FF00"
    "parentCategory" : "misc"
  },
  "plugin_start_cmd":"executable.exe -param",
  "categories": [
    {
      "id":"tp_tut_001_cat_01",
      "name":"Tools",
      "imagepath":"%TP_PLUGIN_FOLDER%Tutorial SDK Plugin/images/tools.png",
      "actions": [ ],
      "events": [ ],
      "connectors": [ ],
      "states": [ ],
      "subCategories": [ ]
    }
  ],
  "settings": [ ],
}

This show an example of a JSON Plugin which contains the base structure and one empty Category.