salomeTMF_plug.pluginxlsxml.Export
Class FromXmlToExcel

java.lang.Object
  extended by salomeTMF_plug.pluginxlsxml.Export.FromXmlToExcel

public class FromXmlToExcel
extends java.lang.Object

Read a XML file, generated by SalomeTMF via DocXML Plugin, having requirements ans test cases, and transform it in XLS file

Author:
adm_dfej

Field Summary
private  org.dom4j.Document documentXml
           
private  EcritEntete ecritEntete
           
private  java.io.File fichierDeSortieXLS
           
private  java.lang.String fs
          Get the File Separator (different between Unix and Windows)
private  boolean isEcritFeuilleExigence
           
private  boolean isEcritFeuilleTest
           
private  boolean isErreurEcritureXLS
           
private  jxl.write.Label label
           
private  jxl.write.Number nombre
           
private  int nombreActionsParCasDeTests
           
private  int nombreExigenceParCasDeTests
           
private  int nombreLigneRequirementLu
           
private  java.lang.String nomFichierXLS
           
private  int numeroColonne
           
private  int numeroColonneExigence
           
private  int numeroLigne
           
private  java.lang.String resulEffectif
           
private  jxl.write.WritableSheet sheet
           
private  jxl.write.WritableSheet testSheet
           
private  jxl.write.WritableWorkbook workbook
           
private  java.lang.String xmlDir
           
 
Constructor Summary
FromXmlToExcel(java.lang.String fichierXml, boolean selectionExportExigence, boolean selectionExportTest)
          Function that transform the XML file to a XLS file
 
Method Summary
 java.lang.String createXlsFile(java.lang.String nomFichierSortie)
          Function that create a XLS File
 java.lang.String getfichierDeSortieXLS()
           
 boolean getWriteErrorXLS()
          Get ErreurEcritureXLS
 void openXmlFile(java.lang.String fichierXml)
          function that tries to open the XML File
 void organizeXLSfile(boolean selectionExportExigence, boolean selectionExportTest)
          Function that organise XLS file (merge cells, ...)
 void readRequirementsSettings(java.lang.String ParsingRequirement)
          Read requirement options
 void readXMLFile(org.dom4j.Document documentXml)
          Function that parse Xml file to read requirements
 void readXMLFileTest(org.dom4j.Document documentXml, boolean selectionExportExigence)
          Function that parse Xml file to read tests
 java.lang.String removeSpecialCharacters(java.lang.String chaineAModifier)
          Modify a string to pass spécial characters like quote
 boolean setErreurEcritureXLS()
          Set ErreurEcriturXLs to True
 void writeXLSHeading(java.lang.String Exigencelu)
          Function that write XLS heading
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workbook

private jxl.write.WritableWorkbook workbook

sheet

private jxl.write.WritableSheet sheet

testSheet

private jxl.write.WritableSheet testSheet

documentXml

private org.dom4j.Document documentXml

fichierDeSortieXLS

private java.io.File fichierDeSortieXLS

numeroColonne

private int numeroColonne

numeroLigne

private int numeroLigne

nombreLigneRequirementLu

private int nombreLigneRequirementLu

numeroColonneExigence

private int numeroColonneExigence

nombreExigenceParCasDeTests

private int nombreExigenceParCasDeTests

nombreActionsParCasDeTests

private int nombreActionsParCasDeTests

isEcritFeuilleTest

private boolean isEcritFeuilleTest

isEcritFeuilleExigence

private boolean isEcritFeuilleExigence

label

private jxl.write.Label label

nombre

private jxl.write.Number nombre

nomFichierXLS

private java.lang.String nomFichierXLS

ecritEntete

private EcritEntete ecritEntete

resulEffectif

private java.lang.String resulEffectif

isErreurEcritureXLS

private boolean isErreurEcritureXLS

xmlDir

private java.lang.String xmlDir

fs

private java.lang.String fs
Get the File Separator (different between Unix and Windows)

Constructor Detail

FromXmlToExcel

public FromXmlToExcel(java.lang.String fichierXml,
                      boolean selectionExportExigence,
                      boolean selectionExportTest)
               throws org.dom4j.DocumentException,
                      java.lang.Exception,
                      java.io.IOException
Function that transform the XML file to a XLS file

Parameters:
selectionExportExigence - parametre case à cocher
selectionExportTest - parametre case à cocher
fichierXml - Name of the XML file
Throws:
org.dom4j.DocumentException - DocumentException
java.lang.Exception - Lang.Exception
java.io.IOException - IOException
Method Detail

openXmlFile

public void openXmlFile(java.lang.String fichierXml)
                 throws org.dom4j.DocumentException
function that tries to open the XML File

Parameters:
fichierXml - Name of the XML File
Throws:
org.dom4j.DocumentException - DocumentException

readXMLFileTest

public void readXMLFileTest(org.dom4j.Document documentXml,
                            boolean selectionExportExigence)
                     throws org.dom4j.DocumentException,
                            java.lang.Exception
Function that parse Xml file to read tests

Parameters:
selectionExportExigence - parametre case à cocher
documentXml - document Xml
Throws:
org.dom4j.DocumentException - DocumentException
java.lang.Exception - Exception

removeSpecialCharacters

public java.lang.String removeSpecialCharacters(java.lang.String chaineAModifier)
Modify a string to pass spécial characters like quote

Parameters:
chaineAModifier - A string for argument
Returns:
A string

readXMLFile

public void readXMLFile(org.dom4j.Document documentXml)
                 throws org.dom4j.DocumentException,
                        java.lang.Exception
Function that parse Xml file to read requirements

Parameters:
documentXml - document Xml
Throws:
org.dom4j.DocumentException - DocumentException
java.lang.Exception - Exception

readRequirementsSettings

public void readRequirementsSettings(java.lang.String ParsingRequirement)
                              throws jxl.write.WriteException
Read requirement options

Parameters:
ParsingRequirement - requirement name
Throws:
jxl.write.WriteException - Erreur Ecriture Excel

writeXLSHeading

public void writeXLSHeading(java.lang.String Exigencelu)
                     throws jxl.write.WriteException
Function that write XLS heading

Parameters:
Exigencelu - Requirement read by the XML Parser
Throws:
jxl.write.WriteException - WriteException

organizeXLSfile

public void organizeXLSfile(boolean selectionExportExigence,
                            boolean selectionExportTest)
                     throws jxl.write.WriteException
Function that organise XLS file (merge cells, ...)

Parameters:
selectionExportExigence - parametre case à cocher
selectionExportTest - parametre case à cocher
Throws:
jxl.write.WriteException - Write Exception

getWriteErrorXLS

public boolean getWriteErrorXLS()
Get ErreurEcritureXLS

Returns:
ErreurEcritureXLS

setErreurEcritureXLS

public boolean setErreurEcritureXLS()
Set ErreurEcriturXLs to True

Returns:
True

createXlsFile

public java.lang.String createXlsFile(java.lang.String nomFichierSortie)
Function that create a XLS File

Parameters:
nomFichierSortie - Name of the XML File
Returns:
The real name of the XLS file génerated

getfichierDeSortieXLS

public java.lang.String getfichierDeSortieXLS()