SemanticLayerMetaResult OpenSemanticLayer(OdId tObject, OpenSemanticLayerMetaArg tArg)
tObject. Moniker of repository object that is data model.
tArg. Operation execution parameters.
The OpenSemanticLayer operation opens data model.
To execute the operation, in the tObject field specify moniker of object that is a data model, and in the tArg field specify opening parameters. In the tArg.args field specify data model opening mode. In the tArg.meta field specify empty values or default values for the fields with metadata, which values should be obtained.
The operation results in the moniker of opened data model instance and obtained metadata if the appropriate fields were defined.
Further work with data model is executed using the GetSemanticLayerMeta, SetSemanticLayerMeta operations and other specific operations used for executing specific actions. To close the opened instance of information panel, use the CloseSemanticLayer operation.
Below is the example of opening data model for edit. The request contains moniker of the repository object that is a data model. The response contains moniker of opened data model instance. Any additional metadata is not obtained.
The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier article.
{
"OpenSemanticLayer" :
{
"tObject" :
{
"id" : "OBNIHFAHPABDGOAEGDPOIOEEEEFKFMOEBLJPNILDEGIADEAK!M!358178"
},
"tArg" :
{
"args" :
{
"openForEdit" : "true"
}
}
}
}
{
"OpenSemanticLayerResult" :
{
"id" :
{
"id" : "OBNIHFAHPABDGOAEGDPOIOEEEEFKFMOEBLJPNILDEGIADEAK!M!S!POFIOKJAHPABDGOAEHEMNLOGBNPHIANDECKECPPGGIBIEIJCA"
}
}
}
public static SemanticLayerMetaResult OpenSemanticLayer(MbId mb, string objectId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tOpen = new OpenSemanticLayer()
{
tArg = new OpenSemanticLayerMetaArg()
{
args = new SemanticLayerMetaOpenArgs()
{
openForEdit = true
}
},
// Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, objectId).k }
};
// Open data model
var result = somClient.OpenSemanticLayer(tOpen);
return result;
}
See also: