Class PreviewDeployer

java.lang.Object
org.craftercms.studio.impl.v2.deployment.AbstractDeployer
org.craftercms.studio.impl.v2.deployment.PreviewDeployer
All Implemented Interfaces:
Deployer

public class PreviewDeployer extends AbstractDeployer
Implementation of Deployer that interacts with the Preview Deployer in Authoring. This Deployer:
  • Creates both and authoring and preview target on create
  • Deletes the authoring and preview target on delete
  • Issues deployments to the authoring and preview target on a preview sync event
Author:
avasquez
  • Constructor Details

  • Method Details

    • onSiteCreateComplete

      @EventListener public void onSiteCreateComplete(SiteReadyEvent event)
    • onRepositorySyncComplete

      @Order(20) @EventListener public void onRepositorySyncComplete(RepositoryEvent event)
    • onContentChange

      @EventListener public void onContentChange(ContentEvent event)
    • doPreviewSync

      protected void doPreviewSync(String siteId, boolean waitTillDone)
    • createTargets

      public void createTargets(String site) throws org.springframework.web.client.RestClientException
      Description copied from interface: Deployer
      Calls a Crafter Deployer to create any necessary targets for the site.
      Parameters:
      site - the site
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs
    • deleteTargets

      public void deleteTargets(String site) throws org.springframework.web.client.RestClientException
      Description copied from interface: Deployer
      Deletes the targets associated with the site.
      Parameters:
      site - the site
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs
    • doDeployment

      protected void doDeployment(String site, String environment, boolean waitTillDone)
    • doCreateAuthTarget

      protected void doCreateAuthTarget(String site) throws IllegalStateException, org.springframework.web.client.RestClientException
      Throws:
      IllegalStateException
      org.springframework.web.client.RestClientException
    • doCreatePreviewTarget

      protected void doCreatePreviewTarget(String site) throws IllegalStateException, org.springframework.web.client.RestClientException
      Throws:
      IllegalStateException
      org.springframework.web.client.RestClientException
    • getDeployTargetUrl

      protected String getDeployTargetUrl(String site, String environment)
    • getCreateTargetUrl

      protected String getCreateTargetUrl()
      Specified by:
      getCreateTargetUrl in class AbstractDeployer
    • getDeleteTargetUrl

      protected String getDeleteTargetUrl(String site, String environment)
      Specified by:
      getDeleteTargetUrl in class AbstractDeployer
    • duplicateTargets

      public void duplicateTargets(String sourceSiteId, String siteId) throws org.springframework.web.client.RestClientException
      Description copied from interface: Deployer
      Call Crafter Deployer API to duplicate the site targets
      Parameters:
      sourceSiteId - the site to duplicate from
      siteId - the new site id
      Throws:
      org.springframework.web.client.RestClientException - if an error occurs while calling Deployer API