Class CmsAddDialogTypeHelper


  • public class CmsAddDialogTypeHelper
    extends java.lang.Object
    Helper class for preparing the resource type lists for gallery and new dialog.

    • Method Detail

      • getPrecomputedTypes

        public java.util.List<CmsResourceTypeBeangetPrecomputedTypes​(CmsElementView view)
        Gets the precomputed type list for the given view.

        Parameters:
        view - the element view
        Returns:
        the precomputed type list, or null if the list wasn't precomputed
      • getResourceTypes

        public java.util.List<CmsResourceTypeBeangetResourceTypes​(CmsObject cms,
                                                                    java.lang.String folderRootPath,
                                                                    java.lang.String createContextPath,
                                                                    java.lang.String checkViewableReferenceUri,
                                                                    CmsElementView elementView,
                                                                    I_CmsResourceTypeEnabledCheck checkEnabled)
                                                             throws CmsException
        Creates list of resource type beans for gallery or 'New' dialog.

        Parameters:
        cms - the CMS context
        folderRootPath - the current folder
        createContextPath - the path to pass to CmsResourceTypeConfig#checkCreatable
        checkViewableReferenceUri - the reference uri to use for viewability check
        elementView - the element view
        checkEnabled - object to check whether resource types should be enabled
        Returns:
        the list of resource type beans
        Throws:
        CmsException - if something goes wrong
      • precomputeTypeLists

        public void precomputeTypeLists​(CmsObject cms,
                                        java.lang.String folderRootPath,
                                        java.lang.String checkViewableReferenceUri,
                                        java.util.List<CmsElementView> views,
                                        I_CmsResourceTypeEnabledCheck check)
        Precomputes type lists for multiple views.

        Parameters:
        cms - the CMS context
        folderRootPath - the current folder
        checkViewableReferenceUri - the reference uri to use for viewability check
        views - the views for which to generate the type lists
        check - object to check whether resource types should be enabled
      • exclude

        protected boolean exclude​(CmsResourceTypeBean type)
        Function used to check if a given resource type should be excluded from the result.

        Parameters:
        type - the type
        Returns:
        true if the given type should be excluded