From c6fc3d9353f202d74b8a603dc0f983e46070de3e Mon Sep 17 00:00:00 2001 From: sathish2379 Date: Fri, 24 May 2024 12:30:32 -0700 Subject: [PATCH 1/5] [CITE-185] added a new mapping for list filtered by source and added new attribute to the model for importedauthoritiessources --- citesphere/pom.xml | 2 +- .../core/service/IAuthorityService.java | 2 ++ .../core/service/impl/AuthorityService.java | 5 +++ .../authorities/AuthorityListController.java | 36 ++++++++++++++++--- .../WEB-INF/views/auth/authorities/list.html | 23 ++++++++---- .../service/impl/AuthorityServiceTest.java | 24 +++++++++++++ 6 files changed, 80 insertions(+), 12 deletions(-) diff --git a/citesphere/pom.xml b/citesphere/pom.xml index fdfb5f8fb..7ff0ca215 100644 --- a/citesphere/pom.xml +++ b/citesphere/pom.xml @@ -25,7 +25,7 @@ 2.2.6.RELEASE 0.12 0.4 - 1.19 + 1.21 $2a$04$oQo44vqcDIFRoYKiAXoNheurzkwX9dcNmowvTX/hsWuBMwijqn44i diff --git a/citesphere/src/main/java/edu/asu/diging/citesphere/core/service/IAuthorityService.java b/citesphere/src/main/java/edu/asu/diging/citesphere/core/service/IAuthorityService.java index 0dd6b9242..444a592ae 100644 --- a/citesphere/src/main/java/edu/asu/diging/citesphere/core/service/IAuthorityService.java +++ b/citesphere/src/main/java/edu/asu/diging/citesphere/core/service/IAuthorityService.java @@ -129,4 +129,6 @@ AuthoritySearchResult searchAuthorityEntries(IUser user, String firstName, Strin Page getAuthoritiesByGroup(long groupId, int page, int pageSize); Page getUserSpecificAuthorities(IUser user, int page, int pageSize); + + List getAuthoritiesBySource(IUser user, String source); } \ No newline at end of file diff --git a/citesphere/src/main/java/edu/asu/diging/citesphere/core/service/impl/AuthorityService.java b/citesphere/src/main/java/edu/asu/diging/citesphere/core/service/impl/AuthorityService.java index 108a3833b..d91c60e9d 100644 --- a/citesphere/src/main/java/edu/asu/diging/citesphere/core/service/impl/AuthorityService.java +++ b/citesphere/src/main/java/edu/asu/diging/citesphere/core/service/impl/AuthorityService.java @@ -303,6 +303,11 @@ public Page getAuthoritiesByGroup(long groupId, int page, int p return entryRepository.findByGroupsOrderByName(groupId, pageable); } + @Override + public List getAuthoritiesBySource(IUser user, String source) { + return entryRepository.findByUsernameAndImporterIdOrderByName(user.getUsername(), source); + } + @Override public Page getUserSpecificAuthorities(IUser user, int page, int pageSize) { Pageable pageable = PageRequest.of(page, pageSize); diff --git a/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java b/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java index 185772d8c..6afe3eaea 100644 --- a/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java +++ b/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java @@ -50,6 +50,8 @@ public String list(Model model, Authentication authentication, Page authoritiesPage = authorityService.getAll(user, userGroups.stream().map(group -> group.getGroupId()).collect(Collectors.toList()),pageInt, authorityPageSize); List authorities = authoritiesPage.getContent(); + model.addAttribute("importedAuthoritySources", authorities.stream() + .map(authorityEntry -> authorityEntry.getImporterId()).distinct().collect(Collectors.toList())); model.addAttribute("authorities", authorities); model.addAttribute("groups", userGroups); model.addAttribute("displayBy", "all"); @@ -73,8 +75,12 @@ public String getAuthoritiesForGroup(Model model, Authentication authentication, pageInt = (pageInt - 1) < 0 ? 0 : pageInt - 1; IUser user = (IUser)authentication.getPrincipal(); Page authoritiesPage = authorityService.getAuthoritiesByGroup(Long.valueOf(zoteroGroupId), pageInt, authorityPageSize); - model.addAttribute("authorities", authoritiesPage.getContent()); - model.addAttribute("groups", citationManager.getGroups((IUser)authentication.getPrincipal())); + List authorities = authoritiesPage.getContent(); + + model.addAttribute("importedAuthoritySources", authorities.stream() + .map(authorityEntry -> authorityEntry.getImporterId()).distinct().collect(Collectors.toList())); + model.addAttribute("authorities", authorities); + model.addAttribute("groups", citationManager.getGroups(user)); model.addAttribute("displayBy", zoteroGroupId); model.addAttribute("username", user.getUsername()); model.addAttribute("total", authoritiesPage.getTotalElements()); @@ -95,8 +101,12 @@ public String getAuthoritiesForUser(Model model, Authentication authentication, pageInt = (pageInt - 1) < 0 ? 0 : pageInt - 1; IUser user = (IUser)authentication.getPrincipal(); Page authoritiesPage = authorityService.getUserSpecificAuthorities(user, pageInt, authorityPageSize); - model.addAttribute("authorities", authoritiesPage.getContent()); - model.addAttribute("groups", citationManager.getGroups((IUser)authentication.getPrincipal())); + List authorities = authoritiesPage.getContent(); + + model.addAttribute("importedAuthoritySources", authorities.stream() + .map(authorityEntry -> authorityEntry.getImporterId()).distinct().collect(Collectors.toList())); + model.addAttribute("authorities", authorities); + model.addAttribute("groups", citationManager.getGroups(user)); model.addAttribute("displayBy", "userSpecific"); model.addAttribute("username", user.getUsername()); model.addAttribute("total", authoritiesPage.getTotalElements()); @@ -104,4 +114,22 @@ public String getAuthoritiesForUser(Model model, Authentication authentication, model.addAttribute("currentPage", page); return "auth/authorities/list"; } + + @RequestMapping("/auth/authority/list/{source}") + public String getAuthoritiesForSource(Model model, Authentication authentication, + @PathVariable("source") String source) { + System.out.println(source); + IUser user = (IUser) authentication.getPrincipal(); + List userGroups = citationManager.getGroups(user); + List authorities = authorityService.getAll(user, + userGroups.stream().map(group -> group.getGroupId()).collect(Collectors.toList())); + model.addAttribute("importedAuthoritySources", authorities.stream() + .map(authorityEntry -> authorityEntry.getImporterId()).distinct().collect(Collectors.toList())); + model.addAttribute("authorities", + authorityService.getAuthoritiesBySource(user, source.equals("null") ? null : source)); + model.addAttribute("groups", userGroups); + model.addAttribute("displayBy", "source-" + source); + model.addAttribute("username", user.getUsername()); + return "auth/authorities/list"; + } } diff --git a/citesphere/src/main/webapp/WEB-INF/views/auth/authorities/list.html b/citesphere/src/main/webapp/WEB-INF/views/auth/authorities/list.html index d5bcd3a9f..d91ce1f7f 100644 --- a/citesphere/src/main/webapp/WEB-INF/views/auth/authorities/list.html +++ b/citesphere/src/main/webapp/WEB-INF/views/auth/authorities/list.html @@ -65,18 +65,24 @@ $("#displayAuthorities").change(function () { var displayAuthoritiesVal = $("#displayAuthorities").val(); + console.log(displayAuthoritiesVal); window.location.href = getAuthorityUrl(displayAuthoritiesVal); }); }); function getAuthorityUrl(displayAuthoritiesVal) { - if (displayAuthoritiesVal === 'all') { - return [[@{/auth/authority/list}]]; - } else if (displayAuthoritiesVal === 'userSpecific') { - return [[@{/auth/authority/user/list}]]; - } else { + if (displayAuthoritiesVal === 'all') { + return [[@{/auth/authority/list}]]; + } else if (displayAuthoritiesVal === 'userSpecific') { + return [[@{/auth/authority/user/list}]]; + } else if (displayAuthoritiesVal.startsWith('source')) { + var source = displayAuthoritiesVal.split("-")[1]; + console.log(source); + window.location.href = [[@{/auth/authority/list/}]] + source; + } else { + console.log("coming here"); return [[@{/auth/authority/}]] + displayAuthoritiesVal + "/list"; - } + } } @@ -95,7 +101,10 @@

Managed Authority Entries

- + + + +

    diff --git a/citesphere/src/test/java/edu/asu/diging/citesphere/core/service/impl/AuthorityServiceTest.java b/citesphere/src/test/java/edu/asu/diging/citesphere/core/service/impl/AuthorityServiceTest.java index dc42096b5..c54f4e8eb 100644 --- a/citesphere/src/test/java/edu/asu/diging/citesphere/core/service/impl/AuthorityServiceTest.java +++ b/citesphere/src/test/java/edu/asu/diging/citesphere/core/service/impl/AuthorityServiceTest.java @@ -651,4 +651,28 @@ public void test_getUserSpecificAuthorities_emptyResult() { Page searchResult = managerToTest.getUserSpecificAuthorities(user, page, pageSize); Assert.assertTrue(searchResult.isEmpty()); } + + @Test + public void test_getAuthoritiesBySource() { + String source = "testsource"; + List expectedEntries = new ArrayList<>(); + expectedEntries.add(entry1); + expectedEntries.add(entry2); + Mockito.when(entryRepository.findByUsernameAndImporterIdOrderByName(user.getUsername(), source)) + .thenReturn(expectedEntries); + + List actualEntries = managerToTest.getAuthoritiesBySource(user, source); + Assert.assertEquals(expectedEntries, actualEntries); + } + + @Test + public void test_getAuthoritiesBySource_noEntriesFound() { + String source = "testsource"; + List expectedEntries = new ArrayList<>(); + Mockito.when(entryRepository.findByUsernameAndImporterIdOrderByName(user.getUsername(), source)) + .thenReturn(expectedEntries); + + List actualEntries = managerToTest.getAuthoritiesBySource(user, source); + Assert.assertEquals(expectedEntries, actualEntries); + } } From d5dd8295c5bec1248c15ac3d98c0be84554eb3ff Mon Sep 17 00:00:00 2001 From: PradnyaC11 Date: Thu, 3 Apr 2025 12:10:03 -0700 Subject: [PATCH 2/5] [CITE-185] Added importer name for IsisCB in config --- citesphere/src/main/resources/config.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/citesphere/src/main/resources/config.properties b/citesphere/src/main/resources/config.properties index 4ddd8c306..f43cb9785 100644 --- a/citesphere/src/main/resources/config.properties +++ b/citesphere/src/main/resources/config.properties @@ -51,6 +51,7 @@ _conceptpower_url=https://chps.asu.edu/conceptpower/rest/ # Importer Names _importer_name_authority.importer.viaf=VIAF _importer_name_authority.importer.conceptpower=Conceptpower +_importer_name_authority.importer.isiscb=IsisCB _creation_default_item_type=JOURNAL_ARTICLE _available_item_columns=version,publicationTitle,volume,issue,pages,series,seriesTitle,abstractNote,dateAdded From 607768cd281aa27d6d988e18d78312b43e57a892 Mon Sep 17 00:00:00 2001 From: PradnyaC11 Date: Fri, 4 Apr 2025 16:34:56 -0700 Subject: [PATCH 3/5] [CITE-185] Updated viaf record mapping --- .../citesphere/core/authority/impl/ViafRecordData.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/ViafRecordData.java b/citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/ViafRecordData.java index d7183aff8..c37b04ba0 100644 --- a/citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/ViafRecordData.java +++ b/citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/ViafRecordData.java @@ -15,9 +15,11 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ViafRecordData { + @JsonProperty("ns3:nameType") private String nameType; + @JsonProperty("ns3:mainHeadings") private MainHeadings mainHeadings; - @JsonProperty("Document") + @JsonProperty("ns3:Document") private Map document; public String getNameType() { @@ -47,6 +49,7 @@ public void setDocument(Map document) { static public class MainHeadings { @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY) + @JsonProperty("ns3:data") private List data; public List getData() { @@ -59,6 +62,7 @@ public void setData(List data) { } static public class Data { + @JsonProperty("ns3:text") private String text; public String getText() { From a6f98c846376b14b304f24a48d84b67a68107d68 Mon Sep 17 00:00:00 2001 From: PradnyaC11 Date: Tue, 8 Apr 2025 16:39:04 -0700 Subject: [PATCH 4/5] [CITE-185] Fixed errors with authority source filter and reverted viaf changes --- .../core/authority/impl/ViafRecordData.java | 6 +----- .../authorities/AuthorityListController.java | 17 ++++++++++++++--- .../WEB-INF/views/auth/authorities/list.html | 7 ++----- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/ViafRecordData.java b/citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/ViafRecordData.java index c37b04ba0..d7183aff8 100644 --- a/citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/ViafRecordData.java +++ b/citesphere/src/main/java/edu/asu/diging/citesphere/core/authority/impl/ViafRecordData.java @@ -15,11 +15,9 @@ @JsonIgnoreProperties(ignoreUnknown=true) public class ViafRecordData { - @JsonProperty("ns3:nameType") private String nameType; - @JsonProperty("ns3:mainHeadings") private MainHeadings mainHeadings; - @JsonProperty("ns3:Document") + @JsonProperty("Document") private Map document; public String getNameType() { @@ -49,7 +47,6 @@ public void setDocument(Map document) { static public class MainHeadings { @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY) - @JsonProperty("ns3:data") private List data; public List getData() { @@ -62,7 +59,6 @@ public void setData(List data) { } static public class Data { - @JsonProperty("ns3:text") private String text; public String getText() { diff --git a/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java b/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java index 6afe3eaea..3bded4d6a 100644 --- a/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java +++ b/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java @@ -117,12 +117,20 @@ public String getAuthoritiesForUser(Model model, Authentication authentication, @RequestMapping("/auth/authority/list/{source}") public String getAuthoritiesForSource(Model model, Authentication authentication, - @PathVariable("source") String source) { + @PathVariable("source") String source, @RequestParam(defaultValue = "1", required = false, value = "page") String page) { System.out.println(source); + Integer pageInt = 1; + try { + pageInt = new Integer(page); + } catch (NumberFormatException ex) { + logger.error("Trying to access invalid page number: ", ex); + } + pageInt = (pageInt - 1) < 0 ? 0 : pageInt - 1; IUser user = (IUser) authentication.getPrincipal(); List userGroups = citationManager.getGroups(user); - List authorities = authorityService.getAll(user, - userGroups.stream().map(group -> group.getGroupId()).collect(Collectors.toList())); + Page authoritiesPage = authorityService.getAll(user, + userGroups.stream().map(group -> group.getGroupId()).collect(Collectors.toList()),pageInt, authorityPageSize); + List authorities = authoritiesPage.getContent(); model.addAttribute("importedAuthoritySources", authorities.stream() .map(authorityEntry -> authorityEntry.getImporterId()).distinct().collect(Collectors.toList())); model.addAttribute("authorities", @@ -130,6 +138,9 @@ public String getAuthoritiesForSource(Model model, Authentication authentication model.addAttribute("groups", userGroups); model.addAttribute("displayBy", "source-" + source); model.addAttribute("username", user.getUsername()); + model.addAttribute("total", authoritiesPage.getTotalElements()); + model.addAttribute("totalPages", authoritiesPage.getTotalPages() > 0 ? authoritiesPage.getTotalPages() : 1); + model.addAttribute("currentPage", page); return "auth/authorities/list"; } } diff --git a/citesphere/src/main/webapp/WEB-INF/views/auth/authorities/list.html b/citesphere/src/main/webapp/WEB-INF/views/auth/authorities/list.html index d91ce1f7f..dc6df0d73 100644 --- a/citesphere/src/main/webapp/WEB-INF/views/auth/authorities/list.html +++ b/citesphere/src/main/webapp/WEB-INF/views/auth/authorities/list.html @@ -65,7 +65,6 @@ $("#displayAuthorities").change(function () { var displayAuthoritiesVal = $("#displayAuthorities").val(); - console.log(displayAuthoritiesVal); window.location.href = getAuthorityUrl(displayAuthoritiesVal); }); }); @@ -77,10 +76,8 @@ return [[@{/auth/authority/user/list}]]; } else if (displayAuthoritiesVal.startsWith('source')) { var source = displayAuthoritiesVal.split("-")[1]; - console.log(source); - window.location.href = [[@{/auth/authority/list/}]] + source; + return [[@{/auth/authority/list/}]] + source; } else { - console.log("coming here"); return [[@{/auth/authority/}]] + displayAuthoritiesVal + "/list"; } } @@ -103,7 +100,7 @@

    Managed Authority Entries

    - +

    From 0f875d7e626d56009a5332bcb01fc519c641976a Mon Sep 17 00:00:00 2001 From: Rajvi Patel Date: Wed, 19 Nov 2025 08:51:52 -0700 Subject: [PATCH 5/5] [CITE-185] Address review comments --- .../authorities/AuthorityListController.java | 66 ++++++++++++++----- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java b/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java index 3bded4d6a..5cdb9de77 100644 --- a/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java +++ b/citesphere/src/main/java/edu/asu/diging/citesphere/web/user/authorities/AuthorityListController.java @@ -45,20 +45,29 @@ public String list(Model model, Authentication authentication, logger.error("Trying to access invalid page number: ", ex); } pageInt = (pageInt - 1) < 0 ? 0 : pageInt - 1; + IUser user = (IUser)authentication.getPrincipal(); List userGroups = citationManager.getGroups((IUser) authentication.getPrincipal()); - Page authoritiesPage = authorityService.getAll(user, - userGroups.stream().map(group -> group.getGroupId()).collect(Collectors.toList()),pageInt, authorityPageSize); + Page authoritiesPage = authorityService.getAll( + user, + userGroups.stream().map(group -> group.getGroupId()).collect(Collectors.toList()), + pageInt, + authorityPageSize); List authorities = authoritiesPage.getContent(); + model.addAttribute("importedAuthoritySources", authorities.stream() - .map(authorityEntry -> authorityEntry.getImporterId()).distinct().collect(Collectors.toList())); + .map(authorityEntry -> authorityEntry.getImporterId()) + .distinct() + .collect(Collectors.toList())); model.addAttribute("authorities", authorities); model.addAttribute("groups", userGroups); model.addAttribute("displayBy", "all"); model.addAttribute("username", user.getUsername()); model.addAttribute("total", authoritiesPage.getTotalElements()); - model.addAttribute("totalPages", authoritiesPage.getTotalPages() > 0 ? authoritiesPage.getTotalPages() : 1); + model.addAttribute("totalPages", + authoritiesPage.getTotalPages() > 0 ? authoritiesPage.getTotalPages() : 1); model.addAttribute("currentPage", page); + return "auth/authorities/list"; } @@ -73,18 +82,25 @@ public String getAuthoritiesForGroup(Model model, Authentication authentication, logger.error("Trying to access invalid page number: ", ex); } pageInt = (pageInt - 1) < 0 ? 0 : pageInt - 1; + IUser user = (IUser)authentication.getPrincipal(); - Page authoritiesPage = authorityService.getAuthoritiesByGroup(Long.valueOf(zoteroGroupId), pageInt, authorityPageSize); + Page authoritiesPage = authorityService.getAuthoritiesByGroup( + Long.valueOf(zoteroGroupId), + pageInt, + authorityPageSize); List authorities = authoritiesPage.getContent(); model.addAttribute("importedAuthoritySources", authorities.stream() - .map(authorityEntry -> authorityEntry.getImporterId()).distinct().collect(Collectors.toList())); + .map(authorityEntry -> authorityEntry.getImporterId()) + .distinct() + .collect(Collectors.toList())); model.addAttribute("authorities", authorities); model.addAttribute("groups", citationManager.getGroups(user)); model.addAttribute("displayBy", zoteroGroupId); model.addAttribute("username", user.getUsername()); model.addAttribute("total", authoritiesPage.getTotalElements()); - model.addAttribute("totalPages", authoritiesPage.getTotalPages() > 0 ? authoritiesPage.getTotalPages() : 1); + model.addAttribute("totalPages", + authoritiesPage.getTotalPages() > 0 ? authoritiesPage.getTotalPages() : 1); model.addAttribute("currentPage", page); return "auth/authorities/list"; } @@ -99,26 +115,34 @@ public String getAuthoritiesForUser(Model model, Authentication authentication, logger.error("Trying to access invalid page number: ", ex); } pageInt = (pageInt - 1) < 0 ? 0 : pageInt - 1; + IUser user = (IUser)authentication.getPrincipal(); - Page authoritiesPage = authorityService.getUserSpecificAuthorities(user, pageInt, authorityPageSize); + Page authoritiesPage = authorityService.getUserSpecificAuthorities( + user, + pageInt, + authorityPageSize); List authorities = authoritiesPage.getContent(); model.addAttribute("importedAuthoritySources", authorities.stream() - .map(authorityEntry -> authorityEntry.getImporterId()).distinct().collect(Collectors.toList())); + .map(authorityEntry -> authorityEntry.getImporterId()) + .distinct() + .collect(Collectors.toList())); model.addAttribute("authorities", authorities); model.addAttribute("groups", citationManager.getGroups(user)); model.addAttribute("displayBy", "userSpecific"); model.addAttribute("username", user.getUsername()); + model.addAttribute("total", authoritiesPage.getTotalElements()); - model.addAttribute("totalPages", authoritiesPage.getTotalPages() > 0 ? authoritiesPage.getTotalPages() : 1); + model.addAttribute("totalPages", + authoritiesPage.getTotalPages() > 0 ? authoritiesPage.getTotalPages() : 1); model.addAttribute("currentPage", page); + return "auth/authorities/list"; } @RequestMapping("/auth/authority/list/{source}") public String getAuthoritiesForSource(Model model, Authentication authentication, @PathVariable("source") String source, @RequestParam(defaultValue = "1", required = false, value = "page") String page) { - System.out.println(source); Integer pageInt = 1; try { pageInt = new Integer(page); @@ -126,21 +150,31 @@ public String getAuthoritiesForSource(Model model, Authentication authentication logger.error("Trying to access invalid page number: ", ex); } pageInt = (pageInt - 1) < 0 ? 0 : pageInt - 1; - IUser user = (IUser) authentication.getPrincipal(); + + IUser user = (IUser) authentication.getPrincipal(); List userGroups = citationManager.getGroups(user); - Page authoritiesPage = authorityService.getAll(user, - userGroups.stream().map(group -> group.getGroupId()).collect(Collectors.toList()),pageInt, authorityPageSize); + Page authoritiesPage = authorityService.getAll( + user, + userGroups.stream().map(group -> group.getGroupId()).collect(Collectors.toList()), + pageInt, + authorityPageSize); List authorities = authoritiesPage.getContent(); + model.addAttribute("importedAuthoritySources", authorities.stream() - .map(authorityEntry -> authorityEntry.getImporterId()).distinct().collect(Collectors.toList())); + .map(authorityEntry -> authorityEntry.getImporterId()) + .distinct() + .collect(Collectors.toList())); model.addAttribute("authorities", authorityService.getAuthoritiesBySource(user, source.equals("null") ? null : source)); model.addAttribute("groups", userGroups); model.addAttribute("displayBy", "source-" + source); model.addAttribute("username", user.getUsername()); + model.addAttribute("total", authoritiesPage.getTotalElements()); - model.addAttribute("totalPages", authoritiesPage.getTotalPages() > 0 ? authoritiesPage.getTotalPages() : 1); + model.addAttribute("totalPages", + authoritiesPage.getTotalPages() > 0 ? authoritiesPage.getTotalPages() : 1); model.addAttribute("currentPage", page); + return "auth/authorities/list"; } }