diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificatePageController.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificatePageController.java index 7e71de79..0cf5c1ec 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificatePageController.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificatePageController.java @@ -235,18 +235,14 @@ public class CertificatePageController extends PageController { // Add the EndorsementCredential for each PlatformCredential based on the // serial number. (pc.HolderSerialNumber = ec.SerialNumber) if (certificateType.equals(PLATFORMCREDENTIAL)) { -// records = OrderedListQueryDataTableAdapter.getOrderedList( -// getCertificateClass(certificateType), platformCertificateRepository, -// input, orderColumnName, criteriaModifier); FilteredRecordsList records = new FilteredRecordsList<>(); org.springframework.data.domain.Page pagedResult = this.platformCertificateRepository.findAll(paging); if (pagedResult.hasContent()) { records.addAll(pagedResult.getContent()); - itemCount = records.size(); } - records.setRecordsTotal(platformCertificateRepository.count()); - records.setRecordsFiltered(itemCount); + records.setRecordsTotal(input.getLength()); + records.setRecordsFiltered(platformCertificateRepository.count()); EndorsementCredential associatedEC; if (!records.isEmpty()) { @@ -269,34 +265,26 @@ public class CertificatePageController extends PageController { log.debug("Returning list of size: " + records.size()); return new DataTableResponse<>(records, input); } else if (certificateType.equals(ENDORSEMENTCREDENTIAL)) { -// records = OrderedListQueryDataTableAdapter.getOrderedList( -// getCertificateClass(certificateType), endorsementCredentialRepository, -// input, orderColumnName, criteriaModifier); FilteredRecordsList records = new FilteredRecordsList<>(); org.springframework.data.domain.Page pagedResult = this.endorsementCredentialRepository.findAll(paging); if (pagedResult.hasContent()) { records.addAll(pagedResult.getContent()); - itemCount = records.size(); } - records.setRecordsTotal(endorsementCredentialRepository.count()); - records.setRecordsFiltered(itemCount); + records.setRecordsTotal(input.getLength()); + records.setRecordsFiltered(endorsementCredentialRepository.count()); log.debug("Returning list of size: " + records.size()); return new DataTableResponse<>(records, input); } else if (certificateType.equals(TRUSTCHAIN)) { -// records = OrderedListQueryDataTableAdapter.getOrderedList( -// getCertificateClass(certificateType), caCredentialRepository, -// input, orderColumnName, criteriaModifier); FilteredRecordsList records = new FilteredRecordsList<>(); org.springframework.data.domain.Page pagedResult = this.caCredentialRepository.findAll(paging); if (pagedResult.hasContent()) { records.addAll(pagedResult.getContent()); - itemCount = records.size(); } - records.setRecordsTotal(caCredentialRepository.count()); - records.setRecordsFiltered(itemCount); + records.setRecordsTotal(input.getLength()); + records.setRecordsFiltered(caCredentialRepository.count()); log.debug("Returning list of size: " + records.size()); return new DataTableResponse<>(records, input); @@ -305,10 +293,9 @@ public class CertificatePageController extends PageController { org.springframework.data.domain.Page pagedResult = this.issuedCertificateRepository.findAll(paging); if (pagedResult.hasContent()) { records.addAll(pagedResult.getContent()); - itemCount = records.size(); } - records.setRecordsTotal(issuedCertificateRepository.count()); - records.setRecordsFiltered(itemCount); + records.setRecordsTotal(input.getLength()); + records.setRecordsFiltered(issuedCertificateRepository.count()); log.debug("Returning list of size: " + records.size()); return new DataTableResponse<>(records, input);