
package de.ivu.elect.presentation.statistik;

import javax.annotation.Nullable;
import javax.inject.Named;

import de.ivu.elect.presentation.hilfe.OnlineHilfeId;
import org.apache.deltaspike.core.api.scope.ViewAccessScoped;

import de.ivu.elect.business.security.UseCasePermission;
import de.ivu.elect.business.statistik.entity.StatistikLauf;
import de.ivu.elect.jee.faces.PreConditionCheck;
import de.ivu.elect.jee.presentation.dynamicform.FormBuilder;
import de.ivu.elect.presentation.View;
import de.ivu.elect.presentation.security.AbstractGebietSecurityFilter;

/**
 *  on 30.01.2017.
 */
@OnlineHilfeId(value = "656")
@ViewAccessScoped
@Named(AbstractStatistikLaufSearchView.COMPONENT_NAME)
@View(viewId = AbstractStatistikLaufSearchView.VIEW_ID, useCase = UseCasePermission.STATISTIK_LAUF_SEARCH)
public class StatistikLaufSearchView extends AbstractStatistikLaufSearchView {

  private static final long serialVersionUID = 1L;

  public StatistikLaufSearchView() {
    super();
  }

  @Nullable
  @PreConditionCheck
  public String checkCondition() {
    if (!isWahlterminSelected() && !isWahlSelected()) {
      return getStartViewId();
    }

    return null;
  }

  @Override
  protected AbstractGebietSecurityFilter<StatistikLauf> getGebietSecurityFilter() {
    return KEIN_GEBIET_SECURITY_FILTER;
  }

  @Override
  public void addProperties(FormBuilder formBuilder) {

  }

  @Override
  public void presetSearchParameters() {

  }
}
