package com.capgemini.reports.definition.r23report.visitors.snecmaobject;

import com.capgemini.framework.common.DoubleFormatter;
import com.capgemini.framework.common.LanguageHelper;
import com.capgemini.framework.teamcenter.object.pom.status.TcReleaseStatus;
import com.capgemini.reports.definition.r23report.visitors.R23VisitorKeys;
import com.capgemini.reports.snecmaobjects.AbstractSnecmaObject;
import com.capgemini.reports.snecmaobjects.admin.RFAdminAGRevision;
import com.capgemini.reports.snecmaobjects.admin.RFAdminAPRevision;
import com.capgemini.reports.snecmaobjects.admin.RFAdminARevision;
import com.capgemini.reports.snecmaobjects.admin.RFAdminRevision;
import com.capgemini.reports.snecmaobjects.descriptif.DescriptifRevision;
import com.capgemini.reports.snecmaobjects.generic.AbstractGenericRevision;
import com.capgemini.reports.snecmaobjects.generic.GenericAssembRevision;
import com.capgemini.reports.snecmaobjects.generic.GenericRevision;
import com.capgemini.reports.snecmaobjects.mockup.MockupRevision;
import com.capgemini.reports.snecmaobjects.part.*;
import com.capgemini.reports.snecmaobjects.product.ProductRevision;
import com.capgemini.reports.snecmaobjects.rf.AbstractRF;
import com.capgemini.reports.snecmaobjects.rf.RFGenericRevision;
import com.capgemini.reports.snecmaobjects.rf.RFPartAssembRevision;
import com.capgemini.reports.snecmaobjects.rf.RFPartRevision;
import com.capgemini.reports.snecmaobjects.supermodel.AbstractSuperModelRevision;
import com.capgemini.reports.snecmaobjects.supermodel.SuperModelRevision;
import com.capgemini.reports.snecmaobjects.visitor.IComponentVisitor;

import java.util.EnumMap;
import java.util.List;
import java.util.Map;

/**
 * Visit a Component SnecmaObject to make a R23 report.
 */
public class R23ComponentVisitor implements IComponentVisitor<Map<R23VisitorKeys, String>> {
  private static final long serialVersionUID = 7703811551227059716L;

  private static final int MASS_SIGNIFICANT_DIGITS = 15;
  private static final String EMPTY_STRING = "";
  private static final String PART_MAT = "PartMat";
  private static final String SEPARATOR = " / ";
  private static final String VALUE_MATIERE = "matière";
  private static final String PRODUIT = "Produit";
  private static final String GENERIQUE_MONTAGE = "Générique Montage";
  private static final String GENERIQUE = "Générique";
  private static final String SUPERMODEL = "Super Model";
  private static final String PARAM_NON = "Non";
  private static final String PARAM_OUI = "Oui";

  private static String french(final String string) {
    return LanguageHelper.french(string);
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final ProductRevision aProductRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aProductRev);
    theMap.put(R23VisitorKeys.DESIGNATION_EN, aProductRev.getDesignationEN());
    theMap.put(R23VisitorKeys.TYPE_PRODUIT, aProductRev.getTypeProduit());
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, PRODUIT);
    theMap.put(R23VisitorKeys.SUIVI_UTILISATION, PARAM_NON);
    theMap.put(R23VisitorKeys.SUIVI_DUREE_VIE, PARAM_NON);
    theMap.put(R23VisitorKeys.REFERENCE_CONCEPTEUR, EMPTY_STRING);
    theMap.put(R23VisitorKeys.REFERENCE_TRANSPOSEE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.RESPONSABLE_CONCEPTION, EMPTY_STRING);
    theMap.put(R23VisitorKeys.MASSE_INDICATIVE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.UNITE_DE_MASSE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.STATUT_REFERENCE_ARTICLE, statutReferenceArticle(aProductRev.getStatusList()));
    theMap.put(R23VisitorKeys.CLASSEMENT, "-");
    theMap.put(R23VisitorKeys.ALTERNATIVE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.SUIVI_DEVELOPPEMENT, EMPTY_STRING);
    theMap.put(R23VisitorKeys.DOCUMENT_CONTROLE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.OBTURATION, EMPTY_STRING);

    return theMap;
  }

  private String statutReferenceArticle(final List<TcReleaseStatus> statuses) {
    StringBuilder builder = new StringBuilder();
    int size = statuses.size();
    for (int i = 0; i < size; i++) {
      builder.append(statuses.get(i).getDisplayableName());
      if (i != size - 1) {
        builder.append(", ");
      }
    }
    return builder.toString();
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final GenericRevision aGenericRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aGenericRev);
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, GENERIQUE);
    putGenericProperties(theMap, aGenericRev);
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final GenericAssembRevision aGenericAssembRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aGenericAssembRev);
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, GENERIQUE_MONTAGE);
    putGenericProperties(theMap, aGenericAssembRev);
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final SuperModelRevision aSuperModelRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aSuperModelRev);
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, GENERIQUE);
    putSuperModelProperties(theMap, aSuperModelRev);
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final AlternateRevision anAlternateRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(anAlternateRev);
    putPartProperties(theMap, anAlternateRev);
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, french(anAlternateRev.getTypeAlt1()) + SEPARATOR + french(anAlternateRev.getTypeAlt2()));
    theMap.put(R23VisitorKeys.SUIVI_DEVELOPPEMENT, french(anAlternateRev.getSuiviDeveloppement()));
    theMap.put(R23VisitorKeys.DOCUMENT_CONTROLE, french(anAlternateRev.getDocumentControle()));
    theMap.put(R23VisitorKeys.OBTURATION, french(anAlternateRev.getObturation()));
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final DETRevision aDetRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aDetRev);
    putPartProperties(theMap, aDetRev);
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, french(aDetRev.getTypeDet1()) + SEPARATOR + french(aDetRev.getTypeDet2()));
    theMap.put(R23VisitorKeys.SUIVI_DEVELOPPEMENT, french(aDetRev.getSuiviDeveloppement()));
    theMap.put(R23VisitorKeys.DOCUMENT_CONTROLE, french(aDetRev.getDocumentControle()));
    theMap.put(R23VisitorKeys.OBTURATION, french(aDetRev.getObturation()));
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final PartAeroRevision aPartAeroRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aPartAeroRev);
    putPartProperties(theMap, aPartAeroRev);
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, french(aPartAeroRev.getTypeAero1()) + SEPARATOR + french(aPartAeroRev.getTypeAero2()) + SEPARATOR + french(aPartAeroRev.getTypeAero3()));
    theMap.put(R23VisitorKeys.SUIVI_DEVELOPPEMENT, french(aPartAeroRev.getSuiviDeveloppement()));
    theMap.put(R23VisitorKeys.DOCUMENT_CONTROLE, french(aPartAeroRev.getDocumentControle()));
    theMap.put(R23VisitorKeys.OBTURATION, french(aPartAeroRev.getObturation()));
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final PartNoAeroRevision aPartNoAeroRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aPartNoAeroRev);
    putPartProperties(theMap, aPartNoAeroRev);
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, french(aPartNoAeroRev.getTypeNoAero()));
    theMap.put(R23VisitorKeys.SUIVI_DEVELOPPEMENT, french(aPartNoAeroRev.getSuiviDeveloppement()));
    theMap.put(R23VisitorKeys.DOCUMENT_CONTROLE, french(aPartNoAeroRev.getDocumentControle()));
    theMap.put(R23VisitorKeys.OBTURATION, EMPTY_STRING);
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final PartAssembRevision aPartAssembRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aPartAssembRev);
    putPartProperties(theMap, aPartAssembRev);
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, french(aPartAssembRev.getTypePartMontage1()) + SEPARATOR + french(aPartAssembRev.getTypePartMontage2()));
    theMap.put(R23VisitorKeys.SUIVI_DEVELOPPEMENT, EMPTY_STRING);
    theMap.put(R23VisitorKeys.DOCUMENT_CONTROLE, french(aPartAssembRev.getDocumentControle()));
    theMap.put(R23VisitorKeys.OBTURATION, EMPTY_STRING);
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final PartMatRevision aPartMatRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aPartMatRev);
    putPartProperties(theMap, aPartMatRev);
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, VALUE_MATIERE);
    theMap.put(R23VisitorKeys.CLASSEMENT, aPartMatRev.getClassementMat());
    theMap.put(R23VisitorKeys.SUIVI_UTILISATION, PARAM_NON);
    theMap.put(R23VisitorKeys.SUIVI_DUREE_VIE, PARAM_NON);
    theMap.put(R23VisitorKeys.SUIVI_DEVELOPPEMENT, EMPTY_STRING);
    theMap.put(R23VisitorKeys.DOCUMENT_CONTROLE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.OBTURATION, EMPTY_STRING);
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final StandardRevision aStandardRev) {
    Map<R23VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aStandardRev);
    putPartProperties(theMap, aStandardRev);
    theMap.put(R23VisitorKeys.TYPE_REFERENCE, french(aStandardRev.getTypeStandard()));
    theMap.put(R23VisitorKeys.SUIVI_DEVELOPPEMENT, french(aStandardRev.getSuiviDeveloppement()));
    theMap.put(R23VisitorKeys.DOCUMENT_CONTROLE, french(aStandardRev.getDocumentControle()));
    theMap.put(R23VisitorKeys.OBTURATION, EMPTY_STRING);
    return theMap;
  }

  /**
   * Get Component properties to make a R23 report.
   *
   * @param anAbstractSnecmaObject AbstractSnecmaObject
   * @return theMap Map<R23VisitorKeys,String>
   */
  private Map<R23VisitorKeys, String> getAbstractSnecmaObjectProperties(final AbstractSnecmaObject anAbstractSnecmaObject) {
    Map<R23VisitorKeys, String> theMap = new EnumMap<>(R23VisitorKeys.class);
    theMap.put(R23VisitorKeys.REF_FABRICANT_REF_SNECMA, anAbstractSnecmaObject.getItemId());
    theMap.put(R23VisitorKeys.NOM_REFERENCE, anAbstractSnecmaObject.getName());
    theMap.put(R23VisitorKeys.REVISION_REFERENCE, anAbstractSnecmaObject.getRevisionId());
    theMap.put(R23VisitorKeys.ALTERNATIVE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.CR, anAbstractSnecmaObject.getCRPseudoFolderContentAsString());
    theMap.put(R23VisitorKeys.CN, anAbstractSnecmaObject.getCNPseudoFolderContentAsString());
    return theMap;
  }

  /**
   * Put the Generic properties into aMap.
   *
   * @param aMap                      Map<R23VisitorKeys, String>
   * @param anAbstractGenericRevision AbstractGenericRevision
   */
  private void putGenericProperties(final Map<R23VisitorKeys, String> aMap, final AbstractGenericRevision anAbstractGenericRevision) {
    aMap.put(R23VisitorKeys.DESIGNATION_EN, anAbstractGenericRevision.getDesignationEN());
    aMap.put(R23VisitorKeys.RESPONSABLE_CONCEPTION, anAbstractGenericRevision.getResponsableConception());
    aMap.put(R23VisitorKeys.SUIVI_UTILISATION, PARAM_OUI);
    aMap.put(R23VisitorKeys.SUIVI_DUREE_VIE, PARAM_NON);
    aMap.put(R23VisitorKeys.REFERENCE_CONCEPTEUR, EMPTY_STRING);
    aMap.put(R23VisitorKeys.REFERENCE_TRANSPOSEE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.MASSE_INDICATIVE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.UNITE_DE_MASSE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.STATUT_REFERENCE_ARTICLE, statutReferenceArticle(anAbstractGenericRevision.getStatusList()));
    aMap.put(R23VisitorKeys.ALTERNATIVE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.CLASSEMENT, "-");
    aMap.put(R23VisitorKeys.TYPE_PRODUIT, EMPTY_STRING);
    aMap.put(R23VisitorKeys.SUIVI_DEVELOPPEMENT, EMPTY_STRING);
    aMap.put(R23VisitorKeys.DOCUMENT_CONTROLE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.OBTURATION, EMPTY_STRING);
  }


  /**
   * Put the Super Model properties into aMap.
   *
   * @param aMap                      Map<R23VisitorKeys, String>
   * @param anAbstractSuperModelRevision AbstractSuperModelRevision
   */
  private void putSuperModelProperties(final Map<R23VisitorKeys, String> aMap, final AbstractSuperModelRevision anAbstractSuperModelRevision) {
    aMap.put(R23VisitorKeys.SUIVI_UTILISATION, EMPTY_STRING);
    aMap.put(R23VisitorKeys.SUIVI_DUREE_VIE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.REFERENCE_CONCEPTEUR, EMPTY_STRING);
    aMap.put(R23VisitorKeys.REFERENCE_TRANSPOSEE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.MASSE_INDICATIVE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.UNITE_DE_MASSE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.TYPE_REFERENCE, french(anAbstractSuperModelRevision.getType()));
    aMap.put(R23VisitorKeys.STATUT_REFERENCE_ARTICLE, statutReferenceArticle(anAbstractSuperModelRevision.getStatusList()));
    aMap.put(R23VisitorKeys.ALTERNATIVE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.CLASSEMENT, "-");
    aMap.put(R23VisitorKeys.TYPE_PRODUIT, EMPTY_STRING);
    aMap.put(R23VisitorKeys.SUIVI_DEVELOPPEMENT, EMPTY_STRING);
    aMap.put(R23VisitorKeys.DOCUMENT_CONTROLE, EMPTY_STRING);
    aMap.put(R23VisitorKeys.OBTURATION, EMPTY_STRING);
    aMap.put(R23VisitorKeys.DESIGNATION_EN, EMPTY_STRING);
    aMap.put(R23VisitorKeys.RESPONSABLE_CONCEPTION, EMPTY_STRING);

  }








  /**
   * Put the Part properties into aMap.
   *
   * @param aMap           Map<R23VisitorKeys, String>
   * @param anAbstractPart AbstractPart
   */
  private void putPartProperties(final Map<R23VisitorKeys, String> aMap, final AbstractPart anAbstractPart) {
    aMap.put(R23VisitorKeys.DESIGNATION_EN, anAbstractPart.getDesignationEN());
    aMap.put(R23VisitorKeys.REFERENCE_CONCEPTEUR, anAbstractPart.getRefCompleteConcepteur());
    aMap.put(R23VisitorKeys.REFERENCE_TRANSPOSEE, anAbstractPart.getRefTransposeeSnecma());
    aMap.put(R23VisitorKeys.RESPONSABLE_CONCEPTION, anAbstractPart.getResponsableConception());
    if (!PART_MAT.equals(anAbstractPart.getType())) {
      aMap.put(R23VisitorKeys.CLASSEMENT, anAbstractPart.getClassement());
      aMap.put(R23VisitorKeys.SUIVI_UTILISATION, french(anAbstractPart.getSuiviUtilisation()));
      aMap.put(R23VisitorKeys.SUIVI_DUREE_VIE, french(anAbstractPart.getSuiviDureeVie()));
    }
    aMap.put(R23VisitorKeys.MASSE_INDICATIVE, DoubleFormatter.toSignificantDigits(anAbstractPart.getMass(), MASS_SIGNIFICANT_DIGITS));
    aMap.put(R23VisitorKeys.UNITE_DE_MASSE, anAbstractPart.getMassUnit());
    aMap.put(R23VisitorKeys.STATUT_REFERENCE_ARTICLE, statutReferenceArticle(anAbstractPart.getStatusList()));
    aMap.put(R23VisitorKeys.TYPE_PRODUIT, anAbstractPart.getTypeProduit());
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final RFGenericRevision aRfGenericRev) {
    Map<R23VisitorKeys, String> theMap = getRfProperties(aRfGenericRev);
    theMap.put(R23VisitorKeys.SUIVI_MONTAGE, PARAM_NON);
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final RFPartAssembRevision aRfPartAssembRev) {
    Map<R23VisitorKeys, String> theMap = new EnumMap<>(R23VisitorKeys.class);
    theMap.put(R23VisitorKeys.REPERE_FONCTIONNEL, aRfPartAssembRev.getName());
    theMap.put(R23VisitorKeys.REVISION_REPERE_FONCTIONNEL, aRfPartAssembRev.getRevisionId());
    theMap.put(R23VisitorKeys.IDENTIFIANT_REPERE_FONCTIONNEL, aRfPartAssembRev.getItemId());
    theMap.put(R23VisitorKeys.EQUIVALENT_SNSSIN, EMPTY_STRING);
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final RFPartRevision aRfPartRev) {
    return getRfProperties(aRfPartRev);
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final RFAdminRevision aRfAdminRev) {
    Map<R23VisitorKeys, String> theMap = new EnumMap<>(R23VisitorKeys.class);
    theMap.put(R23VisitorKeys.MAQUETTE, french(aRfAdminRev.getMaqIntExt()));
    theMap.put(R23VisitorKeys.IDENTIFIANT_RF_ADMIN, aRfAdminRev.getItemId());
    theMap.put(R23VisitorKeys.REVISION_RF_ADMIN, aRfAdminRev.getRevisionId());
    theMap.put(R23VisitorKeys.RESPONSABLE_REPERE, aRfAdminRev.getResponsableRepere());
    theMap.put(R23VisitorKeys.FRONTIERE_AVION, french(aRfAdminRev.getFrontiereAvion()));
    theMap.put(R23VisitorKeys.FRONTIERE_COOPERANT, french(aRfAdminRev.getFrontiereCooperant()));
    theMap.put(R23VisitorKeys.GEOMETRIE_PIECE_RIGIDE, french(aRfAdminRev.getGeometriePieceRigide()));
    theMap.put(R23VisitorKeys.GEOMETRIE_SIMPLIFIE_RIGIDE, french(aRfAdminRev.getGeometrieSimplifiee()));
    theMap.put(R23VisitorKeys.ENVELOPPE_DE_CINEMATIQUE, french(aRfAdminRev.getEnveloppeCinematique()));
    theMap.put(R23VisitorKeys.ENVELOPPE_DE_MAINTENANCE, french(aRfAdminRev.getEnveloppeMaintenance()));
    theMap.put(R23VisitorKeys.ENVELOPPE_DE_MONTAGE_DEMONTAGE, french(aRfAdminRev.getEnveloppeMontage()));
    theMap.put(R23VisitorKeys.TRACE_AXIALE, french(aRfAdminRev.getTraceAxiale()));
    theMap.put(R23VisitorKeys.INTERFACE, french(aRfAdminRev.getInterfaceRfAdmin()));
    theMap.put(R23VisitorKeys.PROJECT_MOTEUR, aRfAdminRev.getProjetMoteur());
    theMap.put(R23VisitorKeys.MAQUETTE_ECHANGEABLE, aRfAdminRev.getMaqEchangeable());
    theMap.put(R23VisitorKeys.WORKPACKAGE, aRfAdminRev.getWorkpackage());
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final RFAdminARevision aRfAdminARev) {
    Map<R23VisitorKeys, String> theMap = new EnumMap<>(R23VisitorKeys.class);
    theMap.put(R23VisitorKeys.SUIVI_MONTAGE, french(aRfAdminARev.getSuiviMontage()));
    theMap.put(R23VisitorKeys.RESPONSABLE_REPERE, aRfAdminARev.getResponsableRepere());
    theMap.put(R23VisitorKeys.MAQUETTE, french(aRfAdminARev.getMaqIntExt()));
    theMap.put(R23VisitorKeys.IDENTIFIANT_RF_ADMIN, EMPTY_STRING);
    theMap.put(R23VisitorKeys.REVISION_RF_ADMIN, EMPTY_STRING);
    theMap.put(R23VisitorKeys.IDENTIFIANT_RF_ADMIN_AP, EMPTY_STRING);
    theMap.put(R23VisitorKeys.REVISION_RF_ADMIN_AP, EMPTY_STRING);
    theMap.put(R23VisitorKeys.FRONTIERE_AVION, EMPTY_STRING);
    theMap.put(R23VisitorKeys.FRONTIERE_COOPERANT, EMPTY_STRING);
    theMap.put(R23VisitorKeys.GEOMETRIE_PIECE_RIGIDE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.GEOMETRIE_SIMPLIFIE_RIGIDE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.ENVELOPPE_DE_CINEMATIQUE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.ENVELOPPE_DE_MAINTENANCE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.ENVELOPPE_DE_MONTAGE_DEMONTAGE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.TRACE_AXIALE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.INTERFACE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.PROJECT_MOTEUR, EMPTY_STRING);
    theMap.put(R23VisitorKeys.MAQUETTE_ECHANGEABLE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.WORKPACKAGE, EMPTY_STRING);
    theMap.put(R23VisitorKeys.TRANSFERT_LIEN_LOGISTIQUE, french(aRfAdminARev.getTransfertLienLogisti()));
    theMap.put(R23VisitorKeys.TRANSFERT_LIEN_MONTAGE, french(aRfAdminARev.getTransfertLienMontage()));
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final RFAdminAPRevision aRfAdminAPRev) {
    Map<R23VisitorKeys, String> theMap = new EnumMap<>(R23VisitorKeys.class);
    theMap.put(R23VisitorKeys.IDENTIFIANT_RF_ADMIN_AP, aRfAdminAPRev.getItemId());
    theMap.put(R23VisitorKeys.REVISION_RF_ADMIN_AP, aRfAdminAPRev.getRevisionId());
    theMap.put(R23VisitorKeys.SUIVI_MONTAGE, french(aRfAdminAPRev.getSuiviMontage()));
    theMap.put(R23VisitorKeys.TRANSFERT_LIEN_LOGISTIQUE, french(aRfAdminAPRev.getTransfertLienLogisti()));
    theMap.put(R23VisitorKeys.TRANSFERT_LIEN_MONTAGE, french(aRfAdminAPRev.getTransfertLienMontage()));
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final RFAdminAGRevision aRfAdminAGRev) {
    Map<R23VisitorKeys, String> theMap = new EnumMap<>(R23VisitorKeys.class);
    theMap.put(R23VisitorKeys.IDENTIFIANT_RF_ADMIN_AP, EMPTY_STRING);
    theMap.put(R23VisitorKeys.REVISION_RF_ADMIN_AP, EMPTY_STRING);
    theMap.put(R23VisitorKeys.TRANSFERT_LIEN_LOGISTIQUE, french(aRfAdminAGRev.getTransfertLienLogisti()));
    theMap.put(R23VisitorKeys.TRANSFERT_LIEN_MONTAGE, french(aRfAdminAGRev.getTransfertLienMontage()));
    return theMap;
  }

  /**
   * Get the Repere Component properties to make a R23 report.
   *
   * @param anAbstractRF AbstractRF
   * @return theMap Map<R23VisitorKeys,String>
   */
  private Map<R23VisitorKeys, String> getRfProperties(final AbstractRF anAbstractRF) {
    Map<R23VisitorKeys, String> theMap = new EnumMap<>(R23VisitorKeys.class);
    theMap.put(R23VisitorKeys.REPERE_FONCTIONNEL, anAbstractRF.getName());
    theMap.put(R23VisitorKeys.IDENTIFIANT_REPERE_FONCTIONNEL, anAbstractRF.getItemId());
    theMap.put(R23VisitorKeys.REVISION_REPERE_FONCTIONNEL, anAbstractRF.getRevisionId());
    theMap.put(R23VisitorKeys.EQUIVALENT_SNSSIN, anAbstractRF.getEquivalentSnsSin());
    return theMap;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final MockupRevision aMockupRev) {
    // This object is not use in this report
    return null;
  }

  @Override
  public Map<R23VisitorKeys, String> visitComponent(final DescriptifRevision aDescriptifRev) {
    // This object is not use in this report
    return null;
  }
}
