示例#1
0
        public CheckoutInfo CheckoutInfo(ObjectIdentity objIdentity)
        {
            ObjectIdentitySet objIdSet = new ObjectIdentitySet();

            objIdSet.Identities.Add(objIdentity);
            List <CheckoutInfo> objList;
            OperationOptions    operationOptions = null;

            versionControlService.Checkout(objIdSet, operationOptions);
            objList = versionControlService.GetCheckoutInfo(objIdSet);
            CheckoutInfo checkoutInfo = objList[0];

            if (checkoutInfo.IsCheckedOut)
            {
                Console.WriteLine("Object "
                                  + checkoutInfo.Identity
                                  + " is checked out.");
                Console.WriteLine("Lock owner is " + checkoutInfo.UserName);
            }
            else
            {
                Console.WriteLine("Object "
                                  + checkoutInfo.Identity
                                  + " is not checked out.");
            }
            versionControlService.CancelCheckout(objIdSet);
            return(checkoutInfo);
        }
示例#2
0
        /// <summary>
        /// Reperimento dei metadati da documentum relativamente allo stato checkedout del documento
        /// </summary>
        /// <param name="documentNumber"></param>
        /// <returns></returns>
        protected virtual CheckoutInfo GetDctmCheckOutInfo(string documentNumber)
        {
            ObjectIdentity identity = null;

            // Reperimento identity del documento da bloccare
            if (DocsPaQueryHelper.isStampaRegistro(documentNumber))
            {
                identity = Dfs4DocsPa.getDocumentoStampaRegistroIdentityByDocNumber(documentNumber);
            }
            else
            {
                identity = Dfs4DocsPa.getDocumentoIdentityByDocNumber(documentNumber);
            }

            if (identity.ValueType == ObjectIdentityType.QUALIFICATION)
            {
                logger.Debug(((Qualification)identity.Value).GetValueAsString());
            }

            ObjectIdentitySet identitySet = new ObjectIdentitySet();

            identitySet.Identities.Add(identity);

            //IVersionControlService service = this.GetVersionServiceInstance();
            IVersionControlService service          = this.GetServiceInstance <IVersionControlService>(true);
            List <CheckoutInfo>    checkOutInfoList = service.GetCheckoutInfo(identitySet);

            if (checkOutInfoList != null && checkOutInfoList.Count > 0)
            {
                return(checkOutInfoList[0]);
            }
            else
            {
                return(null);
            }
        }