Class LangTag

  • All Implemented Interfaces:
    JcmsConstants, JaliosConstants, java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

    public class LangTag
    extends javax.servlet.jsp.tagext.TagSupport
    implements JcmsConstants
    This tag prints the flag bound to the given language or bound to userLang.
    Version:
    $Revision: 135570 $
    Author:
    Olivier Dedieu
    See Also:
    Serialized Form
    • Constructor Detail

      • LangTag

        public LangTag()
    • Method Detail

      • setLang

        public void setLang​(java.lang.String lang)
      • setCss

        public void setCss​(java.lang.String css)
      • setCtxMenuCss

        public void setCtxMenuCss​(java.lang.String ctxMenuCss)
      • setTitle

        public void setTitle​(java.lang.String title)
      • setDisplay

        public void setDisplay​(java.lang.String display)
      • setUseLocalizedLanguageList

        public void setUseLocalizedLanguageList​(boolean use)
      • doStartTag

        public int doStartTag()
                       throws javax.servlet.jsp.JspException
        Specified by:
        doStartTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class javax.servlet.jsp.tagext.TagSupport
        Throws:
        javax.servlet.jsp.JspException
      • doEndTag

        public int doEndTag()
        Specified by:
        doEndTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class javax.servlet.jsp.tagext.TagSupport
      • getLangForm

        public static java.lang.String getLangForm​(java.lang.String userLang)
        Returns the lang icon action to display langForm menu.
        Parameters:
        userLang - the user language
        Returns:
        String icon
        Since:
        jcms-6.1.0
      • getLangFormMenu

        public static java.lang.String getLangFormMenu()
        Returns the lang form menu for doEmptyHeader.jsp
        Returns:
        String LangFormMenu
      • getLangIcon

        public static java.lang.String getLangIcon​(java.lang.String lang)
        Retrieve the HTML used to display a flag associated to specified language
        Parameters:
        lang - the ISO-639 language code to be displayed
        Returns:
        the HTML used to display a lang flag
        Since:
        jcms-10.0.3 / JCMS-7376
      • appendFlag

        public static void appendFlag​(java.lang.StringBuffer sb,
                                      java.lang.String flagLang,
                                      java.lang.String title)
      • appendFlag

        public static void appendFlag​(java.lang.StringBuffer sb,
                                      java.lang.String flagLang,
                                      java.lang.String title,
                                      boolean addAlt)
      • getChangeUrl

        public static java.lang.String getChangeUrl​(javax.servlet.http.HttpServletRequest request,
                                                    java.lang.String lang)
        Retrieve an URL used to change to the specified language.

        Parameters:
        request - the current request (required, must not be nul)
        lang - the target language
        Returns:
        an URL (relative to webapp root) suitable to change current user browsing language to the specified lang (any ampersand used to seperate paramaters will already be encoded for use in HTML)
        Since:
        jcms-9.0.0 / JCMS-3387