Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
ImanExt View Command Error
sideline
Hi
am starting to use the Imanage and ImanExt dlls
currently trying to get the SearchCmd and View command integrated
when i try and use the Viewcmd, get workSite error screen with
"Could not Launch viewer".
cick on the details button, get
"Could not Launch viewer".
here is the c# code that i am using
IManage.NRTDMS dms = new IManage.NRTDMSClass();
IManage.NRTSession sess = (IManage.NRTSession)Login.DMS.Sessions.ItemByIndex(1);
IManage.NRTDatabase db = (IManage.NRTDatabase) sess.PreferredDatabase;
IManage.NRTDocument doc = db.GetDocument(1195140,1);
IMANEXTLib.ViewCmd pViewCmd = new IMANEXTLib.ViewCmdClass();
IMANEXTLib.ContextItems pCtxtItems = new IMANEXTLib.ContextItemsClass();
IManage.NRTDocument[] docArray;
docArray = new IManage.NRTDocument[1];
docArray[0] = doc;
pCtxtItems.Add ("ParentWindow", this.ParentForm.Handle);
pCtxtItems.Add ("SelectedNRTDocuments", docArray);
pViewCmd.Initialize(pCtxtItems);
pViewCmd.Update();
if (pViewCmd.Status == (pViewCmd.Status & (int) IMANEXTLib.CommandStatus.nrActiveCommand))
{
pViewCmd.Execute();
if (Convert.ToBoolean(pCtxtItems.Item("IManExt.Refresh")))
{
MessageBox.Show("its ready");
}
pCtxtItems.Remove("IManExt.Refresh");
}
also, is there any way of finding more meaingful information to try and identify any problems ??
all help appreciated
tia
m
Find more posts tagged with
Comments
sideline
oops - forgot to mention
am using the v8 SDK
jny
Here's a code example on using the ViewCmd in WorkSite 8 (via the IMan or NRT Interfaces ):
// IMan
//IManDMS dms = new ManDMSClass();
//IManSession sess = dms.Sessions.Add("");
//sess.TrustedLogin();
//IManDocument doc = sess.PreferredDatabase.GetDocument(820, 1);
// INRT
NRTDMS dms = new NRTDMSClass();
INRTSession sess = dms.Sessions.Add("("", null, null);
sess.TrustedLogin();
NRTDocument doc = sess.PreferredDatabase.GetDocument(820, 1);
ViewCmd cmd = new ViewCmdClass();
ContextItems context = new ContextItemsClass();
NRTDocument[] saDox = new NRTDocument[1];
saDox[0] = (NRTDocument) doc;
context.Add("ParentWindow", this.Handle.ToInt32());
context.Add("SelectedNRTDocuments", saDox);
context.Add("TempDirectory",
@C:\Temp
);
cmd.Initialize(context);
cmd.Update();
if (cmd.Status == (int)IMANEXTLib.CommandStatus.nrActiveCommand)
{
cmd.Execute();
}
sideline
thanks for the reply
unfortunately i am having the same problem with your code as i did with my version - The WorkSite error box appears with the message "Could not Launch Viewer!" - which is also displayed when i click on the "Details >>" button.
i amended the code you supplied slightly (see below)
IManage.IManDMS dms = new IManage.ManDMSClass();
IManage.IManSession sess = dms.Sessions.Add("123.456.789.6");
sess.Login("testuser1","testuser1");
IManage.IManDocument doc = sess.PreferredDatabase.GetDocument(1045288, 1);
ViewCmd cmd = new ViewCmdClass();
ContextItems context = new ContextItemsClass();
IManage.NRTDocument[] saDox = new IManage.NRTDocument[1];
saDox[0] = (IManage.NRTDocument) doc;
context.Add("ParentWindow",this.MdiParent.Handle.ToInt32());
context.Add("SelectedNRTDocuments", saDox);
context.Add("TempDirectory",
@C:\InterwovenWork
);
cmd.Initialize(context);
cmd.Update();
try
{
if (cmd.Status == (int)IMANEXTLib.CommandStatus.nrActiveCommand)
{
cmd.Execute();
}
}
catch(Exception ex)
{
AjileTrace.PError(ex);
}
CONCAT.bmp
jny
What happens if you changed the parentwindow from this.MdiParent.Handle.ToInt32()); to this.Handle.ToInt32()? Also, which version of the SDK is this?
sideline
1) there is no difference if is set the ParentWindow handle to this.Handle.ToInt32() - still get the scmd.Status = 1
2) Version is from
Interwoven WorkSite SDK 8.0.msi
jny
Check that you have 8.0 SP1 and retest. I tested successfully in 8.0 SP1.
sideline
I have installed SP1.
Still get the same result - the EXECUTE method on the view command brings up the WorkSite Error form with the message "Could not Launch Viewer !"
jny
Make sure you have the View32.exe program installed on the machine -- as the error you have encountered seems to indicate that it cannot find this program so to launch it.
sideline
Jny
have run the prog on another test machine - works well - the view32 exe must have been missing
many thanks for your help
m