/** * @see org.opencms.repository.I_CmsRepositorySession#getItem(java.lang.String) */ public I_CmsRepositoryItem getItem(String path) throws CmsException { path = validatePath(path); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_READ_ITEM_1, path)); } CmsResource res = m_cms.readResource(path, CmsResourceFilter.DEFAULT); CmsRepositoryItem item = new CmsRepositoryItem(res, m_cms); return item; }
/** * @see org.opencms.repository.I_CmsRepositorySession#getItem(java.lang.String) */ public I_CmsRepositoryItem getItem(String path) throws CmsException { path = validatePath(path); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_READ_ITEM_1, path)); } CmsResource res = m_cms.readResource(path, CmsResourceFilter.DEFAULT); CmsRepositoryItem item = new CmsRepositoryItem(res, m_cms); return item; }
/** * @see org.opencms.repository.I_CmsRepositorySession#list(java.lang.String) */ public List list(String path) throws CmsException { List ret = new ArrayList(); path = validatePath(path); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_LIST_ITEMS_1, path)); } List resources = m_cms.getResourcesInFolder(path, CmsResourceFilter.DEFAULT); Iterator iter = resources.iterator(); while (iter.hasNext()) { CmsResource res = (CmsResource)iter.next(); if (!isFiltered(m_cms.getRequestContext().removeSiteRoot(res.getRootPath()))) { // open the original resource (for virtual files this is the resource in the VFS // which the virtual resource is based on) // this filters e.g. property files for resources that are filtered out and thus // should not be displayed CmsResource org = m_cms.readResource(res.getStructureId(), CmsResourceFilter.DEFAULT); if (!isFiltered(m_cms.getRequestContext().removeSiteRoot(org.getRootPath()))) { ret.add(new CmsRepositoryItem(res, m_cms)); } } } if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_LIST_ITEMS_SUCESS_1, new Integer(ret.size()))); } return ret; }
/** * @see org.opencms.repository.I_CmsRepositorySession#list(java.lang.String) */ public List<I_CmsRepositoryItem> list(String path) throws CmsException { List<I_CmsRepositoryItem> ret = new ArrayList<I_CmsRepositoryItem>(); path = validatePath(path); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_LIST_ITEMS_1, path)); } List<CmsResource> resources = m_cms.getResourcesInFolder(path, CmsResourceFilter.DEFAULT); Iterator<CmsResource> iter = resources.iterator(); while (iter.hasNext()) { CmsResource res = iter.next(); if (!isFiltered(m_cms.getRequestContext().removeSiteRoot(res.getRootPath()))) { // open the original resource (for virtual files this is the resource in the VFS // which the virtual resource is based on) // this filters e.g. property files for resources that are filtered out and thus // should not be displayed CmsResource org = m_cms.readResource(res.getStructureId(), CmsResourceFilter.DEFAULT); if (!isFiltered(m_cms.getRequestContext().removeSiteRoot(org.getRootPath()))) { ret.add(new CmsRepositoryItem(res, m_cms)); } } } if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_LIST_ITEMS_SUCESS_1, new Integer(ret.size()))); } return ret; }