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

can't fetch category attribute info

Status
Not open for further replies.

ujjval090683

Programmer
Nov 1, 2011
31
IN
Hi,
I am trying to fetch livelink category attribute information using lapiDocuments.FetchCategoryVersion(CatID, CatVer);

I am able to fetch using this in my Livelink server, but when I run into other livelink server which is also 9.5 only I am getting below error:

Error in retriving Attribute Information
com.opentext.api.LLIllegalOperationException: get(name) not implemented for this datatype

This is comming in log file. Below comes on console:

java.io.UnsupportedEncodingException:
at sun.io.Converters.getConverterClass(Unknown Source)
at sun.io.Converters.newConverter(Unknown Source)
at sun.io.CharToByteConverter.getConverter(Unknown Source)
at java.lang.StringCoding.encode(Unknown Source)
at java.lang.String.getBytes(Unknown Source)
at com.opentext.api.LLOutputStream.writeString(Unknown Source)
at com.opentext.api.LLString.format(Unknown Source)
at com.opentext.api.LLValue.format(Unknown Source)
at com.opentext.api.LLOutputStream.writeValue(Unknown Source)
at com.opentext.api.LLAssoc.format(Unknown Source)
at com.opentext.api.LLValue.format(Unknown Source)
at com.opentext.api.LLOutputStream.writeValue(Unknown Source)
at com.opentext.api.LLConnect.executeTraditional(Unknown Source)
at com.opentext.api.LLConnect.execute(Unknown Source)
at com.opentext.api.LAPI_DOCUMENTS.FetchCategoryVersion(Unknown Source)
at LLUtility.getCatDetails(LLUtility.java:318)
at LLUtility.llUtility(LLUtility.java:258)
at LLUtility.main(LLUtility.java:301)


What can be done? It is working fine in my Server. No idea why this is happening.

Fr UnsupportedEncodingException I google and it says some Local is not set to English or characterset.jar is not present, but both are correct. Jar is there and also Local is engish.So I guess tghe first error which I am getting "get(name) is the cause.

Anybody can help me in this?
 
I Used Below code:

LAPI_DOCUMENTS lapiDocuments = new LAPI_DOCUMENTS(llSession);

LLValue attrCatID = new LLValue().setAssoc();
attrCatID.add("ID",CatID);
attrCatID.add("Version",0); ---- Shoudl I add this line?
LLValue attrCatVer = new LLValue().setAssoc();

lapiDocuments.FetchCategoryVersion(attrCatID, attrCatVer);

I ran above code with version value passed and witout pass. But it is not working.


 
JUST SOME GENERAL GUIDELINES

get(Name) is because you are not trapping session statuses in your code.
for eg in this snippet of code I am making a LAPI call
Code:
	LLValue libData = ( new LLValue() ).setAssoc();		// declare an assoc to hold the enterprise volume info

		LAPI_DOCUMENTS documents = new LAPI_DOCUMENTS( session ); 	// create a new Library object
		
		if (documents.AccessEnterpriseWS( libData ) == 0){ 		// get the Enterprise volume item
			volId = libData.toInteger("VolumeID");			// grab and convert the volume id
			objId = libData.toInteger("ID");				// grab and convert the object id
			status = crawl(volId, objId, "", documents);		// call the crawl routine to crawl the tree
		}


When your client program runs it will call the LAPI -Function AccessEnterpriseWS.If it is ZERO then the output variable 'libData'
will contain parsable info which is happening at client side.

Now if I did not put that call check to see if I suceeded and tried to parse libdata I would get similar errosr like you have.

If the call does not succeed and the return value is NOT ZERO then lapi will send a positive number and some user freindly messages
in session which you can understand.

So one can write this like this

Code:
	LLValue libData = ( new LLValue() ).setAssoc();		// declare an assoc to hold the enterprise volume info

		LAPI_DOCUMENTS documents = new LAPI_DOCUMENTS( session ); 	// create a new Library object
		
		if (documents.AccessEnterpriseWS( libData ) == 0){ 		// get the Enterprise volume item
			volId = libData.toInteger("VolumeID");			// grab and convert the volume id
			objId = libData.toInteger("ID");			// grab and convert the object id
			status = crawl(volId, objId, "", documents);		// call the crawl routine to crawl the tree
		}
		else
		//LAPI CALL FAILED LET US NOT PARSE ANY OUTPUT THAT WE WERE EXPECTING and print session status
		{
		GetErrors(session);
		}
		
		
		
		
		//This function outputs any errors from the session
			public static void GetErrors(LLSession session)
			{
				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());
	}

In very rare circumstances livelink may crash or not send something tou your code.That can only be figured out by looking at livelink
server side logs.DO NOT TRY TO PARSE A LAPI OUTPUT VARIABLE WITHOUT CHECKING WHETHER YOUR LAPI CALL FIRST SUCEEDED OR NOT

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top