]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
assignSimulationContext functionality is implemented.
authormka <mka@opencascade.com>
Mon, 18 Mar 2013 08:38:38 +0000 (08:38 +0000)
committermka <mka@opencascade.com>
Mon, 18 Mar 2013 08:38:38 +0000 (08:38 +0000)
Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeService.java
Workspace/Siman-WS/src/org/splat/ws_server/service/salome/SimanSalomeServiceImpl.java

index 4027198a7105d630896a99ebd072d47b50456efd..4cde0dfb744988d5cd037c6f5fb0012da882e443 100644 (file)
@@ -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);
 }
index d1f881fa1ea4721cc89da0286208fe63aefd84bd..3f5ee1d9f03b6ae9643bd68ff05bc05dd58bc561 100644 (file)
@@ -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.