我目前正在进行一个涉及 OpenText Content Server 10.5 SP1 更新 2015-03 的项目。
我正在尝试找出是否有可能使用 Java SOAP Web 服务或 REST 通过一次调用从系统类别卷中获取所有类别。
在 Web 服务方面,我发现了 DocumentManagement WSDL GetCategoryDefinition
和 GetCategoryDefinitions
公开的几个方法,它们需要类别 ID 作为参数。
在 REST 方面,我设法获得了对类别的访问权,但经过了相当长的旅程:
- 调用
otcs/cs.exe?func=search.GetCategoryVolume
给出后续调用的 URL 作为响应 - 调用
otcs/cs.exe?func=ll&ObjID=2005&objAction=XMLExport&scope=1
给出系统类别卷的 ID 以及类别 ID - 调用
otcs/cs.exe?func=ll&ObjID=21361&objAction=XMLExport&scope=1
提供有关该类别的所需信息。
我希望通过一次调用返回有关我需要的类别的所有信息。
有可能实现吗?
最佳答案
这是可能的。
你需要做什么:
1.) 找到类别的所有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);
关于java - 如何在一次调用中获取所有 OpenText 内容服务器类别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32882884/