Class DefaultLiveEditViewModel

java.lang.Object
de.hybris.platform.cmscockpit.components.liveedit.impl.DefaultLiveEditViewModel
All Implemented Interfaces:
LiveEditViewModel

public class DefaultLiveEditViewModel extends Object implements LiveEditViewModel
Default implementation of the LiveEditViewModel.
  • Field Details

  • Constructor Details

    • DefaultLiveEditViewModel

      public DefaultLiveEditViewModel()
  • Method Details

    • 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 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 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
    • getCMSAdminSiteService

      protected CMSAdminSiteService getCMSAdminSiteService()
    • getCMSPreviewService

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

      protected CMSSiteService getCMSSiteService()
    • getCurrentDataLanguageModel

      protected LanguageModel getCurrentDataLanguageModel()
    • getCurrentPreviewData

      public PreviewDataModel getCurrentPreviewData()
      Specified by:
      getCurrentPreviewData in interface LiveEditViewModel
    • getCurrentUrl

      public String getCurrentUrl()
      Specified by:
      getCurrentUrl in interface LiveEditViewModel
    • getI18NService

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

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

      public AbstractPageModel getPage()
      Specified by:
      getPage in interface LiveEditViewModel
    • getPreviewLoader

      public PreviewLoader getPreviewLoader()
    • getRestrictionService

      protected CMSAdminRestrictionService getRestrictionService()
    • getSite

      public CMSSiteModel getSite()
      Specified by:
      getSite in interface LiveEditViewModel
    • getSystemService

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

      public boolean isContentVisible()
    • isLiveEditModeEnabled

      public boolean isLiveEditModeEnabled()
      Specified by:
      isLiveEditModeEnabled in interface LiveEditViewModel
    • isPagePreview

      public boolean isPagePreview()
    • isPreviewDataValid

      public boolean isPreviewDataValid()
      Specified by:
      isPreviewDataValid in interface LiveEditViewModel
    • isSlotLockedForId

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

      public boolean isWelcomePanelVisible()
    • retriveCatalogVersions

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

      public void setContentVisible(boolean contentVisible)
    • setCurrentPreviewData

      public void setCurrentPreviewData(PreviewDataModel previewData)
      Specified by:
      setCurrentPreviewData in interface LiveEditViewModel
    • setCurrentUrl

      public void setCurrentUrl(String url)
      Specified by:
      setCurrentUrl in interface LiveEditViewModel
    • setLiveEditModeEnabled

      public void setLiveEditModeEnabled(boolean enabled)
      Specified by:
      setLiveEditModeEnabled in interface LiveEditViewModel
    • setPage

      public void setPage(AbstractPageModel page)
      Specified by:
      setPage in interface LiveEditViewModel
    • setPagePreview

      public void setPagePreview(boolean previewPage)
      Specified by:
      setPagePreview in interface LiveEditViewModel
    • setPreviewLoader

      public void setPreviewLoader(PreviewLoader previewLoader)
    • setSite

      public void setSite(CMSSiteModel site)
      Specified by:
      setSite in interface LiveEditViewModel
    • setWelcomePanelVisible

      public void setWelcomePanelVisible(boolean welcomePanelVisible)
    • getCurrentFrontendUser

      public UserModel getCurrentFrontendUser()
    • setCurrentFrontendUser

      public void setCurrentFrontendUser(UserModel currentFrontendUser)