1 package org.splat.simer;
3 import org.splat.dal.bo.som.Study;
4 import org.splat.service.StudyService;
6 public class EditStudyAction extends DisplayStudyStepAction {
11 private static final long serialVersionUID = -4865668290514118396L;
14 * Injected study service.
16 private StudyService _studyService;
18 private enum Execute {
19 publish, protect, promote
22 // ==============================================================================================================================
24 // ==============================================================================================================================
26 public String doEdition() {
27 _openStudy = getOpenStudy();
29 Execute todo = Execute.valueOf(_action);
30 Study study = _openStudy.getStudyObject();
32 if (todo == Execute.publish) {
33 getStudyService().moveToPublic(study);
34 } else if (todo == Execute.protect) {
35 getStudyService().moveToPrivate(study);
36 } else if (todo == Execute.promote) {
37 getStudyService().moveToReference(study);
39 _openStudy.getPopup().setContext("study", _openStudy.getStudyRights()); // The context has changed
47 * Mark study as reference functionality.
50 public String doMarkAsReference() {
52 _openStudy = getOpenStudy();
53 Study study = _openStudy.getStudyObject();
55 _studyService.markStudyAsReference(study);
61 * Remove study as reference functionality.
64 public String doRemoveAsReference() {
66 _openStudy = getOpenStudy();
67 Study study = _openStudy.getStudyObject();
69 _studyService.removeStudyAsReference(study);
75 * Get the studyService.
77 * @return the studyService
80 public StudyService getStudyService() {
85 * Set the studyService.
88 * the studyService to set
91 public void setStudyService(final StudyService studyService) {
92 _studyService = studyService;