SuiteTestUpdateImpl.java :  » Test-Coverage » salome-tmf » org » objectweb » salome_tmf » api » api2ihm » suiteTest » Java Open Source

Java Open Source » Test Coverage » salome tmf 
salome tmf » org » objectweb » salome_tmf » api » api2ihm » suiteTest » SuiteTestUpdateImpl.java
/*
* SalomeTMF is a Test Management Framework
* Copyright (C) 2005 France Telecom R&D
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @author Fayal SOUGRATI
*
* Contact: mikael.marche@rd.francetelecom.com
*/

package org.objectweb.salome_tmf.api.api2ihm.suiteTest;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;

import org.objectweb.salome_tmf.api.api2db.DataBase;
import org.objectweb.salome_tmf.api.api2ihm.Utile;

/**
 * Fonctions de mise  jour relatives  l'aire fonctionnelle "Suites de test"
 */
public class SuiteTestUpdateImpl implements SuiteTestUpdate {

  /**
   * Base de donnees
   */
  DataBase database;
  
  /**
   * Fichier "properties" contenant les requetes SQL relatives aux suites de test
   */
  Properties prop;
  
  /**
   * ID du projet SalomeTMF dans lequel on se situe
   */
  int idProject;
  
  /**
   * Nom du projet SalomeTMF dans lequel on se situe
   */
  String nameProject;

    private boolean special_allow = false;
  /**
   * Constructeur
   * @param db
   * @param pr
   */
  public SuiteTestUpdateImpl(DataBase db, Properties pr) {
    database = db;
    prop = pr;    
  }
  
  /**
   * Fonction qui fixe le projet SalomeTMF dans lequel l'utilisateur travaille
   * @param projectName
   */
   public void setProject(String projectName) {
    nameProject = projectName;
    idProject = Utile.getIdProject(database,prop,projectName);
   }

  /**
   * Mise  jour d'une famille de test
   * @param oldName
   * @param newName
   * @param newDesc
   */
  public void updateFamily(String oldName, String newName, String newDesc) {
       if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
         org.objectweb.salome_tmf.api.Api.log("updateFamily NOT ALLOW");
         try {
       throw new Exception("updateFamily NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
       }
    int idFamily = -1;
    
    int _num = -1;
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
       // Initialisation de l'ID de la famille de test
       idFamily = STCommun.getIdFamily(database,prop,idProject,oldName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFamily"));
      prep.setString(1, newName);
      prep.setString(2, newDesc);
      prep.setInt(3, idFamily);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateFamily", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }  
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        /**
   * Mise  jour d'une famille de test
   * @param familyId
   * @param newName
   * @param newDesc
   */
  public void updateFamilyUsingID(int familyId, String newName, String newDesc) {
       if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
         org.objectweb.salome_tmf.api.Api.log("updateFamily NOT ALLOW");
         try {
       throw new Exception("updateFamily NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
       }
    int _num = -1;
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFamily"));
      prep.setString(1, newName);
      prep.setString(2, newDesc);
      prep.setInt(3, familyId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateFamily", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }  
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
  
  /**
   * Change le numro d'ordre des familles
   * @param familyName
   * @param order
   */
  public void updateFamilyOrder(String familyName, int order) {
      if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
        try {
       throw new Exception("updateFamilyOrder NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
      }
      
    int _num = -1; 
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
        //  Initialisation de l'ID de la famille de test
      int idFamily = STCommun.getIdFamily(database,prop,idProject,familyName);
      
      // Mise a jour de l'ordre du test dans la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFamilyOrder"));
      prep.setInt(1, order);
      prep.setInt(2, idFamily);
      prep.executeUpdate();
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateFamilyOrder", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        /**
   * Change le numro d'ordre des familles
   * @param familyId
   * @param order
   */
  public void updateFamilyOrderUsingID(int familyId, int order) {
      if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
        try {
       throw new Exception("updateFamilyOrder NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
      }
      
    int _num = -1; 
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
          // Mise a jour de l'ordre du test dans la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFamilyOrder"));
      prep.setInt(1, order);
      prep.setInt(2, familyId);
      prep.executeUpdate();
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateFamilyOrder", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
  
  
  
  /**
   * mise a jour d'une suite de test
   * @param familyName
   * @param oldName
   * @param newName
   * @param newDesc
   */
  public void updateSuite(String familyName, String oldName, String newName, String newDesc) {
       if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
         try {
       throw new Exception("updateSuite NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
       }
     int idFamily = -1;
     int idSuite = -1;
    
     int _num = -1; 
     try {
         _num = org.objectweb.salome_tmf.api.Api.beginTrans();
         
         // Initialisation de l'ID de la famille de test
         idFamily = STCommun.getIdFamily(database,prop,idProject,familyName);
       
       // Initialisation de l'ID de la suite de test
       idSuite = STCommun.getIdSuite(database,prop,idProject,oldName,idFamily);
  
       // Mise a jour de la suite de test
       PreparedStatement prep = database.prepareStatement(prop.getProperty("updateSuite"));
       prep.setString(1, newName);
       prep.setString(2, newDesc);
       prep.setInt(3, idSuite);
       prep.executeUpdate();
  
     }
     catch(SQLException E) {
       E.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException("updateSuite", null, E);
     }catch (Exception ex) {
         ex.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
     }
     org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
  
        /**
   * mise a jour d'une suite de test
   * @param suiteId
   * @param newName
   * @param newDesc
   */
  public void updateSuiteUsingID(int suiteId, String newName, String newDesc) {
       if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
         try {
       throw new Exception("updateSuite NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
       }
       
     int _num = -1; 
     try {
         _num = org.objectweb.salome_tmf.api.Api.beginTrans();
         
          // Mise a jour de la suite de test
       PreparedStatement prep = database.prepareStatement(prop.getProperty("updateSuite"));
       prep.setString(1, newName);
       prep.setString(2, newDesc);
       prep.setInt(3, suiteId);
       prep.executeUpdate();
  
     }
     catch(SQLException E) {
       E.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException("updateSuite", null, E);
     }catch (Exception ex) {
         ex.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
     }
     org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
  /**
   * Changer le numro d'ordre des suites de tests
   * @param familyName
   * @param suiteName
   * @param order
   */  
  public void updateSuiteOrder(String familyName, String suiteName, int order) {
        if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest())){
         try {
       throw new Exception("updateSuiteOrder NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
        }
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
       //  Initialisation de l'ID de la famille de test
      int idFamily = STCommun.getIdFamily(database,prop,idProject,familyName);
       
      // Initialisation de l'ID de la suite de test
      int idSuite = STCommun.getIdSuite(database,prop,idProject,suiteName,idFamily);

      // Mise a jour de l'ordre du test dans la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateSuiteOrder"));
      prep.setInt(1, order);
      prep.setInt(2, idSuite);
      prep.executeUpdate();
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateSuiteOrder", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        /**
   * Changer le numro d'ordre des suites de tests
   * @param suiteId
   * @param order
   */  
  public void updateSuiteOrderUsingID(int suiteId, int order) {
        if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest())){
         try {
       throw new Exception("updateSuiteOrder NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
        }
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // Mise a jour de l'ordre du test dans la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateSuiteOrder"));
      prep.setInt(1, order);
      prep.setInt(2, suiteId);
      prep.executeUpdate();
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateSuiteOrder", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }

   /**
  * Mise a jour d'un test
  * @param familyName
  * @param suiteName
  * @param oldTestName
  * @param newTestName
  * @param newLoginPersonne
  * @param newTestType
  * @param newTestDesc
  */
   public void updateTest(String familyName, String suiteName, String oldTestName, String newTestName, String newLoginPersonne, 
                          String newTestDesc) {
        if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
         try {
       throw new Exception("updateTest NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
  }
                           
     int idFamily = -1;
     int idSuite = -1;
     int idTest = -1;
     //int idPers = -1;

     int _num = -1; 
     try {
         _num = org.objectweb.salome_tmf.api.Api.beginTrans();
         
      // Initialisation de l'ID de la famille de test
      idFamily = STCommun.getIdFamily(database,prop,idProject,familyName);
       
       // Initialisation de l'ID de la suite de test
       idSuite = STCommun.getIdSuite(database,prop,idProject,suiteName,idFamily);

       // Initialisation de l'ID du test
       idTest = STCommun.getIdTest(database,prop,oldTestName,idSuite);
      
       // Initialisation de l'ID de l'utilisateur
       //idPers = Utile.getIdPerson(database,prop,newLoginPersonne);

       // Mise a jour du test
       /*
         PreparedStatement prep = database.prepareStatement(prop.getProperty("updateTest"));
         prep.setInt(1, idPers);
         prep.setString(2, newTestName);
         prep.setString(3, newTestDesc);
         prep.setInt(4, idTest);
       */
       
       // Mise a jour du test
       PreparedStatement prep = database.prepareStatement(prop.getProperty("updateTest2"));
       prep.setString(1, newTestName);
       prep.setString(2, newTestDesc);
       prep.setInt(3, idTest);
       
       prep.executeUpdate();
     }
     catch(SQLException E) {
         E.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException("updateTest2", null, E);
     }catch (Exception ex) {
         ex.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
     }  
     org.objectweb.salome_tmf.api.Api.commitTrans(_num);
   }
   
   /**
    * Mise a jour d'un test
    * @param testId
    * @param newTestName
    * @param newLoginPersonne
    * @param newTestType
    * @param newTestDesc
    */
   public void updateTestUsingID(int testId, String newTestName, String newTestDesc) {
        if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
         try {
       throw new Exception("updateTest NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
  }
                           
     int _num = -1; 
     try {
         _num = org.objectweb.salome_tmf.api.Api.beginTrans();
         
       PreparedStatement prep = database.prepareStatement(prop.getProperty("updateTest2"));
       prep.setString(1, newTestName);
       prep.setString(2, newTestDesc);
       prep.setInt(3, testId);
       
       prep.executeUpdate();
     }
     catch(SQLException E) {
         E.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException("updateTest2", null, E);
     }catch (Exception ex) {
         ex.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
     }  
     org.objectweb.salome_tmf.api.Api.commitTrans(_num);
   }
  
  
   /**
  * Changer l'ordre d'un test dans une suite de test
  * @param familyName
  * @param suiteName
  * @param testName
  * @param testOrder
  */
   public void updateTestOrder(String familyName, String suiteName, String testName, int testOrder) {
        if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
         try {
       throw new Exception("updateTestOrder NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
  }
  int idFamily = -1;
  int idSuite = -1;
  int idTest = -1;
     
  int _num = -1; 
  try { 
      _num = org.objectweb.salome_tmf.api.Api.beginTrans();
  
      //  Initialisation de l'ID de la famille de test
      idFamily = STCommun.getIdFamily(database,prop,idProject,familyName);
       
      // Initialisation de l'ID de la suite de test
      idSuite = STCommun.getIdSuite(database,prop,idProject,suiteName,idFamily);
      
      // Initialisation de l'ID du test
      idTest = STCommun.getIdTest(database,prop,testName,idSuite);
      
      // Mise a jour de l'ordre du test dans la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateTestOrder"));
      prep.setInt(1, testOrder);
      prep.setInt(2, idTest);
      prep.executeUpdate();
  }
  catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateTestOrder", null, E);
  }catch (Exception ex) {
      ex.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
  }
  org.objectweb.salome_tmf.api.Api.commitTrans(_num);
   }
   
   /**
  * Changer l'ordre d'un test dans une suite de test
  * @param testId
  * @param testOrder
  */
   public void updateTestOrderUsingID(int testId, int testOrder) {
        if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
         try {
       throw new Exception("updateTestOrder NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
  }
  
  int _num = -1; 
  try { 
      _num = org.objectweb.salome_tmf.api.Api.beginTrans();
  
      // Mise a jour de l'ordre du test dans la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateTestOrder"));
      prep.setInt(1, testOrder);
      prep.setInt(2, testId);
      prep.executeUpdate();
  }
  catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateTestOrder", null, E);
  }catch (Exception ex) {
      ex.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
  }
  org.objectweb.salome_tmf.api.Api.commitTrans(_num);
   }
  
   
  /**
   * Mise a jour d'une action d'un test manuel
   * @param familyName
   * @param suiteName
   * @param testName
   * @param oldActionName
   * @param newActionName
   * @param newActionDesc
   * @param newActionResAttendu
   * @param newActionNum
   */
  public void updateAction(String familyName, String suiteName, String testName, String oldActionName, String newActionName, 
                           String newActionDesc, String newActionResAttendu, int newActionNum) {
      
      if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
        try {
       throw new Exception("updateAction NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
      }
    int idFamily = -1;
     int idSuite = -1;
     int idTest = -1;
     int idAction = -1;
    

     int _num = -1; 
     try { 
         _num = org.objectweb.salome_tmf.api.Api.beginTrans();
         
         PreparedStatement prep = database.prepareStatement(prop.getProperty("updateAction"));

      //  Initialisation de l'ID de la famille de test
      idFamily = STCommun.getIdFamily(database,prop,idProject,familyName);
       
       // Initialisation de l'ID de la suite de test
       idSuite = STCommun.getIdSuite(database,prop,idProject,suiteName,idFamily);

       // Initialisation de l'ID du test manuel
       idTest = STCommun.getIdTest(database,prop,testName,idSuite);
      
       // Initialisation de l'Id de l'action de test
       idAction = STCommun.getIdAction(database,prop,oldActionName,idTest);

       prep.setString(1, newActionName);
       prep.setString(2, newActionDesc);
       prep.setString(3, newActionResAttendu);
       prep.setInt(4, newActionNum);
       prep.setInt(5, idAction);
       prep.executeUpdate();
     }
     catch(SQLException E) {
         E.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException("updateAction", null, E);
     }catch (Exception ex) {
         ex.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
     }
     org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        /**
   * Mise a jour d'une action d'un test manuel
   * @param actionId
   * @param newActionName
   * @param newActionDesc
   * @param newActionResAttendu
   * @param newActionNum
   */
  public void updateActionUsingID(int actionId, String newActionName, String newActionDesc, String newActionResAttendu, int newActionNum) {
      
      if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
        try {
       throw new Exception("updateAction NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
      }
  
     int _num = -1; 
     try { 
         _num = org.objectweb.salome_tmf.api.Api.beginTrans();
         
         PreparedStatement prep = database.prepareStatement(prop.getProperty("updateAction"));

       prep.setString(1, newActionName);
       prep.setString(2, newActionDesc);
       prep.setString(3, newActionResAttendu);
       prep.setInt(4, newActionNum);
       prep.setInt(5, actionId);
       prep.executeUpdate();
     }
     catch(SQLException E) {
         E.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException("updateAction", null, E);
     }catch (Exception ex) {
         ex.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
     }
     org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
  
    /**
  * Changer l'ordre d'une action de test appartenant a un test manuel
  * @param familyName
  * @param suiteName
  * @param testName
  * @param actionName
  * @param actionOrder
  */
    public void updateActionOrder(String familyName, String suiteName, String testName, String actionName, int actionOrder) {
       
       if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
         try {
       throw new Exception("updateActionOrder NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
         return;
     }
       }
       int idFamily = -1;
       int idSuite = -1;
       int idTest = -1;
       int idAction = -1;
       

     int _num = -1; 
     try {
         _num = org.objectweb.salome_tmf.api.Api.beginTrans();
         
         PreparedStatement prep = database.prepareStatement(prop.getProperty("updateActionOrder"));
         
         //  Initialisation de l'ID de la famille de test
         idFamily = STCommun.getIdFamily(database,prop,idProject,familyName);
         
       // Initialisation de l'ID de la suite de test
         idSuite = STCommun.getIdSuite(database,prop,idProject,suiteName,idFamily);
         
         // Initialisation de l'ID du test manuel
       idTest = STCommun.getIdTest(database,prop,testName, idSuite);
       
       // Initialisation de l'Id de l'action de test
       idAction = STCommun.getIdAction(database,prop,actionName,idTest);
       
       // Execution de la requete
       prep.setInt(1, actionOrder);
       prep.setInt(2, idAction);
       prep.executeUpdate();
     }
     catch(SQLException E) {
         E.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException("updateActionOrder", null, E);
     }catch (Exception ex) {
         ex.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
     }
     org.objectweb.salome_tmf.api.Api.commitTrans(_num);
    }
    
    /**
    * Changer l'ordre d'une action de test appartenant a un test manuel
    * @param actionId
    * @param actionOrder
    */
    public void updateActionOrderUsingID(int actionId, int actionOrder) {
       
       if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
         try {
       throw new Exception("updateActionOrder NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
         return;
     }
       }
       
     int _num = -1; 
     try {
         _num = org.objectweb.salome_tmf.api.Api.beginTrans();
         
         PreparedStatement prep = database.prepareStatement(prop.getProperty("updateActionOrder"));
         
              // Execution de la requete
               prep.setInt(1, actionOrder);
               prep.setInt(2, actionId);
               prep.executeUpdate();
     }
     catch(SQLException E) {
         E.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException("updateActionOrder", null, E);
     }catch (Exception ex) {
         ex.printStackTrace();
         org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
     }
     org.objectweb.salome_tmf.api.Api.commitTrans(_num);
    }
   
   /**
  * Changer le contenu d'un fichier attach  une suite de tests
  * @param familyName
  * @param suiteName
  * @param filePath
  */
  public void updateFileForSuite(String familyName, String suiteName, String filePath)  throws FileNotFoundException {

      if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
        try {
       throw new Exception("updateFileForSuite NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
      }
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On cre le fichier  partir de l'URL
      File file = new File(filePath);
      // On rcupre le nom du fichier
      String fileName = file.getName();
      // On enregistre le flux du fichier
      FileInputStream fis = new FileInputStream(file);
      BufferedInputStream bis = new BufferedInputStream(fis);
  
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID de l'attachement
      int fileAttachId = STCommun.getSuiteAttachFileId(database,prop,suiteId,fileName);
    
      // Appel de la requete a executer
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttach"));
      prep.setBinaryStream(1,bis,bis.available());
      prep.setInt(2,fileAttachId);
      
      
      prep.executeUpdate();
      bis.close();  
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateFileAttach", null, sqle);
    } catch(Exception e) {
        org.objectweb.salome_tmf.api.Api.addException( null, null, e);
        e.printStackTrace();
        if (e instanceof FileNotFoundException) {
      org.objectweb.salome_tmf.api.Api.commitTrans(_num);
      throw new FileNotFoundException();
        }
    } 
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        
   /**
  * Changer le contenu d'un fichier attach  un test
  * @param familyName
  * @param suiteName
  * @param testName
  * @param filePath
  */
  public void updateFileForTest(String familyName, String suiteName, String testName, String filePath)  throws FileNotFoundException {
       if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
        try {
       throw new Exception("updateFileForTest NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
        }
        return;
    }
       }
       int _num = -1;
       try { 
     _num = org.objectweb.salome_tmf.api.Api.beginTrans();
     
      // On cre le fichier  partir de l'URL
      File file = new File(filePath);
      // On rcupre le nom du fichier
      String fileName = file.getName();
      // On enregistre le flux du fichier
      FileInputStream fis = new FileInputStream(file);
      BufferedInputStream bis = new BufferedInputStream(fis);
  
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);
      // On initialise l'ID de l'attachement
      int fileAttachId = STCommun.getTestAttachFileId(database,prop,testId,fileName);
    
      // Appel de la requete a executer
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttach"));
      prep.setBinaryStream(1,bis,bis.available());
      prep.setInt(2,fileAttachId);
      
      
      prep.executeUpdate();
      bis.close();  
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateFileAttach", null, sqle);
    } catch(Exception e) {
        org.objectweb.salome_tmf.api.Api.addException( null, null, e);
        e.printStackTrace();
      if (e instanceof FileNotFoundException) {
          org.objectweb.salome_tmf.api.Api.commitTrans(_num);
          throw new FileNotFoundException();
      } 
    }
       org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        
  /**
   * Changer le contenu d'un fichier attach  un test
   * @param familyName
   * @param suiteName
   * @param testName
   * @param filePath
   */
   public void updateScriptForTest(String familyName, String suiteName, String testName, String filePath)  throws FileNotFoundException {
      if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
       try {
           throw new Exception("updateScriptForTest NOT ALLOW");
       }catch (Exception e) {
           e.printStackTrace();
           org.objectweb.salome_tmf.api.Api.addException(e);
       }
       return;
     }
      }
     int _num = -1; 
     try {
         _num = org.objectweb.salome_tmf.api.Api.beginTrans();
         
       // On cre le fichier  partir de l'URL
       File file = new File(filePath);
       // On rcupre le nom du fichier
       String fileName = file.getName();
       // On enregistre le flux du fichier
       FileInputStream fis = new FileInputStream(file);
       BufferedInputStream bis = new BufferedInputStream(fis);
  
       // On initialse l'ID de la famille de test
       int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
       // On initialise l'ID de la suite de test
       int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
       // On initialise l'ID du test
       int testId = STCommun.getIdTest(database, prop, testName, suiteId);
       
       int scriptId = STCommun.getIdScript(database, prop, testId, fileName);
       // On initialise l'ID de l'attachement
       int scriptAttachId = STCommun.getTestAttachScriptId(database, prop, scriptId);
    
       // Appel de la requete a executer
       PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttach"));
       prep.setBinaryStream(1,bis,bis.available());
       prep.setInt(2,scriptAttachId);
      
      
       prep.executeUpdate();
       bis.close();  
     } catch (SQLException sqle) {
       sqle.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException( "updateFileAttach", null, sqle);
     } catch(Exception e) {
         org.objectweb.salome_tmf.api.Api.addException( null, null, e);
         e.printStackTrace();
       if (e instanceof FileNotFoundException) {
           org.objectweb.salome_tmf.api.Api.commitTrans(_num);
           throw new FileNotFoundException();
       }
     } 
     org.objectweb.salome_tmf.api.Api.commitTrans(_num);
   }
         
           /**
   /**
   * @param scriptId
   * @param filePath
   * @throws FileNotFoundException
   */
  public void updateScriptContentUsingID(int scriptId, String filePath)  throws FileNotFoundException {
      if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
       try {
           throw new Exception("updateScriptForTest NOT ALLOW");
       }catch (Exception e) {
           e.printStackTrace();
           org.objectweb.salome_tmf.api.Api.addException(e);
       }
       return;
     }
      }
     int _num = -1; 
     try {
         _num = org.objectweb.salome_tmf.api.Api.beginTrans();
         
       // On cre le fichier  partir de l'URL
       File file = new File(filePath);
       // On rcupre le nom du fichier
       //String fileName = file.getName();
       // On enregistre le flux du fichier
       FileInputStream fis = new FileInputStream(file);
       BufferedInputStream bis = new BufferedInputStream(fis);
  
       // On initialise l'ID de l'attachement
       int scriptAttachId = STCommun.getTestAttachScriptId(database, prop, scriptId);
    
       // Appel de la requete a executer
       PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttach"));
       prep.setBinaryStream(1,bis,bis.available());
       prep.setInt(2,scriptAttachId);
      
      
       prep.executeUpdate();
       bis.close();  
     } catch (SQLException sqle) {
       sqle.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException( "updateFileAttach", null, sqle);
     } catch(Exception e) {
         org.objectweb.salome_tmf.api.Api.addException( null, null, e);
       if (e instanceof FileNotFoundException) {
          e.printStackTrace();
           org.objectweb.salome_tmf.api.Api.commitTrans(_num);
           throw new FileNotFoundException();
       } 
     } 
     org.objectweb.salome_tmf.api.Api.commitTrans(_num);
   }
  
  /**
   * @param scriptId
   * @param name
   */
  public void updateScriptNameUsingID(int scriptId, String name) {
    if (!special_allow) {
      if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject
          .canUpdateTest())) {
        try {
          throw new Exception("updateScriptForTest NOT ALLOW");
        } catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
        }
        return;
      }
    }
    int _num = -1;
    try {
      _num = org.objectweb.salome_tmf.api.Api.beginTrans();

      // On initialise l'ID de l'attachement
      int scriptAttachId = STCommun.getTestAttachScriptId(database, prop,
          scriptId);

      // Mise  jour du nom du fichier attach
      PreparedStatement prep = database.prepareStatement(prop
          .getProperty("updateFileAttachName"));
      prep.setString(1, name);
      prep.setInt(2, scriptAttachId);
      prep.executeUpdate();
      
      // Mise a jour du nom du script
      prep = database.prepareStatement(prop
          .getProperty("updateScriptName"));
      prep.setString(1, name);
      prep.setInt(2, scriptId);
      prep.executeUpdate();
      
    } catch (SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateScriptForTest",
          null, E);
    } catch (Exception ex) {
      ex.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException(null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
  
   /**
    * Changer le contenu d'un fichier attach  une action
    * 
    * @param familyName
    * @param suiteName
    * @param testName
    * @param actionName
    * @param filePath
    */
  public void updateFileForAction(String familyName, String suiteName, String testName, String actionName, String filePath)  throws FileNotFoundException {
       if (!special_allow) {
     if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest())){
        try {
      throw new Exception("updateFileForAction NOT ALLOW");
        }catch (Exception e) {
      e.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException(e);
        }
        return;
     }
       }
    int _num = -1; 
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On cre le fichier  partir de l'URL
      File file = new File(filePath);
      
      
      // On rcupre le nom du fichier
      String fileName = file.getName();
      // On enregistre le flux du fichier
      FileInputStream fis = new FileInputStream(file);
      BufferedInputStream bis = new BufferedInputStream(fis);
  
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);
      // On initialise l'ID de l'action
      int actionId = STCommun.getIdAction(database, prop, actionName, testId);
      // On initialise l'ID de l'attachement
      int fileAttachId = STCommun.getActionAttachFileId(database,prop,actionId,fileName);
    
      // Appel de la requete a executer
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttach"));
      prep.setBinaryStream(1,bis,bis.available());
      prep.setInt(2,fileAttachId);
      prep.executeUpdate();
      bis.close();  
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateFileAttach", null, sqle);
    } catch(Exception e) {
        org.objectweb.salome_tmf.api.Api.addException( null, null, e);
        e.printStackTrace();
      if (e instanceof FileNotFoundException) {
          org.objectweb.salome_tmf.api.Api.commitTrans(_num);
        throw new FileNotFoundException();
      }
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
  
  /**
   * Changer la description d'un fichier attach
   * @param fileName
   * @param newDescription
   */
  public void updateFileAttachDescriptionForTest(String familyName, String suiteName, String testName, String fileName, String newDescription) {
    int idFileAttach = -1;
    if (!special_allow) {
        if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest())){
      try {
          throw new Exception("updateFileAttachDescriptionForTest NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
        }
    }
    int _num = -1;
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      //int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      //int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      //int testId = STCommun.getIdTest(database, prop, testName, suiteId);
      // On initialise l'ID de l'attachement
      //int fileAttachId = STCommun.getTestAttachFileId(database,prop,testId,fileName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateAttachDescription"));
      prep.setString(1, newDescription);
      prep.setInt(2, idFileAttach);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateAttachDescription", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
  
  /**
   * Changer la description d'une url attache
   * @param urlName
   * @param newDescription
   */
  public void updateUrlAttachDescriptionForTest(String familyName, String suiteName, String testName, String urlName, String newDescription) {
        if (!special_allow) {
        if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      try {
          throw new Exception("updateUrlAttachDescriptionForTest NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
        }
    }
    int idUrlAttach = -1;
    
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);
       // Initialisation de l'ID de l'url
       idUrlAttach = STCommun.getTestAttachUrlId(database,prop,testId, urlName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateAttachDescription"));
      prep.setString(1, newDescription);
      prep.setInt(2, idUrlAttach);
      prep.executeUpdate();
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateAttachDescription", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }  
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
  /**
   * Changer la longueur d'un fichier attach
   * @param fileName un nom de fichier
   * @param length la longueur du fichier
   */  
  public void updateFileAttachLengthForTest(String familyName, String suiteName, String testName, String fileName, long length) {
      if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest())){
        org.objectweb.salome_tmf.api.Api.log("updateUrlAttachDescription NOT ALLOW");
        try {
      throw new Exception("updateFileAttachLengthForTest");
         }catch (Exception e) {
      e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
      }
    int _num = -1;
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        

      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);
      // On initialise l'ID de l'attachement
      int fileAttachId = STCommun.getTestAttachFileId(database,prop,testId,fileName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttachLength"));
      prep.setLong(1, length);
      prep.setInt(2, fileAttachId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateFileAttachLength", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }  
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
 
  /**
   * Changer la date d'un fichier
   * @param fileName le nom du fichier
   * @param date la date du fichier
   */
  public void updateFileAttachDateForTest(String familyName, String suiteName, String testName, String fileName, Date date) {
      if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest())){
        org.objectweb.salome_tmf.api.Api.log("updateUrlAttachDescription NOT ALLOW");
        try {
       throw new Exception("updateFileAttachDateForTest NOT ALLOW");
        }catch (Exception e) {
      e.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException(e);
        }
        return;
    }
      }
      
    int _num = -1; 
    try { 
      _num = org.objectweb.salome_tmf.api.Api.beginTrans();
      
        // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);
      // On initialise l'ID de l'attachement
      int fileAttachId = STCommun.getTestAttachFileId(database,prop,testId,fileName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttachDate"));
      prep.setDate(1, date);
      prep.setInt(2, fileAttachId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateFileAttachDate", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }  
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
 
  /**
   * 
   * @param familyName
   * @param suiteName
   * @param testName
   * @param scriptName
   * @param newClassPath
   */
  public void updateScriptClassPath(String familyName, String suiteName, String testName, String scriptName, String newClassPath) {
      if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
        org.objectweb.salome_tmf.api.Api.log("updateUrlAttachDescription NOT ALLOW");
        try {
      throw new Exception("updateUrlAttachDescription NOT ALLOW");
        }catch (Exception e) {
      e.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException(e);
        }
        return;
    }
      }
      
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);

       // Initialisation de l'ID du script
       int idScript = STCommun.getIdScript(database, prop, testId, scriptName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateScriptClassPath"));
      org.objectweb.salome_tmf.api.Api.log(prop.getProperty("updateScriptClassPath"));
      prep.setString(1, newClassPath);
      prep.setInt(2, idScript);
      
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateScriptClassPath", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }  
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);

  }
  
  /**
   * 
   * @param familyName
   * @param suiteName
   * @param testName
   * @param scriptName
   * @param newClassPath
   */
  public void updateScriptPlugArg(String familyName, String suiteName, String testName,String scriptName, String newPlugArg) {
      if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest())){
        org.objectweb.salome_tmf.api.Api.log("updateScriptClassToBeExecuted NOT ALLOW");
        try {
       throw new Exception("updateScriptClassToBeExecuted NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
      }
      
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);

       // Initialisation de l'ID du script
       int idScript = STCommun.getIdScript(database, prop, testId, scriptName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateScriptClassToBeExecuted"));
      prep.setString(1, newPlugArg);
      prep.setInt(2, idScript);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateScriptClassToBeExecuted", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }  
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
    
  }
        
        /**
   * @param scriptId
   * @param newPlugArg
   * @see org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest() 
   * @see org.objectweb.salome_tmf.api.api2ihm.AdminProject.canDeleteTest()
   */
        public void updateScriptPlugArgUsingID(int scriptId, String newPlugArg) {
      if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest())){
        org.objectweb.salome_tmf.api.Api.log("updateScriptClassToBeExecuted NOT ALLOW");
        try {
       throw new Exception("updateScriptClassToBeExecuted NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
      }
      
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateScriptClassToBeExecuted"));
      prep.setString(1, newPlugArg);
      prep.setInt(2, scriptId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateScriptClassToBeExecuted", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }  
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
    
  }

  /**
   * Changer la description d'un fichier attach
   * @param fileName
   * @param newDescription
   */
  public void updateFileAttachDescriptionForAction(String familyName, String suiteName, String testName, String actionName, String fileName, String newDescription) {
    int idFileAttach = -1;
    if (!special_allow) {
      if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateFileAttachDescription NOT ALLOW");
      try {
          throw new Exception("updateFileAttachDescriptionForAction");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
      }
    }
    int _num = -1; 
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      //int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      //int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      //int testId = STCommun.getIdTest(database, prop, testName, suiteId);
      
      //int actionId = STCommun.getIdAction(database, prop, actionName, testId);
      // On initialise l'ID de l'attachement
      //int fileAttachId = STCommun.getActionAttachFileId(database,prop,actionId,fileName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateAttachDescription"));
      prep.setString(1, newDescription);
      prep.setInt(2, idFileAttach);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateAttachDescription", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
     /**
   * Changer la description d'une url attache
   * @param urlName
   * @param newDescription
   */
  public void updateUrlAttachDescriptionForAction(String familyName, String suiteName, String testName, String actionName, String urlName, String newDescription) {
      if (!special_allow) {
      if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      try {
          throw new Exception("updateUrlAttachDescriptionForAction NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
      }
    }
    int idUrlAttach = -1;
    
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);
      int actionId = STCommun.getIdAction(database, prop, actionName, testId);
       // Initialisation de l'ID de l'url
       idUrlAttach = STCommun.getActionAttachUrlId(database,prop,actionId, urlName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateAttachDescription"));
      prep.setString(1, newDescription);
      prep.setInt(2, idUrlAttach);
      prep.executeUpdate();
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateAttachDescription", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
  /**
   * Changer la longueur d'un fichier attach
   * @param fileName un nom de fichier
   * @param length la longueur du fichier
   */  
  public void updateFileAttachLengthForAction(String familyName, String suiteName, String testName, String actionName, String fileName, long length) {
    if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateUrlAttachDescription NOT ALLOW");
      try {
          throw new Exception("updateFileAttachLengthForAction NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
    }
    }
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        

      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);
      int actionId = STCommun.getIdAction(database, prop, actionName, testId);
      // On initialise l'ID de l'attachement
      int fileAttachId = STCommun.getActionAttachFileId(database,prop,actionId,fileName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttachLength"));
      prep.setLong(1, length);
      prep.setInt(2, fileAttachId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
      E.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateFileAttachLength", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }  
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
    /**
   * Changer la date d'un fichier
   * @param fileName le nom du fichier
   * @param date la date du fichier
   */
  public void updateFileAttachDateForAction(String familyName, String suiteName, String testName, String actionName, String fileName, Date date) {
    if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateUrlAttachDescription NOT ALLOW");
      try {
          throw new Exception("updateFileAttachDateForAction NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
    }
    }
      
    int _num = -1;
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);
      int actionId = STCommun.getIdAction(database, prop, actionName, testId);
      // On initialise l'ID de l'attachement
      int fileAttachId = STCommun.getActionAttachFileId(database,prop,actionId,fileName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttachDate"));
      prep.setDate(1, date);
      prep.setInt(2, fileAttachId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateFileAttachDate", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }  
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
     /**
   * Changer la description d'un fichier attach
   * @param fileName
   * @param newDescription
   */
  public void updateFileAttachDescriptionForSuite(String familyName, String suiteName, String fileName, String newDescription) {
    int idFileAttach = -1;
    if (!special_allow) {
      if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateFileAttachDescription NOT ALLOW");
      try {
          throw new Exception("updateFileAttachDescriptionForSuite NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
      }
    }
    int _num = -1;
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      //int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      //int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID de l'attachement
      //int fileAttachId = STCommun.getSuiteAttachFileId(database,prop,suiteId,fileName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateAttachDescription"));
      prep.setString(1, newDescription);
      prep.setInt(2, idFileAttach);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateAttachDescription", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
  /**
   * Changer la description d'une url attache
   * @param urlName
   * @param newDescription
   */
  public void updateUrlAttachDescriptionForSuite(String familyName, String suiteName, String urlName, String newDescription) {
      if (!special_allow) {
      if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
          org.objectweb.salome_tmf.api.Api.log("updateUrlAttachDescription NOT ALLOW");
          try {
        throw new Exception(" updateUrlAttachDescriptionForSuite NOT ALLOW");
          }catch (Exception e) {
        e.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException(e);
          }
          return;
      }
    }
    int idUrlAttach = -1;
    
    int _num = -1;
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
       // Initialisation de l'ID de l'url
       idUrlAttach = STCommun.getSuiteAttachUrlId(database,prop,suiteId, urlName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateAttachDescription"));
      prep.setString(1, newDescription);
      prep.setInt(2, idUrlAttach);
      prep.executeUpdate();
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateAttachDescription", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
  /**
   * Changer la longueur d'un fichier attach
   * @param fileName un nom de fichier
   * @param length la longueur du fichier
   */  
  public void updateFileAttachLengthForSuite(String familyName, String suiteName, String fileName, long length) {
    if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateUrlAttachDescription NOT ALLOW");
      try {
          throw new Exception("updateFileAttachLengthForSuite NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
    }
    }
    int _num = -1; 
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        

      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID de l'attachement
      int fileAttachId = STCommun.getSuiteAttachFileId(database,prop,suiteId,fileName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttachLength"));
      prep.setLong(1, length);
      prep.setInt(2, fileAttachId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateFileAttachLength", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
  
  /**
   * Changer la date d'un fichier
   * @param fileName le nom du fichier
   * @param date la date du fichier
   */
  public void updateFileAttachDateForSuite(String familyName, String suiteName, String fileName, Date date) {
    if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateUrlAttachDescription NOT ALLOW");
      try {
          throw new Exception("updateFileAttachDateForSuite NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
    }
    }
      
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      
      
      // On initialise l'ID de l'attachement
      int fileAttachId = STCommun.getSuiteAttachFileId(database,prop,suiteId,fileName);
       
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttachDate"));
      prep.setDate(1, date);
      prep.setInt(2, fileAttachId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateFileAttachDate", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }

  /**
   * 
   * @param familyName
   * @param suiteName
   * @param testName
   * @param scriptName
   * @param date
   */
  public void updateScriptDate(String familyName, String suiteName, String testName, String scriptName, Date date) {
    if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateUrlAttachDescription NOT ALLOW");
      try {
          throw new Exception("updateScriptDate NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
    }
    }
      
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);

       // Initialisation de l'ID du script
       int idScript = STCommun.getIdScript(database, prop, testId, scriptName);
      
      //int idScriptAttach = STCommun.getTestAttachScriptId(database, prop, idScript);
             
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateScriptDate"));
      org.objectweb.salome_tmf.api.Api.log(prop.getProperty("updateScriptClassPath"));
      prep.setDate(1, date);
      prep.setInt(2, idScript);
      
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateScriptDate", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);  
  }
        
        /**
   * @param scriptId
   * @param date
   */
  public void updateScriptDateUsingID(int scriptId, Date date) {
    if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateUrlAttachDescription NOT ALLOW");
      try {
          throw new Exception("updateScriptDate NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
    }
    }
      
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      //int idScriptAttach = STCommun.getTestAttachScriptId(database, prop, scriptId);
             
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateScriptDate"));
      org.objectweb.salome_tmf.api.Api.log(prop.getProperty("updateScriptClassPath"));
      prep.setDate(1, date);
      prep.setInt(2, scriptId);
      
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateScriptDate", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);  
  }
  
  /**
   * 
   * @param familyName
   * @param suiteName
   * @param testName
   * @param scriptName
   * @param length
   */
  public void updateScriptLength(String familyName, String suiteName, String testName, String scriptName, long length) {
    if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateScriptLength NOT ALLOW");
      try {
          throw new Exception("updateScriptLength NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
    }
    }
      
    int _num = -1; 
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // On initialse l'ID de la famille de test
      int familyId = STCommun.getIdFamily(database,prop,idProject,familyName);
      // On initialise l'ID de la suite de test
      int suiteId = STCommun.getIdSuite(database,prop,idProject,suiteName,familyId);
      // On initialise l'ID du test
      int testId = STCommun.getIdTest(database, prop, testName, suiteId);

       // Initialisation de l'ID du script
       int idScript = STCommun.getIdScript(database, prop, testId, scriptName);
      
      //int idScriptAttach = STCommun.getTestAttachScriptId(database, prop, idScript);
             
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateScriptLength"));
      org.objectweb.salome_tmf.api.Api.log(prop.getProperty("updateScriptClassPath"));
      prep.setLong(1, length);
      prep.setInt(2, idScript);
      
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateScriptLength", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        /**
   * @param scriptId
   * @param length
   */
  public void updateScriptLengthUsingID(int scriptId, long length) {
    if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateScriptLength NOT ALLOW");
      try {
          throw new Exception("updateScriptLength NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
    }
    }
      
    int _num = -1; 
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      //int idScriptAttach = STCommun.getTestAttachScriptId(database, prop, scriptId);
             
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateScriptLength"));
      org.objectweb.salome_tmf.api.Api.log(prop.getProperty("updateScriptClassPath"));
      prep.setLong(1, length);
      prep.setInt(2, scriptId);
      
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateScriptLength", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        /**
  * Changer le contenu d'un fichier attach  une suite de tests
  * @param fileID
        * @param fileContent
        * @param 
  */
  public void updateFileContentUsingID(int fileId, BufferedInputStream fileContent)  throws FileNotFoundException {

      if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
        try {
       throw new Exception("updateFileContent NOT ALLOW");
         }catch (Exception e) {
       e.printStackTrace();
       org.objectweb.salome_tmf.api.Api.addException(e);
         }
        return;
    }
      }
    int _num = -1; 
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // Appel de la requete a executer
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttach"));
      prep.setBinaryStream(1,fileContent,fileContent.available());
      prep.setInt(2,fileId);
      
      prep.executeUpdate();
      
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      org.objectweb.salome_tmf.api.Api.addException("updateFileAttachContent", null, sqle);
    } catch(Exception e) {
        org.objectweb.salome_tmf.api.Api.addException( null, null, e);
        e.printStackTrace();
        if (e instanceof FileNotFoundException) {
      org.objectweb.salome_tmf.api.Api.commitTrans(_num);
      throw new FileNotFoundException();
        } 
    } 
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        /**
   * Changer la date d'un fichier
   * @param fileId
         * @param fileContent
   * @param date la date du fichier
   */
  public void updateFileDateUsingID(int fileId, Date date) {
    if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateFileAttachDate NOT ALLOW");
      try {
          throw new Exception("updateFileAttachDate NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
    }
    }
      
    int _num = -1; 
    try {
                        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttachDate"));
      prep.setDate(1, date);
      prep.setInt(2, fileId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateFileAttachDate", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        /**
   * Changer la longueur d'un fichier attach
   * @param fileId
         * @param length
   * @param length la longueur du fichier
   */  
  public void updateFileLengthUsingID(int fileId, long length) {
    if (!special_allow) {
    if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateFileLength NOT ALLOW");
      try {
          throw new Exception("updateFileLength NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
    }
    }
    int _num = -1; 
    try { 
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
                        // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateFileAttachLength"));
      prep.setLong(1, length);
      prep.setInt(2, fileId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateFileLength", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }
        
        /**
   * Changer la description d'un fichier ou URL attache
   * @param attachId
   * @param newDescription
   */
  public void updateAttachDescriptionUsingID(int fileId, String newDescription) {
    //int idFileAttach = -1;
    if (!special_allow) {
      if (!(org.objectweb.salome_tmf.api.api2ihm.AdminProject.canUpdateTest()) ){
      org.objectweb.salome_tmf.api.Api.log("updateAttachDescription NOT ALLOW");
      try {
          throw new Exception("updateAttachDescription NOT ALLOW");
      }catch (Exception e) {
          e.printStackTrace();
          org.objectweb.salome_tmf.api.Api.addException(e);
      }
      return;
      }
    }
    int _num = -1;
    try {
        _num = org.objectweb.salome_tmf.api.Api.beginTrans();
        
      // Mise a jour de la suite de test
      PreparedStatement prep = database.prepareStatement(prop.getProperty("updateAttachDescription"));
      prep.setString(1, newDescription);
      prep.setInt(2, fileId);
      prep.executeUpdate();
  
    }
    catch(SQLException E) {
        E.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException("updateAttachDescription", null, E);
    }catch (Exception ex) {
        ex.printStackTrace();
        org.objectweb.salome_tmf.api.Api.addException( null, null, ex);
    }
    org.objectweb.salome_tmf.api.Api.commitTrans(_num);
  }

        
} // Fin de la classe
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.