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

NameDescription
ApiClientAn instance of the Trakopolis OAuth2 Client used to access the API. Client is automatically created using ClientId and ClientSecret properties.
ClientIdThe Trakopolis OAuth2 Client Identifier.
ClientSecretThe Trakopolis OAuth2 Client Secret.
IsHostedEquals to True if plugin is hosted in the Trakopolis plugin environment.
PluginContextThe Trakopolis website context from which the plug-in was called.

Methods

NameDescription
ConvertTimezoneDateToUtcConvert time in given time zone to UTC
ConvertUtcDateToTimezoneConvert UTC time to time in given time zone
GetApiClientAsyncReturns API client instance with enabled automatic token management. Client can optionally be initialized in InitializeApiClientAsync method
InitializeApiClientAsyncPerforms the necessary functionality to recreate an API client if required.
TrakViewReturns 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

NameDescription
ActionNameName of plugin action (MVC)
ApplicationNameThe name of the plug-in.
ControllerNameName of plugin controller (MVC)
DivisionIdThe id of the division that called the plug-in.
DivisionTimezoneName of division time zone
MappingsA hierarchy of NameValuePair objects which map Trakopolis ids to external ids. These will be configured in the Trakopolis website.
UserIDThe internal Trakopolis id of the user who called the plug-in.
UserNameThe name of the person who called the plug-in.
UserTimezoneName of user time zone
UseUserTimezoneSpecifies whether plugin should use division time zone or user time zone