Salome HOME
Fix for generating study local document index when adding a document to a study step.
authorrkv <rkv@opencascade.com>
Fri, 25 Jan 2013 07:57:24 +0000 (07:57 +0000)
committerrkv <rkv@opencascade.com>
Fri, 25 Jan 2013 07:57:24 +0000 (07:57 +0000)
Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java

index 06455e4f9324d3b702f8ea0b08ba5b0b2276e1f0..5b84fdfd7826ba2bff148fcd0d1f16795b785324 100644 (file)
@@ -126,7 +126,8 @@ public class DocumentServiceImpl implements DocumentService {
                Study owner = dprop.getOwner().getOwnerStudy();
 
                // Synchronize the object with the current Hibernate session.
-               // owner = getStudyDAO().merge(owner);
+               owner.setLastLocalIndex(getStudyDAO().get(owner.getIndex())
+                               .getLastLocalIndex());
 
                SimpleDateFormat tostring = new SimpleDateFormat("yyyy"); // RKV: NOPMD: TODO: Use locale here?
                String year = tostring.format(owner.getDate());
@@ -144,7 +145,6 @@ public class DocumentServiceImpl implements DocumentService {
                                .toString();
                aDoc.getFile().changePath(path);
                owner = getStudyDAO().merge(owner);
-               // getStudyDAO().update(owner);
        }
 
        /**
@@ -187,7 +187,7 @@ public class DocumentServiceImpl implements DocumentService {
                String res;
                if (scheme == FileNaming.encoded) {
                        res = scope.getReference();
-               }else if (scheme == FileNaming.asis) {
+               } else if (scheme == FileNaming.asis) {
                        res = aDoc.getFile().getName();
                } else {
                        res = aDoc.getTitle();