/** * Gets the template uri.<p> * * @return the template URI. */ public String getUri() { if (m_resource != null) { return m_resource.getRootPath(); } else { return m_uri; } }
/** * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ public int compare(Object o1, Object o2) { if ((o1 == o2) || !(o1 instanceof CmsResource) || !(o2 instanceof CmsResource)) { return 0; } CmsResource r1 = (CmsResource)o1; CmsResource r2 = (CmsResource)o2; return r1.getRootPath().compareToIgnoreCase(r2.getRootPath()); } };
/** * Displays the start resource by opening all nodes in the tree leading to it.<p> * * @param startResource the resource which should be shown in the tree */ public void showStartResource(CmsResource startResource) { openPath(startResource.getRootPath()); }
/** * Initializes the information about the resource from which this configuration was read.<p> * * @param configResource the configuration file */ public void setResource(CmsResource configResource) { m_structureId = configResource.getStructureId(); m_rootPath = configResource.getRootPath(); } }
/** * @see org.opencms.file.wrapper.I_CmsResourceWrapper#isWrappedResource(org.opencms.file.CmsObject, org.opencms.file.CmsResource) */ public boolean isWrappedResource(CmsObject cms, CmsResource res) { return CmsStringUtil.isPrefixPath(BASE_PATH, res.getRootPath()); }
/** * Creates a new relation object of the given type between the given resources.<p> * * @param source the source resource * @param target the target resource * @param type the relation type */ public CmsRelation(CmsResource source, CmsResource target, CmsRelationType type) { this(source.getStructureId(), source.getRootPath(), target.getStructureId(), target.getRootPath(), type); }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#restoreLink(org.opencms.file.CmsObject, java.lang.String) */ @Override public String restoreLink(CmsObject cms, String uri) { CmsResource res = findXmlPage(cms, uri); if (res != null) { return res.getRootPath(); } return null; }
/** * Creates a new relation object of the given type between the given resources.<p> * * @param source the source resource * @param target the target resource * @param type the relation type */ public CmsRelation(CmsResource source, CmsResource target, CmsRelationType type) { this(source.getStructureId(), source.getRootPath(), target.getStructureId(), target.getRootPath(), type); }
/** * @see org.opencms.cache.CmsVfsCache#uncacheResource(org.opencms.file.CmsResource) */ @Override protected void uncacheResource(CmsResource resource) { uncacheSystemId(resource.getRootPath()); }
/** * @see org.opencms.ade.configuration.I_CmsGlobalConfigurationCache#remove(org.opencms.file.CmsResource) */ public void remove(CmsResource resource) { checkIfUpdateIsNeeded(resource.getStructureId(), resource.getRootPath(), resource.getTypeId()); }
/** * @see org.opencms.ade.configuration.I_CmsGlobalConfigurationCache#update(org.opencms.file.CmsResource) */ public void update(CmsResource resource) { checkIfUpdateIsNeeded(resource.getStructureId(), resource.getRootPath(), resource.getTypeId()); }
/** * @see org.opencms.file.types.I_CmsResourceType#chtype(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, int) */ public void chtype(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, int type) throws CmsException { // change type securityManager.chtype(cms.getRequestContext(), resource, type); // type may have changed from non link parseable to link parseable createRelations(cms, securityManager, resource.getRootPath()); }
/** * @see org.opencms.ade.configuration.I_CmsGlobalConfigurationCache#remove(org.opencms.file.CmsResource) */ public void remove(CmsResource resource) { remove(resource.getStructureId(), resource.getRootPath(), resource.getTypeId()); }
/** * @see org.opencms.ade.configuration.I_CmsGlobalConfigurationCache#update(org.opencms.file.CmsResource) */ public void update(CmsResource resource) { update(resource.getStructureId(), resource.getRootPath(), resource.getTypeId(), resource.getState()); }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#rewriteLink(CmsObject, CmsResource) */ @Override public String rewriteLink(CmsObject cms, CmsResource res) { if (checkTypeId(res.getTypeId())) { return CmsResourceWrapperUtils.addFileExtension(cms, res.getRootPath(), getExtension()); } return null; }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#unlockResource(org.opencms.file.CmsObject, java.lang.String) */ @Override public boolean unlockResource(CmsObject cms, String resourcename) throws CmsException { CmsResource res = getResource(cms, resourcename, CmsResourceFilter.DEFAULT); if (res != null) { cms.unlockResource(cms.getRequestContext().removeSiteRoot(res.getRootPath())); return true; } return false; }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#lockResource(org.opencms.file.CmsObject, java.lang.String) */ @Override public boolean lockResource(CmsObject cms, String resourcename) throws CmsException { CmsResource res = getResource(cms, resourcename, CmsResourceFilter.DEFAULT); if (res != null) { cms.lockResource(cms.getRequestContext().removeSiteRoot(res.getRootPath())); return true; } return false; }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#unlockResource(org.opencms.file.CmsObject, java.lang.String) */ @Override public boolean unlockResource(CmsObject cms, String resourcename) throws CmsException { CmsResource res = findXmlPage(cms, resourcename); if (res != null) { cms.unlockResource(cms.getRequestContext().removeSiteRoot(res.getRootPath())); return true; } return false; }
/** The dialog mode. */ public static enum DialogMode { /** Allow copy only. */ copy, /** Allow copy and move. */ copy_and_move, /** Allow move only. */ move }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#getLock(org.opencms.file.CmsObject, org.opencms.file.CmsResource) */ @Override public CmsLock getLock(CmsObject cms, CmsResource resource) throws CmsException { if (checkTypeId(resource.getTypeId())) { CmsWrappedResource wrap = new CmsWrappedResource(resource); wrap.setRootPath(CmsResourceWrapperUtils.removeFileExtension(cms, resource.getRootPath(), getExtension())); return cms.getLock(wrap.getResource()); } return null; }