]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/ImportDocumentAction.java
Salome HOME
Beans initialization is fixed. Document can be added to study now.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / ImportDocumentAction.java
index 3de836904923375c870fec63544a27f538db2bbf..b565afbd382a845b549d7ece165e16b80291285f 100644 (file)
@@ -20,6 +20,7 @@ import org.splat.dal.dao.som.Database;
 import org.splat.dal.bo.som.Document;
 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.dal.bo.som.Publication;
 import org.splat.dal.bo.som.DocumentType;
@@ -35,6 +36,7 @@ public class ImportDocumentAction extends UploadBaseNextAction {
        private String date = ""; // Date extracted from the imported file, if exist
        private ProjectSettingsService _projectSettingsService;
        private PublicationService _publicationService;
+       private StepService _stepService;
 
        private static final long serialVersionUID = 2587822564883588556L;
 
@@ -163,7 +165,7 @@ public class ImportDocumentAction extends UploadBaseNextAction {
 
                        if (docref.length() == 0) { // Importation of a foreign document
                        // TODO: Extract property of supported documents (DOCX, ODT...)
-                               addoc = step.createDocument(dprop.setName(docname)
+                               addoc = getStepService().createDocument(step, dprop.setName(docname)
                                                .setType(type).setFormat(table[table.length - 1])
                                                .setAuthor(user));
                                updir = addoc.getSourceFile().asFile();
@@ -187,7 +189,7 @@ public class ImportDocumentAction extends UploadBaseNextAction {
                                                        locale.getString("date.format"));
                                        dprop.setDate(get.parse(date));
                                }
-                               addoc = step.assignDocument(dprop.setReference(docref).setName(
+                               addoc = getStepService().assignDocument(step, dprop.setReference(docref).setName(
                                                docname));
                                updir = addoc.getSourceFile().asFile();
                                if (logger.isInfoEnabled())
@@ -357,4 +359,20 @@ public class ImportDocumentAction extends UploadBaseNextAction {
        public void setPublicationService(PublicationService publicationService) {
                _publicationService = publicationService;
        }
+
+       /**
+        * Get the stepService.
+        * @return the stepService
+        */
+       public StepService getStepService() {
+               return _stepService;
+       }
+
+       /**
+        * Set the stepService.
+        * @param stepService the stepService to set
+        */
+       public void setStepService(StepService stepService) {
+               _stepService = stepService;
+       }
 }
\ No newline at end of file