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!

LLIllegalOperationException: get(name) not implemented for this datatype

Status
Not open for further replies.

canderton

Programmer
Jan 7, 2013
3
US
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;
}
}
 
Do you not see this in your exception
Code:
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
as a programmer I understand this as a livelink folder id not populated

If the folder was there you would not see this "Livelink location"

somewhere in your code you are creating folders dynamically and adding it to where you want files added.You are unfortunately expecting all goes well with your dir creation.

get(name) is basically because you asked lapi to parse a return data structure that does not have the results

an e.g how you can simulate get(name)
you create a call called doc.accessenterprise(lapi return value of assoc)
now if the call succeeds you will be able to enumerate the fields in the return value.all lapi calls will return 0 for success which means that the call went successful
if for some reason if the call wasn't successful and you had a code piece that said "give me the object id of enterprise" the client lapi routine will try and say that
"get(name)" is not implemented.

Most lapi programmers will put a call to ascertain that each lapi call succeeds before enumeration.




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
 
you can also check if this dataid 888243 in the livelink where the livelink code is executing what if the id is in a developers machine and where you want it needed to be tweaked

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
 
[pc2]Thanks guys.... My problem was I had the incorrect port number to connect to the server, therefore the get(name) wasn't returning any values... Adding a connection exception in my code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top