/** * Returns the site root.<p> * * @return the site root */ public String getSite() { return m_context.getSiteRoot(); }
/** * Returns the site root.<p> * * @return the site root */ public String getSite() { return m_context.getSiteRoot(); }
/** * Creates a new builder instance.<p> * * @param cms the CMS context to use */ public CmsSiteSelectorOptionBuilder(CmsObject cms) { m_cms = cms; m_siteRoot = m_cms.getRequestContext().getSiteRoot(); }
/** * Stores information about the last edited container page.<p> * * @param cms the CMS context * @param pageId the page id * @param detailId the detail content id */ public void setLastPage(CmsObject cms, CmsUUID pageId, CmsUUID detailId) { m_lastPage = new LastPageBean(cms.getRequestContext().getSiteRoot(), pageId, detailId); }
/** * Initialize a HTML report for this Thread.<p> * * @param locale the locale for the report output messages */ protected void initHtmlReport(Locale locale) { m_report = new CmsHtmlReport(locale, m_cms.getRequestContext().getSiteRoot()); }
/** * Initialize a HTML report for this Thread.<p> * * This method is reserved for older report threads that still use * XML templates to generate their output.<p> * * @param locale the locale for the report output messages */ protected void initOldHtmlReport(Locale locale) { m_report = new CmsHtmlReport(locale, m_cms.getRequestContext().getSiteRoot(), true, false); } }
/** * Returns the current site for the provided OpenCms user context object.<p> * * In the unlikely case that no site matches with the provided OpenCms user context, * the default site is returned.<p> * * @param cms the OpenCms user context object to check for the site * * @return the current site for the provided OpenCms user context object */ public CmsSite getCurrentSite(CmsObject cms) { CmsSite site = getSiteForSiteRoot(cms.getRequestContext().getSiteRoot()); return (site == null) ? m_defaultSite : site; }
/** * Returns the current site for the provided OpenCms user context object.<p> * * In the unlikely case that no site matches with the provided OpenCms user context, * the default site is returned.<p> * * @param cms the OpenCms user context object to check for the site * * @return the current site for the provided OpenCms user context object */ public CmsSite getCurrentSite(CmsObject cms) { CmsSite site = getSiteForSiteRoot(cms.getRequestContext().getSiteRoot()); return (site == null) ? m_defaultSite : site; }
/** * @see org.opencms.ade.sitemap.shared.rpc.I_CmsSitemapService#updateAliasEditorStatus(boolean) */ public void updateAliasEditorStatus(boolean editing) { CmsObject cms = getCmsObject(); if (editing) { aliasEditorLockTable.update(cms, cms.getRequestContext().getSiteRoot()); } else { aliasEditorLockTable.clear(cms, cms.getRequestContext().getSiteRoot()); } }
/** * Initialize a HTML report for this Thread.<p> * * @param locale the locale for the report output messages */ protected void initHtmlReport(Locale locale) { boolean isVaadin = A_CmsUI.get() != null; m_report = isVaadin ? new CmsVaadinHtmlReport(locale, m_cms.getRequestContext().getSiteRoot(), getLogChannel()) : new CmsHtmlReport(locale, m_cms.getRequestContext().getSiteRoot()); }
/** * Updates the session info object with the information from * the given request context.<p> * * @param context the request context to update the session with */ protected void update(CmsRequestContext context) { m_timeUpdated = System.currentTimeMillis(); m_siteRoot = context.getSiteRoot(); setProject(context.getCurrentProject().getUuid()); m_ouFqn = context.getOuFqn(); } }
/** * Updates the session info object with the information from * the given request context.<p> * * @param context the request context to update the session with */ protected void update(CmsRequestContext context) { m_timeUpdated = System.currentTimeMillis(); m_siteRoot = context.getSiteRoot(); setProject(context.currentProject().getUuid()); m_ouFqn = context.getOuFqn(); } }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, org.opencms.workplace.explorer.CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { CmsSite currentSite = OpenCms.getSiteManager().getSiteForRootPath(cms.getRequestContext().getSiteRoot()); CmsSite resourceSite = OpenCms.getSiteManager().getSiteForRootPath(resourceUtil[0].getResource().getRootPath()); return (currentSite != null) && (resourceSite != null) && (currentSite != resourceSite); }
/** * Changes to the given site. Will update session and workplace settings.<p> * * @param siteRoot the site to change to */ public void changeSite(String siteRoot) { if (!getCmsObject().getRequestContext().getSiteRoot().equals(siteRoot)) { getCmsObject().getRequestContext().setSiteRoot(siteRoot); getWorkplaceSettings().setSite(siteRoot); OpenCms.getSessionManager().updateSessionInfo(getCmsObject(), getHttpSession()); } }
/** * @see org.opencms.ui.components.fileselect.A_CmsFileSelectField#setResourceValue(org.opencms.file.CmsResource) */ @Override protected void setResourceValue(CmsResource resource) { CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(resource.getRootPath()); if (!m_useRootPaths && (site != null) && A_CmsUI.getCmsObject().getRequestContext().getSiteRoot().equals(site.getSiteRoot())) { setValue(true, A_CmsUI.getCmsObject().getSitePath(resource)); } else { setValue(true, resource.getRootPath()); } }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getListItems() */ @Override protected List<CmsListItem> getListItems() throws CmsException { String storedSiteRoot = getCms().getRequestContext().getSiteRoot(); try { getCms().getRequestContext().setSiteRoot(""); return super.getListItems(); } finally { getCms().getRequestContext().setSiteRoot(storedSiteRoot); } }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getListItems() */ @Override protected List getListItems() throws CmsException { String storedSiteRoot = getCms().getRequestContext().getSiteRoot(); try { getCms().getRequestContext().setSiteRoot(""); return super.getListItems(); } finally { getCms().getRequestContext().setSiteRoot(storedSiteRoot); } }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getListItems() */ @Override protected List<CmsListItem> getListItems() throws CmsException { String storedSiteRoot = getCms().getRequestContext().getSiteRoot(); try { getCms().getRequestContext().setSiteRoot(""); return super.getListItems(); } finally { getCms().getRequestContext().setSiteRoot(storedSiteRoot); } }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getListItems() */ @Override protected List<CmsListItem> getListItems() throws CmsException { String oldSite = getCms().getRequestContext().getSiteRoot(); try { getCms().getRequestContext().setSiteRoot(""); return super.getListItems(); } finally { getCms().getRequestContext().setSiteRoot(oldSite); } }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getListItems() */ @Override protected List getListItems() throws CmsException { String oldSite = getCms().getRequestContext().getSiteRoot(); try { getCms().getRequestContext().setSiteRoot(""); return super.getListItems(); } finally { getCms().getRequestContext().setSiteRoot(oldSite); } }