Class BaseComponent

    • Constructor Detail

      • BaseComponent

        public BaseComponent()
    • Method Detail

      • generate

        public abstract 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
        the generated javascript which is send back to the client
      • getContextUrl

        public String getContextUrl()
      • getId

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

        public void setId​(String id)
      • getData

        public abstract Object getData()
      • setParameters

        public void setParameters​(Map<String,​Object> parameters)
      • getParameterNames

        public List<String> getParameterNames()
      • hasParameter

        public boolean hasParameter​(String key)
      • setDependencies

        public void setDependencies​(List<Component> dependencies)
      • createComponent

        public <U extends Component> U createComponent​(Class<U> clz)
        Return a new component of the correct implementation using Weld.
        clz - an instance of this class will be returned
        an instance of clz
      • 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
        a unique hash for the content generated
      • nullifyModuleCache

        public static void nullifyModuleCache()
      • getLastModified

        public Date getLastModified()
        Specified by:
        getLastModified in interface Component
        the last modified date of any data element used to generate the response, if null is returned then the current date/time is assumed.
      • getModule

        public Module getModule()
        Specified by:
        getModule in interface Component
        the module providing this component
      • getModulePackageName

        protected String getModulePackageName()
        Override this method if the component is in a different package than the module.
      • getSafeValue

        protected String getSafeValue​(Object value)
        Translates a null value to a value which can be handled better by a template.
      • getContentType

        public String getContentType()
        Specified by:
        getContentType in interface Component
        returns the javascript content type with UTF-8: application/javascript;charset=UTF-8
      • isJavaScriptComponent

        public boolean isJavaScriptComponent()
        Specified by:
        isJavaScriptComponent in interface Component
        true if the generated output is javascript
      • getApplicationName

        protected String getApplicationName()
      • isClassicMode

        protected boolean isClassicMode()
      • bypassAuthentication

        public boolean bypassAuthentication()