Package org.opencms.ade.containerpage
Class CmsAddDialogTypeHelper
- java.lang.Object
-
- org.opencms.ade.containerpage.CmsAddDialogTypeHelper
-
public class CmsAddDialogTypeHelper extends java.lang.Object
Helper class for preparing the resource type lists for gallery and new dialog.
-
-
Constructor Summary
Constructors Constructor Description CmsAddDialogTypeHelper(CmsResourceTypeConfig.AddMenuType type)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
exclude(CmsResourceTypeBean type)
Function used to check if a given resource type should be excluded from the result.java.util.List<CmsResourceTypeBean>
getPrecomputedTypes(CmsElementView view)
Gets the precomputed type list for the given view.java.util.List<CmsResourceTypeBean>
getResourceTypes(CmsObject cms, java.lang.String folderRootPath, java.lang.String checkViewableReferenceUri, CmsElementView elementView, I_CmsResourceTypeEnabledCheck checkEnabled)
Creates list of resource type beans for gallery or 'New' dialog.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.
-
-
-
Constructor Detail
-
CmsAddDialogTypeHelper
public CmsAddDialogTypeHelper(CmsResourceTypeConfig.AddMenuType type)
Creates a new instance.- Parameters:
type
- the menu type for which we want to build a type list
-
-
Method Detail
-
getPrecomputedTypes
public java.util.List<CmsResourceTypeBean> getPrecomputedTypes(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<CmsResourceTypeBean> getResourceTypes(CmsObject cms, java.lang.String folderRootPath, 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 contextfolderRootPath
- the current foldercheckViewableReferenceUri
- 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, 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 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
-
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
-
-