-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function "Select all rows" is not applied to KitodoScripts #5267
Comments
Even more: If you select all processes on all pages, and there are 15 pages, the KitodoScript is executed 15 times for each process of page 1. Correct behaviour should be: The script should be executed once for each process of each page. |
probably related to/duplicate of: #4948 |
Thanks a lot for your addition. I would not close the issue as duplicate, because in the other issue, only the generation of images is described. |
I just looked into it and it seems that the problem does not appear if i select all processes by hand, only if the functionality "Select all rows" is used. In this case the process list is already incorrect before the data is passed to the actual processing. So this probably has something to do with the setup and configuration of the Datatable. The processes on the first page are already repeated/duplicated in the list kitodo-production/Kitodo/src/main/java/org/kitodo/production/forms/ProcessListBaseView.java Lines 558 to 559 in 2180742
PS: |
@BartChris : Thanks a lot for the contribution. I hope that this supports the solution of the issue. You are right, regarding the possible relocation of the function into the batch interface or another interface. For me, it is important that the current implementation works correctly - although it might not be the best implementation. |
It seems as if the issue can be fixed, when the "select all" functionality is not delegated to the Primefaces mechanism but is implemented by hand. I added the following method to ProcessForm.java (ProcessBaseListView.java) public void selectAll() throws DataException {
ProcessService processService = ServiceManager.getProcessService();
this.selectedProcessesOrProcessDTOs = processService.findByQuery(processService.getQueryForFilter(
this.isShowClosedProcesses(), isShowInactiveProjects(),getFilter()), false);
} and added a button to call that method. This queries the search index with the current filter settings and sets the currently selected records to all elements in the result. I have the impression that implementing that mechanism as a custom method is the only way to determine what data is actually selected, when the user chooses "Select all". A video demonstrating the behaviour after applying the fix: kitodo_selection_fix_neu.mp4 |
@BartChris thanks for this proposed fix. I wonder, though, if it is a viable solution to load all elements in a real production system with millions of processes instead of just 13 like in your example. I think that is the main reason why the "Select all" button hasn't been implemented in this most straight-forward way until now. I guess we need to find a solution where the |
@solth You are correct i suppose. Holding a lot of processes in memory is probably not a good idea and it would probably be better if triggering the button just sets a variable On the other hand: Is the current implementation (in master) not doing exactly that (building a huge list)? Using "Select all", results in "setSelectedProcessesOrProcessDTOs" to be called with a potentially large list of Processes, with the difference that processes from page one are repeated over and over. PS: Doing it in the prefered (memory lightweight) way would probably still have the problem that after clicking only on a single row, all other selections are lost. So that it is impossible to unselect processes even if they should not be included in the batch process. There might of course be scenarios where somebody wants to select millions of records at once, but there are probably a lot of cases where it would be more useful to select a subset and allow that processes can be deselected by hand, witthout losing the selection. I suppose there is not an optimal solution. This is the main reason why i think the datatable is a suboptimal batch interface. |
Describe the bug
If a list of results with several pages is shown in "processes" and all processes are selected, the following occurs:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If all rows of a result list are selected, they all should be regarded, if a KitodoScript is applied.
Screenshots
function "select all rows"
function "Actions"
Release
Kitodo.Production version 3.4.4
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: