use of org.akaza.openclinica.web.InconsistentStateException in project OpenClinica by OpenClinica.
the class TableOfContentsServlet method validateEventCRFAndAction.
private void validateEventCRFAndAction() throws Exception {
if (invalidAction(action)) {
throw new InconsistentStateException(Page.LIST_STUDY_SUBJECTS_SERVLET, resexception.getString("no_action_specified_or_invalid"));
}
if (!isConsistentAction(action, ecb)) {
HashMap verbs = new HashMap();
verbs.put(ACTION_START_INITIAL_DATA_ENTRY, resword.getString("start_initial_data_entry"));
verbs.put(ACTION_CONTINUE_INITIAL_DATA_ENTRY, resword.getString("continue_initial_data_entry"));
verbs.put(ACTION_START_DOUBLE_DATA_ENTRY, resword.getString("start_double_data_entry"));
verbs.put(ACTION_CONTINUE_DOUBLE_DATA_ENTRY, resword.getString("continue_double_data_entry"));
verbs.put(ACTION_ADMINISTRATIVE_EDITING, resword.getString("perform_administrative_editing"));
String verb = (String) verbs.get(action);
if (verb == null) {
verb = "start initial data entry";
}
throw new InconsistentStateException(Page.LIST_STUDY_SUBJECTS_SERVLET, resexception.getString("you_are_trying_to") + verb + " " + resexception.getString("on_event_CRF_inappropiate_action"));
}
if (action.equals(ACTION_START_DOUBLE_DATA_ENTRY)) {
ecb.setValidatorId(ub.getId());
ecb.setDateValidate(new Date());
ecb = (EventCRFBean) ecdao.update(ecb);
}
}
Aggregations