
package de.ivu.elect.presentation.wertelisten.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.wertelisten.boundary.WertelistenImporter;
import de.ivu.elect.business.wertelisten.control.WertelistenExchangeContext;
import de.ivu.elect.business.wertelisten.entity.Wertelisten;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractImportSearchView;
import de.ivu.elect.presentation.exchange.ImportDescription;

@Named(WertelistenImportSearchView.COMPONENT_NAME)
@View(viewId = WertelistenImportSearchView.VIEW_ID, useCase = UseCasePermission.WERTELISTEN_IMPORTIEREN)
public class WertelistenImportSearchView extends AbstractImportSearchView<List<Wertelisten>, WertelistenExchangeContext> {

  public static final String COMPONENT_NAME = "wertelistenImportSearchView";

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

  @Inject
  private WertelistenImporter importermporter;

  @Inject
  private WertelistenImportDescription wertelistenImportDescription;

  public WertelistenImportSearchView() {
    super();
  }

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

  @Override
  protected AbstractImporter<List<Wertelisten>, WertelistenExchangeContext, ? > getImporter() {
    return importermporter;
  }

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

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