public void Invoke(String path, MakuraDocument doc) { var session = conn.CreateSession(); var targetFolder = SetTargetFolder(path, session); Upload(targetFolder, doc); }
private MakuraDocument GetMakuraDocument(Document cmisDoc) { var content = new MakuraContentStream(); content.FileName = cmisDoc.ContentStreamFileName; content.Length = cmisDoc.ContentStreamLength; content.MimeType = cmisDoc.ContentStreamMimeType; content.Stream = cmisDoc.GetContentStream().Stream; var doc = new MakuraDocument(); doc.ContentStream = content; doc.Name = cmisDoc.Name; return doc; }
private IDocument Upload(IFolder uploadFolder, MakuraDocument document) { var cmisDocumentStream = document.ContentStream.ConvertCmis(); var existDoc = uploadFolder.GetChildren().OfType<IDocument>().FirstOrDefault(p => p.Name == document.Name); if (existDoc == null) { var properties = new Dictionary<string, object>(); properties[PropertyIds.Name] = document.Name; properties[PropertyIds.ObjectTypeId] = "cmis:document"; return uploadFolder.CreateDocument(properties, cmisDocumentStream, DotCMIS.Enums.VersioningState.Minor); } else { existDoc.SetContentStream(cmisDocumentStream,true); return existDoc; } }
private void Capture_Captured(object sender, WebPageCapturedEventArgs e) { var file = e.CapturedFile; using (var fileStream = file.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { var content = new MakuraContentStream(); content.FileName = file.Name; content.Length = fileStream.Length; content.MimeType = MimeMapping.GetMimeMapping(file.Name); content.Stream = fileStream; var doc = new MakuraDocument(); doc.ContentStream = content; doc.Name = file.Name; var eventArgs = new MakuraDocumentEventArgs(); eventArgs.UpdatedDocument = doc; eventArgs.Path = "/CaptureImages"; Changed?.Invoke(this, eventArgs); } }