Class DefaultLiveEditViewModel
- java.lang.Object
-
- de.hybris.platform.cmscockpit.components.liveedit.impl.DefaultLiveEditViewModel
-
- All Implemented Interfaces:
LiveEditViewModel
public class DefaultLiveEditViewModel extends java.lang.Object implements LiveEditViewModel
Default implementation of the LiveEditViewModel.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringEQUALS_MARKprotected static java.lang.StringQUESTION_MARKprotected static java.lang.StringSLASH_MARK
-
Constructor Summary
Constructors Constructor Description DefaultLiveEditViewModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearPreviewInformation()Invokes when current preview parameters are obsolete (i.e.java.lang.StringcomputeFinalUrl()Computes final URL for preview and live editjava.lang.StringextractUrlFromRequest()Extracts all necessary informations from current request and collects server informationprotected CMSAdminSiteServicegetCMSAdminSiteService()protected CMSPreviewServicegetCMSPreviewService()Retrieve CMSPreview Serviceprotected CMSSiteServicegetCMSSiteService()protected LanguageModelgetCurrentDataLanguageModel()UserModelgetCurrentFrontendUser()PreviewDataModelgetCurrentPreviewData()java.lang.StringgetCurrentUrl()protected I18NServicegetI18NService()Retrieves internationalization serviceprotected ModelServicegetModelService()Retrieves Model ServiceAbstractPageModelgetPage()PreviewLoadergetPreviewLoader()protected CMSAdminRestrictionServicegetRestrictionService()CMSSiteModelgetSite()protected SystemServicegetSystemService()Retrieves System servicebooleanisContentVisible()booleanisLiveEditModeEnabled()booleanisPagePreview()booleanisPreviewDataValid()booleanisSlotLockedForId(java.lang.String slotId)Returns if a given Slot is visible for current versionbooleanisWelcomePanelVisible()protected java.util.Set<CatalogVersionModel>retriveCatalogVersions()Retrieves catalog versions that will be stored in PreviewData objectvoidsetContentVisible(boolean contentVisible)voidsetCurrentFrontendUser(UserModel currentFrontendUser)voidsetCurrentPreviewData(PreviewDataModel previewData)voidsetCurrentUrl(java.lang.String url)voidsetLiveEditModeEnabled(boolean enabled)voidsetPage(AbstractPageModel page)voidsetPagePreview(boolean previewPage)voidsetPreviewLoader(PreviewLoader previewLoader)voidsetSite(CMSSiteModel site)voidsetWelcomePanelVisible(boolean welcomePanelVisible)
-
-
-
Field Detail
-
SLASH_MARK
protected static final java.lang.String SLASH_MARK
- See Also:
- Constant Field Values
-
QUESTION_MARK
protected static final java.lang.String QUESTION_MARK
- See Also:
- Constant Field Values
-
EQUALS_MARK
protected static final java.lang.String EQUALS_MARK
- See Also:
- Constant Field Values
-
-
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:
computeFinalUrlin interfaceLiveEditViewModel
-
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
-
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:
getCurrentPreviewDatain interfaceLiveEditViewModel
-
getCurrentUrl
public java.lang.String getCurrentUrl()
- Specified by:
getCurrentUrlin interfaceLiveEditViewModel
-
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:
getPagein interfaceLiveEditViewModel
-
getPreviewLoader
public PreviewLoader getPreviewLoader()
-
getRestrictionService
protected CMSAdminRestrictionService getRestrictionService()
-
getSite
public CMSSiteModel getSite()
- Specified by:
getSitein interfaceLiveEditViewModel
-
getSystemService
protected SystemService getSystemService()
Retrieves System service- Returns:
- System service
-
isContentVisible
public boolean isContentVisible()
-
isLiveEditModeEnabled
public boolean isLiveEditModeEnabled()
- Specified by:
isLiveEditModeEnabledin interfaceLiveEditViewModel
-
isPagePreview
public boolean isPagePreview()
-
isPreviewDataValid
public boolean isPreviewDataValid()
- Specified by:
isPreviewDataValidin interfaceLiveEditViewModel
-
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)
-
setCurrentPreviewData
public void setCurrentPreviewData(PreviewDataModel previewData)
- Specified by:
setCurrentPreviewDatain interfaceLiveEditViewModel
-
setCurrentUrl
public void setCurrentUrl(java.lang.String url)
- Specified by:
setCurrentUrlin interfaceLiveEditViewModel
-
setLiveEditModeEnabled
public void setLiveEditModeEnabled(boolean enabled)
- Specified by:
setLiveEditModeEnabledin interfaceLiveEditViewModel
-
setPage
public void setPage(AbstractPageModel page)
- Specified by:
setPagein interfaceLiveEditViewModel
-
setPagePreview
public void setPagePreview(boolean previewPage)
- Specified by:
setPagePreviewin interfaceLiveEditViewModel
-
setPreviewLoader
public void setPreviewLoader(PreviewLoader previewLoader)
-
setSite
public void setSite(CMSSiteModel site)
- Specified by:
setSitein interfaceLiveEditViewModel
-
setWelcomePanelVisible
public void setWelcomePanelVisible(boolean welcomePanelVisible)
-
getCurrentFrontendUser
public UserModel getCurrentFrontendUser()
-
setCurrentFrontendUser
public void setCurrentFrontendUser(UserModel currentFrontendUser)
-
-