*/
private RepositoryService _repositoryService;
/**
- * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
*/
private String _menuProperty;
/**
- * Value of the title bar property. It can be: study, knowledge.
+ * Value of the title bar property.
+ * It can be: study, knowledge.
*/
private String _titleProperty;
/**
- * Property that indicates whether the current open study is editable or not. On the screen it looks like pen on the status icon, pop-up
- * menu also can be called. It is necessary for correct building the title bar.
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
+ /**
+ * Property that indicates whether the current open study is editable or not.
+ * On the screen it looks like pen on the status icon, pop-up menu also can be called.
+ * It is necessary for correct building the title bar.
*/
private String _editDisabledProperty = "false";
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty);
-
+ if ("true".equals(getWriteAccess())) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("none");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
User user = getConnectedUser();
File updir = getRepositoryService().getDownloadDirectory(user);
File upfile = new File(updir.getPath() + "/" + filename);
usedby = new Vector<Publication>();
if (!extractProperties(upfile, doc)) {
+ if (!("none".equals(_toolProperty))) {
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+ }
return ERROR;
}
setupDefaultUses(deftype);
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty);
-
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+
if (action == ToDo.cancel)
return "cancel";
logger.error("Reason:", error);
setErrorCode("internal");
}
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
public void setEditDisabledProperty(String _editDisabledProperty) {
this._editDisabledProperty = _editDisabledProperty;
}
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file