Skip to main content
Pentaho Documentation

module

pentaho. module

The module namespace contains the types of the Pentaho Modules API.

Source: doc-js/pentaho/module/_namespace.jsdoc, line 19

Child Namespaces

Name Summary
impl

The impl namespace contains implementation types of the Pentaho Modules API.

spec

The module.spec namespace contains specification interfaces.

util

The util namespace contains utility function for working with modules.

Interfaces

Name Summary
IInstanceMeta

The IInstanceMeta interface contains the metadata of an instance module.

IMeta

The IMeta interface contains the metadata of a JavaScript module.

IMetaService

The IMetaService interface represents a service that provides metadata information about JavaScript modules.

IService

The IService interface represents a service that provides ways to load JavaScript modules depending on their type/instance relation to a given module.

ITypeMeta

The ITypeMeta interface contains the metadata of a type module.

Members

Name Description
instanceOf : IAmdLoaderPlugin

The pentaho/module/instanceOf! module is an AMD/RequireJS loader plugin that allows loading a module which provides an instance of a specified type.

instancesOf : IAmdLoaderPlugin

The pentaho/module/instancesOf! module is an AMD/RequireJS loader plugin that allows loading modules which provide instances of a specified type.

metaOf : IAmdLoaderPlugin

The pentaho/module! module is an AMD/RequireJS loader plugin that obtains the metadata object of a module given its identifier. The configuration of the module is also loaded.

metaService

The main modules metadata service of the Pentaho Modules API.

service

The main modules service of the Pentaho Modules API.

subtypeOf : IAmdLoaderPlugin

The pentaho/module/subtypeOf! module is an AMD/RequireJS loader plugin that allows loading a module which provides a subtype of a specified base type.

subtypesOf : IAmdLoaderPlugin

The pentaho/module/subtypesOf! module is an AMD/RequireJS loader plugin that allows loading modules which provide subtypes of a specified type.

Members Details

instanceOf: IAmdLoaderPlugin

The pentaho/module/instanceOf! module is an AMD/RequireJS loader plugin that allows loading a module which provides an instance of a specified type.

AMD Plugin Usage: "pentaho/module/instanceOf!{typeId}"

  1. {typeId} — The identifier or alias of the type of the desired instance.

Example

The following AMD/RequireJS configuration registers two instances, mine/homeScreen and yours/proHomeScreen, of the abstract type IHomeScreen:

require.config({
  config: {"pentaho/modules": {"IHomeScreen":         {base: null, isAbstract: true},"mine/homeScreen":     {type:"IHomeScreen"},"yours/proHomeScreen": {type:"IHomeScreen", ranking: 2}
    }
  }
});

Later, some other component can request for a registered instance of the type IHomeScreen:

define(["pentaho/module/instanceOf!IHomeScreen"], function(homeScreen) {

});

The highest ranking instance is chosen.

Source: javascript/web/pentaho/module/instanceOf.js, line 22

See also: pentaho.module.service , pentaho.module.IService#getInstanceOfAsync

instancesOf: IAmdLoaderPlugin

The pentaho/module/instancesOf! module is an AMD/RequireJS loader plugin that allows loading modules which provide instances of a specified type.

AMD Plugin Usage: "pentaho/module/instancesOf!{typeId}"

  1. {typeId} — The identifier or alias of the type of the desired instances.

Example

The following AMD/RequireJS configuration registers two instances, mine/homeScreen and yours/proHomeScreen, of the abstract type IHomeScreen:

require.config({
  config: {"pentaho/modules": {"IHomeScreen":         {base: null, isAbstract: true},"mine/homeScreen":     {type:"IHomeScreen"},"yours/proHomeScreen": {type:"IHomeScreen", ranking: 2}
    }
  }
});

Later, some other component can request for all registered instances of the type IHomeScreen:

define(["pentaho/module/instancesOf!IHomeScreen"], function(arrayOfHomeScreens) {

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

Source: javascript/web/pentaho/module/instancesOf.js, line 22

See also: pentaho.module.service , pentaho.module.IService#getInstancesOfAsync

metaOf: IAmdLoaderPlugin

The pentaho/module! module is an AMD/RequireJS loader plugin that obtains the metadata object of a module given its identifier. The configuration of the module is also loaded.

If the requested module is not defined (through pentaho.modules), it is defined as an instance module having a null type.

AMD Plugin Usage: "pentaho/module!{moduleId}"

  1. {moduleId} — The identifier of the desired module. To refer to the requesting module, use the special value _.

Source: javascript/web/pentaho/module/metaOf.js, line 31

See also: pentaho.module.IMeta , pentaho.module.metaService , pentaho.module.IMetaService#get

Example
// Obtain the self module.
define(["pentaho/module!_"], function(module) {

 if(module.config) {
 // Do something.
 }
});
metaService:

The main modules metadata service of the Pentaho Modules API.

If instead of the metadata of modules, the modules themselves are needed, use pentaho.module.service directly, or one of the following AMD loader plugins:

  • pentaho/module!
  • pentaho/module/instanceOf!
  • pentaho/module/instancesOf!
  • pentaho/module/typeOf!
  • pentaho/module/typesOf!

The modules metadata service is first initialized with the AMD configuration of the pentaho.modules module. Secondly, the environmental configuration of pentaho/modules also contributes with additional modules' metadata.

Source: javascript/web/pentaho/module/metaService.js, line 22

service:

The main modules service of the Pentaho Modules API.

To obtain the values of modules as a dependency of an AMD/RequireJS module, use one of the following AMD loader plugins instead:

  • pentaho/module!
  • pentaho/module/instanceOf!
  • pentaho/module/instancesOf!
  • pentaho/module/typeOf!
  • pentaho/module/typesOf!

Source: javascript/web/pentaho/module/service.js, line 22

See also: pentaho.module.metaService

subtypeOf: IAmdLoaderPlugin

The pentaho/module/subtypeOf! module is an AMD/RequireJS loader plugin that allows loading a module which provides a subtype of a specified base type.

AMD Plugin Usage: "pentaho/module/instanceOf!{baseTypeId}"

  1. {baseTypeId} — The identifier or alias of the base type of the desired subtype.

Example

The following AMD/RequireJS configuration registers two subtypes, mine/HomeScreen and yours/ProHomeScreen, of the abstract type IHomeScreen:

require.config({
  config: {"pentaho/modules": {"IHomeScreen":         {base: null, isAbstract: true},"mine/HomeScreen":     {base:"IHomeScreen"},"yours/ProHomeScreen": {base:"IHomeScreen", ranking: 2}
    }
  }
});

Later, some other component can request for a registered subtype of the type IHomeScreen:

define(["pentaho/module/subtypeOf!IHomeScreen"], function(HomeScreen) {

});

The highest ranking subtype is chosen.

Source: javascript/web/pentaho/module/subtypeOf.js, line 22

See also: pentaho.module.service , pentaho.module.IService#getSubtypeOfAsync

subtypesOf: IAmdLoaderPlugin

The pentaho/module/subtypesOf! module is an AMD/RequireJS loader plugin that allows loading modules which provide subtypes of a specified type.

AMD Plugin Usage: "pentaho/module/subtypesOf!{baseTypeId}"

  1. {baseTypeId} — The identifier or alias of the base type of the desired subtypes.

Example

The following AMD/RequireJS configuration registers two subtypes, mine/HomeScreen and yours/ProHomeScreen, of the abstract type IHomeScreen:

require.config({
  config: {"pentaho/modules": {"IHomeScreen":         {base: null, isAbstract: true},"mine/HomeScreen":     {base:"IHomeScreen"},"yours/ProHomeScreen": {base:"IHomeScreen", ranking: 2}
    }
  }
});

Later, some other component can request for all registered subtypes of the type IHomeScreen:

define(["pentaho/module/subtypesOf!IHomeScreen"], function(arrayOfHomeScreens) {

  arrayOfHomeScreens.forEach(function(HomeScreen) {
    // ...
  });
});

Source: javascript/web/pentaho/module/subtypesOf.js, line 22

See also: pentaho.module.service , pentaho.module.IService#getSubtypesOfAsync