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

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

import de.ivu.elect.business.exchange.control.AbstractImporter;
import de.ivu.elect.business.gebietsbaum.boundary.GebietsbaumImporter;
import de.ivu.elect.business.gebietsbaum.control.GebietsbaumExchangeContext;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractImportFormatFestlegenView;
import de.ivu.elect.presentation.exchange.ImportDescription;

@Named(GebietImportFormatFestlegenView.COMPONENT_NAME)
@View(viewId = GebietImportFormatFestlegenView.VIEW_ID, useCase = UseCasePermission.GEBIET_IMPORTIEREN)
public class GebietImportFormatFestlegenView extends AbstractImportFormatFestlegenView<GebietsbaumExchangeContext> {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "gebietImportFormatFestlegenView";

  public static final String VIEW_ID = "/gebietsbaum/gebiet-import-format-festlegen.xhtml";

  @Inject
  private transient GebietImportDescription gebietImportDescription;

  @Inject
  private transient GebietsbaumImporter gebietsbaumImporter;

  public GebietImportFormatFestlegenView() {
    super();
  }

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

  @Override
  protected GebietsbaumExchangeContext getContext() {
    return new GebietsbaumExchangeContext(getSelectedWahltermin(), getSelectedWahl());
  }

  @Override
  protected AbstractImporter< ? , GebietsbaumExchangeContext, ? > getImporter() {
    return gebietsbaumImporter;
  }
}
