-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
2 - Long term
-
2 - Normal
Currently, the org.ametys.core.ui.SimpleMenu has 1 components manager for its items, which are both attributes of the class and loaded only once.
If we want a gallery or menu that depends on the context, such as the current skin in the web, we have to destroy and recreate the ComponentManager each time we load it. See org.ametys.web.clientsideelement.TemplatesMenu._lazyInitializeTemplateGallery and org.ametys.plugins.newsletter.category.TemplatesMenu._lazyInitializeTemplateGallery for classes awaiting a FIXME
We could possibly change the _getGalleryItems and _getMenuItems API to pass the List<ClientSideElement> instead of using a class attribute. We could also add a web implementation of a smart cache by skin reloaded on skin updates of the ClientSideElements,