/** * Reads the categories for a resource.<p> * * @param cms the current cms context * @param resource the resource to get the categories for * * @return the categories list * * @throws CmsException if something goes wrong */ public List<CmsCategory> readResourceCategories(CmsObject cms, CmsResource resource) throws CmsException { return internalReadResourceCategories(cms, resource, false); }
/** * Repairs broken category relations.<p> * * This could be caused by renaming/moving a category folder, * or changing the category repositories base folder name.<p> * * Also repairs problems when creating/deleting conflicting * category folders across several repositories.<p> * * The resource has to be previously locked.<p> * * @param cms the cms context * @param resource the resource to repair * * @throws CmsException if something goes wrong */ public void repairRelations(CmsObject cms, CmsResource resource) throws CmsException { internalReadResourceCategories(cms, resource, true); }
/** * Repairs broken category relations.<p> * * This could be caused by renaming/moving a category folder, * or changing the category repositories base folder name.<p> * * Also repairs problems when creating/deleting conflicting * category folders across several repositories.<p> * * The resource has to be previously locked.<p> * * @param cms the cms context * @param resource the resource to repair * * @throws CmsException if something goes wrong */ public void repairRelations(CmsObject cms, CmsResource resource) throws CmsException { internalReadResourceCategories(cms, resource, true); }
/** * Reads the categories for a resource identified by the given resource name.<p> * * @param cms the current cms context * @param resourceName the path of the resource to get the categories for * * @return the categories list * * @throws CmsException if something goes wrong */ public List readResourceCategories(CmsObject cms, String resourceName) throws CmsException { return internalReadResourceCategories(cms, cms.readResource(resourceName), false); }
/** * Reads the categories for a resource identified by the given resource name.<p> * * @param cms the current cms context * @param resourceName the path of the resource to get the categories for * * @return the categories list * * @throws CmsException if something goes wrong */ public List<CmsCategory> readResourceCategories(CmsObject cms, String resourceName) throws CmsException { return internalReadResourceCategories(cms, cms.readResource(resourceName), false); }