Liquit.Applications.List
  • 12 Dec 2023
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Liquit.Applications.List

  • Dark
    Light
  • PDF

Article Summary

The Liquit.Applications.List function returns all applications that are available to the user. Whenever an application has been made available in the Liquit Workspace it will be listed in the response of this function. The Liquit Workspace API autodetects whether or not the Agent is available and adjusts its response according to it. For example, a local application will not be enabled when the Agent is not running.

Request parameters

NameDescriptionValue
sortDetermines the order in which the API returns the applications:
  • 0 User-defined ordering, as determined by their position
  • 1 Name ascending
  • 2 Name descending
  • 3 By launch count (available for Liquit Workspace 3.4 and later )
  • 4 By last launch (available for Liquit Workspace 3.4 and later )
<int>
refreshDefines if the action is a refresh.```
searchAllows you to search by name<string>
tagsIf its value is true, tags will be included<boolean>
teamsIf its value is true, teams will be included<boolean>
eventDefine the type of event:
  • None no action is executed.
  • Refresh triggers actions defined in refresh events.
  • LiquitLogon triggers the actions that would be executed at Liquit Workspace logon.
<string>

Return parameters

The following properties are returned:

NameDescriptionValue
autoLaunchWhether or not auto launch is enabled for the application<boolean>
categoriesReturns an array of categories in which the application is included<array[]>
editableDetermines whether or not the end-user is privileged to edit the package<boolean>
enabledDetermines whether or not the application is enabled (e.g. local applications will not be enabled when no Agent is running.)<boolean>
favoriteWill return true if the end-user added this application to their favorites<boolean>
iconReturns the URL of the application icon<URL>
idThe id of the application<guid>
nameThe friendly name of the application<string>
newWill return true if the end-user has never started this application<boolean>
positionThe position of the application<int>
ratingThis will return the average rating of the app calculated based on the rating given by all users<int>
removableWhether or not the end-user is allowed to remove the application from their workspace (e.g. forced applications will return false)<boolean>
repairWhether or not the repair action is available for the application<boolean>
sourceReturns an object with information about the applications:
  • id the ID of the source which can be either the ID of the zone or of a team
  • type the source type, which can be either “Zone” or “Team”
<object{}>
stageThe published stage:
  • Development
  • Test
  • Acceptance
  • Production
<string>
statusReturns the state of the application.<string>

Example

Below you will find a small example of code to render the applications and their respective icons.

// Do Liquit API calls...
Liquit.Applications.List({

  sort:0

},function (fault, result) {

  // Check if the request failed.
  if (fault != null) {
    alert('Error ' + fault.code + ': ' + fault.message);
    return;
  }

  for (var i = 0; i < result.length; i++) {
    
    $('body').append(
      $('<div>')
        .attr({
          id: result[i].id
        })
        .addClass('app')
        .toggleClass('disabled', !result[i].enabled)
        .on('click', function (e) {

          // Get target html element.
          var target = $(e.currentTarget);

          // Verify application is disabled
          if (target.hasClass('disabled')) {
            alert('Application is disabled');
            return;
          }

          // Launch application by ID with callback returning progress information.
          Liquit.Applications.Launch(target.attr('id'), null, function (e) {

            console.log(e);

            // *** e.state ***
            // Can be one of the following values:
            //
            // * 'success': The application has been successfully launched.
            // * 'inprogress': The application is being installed. Check the progress property to see how far along the installation is.
            // * 'failure': The application has failed to start. See the details property for more information about the error.
            //
            // *** e.progress ***
            // Gives an estimated percentage of the installation progress.
            //
            // *** e.details ***
            // Gives additional information about the failure to launch the application.
            // This is structured with a 'code' field and a 'message' field describing the error.
            //

            // Application started
            if (e.state == 'success')
              alert('application started');

            // Failed to start application.
            else if (e.state == 'failure')
              alert('application failed to start: ' + e.details.code + ': ' + e.details.message);

          });

        })
        .append(
          $('<img>')
            .addClass('icon')
            .attr({
              src: result[i].icon
            })
            .toggle(result[i].icon != null),
          $('<span>')
            .addClass('title')
            .text(result[i].name)
        )
    );

  }

});

Was this article helpful?