I'm getting the following error while uploading documents to Livelink. I'm a newbie and not sure how to debug the error. Below is the code.
2013-01-07 15:31:08,407 DEBUG [main] docwf.storage.pushlivelink.LLFileUploader - start(), startingNodeID =888243
2013-01-07 15:31:08,407 INFO [main] docwf.storage.pushlivelink.LLFileUploader - At prop 1
2013-01-07 15:31:08,549 ERROR [main] docwf.storage.pushlivelink.LLFileUploader - Exception adding document //server4/Test_Upload/55801_1202448786760__v1_080208.pdf to Livelink location
Property number 1get(name) not implemented for this datatype
com.opentext.api.LLIllegalOperationException: get(name) not implemented for this datatype
at com.opentext.api.LLInstance.get(LLInstance.java:72)
at com.opentext.api.LLValue.toString(LLValue.java:701)
at com.boa.docwf.component.storage.livelink.LLLibrary.addDoc(LLLibrary.java:2249)
at com.boa.docwf.storage.pushlivelink.LLFileUploader.uploadFiles(LLFileUploader.java:143)
at com.boa.docwf.storage.pushlivelink.LLFileUploader.start(LLFileUploader.java:204)
at com.boa.docwf.storage.pushlivelink.PrimaryClass.main(PrimaryClass.java:30)
package com.boa.docwf.storage.pushlivelink;
import com.boa.docwf.component.storage.livelink.LLLibrary;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import org.apache.log4j.Logger;
public class LLFileUploader
{
public void uploadDirectories(int startingNodeID, Properties monsterProp, LLLibrary theLib, Logger theLog)
{
int totalDirectoryCount = Integer.parseInt(monsterProp.getProperty("totalDirectoryCount"));
StringBuffer dirPath = new StringBuffer();
StringBuffer dirTitle = new StringBuffer();
for (int y = 1; y <= totalDirectoryCount; y++)
{
dirPath.delete(0, dirPath.length());
dirTitle.delete(0, dirTitle.length());
dirPath.append(monsterProp.getProperty("DirectoryPath" + y));
dirTitle.append(monsterProp.getProperty("DirectoryName" + y));
try
{
theLib.addFolder(startingNodeID, dirPath.toString(), dirTitle.toString(), 0, null, null);
theLog.info("Created dir " + dirPath + "/" + dirTitle + " on Livelink server: property number " + y);
}
catch (Exception e)
{
theLog.error("Exception adding directory " + dirTitle + " to Livelink location " + dirPath + "\nProperty number " + y + e.getMessage(), e);
}
}
}
public void uploadFiles(int startingNodeID, Properties monsterProp, LLLibrary theLib, Logger theLog)
{
int totalFileCount = Integer.parseInt(monsterProp.getProperty("totalFileCount"));
StringBuffer filePath = new StringBuffer();
StringBuffer itemTitle = new StringBuffer();
StringBuffer livelinkPath = new StringBuffer();
int result = 0;
for (int x = 1; x <= totalFileCount; x++) {
theLog.info("At prop " + x);
livelinkPath.delete(0, livelinkPath.length());
itemTitle.delete(0, itemTitle.length());
filePath.delete(0, filePath.length());
livelinkPath.append(monsterProp.getProperty("LivelinkPath" + x));
itemTitle.append(monsterProp.getProperty("LivelinkTitle" + x));
filePath.append(monsterProp.getProperty("rootPath" + x));
try
{
result = theLib.addDoc(startingNodeID, livelinkPath.toString(), itemTitle.toString(), filePath.toString(), 0, null, null);
theLog.info("Added to livelink: " + monsterProp.getProperty(new StringBuffer().append("rootPath").append(x).toString()) + " ; node ID=" + result + "; property number " + x);
}
catch (Exception e)
{
theLog.error("Exception adding document " + filePath + " to Livelink location " + livelinkPath + "\nProperty number " + x + e.getMessage(), e);
}
}
}
public void start(Properties theProp, Logger theLog)
{
try
{
LLLibrary theLib = new LLLibrary(theProp.getProperty("LL_USER"), theProp.getProperty("LL_PASS"), theProp.getProperty("LL_SERVER"), Integer.parseInt(theProp.getProperty("LL_PORT")));
Properties monsterProp = new Properties();
monsterProp.load(new FileInputStream(theProp.getProperty("monsterPropFile")));
int startingNodeID;
if ((theProp.getProperty("LLRootObjID") != null) && (theProp.getProperty("LLRootObjID").length() > 3))
startingNodeID = Integer.parseInt(theProp.getProperty("LLRootObjID"));
else {
startingNodeID = getStartingNodeID(theProp.getProperty("LLRootPath"), theLib);
}
String impersonateUser = theProp.getProperty("LL_IMPERSONATE_USER");
if ((impersonateUser != null) && (impersonateUser.length() > 0)) {
theLib.ImpersonateLivelinkUser(impersonateUser);
theLog.debug("start(), impersonating user " + impersonateUser);
}
theLog.debug("start(), startingNodeID =" + startingNodeID);
uploadDirectories(startingNodeID, monsterProp, theLib, theLog);
uploadFiles(startingNodeID, monsterProp, theLib, theLog);
}
catch (IOException IOEx) {
theLog.error("IOException occured" + IOEx.getMessage(), IOEx);
} catch (IllegalArgumentException illArgEx) {
theLog.error("IllegalArgumentException occurred" + illArgEx.getMessage(), illArgEx);
}
catch (Exception e)
{
theLog.error("Exception occurred" + e.getMessage(), e);
}
}
private int getStartingNodeID(String llRootPath, LLLibrary theLib) throws Exception
{
int startingNodeID = -1;
startingNodeID = theLib.pathToID(llRootPath, -1, null);
return startingNodeID;
}
}
2013-01-07 15:31:08,407 DEBUG [main] docwf.storage.pushlivelink.LLFileUploader - start(), startingNodeID =888243
2013-01-07 15:31:08,407 INFO [main] docwf.storage.pushlivelink.LLFileUploader - At prop 1
2013-01-07 15:31:08,549 ERROR [main] docwf.storage.pushlivelink.LLFileUploader - Exception adding document //server4/Test_Upload/55801_1202448786760__v1_080208.pdf to Livelink location
Property number 1get(name) not implemented for this datatype
com.opentext.api.LLIllegalOperationException: get(name) not implemented for this datatype
at com.opentext.api.LLInstance.get(LLInstance.java:72)
at com.opentext.api.LLValue.toString(LLValue.java:701)
at com.boa.docwf.component.storage.livelink.LLLibrary.addDoc(LLLibrary.java:2249)
at com.boa.docwf.storage.pushlivelink.LLFileUploader.uploadFiles(LLFileUploader.java:143)
at com.boa.docwf.storage.pushlivelink.LLFileUploader.start(LLFileUploader.java:204)
at com.boa.docwf.storage.pushlivelink.PrimaryClass.main(PrimaryClass.java:30)
package com.boa.docwf.storage.pushlivelink;
import com.boa.docwf.component.storage.livelink.LLLibrary;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import org.apache.log4j.Logger;
public class LLFileUploader
{
public void uploadDirectories(int startingNodeID, Properties monsterProp, LLLibrary theLib, Logger theLog)
{
int totalDirectoryCount = Integer.parseInt(monsterProp.getProperty("totalDirectoryCount"));
StringBuffer dirPath = new StringBuffer();
StringBuffer dirTitle = new StringBuffer();
for (int y = 1; y <= totalDirectoryCount; y++)
{
dirPath.delete(0, dirPath.length());
dirTitle.delete(0, dirTitle.length());
dirPath.append(monsterProp.getProperty("DirectoryPath" + y));
dirTitle.append(monsterProp.getProperty("DirectoryName" + y));
try
{
theLib.addFolder(startingNodeID, dirPath.toString(), dirTitle.toString(), 0, null, null);
theLog.info("Created dir " + dirPath + "/" + dirTitle + " on Livelink server: property number " + y);
}
catch (Exception e)
{
theLog.error("Exception adding directory " + dirTitle + " to Livelink location " + dirPath + "\nProperty number " + y + e.getMessage(), e);
}
}
}
public void uploadFiles(int startingNodeID, Properties monsterProp, LLLibrary theLib, Logger theLog)
{
int totalFileCount = Integer.parseInt(monsterProp.getProperty("totalFileCount"));
StringBuffer filePath = new StringBuffer();
StringBuffer itemTitle = new StringBuffer();
StringBuffer livelinkPath = new StringBuffer();
int result = 0;
for (int x = 1; x <= totalFileCount; x++) {
theLog.info("At prop " + x);
livelinkPath.delete(0, livelinkPath.length());
itemTitle.delete(0, itemTitle.length());
filePath.delete(0, filePath.length());
livelinkPath.append(monsterProp.getProperty("LivelinkPath" + x));
itemTitle.append(monsterProp.getProperty("LivelinkTitle" + x));
filePath.append(monsterProp.getProperty("rootPath" + x));
try
{
result = theLib.addDoc(startingNodeID, livelinkPath.toString(), itemTitle.toString(), filePath.toString(), 0, null, null);
theLog.info("Added to livelink: " + monsterProp.getProperty(new StringBuffer().append("rootPath").append(x).toString()) + " ; node ID=" + result + "; property number " + x);
}
catch (Exception e)
{
theLog.error("Exception adding document " + filePath + " to Livelink location " + livelinkPath + "\nProperty number " + x + e.getMessage(), e);
}
}
}
public void start(Properties theProp, Logger theLog)
{
try
{
LLLibrary theLib = new LLLibrary(theProp.getProperty("LL_USER"), theProp.getProperty("LL_PASS"), theProp.getProperty("LL_SERVER"), Integer.parseInt(theProp.getProperty("LL_PORT")));
Properties monsterProp = new Properties();
monsterProp.load(new FileInputStream(theProp.getProperty("monsterPropFile")));
int startingNodeID;
if ((theProp.getProperty("LLRootObjID") != null) && (theProp.getProperty("LLRootObjID").length() > 3))
startingNodeID = Integer.parseInt(theProp.getProperty("LLRootObjID"));
else {
startingNodeID = getStartingNodeID(theProp.getProperty("LLRootPath"), theLib);
}
String impersonateUser = theProp.getProperty("LL_IMPERSONATE_USER");
if ((impersonateUser != null) && (impersonateUser.length() > 0)) {
theLib.ImpersonateLivelinkUser(impersonateUser);
theLog.debug("start(), impersonating user " + impersonateUser);
}
theLog.debug("start(), startingNodeID =" + startingNodeID);
uploadDirectories(startingNodeID, monsterProp, theLib, theLog);
uploadFiles(startingNodeID, monsterProp, theLib, theLog);
}
catch (IOException IOEx) {
theLog.error("IOException occured" + IOEx.getMessage(), IOEx);
} catch (IllegalArgumentException illArgEx) {
theLog.error("IllegalArgumentException occurred" + illArgEx.getMessage(), illArgEx);
}
catch (Exception e)
{
theLog.error("Exception occurred" + e.getMessage(), e);
}
}
private int getStartingNodeID(String llRootPath, LLLibrary theLib) throws Exception
{
int startingNodeID = -1;
startingNodeID = theLib.pathToID(llRootPath, -1, null);
return startingNodeID;
}
}