/** * Returns a list of all {@link CmsSite} instances that are compatible to the given organizational unit.<p> * * @param cms the current OpenCms user context * @param workplaceMode if true, the root and current site is included for the admin user * and the view permission is required to see the site root * @param ouFqn the organizational unit * * @return a list of all site available for the current user */ public List<CmsSite> getAvailableSites(CmsObject cms, boolean workplaceMode, String ouFqn) { return getAvailableSites(cms, workplaceMode, workplaceMode, ouFqn); }
/** * Returns a list of all sites that are compatible to the given organizational unit.<p> * * @param cms the current cms context * @param workplaceMode if true, the root and current site is included for the admin user * and the view permission is required to see the site root * @param ouFqn the organizational unit * * @return a list of all site available for the current user * * @deprecated Use {@link OpenCms#getSiteManager()} to obtain the configured site manager instance, * then use the method with the same name and signature. */ public static List getAvailableSites(CmsObject cms, boolean workplaceMode, String ouFqn) { return OpenCms.getSiteManager().getAvailableSites(cms, workplaceMode, ouFqn); }
/** * Returns a list of all sites available for the current user.<p> * * @param cms the current OpenCms user context * @param workplaceMode if true, the root and current site is included for the admin user * and the view permission is required to see the site root * * @return a list of all site available for the current user */ public List getAvailableSites(CmsObject cms, boolean workplaceMode) { return getAvailableSites(cms, workplaceMode, cms.getRequestContext().getOuFqn()); }
/** * Returns a list of all sites available (visible) for the current user.<p> * * @param cms the current OpenCms user context * @param workplaceMode if true, the root and current site is included for the admin user * and the view permission is required to see the site root * * @return a list of all sites available for the current user */ public List<CmsSite> getAvailableSites(CmsObject cms, boolean workplaceMode) { return getAvailableSites(cms, workplaceMode, cms.getRequestContext().getOuFqn()); }
/** * Determines if the site selector frame should be shown depending on the tree type or the value of a request parameter.<p> * * If only one site is available, the site selector is not displayed.<p> * * @param request the HttpServletRequest to check */ private void computeSiteSelector(HttpServletRequest request) { boolean selectorForType = TYPE_SIBLING.equals(getTreeType()) || TYPE_COPY.equals(getTreeType()) || TYPE_PAGELINK.equals(getTreeType()) || TYPE_PREFERENCES.equals(getTreeType()); boolean showFromRequest = Boolean.valueOf(request.getParameter(PARAM_SHOWSITESELECTOR)).booleanValue(); if (selectorForType || showFromRequest) { // get all available sites int siteCount = OpenCms.getSiteManager().getAvailableSites(getCms(), true).size(); setShowSiteSelector(siteCount > 1); return; } setShowSiteSelector(false); }
/** * Determines if the site selector frame should be shown depending on the tree type or the value of a request parameter.<p> * * If only one site is available, the site selector is not displayed.<p> * * @param request the HttpServletRequest to check */ private void computeSiteSelector(HttpServletRequest request) { boolean selectorForType = TYPE_SIBLING.equals(getTreeType()) || TYPE_COPY.equals(getTreeType()) || TYPE_PAGELINK.equals(getTreeType()) || TYPE_PREFERENCES.equals(getTreeType()); boolean showFromRequest = Boolean.valueOf(request.getParameter(PARAM_SHOWSITESELECTOR)).booleanValue(); if (selectorForType || showFromRequest) { // get all available sites int siteCount = OpenCms.getSiteManager().getAvailableSites(getCms(), true).size(); setShowSiteSelector(siteCount > 1); return; } setShowSiteSelector(false); }
/** * Returns a list of all sites available for the current user.<p> * * @param cms the current cms context * @param workplaceMode if true, the root and current site is included for the admin user * and the view permission is required to see the site root * * @return a list of all site available for the current user * * @deprecated Use {@link OpenCms#getSiteManager()} to obtain the configured site manager instance, * then use the method with the same name and signature. */ public static List getAvailableSites(CmsObject cms, boolean workplaceMode) { return OpenCms.getSiteManager().getAvailableSites(cms, workplaceMode, cms.getRequestContext().getOuFqn()); }
/** * Returns a html select box filled with the current users accessible sites.<p> * * @param htmlAttributes attributes that will be inserted into the generated html * @return a html select box filled with the current users accessible sites */ public String getSiteSelect(String htmlAttributes) { List options = new ArrayList(); List values = new ArrayList(); int selectedIndex = 0; List sites = OpenCms.getSiteManager().getAvailableSites(getCms(), true); Iterator i = sites.iterator(); int pos = 0; while (i.hasNext()) { CmsSite site = (CmsSite)i.next(); values.add(site.getSiteRoot()); options.add(site.getTitle()); if (site.getSiteRoot().equals(getSettings().getSite())) { // this is the user's current site selectedIndex = pos; } pos++; } return buildSelect(htmlAttributes, options, values, selectedIndex); }
/** * Indicates if the site selector should be shown in the top frame depending on the count of accessible sites.<p> * * @return true if site selector should be shown, otherwise false */ public boolean showSiteSelector() { if (getSettings().getUserSettings().getRestrictExplorerView()) { // restricted explorer view to site and folder, do not show site selector return false; } // count available sites int siteCount = OpenCms.getSiteManager().getAvailableSites(getCms(), true).size(); return (siteCount > 1); }
List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites( cms, true,
/** * Indicates if the site selector should be shown in the top frame depending on the count of accessible sites.<p> * * @return true if site selector should be shown, otherwise false */ public boolean showSiteSelector() { if (getSettings().getUserSettings().getRestrictExplorerView()) { // restricted explorer view to site and folder, do not show site selector return false; } // count available sites int siteCount = OpenCms.getSiteManager().getAvailableSites(getCms(), true).size(); return (siteCount > 1); }
final List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites( cms, false,
int selectedIndex = 0; List sites = OpenCms.getSiteManager().getAvailableSites(getCms(), true); String wpSite = getParamTabWpSite(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(wpSite) && !wpSite.endsWith("/")) {
/** * Returns a html select box filled with the current users accessible sites.<p> * * @param htmlAttributes attributes that will be inserted into the generated html * @return a html select box filled with the current users accessible sites */ public String getSiteSelect(String htmlAttributes) { List<String> options = new ArrayList<String>(); List<String> values = new ArrayList<String>(); int selectedIndex = 0; List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites(getCms(), true); Iterator<CmsSite> i = sites.iterator(); int pos = 0; while (i.hasNext()) { CmsSite site = i.next(); values.add(site.getSiteRoot()); options.add(substituteSiteTitle(site.getTitle())); String siteRoot = CmsFileUtil.addTrailingSeparator(site.getSiteRoot()); String settingsSiteRoot = getSettings().getSite(); if (settingsSiteRoot != null) { settingsSiteRoot = CmsFileUtil.addTrailingSeparator(settingsSiteRoot); } if (siteRoot.equals(settingsSiteRoot)) { // this is the user's current site selectedIndex = pos; } pos++; } return buildSelect(htmlAttributes, options, values, selectedIndex); }
int selectedIndex = 0; List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites( cms, true,
List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites(cms, true); if (sites.size() > 0) { startSiteRoot = sites.get(0).getSiteRoot();
List<CmsSite> sitesList = OpenCms.getSiteManager().getAvailableSites(getCms(), true, false, getParamOufqn());
showSiteUrls = true; List sites = OpenCms.getSiteManager().getAvailableSites(getCms(), includeRootSite);
showSiteUrls = true; List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites( getCms(), includeRootSite,
List<CmsSite> sites = siteManager.getAvailableSites(m_cms, true, false, m_cms.getRequestContext().getOuFqn()); try { CmsObject rootCms = OpenCms.initCmsObject(m_cms);