code: public List<CmsResourceTypeBean> getResourceTypes(
          CmsObject cms,
          String folderRootPath,
          String checkViewableReferenceUri,
          CmsElementView elementView,
          I_CmsResourceTypeEnabledCheck checkEnabled)
      throws CmsException {
  
          if (elementView == null) {
              LOG.error("Element view is null");
              return Collections.emptyList();
          }
          List<I_CmsResourceType> additionalTypes = Lists.newArrayList();
  
          // First store the types in a map, to avoid duplicates
          Map<String, I_CmsResourceType> additionalTypeMap = Maps.newHashMap();
  
          if (elementView.getExplorerType() != null) {
              List<CmsExplorerTypeSettings> explorerTypes = OpenCms.getWorkplaceManager().getExplorerTypesForView(
                  elementView.getExplorerType().getName());
              for (CmsExplorerTypeSettings explorerType : explorerTypes) {
                  if (elementView.isOther() && m_includedAdeTypes.contains(explorerType.getName())) {
                      continue;
                  }
                  additionalTypeMap.put(
                      explorerType.getName(),
                      OpenCms.getResourceManager().getResourceType(explorerType.getName()));
              }
          }
          if (OpenCms.getRoleManager().hasRole(cms, CmsRole.DEVELOPER) && elementView.isOther()) {
              Set<String> hiddenTypes = new HashSet<String>(m_allAdeTypes);
              hiddenTypes.removeAll(m_includedAdeTypes);
              for (String typeName : hiddenTypes) {
                  if (OpenCms.getResourceManager().hasResourceType(typeName)) {
                      additionalTypeMap.put(typeName, OpenCms.getResourceManager().getResourceType(typeName));
                  }
              }
          }
          additionalTypes.addAll(additionalTypeMap.values());
  
          return internalGetResourceTypesFromConfig(
              cms,
              folderRootPath,
              checkViewableReferenceUri,
              elementView,
              additionalTypes,
              checkEnabled);
  
      }
docs: Creates list of resource type beans for gallery or 'New' dialog.<p>
  
  @param cms the CMS context
  @param folderRootPath the current folder
  @param checkViewableReferenceUri the reference uri to use for viewability check
  @param elementView the element view
  @param checkEnabled object to check whether resource types should be enabled
  
  @return the list of resource type beans
  
  @throws CmsException if something goes wrong