/** * Returns the detail content site path, or <code>null</code> if not available.<p> * * @return the detail content site path */ public String getDetailContentSitePath() { return ((m_cms == null) || (m_detailContentResource == null)) ? null : m_cms.getSitePath(m_detailContentResource); }
/** * Delegate method for {@link CmsObject#getSitePath(CmsResource)}.<p> * * @see CmsObject#getSitePath(org.opencms.file.CmsResource) * * @param resource the resource to get the adjusted site root path for * * @return the absolute resource path adjusted for the current site */ public String getSitePath(CmsResource resource) { return m_cms.getSitePath(resource); }
/** * Gets the jsp site path for this dynamic function format.<p> * * @return the jsp site path for this dynamic function format */ public String getJsp() { if (m_jspResource != null) { return m_cms.getSitePath(m_jspResource); } return ""; }
/** * Delegate method for {@link CmsObject#getSitePath(CmsResource)}.<p> * * @see CmsObject#getSitePath(org.opencms.file.CmsResource) * * @param resource the resource to get the adjusted site root path for * * @return the absolute resource path adjusted for the current site */ public String getSitePath(CmsResource resource) { return m_cms.getSitePath(resource); }
/** * Checks whether the given resource has any children.<p> * * @param cms the CMS context * @param resource the resource to check * * @return true if the resource has children * * @throws CmsException if something goes wrong */ public static boolean hasChildren(CmsObject cms, CmsResource resource) throws CmsException { return !cms.getResourcesInFolder(cms.getSitePath(resource), CmsResourceFilter.ALL).isEmpty(); }
/** * Gets the locale to use for the given resource.<p> * * @param resource the resource * @param propertyList the properties of the resource * * @return the locale to use for the given resource */ private Locale getLocale(CmsResource resource, List<CmsProperty> propertyList) { return OpenCms.getLocaleManager().getDefaultLocale(m_guestCms, m_guestCms.getSitePath(resource)); }
/** * Returns the path to the configuration file for the current uri.<p> * * @return the path to the configuration file for the current uri */ public String getConfigPath() { if (m_config != null) { return getCmsObject().getSitePath(m_config.getFile()); } return null; }
/** * @see org.opencms.gwt.shared.rpc.I_CmsVfsService#getSitePath(org.opencms.util.CmsUUID) */ public String getSitePath(CmsUUID structureId) { try { CmsResource resource = getCmsObject().readResource(structureId, CmsResourceFilter.IGNORE_EXPIRATION); return getCmsObject().getSitePath(resource); } catch (CmsException e) { if (LOG.isWarnEnabled()) { LOG.warn(e.getMessageContainer(), e); } } return null; }
/** * @see org.opencms.ui.dialogs.permissions.CmsPermissionView.PermissionChangeHandler#setPermissions(java.lang.String, java.lang.String, int, int, int) */ public void setPermissions(String principalType, String principalName, int allowed, int denied, int flags) { try { ensureLock(); m_cms.chacc(m_cms.getSitePath(m_resource), principalType, principalName, allowed, denied, flags); } catch (CmsException e) { m_context.error(e); } }
/** * @see org.opencms.xml.A_CmsXmlDocument#getLinkProcessor(org.opencms.file.CmsObject, org.opencms.staticexport.CmsLinkTable) */ public CmsLinkProcessor getLinkProcessor(CmsObject cms, CmsLinkTable linkTable) { // initialize link processor String relativeRoot = null; if ((!m_allowRelativeLinks) && (m_file != null)) { relativeRoot = CmsResource.getParentFolder(cms.getSitePath(m_file)); } return new CmsLinkProcessor(cms, linkTable, getEncoding(), relativeRoot); }
/** * @see org.opencms.xml.A_CmsXmlDocument#getLinkProcessor(org.opencms.file.CmsObject, org.opencms.staticexport.CmsLinkTable) */ public CmsLinkProcessor getLinkProcessor(CmsObject cms, CmsLinkTable linkTable) { // initialize link processor String relativeRoot = null; if (m_file != null) { relativeRoot = CmsResource.getParentFolder(cms.getSitePath(m_file)); } return new CmsLinkProcessor(cms, linkTable, getEncoding(), relativeRoot); }
/** * @see org.opencms.xml.A_CmsXmlDocument#getLinkProcessor(org.opencms.file.CmsObject, org.opencms.staticexport.CmsLinkTable) */ public CmsLinkProcessor getLinkProcessor(CmsObject cms, CmsLinkTable linkTable) { // initialize link processor String relativeRoot = null; if (m_file != null) { relativeRoot = CmsResource.getParentFolder(cms.getSitePath(m_file)); } return new CmsLinkProcessor(cms, linkTable, getEncoding(), relativeRoot); }
/** * @see org.opencms.xml.A_CmsXmlDocument#getLinkProcessor(org.opencms.file.CmsObject, org.opencms.staticexport.CmsLinkTable) */ public CmsLinkProcessor getLinkProcessor(CmsObject cms, CmsLinkTable linkTable) { // initialize link processor String relativeRoot = null; if ((!m_allowRelativeLinks) && (m_file != null)) { relativeRoot = CmsResource.getParentFolder(cms.getSitePath(m_file)); } return new CmsLinkProcessor(cms, linkTable, getEncoding(), relativeRoot); }
/** * @see org.opencms.loader.I_CmsResourceLoader#load(org.opencms.file.CmsObject, org.opencms.file.CmsResource, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ public void load(CmsObject cms, CmsResource resource, HttpServletRequest req, HttpServletResponse res) throws CmsException { getController(cms, resource, req, res, false, true); OpenCms.getADEManager().handleHtmlRedirect(cms, req, res, cms.getSitePath(resource)); CmsFlexController.removeController(req); }
/** * @see org.opencms.ui.dialogs.permissions.CmsPermissionView.PermissionChangeHandler#deletePermissionSet(java.lang.String, java.lang.String) */ public void deletePermissionSet(String principalType, String principalName) { try { ensureLock(); m_cms.rmacc(m_cms.getSitePath(m_resource), principalType, principalName); refreshOwnEntries(); } catch (CmsException e) { m_context.error(e); } }
/** * Helper method for locking a resource which returns some information on whether the locking * failed, and why.<p> * * @param structureId the structure id of the resource * @return the locking information * * @throws CmsException if something went wrong */ protected CmsLockInfo getLock(CmsUUID structureId) throws CmsException { CmsResource res = getCmsObject().readResource(structureId, CmsResourceFilter.IGNORE_EXPIRATION); return getLock(getCmsObject().getSitePath(res)); }
/** * Submits the dialog.<p> */ void submit() { CmsResource target = m_context.getResources().get(0); String resPath = m_context.getCms().getSitePath(target); try { m_context.getCms().copyResourceToProject(resPath); m_context.finish(Collections.singletonList(target.getStructureId())); } catch (CmsException e) { m_context.error(e); } } }
/** * @see org.opencms.file.types.I_CmsResourceType#chtype(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, int) */ @Override public void chtype(CmsObject cms, CmsSecurityManager securityManager, CmsResource filename, int newType) throws CmsException, CmsDataNotImplementedException { if (!OpenCms.getResourceManager().getResourceType(newType).isFolder()) { // it is not possible to change the type of a folder to a file type throw new CmsDataNotImplementedException( Messages.get().container(Messages.ERR_CHTYPE_FOLDER_1, cms.getSitePath(filename))); } super.chtype(cms, securityManager, filename, newType); }
/** * @see org.opencms.file.types.I_CmsResourceType#chtype(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, int) */ @Override public void chtype(CmsObject cms, CmsSecurityManager securityManager, CmsResource filename, int newType) throws CmsException, CmsDataNotImplementedException { if (!OpenCms.getResourceManager().getResourceType(newType).isFolder()) { // it is not possible to change the type of a folder to a file type throw new CmsDataNotImplementedException(Messages.get().container( Messages.ERR_CHTYPE_FOLDER_1, cms.getSitePath(filename))); } super.chtype(cms, securityManager, filename, newType); }
/** * @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()); } }