submissionId = sub.getId();
}
}
// FIXME: move the method to studyService, handle the case study w/o submission
TBPermission perm = getSubmissionService().getPermission(username, submissionId);
/* retrieve analysis step id */
String analysisStep_id = ServletRequestUtils.getStringParameter(request, "id", null);
request.getSession().setAttribute("analysisStep_id", analysisStep_id);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("ANALYSIS Step ID = " + analysisStep_id + " study id = " + study_id);
}
List<String> uniqueAlgorithmDescriptions = getAnalysisStepService()
.findUniqueAlgorithmDescriptions();
AnalysisStepCommand analysisStepCommand = new AnalysisStepCommand();
analysisStepCommand.setUniqueAlgorithmDescriptions(uniqueAlgorithmDescriptions);
if (TreebaseUtil.isEmpty(analysisStep_id)) {
if (perm == TBPermission.WRITE) {
LOGGER.info("setAuthorizationChecked(true)");
setAuthorizationChecked(true);
return analysisStepCommand;
} else {
LOGGER.info("setAuthorizationChecked(false)");
setAuthorizationChecked(false);
return null;
}
} else {
AnalysisStep analysisStep = mAnalysisStepService.findByID(Long
.parseLong(analysisStep_id));
Long analysis_id = analysisStep.getAnalysis().getId();
TBPermission perm2 = getAnalysisService().getPermission(username, analysis_id);
if (perm2 == TBPermission.WRITE || perm2 == TBPermission.READ_ONLY
|| perm2 == TBPermission.SUBMITTED_WRITE) {
BeanUtils.copyProperties(analysisStep, analysisStepCommand);
Software software = analysisStep.getSoftwareInfo();