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

import java.util.List;

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

import de.ivu.elect.business.exchange.control.AbstractExporter;
import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahlrechtspruefung.boundary.PruefkriteriumExporter;
import de.ivu.elect.business.wahlrechtspruefung.entity.Pruefkriterium;
import de.ivu.elect.business.wahlrechtspruefung.entity.PruefkriteriumExportContext;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.exchange.AbstractExportSearchView;
import de.ivu.elect.presentation.exchange.ExportDescription;

@Named(PruefkriteriumExportSearchView.COMPONENT_NAME)
@View(viewId = PruefkriteriumExportSearchView.VIEW_ID, useCase = UseCasePermission.PRUEFKRITERIUM_EXPORT)
public class PruefkriteriumExportSearchView extends AbstractExportSearchView<List<Pruefkriterium>, PruefkriteriumExportContext> {

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "pruefkriteriumExportSearchView";

  public static final String VIEW_ID = "/wahlrechtspruefung/pruefkriterium-export-search.xhtml";

  @Inject
  private transient PruefkriteriumExporter pruefkriteriumExporter;

  @Inject
  private transient PruefkriteriumExportDescription pruefkriteriumExportDescription;

  public PruefkriteriumExportSearchView() {
    super();
  }

  @Override
  protected AbstractExporter<List<Pruefkriterium>, PruefkriteriumExportContext> getExporter() {
    return pruefkriteriumExporter;
  }

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

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