*/
private DocumentTypeService _documentTypeService;
+ /**
+ * Update uses documents list if chosen new type of import document.
+ * @return SUCCESS
+ */
+ public final String updateUsesList() {
+ _mystudy = getOpenStudy();
+ _defuses = new ArrayList<Document>();
+ _deftype = getDocumentTypeService().selectType(
+ (int) _documentType);
+ if (_deftype != null) {
+ setupDefaultUses(_deftype);
+ }
+ return SUCCESS;
+ }
+
/**
* Initialize the operation.
*
initializationScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
Constants.TRUE);
- if (_action == ToDo.cancel) {
- res = "cancel";
- } else if (_documentType == 0) {
+ if (_documentType == 0) {
setErrorCode("message.error.import.type");
initializationFullScreenContext(Constants.STUDY_MENU,
try {
// Getting user inputs
_mystudy = getOpenStudy();
+ _mystudy.updateCurrentStep(); //update current step
User user = getConnectedUser();
Step step = _mystudy.getSelectedStep();
Date aDate = null;
//
// if (send != null) send.converts(addoc); // Asynchronous process
- _mystudy.add(addoc); // Updates the presentation
+ if (uses.isEmpty()) {
+ _mystudy.add(addoc); // Updates the presentation
+ } else {
+ // Re-opening (refreshing) the currently open study
+ refreshStudy();
+ }
res = SUCCESS;
} catch (FileNotFoundException error) {
LOG.error("Reason:", error);
public List<Boolean> getReviewable() {
return _reviewable;
}
-}
\ No newline at end of file
+}