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);
}
}
}
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);
}
}
}