-
Task
-
Resolution: Fixed
-
Neutral
-
6.2.3
-
None
-
None
-
-
Empty show more show less
-
Empty show more show less
Background
In S3 external dam we have an issue displaying the asset tree for the first time. When there are many buckets (parent folders), it takes a very long time to render the tree for the first time. Then the assets are cached and we don’t have this issue anymore. Also opening other folders have no problem.
The main problem is vaadin needs to know whether each parent folder has children or not. To do so, vaadin calls sequentially the hasChildren method in the corresponding HierarchicalDataProvider for the view. In our case info.magnolia.ui.contentapp.FilterableHierarchicalDataProvider implements the hasChildren:
public boolean hasChildren(T item) { return fetchChildren(new HierarchicalQuery<>(filter, item)).count() > 0; }
This is always translated into a remote API call. As we are able to know in advance whether a bucket has children or not, we would like to override this method to avoid all these remote API calls. Unfortunately we can’t, as FilterableHierarchicalDataProvider has a private constructor.
Proposed solution
Remove the hasChildren method from info.magnolia.ui.contentapp.FilterableHierarchicalDataProvider so instead we would use the parent (HierarchicalDataProviderWrapper) implementation:
public boolean hasChildren(T item) { return dataProvider().hasChildren(item); }
This would allow to override the implementation appropriately.