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 ofDeployer
that interacts with the Preview Deployer in Authoring. ThisDeployer
:- 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
-
-
Field Summary
-
Fields inherited from class org.craftercms.studio.impl.v2.deployment.AbstractDeployer
restTemplate, studioConfiguration
-
-
Constructor Summary
Constructors Constructor Description PreviewDeployer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createTargets(String site)
Calls a Crafter Deployer to create any necessary targets for the site.void
deleteTargets(String site)
Deletes the targets associated with the site.protected void
doCreateAuthTarget(String site)
protected void
doCreatePreviewTarget(String site)
protected void
doDeployment(String site, String environment, boolean waitTillDone)
protected void
doPreviewSync(String siteId, boolean waitTillDone)
protected String
getCreateTargetUrl()
protected String
getDeleteTargetUrl(String site, String environment)
protected String
getDeployTargetUrl(String site, String environment)
void
onContentChange(ContentEvent event)
void
onRepositorySyncComplete(RepositoryEvent event)
void
onSiteCreateComplete(SiteEvent event)
-
Methods inherited from class org.craftercms.studio.impl.v2.deployment.AbstractDeployer
addAdditionalParams, addChildParams, doCreateTarget, doDeleteTarget, getCreateTargetRequestBody, getRepoUrl, setStudioConfiguration
-
-
-
-
Method Detail
-
onSiteCreateComplete
@EventListener public void onSiteCreateComplete(SiteEvent 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
-
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
-
getCreateTargetUrl
protected String getCreateTargetUrl()
- Specified by:
getCreateTargetUrl
in classAbstractDeployer
-
getDeleteTargetUrl
protected String getDeleteTargetUrl(String site, String environment)
- Specified by:
getDeleteTargetUrl
in classAbstractDeployer
-
-