Skip to main content
Pentaho Documentation

SelectType

pentaho.visual.action. SelectType

The type class of pentaho.visual.action.Select.

Extends

Constructor

Name Description
new SelectType()

Members

Name Description
_isLabelSet : boolean
Protected

Gets a value that indicates if the label is locally set.

alias : nonEmptyString

Gets the alias for the identifier of this type.

ancestor : pentaho.type.Type

Gets the parent type in the current type hierarchy, if any, or null.

application : object

Gets or sets the application attribute of this type.

category : nonEmptyString

Gets or sets the category associated with this type.

defaultSelectionMode : pentaho.visual.action.SelectionMode

Gets or sets the default selection mode of actions of this type.

defaultView : string

Gets or sets the default view for instances of this type.

defaultViewAbs : string

Gets the absolute view module identifier, if any.

description : nonEmptyString

Gets or sets the description of this type.

elementType : pentaho.type.Type

Gets the element type of this type.

hasDescendants : boolean

Gets a value that indicates if this type has any descendant types.

helpUrl : nonEmptyString

Gets or sets a URL pointing to documentation associated with this type.

id : nonEmptyString

Gets the identifier of this type.

inheritedStyleClasses : Array.<string>

Gets the style classes of this and any base types.

instance : pentaho.type.Instance

Gets the prototype of the instances of this type.

isAbstract : boolean

Gets a value that indicates if this type is abstract.

isAdvanced : boolean

Gets or sets the isAdvanced attribute of this type.

isBrowsable : boolean

Gets or sets the isBrowsable attribute of this type.

isComplex : boolean

Gets a value that indicates if this type is a complex type.

isContainer : boolean

Gets a value that indicates if this type is a list or a complex type.

isContinuous : boolean

Gets a value that indicates if this is a continuous type.

isElement : boolean

Gets a value that indicates if this type is an element type.

isEntity : boolean

Gets a value that indicates if this type is an entity type.

isList : boolean

Gets a value that indicates if this type is a list type.

isProperty : boolean

Gets a value that indicates if this type is a property type.

isReadOnly : boolean

Gets a value that indicates whether this type, and all of the types of any contained values, cannot be changed, from the outside.

isRoot : boolean

Gets a value that indicates if this type is the root of its type hierarchy.

isSimple : boolean

Gets a value that indicates if this type is a simple type.

isSync : boolean

Gets a value that indicates if the action is synchronous.

isValue : boolean

Gets a value that indicates if this type is a value type.

label : nonEmptyString

Gets or sets the label of this type.

mixins : Array.<pentaho.type.Type>

Gets or sets the mixin types that are locally mixed into this type.

ordinal : number

Gets or sets the ordinal associated with this type.

root : pentaho.type.Type

Gets the root type of this type hierarchy.

shortId : nonEmptyString

Gets the short identifier of this type.

sourceId : nonEmptyString

Gets the source module identifier of this type.

styleClass : nonEmptyString

Gets or sets the CSS class associated with this type.

uid : number

Gets the unique identifier of this type.

Methods

Name Description
_assertNoSubtypesAttribute(attributeName)
Protected

Asserts that the type has no subtypes and that as such the given attribute can be set.

_fillSpecInContext(spec, keyArgs) : boolean
Protected

Fills the given specification with this type's attributes' local values, and returns whether any attribute was actually added.

_getLabelDefault() : string
Protected

Gets the default label to use when the label is not set.

_init(spec, keyArgs) : object
Protected

Performs initialization tasks that take place before the instance is extended with its specification.

_normalizeInstanceSpec(instSpec) : any
Protected

Actually normalizes a given non-Nully value specification.

_postInit(spec, keyArgs)
Protected

Performs initialization tasks that take place after the instance is extended with its specification.

_toSpecInContextCore(keyArgs) : pentaho.type.spec.IType
Protected

Called to actually create a specification of this anonymous type, when it is the first time that this type occurs in the ambient specification context.

areEqual(valueA, valueB) : boolean

Gets a value that indicates if two given values are considered equal.

areEqualContent(valueA, valueB) : boolean

Gets a value that indicates if two values are equal and content-equal.

areEqualContentElements(listA, listB) : boolean

Gets a value that indicates if all of the elements of two lists of the same type are content-equal.

buildSourceRelativeId(id) : string

Builds an absolute module identifier from one that is relative to the type's source location.

compareElements(valueA, valueB) : number

Compares two element values according to their order.

create(instSpec, instKeyArgs) : pentaho.type.Instance

Creates or resolves an instance of this type given an instance reference.

createAsync(instSpec, instKeyArgs) : Promise.<pentaho.type.Instance>

Creates or resolves an instance of this type, asynchronously, given an instance reference.

createLike(value, config) : pentaho.type.Element

Creates a value of this type based on a given value except with a given configuration applied.

hasNormalizedInstanceSpecKeyData(instSpec) : boolean

Gets a value that indicates if a given normalized value specification has any key information.

is(value) : boolean

Determines if a value is an instance of this type.

isSubtypeOf(superType) : boolean

Determines if this is a subtype of another.

normalizeInstanceSpec(instSpec) : object

Normalizes a given value specification.

to(value, keyArgs) : pentaho.type.Instance

Converts a value to an instance of this type, if it is not one already.

toJSON() : JsonValue

Creates a JSON specification that describes this type.

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

Creates a specification that describes this type.

toSpecInContext(keyArgs) : pentaho.type.spec.TypeReference

Creates a specification that describes this type.

toString() : string

Returns a textual representation suitable to identify this type in an error message.

Constructor Details

new SelectType()

Source: javascript/web/pentaho/visual/action/Select.js, line 32

Members Details

_isLabelSet: boolean
Protected

Gets a value that indicates if the label is locally set.

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

Overrides: pentaho.visual.action.mixins.PositionedType#_isLabelSet

alias: nonEmptyString

Gets the alias for the identifier of this type.

The alias of a type can only be specified when extending the ancestor type.

This attribute is not inherited.

When unspecified, defaults to null.

Source: javascript/web/pentaho/type/InstanceType.js, line 542

Overrides: pentaho.visual.action.mixins.PositionedType#alias

See also: pentaho.type.Type#id

ancestor: pentaho.type.Type

Gets the parent type in the current type hierarchy, if any, or null.

The root type returns null.

Source: javascript/web/pentaho/type/InstanceType.js, line 268

Overrides: pentaho.visual.action.mixins.PositionedType#ancestor

See also: pentaho.type.Type#root , pentaho.type.Type#hasDescendants

application: object

Gets or sets the application attribute of this type.

The application property serves as a collection of properties specific to the container application that can be modified via the Configuration Service.

Setting this to a Nully value will have no effect.

Source: javascript/web/pentaho/type/InstanceType.js, line 697

Overrides: pentaho.visual.action.mixins.PositionedType#application

category: nonEmptyString

Gets or sets the category associated with this type.

The category is used primarily to group similar types (or instances of) in a user interface.

Attempting to set to a non-string value type implicitly converts the value to a string before assignment.

Setting this to undefined causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where the attribute is null.

Setting this to null or to an empty string clears the attribute and sets it to null, thus ignoring any inherited value.

Source: javascript/web/pentaho/type/InstanceType.js, line 766

Overrides: pentaho.visual.action.mixins.PositionedType#category

See also: pentaho.type.Type#isBrowsable , pentaho.type.Type#ordinal

defaultSelectionMode: pentaho.visual.action.SelectionMode

Gets or sets the default selection mode of actions of this type.

The default value is pentaho.visual.action.SelectionModes#replace.

When set to a Nully value, the default value is assumed.

Can be set to the name of one of the standard selection modes, SelectionModes, to assume the corresponding selection mode function.

Source: javascript/web/pentaho/visual/action/Select.js, line 71

defaultView: string

Gets or sets the default view for instances of this type.

The identifier of the view's AMD module. If the identifier is relative, it is relative to sourceId.

Setting this to undefined causes the default view to be inherited from the ancestor type, except for the root type, Instance.type (which has no ancestor), where the attribute is null.

Setting this to a falsy value (like null or an empty string), clears the value of the attribute and sets it to null, ignoring any inherited value.

Source: javascript/web/pentaho/type/InstanceType.js, line 1015

Overrides: pentaho.visual.action.mixins.PositionedType#defaultView

See also: pentaho.type.Type#buildSourceRelativeId

defaultViewAbs: string

Gets the absolute view module identifier, if any.

A default view exists if property pentaho.type.Type#defaultView has a non-null value.

Source: javascript/web/pentaho/type/InstanceType.js, line 1050

Overrides: pentaho.visual.action.mixins.PositionedType#defaultViewAbs

See also: pentaho.type.Type#defaultView

description: nonEmptyString

Gets or sets the description of this type.

Attempting to set to a non-string value type implicitly converts the value to a string before assignment.

Setting this to undefined causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where this attribute is null.

Setting this to null or to an empty string clears the attribute and sets it to null, ignoring any inherited value.

Source: javascript/web/pentaho/type/InstanceType.js, line 726

Overrides: pentaho.visual.action.mixins.PositionedType#description

elementType: pentaho.type.Type

Gets the element type of this type.

If this type is a list type, returns its of attribute. Otherwise, this type is an element type, and it returns itself.

Source: javascript/web/pentaho/type/InstanceType.js, line 423

Overrides: pentaho.visual.action.mixins.PositionedType#elementType

See also: pentaho.type.Type#isList , pentaho.type.Type#isElement , pentaho.type.ListType#of

hasDescendants: boolean

Gets a value that indicates if this type has any descendant types.

Source: javascript/web/pentaho/type/InstanceType.js, line 281

Overrides: pentaho.visual.action.mixins.PositionedType#hasDescendants

See also: pentaho.type.Type#ancestor

helpUrl: nonEmptyString

Gets or sets a URL pointing to documentation associated with this type.

Attempting to set to a non-string value type implicitly converts the value to a string before assignment.

Setting this to undefined causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where the attribute is null.

Setting this to null or to an empty string clears the attribute and sets it to null, ignoring any inherited value.

Source: javascript/web/pentaho/type/InstanceType.js, line 802

Overrides: pentaho.visual.action.mixins.PositionedType#helpUrl

id: nonEmptyString

Gets the identifier of this type.

The identifier of a type can only be specified when extending the ancestor type.

The identifier is only defined for types which have an associated AMD/RequireJS module. However, note that all have a pentaho.type.Type#uid.

This attribute is not inherited.

When unspecified, defaults to the value of sourceId.

Source: javascript/web/pentaho/type/InstanceType.js, line 452

Overrides: pentaho.visual.action.mixins.PositionedType#id

See also: pentaho.type.Type#sourceId

inheritedStyleClasses: Array.<string>

Gets the style classes of this and any base types.

The returned array should not be modified.

Source: javascript/web/pentaho/type/InstanceType.js, line 935

Overrides: pentaho.visual.action.mixins.PositionedType#inheritedStyleClasses

instance: pentaho.type.Instance

Gets the prototype of the instances of this type.

Source: javascript/web/pentaho/type/InstanceType.js, line 293

Overrides: pentaho.visual.action.mixins.PositionedType#instance

isAbstract: boolean

Gets a value that indicates if this type is abstract.

This attribute can only be set once, upon the type definition.

Source: javascript/web/pentaho/type/InstanceType.js, line 565

Default Value: false

Overrides: pentaho.visual.action.mixins.PositionedType#isAbstract

isAdvanced: boolean

Gets or sets the isAdvanced attribute of this type.

Types with isAdvanced attributes set to false are typically immediately accessible to the user. An advanced type typically escapes the expected flow of utilization, yet it is sufficiently relevant to be shown in a user interface.

Setting this to a Nully value causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where the attribute is false.

Source: javascript/web/pentaho/type/InstanceType.js, line 869

Overrides: pentaho.visual.action.mixins.PositionedType#isAdvanced

See also: pentaho.type.Type#isBrowsable

isBrowsable: boolean

Gets or sets the isBrowsable attribute of this type.

Browsable types are exposed to the end user. Set this attribute to false to prevent exposing the type in a user interface.

Setting this to a Nully value causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where the attribute is true.

Source: javascript/web/pentaho/type/InstanceType.js, line 835

Overrides: pentaho.visual.action.mixins.PositionedType#isBrowsable

isComplex: boolean

Gets a value that indicates if this type is a complex type.

Source: javascript/web/pentaho/type/InstanceType.js, line 377

Overrides: pentaho.visual.action.mixins.PositionedType#isComplex

isContainer: boolean

Gets a value that indicates if this type is a list or a complex type.

Source: javascript/web/pentaho/type/InstanceType.js, line 342

Overrides: pentaho.visual.action.mixins.PositionedType#isContainer

isContinuous: boolean

Gets a value that indicates if this is a continuous type.

A non-continuous type is said to be categorical.

The default implementation returns false.

The types pentaho.type.Number and pentaho.type.Date are known to be continuous.

Source: javascript/web/pentaho/type/InstanceType.js, line 405

Overrides: pentaho.visual.action.mixins.PositionedType#isContinuous

isElement: boolean

Gets a value that indicates if this type is an element type.

Source: javascript/web/pentaho/type/InstanceType.js, line 366

Overrides: pentaho.visual.action.mixins.PositionedType#isElement

isEntity: boolean

Gets a value that indicates if this type is an entity type.

An entity type is an element type that represents a business entity whose identity is reflected by the $key property.

Simple types are inherently entity types. Complex types can set this property to true, and override the $key property, to become entity types.

Source: javascript/web/pentaho/type/Value.js, line 359

Overrides: pentaho.visual.action.mixins.PositionedType#isEntity

See also: pentaho.type.Value#$key

isList: boolean

Gets a value that indicates if this type is a list type.

Source: javascript/web/pentaho/type/InstanceType.js, line 354

Overrides: pentaho.visual.action.mixins.PositionedType#isList

isProperty: boolean

Gets a value that indicates if this type is a property type.

Source: javascript/web/pentaho/type/InstanceType.js, line 329

Overrides: pentaho.visual.action.mixins.PositionedType#isProperty

isReadOnly: boolean

Gets a value that indicates whether this type, and all of the types of any contained values, cannot be changed, from the outside.

Simple types are inherently read-only.

A Complex type can be marked read-only when defined. All of the properties of a read-only complex type are implicitly marked read-only. When the valueType of a property is an element type, it must be a read-only type. When the valueType of a property is a list type, then its element type must be read-only.

List types are never, a priori, and directly read-only. However, if a property of a complex type is read-only and has a list value type, then the value of the property itself, the list instance, is marked read-only.

The default implementation returns false.

Source: javascript/web/pentaho/type/Value.js, line 387

Overrides: pentaho.visual.action.mixins.PositionedType#isReadOnly

isRoot: boolean

Gets a value that indicates if this type is the root of its type hierarchy.

Source: javascript/web/pentaho/type/InstanceType.js, line 252

Overrides: pentaho.visual.action.mixins.PositionedType#isRoot

See also: pentaho.type.Type#root

isSimple: boolean

Gets a value that indicates if this type is a simple type.

Source: javascript/web/pentaho/type/InstanceType.js, line 389

Overrides: pentaho.visual.action.mixins.PositionedType#isSimple

isSync: boolean

Gets a value that indicates if the action is synchronous.

Source: javascript/web/pentaho/type/action/Base.js, line 70

Overrides: pentaho.visual.action.mixins.PositionedType#isSync

isValue: boolean

Gets a value that indicates if this type is a value type.

Source: javascript/web/pentaho/type/InstanceType.js, line 317

Overrides: pentaho.visual.action.mixins.PositionedType#isValue

label: nonEmptyString

Gets or sets the label of this type.

When set to a non-Nully and non-String value, the value is first replaced by the result of calling its toString method.

When set to an empty string or a nully value, the attribute value is reset.

When reset, the attribute assumes its default value (except on the top-root type, Instance.type, in which case it has no effect).

The default value is the inherited value.

The initial value of the attribute on the top-root type is "instance".

Source: javascript/web/pentaho/type/InstanceType.js, line 640

Overrides: pentaho.visual.action.mixins.PositionedType#label

mixins: Array.<pentaho.type.Type>

Gets or sets the mixin types that are locally mixed into this type.

Can be set to either type identifiers, instance classes or type instances and arrays thereof.

The attributes defined by the added mixin types become available for extension/configuration on this type. When extending, mixins are always applied first.

When set to a Nully value, nothing is done.

Source: javascript/web/pentaho/type/InstanceType.js, line 584

Overrides: pentaho.visual.action.mixins.PositionedType#mixins

ordinal: number

Gets or sets the ordinal associated with this type.

The ordinal is used to disambiguate the order with which a type (or an instance of it) is shown in a user interface.

Setting this to a Nully value causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where the attribute is 0.

Source: javascript/web/pentaho/type/InstanceType.js, line 969

Overrides: pentaho.visual.action.mixins.PositionedType#ordinal

See also: pentaho.type.Type#isBrowsable , pentaho.type.Type#category

root: pentaho.type.Type

Gets the root type of this type hierarchy.

Even though the ultimate type root of types defined in this system is Instance, the system is designed to represent multiple type hierarchies, each representing concrete, more meaningful concepts.

When deriving a type from Instance, it can be marked as the root of a type hierarchy, by specifying the isRoot keyword argument to extend.

Typically, root types are immediate subtypes of Instance. However, this is not enforced and it is up to the developer to decide at what level a practical, meaningful type root arises.

For example, Value is the root of value types. However, Property, also an immediate subtype of Instance, is not considered a root type. It is the immediate subtypes of Property (each root property within a complex type) which are considered roots. This aligns with users expectations of what an attribute named root in a property type should mean.

Source: javascript/web/pentaho/type/InstanceType.js, line 209

Overrides: pentaho.visual.action.mixins.PositionedType#root

See also: pentaho.type.Type#isRoot , pentaho.type.Type#ancestor

shortId: nonEmptyString

Gets the short identifier of this type.

The short identifier of a type is equal to its alias, provided it is defined. Otherwise, it is equal to the identifier.

Source: javascript/web/pentaho/type/InstanceType.js, line 497

Overrides: pentaho.visual.action.mixins.PositionedType#shortId

See also: pentaho.type.Type#id , pentaho.type.Type#alias

sourceId: nonEmptyString

Gets the source module identifier of this type.

The source identifier is the module identifier of the actual AMD/RequireJS module that provides the type and may be different from the identifier when an AMD package or custom mapping is configured for the module.

The source identifier is used to resolve module identifiers relative to the source module, as is the case with the pentaho.type.Type#defaultView attribute.

The source identifier of a type can only be specified when extending the ancestor type.

This attribute is not inherited.

When unspecified, defaults to the value of id.

Source: javascript/web/pentaho/type/InstanceType.js, line 482

Overrides: pentaho.visual.action.mixins.PositionedType#sourceId

See also: pentaho.type.Type#id , pentaho.type.Type#defaultView

styleClass: nonEmptyString

Gets or sets the CSS class associated with this type.

This attribute is typically used to associate an icon with a type.

Attempting to set to a non-string value type implicitly converts the value to a string before assignment.

An empty string or null clears the property value.

Setting to undefined, makes the property assume its default value.

The default value of a type with an id is the identifier converted to snake-case, plus special characters like \, /, _, . and spaces are converted to: a dash (). For example: "pentaho/visual/models/heatGrid" would have a default styleClass of: "pentaho-visual-ccc-heat-grid". The default value of an anonymous type is null.

Source: javascript/web/pentaho/type/InstanceType.js, line 913

Overrides: pentaho.visual.action.mixins.PositionedType#styleClass

uid: number

Gets the unique identifier of this type.

Unique type identifiers are auto-generated in each session.

Note that even anonymous types (those whose pentaho.type.Type#id is null) have a unique identifier.

This attribute is not inherited.

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

Overrides: pentaho.visual.action.mixins.PositionedType#uid

Methods Details

_assertNoSubtypesAttribute(attributeName)
Protected

Asserts that the type has no subtypes and that as such the given attribute can be set.

Source: javascript/web/pentaho/type/InstanceType.js, line 1211

Overrides: pentaho.visual.action.mixins.PositionedType#_assertNoSubtypesAttribute

Parameters:
Name Default Value Summary
attributeName : string

The name of the attribute being set.

Throws:
Name Description
pentaho.lang.OperationInvalidError

When setting and the type already has subtypes.

_fillSpecInContext(spec, keyArgs) : boolean
Protected

Fills the given specification with this type's attributes' local values, and returns whether any attribute was actually added.

This method requires that there currently exists an ambient specification context.

This method does not add the special id and base attributes to the specification.

Source: javascript/web/pentaho/type/InstanceType.js, line 1414

Overrides: pentaho.visual.action.mixins.PositionedType#_fillSpecInContext

Parameters:
Name Default Value Summary
spec : Object

The specification to be filled.

keyArgs : Object
Optional

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

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

Returns:
Name Description
boolean

Returns true if any attribute was added; false, otherwise.

See also: pentaho.type.Instance#toSpecInContext

_getLabelDefault() : string
Protected

Gets the default label to use when the label is not set.

Source: javascript/web/pentaho/type/InstanceType.js, line 668

Overrides: pentaho.visual.action.mixins.PositionedType#_getLabelDefault

Returns:
Name Description
string | null

The default label or an empty value.

_init(spec, keyArgs) : object
Protected

Performs initialization tasks that take place before the instance is extended with its specification.

This method is typically overridden to block the inheritance of certain attributes.

Source: javascript/web/pentaho/type/InstanceType.js, line 165

Overrides: pentaho.visual.action.mixins.PositionedType#_init

Parameters:
Name Default Value Summary
spec : object

The specification of this type.

keyArgs : Object

Keyword arguments.

Parameters:
Name Default Value Summary
instance : pentaho.type.Instance

The prototype of the Instance class associated with this type.

isRoot : boolean
Optional
false

If true, creates a root type.

Returns:
Name Description
object | null

A specification to use instead of the given spec argument to extend the type, or undefined, to use the given specification.

_normalizeInstanceSpec(instSpec) : any
Protected

Actually normalizes a given non-Nully value specification.

Override this method to improve the Type API support for types that have a non-generic serialization format.

The default implementation simply returns the given value specification.

Source: javascript/web/pentaho/type/Value.js, line 508

Overrides: pentaho.visual.action.mixins.PositionedType#_normalizeInstanceSpec

Parameters:
Name Default Value Summary
instSpec : any

The value specification.

Returns:
Name Description
any

The normalized value specification.

See also: pentaho.type.ValueType#normalizeInstanceSpec

_postInit(spec, keyArgs)
Protected

Performs initialization tasks that take place after the instance is extended with its specification.

This method is typically overridden to validate or default the values of the attributes.

Source: javascript/web/pentaho/type/InstanceType.js, line 185

Overrides: pentaho.visual.action.mixins.PositionedType#_postInit

Parameters:
Name Default Value Summary
spec : Object

The specification of this type.

keyArgs : Object

Keyword arguments.

_toSpecInContextCore(keyArgs) : pentaho.type.spec.IType
Protected

Called to actually create a specification of this anonymous type, when it is the first time that this type occurs in the ambient specification context.

Source: javascript/web/pentaho/type/InstanceType.js, line 1363

Overrides: pentaho.visual.action.mixins.PositionedType#_toSpecInContextCore

Parameters:
Name Default Value Summary
keyArgs : object

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

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

Returns:
Name Description
pentaho.type.spec.IType

A specification of this type.

See also: pentaho.type.Type#_toSpecInContextCore

areEqual(valueA, valueB) : boolean

Gets a value that indicates if two given values are considered equal.

Two values are considered equal if they represent the same real-world entity.

The execution proceeds as follows:

  1. If either of the values is Nully, then they're equal only if both are Nully;
  2. Otherwise, execution is delegated to the first value's pentaho.type.Value#equals method.

Source: javascript/web/pentaho/type/Value.js, line 411

Overrides: pentaho.visual.action.mixins.PositionedType#areEqual

Parameters:
Name Default Value Summary
valueA : pentaho.type.Value | undefined

The first value.

valueB : pentaho.type.Value | undefined

The second value.

Returns:
Name Description
boolean

true if two values are equal; false, otherwise.

See also: pentaho.type.Value#$key , pentaho.type.Value#equals

areEqualContent(valueA, valueB) : boolean

Gets a value that indicates if two values are equal and content-equal.

Checks that both values are equals and equalsContent.

Source: javascript/web/pentaho/type/Value.js, line 431

Overrides: pentaho.visual.action.mixins.PositionedType#areEqualContent

Parameters:
Name Default Value Summary
valueA : any

The first value.

valueB : any

The second value.

Returns:
Name Description
boolean

true if two values are considered equal and content-equal; false, otherwise.

areEqualContentElements(listA, listB) : boolean

Gets a value that indicates if all of the elements of two lists of the same type are content-equal.

Source: javascript/web/pentaho/type/Value.js, line 445

Overrides: pentaho.visual.action.mixins.PositionedType#areEqualContentElements

Parameters:
Name Default Value Summary
listA : pentaho.type.List

One list instance.

listB : pentaho.type.List

Another list instance.

Returns:
Name Description
boolean

true if the elements of the two lists are content-equal; false, otherwise.

buildSourceRelativeId(id) : string

Builds an absolute module identifier from one that is relative to the type's source location.

Relative module identifiers start with a . and do not end with ".js". For example, "./View" and "../View", but not ./View.js.

Absolute identifiers are returned without modification.

Source: javascript/web/pentaho/type/InstanceType.js, line 519

Overrides: pentaho.visual.action.mixins.PositionedType#buildSourceRelativeId

Parameters:
Name Default Value Summary
id : string

A module identifier.

Returns:
Name Description
string

An absolute module identifier.

Throws:
Name Description
OperationInvalidError

When id is a relative identifier and this type is anonymous, or when id refers to an inexistent ascendant location.

See also: pentaho.type.Type#sourceId

compareElements(valueA, valueB) : number

Compares two element values according to their order.

Execution proceeds as follows:

  1. If both values are Nully, they have the same order.
  2. Otherwise, if the first value is Nully (and the second is not), it is before the second one.
  3. Othewise, the operation is delegated to the first value's pentaho.type.Element#compare method.

Source: javascript/web/pentaho/type/Element.js, line 296

Overrides: pentaho.visual.action.mixins.PositionedType#compareElements

Parameters:
Name Default Value Summary
valueA : pentaho.type.Element

The first element value.

valueB : pentaho.type.Element

The second element value.

Returns:
Name Description
number

-1 if valueA is before valueB; 1 is valueA is after valueB; 0, otherwise.

create(instSpec, instKeyArgs) : pentaho.type.Instance

Creates or resolves an instance of this type given an instance reference.

This method delegates to InstancesContainer#get with this type as the typeBase argument.

Source: javascript/web/pentaho/type/InstanceType.js, line 1143

Overrides: pentaho.visual.action.mixins.PositionedType#create

Parameters:
Name Default Value Summary
instSpec : pentaho.type.Instance | pentaho.type.spec.Instance
Optional

An instance or instance specification.

instKeyArgs : Object
Optional

The keyword arguments passed to the instance constructor, when one is created.

Returns:
Name Description
pentaho.type.Instance

The created instance or the resolved instance (possibly null).

Throws:
Name Description
Error

Other errors, as documented in: InstancesContainer#get.

See also: pentaho.type.Type#createAsync , pentaho.type.Type#to , pentaho.type.Type#is

Examples

Create a complex instance from a specification that contains the type inline.

require(["pentaho/type/Instance", "pentaho/type/standard"], function(Instance) {

 var product = Instance.type.create({
 _: {
 props: ["id", "name", {name: "price", valueType: "number"}]
 },

 id: "mpma",
 name: "Principia Mathematica",
 price: 1200
 });

 // ...

});

Create a list instance from a specification that contains the type inline.

require(["pentaho/type/Instance", "pentaho/type/standard"], function(Instance) {

 var productList = Instance.type.create({
 _: [{
 props: ["id", "name", {name: "price", valueType: "number"}]
 }],

 d: [
 {id: "mpma", name: "Principia Mathematica", price: 1200},
 {id: "flot", name: "The Laws of Thought", price: 500}
 ]
 });

 // ...

});

Create an instance from a specification that does not contain the type inline.

require(["pentaho/type/Instance", "pentaho/type/standard"], function(Instance) {

 var ProductList = Instance.type.create([{
 props: [
 "id",
 "name",
 {name: "price", valueType: "number"}
 ]
 }]);

 // Provide the default type, in case the instance spec doesn't provide one.
 var productList = ProductList.type.create([
 {id: "mpma", name: "Principia Mathematica", price: 1200},
 {id: "flot", name: "The Laws of Thought", price: 500}
 ]);

 // ...

});
createAsync(instSpec, instKeyArgs) : Promise.<pentaho.type.Instance>

Creates or resolves an instance of this type, asynchronously, given an instance reference.

This method delegates to InstancesContainer#getAsync with this type as the typeBase argument.

Source: javascript/web/pentaho/type/InstanceType.js, line 1164

Overrides: pentaho.visual.action.mixins.PositionedType#createAsync

Parameters:
Name Default Value Summary
instSpec : pentaho.type.Instance | pentaho.type.spec.Instance
Optional

An instance or instance specification.

instKeyArgs : Object
Optional

The keyword arguments passed to the instance constructor, when one is created.

Returns:
Name Description
Promise.<pentaho.type.Instance>

A promise to the created instance or resolved instance (possibly null).

See also: pentaho.type.Type#create

createLike(value, config) : pentaho.type.Element

Creates a value of this type based on a given value except with a given configuration applied.

If this is an entity type, it can only be called if either the given configuration does not contain entity key information or if it contains the same entity key information as the given value.

The default implementation obtains the specification of the given value, merges it with the given configuration, and creates a new value from the resulting specification.

Source: javascript/web/pentaho/type/Element.js, line 367

Overrides: pentaho.visual.action.mixins.PositionedType#createLike

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

The value to configure.

config : any

The configuration

Returns:
Name Description
pentaho.type.Element

The new value.

See also: pentaho.type.ValueType#isEntity , pentaho.type.Value#$key , pentaho.type.Type#hasNormalizedInstanceSpecKeyData

hasNormalizedInstanceSpecKeyData(instSpec) : boolean

Gets a value that indicates if a given normalized value specification has any key information.

The default implementation returns false.

Source: javascript/web/pentaho/type/Value.js, line 525

Overrides: pentaho.visual.action.mixins.PositionedType#hasNormalizedInstanceSpecKeyData

Parameters:
Name Default Value Summary
instSpec : object

The entity normalized specification.

Returns:
Name Description
boolean

true if the specification contains key information; false, otherwise.

See also: pentaho.type.ValueType#isEntity , pentaho.type.ValueType#normalizeInstanceSpec , pentaho.type.Value#$key

is(value) : boolean

Determines if a value is an instance of this type.

Source: javascript/web/pentaho/type/InstanceType.js, line 1225

Overrides: pentaho.visual.action.mixins.PositionedType#is

Parameters:
Name Default Value Summary
value : any

The value to test.

Returns:
Name Description
boolean

true if the value is an instance of this type; false, otherwise.

isSubtypeOf(superType) : boolean

Determines if this is a subtype of another.

A type is considered a subtype of itself.

Source: javascript/web/pentaho/type/InstanceType.js, line 1237

Overrides: pentaho.visual.action.mixins.PositionedType#isSubtypeOf

Parameters:
Name Default Value Summary
superType : pentaho.type.Type

The candidate super-type.

Returns:
Name Description
boolean

true if this is a subtype of superType type; false, otherwise.

normalizeInstanceSpec(instSpec) : object

Normalizes a given value specification.

Usually, "deserialization" is handled in a type's constructor. However, for proper handling of the configure operation, the Type API needs to normalize new value specifications to decide whether it can configure operations an existing instance instead of constructing a new one. This, obviously, has to be done outside of a constructor.

For example, some complex types can serialize as a single string if only its main property is specified. In such cases, this method would return a normal, object, generic specification containing the given value as the value of the main property.

This method calls the _normalizeInstanceSpec when the specified value specification is not Nully.

Source: javascript/web/pentaho/type/Value.js, line 488

Overrides: pentaho.visual.action.mixins.PositionedType#normalizeInstanceSpec

Parameters:
Name Default Value Summary
instSpec : any

The value specification.

Returns:
Name Description
object | null

The normalized value specification or null

See also: pentaho.type.ValueType#_normalizeInstanceSpec

to(value, keyArgs) : pentaho.type.Instance

Converts a value to an instance of this type, if it is not one already.

If a Nully value is specified, null is returned.

Otherwise, if a given value is not already an instance of this type (checked using is), this method delegates the creation of an instance to create.

Source: javascript/web/pentaho/type/InstanceType.js, line 1258

Overrides: pentaho.visual.action.mixins.PositionedType#to

Parameters:
Name Default Value Summary
value : any

The value to convert.

keyArgs : Object
Optional

The keyword arguments passed to create, when a new instance is created.

Returns:
Name Description
pentaho.type.Instance | null

The converted value or null.

toJSON() : JsonValue

Creates a JSON specification that describes this type.

Attributes which do not have a JSON-compatible specification are omitted. Specifically, 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/InstanceType.js, line 1389

Overrides: pentaho.visual.action.mixins.PositionedType#toJSON

Returns:
Name Description
JsonValue

A JSON-compatible specification.

See also: pentaho.type.Instance#toSpec

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

Creates a specification that describes this type.

If an ambient specification context, currently exists, it is used to manage the serialization process. Otherwise, one is created and set as current.

This method creates a new pentaho.type.SpecificationScope for describing this type, and any other instances and types it references, and then delegates the actual work to pentaho.type.Type#toSpecInContext.

This method returns a reference to this type that is appropriate to be the value of an inline type property that is included on a specification of an instance of this type.

When a type has an identifier, its id (or its alias) is returned.

For anonymous types, a temporary, serialization-only identifier is generated. In the first occurrence in the given scope, that identifier is returned, within a full specification of the type, obtained by calling toSpecInContext. In following occurrences, only the previously used temporary identifier is returned.

Source: javascript/web/pentaho/type/InstanceType.js, line 1303

Overrides: pentaho.visual.action.mixins.PositionedType#toSpec

Parameters:
Name Default Value Summary
keyArgs : Object
Optional

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

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

Parameters:
Name Default Value Summary
isJson : boolean
Optional
false

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

Returns:
Name Description
pentaho.type.spec.TypeReference

A reference to this type.

See also: pentaho.type.Type#toSpecInContext , pentaho.type.Type#_fillSpecInContext

toSpecInContext(keyArgs) : pentaho.type.spec.TypeReference

Creates a specification that describes this type.

This method requires that there currently exists an ambient specification context.

This method handles the cases where this type has an identifier or it does not but a temporary identifier has already been assigned in the ambient specification context. Otherwise, execution delegates to _toSpecInContextCore.

Source: javascript/web/pentaho/type/InstanceType.js, line 1332

Overrides: pentaho.visual.action.mixins.PositionedType#toSpecInContext

Parameters:
Name Default Value Summary
keyArgs : Object
Optional

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

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

Returns:
Name Description
pentaho.type.spec.TypeReference

A reference to this type.

See also: pentaho.type.Type#toSpec

toString() : string

Returns a textual representation suitable to identify this type in an error message.

Source: javascript/web/pentaho/type/InstanceType.js, line 1474

Overrides: pentaho.visual.action.mixins.PositionedType#toString

Returns:
Name Description
string

A textual representation.