SetDmCln

Syntax

SetDmClnResult SetDmCln(DmId tDim, SetDmClnArg tArg)

Parameters

tDim. Moniker of opened calendar dictionary instance.

tArg. Operation execution parameters.

Description

The SetDmCln operation changes calendar dictionary metadata.

Comments

This operation enables the user to change calendar dictionary structure and settings: hierarchy in use, levels, custom attributes, calendar limits and other settings that affect dictionary work. To execute the operation, in the tDim field specify calendar dictionary instance moniker, and in the tArg field specify operation execution parameters. The moniker can be obtained on executing the OpenDim operation. In the tArg.meta field specify changed metadata. In certain cases, for example, when working with attributes, in the tArg.pattern field also determine the pattern that will be used to make changes. After making changes save the dictionary by using the SaveObject or SaveObjectAs operation. The operation results in the updated metadata if the tArg.metaGet pattern was specified.

Example

Below is the example of using the SetDmCln operation to change calendar dictionary structure, that is, the Root level is included in the dictionary structure. The request contains dictionary moniker and metadata with information about added calendar level. The response contains updated information about calendar dictionary.

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">
<SetDmCln xmlns="http://www.fsight.ru/PP.SOM.Som">
<tDim xmlns="">
  <id>S1!M!S!DM2</id>
  </tDim>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
  </pattern>
<meta>
<levelInUse>
  <levelIndex>0</levelIndex>
  <res>true</res>
  </levelInUse>
  </meta>
<metaGet>
  <obInst>true</obInst>
<levelInUse>
  <levelIndex>0</levelIndex>
  </levelInUse>
  </metaGet>
  </tArg>
  </SetDmCln>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetDmClnResult 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>S1!M!S!DM2</id>
  </id>
<meta xmlns="">
<obInst>
<obDesc ds="" isShortcut="0" isLink="0" ver="9" hf="0">
  <i>CALENDAR</i>
  <n>Calendar</n>
  <k>112</k>
  <c>1026</c>
  <p>103</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </obInst>
  <dirty>0</dirty>
  <startYear>2000</startYear>
  <endYear>2003</endYear>
  <startYearAsParam>0</startYearAsParam>
  <endYearAsParam>0</endYearAsParam>
  <hierarchy>0</hierarchy>
<levelInUse>
  <levelIndex>0</levelIndex>
  <res>1</res>
  </levelInUse>
  <attrCount>9</attrCount>
  <levelCount>6</levelCount>
  <reverseOrder>0</reverseOrder>
  <shiftForward>0</shiftForward>
  <hierarchyCorrection>0</hierarchyCorrection>
  <lastLevelNameAsDay>0</lastLevelNameAsDay>
  <defaultOpenType>Hierarchical</defaultOpenType>
  <isDynamicAttrs>1</isDynamicAttrs>
  </meta>
  </SetDmClnResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetDmCln" :
{
"tDim" :
{
"id" : "S1!M!S!DM2"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true"
},
"meta" :
{
"levelInUse" :
{
"levelIndex" : "0",
"res" : "true"
}
},
"metaGet" :
{
"obInst" : "true",
"levelInUse" :
{
"levelIndex" : "0"
}
}
}
}
}

JSON response:

{
"SetDmClnResult" :
{
"id" :
{
"id" : "S1!M!S!DM2"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "9",
"@hf" : "0",
"i" : "CALENDAR",
"n" : "Calendar",
"k" : "112",
"c" : "1026",
"p" : "103",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"startYear" : "2000",
"endYear" : "2003",
"startYearAsParam" : "0",
"endYearAsParam" : "0",
"hierarchy" : "0",
"levelInUse" :
{
"levelIndex" : "0",
"res" : "1"
},
"attrCount" : "9",
"levelCount" : "6",
"reverseOrder" : "0",
"shiftForward" : "0",
"hierarchyCorrection" : "0",
"lastLevelNameAsDay" : "0",
"defaultOpenType" : "Hierarchical",
"isDynamicAttrs" : "1"
}
}
}
public static SetDmClnResult ChangeCalendar(DmId moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetDmCln()
{
tArg = new SetDmClnArg()
{
pattern = new DmClnMdPattern(),
meta = new DmClnMd()
{
levelInUse = new DmClnLevelInUse() { levelIndex = 0, res = true }
},
metaGet = new DmClnMdPattern()
{
levelInUse = new DmClnLevelInUse() { levelIndex = 0 }
}
},
tDim = moniker
};
//Change calendar dictionary
var result = somClient.SetDmCln(tSet);
return result;
}

See also:

Working with Dictionaries