Class JKWebAppBaseController

java.lang.Object
com.jk.web.faces.controllers.JKWebController
com.jk.webstack.controllers.JKWebAppBaseController
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JKWebControllerWithSqlDataAccess

public class JKWebAppBaseController extends JKWebController
This class is a base controller for web applications that provides utility methods for managing user information, logging actions, and accessing services related to user actions and email communication.
See Also:
  • Constructor Details

    • JKWebAppBaseController

      public JKWebAppBaseController()
  • Method Details

    • getUserName

      public String getUserName()
      This method gets the user name of the currently logged-in user from the ID token.
      Overrides:
      getUserName in class JKWebController
      Returns:
      the user name of the user.
    • getFirstName

      public String getFirstName()
      This method gets the first name of the currently logged-in user from the ID token.
      Returns:
      the first name of the user.
    • getFamilyName

      public String getFamilyName()
      This method gets the family name (last name) of the currently logged-in user from the ID token.
      Returns:
      the family name of the user.
    • getEmail

      public String getEmail()
      This method gets the email address of the currently logged-in user from the ID token.
      Returns:
      the email address of the user.
    • getIdToken

      public org.keycloak.representations.IDToken getIdToken()
      This method retrieves the ID token of the currently logged-in user.
      Returns:
      the ID token of the user.
    • isUserLoggedIn

      public boolean isUserLoggedIn()
      This method checks if a user is currently logged in.
      Returns:
      true, if a user is logged in, false otherwise.
    • logAction

      public void logAction(String logType)
      This method logs an action to a specific user.
      Overrides:
      logAction in class JKWebController
      Parameters:
      logType - Specifies the type of the action to log.
    • getActionLogName

      protected String getActionLogName()
      This method gets the name to use for action logging.
      Returns:
      the name to use for action logging.
    • getActionLogService

      protected ActionLogsService getActionLogService()
      This method gets the action log service.
      Returns:
      the instance of the action log service.
    • getEmailService

      protected EmailService getEmailService()
      This method gets the email service.
      Returns:
      the instance of the email service.