Home
Extended ECM
API, SDK, REST and Web Services
List category IDs
Alexis_Degaine
I would like to get the category IDs of a Livelink object (here a folder) in order to be able to modify them.Here is the code I use. I encounter the error:enumerateNames() not implemented for this datatype.According to LAPI documentation, the right type to use for categoryIds is Assoc. It doesn't work. However, I tried to set categoryIds as a List, a Record... but it didn't work.Maybe I miss something... Thanks for any help.________________________________________________int folder_id = 10562547; LLSession session = new LLSession("us-bos-wb918", 2099, null, "Admin", "ll95dev4"); LAPI_DOCUMENTS docs = new LAPI_DOCUMENTS(session); LLValue sourceObjectId = new LLValue().setAssocNotSet(); sourceObjectId.add("ID", folder_id); System.out.println("SourceObjectID: "+sourceObjectId.toValue("ID")); LLValue categoryIds = new LLValue().setAssoc(); docs.ListObjectCategoryIDs(sourceObjectId,categoryIds); LLValue categoryID = new LLValue(); LLNameEnumeration categoryEnumeration = categoryIds.enumerateNames(); while (categoryEnumeration.hasMoreElements()) { String categoryName = categoryID.toString("DisplayName"); System.out.println("CategoryName is: " + categoryName); }
Find more posts tagged with
Comments
sıɹɥɔ
Message from Chris Webster <
cwebster@opentext.com
> via eLink
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">eLink
Hi Alexis,
The LAPI docs say that
ListObjectCategoryIDs
returns a List. So, your
categoryIds
object actually has that kind of LLValue. Having said that, you can't call
enumerateNames
on a List object (as the items in such a LLValue do not have names). That's the reason for the error you're getting.
Also, I should point out that in your code you are iterating through the
categoryIds
object, yet you are referencing a
categoryID
object. (Presumably you've been trying various workarounds and this is just one particular version of your code.)
I'll mention that because LAPI is not strongly typed it's very important to know what kinds of LLValue's you really have. Otherwise you'll get into the situation you are experiencing.
Hope this helps,
-chris
From:
eLink Discussion: LAPI Discussion [mailto:lapi@elinkkc.opentext.com]
Sent:
Friday, May 15, 2009 10:51 AM
To:
eLink Recipient
Subject:
List category IDs
List category IDs
Posted by
alexis.degaine@parexel.com
(Degaine, Alexis) on 2009/05/15 11:46
I would like to get the category IDs of a Livelink object (here a folder) in order to be able to modify them.
Here is the code I use. I encounter the error:
enumerateNames() not implemented for this datatype.
According to LAPI documentation, the right type to use for categoryIds is Assoc. It doesn't work. However, I tried to set categoryIds as a List, a Record... but it didn't work.
Maybe I miss something... Thanks for any help.
________________________________________________
int folder_id = 10562547;
LLSession session = new LLSession("us-bos-wb918", 2099, null, "Admin", "ll95dev4");
LAPI_DOCUMENTS docs = new LAPI_DOCUMENTS(session);
LLValue sourceObjectId = new LLValue().setAssocNotSet();
sourceObjectId.add("ID", folder_id);
System.out.println("SourceObjectID: "+sourceObjectId.toValue("ID"));
LLValue categoryIds = new LLValue().setAssoc();
docs.ListObjectCategoryIDs(sourceObjectId,categoryIds);
LLValue categoryID = new LLValue();
LLNameEnumeration categoryEnumeration = categoryIds.enumerateNames();
while (categoryEnumeration.hasMoreElements())
{
String categoryName = categoryID.toString("DisplayName");
System.out.println("CategoryName is: " + categoryName);
}
Appu_Nair
I am sure Chris pointed out the typo but I did not.anyways having not done this in a while I tried it and here is that java file.Why lapi?In any case I think you are trying to figure out given an objectid such as a foler the category objects that are on it see if this compiles and prints.