Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-2753

Review ImageProvider component mappings so that it can be injected

XMLWordPrintable

      Currently ImageProvider has:

      • a type-mapping for ImageProviderDefinition (for n2b)
      • an 'admincentral' component mapping for ImageProvider to DefaultImageProvider
      • an 'admincentral' component mapping for an ImageProviderDefinition

      BrowserPresenter is then creating a separate instance of imageProvider based on the ImageProviderDefinition#imageProviderClass configured under the subApp.
      WorkbenchPresenter is yet even creating another imageProvider instance to pass along with instantiation of content presenters!

      There are two issues with this:

      • One cannot inject current ImageProvider in another subapp component (e.g. thumbnail view) because then we get the 'admincentral' imageProvider, which has null definition and contentConnector.
      • One cannot reuse the imageProvider configured for this subApp.

      We should use a Guice Provider here, similarly as for ContentConnector:

      • we keep the definition type-mapping but replace component mappings with a provider mapping, under 'subapp' container, not 'admincentral'.
      • we inject it directly in BrowserPresenter - we can then even remove injection of componentProvider from there.
      • we drop DefaultImageProvider's no-arg constructor and annotate the other one with @Inject

        Acceptance criteria

              mgeljic Mikaël Geljić
              mgeljic Mikaël Geljić
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD