Skip to main content
Pentaho Documentation

View

pentaho.visual.base.View

This is the base class for views of visualizations.

A container is expected to instantiate a View given a specification with its main properties, like the container DOM element, the width, height and model. The model may not be immediately valid. Alternatively, the container DOM element can be set at a later time, using pentaho.visual.base.View#domContainer.

In any case, the first rendering of the view must be explicitly triggered by a call to update. This two-phase process allows a container application to further configure a view, for example, registering event listeners, before the initial update.

Over time, the view's model is mutated and, in response, the view detects these changes, marks itself as dirty, and, by default, automatically updates itself.

In response to the user interacting with the view, it may perform actions, such as the standard actions Select and Execute, and emit events for these.

When a view is no longer needed, the container application must call its dispose method, so that the view can free held resources and not cause memory-leaks.

AMD Module

require(["pentaho/visual/base/view"], function(View) { /* code goes here */ });

See also:  pentaho.visual.base.spec.IView , pentaho.visual.base.spec.IViewType , pentaho.visual.action.Select , pentaho.visual.action.Execute

Extends

Implements

Constructor

Name Description
new View(viewSpec)
 
Abstract

Creates a visualization View instance.

Classes

Name Summary
Type

The base class of view types.

Members

Name Description
PropertyGroups : number
 
Static

The PropertyGroups enumeration contains the entries for the distinct groups of properties that the base View class recognizes when categorizing property changes.

$references : Array.<Object>

Gets the references to this container, or null, if none.

$uid : string

Gets the unique identifier of the instance.

$version : number

Gets the current version of the instance.

base : function
 
Protected

If a method has been overridden, then the base method provides access to the overridden method.

changeset : pentaho.type.changes.Changeset

Gets the changeset of this instance in the ambient transaction, if any, or null.

domContainer : DOMElement

Gets or sets the container DOM element where the view is rendered.

height : number

Gets or sets the height that the container application has allocated to display the view without horizontal or vertical scrolling, in pixels.

isAutoUpdate : boolean

Gets or sets a value that enables or disables automatic updates of the view.

isDirty : boolean

Gets a value that indicates if the view is in a dirty state.

isUpdating : boolean

Gets a value that indicates if an update is in progress.

isValid : boolean

Determines if this value is a valid instance of its type.

key : string

Gets the key of the complex value.

model : pentaho.visual.base.Model

Gets or sets the visualization model.

selectionFilter : pentaho.type.filter.Abstract

Gets or sets the current data selection filter.

type : pentaho.type.Value.Type

Gets the type of this instance.

width : number

Gets or sets the width that the container application has allocated to display the view without horizontal or vertical scrolling, in pixels.

Methods

Name Description
createAsync(viewSpec) : Promise.<pentaho.visual.base.View>
 
Static

Creates a view, asynchronously, given its specification.

getClassAsync(modelType) : Promise.<Class.<pentaho.visual.base.View>>
 
Static

Gets a promise for the view class (constructor), of the registered default type, if any, for the given model type or identifier.

_clone(clone)
 
Protected

Initializes a clone of this complex value.

_configure(config)
 
Protected

Configures this value with a given non-nully configuration.

_createChangeset(transaction) : pentaho.type.changes.Changeset
 
Abstract
 
Protected

Creates a changeset with this container as owner and returns it.

_emit(event) : pentaho.lang.Event
 
Protected

Emits an unstructured event and returns it, unless it was canceled.

_emitGeneric(event, type, phase, keyArgs) : object
 
Protected

Emits an event given an arbitrary payload object, its type and phase. Returns the event payload object, unless the event is canceled.

_emitSafe(event) : pentaho.lang.Event
 
Protected

Variation of the _emit method in which errors thrown by event listeners are caught and logged.

_hasListeners(type, phase) : boolean
 
Protected

Determines if there are any registrations for a given event type and phase.

_hasObservers(type) : boolean
 
Protected

Determines if there are any registrations for a given event type, for at least one of its phases.

_init(viewSpec)
 
Protected

Called when the view is constructed.

_initDomContainer()
 
Protected

Called to initialize the DOM container, when it is set.

_initValue(value, propType) : pentaho.type.Value
 
Protected

Allows further initializing the value of a property.

_onActionPhaseDo(action) : Promise
 
Protected

Performs an action's do phase, by calling any registered action do observers.

_onActionPhaseFinally(action)
 
Protected

Performs an action's finally phase, by calling any registered action finally observers.

_onActionPhaseInit(action)
 
Protected

Performs an action's initialize phase, by calling any registered action init observers.

_onActionPhaseWill(action)
 
Protected

Performs an action's will phase, by calling any registered action will observers.

_onChangeClassify(dirtyPropGroups, changeset)
 
Protected

Called when the view properties have changed.

_onChangeDid(changeset)
 
Protected

Called after a changeset has been committed.

_onChangeDirty(dirtyPropGroups)
 
Protected

Called when a change caused relevant property groups to be marked as dirty.

_onChangeRejected(changeset, reason)
 
Protected

Called after a changeset has been rejected.

_onChangeWill(changeset) : pentaho.lang.UserError | undefined
 
Protected

Called before a changeset is committed.

_onUpdateDid()
 
Protected

Called when an update operation has been performed with success.

_onUpdateRejected(reason)
 
Protected

Called when an update operation has been canceled or has failed.

_onUpdateWill() : pentaho.lang.UserError
 
Protected

Called when an update operation is going to be performed.

_releaseDomContainer()
 
Protected

Called to release any references to the DOM container.

_updateAll()
 
Protected

Fully renders or updates the view.

_updateData()
 
Protected

Updates the view, taking into account that only the data-related model properties have changed.

_updateGeneral()
 
Protected

Updates the view, taking into account that only "general" model properties have changed.

_updateSelection()
 
Protected

Updates the view, taking into account that only the selection-related model properties have changed.

_updateSize()
 
Protected

Updates the view, taking into account that only the dimensions of the view have changed.

act(action) : pentaho.type.action.Base

Executes a given action with this view as its target and does not wait for its outcome.

actAsync(action) : Promise

Executes a given action in this view as its target and waits for its outcome.

assertValid()

Ensures that the value is valid, and throws the first validation error if it is not.

at(name, index, sloppy) : pentaho.type.Element | Nully

Gets one Element of a property's value, given the property and the index of the element.

atf(name, index, sloppy) : string

Gets the string representation of one element of the value of a property, given the property and the index of the element.

atv(name, index, sloppy) : any | pentaho.type.Complex | Nully

Gets the primitive value of one element of the value of a property, given the property and the index of the element.

clone() : pentaho.type.Complex

Creates a shallow clone of this complex value.

configure(config) : pentaho.type.Value

Configures this value with a given configuration.

count(name, sloppy) : number

Gets the number of values of a given property.

countRange(name) : pentaho.IRange

Gets the current valid count range of values of a given property.

dispose()

Disposes the view by freeing external resources held by the view.

equals(other) : boolean

Determines if a given value, of the same type, represents the same entity.

extend(source, keyArgs) : Object

Extend an object with the properties of another.

first(name, sloppy) : pentaho.type.Element | Nully

Gets the first element of the value of a property.

firstf(name, sloppy) : string

Gets the string representation of the first element of the value of a property.

firstv(name, sloppy) : any | pentaho.type.Complex | Nully

Gets the primitive value of the first element of the value of a property.

get(name, sloppy) : pentaho.type.Value | Nully

Gets the value of a property.

getf(name, sloppy) : string

Gets the string representation of the value of a property.

getv(name, sloppy) : any | pentaho.type.Complex | pentaho.type.List | Nully

Gets the primitive value of the value of a property.

isApplicable(name) : boolean

Gets a value that indicates if a given property is currently applicable.

isEnabled(name) : boolean

Gets a value that indicates if a given property is currently enabled.

isRequired(name) : boolean

Gets a value that indicates if a given property is currently required.

off(typeOrHandle, observer)

Removes one registration given its handle, or all registrations of a given event type (or types) and observer (or listener function).

on(type, observer, keyArgs) : pentaho.lang.IEventRegistrationHandle

Registers an observer (or listener function) for an event(s) of a given type(s).

path(steps, sloppy) : pentaho.type.Value | Nully

Gets the value of a property/index/key path based on the current complex.

set(name, valueSpec)

Sets the value of a property.

toJSON() : UJsonValue

Creates a top-level JSON specification that describes this instance.

toSpec(keyArgs) : pentaho.type.spec.UInstance

Creates a specification that describes this value.

toSpecInContext(keyArgs) : any

Creates a specification that describes this instance.

update() : Promise

Updates the view to match its model's latest state.

validate() : Array.<!pentaho.type.ValidationError>

Determines if this complex value is a valid instance of its type.

Constructor Details

new View(viewSpec)
 
Abstract

Creates a visualization View instance.

Source: javascript/web/pentaho/visual/base/view.js, line 127

Parameters:
Name Default Value Summary
viewSpec : pentaho.visual.base.spec.IViewEx
 
Optional

The extended view specification.

See also:  pentaho.visual.base.spec.IView , pentaho.visual.base.spec.IViewType , pentaho.visual.action.Select , pentaho.visual.action.Execute

Members Details

PropertyGroups: number
 
Static

The PropertyGroups enumeration contains the entries for the distinct groups of properties that the base View class recognizes when categorizing property changes.

Properties:
Name Default Value Description
All : number ~0

Includes all view and model properties.

Ignored : number 0

The group of properties whose changes are ignored, because the view does not visually represent these in any way.

General : number 1

The group of properties that don't have a more specific property group.

Data : number 2

The group of data-related properties.

By default, the only property of this group is the model's data property.

Size : number 4

The group of size-related properties.

By default, the properties of this group are the view's width and height properties.

Selection : number 8

The group of selection-related properties.

By default, the only property of this group is the view's selectionFilter property.

Source: javascript/web/pentaho/visual/base/view.js, line 1311

See also:  pentaho.visual.base.View#_onChangeClassify

$references: Array.<Object>

Gets the references to this container, or null, if none.

Note that the returned array may be empty.

Do NOT change the returned array or its elements in any way.

Source: javascript/web/pentaho/type/ContainerMixin.js, line 119

Inherited From: pentaho.type.ContainerMixin#$references

$uid: string

Gets the unique identifier of the instance.

Source: javascript/web/pentaho/type/ContainerMixin.js, line 103

Inherited From: pentaho.type.ContainerMixin#$uid

$version: number

Gets the current version of the instance.

Source: javascript/web/pentaho/type/ContainerMixin.js, line 150

Inherited From: pentaho.type.ContainerMixin#$version

base: function
 
Protected

If a method has been overridden, then the base method provides access to the overridden method.

Can also be called from within a constructor function.

Source: javascript/web/pentaho/lang/Base.js, line 265

Inherited From: pentaho.lang.Base#base

changeset: pentaho.type.changes.Changeset

Gets the changeset of this instance in the ambient transaction, if any, or null.

Source: javascript/web/pentaho/type/ContainerMixin.js, line 175

Inherited From: pentaho.type.ContainerMixin#changeset

domContainer: DOMElement

Gets or sets the container DOM element where the view is rendered.

The container element is the viewport through which the view's rendered content is revealed. and is provided empty, for the exclusive use of the view, by the container application.

Its content is owned by the view, but its attributes (including style) are owned by the container application and must not be changed by the view.

Its size is controlled by the container application and does not need to be the same as that implied by the visual model's width and height properties, however, normally, it will.

It is the responsibility of the container application to clean up the container element's content, if needed, after the view is disposed of. When disposed of, the view has the responsibility of cleaning up any DOM event handlers it may hold on the container element or any of its children.

Source: javascript/web/pentaho/visual/base/view.js, line 219

See also:  pentaho.visual.base.View#_initDomContainer , pentaho.visual.base.View#_releaseDomContainer

height: number

Gets or sets the height that the container application has allocated to display the view without horizontal or vertical scrolling, in pixels.

This property is required.

Source: javascript/web/pentaho/visual/base/view.js, line 1040

isAutoUpdate: boolean

Gets or sets a value that enables or disables automatic updates of the view.

When true, the view is automatically updated whenever a relevant change in the model occurs. When false, the view must be manually updated by calling update.

Setting this property to true does not cause the view to update in response, if it is currently dirty. This property only affects the view's behaviour in response to subsequent model changes.

Source: javascript/web/pentaho/visual/base/view.js, line 286

isDirty: boolean

Gets a value that indicates if the view is in a dirty state.

A view is dirty during the period after the view's model has changed to until the time the view is updated.

During this period, the view should not handle any user interaction events, as the user would be acting on an outdated representation of the model.

Source: javascript/web/pentaho/visual/base/view.js, line 320

See also:  pentaho.visual.base.View#isAutoUpdate

isUpdating: boolean

Gets a value that indicates if an update is in progress.

Source: javascript/web/pentaho/visual/base/view.js, line 303

See also:  pentaho.visual.base.View#update

isValid: boolean

Determines if this value is a valid instance of its type.

This attribute calls validate and returns a boolean value indicating if it returned no errors.

Source: javascript/web/pentaho/type/value.js, line 137

Inherited From: pentaho.type.Value#isValid

key: string

Gets the key of the complex value.

The key of a value identifies it among values of the same concrete type.

If two values have the same concrete type and their keys are equal, then it must also be the case that pentaho.type.Value.Type#areEqual returns true when given the two values. The opposite should be true as well. If two values of the same concrete type have distinct keys, then pentaho.type.Value.Type#areEqual should return false.

The default complex implementation, returns the value of the complex instance's pentaho.type.Complex#$uid.

Source: javascript/web/pentaho/type/complex.js, line 241

Inherited From: pentaho.type.Complex#key

model: pentaho.visual.base.Model

Gets or sets the visualization model.

This property is required.

Source: javascript/web/pentaho/visual/base/view.js, line 1074

selectionFilter: pentaho.type.filter.Abstract

Gets or sets the current data selection filter.

This property is required.

This property is not serialized by default. To serialize it, specify the argument keyArgs.omitProps.selectionFilter of toSpec to false.

Source: javascript/web/pentaho/visual/base/view.js, line 1055

type: pentaho.type.Value.Type

Gets the type of this instance.

Source: javascript/web/pentaho/type/value.js, line 262

Overrides: pentaho.type.Complex#type

width: number

Gets or sets the width that the container application has allocated to display the view without horizontal or vertical scrolling, in pixels.

This property is required.

Source: javascript/web/pentaho/visual/base/view.js, line 1025

Methods Details

createAsync(viewSpec) : Promise.<pentaho.visual.base.View>
 
Static

Creates a view, asynchronously, given its specification.

If the view specification has its type annotated inline, a view of that type is built.

Otherwise, when the view type is not annotated inline in the specification, if its model property is specified with an already instantiated model instance, or with a type annotated specification, that model's type's default view class is used to create a view instance from the given specification. The returned promise is rejected if the provided model specification is not specified or is not type annotated. The returned promise is also rejected if the model type has no registered default view type.

Unlike the pentaho.type.Type#createAsync counterpart method, this static variant can be called to create an instance of any view type, even if it isn't a subtype of this one.

Source: javascript/web/pentaho/visual/base/view.js, line 1218

Parameters:
Name Default Value Summary
viewSpec : pentaho.visual.base.spec.IViewEx

The extended view specification.

Returns:
Name Description
Promise.<pentaho.visual.base.View>

A promise for a view with the given specification.

getClassAsync(modelType) : Promise.<Class.<pentaho.visual.base.View>>
 
Static

Gets a promise for the view class (constructor), of the registered default type, if any, for the given model type or identifier.

Source: javascript/web/pentaho/visual/base/view.js, line 1266

Parameters:
Name Default Value Summary
modelType : string | pentaho.visual.base.Model.Type

The visual model type or its identifier.

Returns:
Name Description
Promise.<Class.<pentaho.visual.base.View>>

A promise for a view class of the given model type.

_clone(clone)
 
Protected

Initializes a clone of this complex value.

Source: javascript/web/pentaho/type/complex.js, line 195

Inherited From: pentaho.type.Complex#_clone

Parameters:
Name Default Value Summary
clone : pentaho.type.Complex

The complex value clone.

_configure(config)
 
Protected

Configures this value with a given non-nully configuration.

The default implementation does nothing.

Source: javascript/web/pentaho/type/value.js, line 194

Inherited From: pentaho.type.Value#_configure

Parameters:
Name Default Value Summary
config : any

The configuration.

_createChangeset(transaction) : pentaho.type.changes.Changeset
 
Abstract
 
Protected

Creates a changeset with this container as owner and returns it.

Source: javascript/web/pentaho/type/ContainerMixin.js, line 203

Inherited From: pentaho.type.ContainerMixin#_createChangeset

Parameters:
Name Default Value Summary
transaction : pentaho.type.changes.Transaction

The transaction that owns this changeset.

Returns:
Name Description
pentaho.type.changes.Changeset

A changeset of the appropriate type.

_emit(event) : pentaho.lang.Event
 
Protected

Emits an unstructured event and returns it, unless it was canceled.

When this method is called, the listeners of existing registrations are notified synchronously, by priority order and then registration order, until either the event is canceled or all of the listeners have been notified.

It is safe to register or unregister to/from an event type while it is being emitted. However, changes are only taken into account in subsequent emissions.

If a listener function throws an error, the event processing is interrupted. No more registrations are processed and the error is passed to the caller.

Source: javascript/web/pentaho/lang/EventSource.js, line 261

Inherited From: pentaho.lang.EventSource#_emit

Parameters:
Name Default Value Summary
event : pentaho.lang.Event

The event object.

Returns:
Name Description
pentaho.lang.Event | null

The given event object or null, when canceled.

See also:  pentaho.lang.EventSource#_emitSafe , pentaho.lang.EventSource#_emitGeneric

_emitGeneric(event, type, phase, keyArgs) : object
 
Protected

Emits an event given an arbitrary payload object, its type and phase. Returns the event payload object, unless the event is canceled.

Source: javascript/web/pentaho/lang/EventSource.js, line 313

Inherited From: pentaho.lang.EventSource#_emitGeneric

Parameters:
Name Default Value Summary
event : object

The event object.

type : nonEmptyString

The type of the event.

phase : nonEmptyString
 
Optional

The phase of the event. For unstructured events don't specify this argument (or specify a Nully value).

keyArgs : Object
 
Optional

The keyword arguments' object.

Parameters:
Name Default Value Summary
isCanceled : function
 
Optional

A predicate that indicates if a given event object is in a canceled state.

errorHandler : function
 
Optional

When specified with a null value, no error handling is performed and errors thrown by listeners are thrown back to this method's caller. When unspecified or specified as undefined, defaults to a function that simply log the listener errors, and let execution continue to following listeners. The function arguments are: the error, the event, the event type and the event phase.

Returns:
Name Description
object | null

The event payload object or null, when the event is canceled.

_emitSafe(event) : pentaho.lang.Event
 
Protected

Variation of the _emit method in which errors thrown by event listeners are caught and logged.

If an event listener throws an error, the following event listeners are still processed.

Source: javascript/web/pentaho/lang/EventSource.js, line 283

Inherited From: pentaho.lang.EventSource#_emitSafe

Parameters:
Name Default Value Summary
event : pentaho.lang.Event

The event object.

Returns:
Name Description
pentaho.lang.Event | null

The given event object or null, when canceled.

See also:  pentaho.lang.EventSource#_emit , pentaho.lang.EventSource#_emitGeneric

_hasListeners(type, phase) : boolean
 
Protected

Determines if there are any registrations for a given event type and phase.

This method can be used to avoid creating expensive event objects for event type and phase pairs that don't have registrations.

Source: javascript/web/pentaho/lang/EventSource.js, line 189

Inherited From: pentaho.lang.EventSource#_hasListeners

Parameters:
Name Default Value Summary
type : nonEmptyString

The type of the event.

phase : nonEmptyString
 
Optional

The phase of a structured event. For unstructured events don't specify this argument.

Returns:
Name Description
boolean

true if the event has any listeners for the given event type and phase; false, otherwise.

Example

if(this._hasListeners("select", "will")) {

 var event = new Event("select", this);

 if(this._emit(event)) {
 // Select Will phase
 }
}
_hasObservers(type) : boolean
 
Protected

Determines if there are any registrations for a given event type, for at least one of its phases.

This method can be used to avoid creating expensive event objects for event types that currently have no registrations.

Source: javascript/web/pentaho/lang/EventSource.js, line 232

Inherited From: pentaho.lang.EventSource#_hasObservers

Parameters:
Name Default Value Summary
type : nonEmptyString

The type of the event.

Returns:
Name Description
boolean

true if the event has any observers for the given event type; false, otherwise.

Example

if(this._hasObservers("select")) {

 var event = new Event("select");

 if(this._emitGeneric(event, "select", "will")) {
 // Select Will

 this._emitGeneric(event, "select", "did");
 }
}
_init(viewSpec)
 
Protected

Called when the view is constructed.

Override this method, from a configuration mixin class, to perform any initialization.

Source: javascript/web/pentaho/visual/base/view.js, line 186

Parameters:
Name Default Value Summary
viewSpec : pentaho.visual.base.spec.IViewEx

The view specification provided at construction time, if any.

_initDomContainer()
 
Protected

Called to initialize the DOM container, when it is set.

Can be used to initialize the HTML content and/or to attach event handlers.

Source: javascript/web/pentaho/visual/base/view.js, line 245

_initValue(value, propType) : pentaho.type.Value
 
Protected

Allows further initializing the value of a property.

This method is called from within the base constructor.

It is absolutely mandatory to return a value that is an instance of the type of value of the property. If the value should remain "empty", return null, and never undefined.

Source: javascript/web/pentaho/type/complex.js, line 147

Inherited From: pentaho.type.Complex#_initValue

Parameters:
Name Default Value Summary
value : pentaho.type.Value

The value of the property, possibly null.

propType : pentaho.type.Property.Type

The property type.

Returns:
Name Description
pentaho.type.Value

The value of the property, possibly null.

_onActionPhaseDo(action) : Promise
 
Protected

Performs an action's do phase, by calling any registered action do observers.

Source: javascript/web/pentaho/visual/base/view.js, line 921

Parameters:
Name Default Value Summary
action : pentaho.type.action.Base

The action.

Returns:
Name Description
Promise | null

A promise to the completion of the asynchronous do listener, of an asynchronous action, or null.

_onActionPhaseFinally(action)
 
Protected

Performs an action's finally phase, by calling any registered action finally observers.

Source: javascript/web/pentaho/visual/base/view.js, line 932

Parameters:
Name Default Value Summary
action : pentaho.type.action.Base

The action.

_onActionPhaseInit(action)
 
Protected

Performs an action's initialize phase, by calling any registered action init observers.

Source: javascript/web/pentaho/visual/base/view.js, line 896

Parameters:
Name Default Value Summary
action : pentaho.type.action.Base

The action.

_onActionPhaseWill(action)
 
Protected

Performs an action's will phase, by calling any registered action will observers.

Source: javascript/web/pentaho/visual/base/view.js, line 907

Parameters:
Name Default Value Summary
action : pentaho.type.action.Base

The action.

_onChangeClassify(dirtyPropGroups, changeset)
 
Protected

Called when the view properties have changed.

The default implementation marks the view as dirty. More specifically, it marks the property groups of the properties affected by the given changeset as dirty.

The recognized property groups are those of View.PropertyGroups.

Implementations can override this method to change the default behavior for some or all of the model and view properties.

Source: javascript/web/pentaho/visual/base/view.js, line 370

Parameters:
Name Default Value Summary
dirtyPropGroups : pentaho.util.BitSet

A bit set of property groups that should be set dirty. Use the values of View.PropertyGroups as bit values.

changeset : pentaho.type.Changeset

The model's changeset.

See also:  pentaho.visual.base.View#_updateAll

_onChangeDid(changeset)
 
Protected

Called after a changeset has been committed.

The default implementation emits the "did:change" event for the given changeset, if there are any listeners.

When overriding, be sure to call the base implementation.

Source: javascript/web/pentaho/type/ContainerMixin.js, line 253

Overrides: pentaho.type.Complex#_onChangeDid

Parameters:
Name Default Value Summary
changeset : pentaho.type.changes.Changeset

The set of changes.

_onChangeDirty(dirtyPropGroups)
 
Protected

Called when a change caused relevant property groups to be marked as dirty.

The default implementation auto-updates the view, if possible.

Source: javascript/web/pentaho/visual/base/view.js, line 412

Parameters:
Name Default Value Summary
dirtyPropGroups : pentaho.util.BitSet

A bit set of property groups that were changed. Use the values of View.PropertyGroups as bit values.

_onChangeRejected(changeset, reason)
 
Protected

Called after a changeset has been rejected.

The default implementation emits the "rejected:change" event for the given changeset, if there are any listeners.

When overriding, be sure to call the base implementation.

Source: javascript/web/pentaho/type/ContainerMixin.js, line 273

Inherited From: pentaho.type.ContainerMixin#_onChangeRejected

Parameters:
Name Default Value Summary
changeset : pentaho.type.changes.Changeset

The set of changes.

reason : Error

The reason why the changes were rejected.

_onChangeWill(changeset) : pentaho.lang.UserError | undefined
 
Protected

Called before a changeset is committed.

The default implementation emits the "will:change" event for the given changeset, if there are any listeners.

When overriding, be sure to call the base implementation.

Source: javascript/web/pentaho/type/ContainerMixin.js, line 233

Inherited From: pentaho.type.ContainerMixin#_onChangeWill

Parameters:
Name Default Value Summary
changeset : pentaho.type.changes.Changeset

The set of changes.

Returns:
Name Description
pentaho.lang.UserError | undefined

An error if the changeset was canceled; or, undefined otherwise.

_onUpdateDid()
 
Protected

Called when an update operation has been performed with success.

The isUpdating property will now have value false. The isDirty property will also have value false.

The default implementation emits the did:update event.

The implementation or the event listeners are allowed to modify the model and thus possibly start new updates from the did phase.

If an implementation throws an error, the error is logged and the update operation is still considered successful.

Source: javascript/web/pentaho/visual/base/view.js, line 731

Fires: event:did:update

_onUpdateRejected(reason)
 
Protected

Called when an update operation has been canceled or has failed.

The isUpdating property will now have value false. The isDirty property may have value true.

The default implementation emits the rejected:update event.

The implementation or the event listeners are allowed to modify the model and thus possibly start new updates from the rejected phase.

If an implementation throws an error, the error is logged and the update operation is still rejected with the original error.

Source: javascript/web/pentaho/visual/base/view.js, line 757

Parameters:
Name Default Value Summary
reason : Error

The reason why the update operation was canceled or has failed.

Fires: event:rejected:update

_onUpdateWill() : pentaho.lang.UserError
 
Protected

Called when an update operation is going to be performed.

The default implementation emits the will:update event.

Either the implementation or the event listeners are allowed to cancel the update or further modify the model.

The implementation can cancel the update by returning or throwing an error.

Source: javascript/web/pentaho/visual/base/view.js, line 575

Fires: event:will:update

Returns:
Name Description
pentaho.lang.UserError

An error, containing the cancellation reason; or null.

_releaseDomContainer()
 
Protected

Called to release any references to the DOM container.

It is the responsibility of the container application to clean up the container element's content, when it is no longer needed. On the other hand, it is the responsibility of the view to clean up any DOM event handlers or references it may hold on the container element or any of its children.

Currently, this method is automatically called from the dispose method.

The default implementation clears the DOM container property and unregisters from any DOM events.

If an implementation has additional properties containing DOM nodes, or other attached DOM event handlers, then it must override this method (and call base) and set these properties to null, so that memory-leaks are not caused.

Source: javascript/web/pentaho/visual/base/view.js, line 269

_updateAll()
 
Protected

Fully renders or updates the view.

The first update of a visualization is always a full update.

The default implementation does nothing. Implementations should override this method and implement a complete rendering of the visualization.

Besides implementing this method, implementations should consider implementing one or more of the optional partial update methods, like _updateData, _updateSize, _updateSelection and _updateGeneral.

Other appropriate combinations of these can also be implemented, for example, _updateSizeAndSelection, by combining the names of the known property groups: Data, Size, Selection and General, with an And to form a corresponding method name. For more information on property groups, see View.PropertyGroups.

The update operation selects the best fit partial methods to actually update the view.

Source: javascript/web/pentaho/visual/base/view.js, line 1407

See also:  pentaho.visual.base.View#update , pentaho.visual.base.View.PropertyGroups , pentaho.visual.base.View#_onChangeClassify

_updateData()
 
Protected

Updates the view, taking into account that only the data-related model properties have changed.

This is an optional method - there is no base implementation.

Implement this method to provide a faster way to update the data displayed by the view. When not specified, and no other applicable partial update method exists, the view is updated using the _updateAll method.

Source: javascript/web/pentaho/visual/base/view.js, line 1446

See also:  pentaho.visual.base.View#_updateAll

_updateGeneral()
 
Protected

Updates the view, taking into account that only "general" model properties have changed.

This is an optional method - there is no base implementation.

Implement this method to provide a faster way to update the "general information" displayed by the view. When not specified, and no other applicable partial update method exists, the view is updated using the _updateAll method.

Source: javascript/web/pentaho/visual/base/view.js, line 1464

See also:  pentaho.visual.base.View#_updateAll

_updateSelection()
 
Protected

Updates the view, taking into account that only the selection-related model properties have changed.

This is an optional method - there is no base implementation.

Implement this method to provide a faster way to update the selection of the view. When not specified, and no other applicable partial update method exists, the view is updated using the _updateAll method.

Source: javascript/web/pentaho/visual/base/view.js, line 1428

See also:  pentaho.visual.base.View#_updateAll

_updateSize()
 
Protected

Updates the view, taking into account that only the dimensions of the view have changed.

This is an optional method - there is no base implementation.

Implement this method to provide a faster way to resize a view. When not specified, and no other applicable partial update method exists, the full _updateAll method is used to update the view.

Source: javascript/web/pentaho/visual/base/view.js, line 1410

See also:  pentaho.visual.base.View#_updateAll

Implements:
act(action) : pentaho.type.action.Base

Executes a given action with this view as its target and does not wait for its outcome.

Emits a structured event of a type equal to the action type's id, with the action as event payload, for each of the action's phases.

This method can be given synchronous or asynchronous actions. However, in the latter case, this method is only suitable for fire-and-forget scenarios, where it is not needed to know the outcome of the asynchronous action.

Source: javascript/web/pentaho/visual/base/view.js, line 824

Parameters:
Name Default Value Summary
action : pentaho.type.action.Base

The action to execute.

Returns:
Name Description
pentaho.type.action.Base

The given action.

See also:  pentaho.visual.base.View#actAsync

Example

define(["pentaho/visual/action/execute"], function(executeFactory) {

 // ...

 // Listen to the execute event
 view.on("pentaho/visual/action/execute", {

 do: function(action) {

 var dataFilter = action.dataFilter;

 alert("Executed on rows where " + (dataFilter && dataFilter.contentKey));

 // Mark action as done.
 action.done();
 }
 });

 // ...

 // Act "execute" on data rows that have "country" = "us".

 var Execute = view.type.context.get(executeFactory);

 var action = new Execute({
 dataFilter: {
 _: "isEqual",
 p: "country",
 v: "us"
 }
 });

 view.act(action);
});
Implements:
actAsync(action) : Promise

Executes a given action in this view as its target and waits for its outcome.

Emits a structured event of a type equal to the action type's id, with the action as event payload, for each of the action's phases.

This method can be given synchronous or asynchronous actions, and can be used when uniformity in treatment is desired and it is needed to know the outcome of the asynchronous action.

Source: javascript/web/pentaho/visual/base/view.js, line 854

Parameters:
Name Default Value Summary
action : pentaho.type.action.Base

The action to execute.

Returns:
Name Description
Promise

A promise that is fulfilled with the action's result or rejected with the action's error.

See also:  pentaho.visual.base.View#act

assertValid()

Ensures that the value is valid, and throws the first validation error if it is not.

This method calls the validate method.

Source: javascript/web/pentaho/type/value.js, line 168

Inherited From: pentaho.type.Value#assertValid

Throws:
Name Description
pentaho.type.ValidationError

When the value is not valid, the first error returned by the validate method.

at(name, index, sloppy) : pentaho.type.Element | Nully

Gets one Element of a property's value, given the property and the index of the element.

If the specified property is not defined and sloppy is true, undefined is returned. If the specified index is out of range, null is returned.

This method allows use of the same syntax for getting a single element from the value of a property, whether it is a list or an element property. If the property is an element property whose value is null, it is seen like a list property with no elements. If its value is not null, it is seen like a list property with one element. This behavior is consistent with that of the count property.

Source: javascript/web/pentaho/type/complex.js, line 577

Inherited From: pentaho.type.Complex#at

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

index : number

The index of the desired element.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
pentaho.type.Element | Nully

A single Element value, or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Property.Type#isList , pentaho.type.Complex#path , pentaho.type.Complex#atv , pentaho.type.Complex#atf , pentaho.type.Complex#count , pentaho.type.Complex#first

atf(name, index, sloppy) : string

Gets the string representation of one element of the value of a property, given the property and the index of the element.

This method reads the value of the property/index by calling Complex#at.

When the latter returns a Nully value, "" is returned. Otherwise, the result of the element's toString() method is returned.

For a Simple type, this corresponds to returning its formatted attribute, when it is not null. For a Complex type, this varies with the implementation.

Source: javascript/web/pentaho/type/complex.js, line 647

Inherited From: pentaho.type.Complex#atf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

index : number

The index of the value.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
string

The string representation of the requested element, or "".

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#at , pentaho.type.Complex#atv

atv(name, index, sloppy) : any | pentaho.type.Complex | Nully

Gets the primitive value of one element of the value of a property, given the property and the index of the element.

This method reads the value of the property/index by calling Complex#at.

When the latter does not return a Nully value, the result of the element's valueOf() method is returned.

For a Simple type, this corresponds to returning its value attribute. For a Complex type, this corresponds to the value itself.

Source: javascript/web/pentaho/type/complex.js, line 617

Inherited From: pentaho.type.Complex#atv

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

index : number

The index of the element.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
any | pentaho.type.Complex | Nully

The primitive value of the requested element, or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#at , pentaho.type.Complex#atf

clone() : pentaho.type.Complex

Creates a shallow clone of this complex value.

All property values are shared with the clone.

Source: javascript/web/pentaho/type/complex.js, line 183

Inherited From: pentaho.type.Complex#clone

Returns:
Name Description
pentaho.type.Complex

The complex value clone.

Implements:
configure(config) : pentaho.type.Value

Configures this value with a given configuration.

Source: javascript/web/pentaho/type/value.js, line 180

Inherited From: pentaho.type.Value#configure

Parameters:
Name Default Value Summary
config : any

The configuration.

Returns:
Name Description
pentaho.type.Value

This instance.

count(name, sloppy) : number

Gets the number of values of a given property.

When the specified property is a list property, its count is returned.

When the specified property is not a list property, 0 is returned if it is null; 1, otherwise.

Source: javascript/web/pentaho/type/complex.js, line 541

Inherited From: pentaho.type.Complex#count

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
number

The number of values.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

countRange(name) : pentaho.IRange

Gets the current valid count range of values of a given property.

Source: javascript/web/pentaho/type/complex.js, line 694

Inherited From: pentaho.type.Complex#countRange

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

Returns:
Name Description
pentaho.IRange

The range of the property.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

Implements:
dispose()

Disposes the view by freeing external resources held by the view.

The default implementation calls _releaseDomContainer to release the DOM container.

Source: javascript/web/pentaho/visual/base/view.js, line 943

equals(other) : boolean

Determines if a given value, of the same type, represents the same entity.

The given value must be of the same concrete type (or the result is undefined).

To test equality for any two arbitrary values, in a robust way, use pentaho.type.Value.Type#areEqual.

If two values are equal, they must have an equal pentaho.type.Value#key. Otherwise, if they are different, they must have a different key.

The default implementation returns true if the two values have the same key; or, false, otherwise.

Source: javascript/web/pentaho/type/value.js, line 122

Inherited From: pentaho.type.Value#equals

Parameters:
Name Default Value Summary
other : pentaho.type.Value

A value to test for equality.

Returns:
Name Description
boolean

true if the given value is equal to this one; or, false, otherwise.

extend(source, keyArgs) : Object

Extend an object with the properties of another.

Methods that are overridden are accessible through this.base.

This object is extended, but its class doesn't change.

Can be applied to non-Base instances (e.g. using Base.prototype.extend.call(alien, {a: "hello"})).

Source: javascript/web/pentaho/lang/Base.js, line 808

Overrides: pentaho.type.Complex#extend

Parameters:
Name Default Value Summary
source : Object

The instance specification.

keyArgs : Object
 
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
exclude : Object
 
Optional

A map of property names to exclude from source.

Returns:
Name Description
Object

This object.

first(name, sloppy) : pentaho.type.Element | Nully

Gets the first element of the value of a property.

This method returns the result of calling Complex#at with a 0 index.

Source: javascript/web/pentaho/type/complex.js, line 480

Inherited From: pentaho.type.Complex#first

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
pentaho.type.Element | Nully

An element or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#firstv , pentaho.type.Complex#firstf

firstf(name, sloppy) : string

Gets the string representation of the first element of the value of a property.

This method returns the result of calling Complex#atf with a 0 index.

Source: javascript/web/pentaho/type/complex.js, line 520

Inherited From: pentaho.type.Complex#firstf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
string

The string representation of the first element, or "".

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#first , pentaho.type.Complex#firstv

firstv(name, sloppy) : any | pentaho.type.Complex | Nully

Gets the primitive value of the first element of the value of a property.

This method returns the result of calling Complex#atv with a 0 index.

Source: javascript/web/pentaho/type/complex.js, line 500

Inherited From: pentaho.type.Complex#firstv

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
any | pentaho.type.Complex | Nully

The primitive value of the first element, or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#first , pentaho.type.Complex#firstf

get(name, sloppy) : pentaho.type.Value | Nully

Gets the value of a property.

If the specified property is not defined and sloppy is true, undefined is returned.

A list property always has a non-null value, possibly an empty list, but never null. An element property can have a null value.

Source: javascript/web/pentaho/type/complex.js, line 267

Inherited From: pentaho.type.Complex#get

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type
 
Optional

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
pentaho.type.Value | Nully

The value of the property, or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#getv , pentaho.type.Complex#getf , pentaho.type.Complex#at , pentaho.type.Complex#first

getf(name, sloppy) : string

Gets the string representation of the value of a property.

This method reads the value of the property by calling Complex#get.

When the latter returns a Nully value, "" is returned. Otherwise, the result of the value's toString() method is returned.

For a Simple type, this corresponds to returning its formatted attribute, when it is not null. For Complex and List types, varies with the implementation.

Source: javascript/web/pentaho/type/complex.js, line 337

Inherited From: pentaho.type.Complex#getf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
string

The string representation of the value, or "".

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#get , pentaho.type.Complex#getv

getv(name, sloppy) : any | pentaho.type.Complex | pentaho.type.List | Nully

Gets the primitive value of the value of a property.

This method reads the value of the property by calling Complex#get.

When the latter does not return a Nully value, the result of the value's valueOf() method is returned.

For a Simple type, this corresponds to returning its value attribute. For Complex and List types, this corresponds to the value itself.

Source: javascript/web/pentaho/type/complex.js, line 308

Inherited From: pentaho.type.Complex#getv

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
any | pentaho.type.Complex | pentaho.type.List | Nully

The primitive value of a Simple, the Complex or List value itself, or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#get , pentaho.type.Complex#getf

isApplicable(name) : boolean

Gets a value that indicates if a given property is currently applicable.

Source: javascript/web/pentaho/type/complex.js, line 664

Inherited From: pentaho.type.Complex#isApplicable

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

Returns:
Name Description
boolean

true if the property is applicable; false, otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

isEnabled(name) : boolean

Gets a value that indicates if a given property is currently enabled.

Source: javascript/web/pentaho/type/complex.js, line 679

Inherited From: pentaho.type.Complex#isEnabled

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or property type object.

Returns:
Name Description
boolean

Returns true if the property is enabled; false, otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

isRequired(name) : boolean

Gets a value that indicates if a given property is currently required.

A property is currently required if its current pentaho.type.Complex#countRange minimum is at least 1.

Source: javascript/web/pentaho/type/complex.js, line 712

Inherited From: pentaho.type.Complex#isRequired

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type
 
Optional

The property name or type object.

Returns:
Name Description
boolean

true if the property is required; false, otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

Implements:
off(typeOrHandle, observer)

Removes one registration given its handle, or all registrations of a given event type (or types) and observer (or listener function).

To remove an event registration, it is sufficient to call the dispose method of the registration handle returned by on, upon registration. Alternatively, as a convenience syntax, the registration handle can be passed as the single argument to this method.

It is safe to unregister from an event type while it is being emitted. However, any registrations removed during the current emission will still execute.

Specifying an event registration handle that has already been disposed of has no effect. Specifying an event type and observer (or listener function) that have no registrations has no effect.

Source: doc-js/pentaho/lang/IEventSource.jsdoc, line 131

Inherited From: pentaho.lang.EventSource#off

Parameters:
Name Default Value Summary
typeOrHandle : nonEmptyString | Array.<nonEmptyString> | pentaho.lang.IEventRegistrationHandle

The type or types of events, or an event registration handle to dispose of. When a string, it can be a comma-separated list of event types.

observer : pentaho.lang.IEventObserver | pentaho.lang.EventListener | pentaho.lang.EventListenerAsync

The event observer (or listener function). Required when typeOrHandle is not an event registration handle; ignored, otherwise.

See also:  pentaho.lang.IEventSource#on

Implements:
on(type, observer, keyArgs) : pentaho.lang.IEventRegistrationHandle

Registers an observer (or listener function) for an event(s) of a given type(s).

Optionally, a listening priority may be specified to adjust the order by which an observer is notified, relative to other listeners.

Note that if an observer is registered more than once to the same event type, a new registration is created each time and its listeners will be called once per registration.

It is safe to register for an event type while it is being emitted. However, new registrations are only taken into account in subsequent emissions.

When type represents multiple event types, the returned event registration handle is a composite registration for all of the event types.

This method is compatible with the dojo/on API.

Source: doc-js/pentaho/lang/IEventSource.jsdoc, line 90

Inherited From: pentaho.lang.EventSource#on

Parameters:
Name Default Value Summary
type : nonEmptyString | Array.<nonEmptyString>

The type or types of events. When a string, it can be a comma-separated list of event types.

observer : pentaho.lang.IEventObserver | pentaho.lang.EventListener | pentaho.lang.EventListenerAsync

The event observer (or listener function).

keyArgs : object
 
Optional

Keyword arguments.

Parameters:
Name Default Value Summary
priority : number
 
Optional
0

The listening priority. Higher priority observers are notified of an event before any lower priority observers. The priority can be set to -Infinity or Infinity. In case two observers are assigned the same priority, the registration order determines which is notified first.

Returns:
Name Description
pentaho.lang.IEventRegistrationHandle

An event registration handle that can be used for later removal.

See also:  pentaho.lang.IEventSource#off

path(steps, sloppy) : pentaho.type.Value | Nully

Gets the value of a property/index/key path based on the current complex.

When called with no arguments, or with an empty steps array argument, this complex value is returned.

When a step, on a complex value, is not a defined property and sloppy is true, undefined is returned.

Value null is returned when a step, in steps:

  1. On a list value, is an element index that is out of range
  2. On a list value, is an element key that is not present
  3. On a complex value, a property has value null.

This method supports two signatures. When the first argument is an array, it is the steps array, and the second argument is the optional sloppy argument:

var value;

// Strict
value = complex.path(["a", "b", 1]);

// Sloppy
value = complex.path(["a", "b", 1], true);

Otherwise, the method behaves as if sloppy were false, and each argument is a step of the desired path:

var value;

value = complex.path(); // -> null

value = complex.path("a", "b", 1);

Source: javascript/web/pentaho/type/complex.js, line 388

Inherited From: pentaho.type.Complex#path

Parameters:
Name Default Value Summary
steps : Array.<(string | number | !pentaho.type.Property.Type)>

The property/index/key path steps.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
pentaho.type.Value | Nully

The requested value, or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a step, on a complex value, is not a defined property.

set(name, valueSpec)

Sets the value of a property.

Source: javascript/web/pentaho/type/complex.js, line 419

Inherited From: pentaho.type.Complex#set

Parameters:
Name Default Value Summary
name : nonEmptyString | pentaho.type.Property.Type

The property name or type object.

valueSpec : any
 
Optional
null

A value specification.

Fires: event:will:change , event:did:change , event:rejected:change

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

TypeError

When property is read-only.

toJSON() : UJsonValue

Creates a top-level JSON specification that describes this instance.

Attributes which do not have a JSON-compatible specification are omitted. Specifically, for inline types, attributes with a function value are not supported.

This method simply calls pentaho.type.Instance#toSpec with argument keyArgs.isJson as true and exists for seamless integration with JavaScript's JSON.stringify method.

Source: javascript/web/pentaho/type/instance.js, line 206

Inherited From: pentaho.type.Instance#toJSON

Returns:
Name Description
UJsonValue

A JSON-compatible specification.

See also:  pentaho.type.Instance#toSpec

Implements:
toSpec(keyArgs) : pentaho.type.spec.UInstance

Creates a specification that describes this value.

If an ambient specification context, currently exists, it is used to manage the serialization process. Otherwise, one is created and set as current. Then, the actual work is delegated to pentaho.type.Instance#toSpecInContext.

Source: javascript/web/pentaho/type/value.js, line 200

Inherited From: pentaho.type.Value#toSpec

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

The keyword arguments object. Passed to every value and type serialized within this scope.

Please see the documentation of value subclasses for information on additional, supported keyword arguments.

Parameters:
Name Default Value Summary
isJson : boolean
 
Optional
false

Generates a JSON-compatible specification. Attributes which do not have a JSON-compatible specification are omitted.

declaredType : pentaho.type.Type
 
Optional

The base type of this value's storage location. If the value does not have this exact type, its inline type property must be included in the specification. Otherwise, it can be omitted. When unspecified, the inline type property is only included if forceType is true.

forceType : boolean
 
Optional
false

Forces inclusion of the inline type property, _, in the specification.

omitFormatted : boolean
 
Optional
false

Omits the formatted value on Simple values' specifications.

preferPropertyArray : boolean
 
Optional
false

Indicates that, if possible, array form is used for Complex values' specifications.

The array form of a complex value cannot be used when its type must be inlined.

includeDefaults : boolean
 
Optional
false

When true, all of the properties of Complex values are serialized. When false, the default, only properties whose value is different from their default value are serialized.

Only applies to complex values that are serialized in object form. In array form, all of the properties of complex values are serialized independently of their value.

omitProps : Object
 
Optional

An object whose own property names with a truthy value are the names of the properties of the current complex type to omit from the serialization.

Only applies when a complex is output in object form. In array form, all properties are output whatever their value.

This argument only applies to complex values and is not passed through to the values of their properties.

Returns:
Name Description
pentaho.type.spec.UInstance

A specification of this value.

toSpecInContext(keyArgs) : any

Creates a specification that describes this instance.

Source: javascript/web/pentaho/type/instance.js, line 186

Overrides: pentaho.type.Complex#toSpecInContext

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

The keyword arguments' object. Passed to every instance and type serialized within this scope.

Please see the documentation of subclasses for information on additional, supported keyword arguments.

Returns:
Name Description
any

A specification of this instance.

See also:  pentaho.type.Instance#toSpec

update() : Promise

Updates the view to match its model's latest state.

When isAutoUpdate is true, any change to the view's model automatically triggers a view update by calling this method.

The update operation is generally asynchronous. Even if the view implementation completes its update synchronously, the completion is only advertised asynchronously, through the emission of one of the events did:update or rejected:update and the resolution of the returned promise.

The isUpdating property is true while the update operation is considered in progress, a period during which calling update again returns the same promise that was returned by the initial update call.

If the view is not currently updating and is also not dirty, then calling update immediately returns a fulfilled promise.

Otherwise, by this time, isUpdating will be true, and the update operation proceeds to the Will phase.

Will phase

Initially, the _updateWill method is called, which by default emits the will:update event. Either the implementation or the event listeners are allowed to cancel the update or further modify the model.

If the update is canceled, the update is rejected with the cancel reason, and enters the Rejected phase.

Loop phase

If the update is not canceled, the view enters an update loop that only ends when either the view is up to date with the model (in which case surely isDirty will be false), or after some error occurs.

On each iteration of the update loop:

  1. If the model is invalid, the update loop ends with a validation error and then the update operation proceeds to the Rejected phase;
  2. Otherwise, the "best fit" partial update method is selected and called to update the view;
  3. If the selected update method throws an error or returns a rejected promise, the update loop ends and the update operation proceeds to the Rejected phase;
  4. If the view is not dirty anymore, the update loop ends with success;
  5. Repeat.

Over the view's lifetime, the very first "partial" update method that is selected is always the full update method: updateAll. Subsequent iterations may select _proper partial update methods, like _updateSize or _updateSelection.

Did phase

The isUpdating property will now be false.

The _onUpdateDid method is called, which by default emits the did:update event.

The implementation or the event listeners are allowed to modify the model and thus trigger new updates while in the did phase.

Lastly, the returned promise is fulfilled.

Rejected phase

The isUpdating property will now be false.

The _onUpdateRejected method is called, which by default emits the rejected:update event.

The implementation or the event listeners are allowed to modify the model and thus trigger new updates while in the rejected phase.

Lastly, the returned promise is rejected with the original error.

Source: javascript/web/pentaho/visual/base/view.js, line 528

Fires: event:will:update , event:rejected:update , event:did:update

Returns:
Name Description
Promise

A promise that is fulfilled when the visualization is completely updated or is rejected in case some error occurs.

See also:  pentaho.visual.base.View#isAutoUpdate , pentaho.visual.base.View#isUpdating , pentaho.visual.base.View#isDirty , pentaho.visual.base.View#_updateAll , pentaho.visual.base.View#_updateData , pentaho.visual.base.View#_updateSize , pentaho.visual.base.View#_updateSelection , pentaho.visual.base.View#_updateGeneral , pentaho.visual.base.View#_onUpdateWill , pentaho.visual.base.View#_onUpdateDid , pentaho.visual.base.View#_onUpdateRejected

validate() : Array.<!pentaho.type.ValidationError>

Determines if this complex value is a valid instance of its type.

The default implementation validates each property's value against the property's type and collects and returns any reported errors. Override to complement with a type's specific validation logic.

You can use the error utilities in pentaho.type.Util to help in the implementation.

Source: javascript/web/pentaho/type/complex.js, line 736

Inherited From: pentaho.type.Complex#validate

Returns:
Name Description
Array.<!pentaho.type.ValidationError> | null

A non-empty array of errors or null.

See also:  pentaho.type.Value#isValid