From ac68158ae604c2242005acee9cd37254f03328d8 Mon Sep 17 00:00:00 2001 From: mka Date: Mon, 18 Mar 2013 08:38:38 +0000 Subject: [PATCH] assignSimulationContext functionality is implemented. --- .../service/salome/SimanSalomeService.java | 3 ++- .../service/salome/SimanSalomeServiceImpl.java | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) 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 4027198..4cde0df 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 @@ -57,7 +57,8 @@ public interface SimanSalomeService { * Assign the new simulation context to the existing study. * @param studyId - the target study id. * @param contextName - new context name. + * @param contextType - new context type. * @return success or not. */ - String assignSimulationContext(final Long studyId, final String contextName); + String assignSimulationContext(final Long studyId, final String contextType, final String contextName); } 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 d1f881f..3f5ee1d 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 @@ -351,9 +351,19 @@ public class SimanSalomeServiceImpl implements SimanSalomeService, ServletContex * {@inheritDoc} * @see org.splat.ws_server.service.salome.SimanSalomeService#assignSimulationContext(java.lang.Long, java.lang.String) */ - public String assignSimulationContext(final Long studyId, final String contextName) { + public String assignSimulationContext(final Long studyId, final String contextType, final String contextName) { - return "result"; + try { + _scenarioService.assignStudyContext(studyId, contextType, contextName); + } catch (MissedPropertyException e) { + LOG.debug("MissedPropertyException is thrown"); + } catch (InvalidPropertyException e) { + return "Study id is invalid"; + } catch (MultiplyDefinedException e) { + LOG.debug("MultiplyDefinedException is thrown"); + } + + return "Simulation context is successfully assigned to the study."; } /** * Get the scenarioService. -- 2.39.2