
package de.ivu.elect.presentation.gruppe.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.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.AbstractImportSearchView;
import de.ivu.elect.presentation.exchange.ImportDescription;
import de.ivu.elect.presentation.hilfe.OnlineHilfeId;

@OnlineHilfeId("235")
@Named(GruppeImportSearchView.COMPONENT_NAME)
@View(viewId = GruppeImportSearchView.VIEW_ID, useCase = UseCasePermission.GRUPPE_IMPORTIEREN)
public class GruppeImportSearchView extends AbstractImportSearchView<List<Gruppe>, GruppeExchangeContext> {

  public static final String COMPONENT_NAME = "gruppeImportSearchView";

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

  @Inject
  private transient GruppeImporter gruppeImporter;

  @Inject
  private transient GruppeImportDescription gruppeImportDescription;

  public GruppeImportSearchView() {
    super();
  }

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

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

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

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