Salome HOME
Fixed: adding a knowledge element (but there is still a double addition), opening...
authorrkv <rkv@opencascade.com>
Fri, 12 Oct 2012 04:47:38 +0000 (04:47 +0000)
committerrkv <rkv@opencascade.com>
Fri, 12 Oct 2012 04:47:38 +0000 (04:47 +0000)
Workspace/Siman-Common/.springBeans
Workspace/Siman-Common/src/org/splat/service/ScenarioServiceImpl.java
Workspace/Siman-Common/src/spring/daoContext.xml [new file with mode: 0644]
Workspace/Siman-Common/src/spring/daoServiceContext.xml [deleted file]
Workspace/Siman/.springBeans
Workspace/Siman/conf/templates/log4j.xml
Workspace/Siman/src/hibernate.properties
Workspace/Siman/src/jdbc.properties
Workspace/Siman/src/org/splat/simer/Action.java
Workspace/Siman/src/org/splat/simer/DisplayStudyStepAction.java
Workspace/Siman/src/spring/applicationContext.xml

index c18ad0a624e3cfc36421fd438719139a34a57443..832a43d0f6ce9f84a22c9d8124312e226dc28ff2 100644 (file)
@@ -6,8 +6,8 @@
        <configs>
                <config>src/spring/globalContext.xml</config>
                <config>src/spring/businessServiceContext.xml</config>
-               <config>src/spring/daoServiceContext.xml</config>
                <config>src/spring/technicalServiceContext.xml</config>
+               <config>src/spring/daoContext.xml</config>
        </configs>
        <configSets>
                <configSet>
@@ -17,8 +17,8 @@
                        <configs>
                                <config>src/spring/globalContext.xml</config>
                                <config>src/spring/businessServiceContext.xml</config>
-                               <config>src/spring/daoServiceContext.xml</config>
                                <config>src/spring/technicalServiceContext.xml</config>
+                               <config>src/spring/daoContext.xml</config>
                        </configs>
                </configSet>
        </configSets>
index 8cf54cdfb7b5952547072c1a8f6233b822f4596d..0b6ba1280823adf33519e446d193b6060c5bd65f 100644 (file)
@@ -104,8 +104,10 @@ public class ScenarioServiceImpl implements ScenarioService {
                Transaction transax = session.getTransaction();
                try {
                        session.save(kelm);
+                       session.flush(); //RKV
                        // Update of my persistent data
                        aScenario.getKnowledgeElements().add(kelm);
+                       session.merge(aScenario); //RKV
                        // Update of my transient data
                        List<KnowledgeElement> known = aScenario
                                        .getKnowledgeElementsOf(kelm.getType()); // Initializes this.known, if not yet done
diff --git a/Workspace/Siman-Common/src/spring/daoContext.xml b/Workspace/Siman-Common/src/spring/daoContext.xml
new file mode 100644 (file)
index 0000000..ec7b3a4
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xsi:schemaLocation="
+http://www.springframework.org/schema/beans
+http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+http://www.springframework.org/schema/aop
+http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+http://www.springframework.org/schema/tx
+http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
+
+       <bean id="genericDAO" class="org.splat.dal.dao.kernel.GenericDAOImpl"
+               abstract="true">
+               <property name="sessionFactory" ref="simanSessionFactory" />
+       </bean>
+       <bean id="knowledgeElementDAO" parent="genericDAO"
+               class="org.splat.dal.dao.som.KnowledgeElementDAOImpl">
+       </bean>
+</beans>
\ No newline at end of file
diff --git a/Workspace/Siman-Common/src/spring/daoServiceContext.xml b/Workspace/Siman-Common/src/spring/daoServiceContext.xml
deleted file mode 100644 (file)
index ec7b3a4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:aop="http://www.springframework.org/schema/aop"
-       xmlns:tx="http://www.springframework.org/schema/tx"
-       xsi:schemaLocation="
-http://www.springframework.org/schema/beans
-http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-http://www.springframework.org/schema/aop
-http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
-http://www.springframework.org/schema/tx
-http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
-
-       <bean id="genericDAO" class="org.splat.dal.dao.kernel.GenericDAOImpl"
-               abstract="true">
-               <property name="sessionFactory" ref="simanSessionFactory" />
-       </bean>
-       <bean id="knowledgeElementDAO" parent="genericDAO"
-               class="org.splat.dal.dao.som.KnowledgeElementDAOImpl">
-       </bean>
-</beans>
\ No newline at end of file
index ef7a1b3fe7c5d9a39df824ddf85890479a4ff3da..9cb669efc9471cf4c14778e40083ab803f63fb28 100644 (file)
@@ -13,7 +13,6 @@
                        <incomplete>false</incomplete>
                        <configs>
                                <config>/Siman-Common/src/spring/businessServiceContext.xml</config>
-                               <config>/Siman-Common/src/spring/daoServiceContext.xml</config>
                                <config>/Siman-Common/src/spring/globalContext.xml</config>
                                <config>/Siman-Common/src/spring/technicalServiceContext.xml</config>
                                <config>src/spring/applicationContext.xml</config>
index d3a719011e2317ea411acbc0ef10e36e6fc6d8f3..10d1dcb318994fbbcd6a8c45305ecfb0f15c7c07 100644 (file)
         <level value="@org.apache.struts2.logger.level@" />
     </logger>
 
+    <logger name="log4j.logger.org.apache.struts">
+        <level value="@org.apache.struts2.logger.level@" />
+    </logger>
+
     <logger name="org.springframework">
         <level value="@org.springframework.logger.level@" />
     </logger>
@@ -54,6 +58,7 @@
    <category name="org.apache.struts2.interceptor.validation">
       <priority value="@org.apache.struts2.interceptor.validation.logger.level@"/>
    </category>
+   
 
    <!-- for all other loggers log only debug and above log messages -->
      <root>
index 46b07188a5811016ffb4ce342d0563c7ebf75eeb..94db428125ca6b728b67b740466a0c19223d2a53 100644 (file)
@@ -1,4 +1,4 @@
-# Generated at 11/10/2012 11:33:51
+# Generated at 12/10/2012 07:20:45
 # Don't edit manually. See the source in D:\users\rkv\SIMAN\SIMAN_SRC\Workspace\Siman\conf\templates.
 # Connection properties
 connection.driver_class=com.mysql.jdbc.Driver
index 6720228fe4e766cf2c82b6a986afcebcefdbb42a..aeb70ccb185060f46cf889d35fb10e3cfa48a72a 100644 (file)
@@ -1,4 +1,4 @@
-# Generated at 11/10/2012 11:33:51
+# Generated at 12/10/2012 07:20:45
 # Don't edit manually. See the source in D:\users\rkv\SIMAN\SIMAN_SRC\Workspace\Siman\conf\templates.
 # Connection properties
 connection.url=jdbc:mysql://localhost/simer
index c092693e1d61fc27c8037b94630c4c6e0616cd2d..1606a892e1deff67862652fbc01c10750a06e39b 100644 (file)
@@ -105,7 +105,7 @@ public class Action extends ActionSupport implements SessionAware {
         _openKnowledge = kelm;
       }
     protected OpenKnowledge getOpenKnowledge () {
-       _openKnowledge = (OpenKnowledge)session.get("knowledge.open");               // May be null
+//     _openKnowledge = (OpenKnowledge)session.get("knowledge.open");               // May be null
        return _openKnowledge;
     }
     public void setOpenStudy (OpenStudy aStudy) {
index 56f57959e79bbdd0ab1be97009b40b35ca79da3b..c94b23631c75945fb53f3885abea6f681970ea32 100644 (file)
@@ -38,6 +38,11 @@ public class DisplayStudyStepAction extends DisplayBaseAction {
        if (mystudy != null && mystudy.getStudyObject() != null && mystudy.getIndex() == index) {   // - The selected study is currently open
           selection = mystudy.getSelection();                   // Current selection
           study     = mystudy.getStudyObject();                 // Current Study object
+          //RKV:BEGIN: put in session if necessary
+          if (!getSession().containsKey("study.open")) {
+                 open(study);
+          }
+          //RKV:END
        } else {                                                // - The selected study is new
          study     = getStudyService().selectStudy(index);
          mystudy   = open(study);
index c7b78a981732fe2a8b6d76175aa622b50fa982ba..6ca12a4f3b94bdebc29482d3e8e4d5bd27f6f74c 100644 (file)
@@ -26,7 +26,7 @@ http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
        </bean>
 
        <bean id="openKnowledge" class="org.splat.simer.OpenKnowledge"
-               scope="prototype">
+               scope="session">
                <property name="projectElementService"
                        ref="projectElementService" />
                <property name="projectSettings" ref="projectSettings" />
@@ -38,17 +38,60 @@ http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
                <property name="openKnowledge" ref="openKnowledge" />
        </bean>
 
+    <!--========= Inherited from baseAction =========-->
+    
+    <bean id="newStudyAction" class="org.splat.simer.NewStudyAction"
+        parent="baseAction" scope="prototype">
+        <property name="studyService" ref="studyService" />
+    </bean>
+
        <bean id="displayStudyStepAction"
                class="org.splat.simer.DisplayStudyStepAction" parent="baseAction"
                scope="prototype">
                <property name="studyService" ref="studyService" />
        </bean>
 
-       <bean id="newStudyAction" class="org.splat.simer.NewStudyAction"
-               parent="baseAction" scope="prototype">
-               <property name="studyService" ref="studyService" />
+    <!--========= Inherited from displayStudyStepAction =========-->
+    
+       <bean id="studyPropertiesAction"
+               class="org.splat.simer.StudyPropertiesAction" scope="prototype"
+               parent="displayStudyStepAction">
+       </bean>
+
+       <bean id="editStudyAction" class="org.splat.simer.EditStudyAction"
+               scope="prototype" parent="displayStudyStepAction">
+       </bean>
+
+       <bean id="editScenarioPropertiesAction"
+               class="org.splat.simer.EditScenarioPropertiesAction" scope="prototype"
+               parent="displayStudyStepAction">
+               <property name="projectElementService"
+                       ref="projectElementService" />
+               <property name="scenarioService" ref="scenarioService" />
+       </bean>
+
+       <bean id="editSimulationContextAction"
+               class="org.splat.simer.EditSimulationContextAction" scope="prototype"
+               parent="displayStudyStepAction">
+               <property name="stepService" ref="stepService" />
+       </bean>
+
+       <bean id="editDocumentAction"
+               class="org.splat.simer.EditDocumentAction" scope="prototype"
+               parent="displayStudyStepAction">
+               <property name="publicationService" ref="publicationService" />
        </bean>
 
+       <bean id="editKnowledgeElementAction"
+               class="org.splat.simer.EditKnowledgeElementAction" scope="prototype"
+               parent="displayStudyStepAction">
+               <property name="knowledgeElementService"
+                       ref="knowledgeElementService" />
+               <property name="scenarioService" ref="scenarioService" />
+       </bean>
+
+    <!-- End of Inherited from displayStudyStepAction -->
+    
        <bean id="startAction" class="org.splat.simer.StartAction"
                scope="prototype">
                <property name="applicationSettings" ref="applicationSettings" />
@@ -81,22 +124,12 @@ http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
                class="org.splat.simer.SearchDocumentAction" scope="prototype">
        </bean>
 
-       <bean id="studyPropertiesAction"
-               class="org.splat.simer.StudyPropertiesAction" scope="prototype">
-               <property name="studyService" ref="studyService" />
-       </bean>
-
        <bean id="displayKnowledgeAction"
                class="org.splat.simer.DisplayKnowledgeAction" scope="prototype">
                <property name="knowledgeElementService"
                        ref="knowledgeElementService" />
        </bean>
 
-       <bean id="editStudyAction" class="org.splat.simer.EditStudyAction"
-               scope="prototype">
-               <property name="studyService" ref="studyService" />
-       </bean>
-
        <bean id="newScenarioAction"
                class="org.splat.simer.NewScenarioAction" scope="prototype">
                <property name="projectElementService"
@@ -104,21 +137,6 @@ http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
                <property name="studyService" ref="studyService" />
        </bean>
 
-       <bean id="editScenarioPropertiesAction"
-               class="org.splat.simer.EditScenarioPropertiesAction"
-               scope="prototype">
-               <property name="projectElementService"
-                       ref="projectElementService" />
-               <property name="scenarioService" ref="scenarioService" />
-       </bean>
-
-       <bean id="editSimulationContextAction"
-               class="org.splat.simer.EditSimulationContextAction"
-               scope="prototype">
-               <property name="stepService" ref="stepService" />
-               <property name="studyService" ref="studyService" />
-       </bean>
-
        <bean id="uploadAction" class="org.splat.simer.UploadAction"
                scope="prototype">
        </bean>
@@ -137,19 +155,6 @@ http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
                <property name="stepService" ref="stepService" />
        </bean>
 
-       <bean id="editDocumentAction"
-               class="org.splat.simer.EditDocumentAction" scope="prototype">
-               <property name="publicationService" ref="publicationService" />
-       </bean>
-
-       <bean id="editKnowledgeElementAction"
-               class="org.splat.simer.EditKnowledgeElementAction"
-               scope="prototype" parent="baseAction">
-               <property name="knowledgeElementService"
-                       ref="knowledgeElementService" />
-               <property name="scenarioService" ref="scenarioService" />
-       </bean>
-
        <bean id="databaseIndexingAction"
                class="org.splat.simer.admin.DatabaseIndexingAction"
                scope="prototype">