T-Plan Robot Enterprise 3.5.2
Build No. 3.5.2-20140701.1

com.tplan.robot.scripting.report
Interface ReportProvider

All Superinterfaces:
Plugin
All Known Implementing Classes:
DefaultReportProvider, XSLReportProvider

public interface ReportProvider
extends Plugin

Exposed functional interface of report providers. A report provider is an object which typically registers to script (ScriptListener and command CommandEvent events and generates a report on the script execution. Report providers are instantiated through ReportProviderFactory, usually by a call of the Report command.


T-Plan Robot Enterprise, (C) 2009-2014 T-Plan Limited. All rights reserved.


Method Summary
 int create(ScriptingContext context, Map params)
          Create a report using the scripting context.
 String getCode()
          Get report provider code.
 String[] getSupportedFormats()
          Get formats supported by this particular provider.
 
Methods inherited from interface com.tplan.robot.plugin.Plugin
checkDependencies, getDate, getDescription, getDisplayName, getImplementedInterface, getLowestSupportedVersion, getMessageAfterInstall, getMessageBeforeInstall, getSupportContact, getUniqueId, getVendorHomePage, getVendorName, getVersion, requiresRestart
 

Method Detail

getCode

String getCode()
Get report provider code. It serves as identifier in the scripting language. For example, the default report provider implementation returns "default".

Specified by:
getCode in interface Plugin
Returns:
report provider code.

getSupportedFormats

String[] getSupportedFormats()

Get formats supported by this particular provider. The formats are not case sensitive and they must correspond to the supported file extensions. For example, a provider able to generate XML, HTML and Excel formats should return new String[] {"xml", "html", "htm", "xls"}.

The method is used by the calling Report instance to validate file name provided by the script command. If the file doesn't have one of the extensions supported by the selected provider, a syntax error is reported.

Returns:
array of supported formats (file extensions).

create

int create(ScriptingContext context,
           Map params)

Create a report using the scripting context. This method is called just once right after an instance of this provider is created through the Report command or it's associated Java test script method. It is up to the implementing class whether it prefers to generate one-time report and finish or register as ScriptListener and/or CommandListener and stay alive refreshing the report with updates until the script execution finishes.

The context provides access to all necessary objects associated with the script and execution.

Parameters:
context - scripting context of the currently executed script.
params - Report command parameters parsed from the command. They typically contain at least the output file name together with an optional description and scope. See the Report command specification for more information.
Returns:
exit code to be returned by the Report command - 0 means success, other value means failure.

T-Plan Robot Enterprise 3.5.2
Build No. 3.5.2-20140701.1