Class ReportingGatewayHook

java.lang.Object
com.inductiveautomation.ignition.gateway.model.AbstractGatewayModuleHook
com.inductiveautomation.reporting.gateway.ReportingGatewayHook
All Implemented Interfaces:
GatewayModuleHook

public class ReportingGatewayHook extends AbstractGatewayModuleHook
  • Constructor Details

    • ReportingGatewayHook

      public ReportingGatewayHook()
  • Method Details

    • get

      public static ReportingGatewayHook get(GatewayContext context)
      Grabs the Reporting Module's Gateway hook instance from the gateway context
    • get

      public static ReportingGatewayHook get()
      Statically retrieves the hook from within a wicket request cycle
    • setup

      public void setup(GatewayContext context)
      Description copied from interface: GatewayModuleHook
      Called to before startup. This is the chance for the module to add its extension points and update persistent records and schemas. None of the managers will be started up at this point, but the extension point managers will accept extension point types.
    • startup

      public void startup(LicenseState licenseState)
      Description copied from interface: GatewayModuleHook
      Called to initialize the module. Will only be called once. Persistence interface is available, but only in read-only mode.
    • shutdown

      public void shutdown()
      Description copied from interface: GatewayModuleHook
      Called to shutdown this module. Note that this instance will never be started back up - a new one will be created if a restart is desired
    • getContext

      public GatewayContext getContext()
    • getRegistry

      public GatewayDataSourceRegistry getRegistry()
    • isMakerEditionCompatible

      public boolean isMakerEditionCompatible()
      Returns:
      true if this module opts-in to participating in Ignition Maker Edition. Default is false. If you override this and return true, your module will become activated when running in a Maker Edition installation.
    • getRPCHandler

      public Object getRPCHandler(ClientReqSession session, String projectName)
      Description copied from interface: GatewayModuleHook
      A class whose functions will become exposed automatically through reflection to the Designer and the Client through RPC
      Specified by:
      getRPCHandler in interface GatewayModuleHook
      Overrides:
      getRPCHandler in class AbstractGatewayModuleHook
    • executeReport

      @Nullable public <T> T executeReport(String projectName, String reportPath, Map<String,Object> parameters, ReportProcessor<T> reportProcessor) throws Exception
      Execute a report. This involves reading and decoding the report resource from the project, fetching the data for the report, and having the reportmill engine turn the report template into an actualized report.
      Parameters:
      reportProcessor - Assuming report execution gets this far, this object will be given a chance to act upon the finished report. It can also convert the report into a different format and return it, which will then be the return value of this whole method.
      Returns:
      the return value of the reportProcessor, or null if the report was cancelled
      Throws:
      Exception - if anything goes wrong, like missing project, missing report, invalid report, data fetch issues, etc.
    • onMountedResourceRequest

      public void onMountedResourceRequest(String resourcePath, javax.servlet.http.HttpServletResponse response)
      Description copied from interface: GatewayModuleHook
      Called prior to a 'mounted resource request' being fulfilled by requests to the mounted resource servlet serving resources from /res/module-id/ (or /res/alias/ if GatewayModuleHook.getMountPathAlias() is implemented). It is called after the target resource has been successfully located.

      Primarily intended as an opportunity to amend/alter the response's headers for purposes such as establishing Cache-Control. By default, Ignition sets no additional headers on a resource request.

      Parameters:
      resourcePath - path to the resource being returned by the mounted resource request
      response - the response to read/amend.
    • executeReport

      @Nullable public <T> T executeReport(String projectName, String reportPath, Map<String,Object> parameters, ReportProcessor<T> reportProcessor, Consumer<ReportRenderContext> contextSetup) throws Exception
      Throws:
      Exception
    • getReportData

      public ReportExecutionData getReportData(String projectName, String reportPath, ReportDataConfiguration dataConfig, Map<String,Object> parameters, boolean sampleData, ReportExecutionContext execContext) throws Exception
      Throws:
      Exception
    • getReportData

      public ReportExecutionData getReportData(String projectName, String reportPath, ReportDataConfiguration dataConfig, Map<String,Object> parameters, Map<String,Object> extraConfigs, boolean sampleData, ReportExecutionContext execContext) throws Exception
      Throws:
      Exception
    • initializeScriptManager

      public void initializeScriptManager(ScriptManager manager)
      Description copied from interface: GatewayModuleHook
      Initialize a newly-instantiated script manager. This will be called exactly once for any given ScriptManager instance. Usually this will involve calling ScriptManager.addScriptModule(String, Object), which reflectively loads the public (instance and static) java functions from the given object into the scripting environment, at the provided path.

      This function may be called before GatewayModuleHook.startup(LicenseState), but never before GatewayModuleHook.setup(GatewayContext).

      Specified by:
      initializeScriptManager in interface GatewayModuleHook
      Overrides:
      initializeScriptManager in class AbstractGatewayModuleHook
    • getStatusManager

      public ReportStatusManager getStatusManager()
    • mountRouteHandlers

      public void mountRouteHandlers(RouteGroup routes)
      Description copied from interface: GatewayModuleHook
      Provides a chance for the module to mount any route handlers it wants. These will be active at /main/data/module-id/* See RouteGroup for details. Will be called after startup().
    • getMountPathAlias

      public Optional<String> getMountPathAlias()
      Description copied from interface: GatewayModuleHook
      Used by the mounting underneath /res/module-id/* and /main/data/module-id/* as an alternate mounting path instead of your module id, if present.
    • getMountedResourceFolder

      public Optional<String> getMountedResourceFolder()
      Returns:
      the path to a folder in one of the module's gateway jar files that should be mounted at /res/module-id/foldername
    • getStatusOverviewContributor

      public Optional<OverviewContributor> getStatusOverviewContributor()
      Description copied from interface: GatewayModuleHook
      Implement this method to contribute meta data to the Status section's Systems / Overview page.
    • getStatusPanels

      public List<? extends INamedTab> getStatusPanels()
      Description copied from interface: GatewayModuleHook
      A list (may be null or empty) of panels to display in the status section
      Specified by:
      getStatusPanels in interface GatewayModuleHook
      Overrides:
      getStatusPanels in class AbstractGatewayModuleHook
    • notifyLicenseStateChanged

      public void notifyLicenseStateChanged(LicenseState licenseState)
      Description copied from interface: GatewayModuleHook
      Notify module hook when the license state has changed. This could only contain changes for the module or it could contain a change to the platform license (version, restrictions such as expiration date, sqltag count...)
      Specified by:
      notifyLicenseStateChanged in interface GatewayModuleHook
      Overrides:
      notifyLicenseStateChanged in class AbstractGatewayModuleHook
    • getLicenseEdition

      public String getLicenseEdition()
    • getLimitedReportCount

      public int getLimitedReportCount()
    • getLicenseState

      public LicenseState getLicenseState()
    • isTrialMode

      public boolean isTrialMode()
    • isTrialExpired

      public boolean isTrialExpired()