use of edu.harvard.iq.dataverse.export.ExportException in project dataverse by IQSS.
the class FilePage method getExporters.
public List<String[]> getExporters() {
List<String[]> retList = new ArrayList<>();
String myHostURL = systemConfig.getDataverseSiteUrl();
for (String[] provider : ExportService.getInstance(settingsService).getExportersLabels()) {
String formatName = provider[1];
String formatDisplayName = provider[0];
Exporter exporter = null;
try {
exporter = ExportService.getInstance(settingsService).getExporter(formatName);
} catch (ExportException ex) {
exporter = null;
}
if (exporter != null && exporter.isAvailableToUsers()) {
// Not all metadata exports should be presented to the web users!
// Some are only for harvesting clients.
String[] temp = new String[2];
temp[0] = formatDisplayName;
temp[1] = myHostURL + "/api/datasets/export?exporter=" + formatName + "&persistentId=" + fileMetadata.getDatasetVersion().getDataset().getGlobalId();
retList.add(temp);
}
}
return retList;
}
use of edu.harvard.iq.dataverse.export.ExportException in project dataverse by IQSS.
the class OAIRecordServiceBean method exportAllFormats.
// TODO:
// Export functionality probably deserves its own EJB ServiceBean -
// so maybe create ExportServiceBean, and move these methods there?
// (why these need to be in an EJB bean at all, what's wrong with keeping
// them in the loadable ExportService? - since we need to modify the
// "last export" timestamp on the dataset, being able to do that in the
// @EJB context is convenient.
public void exportAllFormats(Dataset dataset) {
try {
ExportService exportServiceInstance = ExportService.getInstance();
logger.fine("Attempting to run export on dataset " + dataset.getGlobalId());
exportServiceInstance.exportAllFormats(dataset);
datasetService.updateLastExportTimeStamp(dataset.getId());
} catch (ExportException ee) {
logger.fine("Caught export exception while trying to export. (ignoring)");
} catch (Exception e) {
logger.fine("Caught unknown exception while trying to export (ignoring)");
}
}
use of edu.harvard.iq.dataverse.export.ExportException in project dataverse by IQSS.
the class OAIRecordServiceBean method exportAllFormatsInNewTransaction.
@TransactionAttribute(REQUIRES_NEW)
public void exportAllFormatsInNewTransaction(Dataset dataset) throws ExportException {
try {
ExportService exportServiceInstance = ExportService.getInstance();
exportServiceInstance.exportAllFormats(dataset);
datasetService.updateLastExportTimeStamp(dataset.getId());
} catch (Exception e) {
logger.fine("Caught unknown exception while trying to export");
throw new ExportException(e.getMessage());
}
}
use of edu.harvard.iq.dataverse.export.ExportException in project dataverse by IQSS.
the class FinalizeDatasetPublicationCommand method exportMetadata.
/**
* Attempting to run metadata export, for all the formats for which we have
* metadata Exporters.
*/
private void exportMetadata(SettingsServiceBean settingsServiceBean) {
try {
ExportService instance = ExportService.getInstance(settingsServiceBean);
instance.exportAllFormats(theDataset);
} catch (ExportException ex) {
// Something went wrong!
// Just like with indexing, a failure to export is not a fatal
// condition. We'll just log the error as a warning and keep
// going:
logger.log(Level.WARNING, "Dataset publication finalization: exception while exporting:{0}", ex.getMessage());
}
}
use of edu.harvard.iq.dataverse.export.ExportException in project dataverse by IQSS.
the class DatasetPage method getExporters.
public List<String[]> getExporters() {
List<String[]> retList = new ArrayList<>();
String myHostURL = getDataverseSiteUrl();
for (String[] provider : ExportService.getInstance(settingsService).getExportersLabels()) {
String formatName = provider[1];
String formatDisplayName = provider[0];
Exporter exporter = null;
try {
exporter = ExportService.getInstance(settingsService).getExporter(formatName);
} catch (ExportException ex) {
exporter = null;
}
if (exporter != null && exporter.isAvailableToUsers()) {
// Not all metadata exports should be presented to the web users!
// Some are only for harvesting clients.
String[] temp = new String[2];
temp[0] = formatDisplayName;
temp[1] = myHostURL + "/api/datasets/export?exporter=" + formatName + "&persistentId=" + dataset.getGlobalId();
retList.add(temp);
}
}
return retList;
}
Aggregations