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

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

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahl.boundary.WahlParameterImporter;
import de.ivu.elect.business.wahl.control.WahlParameterExchangeContext;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractImportFormatFestlegenView;
import de.ivu.elect.presentation.exchange.ImportDescription;

@Named(WahlParameterImportFormatFestlegenView.COMPONENT_NAME)
@View(viewId = WahlParameterImportFormatFestlegenView.VIEW_ID, useCase = UseCasePermission.WAHL_PARAMETER_IMPORTIEREN)
public class WahlParameterImportFormatFestlegenView extends AbstractImportFormatFestlegenView<WahlParameterExchangeContext> {

  public static final String COMPONENT_NAME = "wahlParameterImportFormatFestlegenView";

  public static final String VIEW_ID = "/wahl/wahl-parameter-import-format-festlegen.xhtml";

  private static final long serialVersionUID = 1L;

  @Inject
  private transient WahlParameterImportDescription wahlParameterImportDescription;

  @Inject
  private transient WahlParameterImporter importer;

  public WahlParameterImportFormatFestlegenView() {
    super();
  }

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

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

  @Override
  protected WahlParameterImporter getImporter() {
    return importer;
  }
}
