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

import java.util.List;

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

import de.ivu.elect.business.benutzerverwaltung.boundary.RolleImporter;
import de.ivu.elect.business.benutzerverwaltung.entity.Rolle;
import de.ivu.elect.business.benutzerverwaltung.entity.RolleExchangeContext;
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.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractImportSearchView;
import de.ivu.elect.presentation.exchange.ImportDescription;

@Named(RolleImportSearchView.COMPONENT_NAME)
@View(viewId = RolleImportSearchView.VIEW_ID, useCase = UseCasePermission.ROLLE_IMPORTIEREN)
public class RolleImportSearchView extends AbstractImportSearchView<List<Rolle>, RolleExchangeContext> {

  public static final String COMPONENT_NAME = "rolleImportSearchView";

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

  @Inject
  private RolleImporter rolleImporter;

  @Inject
  private RolleImportDescription rolleImportDescription;

  public RolleImportSearchView() {
    super();
  }

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

  @Override
  protected AbstractImporter<List<Rolle>, RolleExchangeContext, ? > getImporter() {
    return rolleImporter;
  }

  @Override
  protected RolleExchangeContext getContext() {
    return new RolleExchangeContext(getMandant(), false);
  }

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