code: public void removeResourceFromCategory(CmsObject cms, String resourceName, CmsCategory category)
      throws CmsException {
  
          // remove the resource just from this category
          CmsRelationFilter filter = CmsRelationFilter.TARGETS;
          filter = filter.filterType(CmsRelationType.CATEGORY);
          filter = filter.filterResource(
              cms.readResource(cms.getRequestContext().removeSiteRoot(category.getRootPath())));
          filter = filter.filterIncludeChildren();
          cms.deleteRelationsFromResource(resourceName, filter);
      }
docs: Removes a resource identified by the given resource name from the given category.<p>
  
  The resource has to be previously locked.<p>
  
  @param cms the current cms context
  @param resourceName the site relative path to the resource to remove
  @param category the category to remove the resource from
  
  @throws CmsException if something goes wrong