Gets the detail page information for  everything.<p>

@param cms the current CMS context

@return the list with all the detail page information
9012
public List<DetailInfo> getDetailInfo(CmsObject cms) {

        return getCacheState(isOnline(cms)).getDetailInfosForSubsites(cms);
    }
1157690
public Map<String, String> getParameters(CmsObject cms) {

        Map<String, String> result = new LinkedHashMap<String, String>(m_parameters);
        if (cms != null) {
            String userParamsStr = (String)(cms.getRequestContext().getCurrentUser().getAdditionalInfo().get(
                "ADE_PARAMS"));
            if (userParamsStr != null) {
                Map<String, String> userParams = CmsStringUtil.splitAsMap(userParamsStr, "|", ":");
                result.putAll(userParams);
            }
        }
        return result;
    }
1348695
public static List<CmsProject> getAvailableProjects(CmsObject cms) {

        // get all project information
        List<CmsProject> allProjects;
        try {
            String ouFqn = "";
            CmsUserSettings settings = new CmsUserSettings(cms);
            if (!settings.getListAllProjects()) {
                ouFqn = cms.getRequestContext().getCurrentUser().getOuFqn();
            }
            allProjects = new ArrayList<CmsProject>(
                OpenCms.getOrgUnitManager().getAllAccessibleProjects(cms, ouFqn, settings.getListAllProjects()));
            Iterator<CmsProject> itProjects = allProjects.iterator();
            while (itProjects.hasNext()) {
                CmsProject prj = itProjects.next();
                if (prj.isHiddenFromSelector()) {
                    itProjects.remove();
                }
            }
        } catch (CmsException e) {
            // should usually never happen
            LOG.error(e.getLocalizedMessage(), e);
            allProjects = Collections.emptyList();
        }
        return allProjects;
    }
1010154
protected Set<String> getStrongLinkReferences() {

        Set<String> includingFiles = new HashSet<String>();
        CmsDbContext dbc = m_publishEngine.getDbContext(getCms().getRequestContext());
        try {
            // use the online project
            CmsObject jspCms = OpenCms.initCmsObject(m_publishJob.getCmsObject());
            jspCms.getRequestContext().setCurrentProject(jspCms.readProject(CmsProject.ONLINE_PROJECT_ID));
            // collect jsp referencing information
            m_report.println(
                Messages.get().container(Messages.RPT_JSPLOADER_UPDATE_CACHE_BEGIN_0),
                I_CmsReport.FORMAT_HEADLINE);
            int plainId = OpenCms.getResourceManager().getResourceType(
                CmsResourceTypePlain.getStaticTypeName()).getTypeId();
            Iterator<CmsResource> it = m_publishJob.getPublishList().getFileList().iterator();
            while (it.hasNext()) {
                CmsResource resource = it.next();
                if ((CmsResourceTypeJsp.isJsp(resource)) || (resource.getTypeId() == plainId)) {
                    m_report.print(
                        Messages.get().container(Messages.RPT_JSPLOADER_UPDATE_CACHE_0),
                        I_CmsReport.FORMAT_NOTE);
                    m_report.print(
                        org.opencms.report.Messages.get().container(
                            org.opencms.report.Messages.RPT_ARGUMENT_1,
                            dbc.removeSiteRoot(resource.getRootPath())));
                    m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
                    m_jspLoader.getReferencingStrongLinks(jspCms, resource, includingFiles);
                    m_report.println(
                        org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                        I_CmsReport.FORMAT_OK);
                }
            }
        } catch (Throwable e) {
            // catch every thing including runtime exceptions
            m_report.println(e);
        } finally {
            dbc.clear();
            dbc = null;
            m_report.println(
                Messages.get().container(Messages.RPT_JSPLOADER_UPDATE_CACHE_END_0),
                I_CmsReport.FORMAT_HEADLINE);
        }
        return includingFiles;
    }
1211402
public static CmsListInfoBean getPageInfo(CmsObject cms, CmsResource res) throws CmsException {

        CmsListInfoBean result = new CmsListInfoBean();
        addPageInfo(cms, res, result);
        return result;
    }
384709
protected List<I_CmsResourceType> getDetailTypesForPage(CmsResource resource) {

        Collection<String> typesForPage = m_detailTypesByPage.get(resource.getRootPath());
        String parentPath = CmsFileUtil.removeTrailingSeparator(CmsResource.getParentFolder(resource.getRootPath()));
        Collection<String> typesForFolder = m_detailTypesByPage.get(parentPath);
        Set<String> allTypes = new HashSet<String>();
        allTypes.addAll(typesForPage);
        allTypes.addAll(typesForFolder);
        List<I_CmsResourceType> resTypes = new ArrayList<I_CmsResourceType>();
        CmsResourceManager resMan = OpenCms.getResourceManager();
        for (String typeName : allTypes) {
            if (typeName.startsWith(CmsDetailPageInfo.FUNCTION_PREFIX)) {
                continue;
            }
            try {
                I_CmsResourceType resType = resMan.getResourceType(typeName);
                resTypes.add(resType);
            } catch (CmsLoaderException e) {
                LOG.warn("Invalid resource type name" + typeName + "! " + e.getLocalizedMessage(), e);
            }
        }
        return resTypes;
    }
407776
protected List<String> getDetailPages(String type) {

        List<String> result = new ArrayList<String>();
        for (CmsADEConfigDataInternal configData : m_siteConfigurationsByPath.values()) {
            for (CmsDetailPageInfo pageInfo : wrap(configData).getDetailPagesForType(type)) {
                result.add(pageInfo.getUri());
            }
        }
        return result;
    }
689542
private List<I_CmsSearchFieldMapping> getMappings() {

        CmsSearchManager manager = OpenCms.getSearchManager();
        I_CmsSearchFieldConfiguration fieldConfig = manager.getFieldConfiguration(getParamFieldconfiguration());
        CmsLuceneField field;
        List<I_CmsSearchFieldMapping> result = null;
        Iterator<CmsSearchField> itFields;
        if (fieldConfig != null) {
            itFields = fieldConfig.getFields().iterator();
            while (itFields.hasNext()) {
                field = (CmsLuceneField)itFields.next();
                if (field.getName().equals(getParamField())) {
                    result = field.getMappings();
                }
            }
        } else {
            result = Collections.emptyList();
            if (LOG.isErrorEnabled()) {
                LOG.error(
                    Messages.get().getBundle().key(
                        Messages.ERR_SEARCHINDEX_EDIT_MISSING_PARAM_1,
                        A_CmsFieldConfigurationDialog.PARAM_FIELDCONFIGURATION));
            }
        }
        return result;
    }
1159121
public List<DetailInfo> getDetailInfosForSubsites(CmsObject cms) {

        List<DetailInfo> result = Lists.newArrayList();
        for (CmsADEConfigDataInternal configData : m_siteConfigurationsByPath.values()) {
            List<DetailInfo> infosForSubsite = wrap(configData).getDetailInfos(cms);
            result.addAll(infosForSubsite);
        }
        return result;
    }
221248
public static boolean isDetailContainersPage(CmsObject cms, String detailContainersPage) {

        boolean result = false;
        try {
            String detailName = CmsResource.getName(detailContainersPage);
            String parentFolder = CmsResource.getParentFolder(detailContainersPage);
            if (!parentFolder.endsWith("/" + DETAIL_CONTAINERS_FOLDER_NAME + "/")) {
                // this will be the case for locale dependent detail only pages, move one level up
                parentFolder = CmsResource.getParentFolder(parentFolder);
            }
            detailName = CmsStringUtil.joinPaths(CmsResource.getParentFolder(parentFolder), detailName);
            result = parentFolder.endsWith("/" + DETAIL_CONTAINERS_FOLDER_NAME + "/")
                && cms.existsResource(detailName, CmsResourceFilter.IGNORE_EXPIRATION);
        } catch (Throwable t) {
            // may happen in case string operations fail
            LOG.debug(t.getLocalizedMessage(), t);
        }
        return result;
    }
922646
public CmsPublishList getPublishList(CmsObject cms) throws CmsException {

        return m_securityManager.fillPublishList(
            cms.getRequestContext(),
            new CmsPublishList(cms.getRequestContext().getCurrentProject()));
    }
166069
public static List<CmsContextMenuEntryBean> getContextMenuEntries(
        final CmsObject cms,
        CmsUUID structureId,
        final AdeContext context) {

        Map<String, CmsContextMenuEntryBean> entries = new LinkedHashMap<String, CmsContextMenuEntryBean>();
        try {
            final List<CmsResource> resources;
            CmsResource resource = cms.readResource(structureId, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
            // in case of sitemap editor check visibility with empty list
            if (context.equals(AdeContext.sitemapeditor)) {
                resources = Collections.emptyList();
            } else {
                resources = Collections.singletonList(resource);
            }
            Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
            // context to check item visibility
            I_CmsDialogContext dcontext = new I_CmsDialogContextWithAdeContext() {

                public void error(Throwable error) {
                    // not supported
                }

                public void finish(CmsProject project, String siteRoot) {
                    // not supported
                }

                public void finish(Collection<CmsUUID> result) {
                    // not supported
                }

                public void focus(CmsUUID id) {
                    // not supported
                }

                public AdeContext getAdeContext() {

                    return context;
                }

                public List<CmsUUID> getAllStructureIdsInView() {

                    return null;
                }

                public String getAppId() {

                    return context.name();
                }

                public CmsObject getCms() {

                    return cms;
                }

                public ContextType getContextType() {

                    ContextType type;
                    switch (context) {
                        case pageeditor:
                        case editprovider:
                            type = ContextType.containerpageToolbar;
                            break;
                        case sitemapeditor:
                            type = ContextType.sitemapToolbar;
                            break;
                        default:
                            type = ContextType.fileTable;
                    }
                    return type;
                }

                public List<CmsResource> getResources() {

                    return resources;
                }

                public void navigateTo(String appId) {
                    // not supported
                }

                public void onViewChange() {
                    // not supported
                }

                public void reload() {
                    // not supported
                }

                public void setWindow(Window window) {
                    // not supported
                }

                public void start(String title, Component dialog) {
                    // not supported
                }

                public void start(String title, Component dialog, DialogWidth width) {
                    // not supported
                }

                public void updateUserInfo() {
                    // not supported
                }
            };
            Map<String, List<CmsContextMenuEntryBean>> submenus = new HashMap<String, List<CmsContextMenuEntryBean>>();
            List<I_CmsContextMenuItem> items = new ArrayList<I_CmsContextMenuItem>(
                OpenCms.getWorkplaceAppManager().getMenuItemProvider().getMenuItems());
            Collections.sort(items, new Comparator<I_CmsContextMenuItem>() {

                public int compare(I_CmsContextMenuItem arg0, I_CmsContextMenuItem arg1) {

                    return Float.compare(arg0.getOrder(), arg1.getOrder());
                }
            });

            for (I_CmsContextMenuItem item : items) {

                if (!item.isLeafItem()) {
                    CmsMenuItemVisibilityMode visibility = item.getVisibility(dcontext);
                    if (!visibility.isInVisible()) {
                        entries.put(
                            item.getId(),
                            new CmsContextMenuEntryBean(
                                visibility.isActive(),
                                true,
                                null,
                                item.getTitle(locale),
                                null,
                                CmsStringUtil.isEmptyOrWhitespaceOnly(visibility.getMessageKey())
                                ? null
                                : OpenCms.getWorkplaceManager().getMessages(locale).getString(
                                    visibility.getMessageKey()),
                                false,
                                new ArrayList<CmsContextMenuEntryBean>()));
                    }
                } else if ((item instanceof I_CmsADEAction) && ((I_CmsADEAction)item).isAdeSupported()) {
                    CmsMenuItemVisibilityMode visibility = item.getVisibility(dcontext);
                    if (!visibility.isInVisible()) {
                        String jspPath = ((I_CmsADEAction)item).getJspPath();
                        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(jspPath)) {
                            jspPath = OpenCms.getLinkManager().substituteLink(cms, jspPath);
                        }
                        CmsContextMenuEntryBean itemBean = new CmsContextMenuEntryBean(
                            visibility.isActive(),
                            true,
                            jspPath,
                            item.getTitle(locale),
                            ((I_CmsADEAction)item).getCommandClassName(),
                            CmsStringUtil.isEmptyOrWhitespaceOnly(visibility.getMessageKey())
                            ? null
                            : OpenCms.getWorkplaceManager().getMessages(locale).getString(visibility.getMessageKey()),
                            false,
                            null);
                        Map<String, String> params = ((I_CmsADEAction)item).getParams();
                        if (params != null) {
                            params = new HashMap<String, String>(params);
                            for (Entry<String, String> param : params.entrySet()) {
                                String value = CmsVfsService.prepareFileNameForEditor(cms, resource, param.getValue());
                                param.setValue(value);
                            }
                            itemBean.setParams(params);
                        }
                        entries.put(item.getId(), itemBean);
                        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(item.getParentId())) {
                            List<CmsContextMenuEntryBean> submenu;
                            if (submenus.containsKey(item.getParentId())) {
                                submenu = submenus.get(item.getParentId());
                            } else {
                                submenu = new ArrayList<CmsContextMenuEntryBean>();
                                submenus.put(item.getParentId(), submenu);
                            }
                            submenu.add(itemBean);
                        }
                    }
                }
            }
            List<CmsContextMenuEntryBean> result = new ArrayList<CmsContextMenuEntryBean>();
            for (I_CmsContextMenuItem item : items) {
                if (entries.containsKey(item.getId())) {
                    if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(item.getParentId())) {
                        if (entries.containsKey(item.getParentId())) {
                            CmsContextMenuEntryBean parent = entries.get(item.getParentId());
                            if (parent.getSubMenu() != null) {
                                parent.getSubMenu().add(entries.get(item.getId()));
                            }
                        }
                    } else {
                        result.add(entries.get(item.getId()));
                    }
                }
            }
            return result;
        } catch (CmsException e) {
            // ignore, the user probably has not enough permissions to read the resource
            LOG.debug(e.getLocalizedMessage(), e);
        }
        return Collections.emptyList();
    }
1122540
protected Map<String, String> getFolderTypes() throws CmsException {

        Map<String, String> result = new HashMap<String, String>();
        CmsObject cms = OpenCms.initCmsObject(getCms());
        if (m_data.isModuleConfig()) {
            Set<String> siteRoots = OpenCms.getSiteManager().getSiteRoots();
            for (String siteRoot : siteRoots) {
                cms.getRequestContext().setSiteRoot(siteRoot);
                for (CmsResourceTypeConfig config : getResourceTypes()) {
                    if (!config.isDetailPagesDisabled()) {
                        String typeName = config.getTypeName();
                        if (!config.isPageRelative()) { // elements stored with container pages can not be used as detail contents
                            String folderPath = config.getFolderPath(cms, null);
                            result.put(CmsStringUtil.joinPaths(folderPath, "/"), typeName);
                        }
                    }
                }
            }
        } else {
            for (CmsResourceTypeConfig config : getResourceTypes()) {
                if (!config.isDetailPagesDisabled()) {
                    String typeName = config.getTypeName();
                    if (!config.isPageRelative()) { // elements stored with container pages can not be used as detail contents
                        String folderPath = config.getFolderPath(getCms(), null);
                        result.put(CmsStringUtil.joinPaths(folderPath, "/"), typeName);
                    }
                }
            }
        }
        return result;
    }
1295097
private List<CmsSearchIndexSource> searchIndexSources() {

        CmsSearchManager manager = OpenCms.getSearchManager();
        I_CmsSearchIndex index = manager.getIndex(getParamIndexName());
        List<CmsSearchIndexSource> sources = index.getSources();
        return sources;
    }
1072190
protected void initDetailPageInfos() {

        for (CmsUUID id : m_data.getDetailPageTable().getAllIds()) {
            CmsDetailPageInfo info = m_data.getDetailPageTable().get(id);
            m_allDetailPageInfos.put(id, info);
        }
    }
617387
public boolean isDetailPage(CmsObject cms, CmsResource resource) {

        try {
            boolean result = m_detailPageIdCache.get(resource).booleanValue();
            if (!result) {
                // We want new detail pages to be available fast, so we don't cache negative results
                m_detailPageIdCache.invalidate(resource);
            }
            return result;
        } catch (ExecutionException e) {
            LOG.error(e.getLocalizedMessage(), e);
            return true;
        }
    }
231269
public CmsDetailPageInfo getBestDetailPage(String type) {

        List<CmsDetailPageInfo> infos = m_map.get(type);
        if ((infos == null) || infos.isEmpty()) {
            return null;
        }
        return infos.get(0);
    }