We have a requirement to implement a feature in which we are only returning replies from a specific user AND all children of that reply unless the user is an administrator (in which case, show all replies so that admins can reply to users).
I've tried numerous things here (see links below), but there seems to be an issue in which replies aren't returned if they are not on the first page. Bumping the RootePageSize up fixes this, but we're still limited there to 100 and, in our communities, this number gets exceeded rather quickly.
So, I need a solution in which we return replies of the specific user regardless of which page it exists and also return all children of that reply.
I've tried numerous things. For starters, I just looped through the initial response from ThreadedList and picked added the replies to a separate list if author.id == user.id. This works until the RootPageSize is reached on the ThreadedList call.
I've also tried using the Search function - which may would work, except that there is no current way (that I can tell) to find all users in a role.. so I can't add moderator IDs to the query which means their replies do not get returned (see https://community.telligent.com/community/10/f/ask-the-community/1145619/getting-forum-replies-by-user)
Next, I thought possibly a binary search would suffice. Sort by UserID (as sorting is an option) and perform the binary search.. but again, I can't account for administrator role users here either.
Lastly I've tried just straight recursion - calling the custom made vm multiple times and updating the starting reply ID to get the next subset... but I can't seem to grab the last id of the last subset since I can't seem to find a way to test if the there should be more items (I've tried updating a variable each loop through and then checking to see if that variable == RootPageSize).
At this point I'm stuck. Any direction/help would be amazing.
I am curious about the use case behind this requirement. Obviously, the platform and its API doesn't handle it directly. I will answer a few of your questions that should help with the roadblocks you've encountered with your other approaches:
Duane Spainhour said:we're still limited there to 100 and, in our communities, this number gets exceeded rather quickly.
Loading a boundless list is not supported by any of our APIs. Generally page sizes max out at 100. You should loop to show all pages if you need to, ideally with user interaction to ensure they want more information and are still viewing it.
Duane Spainhour said:I've also tried using the Search function - which may would work, except that there is no current way (that I can tell) to find all users in a role
You can retrieve users in a role using the user list API ( https://community.telligent.com/community/10/w/api-documentation/60152/core_5f00_v2_5f00_user-widget-extension ). Note that this API, like all others, is limited to loading 100 at a time, but you can loop if you have more users.
The use case is really to be able to have uninfluenced discussions in a central location. The user story is such that, as a moderator, I should be able to pose a question and have all users respond. I should then be able to see each users reply and reply to each user. As a non-administrative respondent, I should be able to answer the question in a forum, see only my replies and any replies the moderators respond with.
Is this for AMA (ask me anything) or webinar like interactions? Or is this how all discussions work in your planned community?
I would recommend adding this as a idea in our product ideation:
While you should be able to implement this in a custom way, it could be supported more directly.