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

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

import de.ivu.elect.business.exchange.control.AbstractExporter;
import de.ivu.elect.business.gruppe.boundary.GruppeExporter;
import de.ivu.elect.business.gruppe.control.GruppeExchangeContext;
import de.ivu.elect.business.gruppe.control.GruppeExportObject;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractExportSearchView;
import de.ivu.elect.presentation.exchange.ExportDescription;

@Named(GruppeExportView.COMPONENT_NAME)
@View(viewId = GruppeExportView.VIEW_ID, useCase = UseCasePermission.GRUPPE_EXPORTIEREN)
public class GruppeExportView extends AbstractExportSearchView<GruppeExportObject, GruppeExchangeContext> {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "gruppeExportView";

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

  @Inject
  private transient GruppeExporter gruppeExporter;

  @Inject
  private transient GruppeExportDescription gruppeExportDescription;

  public GruppeExportView() {
    super();
  }

  @Override
  protected AbstractExporter<GruppeExportObject, GruppeExchangeContext> getExporter() {
    return gruppeExporter;
  }

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

  @Override
  public ExportDescription getExportDescription() {
    return gruppeExportDescription;
  }
}
