Interface IContentVisualComponent

    • Method Detail

      • getConfig

        ComponentConfig getConfig​(ContentContext ctx)
        get the configuration of the component. from project or from template.
        Parameters:
        ctx -
        Returns:
      • getStyle

        String getStyle()
        get the style of the display (sp. image-left, image-right)
        Returns:
      • prepareView

        void prepareView​(ContentContext ctx)
                  throws Exception
        this method is called before rendering the component.
        Parameters:
        ctx -
        Throws:
        Exception
      • isDisplayable

        boolean isDisplayable​(ContentContext ctx)
                       throws Exception
        true if the component can be displayed in preview mode
        Parameters:
        ctx -
        Returns:
        Throws:
        Exception
      • isDispayEmptyXHTMLCode

        boolean isDispayEmptyXHTMLCode​(ContentContext ctx)
                                throws Exception
        display empty xhtml code if empty
        Parameters:
        ctx -
        Returns:
        Throws:
        Exception
      • isConfig

        boolean isConfig​(ContentContext ctx)
        return true if there the component is configurable.
        Parameters:
        ctx -
        Returns:
      • performConfig

        String performConfig​(ContentContext ctx)
                      throws Exception
        action to manage the config, call when global content form is saved.
        Parameters:
        ctx -
        Returns:
        Throws:
        Exception
      • getValue

        String getValue​(ContentContext ctx)
        get the value of the content without any rendering.
        Returns:
        content in a text format.
      • setValue

        void setValue​(String inContent)
        set the content without rendering
        Parameters:
        inContent -
      • getType

        String getType()
        return the type of the element.
        Returns:
        the type of the element.
      • getComponentLabel

        String getComponentLabel​(ContentContext ctx,
                                 String lg)
        return the label of the element.
        Parameters:
        lg - language of the label
        Returns:
        the label of the element.
      • getTitleLevel

        int getTitleLevel​(ContentContext ctx)
        get the level of the title (1,2,3...). return 0 if the component is not a title
        Returns:
        the level of the title, 0 if the component is not a title.
      • isVisible

        boolean isVisible​(ContentContext ctx)
        check if this element is visible in the format.
        Returns:
        true if elment visible, false else
      • isVisibleFromCookies

        boolean isVisibleFromCookies​(ContentContext ctx)
        visible or no, depend of the choice of visitor with cookies
        Parameters:
        ctx -
        Returns:
      • getId

        String getId()
        return a unique id for the coponent
      • isModify

        boolean isModify()
        Returns:
        true if the composant was modified.
      • isUnique

        boolean isUnique()
        return true if the component must be unique on a page
        Returns:
      • isRealContent

        boolean isRealContent​(ContentContext ctx)
        return true if component is considered as realContent and the page that contain the component is also considered as real content.
        Parameters:
        ctx - current context
        Returns:
      • isDefaultValue

        boolean isDefaultValue​(ContentContext ctx)
        return true if value is never modified.
        Returns:
        true if value contain default value.
      • stored

        void stored()
        call this method when the component is stored.
      • getEditText

        String getEditText​(ContentContext ctx,
                           String key)
        get a internationalized text, in the languague of the edition.
        Parameters:
        key - the key of the text
        Returns:
        the text in the current language
      • getComponentBean

        ComponentBean getComponentBean()
        get the internal data
        Returns:
      • getTextLabel

        String getTextLabel​(ContentContext ctx)
        return a string representation of the component
      • getTextTitle

        String getTextTitle​(ContentContext ctx)
        return a string representation of the component with complete title
        Returns:
      • isRepeat

        boolean isRepeat()
      • setRepeat

        void setRepeat​(boolean newRepeat)
      • getLabelLevel

        int getLabelLevel​(ContentContext ctx)
        define the level of label. If there area most than 1 level on page, the label of the page is the bigger level.
        Parameters:
        ctx -
        Returns:
        0=default, no the components is'nt label.
      • getJSOnSubmit

        String getJSOnSubmit()
        return the java script code called when global form is submited.
        Returns:
        java script code.
      • extractFieldsFromRenderer

        List<String> extractFieldsFromRenderer​(ContentContext ctx)
                                        throws IOException
        extract field define in the current renderer
        Parameters:
        ctx -
        Returns:
        a list of fields name, null if no renderer found
        Throws:
        IOException
      • getTextForSearch

        String getTextForSearch​(ContentContext ctx)
        return a text represent the content of the component. sample all the content :-)
        Returns:
        a text represent the content of the component for the search module
      • getSearchLevel

        int getSearchLevel()
        return the level of the component is a search.
        Returns:
        1-LOW 2-MIDDLE 3-HIGH
      • getStyleList

        String[] getStyleList​(ContentContext ctx)
        get the list of style possible for this component.
        Returns:
        a list of string represent a style.
      • getStyleLabelList

        String[] getStyleLabelList​(ContentContext ctx)
        return a list of label define the style.
        Returns:
        a list of label.
      • getComponentCssClass

        String getComponentCssClass​(ContentContext ctx)
        get the current style of the component.
        Returns:
        the current style.
      • getStyleLabel

        String getStyleLabel​(ContentContext ctx)
        get the label of the current style
        Parameters:
        ctx -
        Returns:
      • setStyle

        void setStyle​(ContentContext ctx,
                      String inStyle)
        set the current style of the component.
        Parameters:
        inStyle - new style
      • setRenderer

        void setRenderer​(ContentContext ctx,
                         String renderer)
        set the current renderer for the component view.
        Parameters:
        a - key to a renderer (defined in config file of the component)
      • getRenderer

        String getRenderer​(ContentContext ctx)
        get the current renderer for the component view.
        Parameters:
        a - key to a renderer (defined in config file of the component)
      • getCurrentRenderer

        String getCurrentRenderer​(ContentContext ctx)
        return the name of the renderer.
        Parameters:
        ctx -
        Returns:
      • getPrefixViewXHTMLCode

        String getPrefixViewXHTMLCode​(ContentContext ctx)
        code for prefix the view XHTML code.
        Returns:
        XHTML code.
      • getInputNameRenderer

        String getInputNameRenderer()
        get the input name of the renderer.
        Returns:
      • getSuffixViewXHTMLCode

        String getSuffixViewXHTMLCode​(ContentContext ctx)
        code for sufix the view XHTML code.
        Returns:
        XHTML code.
      • getContentName

        String getContentName()
        return the name if the content field (textarea...)
        Returns:
      • isInline

        boolean isInline()
        check if the component can be inserd inline.
        Returns:
        true if component is a inline component. (text, link, image)...
      • next

        IContentVisualComponent next()
        get the next component on the page. if null this is the last component.
        Returns:
        a component.
      • previous

        IContentVisualComponent previous()
        get the next component on the page. if null this is the last component.
        Returns:
        a component.
      • setNextComponent

        void setNextComponent​(IContentVisualComponent nextComponent)
        change the previous component
        Parameters:
        nextComponent -
      • setPreviousComponent

        void setPreviousComponent​(IContentVisualComponent nextComponent)
        change the previous component
        Parameters:
        nextComponent -
      • getFirstPrefix

        String getFirstPrefix​(ContentContext ctx)
        get the prefix must be insered before a list of the current component (warning: one element is a list) #return XHTML code of prefix
      • getLastSufix

        String getLastSufix​(ContentContext ctx)
        get the sufix before must be insered after a list of the current component.
        Returns:
        XHTML code of sufix.
      • getHexColor

        String getHexColor()
        get the exadecimal color for representation of the component.
        Returns:
        a exadecimal color (sample : a5b499)
      • getMessage

        GenericMessage getMessage()
        get a message for the component.
        Returns:
        a generic message (error, info, warning, help), null if no message.
      • isInsertable

        boolean isInsertable()
        you can insert a text in this component
        Returns:
        true if a text is insertable
      • isListable

        boolean isListable()
        you display the composant as a list (if you want)
        Returns:
        true if a text is listable
      • insert

        void insert​(String text)
        insert a text in the component
        Parameters:
        text - the text to be insered
      • isList

        boolean isList​(ContentContext ctx)
        true if the component is in a list
        Returns:
        true if component is in a list
      • setList

        void setList​(boolean inList)
        put the component is a list
        Parameters:
        inList - true for put in a list, false for remove from a list
      • isNeedRefresh

        boolean isNeedRefresh()
        return true if the modifition of the component need a refresh of the edit page (ajax).
      • isVisible

        boolean isVisible()
      • isRepeatable

        boolean isRepeatable()
      • setValid

        void setValid​(boolean inVisible)
      • getArea

        String getArea()
        get the area where the component must be rendered
        Returns:
        a area name
      • getHelpURL

        String getHelpURL​(ContentContext ctx)
        a url to descripe the usage of the component
        Parameters:
        lang - the langage of the edit interface
        Returns:
        url to a help page or null if no help page defined
      • setNeedRefresh

        void setNeedRefresh​(boolean needRefresh)
        if you set true the page is refresh after update
        Parameters:
        needRefresh -
      • replaceInContent

        void replaceInContent​(String source,
                              String target)
        replace a content in visual element
        Parameters:
        source - the source element (sample. : test)
        target - the target element (sample. : -- test --)
      • replaceAllInContent

        void replaceAllInContent​(Map<String,​String> replacement)
        add a list of remplacement key, value
        Parameters:
        replacement -
      • clearReplacement

        void clearReplacement()
        clear remplacement values
      • getComplexityLevel

        int getComplexityLevel​(ContentContext ctx)
        return the complexity level of the component.
        Parameters:
        ctx - TODO
        Returns:
        see contant
      • isHidden

        boolean isHidden​(ContentContext ctx)
        true if component marked as hidden (in components.txt the class name start with '.')
        Returns:
      • getPage

        MenuElement getPage()
        get the page contains the component
        Returns:
        a page of the navigation
      • delete

        void delete​(ContentContext ctx)
        this method is called when component is deleted.
      • getNextComponent

        IContentVisualComponent getNextComponent()
        return the next component in the page sequence.
        Returns:
      • getPreviousComponent

        IContentVisualComponent getPreviousComponent()
        return the previous component in the page sequence.
        Returns:
      • isFirstRepeated

        boolean isFirstRepeated()
        return true if component is in the first repeat sequence of the page.
        Returns:
      • getExternalResources

        Collection<String> getExternalResources​(ContentContext ctx)
        return the external resources needed from component as css, javascript...
        Returns:
        a list of URI to external resources
      • getHeaderContent

        String getHeaderContent​(ContentContext ctx)
        return the part of header needed for this component
        Returns:
      • isContentCachable

        boolean isContentCachable​(ContentContext ctx)
        return the part of header needed for this component
        Returns:
      • getI18nEditableKeys

        List<String> getI18nEditableKeys​(ContentContext ctx)
        get i18n keys for edition
        Parameters:
        ctx -
        Returns:
        a list of i18n keys.
      • getKey

        String getKey()
        get a unic key of the component. User special for DynamicComponent.
      • getWordCount

        int getWordCount​(ContentContext ctx)
        count the word in the content.
        Returns:
      • isMetaTitle

        boolean isMetaTitle()
        return true is this component is a title of a group of component.
        Returns:
      • getClassName

        String getClassName()
        return the name of the class (use for JSTL)
        Returns:
      • getVersion

        String getVersion()
        return the version of the component : A.B.C A : major version, no compatibility with the older data B : new function but compatibilty with older data C : bug correction
        Returns:
        ? if version undefined.
      • getDescription

        String getDescription​(Locale local)
        a description of the component;
        Returns:
      • getAuthors

        String getAuthors()
        authors of the component
        Returns:
      • initContent

        boolean initContent​(ContentContext ctx)
                     throws Exception
        init the content with a default value. sample : "lorem ipsum" for text component.
        Parameters:
        ctx -
        Returns:
        true if content is create.
        Throws:
        Exception
      • getCreationDate

        Date getCreationDate()
      • getModificationDate

        Date getModificationDate()
      • getLayout

        ComponentLayout getLayout()
        get a simple layout for the component.
        Returns:
      • getPageDescription

        String getPageDescription​(ContentContext ctx)
        return the description of the page if this component is or contains description.
        Returns:
      • getListGroup

        String getListGroup()
        return the name of group component.
        Returns:
      • markAsNew

        void markAsNew​(ContentContext ctx)
        mark component as new in the current request
        Parameters:
        ctx -
      • isNew

        boolean isNew​(ContentContext ctx)
        check if this component has maked has new in the current request
        Parameters:
        ctx -
        Returns:
      • isEditOnCreate

        boolean isEditOnCreate​(ContentContext ctx)
        return true if the component is directly edited when it is insered.
        Parameters:
        ctx -
        Returns:
      • isNolink

        boolean isNolink()
      • isMirroredByDefault

        boolean isMirroredByDefault​(ContentContext ctx)
        if this component is duplicated, by default it is mirrored.
        Returns:
      • setContainerPage

        void setContainerPage​(ContentContext ctx,
                              MenuElement page)
        set the page of a container (page mirror, component mirror).
        Parameters:
        ctx -
        page -
      • getContentAsText

        String getContentAsText​(ContentContext ctx)
        get the text of the component
        Returns:
      • isHiddenInMode

        boolean isHiddenInMode​(ContentContext ctx,
                               int mode,
                               Boolean mobile)
        component can be hidded in some mode, like view or preview.
        Parameters:
        mode - current mode (view, preview, edit...)
        mobile - render in mobil mode
        Returns:
      • setDisplayHidden

        void setDisplayHidden​(boolean hidden)
        hide component in display mode
        Parameters:
        hidden -
      • isDisplayHidden

        boolean isDisplayHidden()
        is component displayed for visitor
        Returns:
      • getErrorMessage

        String getErrorMessage​(ContentContext ctx)
        return error message on structure of the component.
        Returns:
        null if no errors found
      • transflateFrom

        boolean transflateFrom​(ContentContext ctx,
                               ITranslator translator,
                               String lang)
        translate the content of the component to the current language
        Parameters:
        ctx - contextContext of the current rendering
        translator - class to translate
        lang - the language of the current content (source language)
        Returns:
      • isColumnable

        boolean isColumnable​(ContentContext ctx)
        contributor can select size of column to wrap component
        Parameters:
        ctx -
        Returns:
        0:auto -1:undefined
      • getColumnSize

        int getColumnSize​(ContentContext ctx)
        get the size of the column, the column contains the component
        Returns:
      • setColumnSize

        void setColumnSize​(int size)
        set the size of the column, the column contains the component
      • getGroup

        String getGroup()
        get the group of the component (meta, text, links, media,...)
        Returns:
      • setGroup

        void setGroup​(String grp)
      • getConfigInValue

        String getConfigInValue​(String key,
                                String defaultValue)
        transform the value of the component in a config properties file. If key not found a entry is created in the content.
        Parameters:
        key - the key of the config field
        defaultValue - the default value of the config field, this value is inserd in the config data if key not found.
        Returns:
        the value of the config field, defaultValue if key not found.
      • cleanResources

        boolean cleanResources​(ContentContext ctx)
        clean resources. By default remove import folder
        Returns: