/** * Returns the current resource to be displayed in the explorer.<p> * * @return the current resource to be displayed in the explorer */ public String getExplorerResource() { // get the current explorer mode String mode = getExplorerMode(); if (mode == null) { mode = CmsWorkplace.VIEW_EXPLORER; } if (CmsWorkplace.VIEW_EXPLORER.equals(mode)) { // append the current site to the key when in explorer view mode mode += "_" + getSite() + "/"; } // get the resource for the given mode String resource = m_explorerResource.get(mode); if (resource == null) { resource = "/"; } return resource; }
/** * Returns the current resource to be displayed in the explorer.<p> * * @return the current resource to be displayed in the explorer */ public String getExplorerResource() { // get the current explorer mode String mode = getExplorerMode(); if (mode == null) { mode = CmsExplorer.VIEW_EXPLORER; } if (CmsExplorer.VIEW_EXPLORER.equals(mode)) { // append the current site to the key when in explorer view mode mode += "_" + getSite() + "/"; } // get the resource for the given mode String resource = (String)m_explorerResource.get(mode); if (resource == null) { resource = "/"; } return resource; }
mode += "_" + getSite() + "/";
mode += "_" + getSite() + "/";
/** * 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); }
/** * @see org.opencms.workplace.CmsWorkplace#initWorkplaceMembers(org.opencms.jsp.CmsJspActionElement) */ @Override protected void initWorkplaceMembers(CmsJspActionElement jsp) { String siteRoot = jsp.getRequestContext().getSiteRoot(); // In case of the upload applet the site stored in the user preferences must NOT be made the current // site even if we have a new session! Since the upload applet will create a new session for the upload itself, // we must make sure to use the site of the request, NOT the site stored in the user preferences. // The default logic will erase the request site in case of a new session. // With this workaround the site from the request is made the current site as required. super.initWorkplaceMembers(jsp); if (!siteRoot.equals(getSettings().getSite())) { getSettings().setSite(siteRoot); jsp.getRequestContext().setSiteRoot(siteRoot); } }
/** * @see org.opencms.workplace.CmsWorkplace#initWorkplaceMembers(org.opencms.jsp.CmsJspActionElement) */ @Override protected void initWorkplaceMembers(CmsJspActionElement jsp) { String siteRoot = jsp.getRequestContext().getSiteRoot(); // In case of the upload applet the site stored in the user preferences must NOT be made the current // site even if we have a new session! Since the upload applet will create a new session for the upload itself, // we must make sure to use the site of the request, NOT the site stored in the user preferences. // The default logic will erase the request site in case of a new session. // With this workaround the site from the request is made the current site as required. super.initWorkplaceMembers(jsp); if (!siteRoot.equals(getSettings().getSite())) { getSettings().setSite(siteRoot); jsp.getRequestContext().setSiteRoot(siteRoot); } }