Class StaticResourceComponent

  • All Implemented Interfaces:

    public class StaticResourceComponent
    extends BaseComponent
    The component in charge of generating the static Javascript resources.
    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
        getETag in class BaseComponent
        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
        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.
        staticResourceFileName - The name of the static resource file already generated by the component.
        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
        getId in class BaseComponent
        the id of the component, see the id description in the root of this class.
      • getStaticResourceFileName

        public String getStaticResourceFileName()
        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.