Package org.opencms.ade.containerpage
Class CmsAddDialogTypeHelper
java.lang.Object
org.opencms.ade.containerpage.CmsAddDialogTypeHelper
Helper class for preparing the resource type lists for gallery and new dialog.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
exclude
(CmsResourceTypeBean type) Function used to check if a given resource type should be excluded from the result.Gets the precomputed type list for the given view.getResourceTypes
(CmsObject cms, String folderRootPath, String createContextPath, String checkViewableReferenceUri, CmsElementView elementView, I_CmsResourceTypeEnabledCheck checkEnabled) Creates list of resource type beans for gallery or 'New' dialog.void
precomputeTypeLists
(CmsObject cms, String folderRootPath, String checkViewableReferenceUri, List<CmsElementView> views, I_CmsResourceTypeEnabledCheck check) Precomputes type lists for multiple views.
-
Constructor Details
-
CmsAddDialogTypeHelper
Creates a new instance.- Parameters:
type
- the menu type for which we want to build a type list
-
-
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 contextfolderRootPath
- the current foldercreateContextPath
- the path to pass to CmsResourceTypeConfig#checkCreatablecheckViewableReferenceUri
- the reference uri to use for viewability checkelementView
- the element viewcheckEnabled
- 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 contextfolderRootPath
- the current foldercheckViewableReferenceUri
- the reference uri to use for viewability checkviews
- the views for which to generate the type listscheck
- object to check whether resource types should be enabled
-