During the re-indexing of an item, you cannot change the resource manager or the collection. This change can only be made when you add document parts or resource items. Use the ChangeSMS method to change the collection for resource items and document model parts.
After an item is re-indexed, you can change the collection only, not the resource manager. To change the collection, there are two different procedures you can use to make changes for resource items and document model parts.
DKStorageManageInfoICM storageInfo =
(DKStorageManageInfoICM)lob.
getExtension("DKStorageManageInfoICM");
storageInfo.setCollectionName(targetCollectionName);
lob.changeStorage();
lob.changeSMSInfo(targetCollectionName);
public DKDDO updateDoc(DKDDO ddoDocument)
throws DKException,Exception {
String itemtype = ((DKPidICM)ddoDocument.getPidObject()).
getObjectType();
DKItemTypeDefICM ITDef =
(DKItemTypeDefICM)dsDefICM.retrieveEntity(itemtype);
updateValuesToAttrsInDDO(ddoDocument, ITDef); //(code not shown)
changeSMSForParts(ddoDocument);
ddoDocument.update();
return ddoDocument;
}
public void changeSMSForParts(DKDDO ddo)
throws DKUsageError,Exception{
short dataId = ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,
DKConstant.DK_CM_DKPARTS);
DKParts parts = (DKParts)ddo.getData(dataIbd);
dkIterator iter;
DKLobICM part;
int partsCardinality = parts.cardinality();
if (parts != null)
iter = (DKSequentialIterator)parts.createIterator();
else
return;
while (iter.more()) {
part = (DKLobICM) iter.next();
DKStorageManageInfoICM storageInfo =
(DKStorageManageInfoICM) part.getExtension("DKStorageManageInfoICM");
String rmName = part.getRMName();
if (rmName != null) {
DKRMConfigurationMgmtICM rmCfg = getRMConfigurationMgmt();
DKResourceMgrDefICM rmDef = rmCfg.retrieveResourceMgr(rmName);
if (rmDef != null) {
storageInfo.setCollectionName(targetCollectionName);
}
}
part.setChangeSMSRequested(true);
}
}