code: public void clearCategoriesForResource(CmsObject cms, String resourcePath) throws CmsException {
  
          CmsRelationFilter filter = CmsRelationFilter.TARGETS;
          filter = filter.filterType(CmsRelationType.CATEGORY);
          cms.deleteRelationsFromResource(resourcePath, filter);
      }
docs: Removes the given resource from all categories.<p>
  
  @param cms the cms context
  @param resourcePath the resource to reset the categories for
  
  @throws CmsException if something goes wrong