Salome HOME
File naming strategy is set to "asis" and generated number is in the prefix now inste...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / DocumentServiceImpl.java
index 61cda0b46ee7e5c8ccfa885e202e0548e3f7b13c..c8494b13e70cf1fcd931b082cd3b4ca9ba3152ab 100644 (file)
@@ -126,7 +126,7 @@ public class DocumentServiceImpl implements DocumentService {
                Study owner = dprop.getOwner().getOwnerStudy();
 
                // Synchronize the object with the current Hibernate session.
-               //owner = getStudyDAO().merge(owner);
+               // owner = getStudyDAO().merge(owner);
 
                SimpleDateFormat tostring = new SimpleDateFormat("yyyy"); // RKV: NOPMD: TODO: Use locale here?
                String year = tostring.format(owner.getDate());
@@ -144,7 +144,7 @@ public class DocumentServiceImpl implements DocumentService {
                                .toString();
                aDoc.getFile().changePath(path);
                owner = getStudyDAO().merge(owner);
-//             getStudyDAO().update(owner);
+               // getStudyDAO().update(owner);
        }
 
        /**
@@ -167,8 +167,8 @@ public class DocumentServiceImpl implements DocumentService {
                        encoding.append(scope.getReference()).append("_").append(
                                        tostring.format(number));
                } else { // title and (temporarily) asis
-                       encoding.append(aDoc.getTitle()).append("_").append(
-                                       tostring.format(number));
+                       encoding.append("_").append(tostring.format(number)).append(
+                                       aDoc.getFile().getName());
                }
                return encoding.toString();
        }
@@ -318,7 +318,7 @@ public class DocumentServiceImpl implements DocumentService {
 
                aDoc.getAllRelations().add(attach);
                getDocumentDAO().merge(aDoc);
-               
+
                return attach;
        }
 
@@ -745,6 +745,7 @@ public class DocumentServiceImpl implements DocumentService {
 
        /**
         * Get the relationDAO.
+        * 
         * @return the relationDAO
         */
        public RelationDAO getRelationDAO() {
@@ -753,7 +754,9 @@ public class DocumentServiceImpl implements DocumentService {
 
        /**
         * Set the relationDAO.
-        * @param relationDAO the relationDAO to set
+        * 
+        * @param relationDAO
+        *            the relationDAO to set
         */
        public void setRelationDAO(final RelationDAO relationDAO) {
                _relationDAO = relationDAO;