Web Service > Web Service Operations > Working with Cubes > OpenCube
GetCubeResult OpenCube(OdId tOb, OpenCubeArg tArg)
tOb. Moniker of the object that is a cube.
tArg. Parameters of cube opening.
The OpenCube operation opens a repository cube and returns context for working with cube's structure.
The operation gets access to the structure and settings of various repository cubes. To execute the operation, in the tOb field specify moniker of the object that is a cube, and in the tArg field specify opening parameters. Object moniker can be obtained on executing the GetObjects operation. In the tArg.metaGet field specify the template that will be used to get cube metadata on opening. If the tArg.metaGet field is not set, the operation results in only the moniker of opened cube instance.
Further work with cube structure is executed using the GetCube and SetCube operations. To close the cube instance, use the CloseCube operation.
Below is the example of opening cube structure for edit. The request contains moniker of the repository object that is a cube. The response contains moniker of opened cube instance.
The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.
{
"OpenCube" :
{
"tOb" :
{
"id" : "DJIDPDNFAJIEGOAEFGBFAIAOIJBNELFEKJMNBFEFGMEEHCKG!M!5857"
},
"tArg" :
{
"args" :
{
"bind" : "true",
"openForEdit" : "true"
}
}
}
}
{
"OpenCubeResult" :
{
"id" :
{
"id" : "DJIDPDNFAJIEGOAEFGBFAIAOIJBNELFEKJMNBFEFGMEEHCKG!M!S!CJFAIFLNFAJIEGOAENFOLPMFKLFMJJPPEOLLHBIJJMKBKEMCM"
}
}
}
public static GetCubeResult OpenCube(MbId mb, string cubeId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tOpen = new OpenCube()
{
tArg = new OpenCubeArg()
{
args = new CubeOpenArgs()
{
bind = true,
openForEdit = true
}
},
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, cubeId).k }
};
// Open cube
var tResult = somClient.OpenCube(tOpen);
return tResult;
}
See also: