org.eclipse.birt.report.engine.api
Interface IEngineTask

All Known Subinterfaces:
IDataExtractionTask, IGetParameterDefinitionTask, IRenderTask, IRunAndRenderTask, IRunTask

public interface IEngineTask

defines common features for an engine task. A task captures a set of operations that engine performs to get a unit of work done.


Field Summary
static int STATUS_CANCELLED
          the task is finished by cancled
static int STATUS_FAILED
          the task is finished with errors
static int STATUS_NOT_STARTED
          the task is not running yet
static int STATUS_RUNNING
          the task is running
static int STATUS_SUCCEEDED
          the task is finished with sucessful
 
Method Summary
 void addScriptableJavaObject(java.lang.String jsName, java.lang.Object obj)
          defines an additional Java object that is exposed to BIRT scripting at a per-task level
 void cancel()
          set the cancel flag if the task is running.
 void cancel(java.lang.Object signal)
          cancels the task with a signal.
 void close()
          close the task, relese any resources.
 java.util.Map getAppContext()
          returns the context objects for the task
 boolean getCancelFlag()
          return a flag if the user called cancel.
 IReportEngine getEngine()
          returns the report engine object
 java.util.List getErrors()
          Gets all errors.
 int getID()
          returns an identifier for the task.
 java.util.Locale getLocale()
          returns the locale for running the task
 java.lang.String getParameterDisplayText(java.lang.String name)
          Gets parameter display text by parameter name.
 java.lang.Object getParameterValue(java.lang.String name)
          returns the value of a parameter.
 java.util.HashMap getParameterValues()
          returns the parameter name/value collection
 IReportRunnable getReportRunnable()
          returns the runnable report design object
 int getStatus()
          get the status of task
 com.ibm.icu.util.ULocale getULocale()
          returns the locale for running the task
 void setAppContext(java.util.Map context)
          sets the task context
 void setDataSource(org.eclipse.birt.core.archive.IDocArchiveReader dataSource)
          set the data source used by the engine task.
 void setLocale(java.util.Locale locale)
          sets the task locale
 void setLocale(com.ibm.icu.util.ULocale locale)
          sets the task locale
 void setParameter(java.lang.String name, java.lang.Object value, java.lang.String displayText)
          Sets parameter value and display text.
 void setParameterDisplayText(java.lang.String name, java.lang.String displayText)
          Sets display text of a parameter with specified name.
 void setParameterValue(java.lang.String name, java.lang.Object value)
          sets one parameter value
 void setParameterValues(java.util.Map params)
          set all parameter valuess
 boolean validateParameters()
           
 

Field Detail

STATUS_NOT_STARTED

public static final int STATUS_NOT_STARTED
the task is not running yet

See Also:
Constant Field Values

STATUS_RUNNING

public static final int STATUS_RUNNING
the task is running

See Also:
Constant Field Values

STATUS_SUCCEEDED

public static final int STATUS_SUCCEEDED
the task is finished with sucessful

See Also:
Constant Field Values

STATUS_FAILED

public static final int STATUS_FAILED
the task is finished with errors

See Also:
Constant Field Values

STATUS_CANCELLED

public static final int STATUS_CANCELLED
the task is finished by cancled

See Also:
Constant Field Values
Method Detail

setLocale

public void setLocale(java.util.Locale locale)
sets the task locale

Parameters:
locale - the task locale

setLocale

public void setLocale(com.ibm.icu.util.ULocale locale)
sets the task locale

Parameters:
locale - the task locale

setAppContext

public void setAppContext(java.util.Map context)
sets the task context

Parameters:
context - - task contexts in a map. The map contains name-value pairs

getLocale

public java.util.Locale getLocale()
returns the locale for running the task

Returns:
the locale for running the task

getULocale

public com.ibm.icu.util.ULocale getULocale()
returns the locale for running the task

Returns:
the locale for running the task

getAppContext

public java.util.Map getAppContext()
returns the context objects for the task

Returns:
the task contexts

getEngine

public IReportEngine getEngine()
returns the report engine object

Returns:
the engine object

addScriptableJavaObject

public void addScriptableJavaObject(java.lang.String jsName,
                                    java.lang.Object obj)
defines an additional Java object that is exposed to BIRT scripting at a per-task level

Parameters:
jsName - the name that the object is referenced in JavaScript
obj - the Java object that is wrapped and scripted

getID

public int getID()
returns an identifier for the task. The identifier can be used to identify the task, especially when writing logs in a multi-threaded environment.

Returns:
an identifier for the task.

getReportRunnable

public IReportRunnable getReportRunnable()
returns the runnable report design object

Returns:
the runnable report design object

setParameterValues

public void setParameterValues(java.util.Map params)
set all parameter valuess

Parameters:
params - a hash map with all parameters

setParameterValue

public void setParameterValue(java.lang.String name,
                              java.lang.Object value)
sets one parameter value

Parameters:
name - parameter name
value - parameter value

getParameterValues

public java.util.HashMap getParameterValues()
returns the parameter name/value collection

Returns:
the parameter names/values in a hash map

getParameterValue

public java.lang.Object getParameterValue(java.lang.String name)
returns the value of a parameter.

Returns:
the parameter value.

validateParameters

public boolean validateParameters()
Returns:
whether the parameter validation succeeds

setParameter

public void setParameter(java.lang.String name,
                         java.lang.Object value,
                         java.lang.String displayText)
Sets parameter value and display text.

Parameters:
name - parameter name.
value - value.
displayText - display text.

getParameterDisplayText

public java.lang.String getParameterDisplayText(java.lang.String name)
Gets parameter display text by parameter name.

Parameters:
name - parameter name.
Returns:
display text.

setParameterDisplayText

public void setParameterDisplayText(java.lang.String name,
                                    java.lang.String displayText)
Sets display text of a parameter with specified name.

Parameters:
name - name of the parameter.
displayText - display text to set.

cancel

public void cancel()
set the cancel flag if the task is running. the task can re-run if it is cancedl.


cancel

public void cancel(java.lang.Object signal)
cancels the task with a signal. you can't call this method in the same thread with runTask The signal will be notified when the task finishes the cancel.


getCancelFlag

public boolean getCancelFlag()
return a flag if the user called cancel.

Returns:
true the user has called cancel, false the user doesn't call cancel.

getStatus

public int getStatus()
get the status of task

Returns:
the status

close

public void close()
close the task, relese any resources.


setDataSource

public void setDataSource(org.eclipse.birt.core.archive.IDocArchiveReader dataSource)
set the data source used by the engine task. The dataSource is opend and closed by this task.

Parameters:
dataSource - data source archive.

getErrors

public java.util.List getErrors()
Gets all errors.

Returns:
the errors list.


Copyright © 2005 Actuate Corp. All rights reserved.