lucee.Componentcommandbox.system.util.InteractiveJob
Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I help update the user's console with progress for a curently executing (foreground) job in a nice and tidy way.
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
boolean
|
active
|
true
|
false
|
|
boolean
|
dumpLog
|
true
|
false
|
|
array
|
jobs
|
true
|
false
|
|
any
|
print
|
true
|
false
|
|
any
|
printBuffer
|
true
|
false
|
|
any
|
shell
|
true
|
false
|
Constructor Summary | |
---|---|
init()
|
Method Summary | |
---|---|
any
|
addErrorLog(string line)
Convenience method to log a red message. |
any
|
addLog(string line, [string color=''])
Add a line of logging. |
any
|
addSuccessLog(string line)
Convenience method to log a green message. |
any
|
addWarnLog(string line)
Convenience method to log a yellow message. |
any
|
clear()
Clear from the screen, but don't reset. |
any
|
complete([boolean dumpLog='[runtime expression]'])
Mark job as completed. |
any
|
draw()
Render the information to the console. |
any
|
error([string message=''], [boolean dumpLog='[runtime expression]'])
Mark job as Failed. |
any
|
errorRemaining([any message=''])
Cancel all remaining jobs and mark with error. |
private any
|
finalizeOutput([boolean dumpLog])
Outputs final representation of job to console for good. |
string
|
getActive()
|
private struct
|
getCurrentJob()
Get struct that represents the currently executing job. |
private numeric
|
getCurrentJobDepth()
Get number that represents the depth of the currently executing job. |
string
|
getDumpLog()
|
private string
|
getJobTitle([any job])
Returns colored and formatted job title. |
string
|
getJobs()
|
array
|
getLines([any job], [any includeAllLogs='false'], [any finalOutput='false'])
Returns array of AttribtuedString objects that represent this job and its children's current state. |
string
|
getPrint()
|
string
|
getPrintBuffer()
|
string
|
getShell()
|
boolean
|
isActive()
Is there an active job?. |
private struct
|
newJob([any name], [any logSize])
Returns empty struct of default job details. |
any
|
onDIComplete()
|
any
|
reset()
Reset the internal state of this job. |
any
|
setActive(boolean active)
|
any
|
setDumpLog(boolean dumpLog)
|
any
|
setJobs(array jobs)
|
any
|
setPrint(any print)
|
any
|
setPrintBuffer(any printBuffer)
|
any
|
setShell(any shell)
|
any
|
start(string name, [any logSize='5'])
Kick off a job. |
private string
|
statusColor([any job])
Returns name of color for current job status. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- printserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- printBufferserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- shellserializable
- trueMethod Detail |
---|
Convenience method to log a red message
line
- Message to logAdd a line of logging. Feel free to use ANSI formatting
line
- Message to logcolor
Convenience method to log a green message
line
- Message to logConvenience method to log a yellow message
line
- Message to logClear from the screen, but don't reset
Mark job as completed. This will print out any final permanent lines and clear the state
dumpLog
- Dump out all internal log lines permenantly to the consoleRender the information to the console
Mark job as Failed. This will print out any final permanent lines and clear the state
message
dumpLog
- Dump out all internal log lines permenantly to the consoleCancel all remaining jobs and mark with error
message
- Error message to be applied to the current jobOutputs final representation of job to console for good Resets the internal state this CFC so all job data is gone and there is no active job.
dumpLog
- Include all log messages in output regardless of logSizeGet struct that represents the currently executing job.
Get number that represents the depth of the currently executing job.
Returns colored and formatted job title
job
- Job struct to useReturns array of AttribtuedString objects that represent this job and its children's current state
job
- Reference to a job struct so this method can be called recursivelyincludeAllLogs
- Ignore logSize and include all log linesfinalOutput
- True if getting final output at the completion of the job.Is there an active job?
Returns empty struct of default job details
name
- Name of joblogSize
- Size of the log to displayReset the internal state of this job
active
dumpLog
jobs
print
printBuffer
shell
Kick off a job. Clears any previous state and starts drawing
name
- Name of the joblogSize
Returns name of color for current job status
job
- Job struct to use