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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fetching a document using Oscript/ LAPI

Status
Not open for further replies.

badalc

Programmer
May 23, 2013
4
US
Hi,
I am trying to extract the documents using LAPI. I have used FetchVersion method to achieve this, but that works for only subtype 144. But whenever I am trying to execute this for some custom subtype, I am getting Exception in thread "main" com.opentext.api.LLUnknownFieldException: LLValue unknown field name: FileAttributes exception. Is there any way we can extract the document with custom subtype using LAPI. I have heard that this can be done using oscript but I have no idea on how to do that. Can anyone please let me know how we can use oscript to achive this functionality.

Badal.
 
I am not sure what you are running into but in livelink at its heart are two types of objects one is a container which means that it does not occupy space in a file store.The other one is a versionable item which will occupy a discrete space in a file system.When you say FetchVersion against a subtype=144 that is why it works for you .You cannot do a Fetchversion on a container so in code we do this
Locate a dataid
Is it versionable yes download it
is it container,iterate its children and don't do fetchversion
LAPI basically is unforgiving as to error messages etc.

If you are new to oscript then learning that on your own requires real commitment and training.I am not discouraging you but usually you can do justice only if you set about learning livelink.

If I may ask can you post your code either in C# or Java so I can tell you where I would improve on.

when you arrive at a customsubtype what is the number of that subtype like 144 that you get in lapi.If it is 0,202,201 etc then it is your code problem as I suspected you are trying to do a fetchversion on a folder or container.That is usual pilot error in lapi programming





Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Hi,
Let me tell you in detail what we are doing. We are migrating from livelink to documentum. We are in analysis phase and we are doing a POC with LAPI to extract content and metadata. In the source LL system, along with 144, there are some documents with custom subtype eg - 100010, 100014 etc. These are all pdf/ tif/ txt/ doc files but they are maintained not as 144 but as 100010 or 100014. 100010/ 100014 represents a custom document type Eg - Claim Document. We are able to extract the ACL details or attribute details for documents with these subtypes, but not able to extract the physical document. Wherein for 144, We are able to extract ACL/ Attributes/ Physical document. I am pasting the code, where we are extracting the physical document in a local path -

LLValue config = (new LLValue()).setAssocNotSet();
LLSession llSession = new LLSession("<server_name>", <port_number>, null, "<uid>", "<pwd>", config);
LAPI_DOCUMENTS apiDocument = new LAPI_DOCUMENTS(llSession);
LLValue docInfo = (new LLValue()).setAssocNotSet();
int result = apiDocument.GetObjectInfo(0, objectID, docInfo);
if (result != 0) {
throw new RuntimeException(llSession.getErrMsg());
}
int volumeId = docInfo.toInteger("VOLUMEID");
int versionNumber = docInfo.toInteger("VERSIONNUM");
String fName = docInfo.toString("NAME");
int result1 = apiDocument.FetchVersion(volumeId, objectID, versionNumber, "D:/LAPIPOC/"+fName);
if (result1 != 0) {
throw new RuntimeException(llSession.getErrMsg());
}
It will be really appreciated if you can please help us.

Badal.
 
Suggest you look at the Builder side of the request to see what is happening inside Livelink during the processing, the logs may give you an indication of what the cause is too.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Hi,
Unfortunately we don't have access to the server or logs..
Badal
 
If you do an xmlexport to base64 of
This custom subtype do you
Get a XML doc? If you change the
Mime to PDF then surely you can use
That
Otherwise nothing simple
Can be done you will need somebody
With livelink knowledge advanced
To do this for you
I could also seeing me doing with add
Optional changes to the Object
Exporter. But that again is done
With oscript
If you need syntax for xmlexport
Please let us know

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Thanks appnair....we have tested and its working fine..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top