/**
* 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);
}
* @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);
FileDTO file;
DocumentDTO document;
StepDTO step;
- long ScenarioId = 0;
if (LOG.isDebugEnabled()) {
LOG.debug("The fileURL = " + fileURL);
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);
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) {
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) {