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

Need help in adding document with LAPI

Status
Not open for further replies.

bkoral

Programmer
Sep 27, 2007
1
TR
Hi I am trying to run this java code but I get this exception:
com.opentext.api.LLIllegalOperationException: get(name) not implemented for this datatype
at com.opentext.api.LLInstance.get(Unknown Source)
at com.opentext.api.LLValue.toValue(Unknown Source)
at com.opentext.api.LLConnect.unMarshall(Unknown Source)
at com.opentext.api.LAPI_DOCUMENTS.AddDocument(Unknown Source)
at tr.com.ssm.file.lapi.readwrite.WriteDoc.main(WriteDoc.java:40)


I am not sure where I am doing wrong. I am new to LAPI and any help will be highly appreciated. I am attaching the code here.I get this sample code from "appnair"s site and I am trying to develop something like this too but I started studying with LAPI yesterday.

Thanks & Regards,
Beste

package tr.com.ssm.file.lapi.readwrite;
import com.opentext.api.*;
public class WriteDoc {
private static String Server = "10.0.2.4";
private static int Port = 2099;
private static String DFT = "";
private static String User = "Admin";
private static String Pass = "livelink";

public static void main (String [] args)
{
try
{
//variables
LLSession session;
LAPI_DOCUMENTS doc;
LLValue entInfo= new LLValue();
LLValue objInfo = new LLValue();
LLValue verInfo = new LLValue();
session = new LLSession (Server, Port, DFT, User, Pass);
doc = new LAPI_DOCUMENTS (session);
int volumeID,objectID,objID;
String objName, FilePath;
if(doc.AccessEnterpriseWS(entInfo) != 0)
{
System.out.println("AccessEnterpriseWS Failed.");
return;
}
else
{
volumeID = entInfo.toInteger("VolumeID");
objectID = entInfo.toInteger("ID");
System.out.println("Enterprise Volume"+volumeID+"Enterprise ObjID"+objectID);
}
objID = 2000;
objName = "New Document";
FilePath = "C:\\temp\\AddDocument.java";

System.out.println("volumeID"+volumeID+"objID"+objID+"FilePath"+FilePath+"objInfo"+objInfo+"verInfo"+verInfo);
if (doc.AddDocument(volumeID, objID, objName, FilePath, objInfo, verInfo) == 0)
{
System.out.println("This version's name is"+verInfo.toString("Name"));
System.out.println("This version's created at "+objInfo.toDate("CreateDate"));
System.out.println("This objects id is"+verInfo.toInteger("NodeID"));
System.out.println("Document Added Successfully");
}
else
{
System.out.println("Failed to Add 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);
}

}
}
 
It looks like your livelink may have come from an upgarde so your hardcoding of obJid=2000 may not be correct.Just let the lapi call give you the enterprise objid.If i hard coded the ojid to 2000 sorry my bad.Or if you don't want it to land on the enterpise just figure out a folder to which the user has permissions and put the document there.

change your objID=objectID or put the variable correctly in the call.


BTW:my code was written when I was a starter also.Don't worry you will get better and we are all here to help you.


Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top