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

import java.util.List;

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

import de.ivu.elect.business.datei.entity.DateiImportBerichtCustomData;
import de.ivu.elect.business.exchange.control.AbstractImporter;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahlrechtspruefung.boundary.PruefkriteriumImporter;
import de.ivu.elect.business.wahlrechtspruefung.entity.Pruefkriterium;
import de.ivu.elect.business.wahlrechtspruefung.entity.PruefkriteriumImportContext;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractImportSearchView;
import de.ivu.elect.presentation.exchange.ImportDescription;

@Named(PruefkriteriumImportSearchView.COMPONENT_NAME)
@View(viewId = PruefkriteriumImportSearchView.VIEW_ID, useCase = UseCasePermission.PRUEFKRITERIUM_IMPORT)
public class PruefkriteriumImportSearchView extends AbstractImportSearchView<List<Pruefkriterium>, PruefkriteriumImportContext> {

  public static final String COMPONENT_NAME = "pruefkriteriumImportSearchView";

  public static final String VIEW_ID = "/wahlrechtspruefung/pruefkriterium-import-search.xhtml";

  @Inject
  private transient PruefkriteriumImporter pruefkriteriumImporter;

  @Inject
  private transient PruefkriteriumImportDescription pruefkriteriumImportDescription;

  public PruefkriteriumImportSearchView() {
    super();
  }

  @Override
  protected ImportDescription getImportDescription() {
    return pruefkriteriumImportDescription;
  }

  @Override
  protected AbstractImporter<List<Pruefkriterium>, PruefkriteriumImportContext, ? > getImporter() {
    return pruefkriteriumImporter;
  }

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

  @Override
  protected DateiImportBerichtCustomData createNewDateiImportBerichtCustomData() {
    return new DateiImportBerichtCustomData();
  }
}
