Class SplibDataStoreDependentControllerAdvice

java.lang.Object
jp.ecuacion.splib.web.advice.SplibDataStoreDependentControllerAdvice

public abstract class SplibDataStoreDependentControllerAdvice extends Object
Provides the function that puts logged-in accounts info to Model. Additionally, login-related procedure is done here.

You can use the function by creating a class extends this. If the app you're creating doesn't have login feature, you don't need this.

If you store the account info to a database and use JPA to access the database, Use jp.ecuacion.splib.web.jpa.advice.SplibJpaAccountControllerAdvice in ecuacion-splib-web-jpa.

  • Constructor Details

    • SplibDataStoreDependentControllerAdvice

      public SplibDataStoreDependentControllerAdvice()
  • Method Details

    • setAccountInfo

      @ModelAttribute protected void setAccountInfo(org.springframework.ui.Model model, @AuthenticationPrincipal org.springframework.security.core.userdetails.UserDetails loginUser)
      Sets account info into a Model.
      Parameters:
      model - model
      loginUser - UserDetails
    • executeForAll

      protected void executeForAll()
      Additional procedure for both general accounts and admin accounts can be define by overriding the method.
    • executeForAccountBelongingToGroup

      protected void executeForAccountBelongingToGroup(SplibRecord acc)
      Additional procedure for accounts belonging to group can be define by overriding the method.