Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Orion/Documentation/Developer Guide/Long running operations in services and plugins"
< Orion | Documentation | Developer Guide
Line 1: | Line 1: | ||
=Long running operations in services and plugins= | =Long running operations in services and plugins= | ||
− | Methods in Orion plugins may run asychronusly returning a promise (see [http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client.core/web/orion/Deferred.js orion/Deferred.js]). The result of the method should be returned by calling '''deferred.resolve''' or '''deferred.reject''' methods. If you wish to report progress you should use '''deferred.progress''' method. | + | Methods in Orion plugins may run asychronusly returning a promise (see [http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client.core/web/orion/Deferred.js orion/Deferred.js]). The result of the method should be returned by calling '''deferred.resolve''' or '''deferred.reject''' methods. If you wish to report progress you should use '''deferred.progress''' method. Progress information will be reported on UI if argument passed to '''progress''' method describes an '''operations''', with API as fallows: |
− | '' | + | ==Operation API== |
+ | ;type | ||
+ | :<tt>String</tt> one of: loadstart, progress, error, abort, load, loadend | ||
+ | ;timestamp | ||
+ | :<tt>Long</tt> the time when the operation war run | ||
+ | ;lengthComputable | ||
+ | :<tt>Boolean</tt> true if the progress is deterministic | ||
+ | ;loaded | ||
+ | :<tt>Integer</tt> ''Optional'' applicable if lengthComputable is true, number of items loaded/process | ||
+ | ;total | ||
+ | :<tt>Integer</tt> ''Optional'' applicable if lengthComputable is true, total number of items to load/process | ||
+ | ;location | ||
+ | :<tt>URL</tt> ''Optional'' the location of task where we can find more details and perform operations like update.<br>'''Important!''' this attribute should not be present if this operation status is only important when current page is opened. If operation should be tracked also outside of the current page, for instance in All Operations page plugin provider is required to provide '''Operation Service'''. | ||
+ | ;expires | ||
+ | :<tt>Long</tt> timestamp to which the operation will be available under given location | ||
+ | |||
+ | ==Operation API== |
Revision as of 06:23, 17 January 2013
Long running operations in services and plugins
Methods in Orion plugins may run asychronusly returning a promise (see orion/Deferred.js). The result of the method should be returned by calling deferred.resolve or deferred.reject methods. If you wish to report progress you should use deferred.progress method. Progress information will be reported on UI if argument passed to progress method describes an operations, with API as fallows:
Operation API
- type
- String one of: loadstart, progress, error, abort, load, loadend
- timestamp
- Long the time when the operation war run
- lengthComputable
- Boolean true if the progress is deterministic
- loaded
- Integer Optional applicable if lengthComputable is true, number of items loaded/process
- total
- Integer Optional applicable if lengthComputable is true, total number of items to load/process
- location
- URL Optional the location of task where we can find more details and perform operations like update.
Important! this attribute should not be present if this operation status is only important when current page is opened. If operation should be tracked also outside of the current page, for instance in All Operations page plugin provider is required to provide Operation Service. - expires
- Long timestamp to which the operation will be available under given location