*/
private String _titleProperty;
+ /**
+ * 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.
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);
mystudy = getOpenStudy();
Step step = mystudy.getSelectedStep();
doctypes = getStepService().getValidDocumentTypes(step);
- deftype = ApplicationSettings.getDefaultDocumentType(step, filext);
+ deftype = getApplicationSettings().getDefaultDocumentType(step, filext);
defuses = new Vector<Document>();
state = ProgressState.inWORK;
new Revision().toString());
if (slot == null) {
setErrorCode("reference.undefined");
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
} else {
if (!slot.isUndefined()) {
setErrorCode("reference.duplicate");
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
docref = fileref; // Disables document name and state fields
docver = version.toString();
} catch (ParseException e) {
setErrorCode("format.version");
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
docname = tool.extractProperty("title"); // Property kept even if the file is not referenced
date = tool.extractProperty("date");
if (date != null) {
ResourceBundle locale = ResourceBundle.getBundle("som",
- ApplicationSettings.getCurrentLocale());
+ getApplicationSettings().getCurrentLocale());
SimpleDateFormat check = new SimpleDateFormat(
locale.getString("date.format"));
try {
check.parse(date);
} catch (ParseException e) {
setErrorCode("format.date");
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
} else
return "cancel";
if (doctype == 0) {
setErrorCode("import.type");
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
try {
} else { // Importation of a previously created template-based document
if (date.length() > 0) {
ResourceBundle locale = ResourceBundle.getBundle("som",
- ApplicationSettings.getCurrentLocale());
+ getApplicationSettings().getCurrentLocale());
SimpleDateFormat get = new SimpleDateFormat(
locale.getString("date.format"));
dprop.setDate(get.parse(date));
}
// Creation of derived the document formats
// Document ndoc = addoc.value();
- // Converter send = ApplicationSettings.getConverter(ndoc.getType(), ndoc.getFormat());
+ // Converter send = getApplicationSettings().getConverter(ndoc.getType(), ndoc.getFormat());
//
// if (send != null) send.converts(addoc); // Asynchronous process
logger.error("Reason:", error);
setErrorCode("internal");
}
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
_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