如何在一次调用中获取所有 OpenText 内容服务器类别?

How to get all OpenText Content Server categories in one call?

我目前正在进行一个涉及 OpenText Content Server 10.5 SP1 更新 2015-03 的项目。

我正在尝试找出是否有可能使用 Java SOAP Web 服务或 REST 通过一次调用从系统类别卷中获取所有类别。

在 Web 服务方面,我发现了 DocumentManagement WSDL GetCategoryDefinitionGetCategoryDefinitions 公开的几个方法,它们需要类别 ID 作为参数。

在 REST 方面,我设法获得了对类别的访问权限,但经过相当长的旅程:

  1. 调用 otcs/cs.exe?func=search.GetCategoryVolume 为后续调用
  2. 提供 URL 作为响应
  3. 调用 otcs/cs.exe?func=ll&ObjID=2005&objAction=XMLExport&scope=1 给出系统类别卷的 ID 以及类别 ID
  4. 调用 otcs/cs.exe?func=ll&ObjID=21361&objAction=XMLExport&scope=1 提供有关该类别的所需信息。

我希望通过一个电话返回我需要的有关类别的所有信息。

有可能实现吗?

有可能。

您需要做的事情:

1.) 找到Categories的所有ID,你想要

的定义

2.) 调用 DocumentManagementWS.getCategoryDefinitions(IDs)

例子

在我的项目中,我们将所有类别存储在文件夹中,而不是在内容服务器的类别卷中。

// INFO: variable dm is an instance of the documentManagement-Webservice

// 1.) read the folder of the Categories
Node categoryRoot = dm.getNodeByPath(configRoot.getID(), Arrays.asList("Categories"));

// 2.) find all Ids of the categories
List<Node> categories = dm.listNodes(categoryRoot.getID(), false);

if (categories != null) {
    for (Node category : categories) {
        if (category.getType().equals("Category")) {
            categoryIds.add(category.getID());
        }
    }
}

// 3.) Read all defintitions of the categories
List<AttributeGroupDefinition> categoryDefinitions = dm.getCategoryDefinitions(categoryIds);

也许不完全是面向程序的,但您知道处理程序“cs.exe?func=attributes.dump”吗?这是您所问内容的 UI 版本。