Your plug-in controller must inherit from a subclass of
System.Web.MVC.Controller, Trakopolis.Plugin.Base.Controllers.TrakController.
The TrakController type exposes the following members.
Properties
| Name | Description |
|---|---|
| ApiClient | An instance of the Trakopolis OAuth2 Client used to access the API. Client is automatically created using ClientId and ClientSecret properties. |
| ClientId | The Trakopolis OAuth2 Client Identifier. |
| ClientSecret | The Trakopolis OAuth2 Client Secret. |
| IsHosted | Equals to True if plugin is hosted in the Trakopolis plugin environment. |
| PluginContext | The Trakopolis website context from which the plug-in was called. |
Methods
| Name | Description |
|---|---|
| ConvertTimezoneDateToUtc | Convert time in given time zone to UTC |
| ConvertUtcDateToTimezone | Convert UTC time to time in given time zone |
| GetApiClientAsync | Returns API client instance with enabled automatic token management. Client can optionally be initialized in InitializeApiClientAsync method |
| InitializeApiClientAsync | Performs the necessary functionality to recreate an API client if required. |
| TrakView | Returns the correct view regardless of whether or not the plugin is functioning inside the shell or stand-alone. |
The PluginContext type exposes the following members.
Properties
| Name | Description |
|---|---|
| ActionName | Name of plugin action (MVC) |
| ApplicationName | The name of the plug-in. |
| ControllerName | Name of plugin controller (MVC) |
| DivisionId | The id of the division that called the plug-in. |
| DivisionTimezone | Name of division time zone |
| Mappings | A hierarchy of NameValuePair objects which map Trakopolis ids to external ids. These will be configured in the Trakopolis website. |
| UserID | The internal Trakopolis id of the user who called the plug-in. |
| UserName | The name of the person who called the plug-in. |
| UserTimezone | Name of user time zone |
| UseUserTimezone | Specifies whether plugin should use division time zone or user time zone |