Package io.revealbi.core
Class RVDashboardProvider
java.lang.Object
io.revealbi.core.RVDashboardProvider
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCreates a newRVDashboardProviderusing the default dashboards directory.RVDashboardProvider(String dashboardsPath) Creates a newRVDashboardProvider. -
Method Summary
Modifier and TypeMethodDescriptiongetDashboard(IRVUserContext userContext, String dashboardId) Load dashboard from provided in the constructor location on the file system.voidsaveDashboard(IRVUserContext userContext, String dashboardId, InputStream dashboardStream) Saves a dashboard at the provided in the constructor location on the file system.
-
Constructor Details
-
RVDashboardProvider
public RVDashboardProvider()Creates a newRVDashboardProviderusing the default dashboards directory. -
RVDashboardProvider
Creates a newRVDashboardProvider.- Parameters:
dashboardsPath- The directory to be used to load/save dashboards from/to.
-
-
Method Details
-
getDashboard
Load dashboard from provided in the constructor location on the file system.- Specified by:
getDashboardin interfaceIRVDashboardProvider- Parameters:
userContext- Object identifying the user.dashboardId- The id of the requested dashboard.- Returns:
- An input stream for the requested dashboard, or
nullif 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:
saveDashboardin interfaceIRVDashboardProvider- 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.
-