* Spago SourceBean response
* @throws EMFUserError
*/
private void exportConf(SourceBean request, SourceBean response) throws EMFUserError {
logger.debug("IN");
IExportManager expManager = null;
String exportFileName = (String) request.getAttribute("exportFileName");
if ((exportFileName == null) || (exportFileName.trim().equals(""))) {
logger.error("Missing name of the exported file");
throw new EMFValidationError(EMFErrorSeverity.ERROR, "exportFileName", "8006", "component_impexp_messages");
}
try {
String exportSubObject = (String) request.getAttribute("exportSubObj");
boolean expSubObj = false;
if (exportSubObject != null) {
expSubObj = true;
}
String exportSnapshots = (String) request.getAttribute("exportSnapshots");
boolean exportSnaps = false;
if (exportSnapshots != null) {
exportSnaps = true;
}
// String exportResourcesStr = (String) request.getAttribute("exportResources");
// boolean exportResources = false;
// if (exportResourcesStr != null) {
// exportResources = true;
// }
String pathExportFolder = ExportUtilities.getExportTempFolderPath();
String idListStr = (String) request.getAttribute(ImportExportConstants.OBJECT_ID);
String[] idListArray = idListStr.split(";");
List ids = Arrays.asList(idListArray);
expManager = ExportUtilities.getExportManagerInstance();
expManager.prepareExport(pathExportFolder, exportFileName, expSubObj, exportSnaps);
expManager.exportObjects(ids);
// if (exportResources) {
// logger.error("Exporting resources");
// expManager.exportResources();
// }
expManager.createExportArchive();
response.setAttribute(ImportExportConstants.EXPORT_FILE_PATH, exportFileName);
} catch (EMFUserError emfue) {
expManager.cleanExportEnvironment();
throw emfue;
} catch (Exception e) {
expManager.cleanExportEnvironment();
logger.error("Error while exporting ", e);
throw new EMFUserError(EMFErrorSeverity.ERROR, "8005", "component_impexp_messages");
} finally {
logger.debug("OUT");
}