code: public CmsPublishList fillPublishList(CmsRequestContext context, CmsPublishList publishList) throws CmsException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              m_driverManager.fillPublishList(dbc, publishList);
              checkPublishPermissions(dbc, publishList);
          } catch (CmsTooManyPublishResourcesException e) {
              throw e;
          } catch (Exception e) {
              if (publishList.isDirectPublish()) {
                  dbc.report(
                      null,
                      Messages.get().container(
                          Messages.ERR_GET_PUBLISH_LIST_DIRECT_1,
                          CmsFileUtil.formatResourceNames(context, publishList.getDirectPublishResources())),
                      e);
              } else {
                  dbc.report(
                      null,
                      Messages.get().container(
                          Messages.ERR_GET_PUBLISH_LIST_PROJECT_1,
                          context.getCurrentProject().getName()),
                      e);
              }
          } finally {
              dbc.clear();
          }
          return publishList;
      }
docs: Fills the given publish list with the the VFS resources that actually get published.<p>
  
  Please refer to the source code of this method for the rules on how to decide whether a
  new/changed/deleted <code>{@link CmsResource}</code> object can be published or not.<p>
  
  @param context the current request context
  @param publishList must be initialized with basic publish information (Project or direct publish operation)
  
  @return the given publish list filled with all new/changed/deleted files from the current (offline) project
  that will be published actually
  
  @throws CmsException if something goes wrong
  
  @see org.opencms.db.CmsPublishList