code: 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));
      }
docs: 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