Class StaticResourceComponent

  • All Implemented Interfaces:
    Component

    public class StaticResourceComponent
    extends BaseComponent
    The component in charge of generating the static Javascript resources.
    Author:
    mtaal, iperdomo
    • Constructor Detail

      • StaticResourceComponent

        public StaticResourceComponent()
    • Method Detail

      • getETag

        public String getETag()
        Description copied from interface: Component
        An ETag is a hash-like string which is used to determine if content has changed since the last request for the content. See this link for more information. Note for language specific components the etag has to encode the language (id) also! See ( OBContext.getLanguage()) to get the current language.
        Specified by:
        getETag in interface Component
        Overrides:
        getETag in class BaseComponent
        Returns:
        a unique hash for the content generated
      • generate

        public String generate()
        Description copied from interface: Component
        Generates the content of the component which is sent to the client for execution/rendering.
        Specified by:
        generate in interface Component
        Specified by:
        generate in class BaseComponent
        Returns:
        the generated javascript which is send back to the client
      • generateResult

        protected String generateResult​(String staticResourceFileName)
        Returns the result of the component generation. This method should be overridden by the classes extending this one in order to return its own result.
        Parameters:
        staticResourceFileName - The name of the static resource file already generated by the component.
        Returns:
        a String containing the result of the component generation. By default, it returns a javascript expression that writes an <script> that imports the generated static resource file.
      • getId

        public String getId()
        Specified by:
        getId in interface Component
        Overrides:
        getId in class BaseComponent
        Returns:
        the id of the component, see the id description in the root of this class.
      • getStaticResourceFileName

        public String getStaticResourceFileName()
        Returns:
        all static resources needed by the application and placed in the top of the application page, in order based on module dependencies and using an unique version string to force client side reload or caching.