Salome HOME
Fix for generating a description for version relation during checkin.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / ScenarioServiceImpl.java
index 794dd9029d8a799238c577c7524ad9a97a886a60..d1a7f1b555ebdeadbb3ffbd50dd4adfd5d7391f7 100644 (file)
@@ -930,6 +930,11 @@ public class ScenarioServiceImpl implements ScenarioService {
                        // Attach the file via ConvertsRelation, create a new document or
                        // create a new version of the document
                        dprop.setAuthor(aUser).setDate(aDate).setFormat(fileFormat);
+                       String authorName = I18nUtils.getMessageLocaleDefault(aUser
+                                       .getDisplayName());
+                       String summary = I18nUtils.getMessageLocaleDefault(
+                                       MessageKeyEnum.DCT_000005.toString(), authorName);
+                       dprop.setDescription(summary);
 
                        if (doc.getId() > 0) {
                                checkinExistingDoc(step, doc, dprop, fileFormat, upfile,
@@ -954,7 +959,7 @@ public class ScenarioServiceImpl implements ScenarioService {
                                }
                                docname += "_" + i; // The generated new document title
 
-                               dprop.setDescription("Checked in").setName(docname);
+                               dprop.setName(docname);
                                Publication newPub = getStepService().createDocument(step,
                                                dprop);
 
@@ -1049,7 +1054,7 @@ public class ScenarioServiceImpl implements ScenarioService {
                        } else {
                                // If an attachment with this extension already exists then
                                // replace it by the new one
-                               moveFile(upfile,attach.asFile());
+                               moveFile(upfile, attach.asFile());
                                // Update attached file modification date
                                attach.setDate(new Date());
                        }