/** * Creates a category from the given resource.<p> * * @param cms the cms context * @param resource the resource * * @return a category object * * @throws CmsException if something goes wrong */ public CmsCategory getCategory(CmsObject cms, CmsResource resource) throws CmsException { CmsProperty title = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_TITLE, false); CmsProperty description = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_DESCRIPTION, false); return new CmsCategory( resource.getStructureId(), resource.getRootPath(), title.getValue(resource.getName()), description.getValue(""), getRepositoryBaseFolderName(cms)); }
/** * Creates a category from the given resource.<p> * * @param cms the cms context * @param resource the resource * * @return a category object * * @throws CmsException if something goes wrong */ public CmsCategory getCategory(CmsObject cms, CmsResource resource) throws CmsException { CmsProperty title = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_TITLE, false); CmsProperty description = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_DESCRIPTION, false); return new CmsCategory( resource.getStructureId(), resource.getRootPath(), title.getValue(resource.getName()), description.getValue(""), getRepositoryBaseFolderName(cms)); }