SetDmClnResult SetDmCln(DmId tDim, SetDmClnArg tArg)
tDim. Moniker of opened calendar dictionary instance.
tArg. Operation execution parameters.
The SetDmCln operation changes calendar dictionary metadata.
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.
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.
{
"SetDmCln" :
{
"tDim" :
{
"id" : "S1!M!S!DM2"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true"
},
"meta" :
{
"levelInUse" :
{
"levelIndex" : "0",
"res" : "true"
}
},
"metaGet" :
{
"obInst" : "true",
"levelInUse" :
{
"levelIndex" : "0"
}
}
}
}
}
{
"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: