Salome HOME
Checked-out files path was changed to /tmp/SimanSalome/StudyId/ScenarioId/UserId
authorbri <bri@opencascade.com>
Mon, 10 Feb 2014 14:12:01 +0000 (18:12 +0400)
committerbri <bri@opencascade.com>
Mon, 10 Feb 2014 14:12:01 +0000 (18:12 +0400)
scripts/run_salome_siman.sh
src/SimanIO_Link.cxx

index e17362856f87da6fe81392cf1f733a071efc9a12..fde597ff99d42b74c6cf48f0caaeb45e092d9208 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
-echo "parameters : $1  $2  $3" > /home/siman/check_params.txt
-echo "$#" >> /home/siman/check_params.txt
+echo "parameters : $1  $2  $3" > check_params.txt
+echo "$#" >> check_params.txt
 
 if [ "$#" -ne 3 ] ; then 
 echo  "Usage :
@@ -14,18 +14,18 @@ fi
 #echo dir1 = `dirname $0`
 #echo dir2 = ${PWD}
 
-echo "pwd = " ${PWD} >> /home/siman/check_params.txt
-echo "display = " ${DISPLAY} >> /home/siman/check_params.txt
+echo "pwd = " ${PWD} >> check_params.txt
+echo "display = " ${DISPLAY} >> check_params.txt
 
 env_script=${PWD}/env_products.sh
 echo script = $env_script
 
 if [ -e $env_script ] ; then
     echo
-    echo ">>> Setting SALOME environment" >> /home/siman/check_params.txt
-    echo ">>> Environment script = " $env_script >> /home/siman/check_params.txt
-    source $env_script >> /home/siman/check_params.txt
-    echo ">>> After products " >> /home/siman/check_params.txt
+    echo ">>> Setting SALOME environment" >> check_params.txt
+    echo ">>> Environment script = " $env_script >> check_params.txt
+    source $env_script >> check_params.txt
+    echo ">>> After products " >> check_params.txt
     else
     echo
     echo '!!! Warning !!! Environment is not set.'
@@ -33,28 +33,28 @@ if [ -e $env_script ] ; then
     echo 'Proceed with the current environment.'
 fi
 
-echo ">>> Setting SALOME-SAMAN environment" >> /home/siman/check_params.txt
+echo ">>> Setting SALOME-SAMAN environment" >> check_params.txt
 
 export WSFCPP_HOME=${PWD}/wso2-wsf-cpp-2.1.0
 #export PATH=${WSFCPP_HOME}/lib:${PATH}
 export LD_LIBRARY_PATH=${WSFCPP_HOME}/lib:${LD_LIBRARY_PATH}
-echo "WSFCPP_HOME = " ${WSFCPP_HOME} >> /home/siman/check_params.txt
+echo "WSFCPP_HOME = " ${WSFCPP_HOME} >> check_params.txt
 
 export SIMANIO_ROOT_DIR=${PWD}/SIMANIO
 export PATH=${SIMANIO_ROOT_DIR}/lib:${PATH}
 export LD_LIBRARY_PATH=${SIMANIO_ROOT_DIR}/lib:${LD_LIBRARY_PATH}
 
-export SIMAN_WS_HOST="172.22.2.65:8080"
+export SIMAN_WS_HOST="127.0.0.1:8080"
 
-export PYTHONPATH="/tmp/SimanSalome/${3##*=}/download":${PYTHONPATH}
+export PYTHONPATH="/tmp/SimanSalome/${1##*=}/${2##*=}/${3##*=}":${PYTHONPATH}
 
-echo "parameters 3: $1 $2 $3" >> /home/siman/check_params.txt
+echo "parameters 3: $1 $2 $3" >> check_params.txt
 
 #export SALOME_ROOT_DIR=${PWD}
 
-echo ">>> SALOME-SIMAN running" >> /home/siman/check_params.txt
+echo ">>> SALOME-SIMAN running" >> check_params.txt
 
-echo "parameters 4: $1 $2 $3" >> /home/siman/check_params.txt
+echo "parameters 4: $1 $2 $3" >> check_params.txt
 
-runSalome --siman $1 $2 $3 -k >> /home/siman/check_params.txt
+runSalome --siman $1 $2 $3 -k >> check_params.txt
 
index 7dada805ff54ffdf73d28e38d28c89c5c4093b08..41f5df03b81a69b38f8b8c1803774ebcb2d5efe7 100644 (file)
@@ -108,7 +108,8 @@ SimanIO_Configuration SimanIO_Link::RetrieveConf()
   
   //Parse the response and get the filename
   string aTmpDir = "/tmp";
-  string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/";
+  string aClientFileDir = aTmpDir + "/SimanSalome/" + myStudy + "/" + myScenario + "/" + myUser + "/";
+  //string aClientFileDir = aTmpDir + "/SimanSalome/" +  myUser + "/download/";
   string aClientFilePath = aClientFileDir + aResponseFileName;
   
   //Cretae the directories
@@ -184,6 +185,7 @@ SimanIO_Configuration SimanIO_Link::RetrieveConf()
 
 void SimanIO_Link::StoreConf(/*const*/ SimanIO_Configuration& theConf)
 {
+  cout << "StoreConf method is started\n";
   char* aSimanHost = getenv("SIMAN_WS_HOST");
   if (aSimanHost == NULL)
   {
@@ -221,7 +223,8 @@ void SimanIO_Link::StoreConf(/*const*/ SimanIO_Configuration& theConf)
   
   //Prepare salome-siman.conf file
   string aTmpDir = "/tmp";
-  string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/";
+  string aClientFileDir = aTmpDir + "/SimanSalome/" + myStudy + "/" + myScenario + "/" + myUser + "/";
+  //string aClientFileDir = aTmpDir + "/SimanSalome/" +  myUser + "/download/";
   string aClientFilePath = aClientFileDir + "salome-siman.conf";
   ofstream aSalomeSimanFile;
   aSalomeSimanFile.open(aClientFilePath.c_str());
@@ -302,5 +305,13 @@ void SimanIO_Link::StoreConf(/*const*/ SimanIO_Configuration& theConf)
   aCheckInRequest->setArgs1(atoll(myUser.c_str()));
   aCheckInResponse = aStub->checkIn(aCheckInRequest);
   
-
+  //Delete the directories
+  system(("rm -r " + aTmpDir + "/SimanSalome/").c_str());
+  
+  //Delete objects
+  delete aPutFileRequest;
+  delete aPutFileResponse;
+  delete aCheckInRequest;
+  delete aCheckInResponse;
+  delete aStub;
 }