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

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

import de.ivu.elect.business.exchange.control.AbstractExporter;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahl.boundary.WahlKonfigurationExporter;
import de.ivu.elect.business.wahl.entity.WahlKonfiguration;
import de.ivu.elect.business.wahl.entity.WahlKonfigurationExchangeContext;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractExportSearchView;
import de.ivu.elect.presentation.exchange.ExportDescription;

@Named(WahlKonfigurationExportView.COMPONENT_NAME)
@View(viewId = WahlKonfigurationExportView.VIEW_ID, useCase = UseCasePermission.WAHL_KONFIGURATION_EXPORTIEREN)
public class WahlKonfigurationExportView extends AbstractExportSearchView<WahlKonfiguration, WahlKonfigurationExchangeContext> {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "wahlKonfigurationExportView";

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

  @Inject
  private transient WahlKonfigurationExporter exporter;

  @Inject
  private transient WahlKonfigurationExportDescription exportDescription;

  @Override
  protected AbstractExporter<WahlKonfiguration, WahlKonfigurationExchangeContext> getExporter() {
    return exporter;
  }

  @Override
  protected WahlKonfigurationExchangeContext getContext() {
    return new WahlKonfigurationExchangeContext(getMandant());
  }

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