Salome HOME
CheckIn method is modified
[tools/siman.git] / Workspace / Siman-WS / src / org / splat / ws_server / service / salome / SimanSalomeServiceImpl.java
index c4a08776eb04959934bdf242483905baffe852b0..8088c2d13741a4e7ac0272eab31b3c6e4dc46e60 100644 (file)
@@ -226,7 +226,7 @@ public class SimanSalomeServiceImpl implements SimanSalomeService, ServletContex
         * @see org.splat.ws_server.service.salome.SimanSalomeService#checkIn()
         */
        @Override
-       public String checkIn(final String fileURL, final Long userId) {
+       public String checkIn(final String fileURL, final Long scenarioId, final Long userId) {
                                
                File configFile = new File(fileURL);
                
@@ -236,7 +236,6 @@ public class SimanSalomeServiceImpl implements SimanSalomeService, ServletContex
                FileDTO file;
                DocumentDTO document;
                StepDTO step;
-               long ScenarioId = 0;
                
                if (LOG.isDebugEnabled()) {
                        LOG.debug("The fileURL = " + fileURL);
@@ -250,7 +249,6 @@ public class SimanSalomeServiceImpl implements SimanSalomeService, ServletContex
                            String nextLine = input.nextLine();
                            String[] tokens = nextLine.split(",");
                            int activityNumber = Integer.valueOf(tokens[2]);
-                           ScenarioId = Long.valueOf(tokens[0]);
                            
                            if (numberStepMap.containsKey(activityNumber)) {
                                step = numberStepMap.get(activityNumber);
@@ -280,7 +278,7 @@ public class SimanSalomeServiceImpl implements SimanSalomeService, ServletContex
                        List<StepDTO> listSteps = new ArrayList<StepDTO>(numberStepMap.values());
                
                        try {
-                               _scenarioService.checkin(ScenarioId, userId, listSteps);
+                               _scenarioService.checkin(scenarioId, userId, listSteps);
                        } catch (InvalidPropertyException e) {
                                e.printStackTrace();
                        } catch (MissedPropertyException e) {
@@ -297,6 +295,12 @@ public class SimanSalomeServiceImpl implements SimanSalomeService, ServletContex
                        
                        numberStepMap.clear();
                        
+                       //delete siman-salome.conf and salome-siman.conf files
+                       configFile.delete();
+                       fileURL.replace("salome-siman.conf", "siman-salome.conf");
+                       File configFile2 = new File(fileURL);
+                       configFile2.delete();
+                                       
                        return "SUCCESS";
                        
                } catch (FileNotFoundException e) {