第一范文网 - 专业文章范例文档资料分享平台

Cognos 8 SDK简介 

来源:用户分享 时间:2025/8/24 16:03:00 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

new BaseClass[group.getMembers().getValue().length - 1]; int index = 0; BaseClass obj = null; for (int i = 0; i < group.getMembers().getValue().length; i++) { obj = group.getMembers().getValue()[i]; BaseClass[] memberProps = csHandler.queryObjectInCS(connection, obj.getSearchPath().getValue()); if (memberProps[0] .getDefaultName() .getValue() .compareTo(member.getDefaultName().getValue()) != 0 && memberProps[0].getSearchPath().getValue().compareTo( member.getSearchPath().getValue()) != 0) { newMembers[index] = obj; index++; } } group.setMembers(new BaseClassArrayProp()); group.getMembers().setValue(newMembers); // 更新成员. csHandler.updateObjectInCS(connection, objects); }

/**

* 从指定角色中删除指定成员. *

* @param connection Cognos 8连接

* @param pathOfRole 角色的搜索路径. * @param member 成员对象. * */

public void removeFromRole( CRNConnect connection, String pathOfRole, BaseClass member)

throws java.rmi.RemoteException { //得到当前角色下的成员. PropEnum[] props = { PropEnum.defaultName, PropEnum.searchPath, PropEnum.members }; BaseClass[] objects = csHandler.queryObjectInCS(connection, pathOfRole, props); Role role = (Role)objects[0]; // 保留除待删除成员外的所有成员. BaseClass[] newMembers = new BaseClass[role.getMembers().getValue().length - 1]; int index = 0; String csMember; String csMemberPath; BaseClass obj = null; for (int i = 0; i < role.getMembers().getValue().length; i++) { obj = role.getMembers().getValue()[i]; BaseClass[] memberProps = csHandler.queryObjectInCS(connection, obj.getSearchPath().getValue()); csMember = memberProps[0].getDefaultName().getValue(); csMemberPath = memberProps[0].getSearchPath().getValue(); if ((csMember.compareTo(member.getDefaultName().getValue()) != 0) &&

(csMemberPath.compareTo(member.getSearchPath().getValue()) != 0)) { newMembers[index] = obj; index++; } } role.setMembers(new BaseClassArrayProp()); role.getMembers().setValue(newMembers); // 更新成员. csHandler.updateObjectInCS(connection, objects); }

/**

*删除指定用户组. *

* @param connection Cognos 8连接

* @param groupSearchPath 待删除组的搜索路径. * @return 返回成功字符串. * */

public String deleteGroup(CRNConnect connection, String groupSearchPath) throws java.rmi.RemoteException { //根据搜索路径创建对象 Group obj = new Group(); obj.setSearchPath(new StringProp()); obj.getSearchPath().setValue(groupSearchPath); //从内容库中删除 csHandler.deleteObjectFromCS(connection, obj); }

return (\

/**

* 删除指定的角色. *

* @param connection Cognos 8连接 * @param roleSearchPath 待删除的角色. * @return 返回的成功信息. * */

public String deleteRole(CRNConnect connection, String roleSearchPath) throws java.rmi.RemoteException { //根据搜索路径创建角色对象 Role obj = new Role(); obj.setSearchPath(new StringProp()); obj.getSearchPath().setValue(roleSearchPath); }

//从内容库中删除角色对象

csHandler.deleteObjectFromCS(connection, obj); return (\

/**

* 得到指定成员的信息. *

* @param connection Cognos 8连接

* @param pathOfUser 成员的搜索路径 * @return 返回成员信息. * */

public BaseClass[] getMemberInfo( CRNConnect connection, String pathOfUser) { //设置查询参数 BaseClass groups[] = new BaseClass[] {}; PropEnum props[] = new PropEnum[] { PropEnum.searchPath, PropEnum.defaultName }; try { //找到成员对象数组 groups = connection.getCMService().query( new SearchPathMultipleObject(pathOfUser), props, new Sort[] {}, new QueryOptions()); } catch (Exception e) { System.out.println(e); } return groups; }

/**

* 从指定组中找到成员 *

* @param connection Cognos 8连接

* @param group 组或角色的搜索路径. * */

public BaseClass[] getAvailableMembers(CRNConnect connection, String group) { //查找属性 PropEnum props[] =

new PropEnum[] { PropEnum.searchPath, PropEnum.defaultName, PropEnum.members }; BaseClass[] availableMembers; try { //找出成员 availableMembers = csHandler.queryObjectInCS(connection, group, props); return availableMembers; } catch (java.rmi.RemoteException remoteEx) { remoteEx.printStackTrace(); return null; } }

/**

*找出指定名称空间下的组. *

* @param connection Cognos 8连接

* @param namespace 名称空间的搜索路径. * */

public BaseClass[] getAvailableGroups( CRNConnect connection, String namespace) { //查找属性 PropEnum props[] = new PropEnum[] { PropEnum.searchPath, PropEnum.defaultName }; BaseClass[] availableGroups; try { //找出所有的组 availableGroups = csHandler.queryObjectInCS(connection, namespace + \props); return availableGroups; } catch (java.rmi.RemoteException remoteEx) {

搜索更多关于: Cognos 8 SDK简介  的文档
Cognos 8 SDK简介 .doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c6z9ym2zyen3pebe0iley_10.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top