Hello I'm trying to use the exact same code as above and I cannot see the parameters I set on my IManProfileSearchParameters object.Ideally, I would like to be able to launch a "silent" search but no luck for now, I tried to base my code on the example of the SDK manual, but in the manual there is no detail as how the search parameters object is defined, it's just passed to the searchcmd.I am pretty sure that my problem for running a silent search is that I am not able to correctly pass search parameter to the searchcommand.Maybe someone can help me.Thanks a lot.Here is the complete code : IMANEXTLib.SearchCmd pSrchCmd = new IMANEXTLib.SearchCmdClass();pSrchCmd.OnInitDialog += new IMANEXTLib._ICommandEvents_OnInitDialogEventHandler(pSrchCmd_OnInitDialog);IMANEXTLib.ContextItems pCtxtItems = new IMANEXTLib.ContextItemsClass();IManProfileSearchParameters pSrchParams = dms.CreateProfileSearchParameters();pSrchParams.Add(imProfileAttributeID.imProfileFullText, "someText");pSrchParams.Add(imProfileAttributeID.imProfileAuthor, sess.UserID);IManage.NRTSession[] sessions = new IManage.NRTSession[1];sessions[0] = (NRTSession) sess;string[] dbs = new string[1];dbs[0] = "tikit";pCtxtItems.Add("ParentWindow", this.Handle.ToInt32());pCtxtItems.Add("NRTDMS", dms);pCtxtItems.Add("SelectedIManSession", sess);pCtxtItems.Add("IManSearchParameters", pSrchParams);pSrchCmd.Initialize(pCtxtItems);if (pSrchCmd.Status == (int)IMANEXTLib.CommandStatus.nrActiveCommand) { pSrchCmd.Execute(); } } void pSrchCmd_OnInitDialog(object pMyInterface) { ((SearchDlg)pMyInterface).ClearAll(); }
private void exSearchCmd(){ContextItems context = new ContextItemsClass();SearchCmd oCmd = new SearchCmdClass();oCmd.OnInitDialog += new IMANEXTLib._ICommandEvents_OnInitDialogEventHandler(oCmd_OnInitDialog);context.Add("NRTDMS", dms);context.Add("SelectedIManSession", sess);context.Add("ParentWindow", this.Handle.ToInt32());oCmd.Initialize(context);oCmd.Update();try{if (oCmd.Status == (int)CommandStatus.nrActiveCommand){oCmd.Execute();bool bRefresh = false;bRefresh = (bool)context.Item("iManExt.Refresh");}}catch (Exception ex){MessageBox.Show(ex.Message);}}void oCmd_OnInitDialog(object pMyInterface){SearchDlg dlg = (SearchDlg)pMyInterface;dlg.ClearAll();dlg.SetAttributeValueByID(AttributeID.nrAuthor, sess.UserID, true);dlg.SetAttributeValueByID(AttributeID.nrFullText, "someText", true);}
To perform a search again without redisplayed the WorkSite Search dialog, add the name-value pairs, ReSearchParameters and ReSearchedDatabases, to the ContextItems collection. For further clarification, see the examples in this manual.