From: mka Date: Fri, 28 Dec 2012 08:38:18 +0000 (+0000) Subject: No duplication of the products when new study is created X-Git-Tag: Root_Delivery2_2013_04_22~192 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=60504fe50df03b2a83ff0e974d3a9d1435f6ec88;p=tools%2Fsiman.git No duplication of the products when new study is created --- diff --git a/Workspace/Siman/src/org/splat/simer/NewStudyAction.java b/Workspace/Siman/src/org/splat/simer/NewStudyAction.java index dd32969..95fd4cb 100644 --- a/Workspace/Siman/src/org/splat/simer/NewStudyAction.java +++ b/Workspace/Siman/src/org/splat/simer/NewStudyAction.java @@ -123,10 +123,20 @@ public class NewStudyAction extends Action { // Addition of the entered project context SimulationContext.Properties cprop = new SimulationContext.Properties(); + + SimulationContextType product = getSimulationContextService() + .selectType("product"); + + SimulationContext testContext = getSimulationContextService().selectSimulationContext(product, value); + if (valid == 0) { // Input of new project context + if (testContext == null) { cprop.setType( getSimulationContextService().selectType("product")) .setValue(value); + } else { + cprop.setIndex(testContext.getIndex()); + } } else { // Selection of existing project context cprop.setIndex(valid); } @@ -146,6 +156,26 @@ public class NewStudyAction extends Action { return ERROR; } } + + /** + * + * {@inheritDoc} + * @see com.opensymphony.xwork2.ActionSupport#validate() + */ + @Override + public void validate() { + + if( LOG.isDebugEnabled() ) { + LOG.debug("--- validate"); + } + com.opensymphony.xwork2.ActionContext context = + com.opensymphony.xwork2.ActionContext.getContext(); + + if( LOG.isDebugEnabled() ) { + LOG.debug("======> MKA test"); + LOG.debug(context.getName()); + } + } // ============================================================================================================================== // Getters and setters