
package de.ivu.elect.presentation.wahlvorschlag.action;

import javax.inject.Inject;

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.wahlvorschlag.boundary.ListeConversationSelect;
import de.ivu.elect.business.wahlvorschlag.entity.Liste;
import de.ivu.elect.presentation.kandidatur.ListenkandidaturSearchView;
import de.ivu.elect.presentation.security.AbstractGebietSecurity;

public abstract class AbstractListeListenkandidaturSearchAction extends AbstractListeAction {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient ListeConversationSelect listeConversationSelect;

  public AbstractListeListenkandidaturSearchAction() {
    super();
  }

  @Override
  public UseCasePermission getRequiredPermission() {
    return UseCasePermission.LISTENKANDIDATUR_SEARCH;
  }

  @Override
  protected AbstractGebietSecurity getGebietSecurity() {
    return getEinsehenGebietSecurity();
  }

  @Override
  protected String doIt(Liste liste) {
    listeConversationSelect.setEntity(liste);

    return ListenkandidaturSearchView.VIEW_ID;
  }

  @Override
  public String getLabelKey() {
    return "entity.search.menu.item.label";
  }

  @Override
  public String getIcon() {
    return appIcons.getIconSearch();
  }
}
