Class DashboardCardService

java.lang.Object
org.eblocker.server.http.service.DashboardCardService

public class DashboardCardService extends Object
  • Constructor Details

    • DashboardCardService

      @Inject public DashboardCardService(DataSource dataSource)
  • Method Details

    • getNewDashboardCardColumns

      public DashboardColumnsView getNewDashboardCardColumns(UserRole userRole)
    • createParentalControlCard

      public UiCard createParentalControlCard(int referencingUserId, String name, String requiredFeature)
      Create a new parental control dashboard card. Required e.g. for creation of cards for CHILD users. It should not be necessary to call this method from the UI. The UserService calls this method to create dashboard cards when needed.
      Parameters:
      referencingUserId - the (CHILD) user that this card has been created for (to maintain specific order of that child-card)
      requiredFeature - License that is necessary to display this card (e.g. for CHILD card it is 'FAM') e.g. ProductFeature.FAM.name()
      name - used in UI for translations (json prefix)
      Returns:
      the saved card.
    • removeParentalControlCard

      public Integer removeParentalControlCard(int referencingUserId)
    • removeCardByName

      public void removeCardByName(String name)
    • saveNewDashboardCard

      public UiCard saveNewDashboardCard(UiCard card)
    • saveDashboardCardIfNotExists

      public UiCard saveDashboardCardIfNotExists(UiCard card)
    • getAll

      public List<UiCard> getAll()
    • getDashboardCards

      public List<UiCard> getDashboardCards(DashboardColumnsView columns)
    • getUpdatedColumnsView

      public DashboardColumnsView getUpdatedColumnsView(DashboardColumnsView columns, UserRole userRole, List<AccessRight> accessRights)
      This method finds all cards that are either valid for a user and are not yet included in the user's DashboardColumnsView or that are still in the user's DashboardColumnsView, but are no longer valid for that user. The validity of a card for a user is given by the user's role and the accessRights.
      Returns:
      updated DashboardColumnsView
    • getById

      public UiCard getById(List<UiCard> cards, int id)