Internal method to get the moved folders from the publish list.<p>

@param cms the current CMS context
@return the list of moved folders from the publish list
@throws CmsException if something goes wrong
510157
protected List<CmsResource> getMovedFolders(CmsObject cms) throws CmsException {

        CmsProject onlineProject = cms.readProject(CmsProject.ONLINE_PROJECT_ID);
        List<CmsResource> movedFolders = new ArrayList<CmsResource>();
        for (CmsResource folder : m_folderList) {
            if (folder.getState().isChanged()) {
                CmsProject oldProject = cms.getRequestContext().getCurrentProject();
                boolean isMoved = false;
                try {
                    cms.getRequestContext().setCurrentProject(onlineProject);
                    CmsResource onlineResource = cms.readResource(folder.getStructureId());
                    isMoved = !onlineResource.getRootPath().equals(folder.getRootPath());
                } catch (CmsVfsResourceNotFoundException e) {
                    // resource not found online, this means it doesn't matter whether it has been moved
                } finally {
                    cms.getRequestContext().setCurrentProject(oldProject);
                }
                if (isMoved) {
                    movedFolders.add(folder);
                }
            }
        }
        return movedFolders;
    }
1300292
private List<CmsResource> getVirtualLogResources(CmsObject cms) throws CmsException {

        List<CmsResource> virtualResources = Lists.newArrayList();
        for (CmsModule module : OpenCms.getModuleManager().getAllInstalledModules()) {
            String path = CmsStringUtil.joinPaths(LOG_PATH, module.getName() + ".log");
            CmsResource res = createFakeBinaryFile(path);
            virtualResources.add(res);
        }
        return virtualResources;
    }
55705
protected List<CmsGroup> getGroups() throws CmsException {

        List<CmsGroup> groups = new ArrayList<CmsGroup>();
        if (getParamUser() != null) {
            groups.addAll(getCms().getGroupsOfUser(getParamUser(), false));
        } else {
            groups.addAll(OpenCms.getRoleManager().getManageableGroups(getCms(), "", true));
        }
        if (getParamFlags() != null) {
            int flags = Integer.parseInt(getParamFlags());
            CmsPrincipal.filterFlag(groups, flags);
        }
        if ((getParamOufqn() != null) && !getParamOufqn().equals("null")) {
            Iterator<CmsGroup> groupsIter = groups.iterator();
            while (groupsIter.hasNext()) {
                CmsGroup group = groupsIter.next();
                if (!group.getOuFqn().startsWith(getParamOufqn())) {
                    groupsIter.remove();
                }
            }
        }
        return groups;
    }
113392
public List<CmsResource> getUsersPubList(CmsRequestContext context) throws CmsException {

        List<CmsResource> result = null;
        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        try {
            result = m_driverManager.getUsersPubList(dbc, context.getCurrentUser().getId());
        } catch (Exception e) {
            dbc.report(
                null,
                Messages.get().container(Messages.ERR_READ_USER_PUBLIST_1, context.getCurrentUser().getName()),
                e);

        } finally {
            dbc.clear();
        }
        return result;
    }
857961
public CmsResource createFolder(CmsObject cms) throws CmsException {

        if (m_folder != null) {
            return m_folder;
        }
        return cms.createResource(
            m_path,
            OpenCms.getResourceManager().getResourceType(CmsResourceTypeFolder.RESOURCE_TYPE_NAME).getTypeId());
    }
797148
public void upgradeContent(CmsObject cms) throws CmsException {

        if (m_content == null) {
            m_content = cms.readFile(m_resource).getContents();
        }
    }
132678
private List<CmsResource> getDecorationMapFiles(CmsObject cms) throws CmsException {

        List<CmsResource> files = new ArrayList<CmsResource>();

        // calcualte the basename for the decoration map files
        // the basename is the filename without the fileextension and any "_locale" postfixes
        // e.g. decoration_en.csv will generate "decoration" as basename
        StringBuffer baseFilename = new StringBuffer();
        baseFilename.append(CmsResource.getParentFolder(m_configurationFile));
        String filename = cms.readResource(m_configurationFile).getName();
        // get rid of the fileextension if there is one
        if (filename.lastIndexOf(".") > -1) {
            filename = filename.substring(0, filename.lastIndexOf("."));
        }
        // extract the basename
        if (filename.lastIndexOf("_") > -1) {
            filename = filename.substring(0, filename.lastIndexOf("_"));
        }
        baseFilename.append(filename);
        String basename = baseFilename.toString();

        // get all config files which belong to this basename
        int plainId;
        try {
            plainId = OpenCms.getResourceManager().getResourceType(
                CmsResourceTypePlain.getStaticTypeName()).getTypeId();
        } catch (CmsLoaderException e) {
            // this should really never happen
            plainId = CmsResourceTypePlain.getStaticTypeId();
        }
        List<CmsResource> resources = cms.readResources(
            CmsResource.getParentFolder(m_configurationFile),
            CmsResourceFilter.DEFAULT);
        Iterator<CmsResource> i = resources.iterator();
        while (i.hasNext()) {
            CmsResource res = i.next();
            if (cms.getSitePath(res).startsWith(basename) && (res.getTypeId() == plainId)) {
                files.add(res);
            }
        }

        return files;
    }
1365670
@SuppressWarnings("unused")
    public Set<String> getCSSHeadIncludes(CmsObject cms, CmsResource resource) throws CmsException {

        return getCSSHeadIncludes();
    }
1229402
private List<CmsResource> getContents(String folderPath, String type) throws CmsException {

        CmsPathMap<CmsResource> pathMap = getPathMapForType(type);
        return pathMap.getChildValues(folderPath);
    }
724477
public List<CmsContainerElementBean> getFavoriteList(CmsObject cms) throws CmsException {

        CmsUser user = cms.getRequestContext().getCurrentUser();
        Object obj = user.getAdditionalInfo(ADDINFO_ADE_FAVORITE_LIST);

        List<CmsContainerElementBean> favList = new ArrayList<CmsContainerElementBean>();
        if (obj instanceof String) {
            try {
                JSONArray array = new JSONArray((String)obj);
                for (int i = 0; i < array.length(); i++) {
                    try {
                        favList.add(elementFromJson(array.getJSONObject(i)));
                    } catch (Throwable e) {
                        // should never happen, catches wrong or no longer existing values
                        LOG.warn(e.getLocalizedMessage());
                    }
                }
            } catch (Throwable e) {
                // should never happen, catches json parsing
                LOG.warn(e.getLocalizedMessage());
            }
        } else {
            // save to be better next time
            saveFavoriteList(cms, favList);
        }

        return favList;
    }
523065
public List<CmsJspResourceWrapper> readFilesInFolder(String resourcePath) throws CmsException {

        return CmsJspElFunctions.convertResourceList(m_cms, m_cms.getFilesInFolder(resourcePath));
    }
10832
private CmsObject getRootCms() throws CmsException {

        if (null == m_rootCms) {
            m_rootCms = OpenCms.initCmsObject(m_cms);
            m_rootCms.getRequestContext().setSiteRoot("");
        }
        return m_rootCms;
    }
913029
public List<CmsAlias> getAliasesForSite(CmsObject cms, String siteRoot) throws CmsException {

        return m_securityManager.getAliasesForSite(cms.getRequestContext(), siteRoot);
    }
339230
protected static void checkIsFolder(CmsResource resource) throws CmsException {

        if (!isFolder(resource)) {
            throw new CmsIllegalArgumentException(
                Messages.get().container(
                    org.opencms.file.Messages.ERR_REWRITE_LINKS_ROOT_NOT_FOLDER_1,
                    resource.getRootPath()));
        }
    }
717923
protected void parseLinks(CmsObject cms) throws CmsException {

        List<CmsResource> linkParseables = new ArrayList<>();
        for (CmsResourceImportData resData : m_moduleData.getResourceData()) {
            CmsResource importRes = resData.getImportResource();
            if ((importRes != null) && m_importIds.contains(importRes.getStructureId()) && isLinkParsable(importRes)) {
                linkParseables.add(importRes);
            }
        }
        m_report.println(Messages.get().container(Messages.RPT_START_PARSE_LINKS_0), I_CmsReport.FORMAT_HEADLINE);
        CmsImportVersion10.parseLinks(cms, linkParseables, m_report);
        m_report.println(Messages.get().container(Messages.RPT_END_PARSE_LINKS_0), I_CmsReport.FORMAT_HEADLINE);
    }
717817
protected List<CmsCategory> getResourceCategories() throws CmsException {

        if (m_resCats == null) {
            m_resCats = m_categoryService.readResourceCategories(getJsp().getCmsObject(), getParamResource());
        }
        return m_resCats;
    }
431792
public CmsObject getOfflineCmsObject(CmsObject cms) {

        CmsObject res = null;
        try {
            if (!cms.getRequestContext().getCurrentProject().isOnlineProject()) {
                return OpenCms.initCmsObject(cms);
            }
            res = OpenCms.initCmsObject(cms);
            List<CmsProject> projects = OpenCms.getOrgUnitManager().getAllAccessibleProjects(res, "/", true);
            Iterator<CmsProject> projIterator = projects.iterator();
            boolean offFound = false;
            while (projIterator.hasNext() & !offFound) {
                CmsProject offP = projIterator.next();
                if (!offP.isOnlineProject()) {
                    res.getRequestContext().setCurrentProject(offP);
                    offFound = true;
                }
            }
        } catch (CmsException e) {
            return cms;
        }
        return res;
    }