I am new to plumtree and I am trying to get to know the Plumtree object model. I am trying download a file from the plumtree knowledge directory programmatically.
This is the code I am using:
IRemoteSession session = RemoteSessionFactory.GetExplicitLoginContext(new Uri(url), userName, password);
IDocumentFolderManager DocFolderManager = session.GetDocumentFolderManager();
IDocumentManager DocManager = session.GetDocumentManager();
IObjectQuery FolderQuery = DocFolderManager.GetSubFolders(folderID);
IDocumentQuery DocQuery = DocManager.CreateQuery(FolderQuery.GetRow(i).GetID());
IObjectQuery DocumentQuery = DocQuery.Execute();
IObjectQueryRow document = DocumentQuery.GetRow(1);
IDocumentProperties _docProperties = DocManager.QueryDocumentProperties(document.GetID());
string docUrl = _docProperties.GetStringValue(5);
WebClient webclient = new WebClient();
webclient.Credentials = new System.Net.NetworkCredential(userName, password, "");
webclient.Credentials = CredentialCache.DefaultCredentials;
webclient.DownloadFile(docUrl, "c:\1");
But there seems to be some problem with my session creation code, because instead of downloading the actual file, this code downloads the Plumtree login page to my file system.
Can somebody please tell me what I am doing wrrong here? There must be something that I am missing