Search in sources :

Example 1 with ReportReader

use of eu.esdihumboldt.hale.common.core.report.writer.ReportReader in project hale by halestudio.

the class ReportServiceImpl method loadReport.

/**
 * @see eu.esdihumboldt.hale.ui.service.report.ReportService#loadReport(java.io.File)
 */
@Override
public void loadReport(File file) throws org.eclipse.jface.bindings.keys.ParseException {
    // create a ReportReader
    ReportReader rr = new ReportReader();
    // read all sessions from log folder
    ReportSession s = rr.readFile(file);
    if (s == null) {
        throw new org.eclipse.jface.bindings.keys.ParseException("Log could not be read.");
    }
    // add them to internal storage
    this.reps.put(s.getId(), s);
}
Also used : ReportReader(eu.esdihumboldt.hale.common.core.report.writer.ReportReader) ReportSession(eu.esdihumboldt.hale.common.core.report.ReportSession)

Example 2 with ReportReader

use of eu.esdihumboldt.hale.common.core.report.writer.ReportReader in project hale by halestudio.

the class ReportServiceImpl method loadReportsOnStartup.

/**
 * @see eu.esdihumboldt.hale.ui.service.report.ReportService#loadReportsOnStartup()
 */
@Override
public void loadReportsOnStartup() {
    // folder where the reports shall be stored
    File folder = new File(Platform.getLocation().toString() + "/reports/");
    // create a ReportReader
    ReportReader rr = new ReportReader();
    // read all sessions from log folder
    List<ReportSession> list = rr.readDirectory(folder);
    // add them to internal storage
    for (ReportSession s : list) {
        this.reps.put(s.getId(), s);
    }
}
Also used : ReportReader(eu.esdihumboldt.hale.common.core.report.writer.ReportReader) File(java.io.File) ReportSession(eu.esdihumboldt.hale.common.core.report.ReportSession)

Aggregations

ReportSession (eu.esdihumboldt.hale.common.core.report.ReportSession)2 ReportReader (eu.esdihumboldt.hale.common.core.report.writer.ReportReader)2 File (java.io.File)1