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
- 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
-
The
pentaho/context
module has been renamed to pentaho/environment. -
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
-
Filter types have moved from
pentaho/type/filter
to pentaho/data/filter. -
New property filter types (e.g. pentaho/data/filter/isLess). ⭐
Type API
-
Some class members were renamed to improve readability and/or reduce clashing likelihood:
-
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). -
The attribute
value
of complex properties was renamed to defaultValue. -
The attribute
type
of complex properties was renamed to valueType.
-
-
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 } }); }]; });
-
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.
-
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); }]; });
-
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 avalueType
offunction
now need to wrap the value in an auxiliary function. -
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.
-
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.
-
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.
-
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.