From c27d0de2f4e5754fcb79465bd96f40544ebbd92f Mon Sep 17 00:00:00 2001 From: mka Date: Wed, 6 Feb 2013 08:37:15 +0000 Subject: [PATCH] CheckIn method is modified --- .../service/salome/SimanSalomeService.wsdl | 1 + .../ws_server/service/salome/SimanSalomeService.java | 3 ++- .../service/salome/SimanSalomeServiceImpl.java | 12 ++++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Workspace/Siman-Stub/service_wsdl/service/salome/SimanSalomeService.wsdl b/Workspace/Siman-Stub/service_wsdl/service/salome/SimanSalomeService.wsdl index 474f278..d98c996 100644 --- a/Workspace/Siman-Stub/service_wsdl/service/salome/SimanSalomeService.wsdl +++ b/Workspace/Siman-Stub/service_wsdl/service/salome/SimanSalomeService.wsdl @@ -54,6 +54,7 @@ + diff --git a/Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeService.java b/Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeService.java index de4d7c2..d88dbad 100644 --- a/Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeService.java +++ b/Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeService.java @@ -38,7 +38,8 @@ public interface SimanSalomeService { /** * Check in operation. * @param fileURL - the salome-siman.conf file URL + * @param scenarioId the scenario ID * @param userId the user ID **/ - String checkIn(final String fileURL, final Long userId); + String checkIn(final String fileURL, final Long scenarioId, final Long userId); } diff --git a/Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeServiceImpl.java b/Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeServiceImpl.java index c4a0877..8088c2d 100644 --- a/Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeServiceImpl.java +++ b/Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeServiceImpl.java @@ -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 listSteps = new ArrayList(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) { -- 2.39.2