Interface ContextHub

    • Method Detail

      • getPath

        java.lang.String getPath​(SlingHttpServletRequest request)
        Returns Path to ContextHub
        Parameters:
        request - request
        Returns:
        URL to contexthub
      • getPath

        java.lang.String getPath​(SlingHttpServletRequest request,
                                 boolean checkRequestResource)
        Returns Path to ContextHub
        Parameters:
        request - request
        checkRequestResource - indicates whether request resource should be used to resolve ContextHub path
        Returns:
        URL to contexthub
      • getRunModes

        java.util.Set<java.lang.String> getRunModes()
        Returns instance's run modes.
        Returns:
        list of run modes
      • findStores

        java.util.List<Store> findStores​(Resource contextHub)
        Given a ContextHub configuration resource, return the corresponding Stores as list
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        list of stores
      • findModules

        java.util.List<Module> findModules​(Resource contextHub)
        Given a ContextHub configuration resource, return the corresponding Modules as list
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        list of modules
      • findModes

        java.util.List<Mode> findModes​(Resource contextHub)
        Given a ContextHub configuration resource, return the corresponding Modes as list
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        list of modes
      • filterStores

        java.util.List<Store> filterStores​(Resource contextHub,
                                           java.util.EnumSet<ContextHub.StoreStatus> flags)
        Returns all stores matching to requested filter.
        Parameters:
        contextHub - the ContextHub configuration resource
        flags - filter (EnumSet containing desired status of the store)
        Returns:
        stores matching to requested filter
      • filterModules

        java.util.List<Module> filterModules​(Resource contextHub,
                                             java.util.EnumSet<ContextHub.ModuleStatus> flags)
        Returns all modules matching to requested filter.
        Parameters:
        contextHub - the ContextHub configuration resource
        flags - filter (EnumSet containing desired status of the store)
        Returns:
        modules matching to requested filter
      • getEnabledStores

        java.util.List<Store> getEnabledStores​(Resource contextHub)
        Returns all enabled ContextHub's stores.
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        enabled stores
      • getEnabledModules

        java.util.List<Module> getEnabledModules​(Resource contextHub)
        Returns all visible ContextHub modules.
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        enabled modules
      • getEnabledModes

        java.util.List<Mode> getEnabledModes​(Resource contextHub)
        Returns all visible ContextHub modes.
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        enabled modes
      • getDisabledStores

        java.util.List<Store> getDisabledStores​(Resource contextHub)
        Returns all disabled ContextHub's stores.
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        disabled stores
      • getDisabledModules

        java.util.List<Module> getDisabledModules​(Resource contextHub)
        Returns all hidden ContextHub modules.
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        hidden modules
      • getDisabledModes

        java.util.List<Mode> getDisabledModes​(Resource contextHub)
        Returns all hidden ContextHub modes.
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        hidden modes
      • getTheme

        java.lang.String getTheme​(Resource contextHub)
        Returns ContextHub's UI theme name.
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        UI theme name
      • isConfigured

        boolean isConfigured​(Resource contextHub)
        Determines if ContextHub's instance is ready to use (it's false when ContextHub's resource wasn't found).
        Parameters:
        contextHub - the ContextHub configuration resource
        Returns:
        true if ContextHub was properly initialized
      • isConfigured

        boolean isConfigured​(SlingHttpServletRequest request)
        Determines if ContextHub is configured for this request.
        Parameters:
        request - request
        Returns:
        true if ContextHub was properly initialized
      • getKernelCodeURL

        java.lang.String getKernelCodeURL​(SlingHttpServletRequest request)
        Returns URL to ContextHub's kernel.js
        Parameters:
        request - request
        Returns:
        URL to kernel.js
      • getUICodeURL

        java.lang.String getUICodeURL​(SlingHttpServletRequest request)
        Returns the URL to ContextHub's ui.js
        Parameters:
        request - request
        Returns:
        URL to ui.js
      • getStylesURL

        java.lang.String getStylesURL​(SlingHttpServletRequest request)
        Returns URL to ContextHub's styles.css (containing ui source code)
        Parameters:
        request - request
        Returns:
        URL to styles.css
      • getUIPageURL

        java.lang.String getUIPageURL​(SlingHttpServletRequest request)
        Returns URL to ContextHub's UI page (which is "static", only the code is "dynamic")
        Parameters:
        request - request
        Returns:
        URL to ui.html
      • getKernelCategories

        java.util.List<java.lang.String> getKernelCategories​(SlingHttpServletRequest request)
        Returns a list of kernel client library categories (including javascript part of ui libraries if includeUI is set to true).
        Parameters:
        request - request
        Returns:
        list of categories required to build code.js
      • getUICategories

        java.util.List<java.lang.String> getUICategories​(SlingHttpServletRequest request)
        Returns a list of ui (type: js) client library categories.
        Parameters:
        request - request
        Returns:
        list of categories required to build styles.css
      • getStylesCategories

        java.util.List<java.lang.String> getStylesCategories​(SlingHttpServletRequest request)
        Returns a list of ui (type: css) client library categories.
        Parameters:
        request - request
        Returns:
        list of categories required to build styles.css
      • showUi

        boolean showUi()
        Returns whether to include the ContextHub UI or not.
        Returns:
        true if ContextHub UI is to be included
      • isSilentMode

        boolean isSilentMode()
        Returns whether ContextHub should run in silent mode (takes priority over debug mode).
        Returns:
        true if debug is enabled
      • isDebug

        boolean isDebug​(SlingHttpServletRequest request)
        Returns whether debug is enabled for a given ContextHub instance.
        Returns:
        true if debug is enabled
      • isDisabled

        boolean isDisabled​(SlingHttpServletRequest request)
        Returns whether a given ContextHub instance is disabled.
        Parameters:
        request - - request
        Returns:
        true if a given ContextHub instance is disabled.
      • getAnonymousPath

        java.lang.String getAnonymousPath()
        Returns home path of anonymous user.
        Returns:
        {String|null}