Helper method to converts a list of detail pages to a map from type names to lists of detail pages for each type.<p>

@param detailPages the list of detail pages

@return the map of detail pages
161738
protected Map<String, List<CmsDetailPageInfo>> getDetailPagesMap(List<CmsDetailPageInfo> detailPages) {

        Map<String, List<CmsDetailPageInfo>> result = Maps.newHashMap();
        for (CmsDetailPageInfo detailpage : detailPages) {
            String type = detailpage.getType();
            if (!result.containsKey(type)) {
                result.put(type, new ArrayList<CmsDetailPageInfo>());
            }
            result.get(type).add(detailpage);
        }
        return result;
    }
1182978
protected boolean isValidDetailPage(CmsObject cms, CmsResource page, CmsResource detailRes) {

        if (OpenCms.getSystemInfo().isRestrictDetailContents()) {
            // in 'restrict detail contents mode', do not allow detail contents from a real site on a detail page of a different real site
            CmsSite pageSite = OpenCms.getSiteManager().getSiteForRootPath(page.getRootPath());
            CmsSite detailSite = OpenCms.getSiteManager().getSiteForRootPath(detailRes.getRootPath());
            if ((pageSite != null)
                && (detailSite != null)
                && !pageSite.getSiteRoot().equals(detailSite.getSiteRoot())) {
                return false;
            }
        }
        return OpenCms.getADEManager().isDetailPage(cms, page);
    }
92691
@Deprecated
	public static PageParameters toPageParameters(final Map<String, String> parameters)
	{
		return PageParametersExtensions.toPageParameters(parameters);
	}
441694
@Override
    public Map<String, List<String>> headers() {
        if (headers != null) {
            return headers;
        }
        headers = new HashMap<>();
        final MultiMap requestHeaders = request.headers();
        Set<String> names = requestHeaders.names();
        for (String name : names) {
            headers.put(name, requestHeaders.getAll(name));
        }
        return headers;
    }
255816
public I_CmsFormatterBean getDetailFormatter(String types, int containerWidth) {

        // detail formatters must still match the type or width
        Predicate<I_CmsFormatterBean> checkValidDetailFormatter = Predicates.and(
            new MatchesTypeOrWidth(types, containerWidth),
            new IsDetail());
        Optional<I_CmsFormatterBean> result = Iterables.tryFind(m_allFormatters, checkValidDetailFormatter);
        return result.orNull();
    }
507252
public static StringValueMap fromMaps(Map<?, ?>... maps) {
		StringValueMap result = new StringValueMap();
		if (maps != null && maps.length > 0) {
			for (Map<?, ?> map : maps)
				result.append(map);
		}
		return result;
	}
1188944
public <T> I addPageNames(Collection<T> webPages, Function<T, String> mapper) {
        for (T element : webPages) {
            addPage(WebPage.of(mapper.apply(element)));
        }
        return getThis();
    }
1111175
public CmsDetailPageInfo getMainDetailPage(String type) {

        List<CmsDetailPageInfo> detailPages = getDetailPagesForType(type);
        if ((detailPages == null) || detailPages.isEmpty()) {
            return null;
        }
        return detailPages.get(0);
    }
945238
protected Map<String, Object> detail() {
        final Map<String, Object> map = new HashMap<String, Object>();
        map.put("state", state);
        map.put("tags", getTagString());
        map.put("format", format);
        map.put("slug", slug);
        map.put("date", date);
        map.put("type", getType().getValue());
        return map;
    }
848535
public List<CmsDetailPageInfo> getInfosForType(String type) {

        return new ArrayList<CmsDetailPageInfo>(m_map.get(type));
    }
723013
public static Map<String, List<StringValue>> getPageParametersMap(final Request request)
	{
		final Map<String, List<StringValue>> map = new HashMap<>();
		addToParameters(request.getRequestParameters(), map);
		addToParameters(request.getQueryParameters(), map);
		addToParameters(request.getPostParameters(), map);
		return map;
	}
706402
public Map<String, Class<?>> getPayloadPropertyNames(Map<String,Class<?>> mapPropertyNames)
    {
        mapPropertyNames = super.getPayloadPropertyNames(mapPropertyNames);
        if ((this.getKeyInformation() & STANDARD_PARAM) != 0)
        {   // Add this name and class to the map of property names
            if (mapPropertyNames == null)
                mapPropertyNames = new HashMap<String, Class<?>>();
            mapPropertyNames.put(this.getFullKey(null), this.getRawClassType());
        }
        return mapPropertyNames;
    }
1030784
public static List<CmsResource> getDetailOnlyResources(CmsObject cms, CmsResource resource) {

        List<CmsResource> result = new ArrayList<CmsResource>();
        Set<String> resourcePaths = new HashSet<String>();
        String sitePath = cms.getSitePath(resource);
        for (Locale locale : OpenCms.getLocaleManager().getAvailableLocales()) {
            resourcePaths.add(getDetailOnlyPageNameWithoutLocaleCheck(sitePath, locale.toString()));
        }
        // in case the deprecated locale less detail container resource exists
        resourcePaths.add(getDetailOnlyPageNameWithoutLocaleCheck(sitePath, null));
        // add the locale independent detail container resource
        resourcePaths.add(getDetailOnlyPageNameWithoutLocaleCheck(sitePath, LOCALE_ALL));
        for (String path : resourcePaths) {
            try {
                CmsResource detailContainers = cms.readResource(path, CmsResourceFilter.IGNORE_EXPIRATION);
                result.add(detailContainers);
            } catch (CmsException e) {
                // will happen in case resource does not exist, ignore
            }
        }
        return result;
    }
570563
private List<CmsResource> getDetailResources(I_CmsResourceType type) throws CmsException {

        String typeName = type.getTypeName();
        if (!m_detailResources.containsKey(typeName)) {
            List<CmsResource> result = new ArrayList<CmsResource>();
            CmsResourceFilter filter = CmsResourceFilter.DEFAULT_FILES.addRequireType(type);
            List<CmsResource> siteFiles = m_guestCms.readResources(m_siteRoot, filter, true);
            result.addAll(siteFiles);
            String shared = CmsFileUtil.removeTrailingSeparator(OpenCms.getSiteManager().getSharedFolder());
            if (shared != null) {
                List<CmsResource> sharedFiles = m_guestCms.readResources(shared, filter, true);
                result.addAll(sharedFiles);
            }
            m_detailResources.put(typeName, result);
        }
        return m_detailResources.get(typeName);
    }
753097
public List<CmsModelPageConfig> getModelPages(boolean includeDisable) {

        CmsADEConfigData parentData = parent();
        List<CmsModelPageConfig> parentModelPages;
        if ((parentData != null) && !m_data.isDiscardInheritedModelPages()) {
            parentModelPages = parentData.getModelPages();
        } else {
            parentModelPages = Collections.emptyList();
        }

        List<CmsModelPageConfig> result = combineConfigurationElements(
            parentModelPages,
            m_data.getOwnModelPageConfig(),
            includeDisable);
        return result;
    }
445638
public static Map mapValues(Mapper mapper, Map map) {
        return mapValues(mapper, map, false);
    }
977622
protected function mapIDs($pages)
    {
        $ids = array();
        if ($pages) {
            foreach ($pages as $page) {
                $ids[] = array('ID' => $page->ID, 'ParentID' => $page->ParentID);
            }
        }
        return $ids;
    }