@Service public class WebCmsEndpointServiceImpl extends Object implements WebCmsEndpointService
| Constructor and Description |
|---|
WebCmsEndpointServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.web.util.UriComponentsBuilder |
appendPreviewCode(WebCmsEndpoint endpoint,
org.springframework.web.util.UriComponentsBuilder uriComponentsBuilder) |
Optional<WebCmsUrl> |
getPrimaryUrlForAsset(WebCmsAsset asset)
Get the primary URL for a
WebCmsAsset on the current domain. |
Optional<WebCmsUrl> |
getPrimaryUrlForAssetOnDomain(WebCmsAsset asset,
WebCmsDomain domain)
Get the primary URL for a
WebCmsAsset on the specified domain. |
Optional<WebCmsUrl> |
getUrlForPath(String path)
Retrieve the
WebCmsUrl corresponding to a particular path. |
Optional<WebCmsUrl> |
getUrlForPathAndDomain(String path,
WebCmsDomain domain)
Retrieve the
WebCmsUrl corresponding to a particular path on a specific domain. |
boolean |
isValidPreviewCode(WebCmsEndpoint endpoint,
String securityCode)
Check if a particular security code allows access to an endpoint.
|
ModificationReport<EndpointModificationType,WebCmsUrl> |
updateOrCreatePrimaryUrlForAsset(String primaryUrl,
WebCmsAsset asset,
boolean publishEventOnFailure)
Update the primary URL for a
WebCmsAsset. |
public Optional<WebCmsUrl> getUrlForPath(String path)
WebCmsEndpointServiceWebCmsUrl corresponding to a particular path.
Will use the current WebCmsDomainContext to perform the lookup.getUrlForPath in interface WebCmsEndpointServicepath - to find the url forpublic Optional<WebCmsUrl> getUrlForPathAndDomain(String path, WebCmsDomain domain)
WebCmsEndpointServiceWebCmsUrl corresponding to a particular path on a specific domain.getUrlForPathAndDomain in interface WebCmsEndpointServicepath - to find the url fordomain - to look on@Transactional public ModificationReport<EndpointModificationType,WebCmsUrl> updateOrCreatePrimaryUrlForAsset(String primaryUrl, WebCmsAsset asset, boolean publishEventOnFailure)
WebCmsEndpointServiceWebCmsAsset. Depending on the published status of the asset
will either create or update the existing primary url, or will update the previous primary url
as a redirect to the new primary url.
Note that if there is no single WebCmsAssetEndpoint
for the asset, this method will do nothing. The ModificationReport returned should contain the
status information on which action was performed. A ModificationStatus.FAILED
means another endpoint already has that url.
The third parameter indicates if a PrimaryUrlForAssetFailedEvent should
be published in case of a conflict with another endpoint. This allows another bean to take action and change the modification report.updateOrCreatePrimaryUrlForAsset in interface WebCmsEndpointServiceprimaryUrl - for the assetasset - to updatepublishEventOnFailure - true if an even@Transactional(readOnly=true) public Optional<WebCmsUrl> getPrimaryUrlForAsset(WebCmsAsset asset)
WebCmsEndpointServiceWebCmsAsset on the current domain.getPrimaryUrlForAsset in interface WebCmsEndpointServiceasset - to get the primary url for@Transactional(readOnly=true) public Optional<WebCmsUrl> getPrimaryUrlForAssetOnDomain(WebCmsAsset asset, WebCmsDomain domain)
WebCmsEndpointServiceWebCmsAsset on the specified domain.getPrimaryUrlForAssetOnDomain in interface WebCmsEndpointServiceasset - to get the primary url fordomain - to get the primary url onpublic org.springframework.web.util.UriComponentsBuilder appendPreviewCode(WebCmsEndpoint endpoint, org.springframework.web.util.UriComponentsBuilder uriComponentsBuilder)
appendPreviewCode in interface WebCmsEndpointServicepublic boolean isValidPreviewCode(WebCmsEndpoint endpoint, String securityCode)
WebCmsEndpointServiceisValidPreviewCode in interface WebCmsEndpointServiceendpoint - to accesssecurityCode - that was usedCopyright © 2020. All rights reserved.