/** * Adds the current site root of this context to the given resource name, * and also translates the resource name with the configured the directory translator.<p> * * @param resourcename the resource name * @return the translated resource name including site root * @see #addSiteRoot(String, String) */ public String addSiteRoot(String resourcename) { return addSiteRoot(m_siteRoot, resourcename); }
/** * Returns this request contexts uri extended with the current site root path.<p> * * @return this request contexts uri extended with the current site root path * * @see #getUri() * @see #addSiteRoot(String) */ public String getRootUri() { return addSiteRoot(m_siteRoot, m_uri); }
/** * Convenience method to add the site root from the current user's * request context to the given resource name.<p> * * @param resourcename the resource name * * @return the resource name with the site root added * * @see CmsRequestContext#addSiteRoot(String) */ private String addSiteRoot(String resourcename) { return m_context.addSiteRoot(resourcename); }
/** * Adds the current site root of this context to the given resource name, * and also translates the resource name with the configured the directory translator.<p> * * @param resourcename the resource name * @return the translated resource name including site root * @see #addSiteRoot(String, String) */ public String addSiteRoot(String resourcename) { return addSiteRoot(m_siteRoot, resourcename); }
/** * Convenience method to add the site root from the current user's * request context to the given resource name.<p> * * @param resourcename the resource name * * @return the resource name with the site root added * * @see CmsRequestContext#addSiteRoot(String) */ public String addSiteRoot(String resourcename) { return m_context.addSiteRoot(resourcename); }
/** * Returns the uri.<p> * * @return the uri */ public String getUri() { return m_context.addSiteRoot(m_context.getUri()); }
/** * Returns the full element URI site root path to the resource currently processed.<p> * * @return the name of the resource currently processed */ public String getElementRootPath() { return m_controller.getCmsObject().getRequestContext().addSiteRoot(m_elementUriSiteRoot, m_elementUri); }
/** * Returns the uri.<p> * * @return the uri */ public String getUri() { String uri = m_context.addSiteRoot(m_context.getUri()); if (m_detailViewId != null) { uri += m_detailViewId.toString() + "/"; } return uri; }
/** * Returns the full element URI site root path to the resource currently processed.<p> * * @return the name of the resource currently processed */ public String getElementRootPath() { return m_controller.getCmsObject().getRequestContext().addSiteRoot(m_elementUriSiteRoot, m_elementUri); }
/** * @see org.opencms.file.types.I_CmsResourceType#copyResource(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, java.lang.String, CmsResource.CmsResourceCopyMode) */ public void copyResource( CmsObject cms, CmsSecurityManager securityManager, CmsResource source, String destination, CmsResource.CmsResourceCopyMode siblingMode) throws CmsException { securityManager.copyResource( cms.getRequestContext(), source, cms.getRequestContext().addSiteRoot(destination), siblingMode); // create the relations for the new resource, this could be improved by an sql query for copying relations createRelations(cms, securityManager, cms.getRequestContext().addSiteRoot(destination)); }
/** * Adds the site root to the path name and checks then if the path * is filtered.<p> * * @see org.opencms.repository.A_CmsRepositorySession#isFiltered(java.lang.String) */ @Override protected boolean isFiltered(String name) { boolean ret = super.isFiltered(m_cms.getRequestContext().addSiteRoot(name)); if (ret) { if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.ERR_ITEM_FILTERED_1, name)); } } return ret; }
/** * Adds the site root to the path name and checks then if the path * is filtered.<p> * * @see org.opencms.repository.A_CmsRepositorySession#isFiltered(java.lang.String) */ @Override protected boolean isFiltered(String name) { boolean ret = super.isFiltered(m_cms.getRequestContext().addSiteRoot(name)); if (ret) { if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.ERR_ITEM_FILTERED_1, name)); } } return ret; }
/** * Finds the entry point to a sitemap.<p> * * @param cms the CMS context * @param openPath the resource path to find the sitemap to * * @return the sitemap entry point */ public String findEntryPoint(CmsObject cms, String openPath) { CmsADEConfigData configData = lookupConfiguration(cms, openPath); String result = configData.getBasePath(); if (result == null) { return cms.getRequestContext().addSiteRoot("/"); } return result; }
/** * @see org.opencms.ade.sitemap.shared.rpc.I_CmsSitemapService#getNewElementInfo(java.lang.String) */ public List<CmsNewResourceInfo> getNewElementInfo(String entryPointUri) throws CmsRpcException { try { CmsObject cms = getCmsObject(); String rootPath = cms.getRequestContext().addSiteRoot(entryPointUri); CmsADEConfigData config = OpenCms.getADEManager().lookupConfiguration(cms, rootPath); List<CmsNewResourceInfo> result = getNewResourceInfos(cms, config, getWorkplaceLocale()); return result; } catch (Throwable e) { error(e); return null; } }
/** * @see org.opencms.ade.containerpage.shared.rpc.I_CmsContainerpageService#saveFavoriteList(java.util.List, java.lang.String) */ public void saveFavoriteList(List<String> clientIds, String uri) throws CmsRpcException { try { ensureSession(); OpenCms.getADEManager().saveFavoriteList( getCmsObject(), getCachedElements(clientIds, getCmsObject().getRequestContext().addSiteRoot(uri))); } catch (Throwable e) { error(e); } }
/** * @see org.opencms.ade.containerpage.shared.rpc.I_CmsContainerpageService#saveRecentList(java.util.List, java.lang.String) */ public void saveRecentList(List<String> clientIds, String uri) throws CmsRpcException { try { ensureSession(); OpenCms.getADEManager().saveRecentList( getCmsObject(), getCachedElements(clientIds, getCmsObject().getRequestContext().addSiteRoot(uri))); } catch (Throwable e) { error(e); } }
/** * Default constructor.<p> * * @param jsp an initialized JSP action element */ public CmsShowSiblingsList(CmsJspActionElement jsp) { super(jsp, LIST_ID, Messages.get().container(Messages.GUI_SHOW_SIBLINGS_LIST_NAME_0)); // set the right resource util parameters CmsResourceUtil resUtil = getResourceUtil(); resUtil.setAbbrevLength(50); resUtil.setRelativeTo(getCms().getRequestContext().addSiteRoot(jsp.getRequestContext().getFolderUri())); resUtil.setSiteMode(CmsResourceUtil.SITE_MODE_MATCHING); }
/** * Default constructor.<p> * * @param jsp an initialized JSP action element */ public CmsShowSiblingsList(CmsJspActionElement jsp) { super(jsp, LIST_ID, Messages.get().container(Messages.GUI_SHOW_SIBLINGS_LIST_NAME_0)); // set the right resource util parameters CmsResourceUtil resUtil = getResourceUtil(); resUtil.setAbbrevLength(50); resUtil.setRelativeTo(getCms().getRequestContext().addSiteRoot(jsp.getRequestContext().getFolderUri())); resUtil.setSiteMode(CmsResourceUtil.SITE_MODE_MATCHING); }
/** * Public constructor.<p> * * @param jsp an initialized JSP action element * @param relativeTo the 'relative to' path, this only affects the generation of the path for the resource */ public CmsPublishBrokenRelationsList(CmsJspActionElement jsp, String relativeTo) { super(jsp, LIST_ID, Messages.get().container(Messages.GUI_PUBLISH_BROKENRELATIONS_LIST_NAME_0)); // prevent paging getList().setMaxItemsPerPage(Integer.MAX_VALUE); // set the right resource util parameters CmsResourceUtil resUtil = getResourceUtil(); resUtil.setAbbrevLength(50); resUtil.setRelativeTo(getCms().getRequestContext().addSiteRoot(relativeTo)); resUtil.setSiteMode(CmsResourceUtil.SITE_MODE_MATCHING); }
/** * @see org.opencms.ui.actions.I_CmsWorkplaceAction#executeAction(org.opencms.ui.I_CmsDialogContext) */ public void executeAction(final I_CmsDialogContext context) { CmsObject cms = context.getCms(); String initPath = CmsQuickLaunchLocationCache.getLocationCache( A_CmsUI.get().getHttpSession()).getFileExplorerLocation(cms.getRequestContext().getSiteRoot()); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(initPath)) { initPath = cms.getRequestContext().addSiteRoot(initPath); } else { initPath = CmsFileUtil.addTrailingSeparator(cms.getRequestContext().getSiteRoot()); } String link = CmsWorkplace.getWorkplaceExplorerLink(cms, initPath); A_CmsUI.get().openPageOrWarn(link, WORKPLACE_WINDOW_NAME); }