[Castore-commits] ConverterThread.java 1.3 1.4

Céline BENOIT cbenoit at adullact1.hosting.cri74.org
Jeu 17 Aou 11:43:33 CEST 2006


Update of /cvsroot/castore/castore-core/src/java/fr/emn/castor/documents/metier/textes/retro
In directory adullact1:/tmp/cvs-serv3242/src/java/fr/emn/castor/documents/metier/textes/retro

Modified Files:
	ConverterThread.java 
Log Message:
ajout d'un message d'erreur en cas d'erreur de rétro-conversion sur les documents décompressés

Index: ConverterThread.java
===================================================================
RCS file: /cvsroot/castore/castore-core/src/java/fr/emn/castor/documents/metier/textes/retro/ConverterThread.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ConverterThread.java	17 Aug 2006 08:29:44 -0000	1.3
--- ConverterThread.java	17 Aug 2006 09:43:31 -0000	1.4
***************
*** 200,203 ****
--- 200,206 ----
              this.fonds.setConvStatut(
                  this.id, DocumentsConstants.CONVERSION_ERROR);
+             if (this.classDoc.equals(DocumentsConstants.DOC_CLASSE_GROUPE)) {
+                 this.setEtatDocEltXML(DocumentsConstants.CONVERSION_ERROR);
+             }
              return;
          } catch (FileNotFoundException fnfe) {
***************
*** 209,212 ****
--- 212,218 ----
              this.fonds.setConvStatut(
                  this.id, DocumentsConstants.CONVERSION_ERROR);
+             if (this.classDoc.equals(DocumentsConstants.DOC_CLASSE_GROUPE)) {
+                 this.setEtatDocEltXML(DocumentsConstants.CONVERSION_ERROR);
+             }
              return;
  
***************
*** 219,222 ****
--- 225,231 ----
              this.fonds.setConvStatut(
                  this.id, DocumentsConstants.CONVERSION_ERROR);
+             if (this.classDoc.equals(DocumentsConstants.DOC_CLASSE_GROUPE)) {
+                 this.setEtatDocEltXML(DocumentsConstants.CONVERSION_ERROR);
+             }
              return;
          }
***************
*** 229,242 ****
          //Modifier l'état du document issu d'un document compressé dans le fichier elements.xml  
          if (this.classDoc.equals(DocumentsConstants.DOC_CLASSE_GROUPE)) {
!             // vérifier que le fichier elements.xml existe
!             String pathFicElementXml = this.fonds.getPathForId(id)
!                     + Constants.FILE_SEPARATOR
!                     + DocumentsConstants.NOM_FICHIER_ELEMENTS;
!             File fileElementsXml = new File(pathFicElementXml);
!             if (fileElementsXml.exists()) {
!                 this.fonds.setEtatElementsXML(
!                     pathFicElementXml, this.nameFic,
!                     DocumentsConstants.CONVERSION_ENDED);
!             }
          }
  
--- 238,242 ----
          //Modifier l'état du document issu d'un document compressé dans le fichier elements.xml  
          if (this.classDoc.equals(DocumentsConstants.DOC_CLASSE_GROUPE)) {
!           this.setEtatDocEltXML(DocumentsConstants.CONVERSION_ENDED) ;
          }
  
***************
*** 247,257 ****
              // on supprime le résultat de la conversion
              ConverterXML converter = ConverterXML.getInstance();
!             if (!log.isDebugEnabled()){
                  boolean okClean = converter.cleanConv(this.id, false);
                  if (!okClean && log.isErrorEnabled()) {
!                     log.error("Le nettoyage ne s'est pas correctement terminé.");
                  }
!             }            
          }
      }
  }
\ No newline at end of file
--- 247,275 ----
              // on supprime le résultat de la conversion
              ConverterXML converter = ConverterXML.getInstance();
!             if (!log.isDebugEnabled()) {
                  boolean okClean = converter.cleanConv(this.id, false);
                  if (!okClean && log.isErrorEnabled()) {
!                     log
!                         .error("Le nettoyage ne s'est pas correctement terminé.");
                  }
!             }
!         }
!     }
! 
!     /**
!      * Mettre l'état ŕ jour au document décompressé dans le fichier xml
!      * @param CONVERSION_ETAT : CONVERSION_ENDED | CONVERSION_ERROR
!      */
!     private void setEtatDocEltXML(final String CONVERSION_ETAT) {        
!         String pathFicElementXml = this.fonds.getPathForId(id)
!                 + Constants.FILE_SEPARATOR
!                 + DocumentsConstants.NOM_FICHIER_ELEMENTS;
!         File fileElementsXml = new File(pathFicElementXml);
!         if (fileElementsXml.exists()) {
!             this.fonds.setEtatElementsXML(
!                 pathFicElementXml, this.nameFic,
!                 CONVERSION_ETAT);
          }
      }
+     
  }
\ No newline at end of file




Plus d'informations sur la liste de diffusion Castore-commits