// which specifies the kind of object being looked up
// (there's only one legal value currently) and
// Version, which specifies which version of the
// object to use (the default is the current
// version).
ClientValue objIdAssoc = valueFactory.createAssoc();
objIdAssoc.add("ID", objectId);
ClientValue categoryIds = client.ListObjectCategoryIDs(objIdAssoc);
// Loop over the categories.
int numCategories = categoryIds.size();
for (int i = 0; i < numCategories; i++) {
ClientValue categoryId = categoryIds.toValue(i);
// If this Category is not in the included list, or it is
// explicitly mentioned in the excluded list, then skip it.
Integer id = new Integer(categoryId.toInteger("ID"));
if (((includedCategories != null) &&
!includedCategories.contains(id)) ||
((excludedCategories != null) &&
excludedCategories.contains(id)))
continue;
// Make sure we know what type of categoryId
// object we have. There are also Workflow
// category attributes which can't be read here.
int categoryType = categoryId.toInteger("Type");
if (Client.CATEGORY_TYPE_LIBRARY != categoryType) {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.finer("Unknown category implementation type " +
categoryType + "; skipping");
}
continue;
}
if (includeCategoryNames) {
// XXX: This is the only property name that is
// hard-coded here like this. I think that's OK,
// because the recarray fields are just hard-coded
// someplace else. "Category" is an ObjectInfo
// attribute name that is unused in Livelink 9.0 or
// later.
ClientValue name = categoryId.toValue("DisplayName");
if (name.hasValue())
props.addProperty("Category", name);
}
ClientValue categoryVersion =
client.GetObjectAttributesEx(objIdAssoc, categoryId);
ClientValue attrNames =
client.AttrListNames(categoryVersion, null);
// Loop over the attributes for this category.
int numAttributes = attrNames.size();
for (int j = 0; j < numAttributes; j++) {
String attrName = attrNames.toString(j);
ClientValue attrInfo =
client.AttrGetInfo(categoryVersion, attrName, null);
int attrType = attrInfo.toInteger("Type");
if (Client.ATTR_TYPE_SET == attrType) {
getAttributeSetValues(nameHandler, props, id, categoryVersion,
attrName);
} else {
getAttributeValue(nameHandler, props, id, categoryVersion,