* Injected repository service.
*/
private RepositoryService _repositoryService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
private static final long serialVersionUID = 6003880772275115923L;
public String doInitialize () {
// -----------------------------
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
public String doUpload () {
// -------------------------
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
if (action == ToDo.cancel) return "cancel";
try {
File udir = getRepositoryService().getDownloadDirectory(getConnectedUser());
if (file.exists()) file.delete();
Do.copy(upload, file);
logger.info("Uploading \"" + uploadFileName + "\" " + uploadMimeType + " file.");
+ /*if (next == null || next.isEmpty()) {
+ next = "import";
+ }*/
+
+ logger.info("MKA next = " + next);
return next;
}
catch (OutOfMemoryError error) {
+
+ setMenuProperty("none");
+ initializationScreenContext(_menuProperty);
+
return "outofmemory";
}
catch (Exception error) {
public void setRepositoryService(RepositoryService repositoryService) {
_repositoryService = repositoryService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file