BOBJ SDK添加组的memberOf母集团

问题描述 投票:0回答:1

所有,

我想补充一组是父组的一个孩子,但,它不是成为父组的成员。我不得不去和手动设置。

任何人都知道这是如何工作?

business-objects
1个回答
2
投票

我与它玩,做对BOB Forum一个小小的研究,但我想通了,虽然它不直观。

我会假设你知道如何让父组IUserGroup对象。

// get the plugin manager
IPluginMgr pluginMgr = store.getPluginMgr();
//  Retrieve the User plugin.
IPluginInfo groupPlugin = pluginMgr.getPluginInfo("CrystalEnterprise.UserGroup");
//  Create a new InfoObjects collection.
IInfoObjects newInfoObjects  = store.newInfoObjectCollection();
//  Add the User plugin to the collection.
newInfoObjects.add (groupPlugin);
//  Retrieve the newly created user object.
IUserGroup newUserGroup = (IUserGroup)newInfoObjects.get(0);

// build the new group
String newGroupName = "My Test Group"; 
newUserGroup.setTitle(newGroupName);
newUserGroup.setDescription("Just for sample test code");
store.commit(newInfoObjects);

// now that things commited associate the parent group
if(parentGroup != null)
{
  parentGroup.getSubGroups().add(new Integer(newUserGroup.getID()));
  store.commit(parGroupObjs);
}

大难倒的是你,你会想到刚使用setParentID()方法。警告这个这个字才被下BO XI R2,R3不测试,所以它可能不是当前版本100%正确的。

© www.soinside.com 2019 - 2024. All rights reserved.