Verint | Telligent Community
Verint | Telligent Community
  • Site
  • User
  • Site
  • Search
  • User
Verint Community 12.x
  • Verint Community
Verint Community 12.x
API Documentation scheduledfile UI Component
  • User Documentation
  • Ask the Community
  • API Documentation
  • Manager Training
  • Developer Training
  • Tags
  • More
  • Cancel
  • New
  • API Documentation
  • +In-Process API Documentation
  • +Plugin API Documentation
  • +REST API Documentation
  • -Widget, Theme, and Automation APIs
    • +Automation Events
    • -Client-side APIs
      • +Client Messages
      • +Composer Plugins
      • +JavaScript API Modules
      • +jQuery Events
      • +jQuery Plugins
      • -UI Components
        • bookmark UI Component
        • code UI Component
        • collapseexpand UI Component
        • feature UI Component
        • html UI Component
        • Idea Voting UI Component
        • like UI Component
        • links UI Component
        • loading UI Component
        • masonry UI Component
        • moderate UI Component
        • page UI Component
        • poll UI Component
        • previewhtml UI Component
        • rate UI Component
        • resizedimage UI Component
        • scheduledfile UI Component
        • searchresult UI Component
        • select UI Component
        • squeezetext UI Component
        • tag UI Component
        • theater UI Component
        • tip UI Component
        • tourtip UI Component
        • viewhtml UI Component
        • webpreview UI Component
    • +Dynamic Configuration
    • +LESS Functions
    • +Script API Types
    • +Script APIs

scheduledfile UI Component


jQuery.telligent.evolution.ui.components.scheduledfile

UI Component which allows client-side declarative rendering of a scheduled script file execution's status. Transforms the output from core_v2_ui.ScheduledFile(), which is a <span class="ui-scheduledfile"></span> stub. The default implementation uses the evolutionProgressIndicator plugin. Overrides can be provided at the theme level to present file status differently.

Options

  • progresskey: Identifier matching the ProgressKey passed to core_v2_widget.ScheduleFile()
  • percentcomplete: Optional initial percent complete
  • includepercentcomplete: Includes a progress bar displaying completion percentage reported by the script with context_v2_scheduledFile.Report()
  • includelatestmessage: Includes only the latest message reported by the script with context_v2_scheduledFile.Report()
  • includeallmessages: Includes a log of all messages reported by the script with context_v2_scheduledFile.Report()

Example

A barebones UI component override which would result in rendering a read-only message of 'Indicator: [Key] [Percent]'.

$.telligent.evolution.ui.components.scheduledfile = {
    setup: function() {},
    add: function(elm, options) {
        $(elm).html('Indicator ' + options.progresskey + ' ' + options.percentcomplete);
    }
};

Default Implementation

For reference purposes or as the basis for an override:

(function($){

    // Handle scheduleFile API messages and calling updates on the progress indicator
    function handleMessages(context) {
        messaging.subscribe('scheduledFile.complete', getMessageNamespace(context), function(data) {
            if (data.progressKey !== context.progressKey)
                return;

            context.indicator.evolutionProgressIndicator('complete', data);
            dispose(context);
        });

        messaging.subscribe('scheduledFile.error', getMessageNamespace(context), function(data) {
            if (data.progressKey !== context.progressKey)
                return;

            context.indicator.evolutionProgressIndicator('error', data ? data.message : null);
            dispose(context);
        });

        messaging.subscribe('scheduledFile.progress', getMessageNamespace(context), function(data) {
            if (data.progressKey !== context.progressKey)
                return;

            context.indicator.evolutionProgressIndicator('progress', data);
        });
    }

    function dispose(context) {
        setTimeout(function() {
            messaging.unsubscribe(getMessageNamespace(context));
        }, 100);
    }

    function getMessageNamespace(context) {
        return 'messages-' + context.progressKey;
    }

    $.telligent.evolution.ui.components.scheduledfile = {
        setup: function () {

        },
        add: function (elm, options) {
            // Start monitoring the progress key to ensure ajax fallbacks are called
            // in case sockets disconnect so that scheduleFile messages are guaranteed to be raised
            $.telligent.evolution.scheduledFile.monitor(options.progresskey);

            // render an indicator
            var context = $.extend({}, {
                progressKey: options.progresskey,
                percentComplete: options.percentcomplete,
                log: JSON.parse(options.log),
                indicator: $(elm).evolutionProgressIndicator({
                    includePercentComplete: options.includepercentcomplete == 'true',
                    includeLatestMessage: options.includelatestmessage == 'true',
                    includeAllMessages: options.includeallmessages == 'true'
                })
            });

            // If any initial progress or log messages at render-time, render those as well

            if(context.percentComplete && context.percentComplete > 0) {
                context.indicator.evolutionProgressIndicator('progress', {
                    percentComplete: parseFloat(context.percentComplete)
                });
            }

            if(context.log) {
                for (var i = 0; i < context.log.length; i++) {
                    context.indicator.evolutionProgressIndicator('progress', {
                        message: context.log
                    });
                }
            }

            handleMessages(context);
        }
    };

}(jQuery));

  • Share
  • History
  • More
  • Cancel
Related
Recommended
  • Telligent
  • Professional Services
  • Submit a Support Ticket
  • Become a Partner
  • Request a Demo
  • Contact Us

About
Privacy Policy
Terms of use
Copyright 2024 Verint, Inc.
Powered by Verint Community