Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

service

pentaho.service

The service namespace contains the types of the Pentaho Service Locator API.

Overview

The Pentaho Service Locator API is constituted by an AMD/RequireJS loader plugin, pentaho.service.ILocator, which allows JavaScript components to depend on logical services. Other modules may declare to "implement" these services through AMD/RequireJS configuration.

The main service locator service, and AMD/RequireJS loader plugin, is pentaho.service.locator.

Source: doc-js/pentaho/service/_namespace.jsdoc, line 17

Interfaces

Name Summary
ILocator

The interface of service locator AMD/RequireJS loader plugins.

Members

Name Description
locator : pentaho.service.ILocator

The main service locator service of the JavaScript Pentaho platform.

Members Details

locator: pentaho.service.ILocator

The main service locator service of the JavaScript Pentaho platform.

This service uses the Instance Info API to query for instances that provide a given service type.

Alternatively, the service can also be explicitly configured.

Configuration

To register a module that provides a service, you configure this module, pentaho/service. For example, the following AMD/RequireJS configuration registers two modules, mine/homeScreen and yours/proHomeScreen, as providing the logical service named IHomeScreen:

require.config({
  config: {
    "pentaho/service": {
      "mine/homeScreen": "IHomeScreen",
      "yours/proHomeScreen": "IHomeScreen"
    }
  }
});

Later, some other component can request for all implementers of the logical service:

define(["pentaho/service!IHomeScreen"], function(arrayOfHomeScreenModules) {

  arrayOfHomeScreenModules.forEach(function(homeScreen) {
    // ...
  });
});

Source: javascript/web/pentaho/service.js, line 17