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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classReportingGatewayHook.RPC
-
Constructor Summary
Constructors Constructor Description ReportingGatewayHook()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TexecuteReport(java.lang.String projectName, java.lang.String reportPath, java.util.Map<java.lang.String,java.lang.Object> parameters, ReportProcessor<T> reportProcessor)Execute a report.<T> TexecuteReport(java.lang.String projectName, java.lang.String reportPath, java.util.Map<java.lang.String,java.lang.Object> parameters, ReportProcessor<T> reportProcessor, java.util.function.Consumer<ReportRenderContext> contextSetup)static ReportingGatewayHookget()Statically retrieves the hook from within a wicket request cyclestatic ReportingGatewayHookget(GatewayContext context)Grabs the Reporting Module's Gateway hook instance from the gateway contextGatewayContextgetContext()java.lang.StringgetLicenseEdition()LicenseStategetLicenseState()intgetLimitedReportCount()java.util.Optional<java.lang.String>getMountedResourceFolder()java.util.Optional<java.lang.String>getMountPathAlias()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.GatewayDataSourceRegistrygetRegistry()ReportExecutionDatagetReportData(java.lang.String projectName, java.lang.String reportPath, ReportDataConfiguration dataConfig, java.util.Map<java.lang.String,java.lang.Object> parameters, boolean sampleData, ReportExecutionContext execContext)ReportExecutionDatagetReportData(java.lang.String projectName, java.lang.String reportPath, ReportDataConfiguration dataConfig, java.util.Map<java.lang.String,java.lang.Object> parameters, java.util.Map<java.lang.String,java.lang.Object> extraConfigs, boolean sampleData, ReportExecutionContext execContext)java.lang.ObjectgetRPCHandler(ClientReqSession session, java.lang.String projectName)A class whose functions will become exposed automatically through reflection to the Designer and the Client through RPCReportStatusManagergetStatusManager()java.util.Optional<OverviewContributor>getStatusOverviewContributor()Implement this method to contribute meta data to the Status section's Systems / Overview page.java.util.List<? extends INamedTab>getStatusPanels()A list (may be null or empty) of panels to display in the status sectionvoidinitializeScriptManager(ScriptManager manager)Initialize a newly-instantiated script manager.booleanisMakerEditionCompatible()booleanisTrialExpired()booleanisTrialMode()voidmountRouteHandlers(RouteGroup routes)Provides a chance for the module to mount any route handlers it wants.voidnotifyLicenseStateChanged(LicenseState licenseState)Notify module hook when the license state has changed.voidsetup(GatewayContext context)Called to before startup.voidshutdown()Called to shutdown this module.voidstartup(LicenseState licenseState)Called to initialize the module.-
Methods inherited from class com.inductiveautomation.ignition.gateway.model.AbstractGatewayModuleHook
configureDeserializer, configureFunctionFactory, configureSerializer, getHomepagePanels
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.gateway.model.GatewayModuleHook
getConfigCategories, getConfigOverviewContributor, getConfigPanels, initializeResourceTypeAdapterRegistry, isFreeModule, onMountedResourceRequest, updateSystemMap
-
-
-
-
Method Detail
-
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:GatewayModuleHookCalled 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:GatewayModuleHookCalled 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:GatewayModuleHookCalled 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:
trueif this module opts-in to participating in Ignition Maker Edition. Default isfalse. If you override this and return true, your module will become activated when running in a Maker Edition installation.
-
getRPCHandler
public java.lang.Object getRPCHandler(ClientReqSession session, java.lang.String projectName)
Description copied from interface:GatewayModuleHookA class whose functions will become exposed automatically through reflection to the Designer and the Client through RPC- Specified by:
getRPCHandlerin interfaceGatewayModuleHook- Overrides:
getRPCHandlerin classAbstractGatewayModuleHook
-
executeReport
@Nullable public <T> T executeReport(java.lang.String projectName, java.lang.String reportPath, java.util.Map<java.lang.String,java.lang.Object> parameters, ReportProcessor<T> reportProcessor) throws java.lang.ExceptionExecute 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:
java.lang.Exception- if anything goes wrong, like missing project, missing report, invalid report, data fetch issues, etc.
-
executeReport
@Nullable public <T> T executeReport(java.lang.String projectName, java.lang.String reportPath, java.util.Map<java.lang.String,java.lang.Object> parameters, ReportProcessor<T> reportProcessor, java.util.function.Consumer<ReportRenderContext> contextSetup) throws java.lang.Exception- Throws:
java.lang.Exception
-
getReportData
public ReportExecutionData getReportData(java.lang.String projectName, java.lang.String reportPath, ReportDataConfiguration dataConfig, java.util.Map<java.lang.String,java.lang.Object> parameters, boolean sampleData, ReportExecutionContext execContext) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getReportData
public ReportExecutionData getReportData(java.lang.String projectName, java.lang.String reportPath, ReportDataConfiguration dataConfig, java.util.Map<java.lang.String,java.lang.Object> parameters, java.util.Map<java.lang.String,java.lang.Object> extraConfigs, boolean sampleData, ReportExecutionContext execContext) throws java.lang.Exception
- Throws:
java.lang.Exception
-
initializeScriptManager
public void initializeScriptManager(ScriptManager manager)
Description copied from interface:GatewayModuleHookInitialize a newly-instantiated script manager. This will be called exactly once for any givenScriptManagerinstance. Usually this will involve callingScriptManager.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 beforeGatewayModuleHook.setup(GatewayContext).- Specified by:
initializeScriptManagerin interfaceGatewayModuleHook- Overrides:
initializeScriptManagerin classAbstractGatewayModuleHook
-
getStatusManager
public ReportStatusManager getStatusManager()
-
mountRouteHandlers
public void mountRouteHandlers(RouteGroup routes)
Description copied from interface:GatewayModuleHookProvides a chance for the module to mount any route handlers it wants. These will be active at /main/data/module-id/* SeeRouteGroupfor details. Will be called after startup().
-
getMountPathAlias
public java.util.Optional<java.lang.String> getMountPathAlias()
Description copied from interface:GatewayModuleHookUsed 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 java.util.Optional<java.lang.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 java.util.Optional<OverviewContributor> getStatusOverviewContributor()
Description copied from interface:GatewayModuleHookImplement this method to contribute meta data to the Status section's Systems / Overview page.
-
getStatusPanels
public java.util.List<? extends INamedTab> getStatusPanels()
Description copied from interface:GatewayModuleHookA list (may be null or empty) of panels to display in the status section- Specified by:
getStatusPanelsin interfaceGatewayModuleHook- Overrides:
getStatusPanelsin classAbstractGatewayModuleHook
-
notifyLicenseStateChanged
public void notifyLicenseStateChanged(LicenseState licenseState)
Description copied from interface:GatewayModuleHookNotify 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:
notifyLicenseStateChangedin interfaceGatewayModuleHook- Overrides:
notifyLicenseStateChangedin classAbstractGatewayModuleHook
-
getLicenseEdition
public java.lang.String getLicenseEdition()
-
getLimitedReportCount
public int getLimitedReportCount()
-
getLicenseState
public LicenseState getLicenseState()
-
isTrialMode
public boolean isTrialMode()
-
isTrialExpired
public boolean isTrialExpired()
-
-