/** * Returns a flag indicating if the site is the shared site. * * @return <code>true</code> if the site is the shared site, * or <code>false</code> if it is not the shared site. */ public boolean isSharedSite() { return OpenCms.getSiteManager().getSharedFolder().equals(m_siteRoot + "/"); }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#isColumnVisible(int) */ @Override protected boolean isColumnVisible(int colFlag) { boolean isVisible = (colFlag == CmsUserSettings.FILELIST_TITLE); isVisible = isVisible || (colFlag == LIST_COLUMN_TYPEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_LOCKICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_PROJSTATEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_NAME.hashCode()); isVisible = isVisible || ((colFlag == LIST_COLUMN_SITE.hashCode()) && (OpenCms.getSiteManager().getSites().size() > 1)); return isVisible; }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#isColumnVisible(int) */ @Override protected boolean isColumnVisible(int colFlag) { boolean isVisible = (colFlag == CmsUserSettings.FILELIST_TITLE); isVisible = isVisible || (colFlag == LIST_COLUMN_TYPEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_LOCKICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_PROJSTATEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_NAME.hashCode()); isVisible = isVisible || ((colFlag == LIST_COLUMN_SITE.hashCode()) && (OpenCms.getSiteManager().getSites().size() > 1)); return isVisible; }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#isColumnVisible(int) */ @Override protected boolean isColumnVisible(int colFlag) { boolean isVisible = (colFlag == CmsUserSettings.FILELIST_TITLE); isVisible = isVisible || (colFlag == LIST_COLUMN_TYPEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_LOCKICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_PROJSTATEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_NAME.hashCode()); isVisible = isVisible || ((colFlag == LIST_COLUMN_SITE.hashCode()) && (OpenCms.getSiteManager().getSites().size() > 1)); return isVisible; }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#isColumnVisible(int) */ @Override protected boolean isColumnVisible(int colFlag) { boolean isVisible = (colFlag == CmsUserSettings.FILELIST_TITLE); isVisible = isVisible || (colFlag == LIST_COLUMN_TYPEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_LOCKICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_PROJSTATEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_NAME.hashCode()); isVisible = isVisible || ((colFlag == LIST_COLUMN_SITE.hashCode()) && (OpenCms.getSiteManager().getSites().size() > 1)); return isVisible; }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#isColumnVisible(int) */ @Override protected boolean isColumnVisible(int colFlag) { boolean isVisible = (colFlag == CmsUserSettings.FILELIST_TITLE); isVisible = isVisible || (colFlag == LIST_COLUMN_TYPEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_LOCKICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_PROJSTATEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_NAME.hashCode()); isVisible = isVisible || ((colFlag == LIST_COLUMN_SITE.hashCode()) && (OpenCms.getSiteManager().getSites().size() > 1)); return isVisible; }
/** * Return the site root if the target of this link is internal, or <code>null</code> otherwise.<p> * * @return the site root if the target of this link is internal, or <code>null</code> otherwise */ public String getSiteRoot() { if (m_internal && (m_siteRoot == null)) { m_siteRoot = OpenCms.getSiteManager().getSiteRoot(m_target); if (m_siteRoot == null) { m_siteRoot = ""; } } return m_siteRoot; }
/** * Return the site root if the target of this link is internal, or <code>null</code> otherwise.<p> * * @return the site root if the target of this link is internal, or <code>null</code> otherwise */ public String getSiteRoot() { if (m_internal && (m_siteRoot == null)) { m_siteRoot = OpenCms.getSiteManager().getSiteRoot(m_target); if (m_siteRoot == null) { m_siteRoot = ""; } } return m_siteRoot; }
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#isColumnVisible(int) */ @Override protected boolean isColumnVisible(int colFlag) { boolean isVisible = (colFlag == CmsUserSettings.FILELIST_TITLE); isVisible = isVisible || (colFlag == LIST_COLUMN_TYPEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_LOCKICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_PROJSTATEICON.hashCode()); isVisible = isVisible || (colFlag == LIST_COLUMN_NAME.hashCode()); isVisible = isVisible || ((colFlag == LIST_COLUMN_SITE.hashCode()) && (OpenCms.getSiteManager().getSites().size() > 1)); return isVisible; }
/** * Constructor, only package visible.<p> */ CmsWorkplaceSettings() { m_explorerPage = 1; m_explorerResource = new HashMap<String, String>(); m_treeType = new HashMap<String, String>(); m_treeSite = new HashMap<String, String>(); m_frameUris = new HashMap<String, String>(); m_lastUsedGalleries = new HashMap<String, String>(); m_currentSite = OpenCms.getSiteManager().getDefaultSite().getSiteRoot(); }
/** * 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); }
/** * Constructor, only package visible.<p> */ CmsWorkplaceSettings() { m_explorerPage = 1; m_explorerResource = new HashMap(); m_treeType = new HashMap(); m_treeSite = new HashMap(); m_frameUris = new HashMap(); m_lastUsedGalleries = new HashMap(); m_currentSite = OpenCms.getSiteManager().getDefaultSite().getSiteRoot(); }
/** * Gets the initial value for the 'default location' option.<p> * * @param folderResource the current folder * * @return the initial value for the option */ private Boolean getInitialValueForUseDefaultLocationOption(CmsResource folderResource) { String rootPath = folderResource.getRootPath(); return Boolean.valueOf(OpenCms.getSiteManager().getSiteForRootPath(rootPath) != null); }
/** * Gets the main translation locale configured for the given root path.<p> * * @param rootPath a root path * * @return the main translation locale configured for the given path, or null if none was found */ public Locale getMainLocale(String rootPath) { CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(rootPath); if (site == null) { return null; } return site.getMainTranslationLocale(null); }
/** * Returns the URL of the page to be displayed on the imprint.<p> * * @return the URL of the page */ public String getUrl() { StringBuffer result = new StringBuffer(64); CmsSite site = OpenCms.getSiteManager().getCurrentSite(getCmsObject()); result.append(site.getUrl()); result.append(link(getRequestContext().getUri())); return result.toString(); }
/** * @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); }
/** * 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()); }
/** * 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); }
/** * 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); }
/** * @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()); } }