Class CmsAfterPublishStaticExportHandler

    • Method Detail

      • doExportAfterPublish

        public void doExportAfterPublish​(java.util.List<CmsPublishedResource> 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 errors writing to the export output stream
        javax.servlet.ServletException - in case of errors accessing the servlet
      • exportAfterPublish

        protected void exportAfterPublish​(CmsUUID publishHistoryId,
                                          I_CmsReport report)
                                   throws CmsException,
                                          java.io.IOException,
                                          javax.servlet.ServletException
        Starts the static export on publish.

        Exports all modified resources after a publish process into the real FS.

        Parameters:
        publishHistoryId - the publichHistoryId of the published project
        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 errors writing to the export output stream
        javax.servlet.ServletException - in case of errors accessing the servlet
      • exportNonTemplateResources

        protected boolean exportNonTemplateResources​(CmsObject cms,
                                                     java.util.List<CmsPublishedResource> publishedResources,
                                                     I_CmsReport report)
                                              throws CmsException,
                                                     java.io.IOException,
                                                     javax.servlet.ServletException
        Exports all non template resources found in a list of published resources.

        Parameters:
        cms - the current cms object
        publishedResources - the list of published resources
        report - an I_CmsReport instance to print output message, or null to write messages to the log file
        Returns:
        true if some template resources were found while looping the list of published resources
        Throws:
        CmsException - in case of errors accessing the VFS
        java.io.IOException - in case of errors writing to the export output stream
        javax.servlet.ServletException - in case of errors accessing the servlet
      • exportTemplateResource

        protected int exportTemplateResource​(CmsStaticExportData data,
                                             java.lang.StringBuffer cookies)
                                      throws java.io.IOException
        Exports a single (template) resource specified by its export data.

        Parameters:
        data - the export data
        cookies - cookies to keep the session
        Returns:
        the status of the http request used to perform the export
        Throws:
        java.io.IOException - if the http request fails
      • exportTemplateResources

        protected void exportTemplateResources​(CmsObject cms,
                                               java.util.List<java.lang.String> publishedTemplateResources,
                                               I_CmsReport report)
        Exports all template resources found in a list of published resources.

        Parameters:
        cms - the cms context, in the root site as Export user
        publishedTemplateResources - list of potential candidates to export
        report - an I_CmsReport instance to print output message, or null to write messages to the log file
      • getRelatedResources

        protected java.util.List<CmsPublishedResourcegetRelatedResources​(CmsObject cms,
                                                                           java.util.List<CmsPublishedResource> publishedResources)
                                                                    throws CmsException
        Creates a list of CmsPublishedResource objects containing all related resources of the VFS tree.

        If the static export has been triggered by the OpenCms workplace, publishedResources is null and all resources in the VFS tree are returned.

        If really an after publish static export is triggered, then only the related resources are returned.

        Parameters:
        cms - the current cms object
        publishedResources - the list of published resources
        Returns:
        list of CmsPulishedResource objects containing all resources of the VFS tree
        Throws:
        CmsException - in case of errors accessing the VFS
      • readNonTemplateResourcesToExport

        protected boolean readNonTemplateResourcesToExport​(CmsObject cms,
                                                           java.util.List<CmsPublishedResource> publishedResources,
                                                           java.util.List<CmsStaticExportData> resourcesToExport)
                                                    throws CmsException
        Returns all non template resources found in a list of published resources.

        Parameters:
        cms - the current cms object
        publishedResources - the list of published resources
        resourcesToExport - the list of non-template resources
        Returns:
        true if some template resources were found while looping the list of published resources
        Throws:
        CmsException - in case of errors accessing the VFS