From: rkv Date: Fri, 25 Jan 2013 07:57:24 +0000 (+0000) Subject: Fix for generating study local document index when adding a document to a study step. X-Git-Tag: Root_Delivery2_2013_04_22~163 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a34d4b52b14218195c8dc7754486d1a2a13df412;p=tools%2Fsiman.git Fix for generating study local document index when adding a document to a study step. --- diff --git a/Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java b/Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java index 06455e4..5b84fdf 100644 --- a/Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java +++ b/Workspace/Siman-Common/src/org/splat/service/DocumentServiceImpl.java @@ -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();