
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.RolleExporter;
import de.ivu.elect.business.benutzerverwaltung.entity.Rolle;
import de.ivu.elect.business.benutzerverwaltung.entity.RolleExchangeContext;
import de.ivu.elect.business.exchange.control.AbstractExporter;
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(RolleExportView.COMPONENT_NAME)
@View(viewId = RolleExportView.VIEW_ID, useCase = UseCasePermission.ROLLE_EXPORTIEREN)
public class RolleExportView extends AbstractExportSearchView<List<Rolle>, RolleExchangeContext> {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "rolleExportView";

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

  @Inject
  private transient RolleExporter rolleExporter;

  @Inject
  private transient RolleExportDescription rolleExportDescription;

  public RolleExportView() {
    super();
  }

  @Override
  protected AbstractExporter<List<Rolle>, RolleExchangeContext> getExporter() {
    return rolleExporter;
  }

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

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