Cognos 8 SDK:如何获取组的子组?

发布于 2024-08-17 18:26:02 字数 131 浏览 4 评论 0原文

我尝试在标准 Cognos 命名空间中获取组的子组。

查询内容存储以获取所有组工作正常。 获取对象“成员”的标准方法返回用户或仅返回“根”组(我想要其子组的组)。没有别的......

我做错了什么还是只是“不该做”?

I try to get the Subgroup of a Group in the standard Cognos Namespace.

Quering the Contentstore to get ALL groups works fine.
The standard methodes to get "members" of objects return the users or only the "root" group (the group I want the subgroups of). Nothing else....

Am I doing something wrong or is it just "not to be done" ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撞了怀 2024-08-24 18:26:02

我找到了一种方法:

假设您拥有所需子组的组的搜索路径。
使用以下 PropEnum 查询内容存储:

PropEnum[] props = { 
    PropEnum.defaultName, 
    PropEnum.searchPath, 
    PropEnum.members };

结果你得到一个 BaseClass[] 对象(尽管只有一个元素......)。
导入 com.cognos.developer.schemas.bibus._3.Group <--- 这是 Cognos SDK 库的一部分,并且
现在您可以将 object[0] 转换为 Group。

object.getMembers().getValue()[] 是所有成员的数组,包括组、角色、帐户。

在java中它看起来像这样(查询已经完成的对象):

Group group = (Group)object[0];
BaseClass obj = null;
for (int i = 0; i < group.getMembers().getValue().length; i++){
   obj = group.getMembers().getValue();
   System.out.println(obj.getSearchPath().getValue());
}

I found a way of doing it:

Assuming you have the searchpath for the group you want the subgroups of.
Query the contentstore for it with following PropEnum:

PropEnum[] props = { 
    PropEnum.defaultName, 
    PropEnum.searchPath, 
    PropEnum.members };

As result you get a BaseClass[] object (with only one element though...).
Import com.cognos.developer.schemas.bibus._3.Group <--- this is part of the Cognos SDK libraries and
now you can cast the object[0] to Group.

object.getMembers().getValue()[] is an array of all members INCLUDING groups, roles, accounts.

In java it looks like this (query for the object already done):

Group group = (Group)object[0];
BaseClass obj = null;
for (int i = 0; i < group.getMembers().getValue().length; i++){
   obj = group.getMembers().getValue();
   System.out.println(obj.getSearchPath().getValue());
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文