Creates a new remote document.
//get the document manager..... int folderID = 20; //get from the query string from mousing over the directory folder in the ui int dataSourceID = 30; //get from the query string from mousing over the data source in the ui //location of a file; the format of the location string is data-source specific String location = "\\\\MyServer\\share\\Portlet FAQ and Price list.doc" ; IRemoteDocument doc = documentManager.CreateRemoteDocument(folderID, dataSourceID, location); //set the override name and description- otherwise the value would be taken from the accessor doc.SetOverrideName("Portlet Price List"); doc.SetOverrideDescription("Portlet Prices and FAQs"); //set the type- in this case, a word doc in the MIME namespace doc.SetType("http://www.plumtree.com/dtm/mime", "application/msword"); //set the docID to a negative number to check for failure int docID = -1; try { docID = documentManager.save(); } catch (System.Web.HttpException e) { //if the query interface URL was not valid Console.WriteLine(e.StackTrace); } catch (PortalException pe) { //if the operation resulted in an error in the portal Console.WriteLine(pe.StackTrace); } //process docID as desired......
the new document
The document will not be saved in the portal Knowledge Directory until the Save()
method is called on the IDocument
object. See DatasourceID
enumeration for a list of predefined datasources.
IDocumentManager Interface | Plumtree.Remote.PRC Namespace | IDocumentManager.CreateRemoteDocument Overload List