/// <summary> /// 1) Annulla estrazione del file da parte dell'utente. /// 2) Aggiorna l'ultimo utente che ha eseguito le operazioni sul file e la data. /// 3) Aggiunge un commento nello storyboard. /// </summary> /// <param name="desk"></param> /// <param name="roleUser"></param> /// <param name="docVersion"></param> /// <param name="idDeskDocument"></param> /// <param name="idDocument"></param> /// <param name="userId"></param> public void UndoCheckOut(Desk desk, DeskRoleUser roleUser, DeskDocumentVersion docVersion, Guid?idDeskDocument, Guid idDocument, string userId) { BiblosDocumentInfo.UndoCheckOutDocument(idDocument, userId); BiblosDocumentInfo undoDoc = BiblosDocumentInfo.GetDocumentByVersion(idDocument, null, null); UpdateDocumentLastChages(idDeskDocument); AddCommentStoryBoard(undoDoc, desk, roleUser, docVersion, DeskStoryBoardType.UndoCheckout); }
public void ElaborateDocument(HttpContext context) { Guid documentId = context.Request.QueryString.GetValueOrDefault("Id", Guid.Empty); byte[] stream = { }; try { if (documentId == null) { ElaborateException(context); } BiblosDocumentInfo documentInfo = BiblosDocumentInfo.GetDocumentByVersion(string.Empty, documentId, null, null); if (documentInfo == null) { ElaborateException(context); } stream = documentInfo.GetPdfStream(); if (!Encoding.Default.GetString(stream, 0, 4).Equals("%PDF")) { throw new Exception("Il pdf non può essere visualizzato a causa di un errore di conversione.", new Exception("Lo stream non inizia con '%PDF'")); } DocumentUnit documentUnit = GetProtocolId(documentInfo.ChainId); if (documentUnit != null) { InsertProtocolLog(documentUnit, documentInfo); //throw new Exception(string.Concat("DocumentUnit con IdArchiveChain ", documentInfo.ChainId, " non trovata."), new Exception("DocumentUnit non trovata.")); } ElaborateStream(context, stream, string.Empty); } catch (Exception ex) { FileLogger.Error(LogName.BiblosServiceLog, ex.Message, ex); ElaborateException(context); } }
public BiblosDocumentInfo GetLastDocumentVersion(DeskDocumentResult document) { return(BiblosDocumentInfo.GetDocumentByVersion(document.IdDocumentBiblos.Value, null, true)); }