
package de.ivu.elect.presentation.gruppe.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.gruppe.boundary.GruppeImporter;
import de.ivu.elect.business.gruppe.control.GruppeExchangeContext;
import de.ivu.elect.business.gruppe.entity.Gruppe;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractImportBestaetigenView;
import de.ivu.elect.presentation.exchange.ImportDescription;

@Named(GruppeImportBestaetigenView.COMPONENT_NAME)
@View(viewId = GruppeImportBestaetigenView.VIEW_ID, useCase = UseCasePermission.GRUPPE_IMPORTIEREN)
public class GruppeImportBestaetigenView extends AbstractImportBestaetigenView<List<Gruppe>, GruppeExchangeContext> {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "gruppeImportBestaetigenView";

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

  @Inject
  private transient GruppeImporter gruppeImporter;

  @Inject
  private transient GruppeImportDescription gruppeImportDescription;

  public GruppeImportBestaetigenView() {
    super();
  }

  @Override
  protected AbstractImporter<List<Gruppe>, GruppeExchangeContext, ? > getImporter() {
    return gruppeImporter;
  }

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

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