Salome HOME
577b185609bd19b907da7e5db11467a6ae96c129
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / EditStudyAction.java
1 package org.splat.simer;
2
3 import org.splat.dal.bo.som.Study;
4
5 public class EditStudyAction extends DisplayStudyStepAction {
6
7         /**
8          * Serial version ID.
9          */
10         private static final long serialVersionUID = -4865668290514118396L;
11
12         private enum Execute {
13                 publish, promote
14         }
15
16         // ==============================================================================================================================
17         // Action methods
18         // ==============================================================================================================================
19
20         public String doEdition() {
21                 try {
22                         _openStudy = getOpenStudy();
23
24                         Execute todo = Execute.valueOf(_action);
25                         Study study = _openStudy.getStudyObject();
26
27                         if (todo == Execute.publish) {
28                                 getStudyService().moveToPublic(study);
29                         } else if (todo == Execute.promote) {
30                                 getStudyService().moveToReference(study);
31                         }
32                         _openStudy.getPopup().setContext("study",
33                                         _openStudy.getStudyRights()); // The context has changed
34
35                         setMenu();
36
37                         return SUCCESS;
38                 } catch (RuntimeException saverror) {
39                         LOG.error("Reason:", saverror);
40                         return ERROR;
41                 }
42         }
43 }