This documentation targets the API shipped with Pentaho 8.0. Click here for the updated version shipped with Pentaho 8.3.

What's new and changed in the Platform JavaScript APIs beta 2

Platform JavaScript APIs

Global changes

  1. All class members documented as private are now consistently named, by having a __ prefix. Likewise, all protected class members now have a _ prefix.

Core APIs

  1. The pentaho/context module has been renamed to pentaho/environment.

  2. Services are no longer registered with pentaho/service but instead with one of the pentaho/instanceInfo ⭐ or pentaho/typeInfo ⭐ modules, depending on whether the registered module provides an instance or a type, respectively. pentaho/service is still used as an AMD loader plugin to obtain registered instances of a given type.

Data API

  1. Filter types have moved from pentaho/type/filter to pentaho/data/filter.

  2. New property filter types (e.g. pentaho/data/filter/isLess). ⭐

Type API

  1. Some class members were renamed to improve readability and/or reduce clashing likelihood:

    1. The type property used when defining a type or for accessing the type object of an instance was renamed to $type; other instance-side system properties were also renamed to contain a $ prefix (e.g. $isValid).

    2. The attribute value of complex properties was renamed to defaultValue.

    3. The attribute type of complex properties was renamed to valueType.

  2. The format of type modules has changed. Dependencies on other Type API types are not declared as AMD dependencies anymore, in the define call, but are instead declared in an array which is returned, together with the type factory function (see UTypeModule):

    define(["module"], function(module) {
      
      return ["complex", function(Complex) {
        
        return Complex.extend({
          $type: {
            id: module.id
          }      
        });
      }];
    });
    
  3. It is now possible to apply mixins to Type API types, through configuration. ⭐

    This is to avoid generating configuration files having functions, possibly with AMD dependencies on other modules. Any non-trivial code can be moved to a separate module which is only loaded if and when the target type is actually used. This also makes it easier to test configuration code.

  4. The Type API now supports instance modules. ⭐

    Instance modules are instances dual of type modules. Just like types, instances also support configuration. The following illustrates a color palette instance:

    define(["pentaho/util/spec"], function(specUtil) {
       
      "use strict";
       
      return ["pentaho/visual/color/palette", function(Palette, config) {
       
        var spec = specUtil.merge({
          level: "divergent",
          colors: ["#FF0000", "#FFFF00", "#4BB6E4"]
        }, config);
       
        return new Palette(spec);
      }];
    });
    
  5. The defaultValue attribute of a complex type property can now be a function. ⭐

    The function is evaluated when the complex is constructed and whenever the property is set to null. Due to this, default values of properties having a valueType of function now need to wrap the value in an auxiliary function.

  6. The semantics of the defaultValue attribute of a complex type property has changed. A value is now considered specified when explicitly set by the user, even if set to the default value. This mostly affects serialization.

  7. It is no longer possible to set the valueType attribute of a property through configuration, as this, in general, was not a type-safe operation. This pattern was used when defining enumerations (by using refinement types), or when defining Visualization API visual roles. Both of these are now defined in other ways.

  8. Enumerations are now easier to declare (refinement types no more!). Now, defining an enumeration type leverages mixins and has become as simple as:

    define(function() {
       
      return ["string", function(PentahoString) {
       
        return PentahoString.extend({
          $type: {
            mixins: ["enum"],
            domain: ["A", "B", "C", "D"]
          }
        });
      }];
    });
    

    If the value domain of a property is dynamic, the domain attribute can be used to dynamically filter the domain of an enumeration type.

  9. Load tolerance to failure of individual types. ⭐

    When all of the subtypes of a given base type are requested and loaded, and one of the subtypes fails to load, the whole operation still succeeds. This happens, for example, when loading all registered Visualization API models, to display in the menu of an application.

Visualization API

See What’s new and changed in the Visualization API beta 2.

Pentaho Web Platform

Pentaho Web Package deployer ⭐

The Pentaho Web Package deployer allows to easily deploy web resources in the Pentaho Platform, without the need to build a OSGi bundle JAR file.

Previously you needed to setup a Maven project, deal with assemblies, KAR files, etc. With Pentaho 8.0 you can simply create an archive with your files and directly deploy it. Check OSGi Artifacts Deployment for more information.