]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Methods are updated
authormka <mka@opencascade.com>
Mon, 3 Dec 2012 07:33:31 +0000 (07:33 +0000)
committermka <mka@opencascade.com>
Mon, 3 Dec 2012 07:33:31 +0000 (07:33 +0000)
Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeServiceImpl.java

index 1668069e1a6953c46167c0d9f5c3b05b01dc2753..d83620ba4bf37751670a9f7c0f8009626c628a6b 100644 (file)
@@ -18,6 +18,11 @@ import javax.activation.DataHandler;
 import javax.activation.FileDataSource;
 
 import org.apache.log4j.Logger;
+import org.splat.kernel.InvalidPropertyException;
+import org.splat.kernel.MismatchException;
+import org.splat.kernel.MissedPropertyException;
+import org.splat.kernel.MultiplyDefinedException;
+import org.splat.kernel.NotApplicableException;
 import org.splat.service.ScenarioService;
 import org.splat.service.dto.DocumentDTO;
 import org.splat.service.dto.FileDTO;
@@ -99,10 +104,14 @@ public class SimanSalomeServiceImpl implements SimanSalomeService {
                        } catch (SQLException sqlException) {
                                LOG.debug("Sorry, impossible to populate the database", sqlException);
                        }       
+                       
+                       if (LOG.isDebugEnabled()) {
+                               LOG.debug("Scenario Id = " + scenarioId);
+                       }
 
                        List<StepDTO> listSteps = _scenarioService.getScenarioInfo(scenarioId);
                        
-                       File configFilePath = new File(_repositoryService.getRepositoryVaultPath() + "\\SimanSalome\\" + studyId.toString() + scenarioId.toString() + userId.toString());
+                       File configFilePath = new File(_repositoryService.getDownloadDirectory(userId).getPath());
                        configFilePath.mkdirs();
                        File configFile = new File(configFilePath + "\\siman-salome.conf");
                        
@@ -149,6 +158,8 @@ public class SimanSalomeServiceImpl implements SimanSalomeService {
                                                  out.write("        Result file : " + fileValue.getPath() + "\n");
                                          }
                                          
+                                         out.write("        File ID : " + fileValue.getId() + "\n");
+                                         
                                          out.write("            Automatic processing : " + fileValue.getProcessing() + "\n");
                                          fileState = fileValue.getState();
                                          if ((fileState == 'Y') || (fileState == 'N')) {
@@ -252,6 +263,8 @@ public class SimanSalomeServiceImpl implements SimanSalomeService {
                DocumentDTO document;
                StepDTO step;
                long ScenarioId = 0;
+               
+               LOG.debug("The fileURL = " + fileURL);
 
                try {
                        Scanner input = new Scanner(configFile);
@@ -289,8 +302,24 @@ public class SimanSalomeServiceImpl implements SimanSalomeService {
                        input.close();
                        
                        List<StepDTO> listSteps = new ArrayList<StepDTO>(numberStepMap.values());
+                       LOG.debug("MKA List of steps: ");
+                       LOG.debug(listSteps.get(0).toString());
                
-                       _scenarioService.checkin(ScenarioId, userId, listSteps);
+                       try {
+                               _scenarioService.checkin(ScenarioId, userId, listSteps);
+                       } catch (InvalidPropertyException e) {
+                               e.printStackTrace();
+                       } catch (MissedPropertyException e) {
+                               e.printStackTrace();
+                       } catch (MultiplyDefinedException e) {
+                               e.printStackTrace();
+                       } catch (MismatchException e) {
+                               e.printStackTrace();
+                       } catch (NotApplicableException e) {
+                               e.printStackTrace();
+                       } catch (IOException e) {
+                               e.printStackTrace();
+                       }
                        
                        numberStepMap.clear();