CubeViewer properties

The CubeViewer class has the following properties.

When instantiating either a CubeViewer or Workbook object, the following properties are common between the two types of objects:

sessionToken
Type: String
Specifies the TM1® Web session to use for this object. Do not use this property with the properties for adminHost, tm1Server, username, password, and camPassport. If this property is not specified, and no additional credentials are provided, the user is prompted with a login dialog during startup.
adminHost
Type: String
Default: localhost
The admin host to use when the object is loaded. Do not use this property with the sessionToken property.
tm1Server
Type: String
The TM1 server to use when the object is loaded. Do not use this property with the sessionToken property. If unspecified and no sessionToken is provided, the user is prompted with a login dialog during startup.
username
Type: String
The user name to use when the object is loaded. Do not use this property with the sessionToken or camPassport properties. If unspecified and no sessionToken or camPassport is provided, the user is prompted with a login dialog during startup.
password
Type: String
The password to use when the object is loaded. If unspecified and no sessionToken is provided, the user is prompted with a login dialog during startup.
camPassport
Type: String
The Cognos® BI authentication passport (CAM passport) to use when you load an object. Do not use this property with username or sessionToken.

The following properties are used when you instantiate a CubeViewer object:

view
Type: String
The name of the cube view to load.
cube
Type: String
The name of the cube that contains the view you want to load.
isPublic
Type: Boolean
Default: true
The access type of the cube view to load.
A value of true indicates that you want to load a public cube view.
A value of false indicates that you want to load a private cube view.

Get properties

All properties that get a value are called with the following format:

get("property_Name").

For example: get("sandboxes");

sandboxes
Retrieves all available sandboxes.
Returns dojo._base.Deferred.promise as a promise that is resolved when the sandboxes are retrieved. When the promise is resolved, an Array of objects that represent the available sandboxes is passed to any callback registered with the promise.
Each object uses the following format:
  • name: (String) - The name of the sandbox.
  • active: (Boolean) - True if this sandbox is the active sandbox for the object, else false.
  • baseSandbox: (Boolean) - True if this sandbox is the base sandbox, else false.
  • defaultSandbox: (Boolean) - True if this sandbox is the default sandbox, else false.

Set properties

All properties that set a value are called with the following format:

set("property_Name", value)

For example: set("activeSandbox", "theSandbox");

activeSandbox
Sets the specified sandbox as active.
Parameter: (String) sandbox. The name of the sandbox to set as active.
Returns: dojo._base.Deferred.promise as a promise that is resolved when the active sandbox is set.

The following methods apply only to CubeViewer objects.

dimensionBarVisible
Sets the visibility of the dimension bar.
Parameters: Boolean.
  • True turns on the display of the dimension bar.
  • False turns off the display of the dimension bar.
automaticRecalculation
Sets automatic recalculation to on or off.
Parameters: Boolean.
  • True turns on automatic recalculation.
  • False turns off automatic recalculation.
Returns: dojo._base.Deferred.promise. A promise that is resolved when automatic recalculation is enabled or disabled.
displayMode
Sets the display mode of the CubeViewer object.
Parameters: tm1web.cubeview.DisplayMode. The display mode to set.
Returns: dojo._base.Deferred.promise. A promise that is resolved when the display mode is set.
chartType
Sets the chart type of the CubeViewer object.
Parameters: tm1web.cubeview.ChartType. The chart type to set.
Returns: dojo._base.Deferred.promise. A promise that is resolved when the chart type is set.
titleDimensionElement
Sets a title dimension element.
Parameter: element object. The title dimension element to set. This object uses the following format:
dimension
String
The name of the dimension.
element
String
The name of the element. Do not use this parameter with elementIndex.
elementIndex
Integer
The one-based index of the dimension element to set. Do not use this parameter with the element parameter.
Returns: dojo._base.Deferred.promise. A promise that is resolved when the title dimension element is set. Any callbacks that are registered with the promise are passed an object that matches the format of the element that was passed into this method. A value of null is passed if the element was not changed.
titleDimensionElements
Sets multiple title dimension elements.
Parameter: object[] elements. An array of the title dimension elements to set. Each object uses the following format:
dimension
String
The name of the dimension.
element
String
The name of the element. Do not use this parameter with elementIndex.
elementIndex
Integer
The one-based index of the dimension element to set. Do not use this parameter with the element parameter.
Returns dojo._base.Deferred.promise. A promise that is resolved when the title dimension elements are set. Any callbacks that are registered with the promise are passed an array of objects that match the format of the element objects that were passed into this method. The passed array reports back about the elements that are successfully set.