|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.task.Executor
com.waveset.report.BaseReportTask
Field Summary | |
protected java.util.Map |
_conditions
list of attribute conditions used by a report when requesting objects |
protected TaskContext |
_ctx
Context of the report task |
protected boolean |
_emailReport
flag to indicate if this report should be emailed after generated |
boolean |
_reportsProgress
Flag to indicate if progress updates should be written. |
protected boolean |
_storesResults
|
protected Subject |
_subject
Subject who is running the task, used for Locale, where necessary |
protected TaskInstance |
_task
TaskInstance for this report task |
int |
_updateInterval
How often to write progress to the repository. |
protected static java.lang.String |
COL_END
|
protected static java.lang.String |
COL_START
|
static int |
DEFAULT_MAX_ROW_SIZE
|
protected static java.lang.String |
ROW_END
|
protected static java.lang.String |
ROW_START
|
static java.lang.String |
VAR_DATE_RANGE
|
static java.lang.String |
VAR_DESCRIPTION
|
static java.lang.String |
VAR_EMAIL_ADDRESSES
|
static java.lang.String |
VAR_EMAIL_TEMPLATE
|
static java.lang.String |
VAR_END_DATE
|
static java.lang.String |
VAR_EXCLUDE_ALL
|
static java.lang.String |
VAR_ORG_SCOPE
|
static java.lang.String |
VAR_SEND_EMAIL
|
static java.lang.String |
VAR_START_DATE
|
static java.lang.String |
VAR_TIMELINE
|
static java.lang.String |
VAR_TITLE
|
static java.lang.String |
XML_HEADER
|
Fields inherited from class com.waveset.task.Executor |
_monitor, _suspendRequested, _terminateRequested, trace |
Constructor Summary | |
BaseReportTask()
|
Method Summary | |
void |
addCondition(AttributeCondition cond)
Add an attribute condition to this reports conditions. |
void |
addCondition(java.lang.Object attr,
java.lang.Object attrValue,
AttributeCondition.Operator op)
Build an attribute condition to this reports conditions. |
void |
addCondition(java.lang.Object attr,
java.lang.Object attrValue,
AttributeCondition.Operator op,
boolean useId)
|
void |
addKeyedCondition(Attribute attr,
java.lang.Object val)
Add in a keyed attribute condition, this if for things like objectType, action and status for audit reports. |
protected java.lang.String |
buildRow(java.lang.Object attrName,
java.lang.Object value)
|
void |
checkForTermination()
|
abstract WavesetResult |
createReports()
Abstract method createReports, which is the method that will generate the Report object(s) and place them in a waveset result. |
static void |
emailReport(RepositoryResult extendedResults,
TaskInstance task,
LighthouseContext ctx,
java.lang.String templateName,
java.util.Locale locale)
Email a result that contains one or more report objects. |
void |
execute(TaskContext ctx,
TaskInstance task)
Execute the task. |
protected java.lang.String |
formatEventDateTimeForQuery(java.util.Date date)
|
java.util.List |
getAttributeConditionsList()
Get an array of AttributeConditions for use when calling session/repo. |
protected java.lang.String |
getDbKey(Attribute attr,
java.lang.String value)
For things that use ObjectType, Action and Status as a db key convert the mask to the corresponding DB key for the query. |
Message |
getDescription()
Get the report description. |
java.util.Date |
getEndDate()
|
protected java.util.Locale |
getLocale()
Returns the current locale setting. |
protected static java.util.Locale |
getLocale(Subject subject)
Returns the locale based on the subject. |
static boolean |
getPdfFontIsEmbedded(TaskInstance task)
Return whether or not to embed the font in PDF documents. |
static java.lang.String |
getPdfFontName(TaskInstance task)
Return the font name to use in the PDF document. |
java.util.Date |
getStartDate()
|
protected boolean |
getStoresExtendedResults()
|
Message |
getTitle()
Get the report title. |
protected RepositoryResult |
listExtendedResults(TaskContext ctx,
TaskInstance task)
Returns the extended report for use in email results. |
protected java.lang.String |
mapActionDbKeyToMessageKey(java.lang.String dbKey)
|
protected java.lang.String |
mapObjectTypeDbKeyToMessageKey(java.lang.String dbKey)
|
protected java.lang.String |
mapStatusDbKeyToMessageKey(java.lang.String dbKey)
|
protected void |
parseAttributeConditions()
Allow a report form to specify queries with the following format: queryAttr.attr.enabled ( ui controlled checkbox ) queryAttr.attr.value ( can be list, String ) queryAttr.attr.condition ( EQUALS, STARTS WITH, ENDS WITH, CONTAINS, etc queryAttr.attr.useId(value needs to be resovled to an id before query) Where attr is the string name of a com.waveset.object.Type i.e The following example would add an Attribute condition which described querying a given object for specified value. |
protected void |
processCommonArguments()
Process those arguments that are common among all the reporting tasks. |
void |
removeCondition(java.lang.String name)
Generic remove condition by name function. |
AttributeCondition.Operator |
resolveOperator(java.lang.String operator)
|
void |
setDescription(Message description)
Set the report description. |
void |
setEndDateCondition(java.util.Date date)
|
protected void |
setReportsProgress(boolean reportsProgress)
|
void |
setStartDateCondition(java.util.Date date)
|
protected void |
setStoresExtendedResults(boolean does)
|
void |
setTitle(Message title)
Set the report title. |
protected void |
setUpdateInterval(int interval)
|
protected static java.util.Date |
translateInterval(java.lang.String intervalString)
|
void |
updateProgress(Message progress)
Update the progress string on the task instance. |
protected void |
updateProgress(Message progress,
boolean force)
Update the progress string on the task instance. |
protected static void |
validateDates(java.util.Date startDate,
java.util.Date endDate)
|
Methods inherited from class com.waveset.task.Executor |
addExtendedResult, delete, doRealWork, getExtendedResult, getPool, isSuspendRequested, isTerminateRequested, println, processEvent, setPool, setSuspendRequested, setTerminateRequested |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String XML_HEADER
public static final java.lang.String VAR_EXCLUDE_ALL
public static final java.lang.String VAR_TITLE
public static final java.lang.String VAR_DESCRIPTION
public static final java.lang.String VAR_ORG_SCOPE
public static final java.lang.String VAR_DATE_RANGE
public static final java.lang.String VAR_START_DATE
public static final java.lang.String VAR_END_DATE
public static final java.lang.String VAR_TIMELINE
public static final java.lang.String VAR_SEND_EMAIL
public static final java.lang.String VAR_EMAIL_ADDRESSES
public static final java.lang.String VAR_EMAIL_TEMPLATE
public static final int DEFAULT_MAX_ROW_SIZE
protected boolean _storesResults
protected static final java.lang.String COL_START
protected static final java.lang.String COL_END
protected static final java.lang.String ROW_START
protected static final java.lang.String ROW_END
protected java.util.Map _conditions
protected TaskContext _ctx
protected boolean _emailReport
protected TaskInstance _task
protected Subject _subject
public boolean _reportsProgress
public int _updateInterval
Constructor Detail |
public BaseReportTask()
Method Detail |
public void execute(TaskContext ctx, TaskInstance task)
Executor
doRealWork()
.
execute
in class Executor
Executor.doRealWork(TaskContext, TaskInstance)
protected RepositoryResult listExtendedResults(TaskContext ctx, TaskInstance task)
protected void processCommonArguments() throws WavesetException
WavesetException
public abstract WavesetResult createReports() throws WavesetException
WavesetException
public void updateProgress(Message progress)
protected void updateProgress(Message progress, boolean force)
protected java.util.Locale getLocale()
protected static java.util.Locale getLocale(Subject subject)
protected boolean getStoresExtendedResults()
public Message getDescription()
public Message getTitle() throws WavesetException
WavesetException
public void setTitle(Message title)
protected void setStoresExtendedResults(boolean does)
public void setDescription(Message description)
public java.util.Date getStartDate()
public java.util.Date getEndDate()
public java.util.List getAttributeConditionsList() throws WavesetException
WavesetException
protected void parseAttributeConditions() throws WavesetException
WavesetException
public AttributeCondition.Operator resolveOperator(java.lang.String operator)
public void setStartDateCondition(java.util.Date date) throws WavesetException
WavesetException
public void setEndDateCondition(java.util.Date date) throws WavesetException
WavesetException
public void addKeyedCondition(Attribute attr, java.lang.Object val)
public void addCondition(java.lang.Object attr, java.lang.Object attrValue, AttributeCondition.Operator op) throws WavesetException
WavesetException
public void addCondition(java.lang.Object attr, java.lang.Object attrValue, AttributeCondition.Operator op, boolean useId) throws WavesetException
WavesetException
public void addCondition(AttributeCondition cond)
public void removeCondition(java.lang.String name)
protected static java.util.Date translateInterval(java.lang.String intervalString)
public void checkForTermination() throws ReportTerminated
ReportTerminated
public static void emailReport(RepositoryResult extendedResults, TaskInstance task, LighthouseContext ctx, java.lang.String templateName, java.util.Locale locale)
public static java.lang.String getPdfFontName(TaskInstance task)
public static boolean getPdfFontIsEmbedded(TaskInstance task)
protected java.lang.String getDbKey(Attribute attr, java.lang.String value)
protected java.lang.String mapStatusDbKeyToMessageKey(java.lang.String dbKey)
protected java.lang.String mapObjectTypeDbKeyToMessageKey(java.lang.String dbKey)
protected java.lang.String mapActionDbKeyToMessageKey(java.lang.String dbKey)
protected void setUpdateInterval(int interval)
protected void setReportsProgress(boolean reportsProgress)
protected static void validateDates(java.util.Date startDate, java.util.Date endDate) throws WavesetException
WavesetException
protected java.lang.String formatEventDateTimeForQuery(java.util.Date date) throws WavesetException
WavesetException
protected java.lang.String buildRow(java.lang.Object attrName, java.lang.Object value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |