Salome HOME
Refactoring of Database, replacing SQL by DAOs calls. Methods for search by criteria...
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / VersionDocumentAction.java
index a5503b38f32d9ab1745725cb4546fdebc34f8754..e56c4dbace4b39d469875e859538d0f19a545f18 100644 (file)
@@ -24,6 +24,7 @@ import org.splat.dal.bo.som.ProgressState;
 import org.splat.service.PublicationService;
 import org.splat.service.StepService;
 import org.splat.service.technical.ProjectSettingsService;
+import org.splat.service.technical.RepositoryService;
 import org.splat.dal.bo.som.Publication;
 import org.splat.som.Revision;
 import org.splat.som.Step;
@@ -41,7 +42,14 @@ public class VersionDocumentAction extends UploadBaseNextAction {
        private ProjectSettingsService _projectSettingsService;
        private PublicationService _publicationService;
        private StepService _stepService;
+       /**
+        * Injected repository service.
+        */
+       private RepositoryService _repositoryService;
 
+       /**
+        * Serial version ID.
+        */
        private static final long serialVersionUID = -5702264003232132168L;
 
        // ==============================================================================================================================
@@ -53,7 +61,7 @@ public class VersionDocumentAction extends UploadBaseNextAction {
                Session connex = Database.getSession();
                Transaction transax = connex.beginTransaction();
                User user = getConnectedUser();
-               File updir = Database.getDownloadDirectory(user);
+               File updir = getRepositoryService().getDownloadDirectory(user);
                File upfile = new File(updir.getPath() + "/" + filename);
 
                mystudy = getOpenStudy();
@@ -136,7 +144,7 @@ public class VersionDocumentAction extends UploadBaseNextAction {
                        mystudy = getOpenStudy();
                        User user = getConnectedUser();
                        Step step = mystudy.getSelectedStep();
-                       File updir = Database.getDownloadDirectory(user);
+                       File updir = getRepositoryService().getDownloadDirectory(user);
                        File upfile = new File(updir.getPath() + "/" + filename);
 
                        // Versioning of the document
@@ -346,4 +354,20 @@ public class VersionDocumentAction extends UploadBaseNextAction {
        public void setStepService(StepService stepService) {
                _stepService = stepService;
        }
+
+       /**
+        * Get the repositoryService.
+        * @return the repositoryService
+        */
+       public RepositoryService getRepositoryService() {
+               return _repositoryService;
+       }
+
+       /**
+        * Set the repositoryService.
+        * @param repositoryService the repositoryService to set
+        */
+       public void setRepositoryService(RepositoryService repositoryService) {
+               _repositoryService = repositoryService;
+       }
 }
\ No newline at end of file