/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(CmsSite that) { if (that == this) { return 0; } float thatPos = that.getPosition(); // please note: can't just subtract and cast to int here because of float precision loss if (m_position == thatPos) { if (m_position == Float.MAX_VALUE) { // if they both do not have any position, sort by title return m_title.compareTo((that).getTitle()); } return 0; } return (m_position < thatPos) ? -1 : 1; }
/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(Object that) { if (that == this) { return 0; } if (that instanceof CmsSite) { float thatPos = ((CmsSite)that).getPosition(); // please note: can't just subtract and cast to int here because of float precision loss if (m_position == thatPos) { if (m_position == Float.MAX_VALUE) { // if they both do not have any position, sort by title return m_title.compareTo(((CmsSite)that).getTitle()); } return 0; } return (m_position < thatPos) ? -1 : 1; } return 0; }
/** * 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); }
/** * 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); }
if (site != null) { relationName = relationName.substring(site.length()); siteName = OpenCms.getSiteManager().getSiteForSiteRoot(site).getTitle(); } else { siteName = "/";
if (site != null) { relationName = relationName.substring(site.length()); siteName = OpenCms.getSiteManager().getSiteForSiteRoot(site).getTitle(); } else { siteName = "/";
/** * Returns a clone of this Objects instance.<p> * * @return a clone of this instance */ @Override public Object clone() { return new CmsSite( getSiteRoot(), (CmsUUID)getSiteRootUUID().clone(), getTitle(), (CmsSiteMatcher)getSiteMatcher().clone(), String.valueOf(getPosition())); }
if (site != null) { relationName = relationName.substring(site.length()); siteName = OpenCms.getSiteManager().getSiteForSiteRoot(site).getTitle(); } else { siteName = "/";
if (site != null) { relationName = relationName.substring(site.length()); siteName = OpenCms.getSiteManager().getSiteForSiteRoot(site).getTitle(); } else { siteName = "/";
sites.add(new CmsSelectWidgetOption(siteRoot, selected, substituteSiteTitle(site.getTitle()), null));
CmsResource siteRes = clone.readResource(site.getSiteRoot()); if (CmsStringUtil.isEmptyOrWhitespaceOnly(site.getTitle())) { String title = clone.readPropertyObject( siteRes,
CmsSite site = (CmsSite)i.next(); values.add(site.getSiteRoot()); String curOption = site.getTitle(); if (showSiteUrls) {
site.getUrl(), site.getSiteRoot(), site.getTitle(), Float.toString(site.getPosition()), site.getErrorPage(),
/** * Returns a clone of this Objects instance.<p> * * @return a clone of this instance */ @Override public Object clone() { return new CmsSite( getSiteRoot(), (CmsUUID)getSiteRootUUID().clone(), getTitle(), (CmsSiteMatcher)getSiteMatcher().clone(), String.valueOf(getPosition()), getErrorPage(), getSecureServer(), isExclusiveUrl(), isExclusiveError(), isWebserver(), getAliases()); }
CmsSite site = i.next(); values.add(site.getSiteRoot()); String curOption = substituteSiteTitle(site.getTitle()); if (showSiteUrls && (site.getSiteMatcher() != null)) {
Type type = Type.site; String message = null; String title = site.getTitle(); if (!CmsStringUtil.isEmptyOrWhitespaceOnly(title)) { message = title;
String siteName = null; if (site != null) { siteName = site.getTitle(); } else { try {