RootFolder: IMetabaseUpdateFolderNode;
The RootFolder property returns the object containing update structure.
Executing the example requires that the repository contains tables with the TABLE_1 and TABLE_2 identifiers and forms with the FORM_1 and FORM_2 identifiers.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Update: IMetabaseUpdate;
Root, Folder1, Folder2:IMetabaseUpdateFolderNode;
TableObj: IMetabaseUpdateDataObjectNode;
FormObj: IMetabaseUpdateObjectNode;
Begin
MB := MetabaseClass.Active;
Update := MB.CreateUpdate;
Root := Update.RootFolder;
//Create folders
Folder1 := Root.Add(MetabaseUpdateNodeType.Folder) As IMetabaseUpdateFolderNode;
Folder1.Label := "Tables";
Folder2 := Root.Add(MetabaseUpdateNodeType.Folder) As IMetabaseUpdateFolderNode;
Folder2.Label := "Forms";
//Add tables
TableObj := Folder1.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
TableObj.Object := MB.ItemById("Table_1");
TableObj.Label := TableObj.Object.Name;
TableObj.Method := MetabaseUpdateMethod.All;
TableObj := Folder1.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
TableObj.Object := MB.ItemById("Table_2");
TableObj.Label := TableObj.Object.Name;
TableObj.Method := MetabaseUpdateMethod.All;
//Add forms
FormObj := Folder2.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
FormObj.Object := MB.ItemById("Form_1");
FormObj.Label := FormObj.Object.Name;
FormObj := Folder2.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
FormObj.Object := MB.ItemById("Form_2");
FormObj.Label := FormObj.Object.Name;
Update.SaveToFileNF("c:\Object.pefx");
End Sub;
After executing the example a new update is created. Two tables and two forms are included in the update. Two folders are created in the update structure to arrange objects.
See also: