docs: public CmsPublishList getRelatedResourcesToPublish(
          CmsRequestContext context,
          CmsPublishList publishList,
          CmsRelationFilter filter)
      throws CmsException {
  
          if (!publishList.isDirectPublish()) {
              throw new CmsIllegalArgumentException(
                  Messages.get().container(Messages.ERR_GET_RELATED_RESOURCES_PUBLISH_PROJECT_0));
          }
  
          CmsPublishList ret = null;
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              ret = m_driverManager.getRelatedResourcesToPublish(dbc, publishList, filter);
              checkPublishPermissions(dbc, ret);
          } catch (Exception e) {
              dbc.report(
                  null,
                  Messages.get().container(
                      Messages.ERR_GET_RELATED_RESOURCES_PUBLISH_DIRECT_1,
                      CmsFileUtil.formatResourceNames(context, publishList.getDirectPublishResources())),
                  e);
          } finally {
              dbc.clear();
          }
          return ret;
      }