]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/VersionDocumentAction.java
Salome HOME
Default document types mappings are moved from application settings (my.xml) to proje...
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / VersionDocumentAction.java
index ac94f1305ce72103d492e87cbaaa4a51afa864d0..9f975c0311c054d034c689c236ef2f0da43bdd88 100644 (file)
@@ -79,33 +79,28 @@ public class VersionDocumentAction extends UploadBaseNextAction {
         */
        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;
 
        /**
-        * Value of the tool bar property. 
-        * It can be: none, standard, study, back.
+        * 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.
+        * 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.
+        * 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";
 
@@ -129,8 +124,9 @@ public class VersionDocumentAction extends UploadBaseNextAction {
                        setToolProperty(Constants.NONE);
                }
                setLeftMenuProperty(Constants.STUDY_MENU);
-        initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-           
+               initializationFullScreenContext(_menuProperty, _titleProperty,
+                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
                User user = getConnectedUser();
                File updir = getRepositoryService().getDownloadDirectory(user);
                File upfile = new File(updir.getPath() + "/" + filename);
@@ -162,7 +158,8 @@ public class VersionDocumentAction extends UploadBaseNextAction {
                        if (!(Constants.NONE.equals(_toolProperty))) {
                                setToolProperty(Constants.NONE);
                                setLeftMenuProperty(Constants.STUDY_MENU);
-                               initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+                               initializationFullScreenContext(_menuProperty, _titleProperty,
+                                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
                        }
                        res = ERROR;
                }
@@ -241,12 +238,13 @@ public class VersionDocumentAction extends UploadBaseNextAction {
                setMenuProperty(Constants.STUDY_MENU);
                setTitleProperty(Constants.STUDY_MENU);
                setEditDisabledProperty("true");
-        initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
-           
+               initializationScreenContext(_menuProperty, _titleProperty,
+                               _editDisabledProperty);
+
                if (action == ToDo.cancel) {
                        res = "cancel";
                } else {
-       
+
                        try {
                                // Getting user inputs
                                mystudy = getOpenStudy();
@@ -260,19 +258,19 @@ public class VersionDocumentAction extends UploadBaseNextAction {
                                                        .getString("date.format"));
                                        aDate = get.parse(_date);
                                }
-       
+
                                String[] listDocuses = null;
                                if (docuses != null) {
                                        listDocuses = docuses.split(",");
                                }
                                getPublicationService().versionDocument(step, user, filename,
-                                               Integer.valueOf(_index), _version, _description, state, aDate,
-                                               listDocuses, _docusedby);
-       
+                                               Integer.valueOf(_index), _version, _description, state,
+                                               aDate, listDocuses, _docusedby);
+
                                // Update of the open study
                                mystudy.setSelection(mystudy.getSelection()); // Rebuilds the presentation
                                // TODO: Look is an optimization is possible (for example by updating the presentation of versioned document)
-       
+
                                res = SUCCESS;
                        } catch (FileNotFoundException error) {
                                LOG.error("Reason:", error);
@@ -283,11 +281,12 @@ public class VersionDocumentAction extends UploadBaseNextAction {
                        }
                        if (!SUCCESS.equals(res)) {
                                setToolProperty(Constants.NONE);
-                               
+
                                setLeftMenuProperty(Constants.STUDY_MENU);
-                               initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
+                               initializationFullScreenContext(_menuProperty, _titleProperty,
+                                               _editDisabledProperty, _toolProperty, _leftMenuProperty);
                        }
-               }               
+               }
                return res;
        }
 
@@ -356,7 +355,8 @@ public class VersionDocumentAction extends UploadBaseNextAction {
         * @param projectSettingsService
         *            project settings service
         */
-       public void setProjectSettings(final ProjectSettingsService projectSettingsService) {
+       public void setProjectSettings(
+                       final ProjectSettingsService projectSettingsService) {
                _projectSettings = projectSettingsService;
        }
 
@@ -375,7 +375,8 @@ public class VersionDocumentAction extends UploadBaseNextAction {
         * @param publicationService
         *            the publicationService to set
         */
-       public void setPublicationService(final PublicationService publicationService) {
+       public void setPublicationService(
+                       final PublicationService publicationService) {
                _publicationService = publicationService;
        }
 
@@ -473,9 +474,10 @@ public class VersionDocumentAction extends UploadBaseNextAction {
        public void setEditDisabledProperty(final String editDisabledProperty) {
                this._editDisabledProperty = editDisabledProperty;
        }
-       
+
        /**
         * Get the toolProperty.
+        * 
         * @return the toolProperty
         */
        public String getToolProperty() {
@@ -484,14 +486,17 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        /**
         * Set the toolProperty.
-        * @param toolProperty the toolProperty to set
+        * 
+        * @param toolProperty
+        *            the toolProperty to set
         */
        public void setToolProperty(final String toolProperty) {
                _toolProperty = toolProperty;
        }
-       
+
        /**
         * Get the leftMenuProperty.
+        * 
         * @return the leftMenuProperty
         */
        public String getLeftMenuProperty() {
@@ -500,7 +505,9 @@ public class VersionDocumentAction extends UploadBaseNextAction {
 
        /**
         * Set the leftMenuProperty.
-        * @param leftMenuProperty the leftMenuProperty to set
+        * 
+        * @param leftMenuProperty
+        *            the leftMenuProperty to set
         */
        public void setLeftMenuProperty(final String leftMenuProperty) {
                _leftMenuProperty = leftMenuProperty;