Class ecm.model.AsyncTask
Extends
ecm.model._ModelObject.
Represents an asynchronous task from ECM TaskManager. An asynchronous task is any type of long running
process that once started will report its completion at a later time without needing the user to wait for
it to finish. This is intended for any actions that may tie up a graphical user interface for an extended
period of time. Once an asynchronous task is started, users can view that it's running and can come back
at a later time to view its completion or whether it has failed.
For an asynchronous task, it will also have an ecm.model.AsyncTaskType which represents a type of the current task. An AsyncTask can also be recurring and if it does, it will have multiple ecm.model.AsyncTaskInstace which represents each run as it repeats.
This model object shouldn't be created by hand. It is created from calling functions inside ecm.model.TaskManager to be placed inside of a ecm.widget.listView.ContentList.
Defined in: <ecm\model\AsyncTask.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Field Summary
Field Attributes | Field Name and Description |
---|---|
The set of attributes for this task
|
|
A result set of ecm.model.AsyncTaskAudit items associated with this task.
|
|
The errors associated with the task if they exist.
|
|
A boolean that indicates whether this task is a recurring task.
|
|
The mode for this task.
|
|
The parent of the task
|
|
The instances for recurring tasks.
|
|
The results for this task when the task completes.
|
|
The result set that the task came from if applicable
|
|
All the request information used to schedule this task
|
- Fields borrowed from class ecm.model._ModelObject:
- categorization, id, name, nameFilter, pane, status, type, userId
Method Summary
Method Attributes | Method Name and Description |
---|---|
Deletes all error records associated with this async task if they exist.
|
|
deleteTask(callback)
Deletes the task permanently from the ECM TaskManager.
|
|
Returns the ecm.model.AsyncTaskType object associated with this task.
|
|
getAttributeType(attribute)
Returns the type of the attribute.
|
|
getDetails(onComplete, forcedRefresh, skipOnChange)
Obtains the details for this task.
|
|
getDisplayValue(attribute)
Returns the attribute value in a format that can be displayed in the user interface.
|
|
getPath()
If this task was obtained in a result set that contained a parent category, it will return an array of the
path to this task.
|
|
getResults(callback)
Returns the results associated with this task if they exist.
|
|
getUserInfo(propertyName)
Returns the user information for this task.
|
|
hasPrivilege(privilege)
Returns true if this item has the specified privilege.
|
|
Returns whether this task is a recurring task.
|
|
onChange(modelObject)
The onChange event that is invoked when a change occurs on this task.
|
|
pause(callback)
Pauses the current task.
|
|
refresh()
Refreshes the current task by fetching all of its details again.
|
|
<static> |
ecm.model.AsyncTask.registerFactory(factory)
Static function that registers a factory for sub-classes of
AsyncTask . |
reschedule(callback, taskRequest)
Reschedules the task with the new task request information.
|
|
resume(callback)
Resumes the current task.
|
|
retrieveAsyncTaskInstances(callback, forcedRefresh)
Retrieves all async task instances for this task.
|
|
retrieveAudits(filterParameters, callback, forcedRefresh)
Retrieves a result set of ecm.model.AsyncTaskAudit items associated with this task.
|
|
update(item)
Updates an item with the provided new item's properties and attributes
|
- Methods borrowed from class ecm.model._ModelObject:
- destroy, getSortCriteria, own, toString
Field Detail
attributes
audits
- Since:
- 2.0.3
errors
isRecurring
- Since:
- 2.0.3
mode
- "0" - Single. This means the task will only run once.
- "1" - FixedIntervalSchedule. This means the task will reoccur on a fixed interval.
- "4" - CalendarSchedule. This means the task will reoccur based on a calendar schedule.
- Since:
- 2.0.3
parent
recurringTaskInstances
results
resultSet
taskRequest
Method Detail
deleteErrors()
- Since:
- 2.0.3
deleteTask(callback)
- Parameters:
- callback
- The callback function that will be invoked when delete completes.
getAsyncTaskType()
- Since:
- 2.0.3
{string} getAttributeType(attribute)
- Parameters:
- attribute
- The attribute name
- Returns:
- {string} The type of the attribute
getDetails(onComplete, forcedRefresh, skipOnChange)
- Parameters:
- onComplete
- A callback when the details for this task has been retrieved.
- forcedRefresh
- A boolean that indicates whether to force a refresh and always grab go back to the server to obtain the details
- skipOnChange
- A boolean that indicates whether to skip on throwing the onChange event.
getDisplayValue(attribute)
- Parameters:
- attribute
- The name of the attribute.
getPath()
getResults(callback)
- Parameters:
- callback
- The callback function that will be invoked once results are obtained.
getUserInfo(propertyName)
- Parameters:
- propertyName
- Since:
- 2.0.3
hasPrivilege(privilege)
- Parameters:
- privilege
- The name of the privilege.
isTaskRecurring()
onChange(modelObject)
- Parameters:
- modelObject
pause(callback)
- Parameters:
- callback
- The callback function to be invoked when pause completes.
refresh()
<static> ecm.model.AsyncTask.registerFactory(factory)
AsyncTask
.
- Parameters:
- factory
- A factory object with
createFromJSON()
method to possibly create a sub-class ofAsyncTask
from JSON. The factory method should return null when the given JSON is not one for known sub-classes, giving chances for other factories to create one or falling back to the defaultAsyncTask
construction.
reschedule(callback, taskRequest)
taskRequest
attribute associated with this task and reschedule with this new information. The name of the task and the
schedule information can not be changed in a reschedule.
- Parameters:
- callback
- The callback function that will be invoked when rescheduling completes.
- taskRequest
- The new task request information that will be passed into the task when rescheduling.
resume(callback)
- Parameters:
- callback
- The callback function to be invoked when resume completes.
- Since:
- 2.0.3
retrieveAsyncTaskInstances(callback, forcedRefresh)
- Parameters:
- callback
- a callback when all the async task instances have been retrieved.
- forcedRefresh
- refresh and go to the server to obtain all the async task instances again.
retrieveAudits(filterParameters, callback, forcedRefresh)
Users can filter the amount of audits return with the following filter parameters:
- originator - Return only audits created by this user.
- eventType - Return only audits that are of this particular event type.
- eventAction - Return only audits that are of this particular event action.
- status - Return only audits that of this status
- startDate (Timestamp in milliseconds) - Return only audits created after this start date.
- endDate (Timestamp in milliseconds) - Return only audits created before this end date.
- Parameters:
- filterParameters
- Parameters that can filter the amount of audits returned.
- callback
- The callback function that will be called when the result set of audits have returned.
- forcedRefresh
- Boolean to force a refresh and not to return with the cached set of audits.
- Since:
- 2.0.3
update(item)
- Parameters:
- item