Salome HOME
Edit/Delete of the description/comments functionalities are implemented
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / DisplayStudyStepAction.java
index 4474f20d8088a6256cae95b1bd22c978edd1b8f9..8d377558d3712d7680b29c8b2a657b946a6bae08 100644 (file)
@@ -4,10 +4,7 @@ import java.util.List;
 
 import org.splat.dal.bo.som.ProjectElement;
 import org.splat.dal.bo.som.Scenario;
-import org.splat.exception.InvalidParameterException;
-import org.splat.service.StepService;
 import org.splat.service.StudyService;
-import org.splat.service.dto.StepCommentDTO;
 import org.splat.som.StepRights;
 import org.splat.wapp.Constants;
 import org.splat.wapp.PopupMenu;
@@ -15,9 +12,9 @@ import org.splat.wapp.SimpleMenu;
 
 /**
  * Presents the current open study information.
- * 
+ *
  * @author Daniel Brunier-Coulin.
- * 
+ *
  */
 public class DisplayStudyStepAction extends AbstractDisplayAction {
 
@@ -35,21 +32,6 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
         * Injected study service.
         */
        private StudyService _studyService;
-       
-       /**
-        * Step comments.
-        */
-       private List<StepCommentDTO> _comments = null;
-
-       /**
-        * Injected Step Service.
-        */
-       private StepService _stepService;
-       
-       /**
-        * Study description.
-        */
-       private String _descriptionValue;
 
        // ==============================================================================================================================
        // Action methods
@@ -57,7 +39,7 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * Open the selected study.
-        * 
+        *
         * @return SUCCESS if succeeded or ERROR if can't open
         */
        public String doOpen() {
@@ -106,8 +88,6 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
                        setMenu();
                }
-               loadComments();
-               loadDescription();
                return res;
        }
 
@@ -183,7 +163,7 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * Close the currently open study.
-        * 
+        *
         * @return SUCCESS
         */
        public String doClose() {
@@ -191,46 +171,6 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                initializationScreenContext("none");
                return SUCCESS;
        }
-
-       /**
-        * Loads step comments (if already loaded - reloads).
-        */
-       public void loadComments() {
-               try {
-                       _comments = _stepService.getStepComments(_openStudy.getSelectedStep());
-               } catch(InvalidParameterException exception) {
-                       _comments = null;
-                       LOG.debug("Error while trying to add comment: " + exception.getMessage());
-               }
-       }
-       
-       /**
-        * Loads description (if already loaded - reloads).
-        */
-       public void loadDescription() {
-               try {
-                       _descriptionValue = _studyService.getDescription(_openStudy.getIndex());
-               } catch(InvalidParameterException exception) {
-                       _descriptionValue = null;
-                       LOG.debug("Error while trying to add description: " + exception.getMessage());
-               }
-       }
-       
-       /**
-        * Sets study description.
-        * @return SUCCESS if succeeded, INPUT otherwise.
-        */
-       public String doSetDescription() {
-               String res = INPUT;
-               try {
-                       _studyService.setDescription(_openStudy.getIndex(), _descriptionValue);
-                       res = SUCCESS;
-               } catch(InvalidParameterException exception) {
-                       LOG.debug("Error while trying to add description: " + exception.getMessage());
-               }
-               loadDescription();
-               return res;
-       }
        
        // ==============================================================================================================================
        // Getters
@@ -275,7 +215,7 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * Get the studyService.
-        * 
+        *
         * @return the studyService
         */
        public StudyService getStudyService() {
@@ -284,7 +224,7 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * Set the studyService.
-        * 
+        *
         * @param studyService
         *            the studyService to set
         */
@@ -294,7 +234,7 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
 
        /**
         * {@inheritDoc}
-        * 
+        *
         * @see org.splat.simer.Action#setOpenStudy(org.splat.simer.OpenStudy)
         */
        @Override
@@ -302,52 +242,4 @@ public class DisplayStudyStepAction extends AbstractDisplayAction {
                super.setOpenStudy(study);
                _openStudy = study;
        }
-       
-       /**
-        * Get the comments.
-        * @return the comments
-        */
-       public List<StepCommentDTO> getComments() {
-               return _comments;
-       }
-
-       /**
-        * Set the comments.
-        * @param comments the comments to set
-        */
-       public void setComments(final List<StepCommentDTO> comments) {
-               _comments = comments;
-       }
-
-       /**
-        * Get the stepService.
-        * @return the stepService
-        */
-       public StepService getStepService() {
-               return _stepService;
-       }
-
-       /**
-        * Set the stepService.
-        * @param stepService the stepService to set
-        */
-       public void setStepService(final StepService stepService) {
-               _stepService = stepService;
-       }
-       
-       /**
-        * Get the descriptionValue.
-        * @return the descriptionValue
-        */
-       public String getDescriptionValue() {
-               return _descriptionValue;
-       }
-
-       /**
-        * Set the descriptionValue.
-        * @param descriptionValue the descriptionValue to set
-        */
-       public void setDescriptionValue(final String descriptionValue) {
-               _descriptionValue = descriptionValue;
-       }
 }
\ No newline at end of file