简体   繁体   中英

Need a way to delete a file in Livelink from a cmd prompt

Would there be a way to delete a file in Livelink (OpenText Content Server 10 to be exact) from a command prompt?

I should delete more than 7000 documents, thus it would be quite slow to do it manually. I could generate the object ID's from SQL Server and ideally would run the delete calls one-by-one programmatically on command line.

You have many options to do it but not from the CMD.

  1. If you have access to the database you can change item parentId to common folder and then delete that folder. Be careful when playing around with DB directly.
  2. You can built LAPI application if you are familiar with coding.
  3. If you have web services you can use custom application or program like JMeter, SoapUI to delete all documents.
  4. Use LL Explorer to delete them

....

It depends how many times you have to execute this job.

You can, of course, write a console app for deleting files in LiveLink. You can use LiveLink API (LAPI):

    public static bool DeleteLLObject( int iNodeID, int iVolumeID)
    {
        try
        {               
            LLSession mySession = new LLSession(strHost, iPort, string.Empty, strUser, strPwd);
            LAPI_DOCUMENTS lapiDoc = new LAPI_DOCUMENTS(mySession);

            int iResult = lapiDoc.DeleteObject(iVolumeID, iNodeID);
            if (iResult != 0)
            {
                string strErrMsg = mySession.getErrMsg();
                throw new Exception(strErrMsg);
            }
        }
       catch (Exception ex)
       {
            var strMsg = string.Format("The object cannot be deleted due to the reason:\n\n{0}", ex.Message);
            Console.Out.WriteLine(strMsg);
            return false;
       }
       return true;
   }      

It will be hard to use this code for deleting of multiple files at onece, since you need to identify and enter Node Id and Volume ID for every file.

It is better to use LiveLink Explorer (as already suggested) or a third party tool like DMS-Shuttle for LiveLink. There is a 15 days trial: http://dms-shuttle.com/downloads/ . I am working for the vendor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM