Module: Application

Application

Application service utilities for cross-component usage.

Author:
  • Marco Lehmann <marco.lehmann (at) kiwigrid.com>
Source:

Classes

ApplicationUtils

Methods

<inner> getAppAuthor(app, type) → {string}

Returns author from type or the first author in app.meta.author array.

Parameters:
Name Type Description
app object application instance
type string author type
Source:
Returns:
string app author name

<inner> getAppIcon(app, language) → {string}

Returns app icon source from app meta object by using link-element to easily access url params. If app has no icon informations it return null.

Parameters:
Name Type Description
app object application instance
language string current language
Source:
Returns:
string app icon src

<inner> getAppList(options) → {promise}

Returns an array with all apps that are not blacklisted and have an entryUri. It is also possible to get apps for a specific user by providing an appropriate filter with key userId.

Parameters:
Name Type Description
options object options to configure the API call
Source:
Returns:
promise app list promise
Example
angular.module('exampleApp', ['keta.utils.Application'])
    .controller('ExampleController', function(ketaApplicationUtils) {

        // get apps with default options
        // eventBusId: kiwibus
        // forceRefresh: false
        // filter: {} (no filter applied)
        ketaApplicationUtils.getAppList().then(function(apps) {
            // ...
        });

        // get apps with options in place
        ketaApplicationUtils.getAppList({
            eventBusId: 'myCustomEventBusId',
            forceRefresh: true,
            filter: {
                userId: 'john.doe'
            },
            excludeAppIds: {
                'kiwigrid.desktop': true
            }
        }).then(function(apps) {
            // ...
        });

    });

<inner> getAppName(app, uiLocale) → {string|null}

uiLocale is the current (user set) UI language of the running app. Can be either short ('de') or long ('en-US') format.

Parameters:
Name Type Description
app object application instance
uiLocale string current locale
Source:
Returns:
string | null application localized application name