Class CmsAddDialogTypeHelper

java.lang.Object
org.opencms.ade.containerpage.CmsAddDialogTypeHelper

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

  • Constructor Details

  • Method Details

    • getPrecomputedTypes

      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 List<CmsResourceTypeBean> getResourceTypes(CmsObject cms, String folderRootPath, String createContextPath, 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, String folderRootPath, String checkViewableReferenceUri, 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