org.opencms.staticexport
Class CmsAfterPublishStaticExportHandler

java.lang.Object
  extended byorg.opencms.staticexport.A_CmsStaticExportHandler
      extended byorg.opencms.staticexport.CmsAfterPublishStaticExportHandler
All Implemented Interfaces:
I_CmsStaticExportHandler

public class CmsAfterPublishStaticExportHandler
extends A_CmsStaticExportHandler
implements I_CmsStaticExportHandler

Implementation for the I_CmsStaticExportHandler interface.

This handler exports all changes immediately after something is published.

Since:
6.0.0
Version:
$Revision: 1.19 $
Author:
Michael Moossen
See Also:
I_CmsStaticExportHandler

Field Summary
 
Fields inherited from class org.opencms.staticexport.A_CmsStaticExportHandler
m_busy
 
Constructor Summary
CmsAfterPublishStaticExportHandler()
           
 
Method Summary
 void doExportAfterPublish(java.util.List resources, I_CmsReport report)
          Does the actual static export.
 java.util.List getAllResources(CmsObject cms)
          Gets all resources within the folder tree.
protected  java.util.List getRelatedFilesToPurge(java.lang.String exportFileName, java.lang.String vfsName)
          Returns a list of related files to purge.
 void performEventPublishProject(CmsUUID publishHistoryId, I_CmsReport report)
          Scrubs files from the export folder that might have been changed.
 
Methods inherited from class org.opencms.staticexport.A_CmsStaticExportHandler
getSiblingsList, isBusy, purgeFile, scrubExportFolders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opencms.staticexport.I_CmsStaticExportHandler
isBusy
 

Constructor Detail

CmsAfterPublishStaticExportHandler

public CmsAfterPublishStaticExportHandler()
Method Detail

doExportAfterPublish

public void doExportAfterPublish(java.util.List resources,
                                 I_CmsReport report)
                          throws CmsException,
                                 java.io.IOException,
                                 javax.servlet.ServletException
Does the actual static export.

Parameters:
resources - a list of CmsPublishedREsources to start the static export with
report - an I_CmsReport instance to print output message, or null to write messages to the log file
Throws:
CmsException - in case of errors accessing the VFS
java.io.IOException - in case of erros writing to the export output stream
javax.servlet.ServletException - in case of errors accessing the servlet

getAllResources

public java.util.List getAllResources(CmsObject cms)
                               throws CmsException
Gets all resources within the folder tree.

Since the long min and max value do not work with the sql timestamp function in the driver, we must calculate some different, but usable start and endtime values first.

Parameters:
cms - the cms context
Returns:
all resources within the folder tree
Throws:
CmsException - if something goes wrong

performEventPublishProject

public void performEventPublishProject(CmsUUID publishHistoryId,
                                       I_CmsReport report)
Description copied from interface: I_CmsStaticExportHandler
Scrubs files from the export folder that might have been changed.

Specified by:
performEventPublishProject in interface I_CmsStaticExportHandler
Specified by:
performEventPublishProject in class A_CmsStaticExportHandler
See Also:
I_CmsStaticExportHandler.performEventPublishProject(org.opencms.util.CmsUUID, org.opencms.report.I_CmsReport)

getRelatedFilesToPurge

protected java.util.List getRelatedFilesToPurge(java.lang.String exportFileName,
                                                java.lang.String vfsName)
Description copied from class: A_CmsStaticExportHandler
Returns a list of related files to purge.

Specified by:
getRelatedFilesToPurge in class A_CmsStaticExportHandler
Parameters:
exportFileName - the previous exported rfs filename (already purged)
vfsName - the vfs name of the resource (to be used to compute more sofisticated sets of related files to purge
Returns:
a list of related files to purge
See Also:
A_CmsStaticExportHandler.getRelatedFilesToPurge(java.lang.String, java.lang.String)