Plumtree EDK (Enterprise Web Development Kit) 5.4.0

IDocumentManager.CreateNewDocument Method 

Returns a new IDocument instance.

IDocument CreateNewDocument(
   string name,
   string description
);

Parameters

name
The name of the document. Cannot be null.
description
The description of the document. Cannot be null.

Return Value

A new IDocument instance.

Remarks

After setting some of the fields on the newly created object, the method InsertNewDocument needs to be called to persist the newly created document.

The following sample code demonstrates how to create and store a new document.
//Create the document
IDocument newDocument = documentManager.CreateNewDocument("my new document", "this is a test document");
//Set optional properties
newDocument.Author = "joe bloggs";
//Set content-type
newDocument.ContentType = "text/vnd.ms-word";
//Open a Stream for the document contents
Stream fileInputStream = new FileStream("c:\\report.doc");
//Insert the document, inheriting the containing folder's security
documentManager.InsertNewDocument(containingFolder, newDocument, "initial check-in", fileInputStream, "en", true);

See Also

IDocumentManager Interface | Plumtree.Remote.PRC.Collaboration.Document Namespace