Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Download livelink docs to hard drive

Status
Not open for further replies.
I got what i was looking for from KC.this is how i did it
//Add a document to Livelink
//this example gets a document from enterprise you have to specify
//folder id and nodeid
//import classes
import com.opentext.api.*;

public class GetDocument
{
private static String Server = "localhost"; //livelink host
private static int Port = 5555; //livelink server port see opentext.ini
private static String DFT = ""; //default database file or schema
private static String User = "Admin"; //username
private static String Pass = "123admin"; //passwd

public static void main (String [] args)
{
try
{
//variables
LLSession session;
LAPI_DOCUMENTS doc;
session = new LLSession (Server, Port, DFT, User, Pass);
doc = new LAPI_DOCUMENTS (session);
int volID, objID,versionID;
String FilePath;
volID = -2000;//Parent VolumeID usually enterprise workspace
objID = 9672;//unique number of an existing document
versionID=0;//currentversion
FilePath = "C:\\livelinkfolders\\text.txt";
//Add the Document
if (doc.FetchVersion(volID, objID, versionID, FilePath) == 0)
{
System.out.println("Document Fetched Successfully");
}
else
{
System.out.println("Failed to fetch Document");

//Error Checking
System.out.println("Status Code: " + session.getStatus());
System.out.println("Api Error: " + session.getApiError());
System.out.println("Error Message: " + session.getErrMsg());
System.out.println("Status Message: " + session.getStatusMessage());
}


}
catch (Throwable e)
{
System.err.println(e.getMessage() );
e.printStackTrace (System.err);
}
}

}
 
hi,

Just a follow-up question on appnair's given code. I also need to fetch documents from the livelink server. My concern is that given a folder path from livelink where you want to get the documents, how can I check if that folder path is valid? Is there any LAPI function that does this?

Thank you in advance.
 
there is no folder concept per se in livelink being an rdbms implementation .it differentiates folders by subtypes in dtree.in my implementation of a download tool this is the logic I used

Start at a known particular folderid(objid)
Ascertain all child items
Check if folder-run recurse on child items

Using lapi you can check for existence of the object and one of the assoc info that it will return is I believe the subtype which you can equate to the foldersubtype.If you wish to see my full implemented code please feel free to publish your id here I will send it as a zip file.
The only dependencies are java 1.4.JDBC classes,xml parser classes or greater since I am using a regex class to do some manipulation of converting unsupported windows filenames the folder/file names.I made it very generic since
the end user need only give a strting path(objid) and a starting base path for the download in an xml file


Freedom is not worth having if it does not include the freedom to make mistakes.
Mahatma Gandhi

appnair

 
I agree appnair, you have to code a recursive function that iterates through the "directories" levels. I had to code a function to translate LiveLink "paths" to IDs.

Cheers.

Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top