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

import java.util.List;

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

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.AbstractImportBestaetigenView;
import de.ivu.elect.presentation.exchange.ImportDescription;

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

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "wertelistenImportBestaetigenView";

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

  @Inject
  private transient WertelistenImporter importer;

  @Inject
  private transient WertelistenImportDescription importDescription;

  public WertelistenImportBestaetigenView() {
    super();
  }

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

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

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

}
