All platform dictionaries have similar structure. Number of interfaces is created to view data on any dictionary in the Dimensions assembly. The IDimensionModel interface is a common interface reflecting structure of any dictionary.
The basis of any dictionary is the set of attributes. Every dictionary attribute is bound to any source field and further values can be obtained by its attribute. Dictionary contains range of attributes with a particular destination:
Name - attribute, values of which are element names.
ID - attribute, values of which are elements' identifiers; they determine elements in a unique way.
Order - attribute, values of which are used for sorting.
Element icon - attribute, values of which determine index of the icon, displayed next to the element.
Read access - attribute, values of which determine access mask to dictionary elements.
Write access - attribute, values of which determine access mask to edit values according to selected dictionary elements.
One attribute can have several destinations.
The IDimAttributes interface is used to get information on dictionary attributes:
Var
//…
MB: IMetabase;
DimModel: IDimensionModel;
Attrs: IDimAttributes;
//…
Begin
//…
MB := MetabaseClass.Active;
DimModel := MB.ItemById("DimSource").Bind As IDimensionModel;
Attrs := DimModel.Attributes;
//…
Sorting can be set by attributes. By default, the Order attribute is added into the sorting list via the wizard on creating table dictionary. The IDimOrders interface is used to get information on collection of attributes used for dictionary sorting:
Var
//…
MB: IMetabase;
DimModel: IDimensionModel;
Attrs: IDimAttributes;
Orders: IDimOrders;
//…
Begin
//…
MB := MetabaseClass.Active;
DimModel := MB.ItemById("DimSource").Bind As IDimensionModel;
Attrs := DimModel.Attributes;
Orders := Attrs.Orders;
//…
Dictionary structure includes blocks and indexes.
Key element determining the whole hierarchy of dictionary elements are blocks of dictionary. Blocks collate elements to hierarchy structure by any property. Different dictionaries have different number of blocks of different types. The IDimBlocks interface is used to get information on dictionary blocks:
Var
//…
MB: IMetabase;
DimModel: IDimensionModel;
Blocks: IDimBlocks;
//…
Begin
//…
MB := MetabaseClass.Active;
DimModel := MB.ItemById("DimSource").Bind As IDimensionModel;
Blocks := DimModel.Blocks;
//…
If dictionary selection is controlled through the core, dictionary should contain indexes. Indexes are created by attributes, by values of which the selection is formed. The IDimIndexes interface is used to get information on dictionary indexes:
Var
//…
MB: IMetabase;
DimModel: IDimensionModel;
Indexes: IDimIndexes;
//…
Begin
//…
MB := MetabaseClass.Active;
DimModel := MB.ItemById("DimSource").Bind As IDimensionModel;
Indexes := DimModel.Indexes;
//…
If dictionary is created for cubes, it should contain levels for further setting of data aggregation. The IDimLevels interface is used to get information on dictionary levels:
Var
//…
MB: IMetabase;
DimModel: IDimensionModel;
Levels: IDimLevels;
//…
Begin
//…
MB := MetabaseClass.Active;
DimModel := MB.ItemById("DimSource").Bind As IDimensionModel;
Levels := DimModel.Levels;
//…
See also: