[Castore-commits] WorkflowParser.java 1.2.2.1 1.2.2.2 WorkflowManager.java 1.3.2.2 1.3.2.3 WorkflowException.java 1.1.2.1 1.1.2.2

Stéphane Bouchet sbouchet at adullact1.hosting.cri74.org
Lun 6 Mar 12:11:33 CET 2006


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

Modified Files:
      Tag: v1_1_branch
	WorkflowParser.java WorkflowManager.java 
	WorkflowException.java 
Log Message:
correction du bug de gestion des workflows

Index: WorkflowException.java
===================================================================
RCS file: /cvsroot/castore/castore-core/src/java/fr/emn/castor/documents/metier/workflow/WorkflowException.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** WorkflowException.java	24 Nov 2005 14:29:57 -0000	1.1.2.1
--- WorkflowException.java	6 Mar 2006 11:11:30 -0000	1.1.2.2
***************
*** 49,52 ****
--- 49,62 ----
  
      /**
+      * le serialversionUID.
+      */
+     private static final long serialVersionUID = 812912422683336333L;
+ 
+     /**
+      * Erreur indiquant que l'on devrait trouver un login valide pour
+      * un validateur, mais ce n'est pas le cas.
+      */
+     public static final int BAD_LOGIN_FOR_VALIDATOR = 1;
+     /**
       * le type d'erreur rencontre.
       */
***************
*** 66,70 ****
       * @param theErrorType le type d'erreur rencontre
       */
!     public WorkflowException(final String message, final int theErrorType) {
          super(message);
          this.errorType = theErrorType;
--- 76,80 ----
       * @param theErrorType le type d'erreur rencontre
       */
!     public WorkflowException (final String message, final int theErrorType) {
          super(message);
          this.errorType = theErrorType;
***************
*** 75,79 ****
       * @param theErrorType le type d'erreur rencontre
       */
!     public WorkflowException(final int theErrorType) {
          super();
          this.errorType = theErrorType;
--- 85,89 ----
       * @param theErrorType le type d'erreur rencontre
       */
!     public WorkflowException (final int theErrorType) {
          super();
          this.errorType = theErrorType;

Index: WorkflowManager.java
===================================================================
RCS file: /cvsroot/castore/castore-core/src/java/fr/emn/castor/documents/metier/workflow/WorkflowManager.java,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -C2 -d -r1.3.2.2 -r1.3.2.3
*** WorkflowManager.java	21 Dec 2005 17:40:15 -0000	1.3.2.2
--- WorkflowManager.java	6 Mar 2006 11:11:30 -0000	1.3.2.3
***************
*** 101,105 ****
       * Prevents instantiation.
       */
!     private WorkflowManager() {
          this.jdoQuery = new JDOQuery();
          this.fonds = Fonds.getInstance();
--- 101,105 ----
       * Prevents instantiation.
       */
!     private WorkflowManager () {
          this.jdoQuery = new JDOQuery();
[...991 lines suppressed...]
              }
!             return false;
          } finally {
              pm.close();
          }
      }
  
--- 1489,1500 ----
                  }
              }
!         } catch (Exception e) {
!             if (log.isErrorEnabled()) {
!                 log.error(e.getMessage(), e);
!             }
          } finally {
              pm.close();
          }
+         return false;
      }
  

Index: WorkflowParser.java
===================================================================
RCS file: /cvsroot/castore/castore-core/src/java/fr/emn/castor/documents/metier/workflow/WorkflowParser.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C2 -d -r1.2.2.1 -r1.2.2.2
*** WorkflowParser.java	24 Nov 2005 14:29:57 -0000	1.2.2.1
--- WorkflowParser.java	6 Mar 2006 11:11:30 -0000	1.2.2.2
***************
*** 45,52 ****
  import java.util.ArrayList;
  
- import javax.xml.parsers.ParserConfigurationException;
- import javax.xml.parsers.SAXParser;
- import javax.xml.parsers.SAXParserFactory;
- 
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
--- 45,48 ----
***************
*** 56,59 ****
--- 52,56 ----
  import org.xml.sax.XMLReader;
  import org.xml.sax.helpers.DefaultHandler;
+ import org.xml.sax.helpers.XMLReaderFactory;
  
  import fr.emn.castor.common.Constants;
***************
*** 99,118 ****
       * @param workflowFiles les fichiers de configuration
       */
!     public WorkflowParser(final String[] workflowFiles) {
          this.workflows = new ArrayList();
          try {
              //construction du parser
!             SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
!             saxParserFactory.setValidating(false);
!             SAXParser saxParser = saxParserFactory.newSAXParser();
!             this.xmlReader = saxParser.getXMLReader();
          } catch (SAXException e) {
              if (log.isErrorEnabled()) {
                  log.error(e.getMessage(), e);
              }
-         } catch (ParserConfigurationException e) {
-             if (log.isErrorEnabled()) {
-                 log.error(e.getMessage(), e);
-             }
          }
          this.xmlReader.setContentHandler(this);
--- 96,109 ----
       * @param workflowFiles les fichiers de configuration
       */
!     public WorkflowParser (final String[] workflowFiles) {
          this.workflows = new ArrayList();
          try {
              //construction du parser
!             this.xmlReader = XMLReaderFactory
!                 .createXMLReader(Constants.XML_SAX_PARSER);
          } catch (SAXException e) {
              if (log.isErrorEnabled()) {
                  log.error(e.getMessage(), e);
              }
          }
          this.xmlReader.setContentHandler(this);
***************
*** 141,152 ****
  
      /**
-      * @see org.xml.sax.ContentHandler#characters(char[], int, int)
-      */
-     public final void characters(
-             final char[] text, final int start, final int length) {
-         // il n'y a pas de texte a lire dans les fichiers xml de workflow
-     }
- 
-     /**
       * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
       */
--- 132,135 ----
***************
*** 193,201 ****
              this.currentWorkflow = new Workflow(attributes.getValue("id"));
          } else if (qName.equals("step")) {
!             this.stepNumber = Integer.parseInt(attributes.getValue("number"));
              this.currentWorkflow.addStep(this.stepNumber);
          } else if (qName.equals("acces")) {
              this.inAcces = true;
!             WorkflowStep step = this.currentWorkflow.getStep(this.stepNumber);
              if (step != null) {
                  step.setValidationType(DocumentsConstants.VALIDATION_ACCES);
--- 176,186 ----
              this.currentWorkflow = new Workflow(attributes.getValue("id"));
          } else if (qName.equals("step")) {
!             this.stepNumber = Integer
!                 .parseInt(attributes.getValue("number"));
              this.currentWorkflow.addStep(this.stepNumber);
          } else if (qName.equals("acces")) {
              this.inAcces = true;
!             WorkflowStep step = this.currentWorkflow
!                 .getStep(this.stepNumber);
              if (step != null) {
                  step.setValidationType(DocumentsConstants.VALIDATION_ACCES);
***************
*** 207,213 ****
          } else if (qName.equals("content")) {
              this.inContent = true;
!             WorkflowStep step = this.currentWorkflow.getStep(this.stepNumber);
              if (step != null) {
!                 step.setValidationType(DocumentsConstants.VALIDATION_CONTENT);
              } else {
                  if (log.isErrorEnabled()) {
--- 192,200 ----
          } else if (qName.equals("content")) {
              this.inContent = true;
!             WorkflowStep step = this.currentWorkflow
!                 .getStep(this.stepNumber);
              if (step != null) {
!                 step
!                     .setValidationType(DocumentsConstants.VALIDATION_CONTENT);
              } else {
                  if (log.isErrorEnabled()) {
***************
*** 217,223 ****
          } else if (qName.equals("metadata")) {
              this.inMetadata = true;
!             WorkflowStep step = this.currentWorkflow.getStep(this.stepNumber);
              if (step != null) {
!                 step.setValidationType(DocumentsConstants.VALIDATION_METADATA);
              } else {
                  if (log.isErrorEnabled()) {
--- 204,212 ----
          } else if (qName.equals("metadata")) {
              this.inMetadata = true;
!             WorkflowStep step = this.currentWorkflow
!                 .getStep(this.stepNumber);
              if (step != null) {
!                 step
!                     .setValidationType(DocumentsConstants.VALIDATION_METADATA);
              } else {
                  if (log.isErrorEnabled()) {
***************
*** 227,231 ****
          } else if (qName.equals("collection")) {
              this.inCollection = true;
!             WorkflowStep step = this.currentWorkflow.getStep(this.stepNumber);
              if (step != null) {
                  step
--- 216,221 ----
          } else if (qName.equals("collection")) {
              this.inCollection = true;
!             WorkflowStep step = this.currentWorkflow
!                 .getStep(this.stepNumber);
              if (step != null) {
                  step
***************
*** 238,242 ****
          } else if (qName.equals("group")) {
              // c'est un groupe qui doit valider
!             WorkflowStep step = this.currentWorkflow.getStep(this.stepNumber);
              if (step != null) {
                  step.addValidateur(attributes.getValue("name"));
--- 228,233 ----
          } else if (qName.equals("group")) {
              // c'est un groupe qui doit valider
!             WorkflowStep step = this.currentWorkflow
!                 .getStep(this.stepNumber);
              if (step != null) {
                  step.addValidateur(attributes.getValue("name"));
***************
*** 248,252 ****
          } else if (qName.equals("people")) {
              // c'est une personne qui doit valider
!             WorkflowStep step = this.currentWorkflow.getStep(this.stepNumber);
              if (step != null) {
                  step.addValidateur(attributes.getValue("name"));
--- 239,244 ----
          } else if (qName.equals("people")) {
              // c'est une personne qui doit valider
!             WorkflowStep step = this.currentWorkflow
!                 .getStep(this.stepNumber);
              if (step != null) {
                  step.addValidateur(attributes.getValue("name"));
***************
*** 262,266 ****
              // il faut lire la donnée une fois celle-ci remplie par
              // l'utilisateur...
!             WorkflowStep step = this.currentWorkflow.getStep(this.stepNumber);
  
              if (step != null) {
--- 254,259 ----
              // il faut lire la donnée une fois celle-ci remplie par
              // l'utilisateur...
!             WorkflowStep step = this.currentWorkflow
!                 .getStep(this.stepNumber);
  
              if (step != null) {
***************
*** 279,283 ****
                          .setValidationType(DocumentsConstants.WORKFLOW_METADATA_MD_LINK);
                  }
!                 step.addValidateurLink(attributes.getValue("metadatakey"));                
              } else {
                  if (log.isErrorEnabled()) {
--- 272,276 ----
                          .setValidationType(DocumentsConstants.WORKFLOW_METADATA_MD_LINK);
                  }
!                 step.addValidateurLink(attributes.getValue("metadatakey"));
              } else {
                  if (log.isErrorEnabled()) {




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