Skip to content

Plugin Integration Details

mikldt edited this page Sep 16, 2014 · 1 revision

This page contains details of the integration between the Concerto Hardware Plugin and the Concerto Server. For the code behind much of this integration, see engine.rb.

Routes

concerto-hardware's routes are namespaced to the /hardware sub-uri. For example, if concerto is normally accessed at http://concerto.example.com, a concerto-hardware would look like http://concerto.example.com/hardware/players/1. The following routes are added to the main rails app:

  • /hardware - a plaintext page which reads "Welcome to the hardware plugin!" - this is useful for making sure that routes are integrated properly.
  • /hardware/players - a RESTful resource representing the Player object. For more information, see the Player API Documentation.

Screen Creation

When a new screen is set up using a Concerto Hardware client (Bandshell) instead of a simple web browser, a Player object is automatically created. This is accomplished through the little trick of adding the character s to the end of the screen's authentication code (which is used to uniquely identify the screen during setup). Core Concerto methods ignore this character when it is entered by the user as the temporary token for a new screen. However, a special hook (:change on ScreensController) allows Concerto Hardware to intercept the new screen and create a corresponding Player. As soon as the user submits the setup form to view their newly-created Screen's details, Player information will be available (see UI Integration below).

UI Integration

In Concerto, the primary method for accessing Concerto Hardware is when viewing details of a Screen (screens#show). Concerto Hardware adds a right-hand status box which provides relevant information. If the Screen is not associated with a hardware Player, a link is provided to create one. If it is managed by Concerto Hardware, this area is used to display Player settings (such as screen on/off times) and an Edit Screen link.

This integration is accomplished using the ScreensController's show controller hook and screen_details view hooks.

  • Like other integrations to Concerto, these hooks managed by engine.rb.
  • For the code that gets inserted into the screen details view, see the screen_link partial.
  • For more information about Concerto callback hooks, see this page on the Concerto Wiki.

Configuration

Concerto Hardware adds a configuration option, Poll Interval, to the main Concerto App. This parameter can be set on Concerto's Settings page. Right now, this option is not used, but we keep it around because it is a good demonstration of the feature. Its fate will be decided ater we come up with a Push solution and decide if it is still desirable for polling fallback.

Clone this wiki locally