branch develop-1.1.x updated (9c3ba4c -> 5e36803)
This is an automated email from the git hooks/post-receive script. New change to branch develop-1.1.x in repository faxtomail. See http://git.codelutin.com/faxtomail.git from 9c3ba4c Prepare next devolpment iteration new 195e652 enregistrement des sociétés dans le dossier même si c'est hérité (moins de requêtes pour trouver les dossiers d'une société) new 5e36803 enregistrement de tous les droits de lecture sur les dossiers (même ceux des parents) pour plus de rapidité dans les recherches (fixes #7683) The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 5e36803ef3b38a0ac39d23403cca1e6eb5d00775 Author: Kevin Morin <morin@codelutin.com> Date: Fri Oct 30 15:52:04 2015 +0100 enregistrement de tous les droits de lecture sur les dossiers (même ceux des parents) pour plus de rapidité dans les recherches (fixes #7683) commit 195e652cfb71ac0b229d1d3505aa1db2fa85c5d8 Author: Kevin Morin <morin@codelutin.com> Date: Fri Oct 30 10:43:30 2015 +0100 enregistrement des sociétés dans le dossier même si c'est hérité (moins de requêtes pour trouver les dossiers d'une société) Summary of changes: .../services/service/ConfigurationServiceImpl.java | 11 +++++ .../services/service/EmailServiceImpl.java | 49 +--------------------- .../services/service/MailFolderService.java | 2 + .../services/service/MailFolderServiceImpl.java | 15 ++++--- .../src/main/webapp/js/configuration.js | 15 +++++++ .../src/main/webapp/js/configuration.js | 2 +- 6 files changed, 40 insertions(+), 54 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-1.1.x in repository faxtomail. See http://git.codelutin.com/faxtomail.git commit 195e652cfb71ac0b229d1d3505aa1db2fa85c5d8 Author: Kevin Morin <morin@codelutin.com> Date: Fri Oct 30 10:43:30 2015 +0100 enregistrement des sociétés dans le dossier même si c'est hérité (moins de requêtes pour trouver les dossiers d'une société) --- .../services/service/ConfigurationServiceImpl.java | 5 +++++ .../faxtomail/services/service/EmailServiceImpl.java | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java index d2a7c85..4a10c85 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java @@ -307,6 +307,11 @@ public class ConfigurationServiceImpl extends FaxToMailServiceSupport implements currentMailFolder.setParent(parent); + // set the parent's company if it is inherited + if (!currentMailFolder.isUseCurrentLevelCompany() && parent != null) { + currentMailFolder.setCompany(parent.getCompany()); + } + if (!currentMailFolder.isPersisted()) { currentMailFolder = dao.create(currentMailFolder); } diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java index fc3275e..a4b418a 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java @@ -989,14 +989,14 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe MailFolderTopiaDao mailFolderDao = getPersistenceContext().getMailFolderDao(); Collection<MailFolder> companyFolders = mailFolderDao.forCompanyEquals(company).findAll(); Set<MailFolder> archiveFolders = new HashSet<>(companyFolders); - for (MailFolder folder : companyFolders) { - Collection<MailFolder> children = folder.getChildren(); - if (children != null) { - for (MailFolder child : children) { - findCompanyFoldersChildren(child, archiveFolders); - } - } - } +// for (MailFolder folder : companyFolders) { +// Collection<MailFolder> children = folder.getChildren(); +// if (children != null) { +// for (MailFolder child : children) { +// findCompanyFoldersChildren(child, archiveFolders); +// } +// } +// } EmailTopiaDao emailDao = getPersistenceContext().getEmailDao(); return emailDao.findArchivedEmails(commandQuotationNumber, archiveFolders); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop-1.1.x in repository faxtomail. See http://git.codelutin.com/faxtomail.git commit 5e36803ef3b38a0ac39d23403cca1e6eb5d00775 Author: Kevin Morin <morin@codelutin.com> Date: Fri Oct 30 15:52:04 2015 +0100 enregistrement de tous les droits de lecture sur les dossiers (même ceux des parents) pour plus de rapidité dans les recherches (fixes #7683) --- .../services/service/ConfigurationServiceImpl.java | 6 +++ .../services/service/EmailServiceImpl.java | 49 +--------------------- .../services/service/MailFolderService.java | 2 + .../services/service/MailFolderServiceImpl.java | 15 ++++--- .../src/main/webapp/js/configuration.js | 15 +++++++ .../src/main/webapp/js/configuration.js | 2 +- 6 files changed, 35 insertions(+), 54 deletions(-) diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java index 4a10c85..9a2e02b 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java @@ -312,6 +312,12 @@ public class ConfigurationServiceImpl extends FaxToMailServiceSupport implements currentMailFolder.setCompany(parent.getCompany()); } + // set the reading rights on all the children for the search to be easier + if (parent != null) { + currentMailFolder.addAllReadRightUsers(parent.getReadRightUsers()); + currentMailFolder.addAllReadRightGroups(parent.getReadRightGroups()); + } + if (!currentMailFolder.isPersisted()) { currentMailFolder = dao.create(currentMailFolder); } diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java index a4b418a..300aad0 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java @@ -943,37 +943,10 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe } } - /** - * Calcule recursivement l'ensemble des répertoires lisible par un utilisateur récursivement. - * - * @param readMailFolders result mail folders - * @param mailFolders mail folder to allow - */ - protected void computeUserReadableFolder(Set<MailFolder> readMailFolders, Iterable<MailFolder> mailFolders) { - if (mailFolders != null) { - for (MailFolder mailFolder : mailFolders) { - readMailFolders.add(mailFolder); - computeUserReadableFolder(readMailFolders, mailFolder.getChildren()); - } - } - } - @Override public PaginationResult<Email> search(SearchFilter emailFilter, FaxToMailUser user, PaginationParameter pagination) { - // compute rigths - MailFolderTopiaDao mailFolderDao = getPersistenceContext().getMailFolderDao(); - Set<MailFolder> readMailFolders = new HashSet<MailFolder>(); - // read rights for user - Iterable<MailFolder> mailFolders = mailFolderDao.forReadRightUsersContains(user).findAll(); - computeUserReadableFolder(readMailFolders, mailFolders); - // read rigths for groups - if (user.getUserGroups() != null) { - for (FaxToMailUserGroup group : user.getUserGroups()) { - mailFolders = mailFolderDao.forReadRightGroupsContains(group).findAll(); - computeUserReadableFolder(readMailFolders, mailFolders); - } - } + Set<MailFolder> readMailFolders = getMailFolderService().getAllMailFoldersWithReadingRights(user); // compute search EmailTopiaDao emailDao = getPersistenceContext().getEmailDao(); @@ -989,31 +962,11 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe MailFolderTopiaDao mailFolderDao = getPersistenceContext().getMailFolderDao(); Collection<MailFolder> companyFolders = mailFolderDao.forCompanyEquals(company).findAll(); Set<MailFolder> archiveFolders = new HashSet<>(companyFolders); -// for (MailFolder folder : companyFolders) { -// Collection<MailFolder> children = folder.getChildren(); -// if (children != null) { -// for (MailFolder child : children) { -// findCompanyFoldersChildren(child, archiveFolders); -// } -// } -// } EmailTopiaDao emailDao = getPersistenceContext().getEmailDao(); return emailDao.findArchivedEmails(commandQuotationNumber, archiveFolders); } - protected void findCompanyFoldersChildren(MailFolder folder, Set<MailFolder> archiveFolders) { - if (!folder.isUseCurrentLevelCompany()) { - archiveFolders.add(folder); - Collection<MailFolder> children = folder.getChildren(); - if (children != null) { - for (MailFolder child : children) { - findCompanyFoldersChildren(child, archiveFolders); - } - } - } - } - @Override public Email groupEmails(String email1Id, String email2Id, FaxToMailUser user) { EmailGroupTopiaDao groupDao = getPersistenceContext().getEmailGroupDao(); diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java index 94d126c..69789fe 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderService.java @@ -53,6 +53,8 @@ public interface MailFolderService extends FaxToMailService { List<MailFolder> getRootMailFoldersWithReadingRights(FaxToMailUser user); + Set<MailFolder> getAllMailFoldersWithReadingRights(FaxToMailUser user); + List<MailFolder> getRootMailFoldersWithMoveRights(FaxToMailUser user); List<MailFolder> getMailFolders(Collection<String> ids); diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java index c00ed91..1ace3ec 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/MailFolderServiceImpl.java @@ -88,7 +88,7 @@ public class MailFolderServiceImpl extends FaxToMailServiceSupport implements Ma @Override public List<MailFolder> getAllMailFolders() { MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao(); - return new ArrayList<MailFolder>(dao.findAll()); + return new ArrayList<>(dao.findAll()); } @Override @@ -129,13 +129,19 @@ public class MailFolderServiceImpl extends FaxToMailServiceSupport implements Ma } if (folder != null) { - browseReadableFolders(folder, result, user, false); + browseReadableFolders(folder, user, false); } } return result; } - protected void browseReadableFolders(MailFolder folder, List<MailFolder> readableRoots, FaxToMailUser user, boolean writable) { + @Override + public Set<MailFolder> getAllMailFoldersWithReadingRights(FaxToMailUser user) { + MailFolderTopiaDao dao = getPersistenceContext().getMailFolderDao(); + return new HashSet<>(dao.getReadableFolders(user)); + } + + protected void browseReadableFolders(MailFolder folder, FaxToMailUser user, boolean writable) { folder.setFolderReadable(true); if (!writable && folder.sizeWriteRightGroups() > 0) { @@ -148,7 +154,7 @@ public class MailFolderServiceImpl extends FaxToMailServiceSupport implements Ma if (folder.isChildrenNotEmpty()) { for (MailFolder child : folder.getChildren()) { - browseReadableFolders(child, readableRoots, user, writable); + browseReadableFolders(child, user, writable); } } @@ -353,5 +359,4 @@ public class MailFolderServiceImpl extends FaxToMailServiceSupport implements Ma return filter; } - } diff --git a/faxtomail-ui-web/src/main/webapp/js/configuration.js b/faxtomail-ui-web/src/main/webapp/js/configuration.js index c3804b4..ed5cadc 100644 --- a/faxtomail-ui-web/src/main/webapp/js/configuration.js +++ b/faxtomail-ui-web/src/main/webapp/js/configuration.js @@ -91,6 +91,21 @@ ConfigurationModule.controller('ConfigurationController', ['$scope', 'Configurat // et on modifie encore (tant qu'on a commencé !!!) mailFolder.$cumulativeCount = folderCount; cumulativeCount += folderCount; + + // et on supprime les droits de lecture qui sont déjà dans les parents + angular.forEach(mailFolder.readRightUsers, function(user) { + if (parent.readRightUsers.containsByTopiaId(user)) { + var index = mailFolder.readRightUsers.indexOfByTopiaId(user); + mailFolder.readRightUsers.splice(index, 1); + } + }); + + angular.forEach(mailFolder.readRightGroups, function(group) { + if (parent.readRightGroups.containsByTopiaId(group)) { + var index = mailFolder.readRightGroups.indexOfByTopiaId(group); + mailFolder.readRightGroups.splice(index, 1); + } + }); }); } return cumulativeCount; diff --git a/trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js b/trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js index c3804b4..4963044 100644 --- a/trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js +++ b/trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js @@ -720,7 +720,7 @@ ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$windo $scope.parentScopeValues.ranges = folder.ranges; } - // move to parent first to keed parent order for collection + // move to parent first to keep parent order for collection if (folder.$parent) { updateParentScopeValues(folder.$parent); }; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm