Interface CMSPreviewService
- All Known Implementing Classes:
DefaultCMSPreviewService
public interface CMSPreviewService
Service which provides preview and live edit functionality.
Responsible for managing preview data such as creating, validating and storing preview tickets and preview contexts.
- Spring Bean ID:
- cmsPreviewService
-
Method Summary
Modifier and TypeMethodDescriptionclonePreviewData(PreviewDataModel original) Clones givenPreviewDataModelcreatePreviewTicket(PreviewDataModel previewData) Creates a newCMSPreviewTicketModelwith a unique ID, which contains the passed preview context,previewData.getEditableCatalogs(CMSSiteModel cmsSiteModel, CatalogVersionModel activeCatalogVersion) Retrieves all editable catalogs for current siteReturns a object generated from the preview ticket stored in the session.Returns a object from the preview ticket's data stored in the session.getPreviewTicket(String ticketId) Returns the preview ticket with IDticketId.booleanChecks if we are in preview mode for a versioned page by checking the presence of a cmsTicketId in session and a in theCMSPreviewTicketModel.Persists the suppliedCMSPreviewTicketModelticket.
-
Method Details
-
createPreviewTicket
Creates a newCMSPreviewTicketModelwith a unique ID, which contains the passed preview context,previewData. Note: Preview tickets are only valid for a limited period of time and the returned ticket will be automatically removed once no longer valid.- Parameters:
previewData- the preview context for the ticket- Returns:
- newly created preview ticket with the supplied context
- See Also:
-
getPreviewTicket
Returns the preview ticket with IDticketId.- Parameters:
ticketId- unique ID of the ticket- Returns:
- the ticket with ID
ticketIdornullif no ticket with that ID is available - See Also:
-
storePreviewTicket
Persists the suppliedCMSPreviewTicketModelticket. Note: Storing a preview ticket will not extend its remaining life time.- Parameters:
ticket- the preview ticket to persist- Returns:
- the id of the stored ticket
- See Also:
-
clonePreviewData
Clones givenPreviewDataModelNote:- Parameters:
original- currentPreviewDataModel- Returns:
- cloned
PreviewDataModel
-
getEditableCatalogs
Collection<CatalogModel> getEditableCatalogs(CMSSiteModel cmsSiteModel, CatalogVersionModel activeCatalogVersion) Retrieves all editable catalogs for current site Note:
Catalog versions from those catalog can be edited within live edit mode in CMSCockpit- Parameters:
cmsSiteModel- current CMS SiteactiveCatalogVersion- current Content Catalog Version- Returns:
- catalog list that contains catalog versions which can be changed in live edit session
-
getPagePreviewCriteria
PagePreviewCriteriaData getPagePreviewCriteria()Returns a object generated from the preview ticket stored in the session. -
isVersioningPreview
boolean isVersioningPreview()Checks if we are in preview mode for a versioned page by checking the presence of a cmsTicketId in session and a in theCMSPreviewTicketModel.- Returns:
- true if in preview mode with a version
-
getPreviewContentCatalogVersion
CatalogVersionModel getPreviewContentCatalogVersion()Returns a object from the preview ticket's data stored in the session.
-