Bug 489318 - TPS "List Activites" - does not list activities after 20 entries??
TPS "List Activites" - does not list activities after 20 entries??
Status: CLOSED ERRATA
Product: Dogtag Certificate System
Classification: Community
Component: TPS (Show other bugs)
unspecified
All Linux
urgent Severity medium
: ---
: ---
Assigned To: Ade Lee
Chandrasekar Kannan
:
Depends On:
Blocks: 443788
  Show dependency treegraph
 
Reported: 2009-03-09 09:48 EDT by Kashyap Chamarthy
Modified: 2015-01-04 18:37 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-07-22 19:32:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to fix (21.56 KB, patch)
2009-03-17 21:37 EDT, Ade Lee
no flags Details | Diff
patch to fix2 (5.93 KB, patch)
2009-06-12 12:28 EDT, Ade Lee
no flags Details | Diff

  None (edit)
Description Kashyap Chamarthy 2009-03-09 09:48:39 EDT
Description of problem:

In the TPS "List Activities"(for any of the Admin, Agent and operators), more than 20 activities are not listed.

After 20 entries, when I add a user,  the new action(the now newly added uer) does not show up under the "Activites List" . But the "Total" counter at the bottom increases.


  
Actual results:

Newly added activities after 20 entries does not show up. But the "Total" counter increases.

Expected results:

Activites after 20 entries should be listed.

Additional info:

Logs does not reveal much.

Please let me know if more information is required.
Comment 1 Ade Lee 2009-03-17 21:37:47 EDT
Created attachment 335625 [details]
patch to fix

Fix this simply as follows:

1.  Allow to return a maximum of 100 results for a non-search return (instead of 20).
2.  Add pagination (25 entries per page)
3.  Return the latest 100 activity logs (now in reverse order) for non-search.

cfu, please review.
Comment 2 Andrew Wnuk 2009-03-20 17:15:19 EDT
attachment (id=335625) +awnuk   (under assumption "doCancel()" is removed)
Comment 3 Ade Lee 2009-03-20 17:37:03 EDT
[builder@dhcp231-124 tps-ui]$ svn ci -m "Bugzilla 489318 TPS does not list more than 20 activities" 
Sending        tps-ui/dogtag-pki-tps-ui.spec
Sending        tps-ui/shared/docroot/tokendb/editUser.template
Sending        tps-ui/shared/docroot/tokendb/searchActivityAdminResults.template
Sending        tps-ui/shared/docroot/tokendb/searchActivityResults.template
Sending        tps-ui/shared/docroot/tokendb/searchAdminResults.template
Sending        tps-ui/shared/docroot/tokendb/searchCertificateResults.template
Sending        tps-ui/shared/docroot/tokendb/searchResults.template
Sending        tps-ui/shared/docroot/tokendb/searchUserResults.template
Transmitting file data ........
Committed revision 314.

[builder@dhcp231-124 tps]$ svn ci -m "Bugzilla 489318 TPS does not list more than 20 activities" pki-tps.spec ../../base/tps/
Sending        base/tps/src/modules/tokendb/mod_tokendb.cpp
Sending        dogtag/tps/pki-tps.spec
Transmitting file data ..
Committed revision 315.
Comment 5 Chandrasekar Kannan 2009-06-07 08:43:02 EDT
I was doing some searches. 

- main menu - agent operations - search activities
- max count : 200

- 1st page returned: 200 of 504 ( I guess I have 504 total activities as max)
- 2nd page returned: 200 of 504.
..
..
..
- 6th page(last page shown )returned: 164 of 504. The number reported
  seems bogus to me.
Comment 6 Ade Lee 2009-06-12 12:28:58 EDT
Created attachment 347606 [details]
patch to fix2

patch to finally fix pagination.

In the past, there was no pagination and so the size of the buffer injection was set by a heuristic as follows:

After the first entry is added to the injection - determine the size of the injection and multiply that by the total number of entries (up to a maximum size)
So, if the total number of entries was 10 000, then the size of the buffer would be roughly 10 000 * sizeof(one entry + header)

We now have pagination - so we do not return all the entries at once.  So the above algorithm makes no sense.  Instead, we check after each entry and grow the buffer (up to a maximum size) as needed.

Before, the variable "limited" made sense because the number of entries returned was limited by the largest buffer size.  If there were 10000 entries, but the max buffer size only allowed the display of 2000 entries, then we needed to say "2000 of 10000" entries.  The downside of course was that it was not possible to find  the remaining entries..

With pagination, this is no longer a limitation.  The number of entries per page is limited to 25 - so we can display all of them - albeit in little batches at a time.  "limited" now refers to the size of maxReturns as defined by the user.  ie. if I do a search on certificates, and the search returns 100 certs and I have designated a maxReturn of 50 , then it will say 50 of 100.
Obviously, if the number of max returns is less than the number of search results -- it will just list the number of search results.
 
This does not work for searches on tokens, where maxReturns is used to limit the size of the search results returned. Thats probably the right thing to do for other searches -- but I'm not going to touch that now.

awnuk, please review
Comment 7 Andrew Wnuk 2009-06-12 15:34:01 EDT
attachment (id=347606) +awnuk

It would even nicer to have an option to enter page size from UI.
CA is already handling page size this way.
Comment 8 Ade Lee 2009-06-12 15:51:44 EDT
Will add UI option in later bug.

[builder@dhcp231-124 pki]$ svn ci -m "Bugzilla Bug #489318 - TPS List Activites - does not list activities after 20 entries - fix pagination" 
Sending        base/tps/src/modules/tokendb/mod_tokendb.cpp
Sending        dogtag/tps/pki-tps.spec
Transmitting file data ..
Committed revision 586.
Comment 9 Jenny Galipeau 2009-07-02 12:55:39 EDT
Verified:

Listing activities max is 100 and displays 25 per page

Searching activies with 516 activities:

max 100 - displays 100 - 25 per page - 100 of 516 displayed at bottom of each page
max 525 - displays all - 25 per page - last page displays last 16 - Total:516 displayed at bottom of each page

Note You need to log in before you can comment on or make changes to this bug.