
package de.ivu.elect.presentation.praesentation.exchange;

import javax.inject.Inject;
import javax.inject.Named;

import de.ivu.elect.business.ergebnis.boundary.ErgebnisSessionSelect;
import de.ivu.elect.business.ergebnis.entity.Praesentationsexportausloeser;
import de.ivu.elect.business.exchange.control.AbstractExporter;
import de.ivu.elect.business.internet.boundary.PraesentationExporter;
import de.ivu.elect.business.internet.control.PraesentationExportContext;
import de.ivu.elect.business.internet.control.PraesentationExportObject;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahl.boundary.WahldurchfuehrungSessionSelect;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractExportSearchView;
import de.ivu.elect.presentation.exchange.ExportDescription;

@Named(PraesentationExportView.COMPONENT_NAME)
@View(viewId = PraesentationExportView.VIEW_ID, useCase = UseCasePermission.PRAESENTATION_EXPORTIEREN)
public class PraesentationExportView extends AbstractExportSearchView<PraesentationExportObject, PraesentationExportContext> {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "praesentationExportView";

  public static final String VIEW_ID = "/praesentation/praesentation-export.xhtml";

  @Inject
  private transient PraesentationExporter exporter;

  @Inject
  private transient PraesentationExportDescription exportDescription;

  @Inject
  private transient ErgebnisSessionSelect ergebnisSessionSelect;

  @Inject
  private transient WahldurchfuehrungSessionSelect wahldurchfuehrungSessionSelect;


  public PraesentationExportView() {
    super();
  }

  @Override
  protected AbstractExporter<PraesentationExportObject, PraesentationExportContext> getExporter() {
    return exporter;
  }

  @Override
  protected PraesentationExportContext getContext() {
    return new PraesentationExportContext(wahldurchfuehrungSessionSelect.getEntity(), ergebnisSessionSelect.getEntity(),
        Praesentationsexportausloeser.BENUTZER);
  }

  @Override
  public ExportDescription getExportDescription() {
    return exportDescription;
  }
}
