Interface IReportContext
-
public interface IReportContextAn interface used to share information between the event methods in scripting. Gives access to report parameters and configuration values. Also provides a way for the report developer to register and retrieve custom properties.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPAGE_VAR_PAGE_LABEL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel()cancel the current engine taskvoidcancel(java.lang.String reason)cancel the current engine taskvoiddeleteGlobalVariable(java.lang.String name)Remove an object from runtime scope.voiddeletePersistentGlobalVariable(java.lang.String name)Remove an object from report document scope.java.lang.Objectevaluate(java.lang.String script)evaluate the script with default script language.java.lang.Objectevaluate(java.lang.String language, java.lang.String script)evaluate the script with specified script language.java.lang.Objectevaluate(org.eclipse.birt.report.engine.ir.Expression script)Evaluate the script.java.util.MapgetAppContext()Get the application contextjava.lang.ClassLoadergetApplicationClassLoader()get the application classLoader of the current report contextorg.eclipse.birt.report.model.api.ReportDesignHandlegetDesignHandle()get the report design handle.java.lang.ObjectgetGlobalVariable(java.lang.String name)Retireve an object from runtime scope.java.lang.ObjectgetHttpServletRequest()Get the http servlet request objectjava.util.LocalegetLocale()java.lang.StringgetMessage(java.lang.String key)Finds user-defined messages for the current thread's locale.java.lang.StringgetMessage(java.lang.String key, java.lang.Object[] params)Finds user-defined messages for the current thread's locale using parametersjava.lang.StringgetMessage(java.lang.String key, java.util.Locale locale)Finds user-defined messages for the given locale.java.lang.StringgetMessage(java.lang.String key, java.util.Locale locale, java.lang.Object[] params)Finds user-defined messages for the given locale using parametersjava.lang.StringgetOutputFormat()java.lang.ObjectgetPageVariable(java.lang.String name)java.lang.ObjectgetParameterDisplayText(java.lang.String name)java.lang.ObjectgetParameterValue(java.lang.String name)java.lang.ObjectgetPersistentGlobalVariable(java.lang.String name)Retireve an object from report document scope.org.eclipse.birt.report.engine.api.IRenderOptiongetRenderOption()get the render options used to render the report.org.eclipse.birt.report.engine.api.IReportRunnablegetReportRunnable()return the report runnable used to create/render this reportjava.net.URLgetResource(java.lang.String resourceName)get the URL for the resource.java.lang.StringgetResourceRenderURL(java.lang.String resourceName)get the render URL for a resource.intgetTaskType()Get the type of the current task.com.ibm.icu.util.TimeZonegetTimeZone()Get time zone informations.booleanisReportDocumentFinished()check if the report document generation is finished.voidsetGlobalVariable(java.lang.String name, java.lang.Object obj)Add the object to runtime scope.voidsetPageVariable(java.lang.String name, java.lang.Object value)voidsetParameterDisplayText(java.lang.String name, java.lang.String value)voidsetParameterValue(java.lang.String name, java.lang.Object value)voidsetPersistentGlobalVariable(java.lang.String name, java.io.Serializable obj)Add the object to report document scope.
-
-
-
Field Detail
-
PAGE_VAR_PAGE_LABEL
static final java.lang.String PAGE_VAR_PAGE_LABEL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getReportRunnable
org.eclipse.birt.report.engine.api.IReportRunnable getReportRunnable()
return the report runnable used to create/render this report- Returns:
-
getParameterValue
java.lang.Object getParameterValue(java.lang.String name)
- Parameters:
name-- Returns:
-
setParameterValue
void setParameterValue(java.lang.String name, java.lang.Object value)- Parameters:
name-value-
-
getParameterDisplayText
java.lang.Object getParameterDisplayText(java.lang.String name)
- Parameters:
name-- Returns:
-
setParameterDisplayText
void setParameterDisplayText(java.lang.String name, java.lang.String value)- Parameters:
name-value-
-
getLocale
java.util.Locale getLocale()
- Returns:
-
getTimeZone
com.ibm.icu.util.TimeZone getTimeZone()
Get time zone informations.- Returns:
-
getOutputFormat
java.lang.String getOutputFormat()
- Returns:
-
getRenderOption
org.eclipse.birt.report.engine.api.IRenderOption getRenderOption()
get the render options used to render the report.- Returns:
-
getAppContext
java.util.Map getAppContext()
Get the application context
-
getHttpServletRequest
java.lang.Object getHttpServletRequest()
Get the http servlet request object
-
setGlobalVariable
void setGlobalVariable(java.lang.String name, java.lang.Object obj)Add the object to runtime scope. This object can only be retrieved in the same phase, i.e. it is not persisted between generation and presentation.
-
deleteGlobalVariable
void deleteGlobalVariable(java.lang.String name)
Remove an object from runtime scope.
-
getGlobalVariable
java.lang.Object getGlobalVariable(java.lang.String name)
Retireve an object from runtime scope.
-
setPersistentGlobalVariable
void setPersistentGlobalVariable(java.lang.String name, java.io.Serializable obj)Add the object to report document scope. This object can be retrieved later. It is persisted between phases, i.e. between generation and presentation.
-
deletePersistentGlobalVariable
void deletePersistentGlobalVariable(java.lang.String name)
Remove an object from report document scope.
-
getPersistentGlobalVariable
java.lang.Object getPersistentGlobalVariable(java.lang.String name)
Retireve an object from report document scope.
-
getPageVariable
java.lang.Object getPageVariable(java.lang.String name)
-
setPageVariable
void setPageVariable(java.lang.String name, java.lang.Object value)
-
getMessage
java.lang.String getMessage(java.lang.String key)
Finds user-defined messages for the current thread's locale.- Parameters:
key- resource key of the user-defined message.- Returns:
- the corresponding locale-dependent messages. Return
nullif resoueceKey is blank.
-
getMessage
java.lang.String getMessage(java.lang.String key, java.util.Locale locale)Finds user-defined messages for the given locale.First we look up in the report itself, then look into the referenced message file. Each search uses a reduced form of Java locale-driven search algorithm: Language&Country, language, default.
- Parameters:
key- resource key of the user defined message.locale- locale of message, if the inputlocaleisnull, the locale for the current thread will be used instead.- Returns:
- the corresponding locale-dependent messages. Return
nullif resoueceKey is blank.
-
getMessage
java.lang.String getMessage(java.lang.String key, java.lang.Object[] params)Finds user-defined messages for the current thread's locale using parameters- Parameters:
key- resource key of the user-defined message.params- string arguments used to format error messages- Returns:
- the corresponding locale-dependent messages. Return
nullif resoueceKey is blank.
-
getMessage
java.lang.String getMessage(java.lang.String key, java.util.Locale locale, java.lang.Object[] params)Finds user-defined messages for the given locale using parametersFirst we look up in the report itself, then look into the referenced message file. Each search uses a reduced form of Java locale-driven search algorithm: Language&Country, language, default.
- Parameters:
key- resource key of the user defined message.locale- locale of message, if the inputlocaleisnull, the locale for the current thread will be used instead.params- string arguments used to format error messages- Returns:
- the corresponding locale-dependent messages. Return
nullif resoueceKey is blank.
-
getTaskType
int getTaskType()
Get the type of the current task.- Returns:
- task type including:
- 0 for GetParameterDefinition Task
- 1 for Run Task
- 2 for Render Task
- 3 for Run and Render Task
- 4 for DataExtraction Task
- -1 default value for unknown task
-
getDesignHandle
org.eclipse.birt.report.model.api.ReportDesignHandle getDesignHandle()
get the report design handle.- Returns:
- report design handle
-
getResource
java.net.URL getResource(java.lang.String resourceName)
get the URL for the resource. The url can only be used in the server side.- Parameters:
resourceName- resource name- Returns:
- resource URL
-
getResourceRenderURL
java.lang.String getResourceRenderURL(java.lang.String resourceName)
get the render URL for a resource.- Parameters:
resourceName- resource name- Returns:
- the URL which can be used in the client side.
-
evaluate
java.lang.Object evaluate(java.lang.String script) throws org.eclipse.birt.core.exception.BirtExceptionevaluate the script with default script language.- Parameters:
script-- Returns:
- Throws:
org.eclipse.birt.core.exception.BirtException
-
evaluate
java.lang.Object evaluate(java.lang.String language, java.lang.String script) throws org.eclipse.birt.core.exception.BirtExceptionevaluate the script with specified script language.- Parameters:
language-script-- Returns:
- Throws:
org.eclipse.birt.core.exception.BirtException
-
evaluate
java.lang.Object evaluate(org.eclipse.birt.report.engine.ir.Expression script) throws org.eclipse.birt.core.exception.BirtExceptionEvaluate the script.- Parameters:
script-- Returns:
- Throws:
org.eclipse.birt.core.exception.BirtException
-
getApplicationClassLoader
java.lang.ClassLoader getApplicationClassLoader()
get the application classLoader of the current report context- Returns:
- application classLoader
-
cancel
void cancel()
cancel the current engine task
-
cancel
void cancel(java.lang.String reason)
cancel the current engine task
-
isReportDocumentFinished
boolean isReportDocumentFinished()
check if the report document generation is finished. It should be used at render time. The default value is false- Returns:
-
-