]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java
Salome HOME
Satisfy some PMD rules.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / StudyServiceImpl.java
index 29a27d4cb891da5898b86c1dc75839d19f51a888..d75d3ccfa29cd440919d9bd6ac10de208b6a8753 100644 (file)
@@ -491,6 +491,7 @@ public class StudyServiceImpl implements StudyService {
 
                                ValidationCycleRelation link = cycle.getContext();
                                aStudy.addRelation(link);
+                               getValidationCycleDAO().flush();
                                aStudyDTO.getAllRelations().add(link); // RKV
 
                                validactor.put(cname, link.getTo()); // Replaces the cycle if exists as default,
@@ -761,25 +762,20 @@ public class StudyServiceImpl implements StudyService {
         * @return true if reindexing succeeded
         */
        private boolean updateKnowledgeElementsIndex(final Study aStudy) {
-               // boolean isOk = false;
-               // try {
-               // IndexService lucin = getIndex();
-               //
-               // for (Iterator<Scenario> i = aStudy.getScenariiList().iterator(); i
-               // .hasNext();) {
-               // Scenario scene = i.next();
-               // for (Iterator<KnowledgeElement> j = scene
-               // .getAllKnowledgeElements().iterator(); j.hasNext();) {
-               // KnowledgeElement kelm = j.next();
-               // lucin.update(kelm);
-               // }
-               // }
-               // isOk = true;
-               // } catch (Exception error) {
-               // LOG.error("Unable to re-index Knowledge Elements, reason:",
-               // error);
-               // }
-               // return isOk;
+//             boolean isOk = false;
+//              try {
+//                      IndexService lucin = getIndex();
+//                      for(Scenario scenario : aStudy.getScenariiList()) {
+//                              for (KnowledgeElement element : scenario.getAllKnowledgeElements()) {
+//                                      lucin.update(element);
+//                              }
+//                      }
+//                      isOk = true;
+//              } catch (Exception error) {
+//                      LOG.error("Unable to re-index Knowledge Elements, reason:",
+//                      error);
+//              }
+//              return isOk;
                return true;
        }
 
@@ -1365,7 +1361,7 @@ public class StudyServiceImpl implements StudyService {
        public List<UserDTO> getReaders(final long studyId) throws InvalidParameterException {
                Study aStudy = selectStudy(studyId);
                if(aStudy == null){
-                       throw new InvalidParameterException("studyId", String.valueOf(studyId));
+                       throw new InvalidParameterException(PARAM_STUDY_ID, String.valueOf(studyId));
                }
                List<Relation> relations = aStudy.getRelations(ReaderRelation.class);
                List<UserDTO> result = new ArrayList<UserDTO>();
@@ -1383,7 +1379,7 @@ public class StudyServiceImpl implements StudyService {
        public boolean addReader(final long studyId, final long userId) throws InvalidParameterException {
                Study aStudy = selectStudy(studyId);
                if(aStudy == null){
-                       throw new InvalidParameterException("studyId", String.valueOf(studyId));
+                       throw new InvalidParameterException(PARAM_STUDY_ID, String.valueOf(studyId));
                }
                User user = _userService.selectUser(userId);
                if(user == null){
@@ -1408,7 +1404,7 @@ public class StudyServiceImpl implements StudyService {
        public boolean removeReader(final long studyId, final long userId) throws InvalidParameterException {
                Study aStudy = selectStudy(studyId);
                if(aStudy == null){
-                       throw new InvalidParameterException("studyId", String.valueOf(studyId));
+                       throw new InvalidParameterException(PARAM_STUDY_ID, String.valueOf(studyId));
                }
                User user = _userService.selectUser(userId);
                if(user == null){