1 package org.splat.simer;
3 import org.splat.dal.bo.som.Study;
5 public class EditStudyAction extends DisplayStudyStepAction {
10 private static final long serialVersionUID = -4865668290514118396L;
13 * Possible operations on a study.
15 private enum Execute {
21 * Make published study private.
25 * Promote a study to the next state.
29 * Demote a study from In-Draft or In-Check to In-Work.
34 // =========================================================================
36 // =========================================================================
39 * Perform operation on the selected study.
43 public String doEdition() {
44 _openStudy = getOpenStudy();
46 Execute todo = Execute.valueOf(_action);
47 Study study = _openStudy.getStudyObject();
49 if (todo == Execute.publish) {
50 getStudyService().moveToPublic(study);
51 } else if (todo == Execute.protect) {
52 getStudyService().moveToPrivate(study);
53 } else if (todo == Execute.promote) {
54 getStudyService().promote(study);
55 } else if (todo == Execute.demote) {
56 getStudyService().demote(study);
58 // _openStudy.getMenu().refreshSelectedItem(); // Updates the menu icon, in case of other documents in approved state
59 _openStudy.getPopup().setContext("study", _openStudy.getStudyRights()); // The context has changed
64 _selection = _openStudy.getSelection(); // actually, value doesn't matter, it just has to be not null
70 * Mark study as reference functionality.
74 public String doMarkAsReference() {
76 _openStudy = getOpenStudy();
77 Study study = _openStudy.getStudyObject();
79 getStudyService().markStudyAsReference(study);
82 _selection = _openStudy.getSelection(); // actually, value doesn't matter, it just has to be not null
88 * Remove study as reference functionality.
92 public String doRemoveAsReference() {
94 _openStudy = getOpenStudy();
95 Study study = _openStudy.getStudyObject();
97 getStudyService().removeStudyAsReference(study);
100 _selection = _openStudy.getSelection(); // actually, value doesn't matter, it just has to be not null