Class ApplicationCodeService

java.lang.Object
io.meeds.layout.service.ApplicationCodeService

@Service public class ApplicationCodeService extends Object
The registry of the ApplicationCodePlugins, keyed by portlet name, and the read the layout descriptions make through them: a window whose portlet has no plugin has no code to describe
  • Constructor Details

    • ApplicationCodeService

      public ApplicationCodeService()
  • Method Details

    • addPlugin

      public void addPlugin(ApplicationCodePlugin plugin)
      Registers a plugin, replacing the one registered for the same portlet
      Parameters:
      plugin - the plugin
    • removePlugin

      public void removePlugin(String portletName)
      Parameters:
      portletName - the portlet name whose plugin leaves
    • hasPlugin

      public boolean hasPlugin(String contentId)
      Parameters:
      contentId - the window's content id (application/portlet)
      Returns:
      whether a plugin reads the code of that portlet
    • read

      public ApplicationCode read(String contentId, ApplicationSettingsContext context)
      Parameters:
      contentId - the window's content id
      context - the window's context, for the plugin
      Returns:
      the code as the plugin reads it for the context's user; null when the portlet has no plugin, when the window has no code, when the user may not read it or when the plugin fails
    • newApplication

      public PortletInstance newApplication(String contentId)
      Parameters:
      contentId - the content id to place
      Returns:
      a new window of the application with that exact content id that its plugin places without a catalog instance, null when there is none
    • newApplications

      public List<PortletInstance> newApplications()
      Returns:
      a new window of each application its plugin places without a catalog instance