code: protected void internalWriteHistory(
          CmsDbContext dbc,
          CmsResource resource,
          CmsResourceState state,
          List<CmsProperty> properties,
          CmsUUID publishHistoryId,
          int publishTag)
      throws CmsDataAccessException {
  
          try {
              if (OpenCms.getSystemInfo().isHistoryEnabled()) {
                  // write the resource to the historical archive
                  if (properties == null) {
                      properties = m_driverManager.getVfsDriver(dbc).readPropertyObjects(
                          dbc,
                          dbc.currentProject(),
                          resource);
                  }
                  m_driverManager.getHistoryDriver(dbc).writeResource(dbc, resource, properties, publishTag);
              }
              // write the resource to the publish history
              m_driverManager.getProjectDriver(dbc).writePublishHistory(
                  dbc,
                  publishHistoryId,
                  new CmsPublishedResource(resource, publishTag, state));
          } catch (CmsDataAccessException e) {
              if (LOG.isErrorEnabled()) {
                  LOG.error(
                      Messages.get().getBundle().key(Messages.LOG_WRITING_PUBLISHING_HISTORY_1, resource.getRootPath()),
                      e);
              }
              throw e;
          }
      }
docs: Writes the needed history entries.<p>
  
  @param dbc the current database context
  @param resource the offline resource
  @param state the state to store in the publish history entry
  @param properties the offline properties
  @param publishHistoryId the current publish process id
  @param publishTag the current publish process tag
  
  @throws CmsDataAccessException if something goes wrong