try {
// import maps
List exportedMaps = importer.getAllExportedSbiObjects(sessionExpDB, "SbiGeoMaps", null);
Iterator iterMaps = exportedMaps.iterator();
while (iterMaps.hasNext()) {
SbiGeoMaps expMap = (SbiGeoMaps) iterMaps.next();
String name = expMap.getName();
Object existObj = importer.checkExistence(name, sessionCurrDB, new SbiGeoMaps());
SbiGeoMaps newMap = null;
if (existObj != null) {
if (!overwrite) {
metaLog.log("Found an existing map '" + name + "' with "
+ "the same name of the exported map. It will be not overwritten.");
continue;
} else {
metaLog.log("Found an existing map '" + name + "' with "
+ "the same name of the exported map. It will be overwritten.");
newMap = (SbiGeoMaps) existObj;
}
} else {
newMap = new SbiGeoMaps();
}
newMap.setName(expMap.getName());
newMap.setDescr(expMap.getDescr());
newMap.setFormat(expMap.getFormat());
newMap.setUrl(expMap.getUrl());
if (expMap.getBinContents() != null) {
SbiBinContents binary = insertBinaryContent(expMap.getBinContents());
newMap.setBinContents(binary);
} else {
metaLog.log("WARN: exported map with name '" + expMap.getName() + "' has no content!!");
newMap.setBinContents(null);
}
sessionCurrDB.save(newMap);
metaAss.insertCoupleMaps(new Integer(expMap.getMapId()), new Integer(newMap.getMapId()));
}
// import features
List exportedFeatures = importer.getAllExportedSbiObjects(sessionExpDB, "SbiGeoFeatures", null);
Iterator iterFeatures = exportedFeatures.iterator();