OpenWsp

Syntax

OpenWspResult OpenWsp(OdId tOb, OpenWspArg tArg)

Parameters

tOb. Moniker of a repository object that is a workspace.

tArg. Operation execution parameters.

Description

The OpenWsp operation opens workspace.

Comments

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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<OpenWsp xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>CIMJHKLEBJECGOAEDDAIHBNBMCJPBEIEDLDBMALGIAOFGHDO!M!282380</id>
  </tOb>
<tArg xmlns="">
<args>
  <bind>true</bind>
  <openForEdit>true</openForEdit>
  </args>
  </tArg>
  </OpenWsp>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<OpenWspResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>CIMJHKLEBJECGOAEDDAIHBNBMCJPBEIEDLDBMALGIAOFGHDO!M!S!WSPMCLOGNLEBJECGOAEIIMMCOLKFIOGIGNEPLNLFCEAJGEIEIBG</id>
  </id>
  </OpenWspResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"OpenWsp" :
{
"tOb" :
{
"id" : "CIMJHKLEBJECGOAEDDAIHBNBMCJPBEIEDLDBMALGIAOFGHDO!M!282380"
},
"tArg" :
{
"args" :
{
"bind" : "true",
"openForEdit" : "true"
}
}
}
}

JSON response:

{
"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:

Working with Workspace