Class StaticReportDataSource

  • All Implemented Interfaces:
    ReportDataSource

    public class StaticReportDataSource
    extends java.lang.Object
    implements ReportDataSource
    StaticReportDataSource

    Author: Perry

    This class provides a static data source to a report resource.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void gatherData​(ReportExecutionContext context, java.io.Serializable aConfigObject, java.util.Map<java.lang.String,​java.lang.Object> extraConfigs)
      Called when a report is being executed to gather the data represented by this data source.
      java.lang.String getId()
      Return the unique ID for this data source.
      static java.util.List toList​(JSONArray array)  
      static java.util.Map toMap​(JSONObject object)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StaticReportDataSource

        public StaticReportDataSource()
    • Method Detail

      • gatherData

        public void gatherData​(ReportExecutionContext context,
                               java.io.Serializable aConfigObject,
                               java.util.Map<java.lang.String,​java.lang.Object> extraConfigs)
                        throws java.lang.Exception
        Description copied from interface: ReportDataSource
        Called when a report is being executed to gather the data represented by this data source. This method is high re-entrant. A given data source instance will be used for concurrently executing reports. This method must inject the data it gathers into the data map.
        Specified by:
        gatherData in interface ReportDataSource
        Parameters:
        context - This context holds the data map for the report, as well as other information about the report, its project, logging context, status feedback, etc.
        aConfigObject - The object that was saved for this data source in the designer.
        extraConfigs - Any extra info datasources might need when running. Will be null if not sample data. It's up to the datasource to decide what object(s) from this map it wants. Key is the datasource id.
        Throws:
        java.lang.Exception
      • getId

        public java.lang.String getId()
        Description copied from interface: ReportDataSource
        Return the unique ID for this data source. Should be qualified, such as com.example.data-source-type. Must match the ID returned by your DataSourceConfigFactory in the designer scope.
        Specified by:
        getId in interface ReportDataSource