
package de.ivu.elect.was.exchange.internet;

import javax.enterprise.inject.Instance;
import javax.inject.Inject;

import de.ivu.elect.business.exchange.control.FileFormat;
import de.ivu.elect.business.internet.control.PraesentationExportContext;
import de.ivu.elect.business.internet.control.PraesentationExportExchange;
import de.ivu.elect.business.internet.control.PraesentationExportObject;
import de.ivu.elect.business.internet.entity.Praesentationsexport;
import de.ivu.elect.exchange.AbstractExportExchange;
import de.ivu.elect.exchange.ExportMapper;

public class DefaultPraesentationExportExchange
    extends
      AbstractExportExchange<PraesentationExportObject, PraesentationExportContext>
    implements
      PraesentationExportExchange {

  @Inject
  private transient Instance<InternetExportMapper> mapper;

  @Override
  protected Iterable< ? extends ExportMapper<PraesentationExportObject, PraesentationExportContext>> getAllSupportedMapper() {
    return mapper;
  }

  private InternetExportMapper getPraesentationExportMapper(PraesentationExportContext context, FileFormat fileFormat) {
    return (InternetExportMapper) getMapperForFileTypeAndContext(fileFormat, context);
  }

  @Override
  public boolean isDateinameWirdAngepasst(PraesentationExportContext context, FileFormat fileFormat) {
    return getPraesentationExportMapper(context, fileFormat).isDateinameWirdAngepasst();
  }

  @Override
  public String getExportDateiname(PraesentationExportContext context, FileFormat fileFormat,
      Praesentationsexport praesentationsexport) {
    return getPraesentationExportMapper(context, fileFormat).getExportDateiname(praesentationsexport);
  }
}
