smallredville
Programmer
Hi All,
Through this post, I would like to ask anyone who encountered this before :
I can execute the following code successfully but the owned by of the document does not change at all. Only the Created By of the document which changed.
Note : I used UserID and UpdateObjectInfo()
//to get Object related items
import java.util.*;//for our date manip
import com.opentext.api.*;//this needs to be in your classpath
public class Main
{
private static String Server = "127.0.0.1"; //livelink host
private static int Port = 2099; //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 = "password"; //passwd
public static void main (String [] args)
{
try
{
//LAPI variables
LLSession session;
LAPI_DOCUMENTS doc;
session = new LLSession (Server, Port, DFT, User, Pass);
doc = new LAPI_DOCUMENTS (session);
LLValue LLvalueABS=new LLValue().setAssocNotSet();//will contain the return values
int volID, objID,versionID;
volID = -2000;//Parent VolumeID usually enterprise workspace
//use accessenterprise call if you do not like hardcoding
objID = 819361;//unique number of our object
//Query the task or for that matter anything
if (doc.GetObjectInfo(-2000,objID,LLvalueABS) == 0)
{
System.out.println("Object located Successfully");
int CreatedBy = - LLvalueABS.toInteger("CreatedBy");
int ownedby = LLvalueABS.toInteger("UserID");
System.out.println("this was created by"+CreatedBy);
System.out.println("this was owned by " + ownedby);
int newid = 821780;
LLvalueABS.add("UserID",newid);
doc.UpdateObjectInfo( volID, objID, LLvalueABS ) ;
int ownedby2 = LLvalueABS.toInteger("UserID");
System.out.println("this was owned 2 by " + ownedby2);
}
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);
}
}
}
Lastly, I would like to say many thanks in advance.
Regards,
smallredville
Through this post, I would like to ask anyone who encountered this before :
I can execute the following code successfully but the owned by of the document does not change at all. Only the Created By of the document which changed.
Note : I used UserID and UpdateObjectInfo()
//to get Object related items
import java.util.*;//for our date manip
import com.opentext.api.*;//this needs to be in your classpath
public class Main
{
private static String Server = "127.0.0.1"; //livelink host
private static int Port = 2099; //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 = "password"; //passwd
public static void main (String [] args)
{
try
{
//LAPI variables
LLSession session;
LAPI_DOCUMENTS doc;
session = new LLSession (Server, Port, DFT, User, Pass);
doc = new LAPI_DOCUMENTS (session);
LLValue LLvalueABS=new LLValue().setAssocNotSet();//will contain the return values
int volID, objID,versionID;
volID = -2000;//Parent VolumeID usually enterprise workspace
//use accessenterprise call if you do not like hardcoding
objID = 819361;//unique number of our object
//Query the task or for that matter anything
if (doc.GetObjectInfo(-2000,objID,LLvalueABS) == 0)
{
System.out.println("Object located Successfully");
int CreatedBy = - LLvalueABS.toInteger("CreatedBy");
int ownedby = LLvalueABS.toInteger("UserID");
System.out.println("this was created by"+CreatedBy);
System.out.println("this was owned by " + ownedby);
int newid = 821780;
LLvalueABS.add("UserID",newid);
doc.UpdateObjectInfo( volID, objID, LLvalueABS ) ;
int ownedby2 = LLvalueABS.toInteger("UserID");
System.out.println("this was owned 2 by " + ownedby2);
}
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);
}
}
}
Lastly, I would like to say many thanks in advance.
Regards,
smallredville