Package io.jmix.supersetflowui.component
Class SupersetDashboard
java.lang.Object
com.vaadin.flow.component.Component
io.jmix.supersetflowui.kit.component.JmixSupersetDashboard
io.jmix.supersetflowui.component.SupersetDashboard
- All Implemented Interfaces:
- com.vaadin.flow.component.AttachNotifier,- com.vaadin.flow.component.DetachNotifier,- com.vaadin.flow.component.HasElement,- com.vaadin.flow.component.HasSize,- com.vaadin.flow.component.HasStyle,- Serializable,- org.springframework.beans.factory.Aware,- org.springframework.beans.factory.InitializingBean,- org.springframework.context.ApplicationContextAware
public class SupersetDashboard
extends JmixSupersetDashboard
implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
The component for showing embedded dashboards from Superset. It uses the embedded-sdk library on the client-side to
 embed a dashboard into an IFrame.
 
To work with the component correctly, you should provide the embedded ID from a configured dashboard in Superset and set it to the component.
By default, the component manages guest token acquisition and refresh requests. It configures the request according to the Superset API and contains the following information: dataset constraints, the embedded ID, and the current username. The client-side of the component handles token expiration time. Before expiration, the component requests fetching a new token in a non-blocking manner.
The example of component in a view descriptor:
 xmlns:superset="http://jmix.io/schema/superset/ui"
 <superset:dashboard id="dashboard"
                     height="100%"
                     width="100%"
                     embeddedId="d8bb6f86-dfef-4049-a39a-fd73da1a601d"/>
 - See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected BackgroundWorkerprotected CurrentUserSubstitutionprotected DatasetConstraintsProviderprotected SupersetClientprotected SupersetUiPropertiesprotected SupersetTokenManager
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidprotected GuestTokenBodybuildGuestTokenBody(String embeddedID, DatasetConstraintsProvider constraintsProvider) protected List<GuestTokenBody.RowLevelRole>convertToSupersetRls(List<DatasetConstraint> datasetConstraints) protected SupersetDashboard.FetchGuestTokenTaskcreateFetchGuestTokenTask(long timeout, GuestTokenBody body, String accessToken, String csrfToken) protected voidvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetDatasetConstraintsProvider(DatasetConstraintsProvider datasetConstraintsProvider) Sets dataset constraints provider.Methods inherited from class io.jmix.supersetflowui.kit.component.JmixSupersetDashboardgetEmbeddedId, isChartControlsVisible, isFiltersExpanded, isTitleVisible, setChartControlsVisible, setEmbeddedId, setFiltersExpanded, setGuestTokenInternal, setTitleVisible, setUrlInternalMethods inherited from class com.vaadin.flow.component.ComponentaddListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifieraddAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifieraddDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElementgetElementMethods inherited from interface com.vaadin.flow.component.HasSizegetHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyleaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
- 
Field Details- 
applicationContextprotected org.springframework.context.ApplicationContext applicationContext
- 
supersetClient
- 
tokenManager
- 
backgroundWorker
- 
currentUserSubstitution
- 
supersetUiProperties
- 
datasetConstraintsProvider
 
- 
- 
Constructor Details- 
SupersetDashboardpublic SupersetDashboard()
 
- 
- 
Method Details- 
setApplicationContextpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
- setApplicationContextin interface- org.springframework.context.ApplicationContextAware
- Throws:
- org.springframework.beans.BeansException
 
- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- org.springframework.beans.factory.InitializingBean
 
- 
getDatasetConstraintsProvider- Returns:
- dataset constraints provider or nullif not set
 
- 
setDatasetConstraintsProviderpublic void setDatasetConstraintsProvider(@Nullable DatasetConstraintsProvider datasetConstraintsProvider) Sets dataset constraints provider. These constraints are applied to datasets that are used in an embedded dashboardJmixSupersetDashboard.getEmbeddedId().- Parameters:
- datasetConstraintsProvider- dataset constraints providers
 
- 
fetchGuestTokenprotected void fetchGuestToken()- Overrides:
- fetchGuestTokenin class- JmixSupersetDashboard
 
- 
buildGuestTokenBodyprotected GuestTokenBody buildGuestTokenBody(String embeddedID, @Nullable DatasetConstraintsProvider constraintsProvider) 
- 
convertToSupersetRlsprotected List<GuestTokenBody.RowLevelRole> convertToSupersetRls(List<DatasetConstraint> datasetConstraints) 
- 
createFetchGuestTokenTaskprotected SupersetDashboard.FetchGuestTokenTask createFetchGuestTokenTask(long timeout, GuestTokenBody body, String accessToken, @Nullable String csrfToken) 
 
-