org.apertereports.dashboard
Class ReportViewComponent

java.lang.Object
  extended by com.vaadin.ui.AbstractComponent
      extended by com.vaadin.ui.AbstractComponentContainer
          extended by com.vaadin.ui.CustomComponent
              extended by org.apertereports.AbstractLazyLoaderComponent
                  extended by org.apertereports.dashboard.ReportViewComponent
All Implemented Interfaces:
com.vaadin.event.MethodEventSource, com.vaadin.terminal.Paintable, com.vaadin.terminal.Sizeable, com.vaadin.terminal.VariableOwner, com.vaadin.ui.Component, com.vaadin.ui.ComponentContainer, eu.livotov.tpt.gui.widgets.TPTLazyLoadingLayout.LazyLoader, Serializable, EventListener, ReportDataProvider

public class ReportViewComponent
extends AbstractLazyLoaderComponent
implements ReportDataProvider

This component is used to display the generated reports in the portlet. It analyzes the template and report config list loaded from portlet preferences and transforms the HTML according to the discovered report tags.

The contents of every generated report are cached using a MapCache instance. These caches are cleared after a configured interval thus enabling the component to generate the report again with more up to date data.

The component also supports lazy loading due to the fact that the generated reports can grow to enormous sizes.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponent.ComponentErrorEvent, com.vaadin.ui.AbstractComponent.ComponentErrorHandler
 
Nested classes/interfaces inherited from interface com.vaadin.ui.ComponentContainer
com.vaadin.ui.ComponentContainer.ComponentAttachEvent, com.vaadin.ui.ComponentContainer.ComponentAttachListener, com.vaadin.ui.ComponentContainer.ComponentDetachEvent, com.vaadin.ui.ComponentContainer.ComponentDetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.ErrorListener, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable
com.vaadin.terminal.Paintable.RepaintRequestEvent, com.vaadin.terminal.Paintable.RepaintRequestListener
 
Field Summary
 
Fields inherited from interface com.vaadin.terminal.Sizeable
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
ReportViewComponent(com.vaadin.Application application, MapCache cache, String template, List<ReportConfig> configs, boolean lazyLoad)
           
 
Method Summary
 ReportConfig generateDrilldownReportConfig(Map<String,List<String>> params)
          Generates a temporary drilldown report config from a map of link parameters.
 void lazyLoad()
          Initializes the component with lazy loading.
 Pair<net.sf.jasperreports.engine.JasperPrint,byte[]> provideReportData(ReportConfig config, ReportConstants.ReportType format, boolean cached)
          Provides a report data from the cache or generates it and caches for later use to boost performance.
 ReportTemplate provideReportTemplate(ReportConfig config)
          Provides the report templates from database for other components based on passed ReportConfig parameter.
 
Methods inherited from class org.apertereports.AbstractLazyLoaderComponent
getLazyLoadingMessage, lazyLoad
 
Methods inherited from class com.vaadin.ui.CustomComponent
addComponent, getComponentCount, getComponentIterator, getComponentType, getCompositionRoot, moveComponentsFrom, paintContent, removeAllComponents, removeComponent, replaceComponent, setComponentType, setCompositionRoot
 
Methods inherited from class com.vaadin.ui.AbstractComponentContainer
addListener, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, removeListener, removeListener, requestRepaintAll, setEnabled, setHeight, setWidth
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addListener, addListener, addListener, addListener, addStyleName, changeVariables, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, focus, getApplication, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isReadOnly, isVisible, paint, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeight, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidth, setWidthUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setIcon, setParent, setReadOnly, setStyleName, setVisible
 
Methods inherited from interface com.vaadin.terminal.Paintable
addListener, getDebugId, paint, removeListener, requestRepaint, requestRepaintRequests, setDebugId
 
Methods inherited from interface com.vaadin.terminal.VariableOwner
changeVariables, isImmediate
 
Methods inherited from interface com.vaadin.terminal.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUnits
 

Constructor Detail

ReportViewComponent

public ReportViewComponent(com.vaadin.Application application,
                           MapCache cache,
                           String template,
                           List<ReportConfig> configs,
                           boolean lazyLoad)
Method Detail

generateDrilldownReportConfig

public ReportConfig generateDrilldownReportConfig(Map<String,List<String>> params)
Generates a temporary drilldown report config from a map of link parameters. The parameters are taken from a generated report.

Specified by:
generateDrilldownReportConfig in interface ReportDataProvider
Parameters:
params - Drilldown parameters
Returns:
A temporary ReportConfig

provideReportTemplate

public ReportTemplate provideReportTemplate(ReportConfig config)
Provides the report templates from database for other components based on passed ReportConfig parameter.

Specified by:
provideReportTemplate in interface ReportDataProvider
Parameters:
config - A report config
Returns:
A relevant report template
See Also:
ReportDataProvider

provideReportData

public Pair<net.sf.jasperreports.engine.JasperPrint,byte[]> provideReportData(ReportConfig config,
                                                                              ReportConstants.ReportType format,
                                                                              boolean cached)
Provides a report data from the cache or generates it and caches for later use to boost performance.

Specified by:
provideReportData in interface ReportDataProvider
Parameters:
config - Input config
format - Output format
cached - Should the data be taken from a cache or generated directly
Returns:
A pair of objects - the JasperPrint and the bytes of the generated report
See Also:
ReportDataProvider

lazyLoad

public void lazyLoad()
              throws Exception
Initializes the component with lazy loading.

Specified by:
lazyLoad in class AbstractLazyLoaderComponent
Throws:
Exception - on lazy load error


Copyright © 2011-2012. All Rights Reserved.