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

import java.util.List;

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

import de.ivu.elect.business.exchange.control.AbstractExporter;
import de.ivu.elect.business.person.entity.Personendaten;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahlvorschlag.boundary.SperrlisteExporter;
import de.ivu.elect.business.wahlvorschlag.control.SperrlisteExportContext;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractExportSearchView;
import de.ivu.elect.presentation.exchange.ExportDescription;

@Named(SperrlisteExportView.COMPONENT_NAME)
@View(viewId = SperrlisteExportView.VIEW_ID, useCase = UseCasePermission.SPERRLISTE_EXPORTIEREN)
public class SperrlisteExportView extends AbstractExportSearchView<List<Personendaten>, SperrlisteExportContext> {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "sperrlisteExportView";

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

  @Inject
  private transient SperrlisteExporter exporter;

  @Inject
  private transient SperrlisteExportDescription exportDescription;

  public SperrlisteExportView() {
    super();
  }

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

  @Override
  protected AbstractExporter<List<Personendaten>, SperrlisteExportContext> getExporter() {
    return exporter;
  }

  @Override
  protected SperrlisteExportContext getContext() {
    return new SperrlisteExportContext(getSelectedWahl());
  }
}
