Returns the new resource site path.<p>

@return the new resource site path
@throws CmsException if something goes wrong
167545
private String getNewContentName() throws CmsException {

        String sitePath = OpenCms.getResourceManager().getNameGenerator().getNewFileName(
            m_cms,
            CmsStringUtil.joinPaths(
                m_cms.getRequestContext().removeSiteRoot(m_configuration.getContentParentFolder().getRootPath()),
                m_configuration.getNamePattern()),
            5);
        return sitePath;
    }
320760
public CmsJspNavBuilder getNavBuilder() {

        if (m_navBuilder == null) {
            m_navBuilder = new CmsJspNavBuilder();
            m_navBuilder.init(m_cms, null, getSitePath());
        }
        return m_navBuilder;
    }
350268
private CmsResource getContainerpage(CmsObject cms) throws CmsException {

        String currentUri = cms.getRequestContext().getUri();
        CmsResource containerPage = cms.readResource(currentUri);
        if (!CmsResourceTypeXmlContainerPage.isContainerPage(containerPage)) {
            // container page is used as template
            String cntPagePath = cms.readPropertyObject(
                containerPage,
                CmsPropertyDefinition.PROPERTY_TEMPLATE_ELEMENTS,
                true).getValue("");
            try {
                containerPage = cms.readResource(cntPagePath);
            } catch (CmsException e) {
                if (!LOG.isDebugEnabled()) {
                    LOG.warn(e.getLocalizedMessage());
                }
                LOG.debug(e.getLocalizedMessage(), e);
            }
        }
        return containerPage;
    }
986208
public CmsResource buildResource() {

        return new CmsResource(
            m_structureId,
            m_resourceId,
            m_rootPath,
            m_type,
            m_flags,
            m_projectLastModified,
            m_state,
            m_dateCreated,
            m_userCreated,
            m_dateLastModified,
            m_userLastModified,
            m_dateReleased,
            m_dateExpired,
            m_length,
            m_flags,
            m_dateContent,
            m_version);
    }
1211402
public static CmsListInfoBean getPageInfo(CmsObject cms, CmsResource res) throws CmsException {

        CmsListInfoBean result = new CmsListInfoBean();
        addPageInfo(cms, res, result);
        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());
    }
761249
CmsSitemapEntryBean internalCreateSitemapEntryBean(CmsObject cms, CmsResource resource) throws CmsException {

        cms = OpenCms.initCmsObject(cms);
        cms.getRequestContext().setSiteRoot("");
        CmsJspNavBuilder navBuilder = new CmsJspNavBuilder(cms);
        CmsJspNavElement entry = navBuilder.getNavigationForResource(resource.getRootPath());
        if (entry == null) {
            // may be null for expired resources
            return null;
        }
        return prepareSitemapEntry(cms, entry, false, true);
    }
10832
private CmsObject getRootCms() throws CmsException {

        if (null == m_rootCms) {
            m_rootCms = OpenCms.initCmsObject(m_cms);
            m_rootCms.getRequestContext().setSiteRoot("");
        }
        return m_rootCms;
    }
898031
public CmsResource getOrCreateFolder(CmsObject cms) throws CmsException {

        CmsResource result = getFolder(cms);
        if (result != null) {
            return result;
        }
        return createFolder(cms);
    }
168726
protected CmsResource getNextResource() {

        if ((m_collectorResult != null) && (m_collectorResult.size() > 0)) {

            m_contentInfoBean.incResultIndex();
            return m_collectorResult.remove(0);
        }

        return null;
    }
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;
    }
317150
public String getSiteTitle(CmsObject cms, CmsResource resource) throws CmsException {

        String title = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_TITLE, false).getValue();
        if (title == null) {
            title = resource.getRootPath();
        }
        if (resource.getRootPath().equals(getSharedFolder())) {
            title = SHARED_FOLDER_TITLE;
        }
        return title;
    }
1137638
public CmsVfsSitemapService getSitemapService() throws CmsException {

        CmsVfsSitemapService svc = new CmsVfsSitemapService();
        CmsObject cms = OpenCms.initCmsObject(m_cms);
        cms.getRequestContext().setSiteRoot("");
        svc.setCms(cms);
        return svc;
    }
1229999
protected CmsTemplateLoaderFacade getTemplateLoaderFacade(
        CmsObject cms,
        CmsResource resource,
        HttpServletRequest req)
    throws CmsException {

        return OpenCms.getResourceManager().getTemplateLoaderFacade(
            cms,
            req,
            resource,
            getTemplatePropertyDefinition());
    }
282561
protected void doLoadNextFile() throws CmsException {

        super.doLoadNextResource();
        if (m_resource == null) {
            return;
        }

        // upgrade the resource to a file
        CmsFile file = m_cms.readFile(m_resource);

        // unmarshal the XML content from the resource, don't use unmarshal(CmsObject, CmsResource)
        // as no support for getting the historic version that has been cached by a CmsHistoryResourceHandler
        // will come from there!
        m_content = CmsXmlContentFactory.unmarshal(m_cms, file, pageContext.getRequest());

        // check if locale is available
        m_contentLocale = m_locale;
        if (!m_content.hasLocale(m_contentLocale)) {
            Iterator<Locale> it = OpenCms.getLocaleManager().getDefaultLocales().iterator();
            while (it.hasNext()) {
                Locale locale = it.next();
                if (m_content.hasLocale(locale)) {
                    // found a matching locale
                    m_contentLocale = locale;
                    break;
                }
            }
        }
    }
214273
protected void findRoot(Collection<CmsResource> resources) throws CmsException {

        m_commonRoot = getCommonSite(resources);
        String commonPath = getCommonAncestorPath(resources);
        try {
            m_rootResource = m_cms.readResource(m_commonRoot, m_filter);
        } catch (CmsVfsResourceNotFoundException e) {
            String currentPath = commonPath;
            String lastWorkingPath = null;
            while (m_cms.existsResource(currentPath, m_filter)) {
                lastWorkingPath = currentPath;
                currentPath = CmsResource.getParentFolder(currentPath);
            }
            m_rootResource = m_cms.readResource(lastWorkingPath, m_filter);
            m_commonRoot = lastWorkingPath;
        }
        m_knownResources.add(m_rootResource);
    }
497919
public String getSelectPath(CmsSitemapEntryBean sitemapEntry) {

        String normalizedSiteRoot = CmsStringUtil.joinPaths(CmsCoreProvider.get().getSiteRoot(), "/");
        String rootPath = sitemapEntry.getRootPath();
        if (rootPath.startsWith(normalizedSiteRoot)) {
            return rootPath.substring(normalizedSiteRoot.length() - 1);
        }
        return sitemapEntry.getRootPath();
    }