Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-2209

Support hst:isBeanType JSTL function

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 2.25.05
    • None
    • None

    Description

      Add support for

      <function>
      <description>
      Determines if the class or interface represented by this ContentBean object is either the same as, or is a
      subclass of, the class or interface represented by the specified fully qualified class name parameter.
      It returns true if so; otherwise it returns false.
      </description>
      <name>isBeanType</name>
      <function-class>org.hippoecm.hst.util.ContentBeanUtils</function-class>
      <function-signature>boolean isBeanType(org.hippoecm.hst.content.beans.standard.ContentBean, java.lang.String)</function-signature>
      <example>
      <c:if test="${hst:isBeanType(bean, 'org.hippoecm.hst.content.beans.standard.HippoFolderBean')}">
      </example>

      </function>

      In ContentBeanUtils :

      // typeName = Fully qualified classname of class to check against
      public static boolean isBeanType(ContentBean contentBean, String typeName)

      { // ... }

      Also, it must be better if the method allows simple class name as well. e.g., NewsBean as well as org.example.beans.NewsBean.

      Attachments

        Issue Links

          Activity

            People

              aschrijvers Ard Schrijvers
              aschrijvers Ard Schrijvers
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: