/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package clips.reportgen.mainpanel;
import cli_fmw.delegate.AuditListener;
import cli_fmw.main.ClipsException;
import clips.reportgen.QueryLocal;
import clips.reportgen.QuerySearcher;
import java.util.ArrayList;
import reportgen.utils.ReportException;
import reportgen.gui.genepanel.Report;
import reportgen.gui.genepanel.ReportManager;
/**
*
* @author axe
*/
public class ReportManagerImp implements ReportManager {
private final QuerySearcher instance;
private AuditListener al;
public ReportManagerImp(AuditListener al) throws ClipsException {
this.instance = new QuerySearcher(al);
this.al = al;
}
@Override
public ArrayList<Report> getQueryList(Boolean object) throws ReportException {
ArrayList<QueryLocal> res;
try {
res = instance.getQueryList(null, object);
} catch (ClipsException ex) {
throw new ReportException(ex.getLocalizedMessage());
}
ArrayList<Report> reports = new ArrayList<Report>(res);
return reports;
}
@Override
public Report get(int id) throws ReportException {
try {
return new QueryLocal(id, al);
} catch (ClipsException ex) {
throw new ReportException(ex.getLocalizedMessage());
}
}
}