OpenWspResult OpenWsp(OdId tOb, OpenWspArg tArg)
tOb. Moniker of a repository object that is a workspace.
tArg. Operation execution parameters.
The OpenWsp operation opens workspace.
The operation gets access to workspace structure. To execute the operation, in the tOb field specify moniker of the object that is a workspace, and in the tArg field specify opening parameters. The object moniker can be obtained on executing the GetObjects operation.
The tArg field can be used to specify mode of workspace opening (view or edit), parameter values and pattern for getting metadata. The pattern specifies the information to be retrieved on executing the operation. The operation results in the opened workspace instance moniker and also the metadata if an appropriate pattern was defined in the tArg.metaGet parameter on executing the operation.
Further work with the opened instance is executed using the GetWspMd and SetWspMd operations.
To close the opened workspace instance, use the CloseWsp operation.
Below is the example of opening the workspace for edit. The request contains moniker of the object that a repository workspace. The response contains the moniker of opened workspace instance.
The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier article.
{
"OpenWsp" :
{
"tOb" :
{
"id" : "CIMJHKLEBJECGOAEDDAIHBNBMCJPBEIEDLDBMALGIAOFGHDO!M!282380"
},
"tArg" :
{
"args" :
{
"bind" : "true",
"openForEdit" : "true"
}
}
}
}
{
"OpenWspResult" :
{
"id" :
{
"id" : "CIMJHKLEBJECGOAEDDAIHBNBMCJPBEIEDLDBMALGIAOFGHDO!M!S!WSPMCLOGNLEBJECGOAEIIMMCOLKFIOGIGNEPLNLFCEAJGEIEIBG"
}
}
}
public static OpenWspResult OpenWorkspace(MbId mb, string id)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tOpen = new OpenWsp()
{
tArg = new OpenWspArg()
{
args = new WspOpenArgs()
{
bind = true,
openForEdit = true
}
},
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, id).k }
};
// Open workspace
var tResult = somClient.OpenWsp(tOpen);
return tResult;
}
See also: