From a34d4b52b14218195c8dc7754486d1a2a13df412 Mon Sep 17 00:00:00 2001 From: rkv Date: Fri, 25 Jan 2013 07:57:24 +0000 Subject: [PATCH] Fix for generating study local document index when adding a document to a study step. --- .../src/org/splat/service/DocumentServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(); -- 2.39.2