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 {
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.promote) {
35 getStudyService().moveToReference(study);
37 _openStudy.getPopup().setContext("study", _openStudy.getStudyRights()); // The context has changed
45 * Mark study as reference functionality.
48 public String doMarkAsReference() {
50 _openStudy = getOpenStudy();
51 Study study = _openStudy.getStudyObject();
53 _studyService.markStudyAsReference(study);
59 * Remove study as reference functionality.
62 public String doRemoveAsReference() {
64 _openStudy = getOpenStudy();
65 Study study = _openStudy.getStudyObject();
67 _studyService.removeStudyAsReference(study);
73 * Get the studyService.
75 * @return the studyService
78 public StudyService getStudyService() {
83 * Set the studyService.
86 * the studyService to set
89 public void setStudyService(final StudyService studyService) {
90 _studyService = studyService;