Class DefaultLiveEditViewModel

  • All Implemented Interfaces:
    LiveEditViewModel

    public class DefaultLiveEditViewModel
    extends java.lang.Object
    implements LiveEditViewModel
    Default implementation of the LiveEditViewModel.
    • Constructor Detail

      • DefaultLiveEditViewModel

        public DefaultLiveEditViewModel()
    • Method Detail

      • clearPreviewInformation

        public void clearPreviewInformation()
        Invokes when current preview parameters are obsolete (i.e. active CMSSite was changed, active catalogVersion was changed)

        Note:
        This prevents URL and preview data caching when preview parameters was changed.

      • computeFinalUrl

        public java.lang.String computeFinalUrl()
        Computes final URL for preview and live edit

        Note:
        This method produces a URL in order to trigger that is responsible for getting a proper page

        Specified by:
        computeFinalUrl in interface LiveEditViewModel
      • extractUrlFromRequest

        public java.lang.String extractUrlFromRequest()
        Extracts all necessary informations from current request and collects server information

        Note:
        Constructs absolute preview URL when current is relative.

        Returns:
        absolute preview URL
      • getCMSPreviewService

        protected CMSPreviewService getCMSPreviewService()
        Retrieve CMSPreview Service
        Returns:
        CMSPreview Service
      • getCurrentDataLanguageModel

        protected LanguageModel getCurrentDataLanguageModel()
      • getI18NService

        protected I18NService getI18NService()
        Retrieves internationalization service
        Returns:
        internationalization service
      • getModelService

        protected ModelService getModelService()
        Retrieves Model Service
        Returns:
        Model Service
      • getSystemService

        protected SystemService getSystemService()
        Retrieves System service
        Returns:
        System service
      • isContentVisible

        public boolean isContentVisible()
      • isPagePreview

        public boolean isPagePreview()
      • isSlotLockedForId

        public boolean isSlotLockedForId​(java.lang.String slotId)
        Returns if a given Slot is visible for current version
        Returns:
        boolean
      • isWelcomePanelVisible

        public boolean isWelcomePanelVisible()
      • retriveCatalogVersions

        protected java.util.Set<CatalogVersionModel> retriveCatalogVersions()
        Retrieves catalog versions that will be stored in PreviewData object
        Returns:
        current catalog versions
      • setContentVisible

        public void setContentVisible​(boolean contentVisible)
      • setPreviewLoader

        public void setPreviewLoader​(PreviewLoader previewLoader)
      • setWelcomePanelVisible

        public void setWelcomePanelVisible​(boolean welcomePanelVisible)
      • getCurrentFrontendUser

        public UserModel getCurrentFrontendUser()
      • setCurrentFrontendUser

        public void setCurrentFrontendUser​(UserModel currentFrontendUser)