* @throws EMFUserError the EMF user error
*/
public void updateDSRefs(Map associations, Session session, MetadataLogger log)
throws EMFUserError {
logger.debug("IN");
SbiLov lov = null;
try {
List lovs = getAllExportedSbiObjects(session, "SbiLov", null);
Iterator iterLovs = lovs.iterator();
while (iterLovs.hasNext()) {
lov = (SbiLov) iterLovs.next();
if (lov.getInputTypeCd().equalsIgnoreCase("QUERY")) {
String lovProv = lov.getLovProvider();
QueryDetail qDet = QueryDetail.fromXML(lovProv);
String oldDataSource = qDet.getDataSource();
String assDataSource = (String) associations.get(oldDataSource);
// register user association
if ((assDataSource != null) && !assDataSource.trim().equals("") && (oldDataSource != null)
&& !oldDataSource.trim().equals("")) {
qDet.setDataSource(assDataSource);
lovProv = qDet.toXML();
lov.setLovProvider(lovProv);
session.save(lov);
log.log("Changed the data source label from " + oldDataSource + " to " + assDataSource
+ " for the lov " + lov.getName());
}
}
}
} catch (Exception e) {
if (lov != null) {
logger.error("Error while updating connection reference for exported lov with label [" + lov.getLabel() + "].", e);
}
logger.error("Error while updating connection references ", e);
throw new EMFUserError(EMFErrorSeverity.ERROR, "8004", "component_impexp_messages");
} finally {
logger.debug("OUT");