import org.splat.dal.bo.som.ProjectElement;
import org.splat.dal.bo.som.Scenario;
-import org.splat.exception.InvalidParameterException;
-import org.splat.service.StepService;
import org.splat.service.StudyService;
-import org.splat.service.dto.StepCommentDTO;
import org.splat.som.StepRights;
import org.splat.wapp.Constants;
import org.splat.wapp.PopupMenu;
/**
* Presents the current open study information.
- *
+ *
* @author Daniel Brunier-Coulin.
- *
+ *
*/
public class DisplayStudyStepAction extends AbstractDisplayAction {
* Injected study service.
*/
private StudyService _studyService;
-
- /**
- * Step comments.
- */
- private List<StepCommentDTO> _comments = null;
-
- /**
- * Injected Step Service.
- */
- private StepService _stepService;
-
- /**
- * Study description.
- */
- private String _descriptionValue;
// ==============================================================================================================================
// Action methods
/**
* Open the selected study.
- *
+ *
* @return SUCCESS if succeeded or ERROR if can't open
*/
public String doOpen() {
setMenu();
}
- loadComments();
- loadDescription();
return res;
}
/**
* Close the currently open study.
- *
+ *
* @return SUCCESS
*/
public String doClose() {
initializationScreenContext("none");
return SUCCESS;
}
-
- /**
- * Loads step comments (if already loaded - reloads).
- */
- public void loadComments() {
- try {
- _comments = _stepService.getStepComments(_openStudy.getSelectedStep());
- } catch(InvalidParameterException exception) {
- _comments = null;
- LOG.debug("Error while trying to add comment: " + exception.getMessage());
- }
- }
-
- /**
- * Loads description (if already loaded - reloads).
- */
- public void loadDescription() {
- try {
- _descriptionValue = _studyService.getDescription(_openStudy.getIndex());
- } catch(InvalidParameterException exception) {
- _descriptionValue = null;
- LOG.debug("Error while trying to add description: " + exception.getMessage());
- }
- }
-
- /**
- * Sets study description.
- * @return SUCCESS if succeeded, INPUT otherwise.
- */
- public String doSetDescription() {
- String res = INPUT;
- try {
- _studyService.setDescription(_openStudy.getIndex(), _descriptionValue);
- res = SUCCESS;
- } catch(InvalidParameterException exception) {
- LOG.debug("Error while trying to add description: " + exception.getMessage());
- }
- loadDescription();
- return res;
- }
// ==============================================================================================================================
// Getters
/**
* Get the studyService.
- *
+ *
* @return the studyService
*/
public StudyService getStudyService() {
/**
* Set the studyService.
- *
+ *
* @param studyService
* the studyService to set
*/
/**
* {@inheritDoc}
- *
+ *
* @see org.splat.simer.Action#setOpenStudy(org.splat.simer.OpenStudy)
*/
@Override
super.setOpenStudy(study);
_openStudy = study;
}
-
- /**
- * Get the comments.
- * @return the comments
- */
- public List<StepCommentDTO> getComments() {
- return _comments;
- }
-
- /**
- * Set the comments.
- * @param comments the comments to set
- */
- public void setComments(final List<StepCommentDTO> comments) {
- _comments = comments;
- }
-
- /**
- * Get the stepService.
- * @return the stepService
- */
- public StepService getStepService() {
- return _stepService;
- }
-
- /**
- * Set the stepService.
- * @param stepService the stepService to set
- */
- public void setStepService(final StepService stepService) {
- _stepService = stepService;
- }
-
- /**
- * Get the descriptionValue.
- * @return the descriptionValue
- */
- public String getDescriptionValue() {
- return _descriptionValue;
- }
-
- /**
- * Set the descriptionValue.
- * @param descriptionValue the descriptionValue to set
- */
- public void setDescriptionValue(final String descriptionValue) {
- _descriptionValue = descriptionValue;
- }
}
\ No newline at end of file