ossiejhmoore

Fetch

Sep 25th, 2012
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package getdocumentstatsforstructure;
  6.  
  7. import com.opentext.api.LAPI_DOCUMENTS;
  8. import com.opentext.api.LLSession;
  9. import com.opentext.api.LLValue;
  10.  
  11. /**
  12.  *
  13.  * @author mooreo
  14.  */
  15. public class TestFetchVersion {
  16.     private static LLSession session = new LLSession("hostname", 2099, null, "username", "passowrd");
  17.     public static void main(String [] args) throws Throwable {
  18.        
  19.        
  20.         LAPI_DOCUMENTS apiDoc = new LAPI_DOCUMENTS(session);
  21.         int dataid = 6840021;
  22.        
  23.         LLValue objInfo = (new LLValue()).setAssocNotSet();
  24.         check(apiDoc.GetObjectInfo(0, dataid, objInfo));
  25.        
  26.         check(apiDoc.FetchVersion(objInfo.toInteger("VOLUMEID"), objInfo.toInteger("ID"), objInfo.toInteger("VERSIONNUM"), "c:\\temp\\blah.dat"));
  27.        
  28.     }
  29.    
  30.     private static void check(int i) {
  31.         if (i != 0) {
  32.             throw new RuntimeException(session.getStatusMessage());
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment