我正在使用java api为ibm db2内容管理器开发一个新的应用程序。就像在ibm cm系统管理客户端中所做的那样,我正在尝试通过java编码将现有项类型的属性复制到新的项类型。
我将只更改项目类型的名称和定义。所有剩余属性都将按原样复制;如属性、保留策略、自动链接、集合名称。
有人知道如何获取现有项目类型的“自动链接”属性并将其设置为新的项目类型吗?
诚挚的问候,
发布于 2017-08-15 19:27:15
我使用下面的方法来获取和设置自动链接属性。
boolean autoLinkBol = source_itemType.getAutoLinkEnable();
new_itemType.setAutoLinkEnable(autoLinkBol);
dkCollection coll = source_itemType.getAutoLinkRule();
dkIterator iter = coll.createIterator(); // Create an iterator to iterate
while(iter.more()){ // while there are still items in the list, continue
DKAutoLinkDefICM autoLinkDef = (DKAutoLinkDefICM) iter.next();
DKAutoLinkDefICM autoLinkDef_new = new DKAutoLinkDefICM();
autoLinkDef_new.setLinkType(autoLinkDef.get`enter code here`LinkType());
autoLinkDef_new.setSourceEntityName(autoLinkDef.getSourceEntityName());
autoLinkDef_new.setAttributeId(autoLinkDef.getAttributeId());
autoLinkDef_new.setTargetEntityName("XXX_05");
new_itemType.addAutoLinkRule(autoLinkDef_new);
}https://stackoverflow.com/questions/45660377
复制相似问题