Class RVDashboardProvider

java.lang.Object
io.revealbi.core.RVDashboardProvider
All Implemented Interfaces:
IRVDashboardProvider

public class RVDashboardProvider extends Object implements IRVDashboardProvider
Default file system based implementation of IRVDashboardProvider loading/saving .rdash files from a specified (through the constructor) directory. If the dashboardId does not end with .rdash it will be added upon save and load.
  • Constructor Details

    • RVDashboardProvider

      public RVDashboardProvider()
      Creates a new RVDashboardProvider using the default dashboards directory.
    • RVDashboardProvider

      public RVDashboardProvider(String dashboardsPath)
      Creates a new RVDashboardProvider.
      Parameters:
      dashboardsPath - The directory to be used to load/save dashboards from/to.
  • Method Details

    • getDashboard

      public InputStream getDashboard(IRVUserContext userContext, String dashboardId) throws IOException
      Load dashboard from provided in the constructor location on the file system.
      Specified by:
      getDashboard in interface IRVDashboardProvider
      Parameters:
      userContext - Object identifying the user.
      dashboardId - The id of the requested dashboard.
      Returns:
      An input stream for the requested dashboard, or null if it was not found.
      Throws:
      IOException - If the dashboard cannot be loaded.
    • saveDashboard

      public void saveDashboard(IRVUserContext userContext, String dashboardId, InputStream dashboardStream) throws IOException
      Saves a dashboard at the provided in the constructor location on the file system.
      Specified by:
      saveDashboard in interface IRVDashboardProvider
      Parameters:
      userContext - Object identifying the user.
      dashboardId - The id of the requested dashboard.
      dashboardStream - The dashboard to save.
      Throws:
      IOException - If the dashboard cannot be saved.