Another fix for setting the auditInfo object by setting AND the user that changed...
authorNatasa Kapravelou <akapravelou@gmail.com>
Fri, 8 Oct 2010 11:01:49 +0000 (14:01 +0300)
committerNatasa Kapravelou <akapravelou@gmail.com>
Fri, 8 Oct 2010 11:01:49 +0000 (14:01 +0300)
src/gr/ebs/gss/server/ejb/ExternalAPIBean.java

index 08b5c3a..2f0d6df 100644 (file)
@@ -492,16 +492,16 @@ public class ExternalAPIBean implements ExternalAPI, ExternalAPIRemote {
                        List<Folder> folders = dao.getFoldersPermittedForGroup(userId, groupId);
                        for (Folder f : folders){
                                f.getPermissions().removeAll(group.getPermissions());
-                               touchFolder(f, now);
+                               touchFolder(f, owner, now);
                                for(FileHeader file : f.getFiles()){
                                        file.getPermissions().removeAll(group.getPermissions());
-                                       touchFile(file, now);
+                                       touchFile(file, owner, now);
                                }
                        }
                        List<FileHeader> files = dao.getFilesPermittedForGroup(userId, groupId);
                        for(FileHeader h : files){
                                h.getPermissions().removeAll(group.getPermissions());
-                               touchFile(h, now);
+                               touchFile(h, owner, now);
                        }
                        owner.removeSpecifiedGroup(group);
                        dao.delete(group);
@@ -2682,18 +2682,20 @@ public class ExternalAPIBean implements ExternalAPI, ExternalAPIRemote {
        /**
         * Mark the folder as modified from the specified user and change it's modification date.
         */
-       private void touchFolder(Folder f, Date now){
+       private void touchFolder(Folder f, User _user, Date now){
                final AuditInfo auditInfo = f.getAuditInfo();
                auditInfo.setModificationDate(now);
+               auditInfo.setModifiedBy(_user);
                f.setAuditInfo(auditInfo);
        }
 
        /**
         * Mark the file as modified from the specified user and change it's modification date.
         */
-       private void touchFile(FileHeader f, Date now){
+       private void touchFile(FileHeader f, User _user, Date now){
                final AuditInfo auditInfo = f.getAuditInfo();
                auditInfo.setModificationDate(now);
+               auditInfo.setModifiedBy(_user);
                f.setAuditInfo(auditInfo);
        }