HiI have a client who insists on having a workspace designed as such:Workspace SAMPLE-Tab 1 > Folder A > Folder B > Folder CThey would like to be able to automatically add a new tab with an identical folder structure to this workspace if the following are provided:- target Workspace name/ID- name of the tab to be createdThis data could be provided in the form of a CSV file.Any ideas how I can use the SDK to do this?ThanksJason
using IManage;string strServer = "MyServerName";IManDMS myDMS = new ManDMSClass();IManSession mySess = myDMS.Sessions.Add(strServer);mySess.TrustedLogin();// Get an instance of the ManStrings object for searching in target databases.ManStrings myDatabaseList = new ManStringsClass();// Build a list to include all the databases.foreach (IManDatabase db in mySess.Databases){ myDatabaseList.Add(db.Name);}// Search by workspace name. IManWorkspaceSearchParameters wsparams = myDMS.CreateWorkspaceSearchParameters();//assuming the name is unique across all databases.wsparams.Add(imFolderAttributeID.imFolderName, "aaa"); //ex of a workspace name//Search across databases under the same serverIManFolders results = mySess.SearchWorkspaces(myDatabaseList, myDMS.CreateProfileSearchParameters(), wsparams);//~ Search in a specific database// Query for the target database in which to create the new workspace.//IManDatabase myDatabase = mySess.Databases.ItemByName("MyDatabaseName");//IManFolders results = myDatabase.SearchWorkspaces(myDMS.CreateProfileSearchParameters(), wsparams);if (results != null){ if (results.Empty == false) { IManWorkspace target = (IManWorkspace)results.ItemByIndex(1); // Query for Tabs collection from the newly created workspace. IManTabs myTabs = (IManTabs)target.SubFolders; // Add a tab to the workspace. IManTab myTab = myTabs.AddNewTabInheriting("SDK", "Adding a tab programmatically"); //Note: you may also use the AddNewTab Method if you do not want to inherit security from the workspace // Add folders to the tab myTab.DocumentFolders.AddNewDocumentFolderInheriting("SDK Folder 1", "Adding a documnet folder programmatically"); myTab.DocumentFolders.AddNewDocumentFolderInheriting("SDK Folder 2", "Adding a documnet folder programmatically"); myTab.DocumentFolders.AddNewDocumentFolderInheriting("SDK Folder 3", "Adding a documnet folder programmatically"); //Note: you may also use the AddNewDocumentFolder Method if you do not want to inherit security from the tab. target.Update(); }}