package org.splat.simer;
import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
import org.splat.kernel.Do;
import org.splat.service.technical.RepositoryService;
*/
private RepositoryService _repositoryService;
- /**
- * 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.
- */
- private String _titleProperty;
-
- /**
- * Value of the tool bar property. It can be: none, standard, study, back.
- */
- private String _toolProperty;
-
- /**
- * Value of the left menu property. It can be: open, study, knowledge, scenario.
- */
- private String _leftMenuProperty;
-
- /**
- * 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";
-
/**
* Action modes enumeration.
*/
// ==============================================================================================================================
/**
- * Prepare form for the upload action.
+ * Prepare form for the upload documents to study action.
*
* @return SUCCESS
*/
- public String doInitialize() {
- setMenuProperty(Constants.STUDY_MENU);
- setToolProperty(Constants.NONE);
- setLeftMenuProperty("open");
- initializationFullScreenContext(_menuProperty, _toolProperty,
- _leftMenuProperty);
+ public String doInitializeStudy() {
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.STUDY_MENU);
+
+ return SUCCESS;
+ }
+
+ /**
+ * Prepare form for the upload users action.
+ * @return SUCCESS
+ */
+ public String doInitializeSysAdmin() {
+ initializationFullScreenContext(Constants.SYSADMIN_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.OPEN);
+ setSimanContext("#Database_Management.htm");
return SUCCESS;
}
* file or ERROR otherwise
*/
public String doUpload() {
- setMenuProperty(Constants.STUDY_MENU);
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty);
+ initializationScreenContext(getMenuProperty(), Constants.STUDY_MENU,
+ Constants.TRUE);
String res;
if (_action == ToDo.cancel) {
res = _nextAction;
} catch (OutOfMemoryError error) {
- setMenuProperty(Constants.NONE);
- setTitleProperty(Constants.STUDY_MENU);
- setEditDisabledProperty("true");
- setToolProperty(Constants.NONE);
- setLeftMenuProperty(Constants.STUDY_MENU);
- initializationFullScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty, _toolProperty, _leftMenuProperty);
+ initializationFullScreenContext(Constants.NONE,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.STUDY_MENU);
setErrorCode("message.error.outofmemory");
return _uploadFileName;
}
+ /**
+ * Get fileName with url special symbols canceled for usage in struts.xml.
+ * @return the encoded uploaded file name.
+ */
+ public String getCanceledFileName() {
+ String res = _uploadFileName;
+ try {
+ res = URLEncoder.encode(res, "ISO-8859-1");
+ } catch (UnsupportedEncodingException e) {
+ LOG.error("Reason: ", e);
+ }
+ return res;
+ }
+
/**
* Get the action to which the uploaded file is passed.
*
public void setRepositoryService(final 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(final String menuProperty) {
- this._menuProperty = menuProperty;
- }
-
- /**
- * Get the _titleProperty.
- *
- * @return the _titleProperty
- */
- public String getTitleProperty() {
- return _titleProperty;
- }
-
- /**
- * Set the _titleProperty.
- *
- * @param titleProperty
- * the titleProperty to set
- */
- public void setTitleProperty(final String titleProperty) {
- _titleProperty = titleProperty;
- }
-
- /**
- * Get the _editDisabledProperty.
- *
- * @return the _editDisabledProperty
- */
- public String getEditDisabledProperty() {
- return _editDisabledProperty;
- }
-
- /**
- * Set the editDisabledProperty.
- *
- * @param editDisabledProperty
- * the editDisabledProperty to set
- */
- public void setEditDisabledProperty(final 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;
- }
-
- /**
- * Get the leftMenuProperty.
- *
- * @return the leftMenuProperty
- */
- public String getLeftMenuProperty() {
- return _leftMenuProperty;
- }
-
- /**
- * Set the leftMenuProperty.
- *
- * @param leftMenuProperty
- * the leftMenuProperty to set
- */
- public void setLeftMenuProperty(final String leftMenuProperty) {
- _leftMenuProperty = leftMenuProperty;
- }
}
\ No newline at end of file