Data
pentaho.visual.action.Data
The visual.action.Data
class is the base class of action types which are performed on a subset of a dataset and whose target
is a View
.
The actual subset is determined by the data filter
property.
AMD Module
require(["pentaho/visual/action/data"], function(Data) { /* code goes here */ });
Extends
Constructor
Name | Description |
---|---|
new Data(spec) Abstract | Creates a data action instance given its specification. |
Classes
Name | Summary |
---|---|
Type | The base type class of data actions. |
Members
Name | Description |
---|---|
$isValid : | Determines if this value is a valid instance of its type. |
$key : | Gets the key of the value. |
$type : | Gets the type of this instance. |
_executor : Protected | Gets the executor to which the actual action execution is delegated. |
dataFilter : | Gets or sets the data filter of this action. |
description : | Gets or sets the description of this action. |
error : | Gets the reason for a rejected action execution, or |
isCanceled : | Gets a value that indicates if the action has been canceled. |
isCandidate : | Gets a value that indicates if the action is in a candidate state. |
isDone : | Gets a value that indicates if the action executed successfully. |
isEditable : | Gets a value that indicates if the action is editable. |
isExecuting : | Gets a value that indicates if the action is executing. |
isFailed : | Gets a value that indicates if the action has failed. |
isFinished : | Gets a value that indicates if the action has finished execution. |
isRejected : | Gets a value that indicates if the action has been rejected. |
label : | Gets or sets the label of this action. |
position : | Gets or sets the position where the action took place, in screen coordinates. |
promise : | Gets a promise for the result (or error) of this action's execution, if ever. |
result : | Gets the result of a successful action execution, if any. |
state : | Gets the current action state. |
target : | Gets the target view where the action is executing or has executed. |
Methods
Name | Description |
---|---|
_assertEditable() Protected | Asserts that the action is editable and throws an error if not. |
_configure(config) Protected | Configures this value with a given non-nully configuration. |
_doDefault() : Promise | Performs the default "action" of this action. |
_onPhaseDo() : Promise Protected | Called during the action's do phase. |
_onPhaseFinally() Protected | Called during the action's finally phase. |
_onPhaseInit() Protected | Called during the action's initialize phase. |
_onPhaseWill() Protected | Called during the action's will phase. |
_setTarget(target) Protected | Called to validate and set the action's target, upon execution. |
assertValid() | Ensures that the value is valid, and throws the first validation error if it is not. |
clone() : pentaho.type.Value | Creates a shallow clone of this value. |
configure(config) : pentaho.type.Value | Configures this value with a given configuration. |
done(result) : pentaho.type.action.Base | Called from an action observer to mark the action as being done, optionally given a result value. |
equals(other) : boolean | Determines if a given value, of the same type, represents the same entity. |
execute(target, executor) : pentaho.type.action.Base | Executes the action on a given target and, optionally, with a given executor, and does not wait for its outcome. |
executeAsync(target, executor) : Promise | Executes the action on a given target and, optionally, with a given executor, and waits for its outcome. |
reject(reason) : pentaho.type.action.Base | Called from an action observer to mark the action as rejected. |
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. |
validate() : Array.< | Determines if this value is a valid instance of its type. |
Constructor Details
new Data(spec) Abstract | ||||||
---|---|---|---|---|---|---|
Creates a data action instance given its specification. Source: javascript/web/pentaho/visual/action/data.js, line 71
|
Members Details
$isValid: |
---|
Determines if this value is a valid instance of its type. This attribute calls Source: javascript/web/pentaho/type/value.js, line 123 Inherited From: pentaho.type.Value#$isValid |
$key: |
---|
Gets the key of the value. The key of a value must identify it among values of the same concrete type. Two values of the same concrete type and with the same key represent the same entity. The default implementation returns the result of calling Source: javascript/web/pentaho/type/value.js, line 82 Inherited From: pentaho.type.Value#$key See also: pentaho.type.Value#equals , pentaho.type.Value.Type#areEqual |
$type: |
---|
Gets the type of this instance. Source: javascript/web/pentaho/type/value.js, line 246 Overrides: pentaho.visual.action.Base#$type |
_executor: Protected |
---|
Gets the executor to which the actual action execution is delegated. This property contains the value of the Source: javascript/web/pentaho/type/action/base.js, line 746 Inherited From: pentaho.type.action.Base#_executor |
dataFilter: |
---|
Gets or sets the data filter of this action. Can only be set while the action is in an When set to a filter specification, Source: javascript/web/pentaho/visual/action/data.js, line 91 |
description: |
---|
Gets or sets the description of this action. When not set to a non-empty local value, the description of the action type, Can only be set while the action is in an Source: javascript/web/pentaho/type/action/base.js, line 380 Inherited From: pentaho.type.action.Base#description |
error: |
---|
Gets the reason for a rejected action execution, or This property can only return a non-null value if Source: javascript/web/pentaho/type/action/base.js, line 464 Inherited From: pentaho.type.action.Base#error |
isCanceled: |
---|
Gets a value that indicates if the action has been canceled. Source: javascript/web/pentaho/type/action/base.js, line 510 Inherited From: pentaho.type.action.Base#isCanceled See also: pentaho.type.action.Base#isRejected |
isCandidate: |
---|
Gets a value that indicates if the action is in a candidate state. Source: javascript/web/pentaho/type/action/base.js, line 532 Inherited From: pentaho.type.action.Base#isCandidate |
isDone: |
---|
Gets a value that indicates if the action executed successfully. Source: javascript/web/pentaho/type/action/base.js, line 562 Inherited From: pentaho.type.action.Base#isDone See also: pentaho.type.action.Base#result |
isEditable: |
---|
Gets a value that indicates if the action is editable. An action is considered editable if its state is one of Source: javascript/web/pentaho/type/action/base.js, line 478 Inherited From: pentaho.type.action.Base#isEditable |
isExecuting: |
---|
Gets a value that indicates if the action is executing. An action is executing if its state is one of Source: javascript/web/pentaho/type/action/base.js, line 550 Inherited From: pentaho.type.action.Base#isExecuting See also: pentaho.type.action.Base#isCandidate , pentaho.type.action.Base#isFinished |
isFailed: |
---|
Gets a value that indicates if the action has failed. Source: javascript/web/pentaho/type/action/base.js, line 522 Inherited From: pentaho.type.action.Base#isFailed See also: pentaho.type.action.Base#isRejected |
isFinished: |
---|
Gets a value that indicates if the action has finished execution. An action has finished execution if its state is one of Source: javascript/web/pentaho/type/action/base.js, line 581 Inherited From: pentaho.type.action.Base#isFinished See also: pentaho.type.action.Base#isDone , pentaho.type.action.Base#isCanceled , pentaho.type.action.Base#isFailed |
isRejected: |
---|
Gets a value that indicates if the action has been rejected. An action is considered rejected if its state is one of Source: javascript/web/pentaho/type/action/base.js, line 498 Inherited From: pentaho.type.action.Base#isRejected See also: pentaho.type.action.Base#isCanceled , pentaho.type.action.Base#isFailed , pentaho.type.action.Base#isDone , pentaho.type.action.Base#isFinished , pentaho.type.action.Base#error |
label: |
---|
Gets or sets the label of this action. When not set to a non-empty local value, the label of the action type, Can only be set while the action is in an Source: javascript/web/pentaho/type/action/base.js, line 359 Inherited From: pentaho.type.action.Base#label |
position: |
---|
Gets or sets the position where the action took place, in screen coordinates. Can only be set while the action is in an Source: javascript/web/pentaho/visual/action/base.js, line 103 Inherited From: pentaho.visual.action.Base#position |
promise: |
---|
Gets a promise for the result (or error) of this action's execution, if ever. This promise can be requested anytime, before starting execution, during execution, or after finishing execution of this action. Also, it can be requested whether or not the action is The promise is fulfilled with the action's Source: javascript/web/pentaho/type/action/base.js, line 601 Inherited From: pentaho.type.action.Base#promise |
result: |
---|
Gets the result of a successful action execution, if any. This property can only return a non-undefined value if Source: javascript/web/pentaho/type/action/base.js, line 451 Inherited From: pentaho.type.action.Base#result |
state: |
---|
Gets the current action state. Source: javascript/web/pentaho/type/action/base.js, line 399 Inherited From: pentaho.type.action.Base#state |
target: |
---|
Gets the target view where the action is executing or has executed. This property contains the value of the Source: javascript/web/pentaho/visual/action/base.js, line 68 Inherited From: pentaho.visual.action.Base#target |
Methods Details
_assertEditable() Protected | ||||
---|---|---|---|---|
Asserts that the action is editable and throws an error if not. Call this helper method at the start of general property setters. Source: javascript/web/pentaho/type/action/base.js, line 412 Inherited From: pentaho.type.action.Base#_assertEditable
|
_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 178 Inherited From: pentaho.type.Value#_configure
|
_doDefault() : Promise | ||||
---|---|---|---|---|
Performs the default "action" of this action. When the action is Source: javascript/web/pentaho/type/action/base.js, line 760 Inherited From: pentaho.type.action.Base#_doDefault
|
_onPhaseDo() : Promise Protected | ||||
---|---|---|---|---|
Called during the action's do phase. The default implementation calls the executor's Source: javascript/web/pentaho/type/action/base.js, line 1183 Inherited From: pentaho.type.action.Base#_onPhaseDo
|
_onPhaseFinally() Protected |
---|
Called during the action's finally phase. The default implementation calls the executor's Source: javascript/web/pentaho/type/action/base.js, line 1198 Inherited From: pentaho.type.action.Base#_onPhaseFinally |
_onPhaseInit() Protected |
---|
Called during the action's initialize phase. The default implementation calls the executor's Source: javascript/web/pentaho/type/action/base.js, line 1150 Inherited From: pentaho.type.action.Base#_onPhaseInit |
_onPhaseWill() Protected |
---|
Called during the action's will phase. The default implementation calls the executor's Source: javascript/web/pentaho/type/action/base.js, line 1165 Inherited From: pentaho.type.action.Base#_onPhaseWill |
_setTarget(target) Protected | ||||||
---|---|---|---|---|---|---|
Called to validate and set the action's target, upon execution. Override to perform additional validations after calling the base implementation. Source: javascript/web/pentaho/type/action/base.js, line 726 Inherited From: pentaho.type.action.Base#_setTarget
|
assertValid() | ||||
---|---|---|---|---|
Ensures that the value is valid, and throws the first validation error if it is not. This method calls the Source: javascript/web/pentaho/type/value.js, line 152 Inherited From: pentaho.type.Value#assertValid
|
clone() : pentaho.type.Value | ||||
---|---|---|---|---|
Creates a shallow clone of this value. Source: javascript/web/pentaho/type/value.js, line 86 Inherited From: pentaho.type.Value#clone
|
configure(config) : pentaho.type.Value | ||
---|---|---|
Configures this value with a given configuration. Source: javascript/web/pentaho/type/value.js, line 165 Inherited From: pentaho.type.Value#configure |
Name | Default Value | Summary |
---|---|---|
config : any | The configuration. |
Name | Description |
---|---|
pentaho.type.Value | This instance. |
done(result) : pentaho.type.action.Base | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Called from an action observer to mark the action as being done, optionally given a result value. Source: javascript/web/pentaho/type/action/base.js, line 775 Inherited From: pentaho.type.action.Base#done
|
equals(other) : boolean | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Determines if a given value, of the same type, represents the same entity. The default implementation delegates the operation to the Source: javascript/web/pentaho/type/value.js, line 107 Inherited From: pentaho.type.Value#equals
See also: pentaho.type.Value#$key , pentaho.type.Value.Type#areEqual |
execute(target, executor) : pentaho.type.action.Base | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Executes the action on a given target and, optionally, with a given executor, and does not wait for its outcome. This method can be called on Source: javascript/web/pentaho/type/action/base.js, line 661 Inherited From: pentaho.type.action.Base#execute
See also: pentaho.type.action.ITarget#executeAsync , pentaho.type.action.ITarget#act |
executeAsync(target, executor) : Promise | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Executes the action on a given target and, optionally, with a given executor, and waits for its outcome. This method can be called on Source: javascript/web/pentaho/type/action/base.js, line 688 Inherited From: pentaho.type.action.Base#executeAsync
See also: pentaho.type.action.ITarget#execute , pentaho.type.action.ITarget#actAsync |
reject(reason) : pentaho.type.action.Base | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Called from an action observer to mark the action as rejected. The action is considered failed if Otherwise, the action is considered canceled if Source: javascript/web/pentaho/type/action/base.js, line 843 Inherited From: pentaho.type.action.Base#reject
See also: pentaho.type.action.Base#isRejected , pentaho.type.action.Base#isCanceled , pentaho.type.action.Base#isFailed , pentaho.type.action.Base#error Example define([ "pentaho/lang/UserError", "pentaho/lang/RuntimeError" ], function(UserError, RuntimeError) { // ... target.on("fly", { will: function(action) { // Canceling the action // .. Method 1 action.reject("Cannot do this action now."); // .. Method 2 action.reject(new UserError("Cannot do this action now.")); // Failing the action // .. Method 1 - message is not adequate to be shown to the user. action.reject(new Error("Null Pointer Exception.")); // .. Method 2 - message is adequate to be shown to the user. action.reject(new RuntimeError("The server is currently unreachable.")); } }); // ... }); |
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 Source: javascript/web/pentaho/type/instance.js, line 210 Inherited From: pentaho.type.Instance#toJSON
See also: pentaho.type.Instance#toSpec |
toSpec(keyArgs) : pentaho.type.spec.UInstance | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a specification that describes this value. If an Source: javascript/web/pentaho/type/value.js, line 184 Inherited From: pentaho.type.Value#toSpec |
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.
|
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 190 Overrides: pentaho.visual.action.Base#toSpecInContext
See also: pentaho.type.Instance#toSpec |
validate() : Array.< | ||||
---|---|---|---|---|
Determines if this value is a valid instance of its type. The default implementation delegates to Source: javascript/web/pentaho/type/value.js, line 137 Inherited From: pentaho.type.Value#validate
See also: pentaho.type.Value#$isValid |