Univention Bugzilla – Bug 31554
UMC-Server: Generic progress mechanism for UMC commands
Last modified: 2023-06-14 13:11:14 CEST
Currently progress bars are implemented in a module specific fashion. It would be nice to have a generic mechanism that allows to automatically offer (on the server side) progress information for any UMC command. A possible sketch: (1) UMC command mymodule/foo ist started (2) UMC python module Instead of self.finish(), self.progress(request.id, ...) updates internal information that the request is being processed. With each call to self.progress(), the internal information is updated. The module process needs to wait with a forced shutdown (after it timeout) until the last request has been finished. (3) UMC JS module The JS frontend receives information that the request is being processed (e.g., via a special HTTP status). Subsequent calls to umcp/progress/<moduleID>/<requestID> return the current progress information. This behaviour could be wrapped in a ProgressBar widget which accepts as parameter the initial UCMP command. Dojo Deferreds have the possibility for a progress callback, this feature could be used on the JS side.
Within Bug #25465 a base for this has been implemented in univention.management.console.modules.mixins.ProgressMixin.
Since UCS 4.2 it is possible to use HTTP header in UMC modules. HTTP defines the status code "202 Accepted" and the belonging header "Location" which could be used to tell where progress about a resource can be fetched. We should use this for a unified progress procedure. It eases UMC module development and fixes also the various robustness problems we have with progress bars. As extra feature we can even instruct via the response how often the progress bar should fetch the content (Bug #44319).