1 package org.splat.simer;
3 import org.splat.dal.bo.som.Study;
4 import org.splat.service.StudyService;
7 public class EditStudyAction extends DisplayStudyStepAction {
12 private static final long serialVersionUID = -4865668290514118396L;
14 private enum Execute { publish, promote }
16 private StudyService _studyService;
19 * Value of the menu property.
20 * It can be: none, create, open, study, knowledge, sysadmin, help.
22 private String _menuProperty;
25 * Value of the title bar property.
26 * It can be: study, knowledge.
28 private String _titleProperty;
31 * Value of the tool bar property.
32 * It can be: none, standard, study, back.
34 private String _toolProperty;
37 * Property that indicates whether the current open study is editable or not.
38 * On the screen it looks like pen on the status icon, pop-up menu also can be called.
39 * It is necessary for correct building the title bar.
41 private String _editDisabledProperty = "false";
43 // ==============================================================================================================================
45 // ==============================================================================================================================
47 public String doEdition () {
49 mystudy = getOpenStudy();
51 Execute todo = Execute.valueOf(action);
52 Study study = mystudy.getStudyObject();
54 if (todo == Execute.publish) getStudyService().moveToPublic(study);
55 else if (todo == Execute.promote) getStudyService().moveToReference(study);
56 mystudy.getPopup().setContext("study", mystudy.getStudyRights()); // The context has changed
58 setMenuProperty("study");
59 setTitleProperty("study");
60 if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
61 setToolProperty("study");
63 setToolProperty("standard");
65 initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
69 catch (RuntimeException saverror) {
70 logger.error("Reason:", saverror);
75 * Get the studyService.
77 * @return the studyService
79 public StudyService getStudyService() {
84 * Set the studyService.
87 * the studyService to set
89 public void setStudyService(StudyService studyService) {
90 _studyService = studyService;
94 * Get the menuProperty.
95 * @return the menuProperty
97 public String getMenuProperty() {
102 * Set the menuProperty.
103 * @param menuProperty the menuProperty to set
105 public void setMenuProperty(String menuProperty) {
106 this._menuProperty = menuProperty;
110 * Get the _titleProperty.
111 * @return the _titleProperty
113 public String getTitleProperty() {
114 return _titleProperty;
118 * Set the _titleProperty.
119 * @param _titleProperty the titleProperty to set
121 public void setTitleProperty(String titleProperty) {
122 _titleProperty = titleProperty;
125 * Get the editDisabledProperty.
126 * @return the editDisabledProperty
128 public final String getEditDisabledProperty() {
129 return _editDisabledProperty;
132 * Set the editDisabledProperty.
133 * @param editDisabledProperty the editDisabledProperty to set
135 public final void setEditDisabledProperty(String editDisabledProperty) {
136 _editDisabledProperty = editDisabledProperty;
140 * Get the toolProperty.
141 * @return the toolProperty
143 public String getToolProperty() {
144 return _toolProperty;
148 * Set the toolProperty.
149 * @param toolProperty the toolProperty to set
151 public void setToolProperty(final String toolProperty) {
152 _toolProperty = toolProperty;