LinkConnectionResult OpenLinkConnection(OdId tOb, OpenLinkConnectionArg tArg)
tOb. Moniker of repository object that is a shortcut.
tArg. Operation execution parameters.
The OpenLinkConnection operation opens connection of the repository, for which repository link used by shortcut is set up.
To execute the operation, in the tOb field specify moniker if the repository object that is a shortcut. The object moniker can be obtained on executing the GetObjects operation. The tArg.metaGet field can contain the pattern to be used to get the information about the object from another repository, to which the shortcut refers. The connection is opened with the credentials that should be saved in repository link settings.
The operation results in the moniker of the repository connection, for working with which the repository link is set up, if the tArg.metaGet field was defined.
Below is the example of opening the repository connection, for which the repository link used by the shortcut is set up. The request contains shortcut moniker. The response contains moniker of the created connection and description of the object from another repository, to which the shortcut refers.
The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.
{
"OpenLinkConnection" :
{
"tOb" :
{
"id" : "IJOPIIAIMOBHGOAECKHNANPEIOCCJHNEGKCCHICKJBCCIFCP!M!461455"
},
"tArg" :
{
"metaGet" :
{
"source" : "true"
}
}
}
}
{
"OpenLinkConnectionResult" :
{
"id" :
{
"id" : "IJOPIIAIMOBHGOAECKHNANPEIOCCJHNEGKCCHICKJBCCIFCP!M!S!MLCCHOLJAIMOBHGOAEAJLMHGHHGFFHEIKEFIAOKKIGHGCBKIPC!M"
},
"meta" :
{
"source" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "1",
"@hf" : "0",
"i" : "FUNCTION",
"n" : "Function",
"k" : "118",
"c" : "9473",
"p" : "57",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
}
}
}
}
public static LinkConnectionResult OpenLinkConnection(MbId mb, string shortcutId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tOpen = new OpenLinkConnection()
{
tArg = new OpenLinkConnectionArg()
{
metaGet = new LinkConnectionMdPattern()
{
source = true
}
},
tOb = new OdId() { id = mb.id + "!" + PP7SOMSampleClass.FindObjectById(mb, shortcutId).k }
};
// Open the repository connection, for which the repository link used by the shortcut is set up
var result = somClient.OpenLinkConnection(tOpen);
return result;
}
See also: