Skip to content
Joshua Monson edited this page Aug 3, 2013 · 4 revisions

Controllers are located under the app/controllers package. For controllers which have AJAX-related actions, an ajax package is also created. For authentication modules, an authentication package is created.

ajax

  • ActivitySaver.scala - Activity and analytics are tracked via a custom activity stream. Each event is saved by making an AJAX call to this controller.
  • ContrentLister.scala - The purpose of this controller is to allow for content listing cross-domain. This is used in the Ayamel-customized PlayGraph editor (which is on the playgraph.byu.edu domain).
  • PermissionChecker.scala - This controller is used to check which documents (caption tracks and annotations) a user is allowed to view, edit, enable, and publish. Uses service/DocumentPermissionChecker.scala.
  • Translate.scala - Because Google Translate and WordReference both required sensitive information (key, login info) for their API calls, this controller was added. It handles all the authentication of the translate APIs.
  • Util.scala - This is the controller for various utility AJAX calls.

authentication

  • Authentication.scala - Most of the authentication tasks are located in the controllers/authentication/Authentication.scala controller. It deals with logging in and out, creating accounts, merging accounts, pulling the active user out of the current session, and enforcing user roles.
  • Cas.scala - This deals with the authentication flow of BYU CAS authentication.
  • Google.scala - This deals with the authentication flow of Google authentication.
  • Password.scala - This handles password authentication as well as password-based account creation.

Authenticated actions

When writing an action, instead of using the default Play framework Action, use Authentication.authenticatedAction. This will check that the user is logged in and is a real user. Use it like this:

def myAction = Authentication.authenticatedAction() {
  request =>
    user =>
      Ok("Hello " + user.displayName)
}

Default package

  • Administration.scala - This controller deals with administrator dashboard actions.
  • Application.scala - This is the controller for all basic pages (login, home, about, terms of use, etc.)
  • CaptionAider.scala - All CaptionAider-related actions are in this controller.
  • ContentController.scala - Basic actions relating to content are here. That includes creation, viewing, listing, and deleting.
  • ContentEditing.scala - Actions that edit the content are in this controller (updating metadata, visibility, shareability, configuration/settings, etc.)
  • CourseContent.scala - Anything that deals with content in the context of a course goes here. Has both viewing and editing actions.
  • Courses.scala - Actions dealing with courses go here.
  • DocumentManager.scala - The purpose of this controller is to deal with the creation and updating of annotation sets. It also includes publishing of documents (annotation sets and caption tracks).
  • Errors.scala - Common errors that the user could run into are here.
  • HelpPages.scala - A controller for the help pages.
  • Playlists.scala - A basic controller for viewing playlists.
  • QuestionSets.scala - This controller deals with viewing question sets and grading them. See Question Sets for more information.
Clone this wiki locally