/// <summary> /// Checkout di un documento /// </summary> /// <param name="checkOutStatus">Metadati relativi allo stato del documento in checkout</param> /// <param name="user"></param> /// <param name="library"></param> /// <returns></returns> public bool CheckOut(string idDocument, string documentNumber, string documentLocation, string machineName, out CheckOutStatus checkOutStatus) { checkOutStatus = null; bool retValue = false; try { //Il documento viene messo nello stato LOCK long idOCS = OCSDocumentHelper.getDocumentIdOCS(documentNumber, null, OCSUtils.getApplicationUserCredentials()); CorteContentServices.ItemIdRequestType requestId = new DocsPaDocumentale_OCS.CorteContentServices.ItemIdRequestType(); CorteContentServices.ResultType result; requestId.userCredentials = OCSServices.OCSUtils.getApplicationUserCredentials(); requestId.itemId = idOCS; // id del documento result = this.WsDocumentInstance.LockDocument(requestId); OCSUtils.throwExceptionIfInvalidResult(result); retValue = true; } catch (Exception ex) { retValue = false; logger.Debug("Errore in OCS.CheckOut", ex); } return(retValue); }
/// <summary> /// UndoCheckout di un documento in stato checkout /// </summary> /// <param name="checkOutStatus"></param> /// <param name="library"></param> /// <returns></returns> public bool UndoCheckOut(DocsPaVO.CheckInOut.CheckOutStatus checkOutStatus) { bool retValue = false; try { long idOCS = OCSDocumentHelper.getDocumentIdOCS(checkOutStatus.DocumentNumber, null, OCSUtils.getApplicationUserCredentials()); CorteContentServices.ItemIdRequestType requestId = new DocsPaDocumentale_OCS.CorteContentServices.ItemIdRequestType(); requestId.userCredentials = OCSServices.OCSUtils.getApplicationUserCredentials(); requestId.itemId = idOCS; // id del documento CorteContentServices.ResultType result = this.WsDocumentInstance.UnlockDocument(requestId); OCSUtils.throwExceptionIfInvalidResult(result); retValue = true; } catch (Exception ex) { retValue = false; logger.Debug("Errore in OCS.UndoCheckOut", ex); } return(retValue); }