Class LiveEditView<T extends LiveEditPopupEditDialog>
- java.lang.Object
-
- de.hybris.platform.cmscockpit.components.liveedit.LiveEditView<T>
-
public class LiveEditView<T extends LiveEditPopupEditDialog> extends java.lang.ObjectController of (live edit) preview of a site. Note:
We using this component for displaying a preview of particular web application within cmscockpit in following modes:- displaying preview of particular page in WCMS Page perspective
- displaying live edit session in Live Edit perspective
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLiveEditView.DesktopRefreshContentHandler
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCALLBACK_EVENTprotected static java.lang.StringLIVE_EDIT_BROWSER_SCLASSprotected static java.lang.StringON_INIT_EVENTprotected static java.lang.StringON_INVALIDATE_LATER_EVENTstatic java.lang.StringURL_CHANGE_EVENT
-
Constructor Summary
Constructors Constructor Description LiveEditView(DefaultLiveEditViewModel model)LiveEditView(DefaultLiveEditViewModel model, org.zkoss.zul.Div welcomePanel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddEventListeners()Adds all required events handling i.e: user special events init events invalidate eventprotected java.lang.StringextractRequestPath(java.lang.String longUrl)Extracts request path from long URL (request path with query search)org.zkoss.zul.IframegetContentFrame()Returns content frame component - for access it from outsideprotected org.zkoss.zk.ui.event.EventListenergetIniEventListener()Returns event listener for handling init eventsprotected org.zkoss.zk.ui.event.EventListenergetInvalidateListener()Returns event listener for handling invalidate eventsDefaultLiveEditViewModelgetModel()LiveEditPopupEditDialoggetPopupEditorDialog()protected org.zkoss.zk.ui.event.EventListenergetUserEventListener()Returns event listener for handling user eventsorg.zkoss.zk.ui.HtmlBasedComponentgetViewComponent()Returns the ZK component of the site preview.protected org.zkoss.zul.DivgetWelcomePanel()voidinitialize()Initialize live edit view (i.e.protected org.zkoss.zul.IframeinitializeContentFrame()Initialize live edit content iframeprotected org.zkoss.zul.DivinitializeViewComponent()Initialize the main view component for the live editprotected org.zkoss.zk.ui.HtmlBasedComponentloadWelcomePanel(org.zkoss.zk.ui.HtmlBasedComponent parent)Loads welcome panel if anyprotected voidrefreshContentFrame()protected voidrefreshWelcomePanel()Refreshes welcome panel when it is availablevoidsetPopupEditorDialog(T popupEditorDialog)voidsetWelcomePanel(org.zkoss.zul.Div welcomePanel)voidupdate()Performs general update.voidupdateItem(TypedObject item, java.util.Set<PropertyDescriptor> modifiedProperties, java.lang.Object reason)Performs update according to given item modifications
-
-
-
Field Detail
-
ON_INIT_EVENT
protected static final java.lang.String ON_INIT_EVENT
- See Also:
- Constant Field Values
-
CALLBACK_EVENT
public static final java.lang.String CALLBACK_EVENT
- See Also:
- Constant Field Values
-
URL_CHANGE_EVENT
public static final java.lang.String URL_CHANGE_EVENT
- See Also:
- Constant Field Values
-
LIVE_EDIT_BROWSER_SCLASS
protected static final java.lang.String LIVE_EDIT_BROWSER_SCLASS
- See Also:
- Constant Field Values
-
ON_INVALIDATE_LATER_EVENT
protected static final java.lang.String ON_INVALIDATE_LATER_EVENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LiveEditView
public LiveEditView(DefaultLiveEditViewModel model)
-
LiveEditView
public LiveEditView(DefaultLiveEditViewModel model, org.zkoss.zul.Div welcomePanel)
-
-
Method Detail
-
initialize
public void initialize()
Initialize live edit view (i.e. creates content frame, loads welcome panel - if any, send init event) Note:
Should be called after instantiation.
-
initializeViewComponent
protected org.zkoss.zul.Div initializeViewComponent()
Initialize the main view component for the live edit
-
initializeContentFrame
protected org.zkoss.zul.Iframe initializeContentFrame()
Initialize live edit content iframe
-
addEventListeners
protected void addEventListeners()
Adds all required events handling i.e:- user special events
- init events
- invalidate event
-
getViewComponent
public org.zkoss.zk.ui.HtmlBasedComponent getViewComponent()
Returns the ZK component of the site preview.- Returns:
- ZK component of the site preview
-
getContentFrame
public org.zkoss.zul.Iframe getContentFrame()
Returns content frame component - for access it from outside- Returns:
- content frame component
-
getModel
public DefaultLiveEditViewModel getModel()
-
setWelcomePanel
public void setWelcomePanel(org.zkoss.zul.Div welcomePanel)
-
getIniEventListener
protected org.zkoss.zk.ui.event.EventListener getIniEventListener()
Returns event listener for handling init events Note:
This is used for proper initialize live edit view - within preview mode we to update view in order to make content visible. When we are within preview mode thenLiveEditViewModel.getCurrentPreviewData()returnnull- Returns:
- instance of
EventListener - See Also:
ON_INIT_EVENT
-
getInvalidateListener
protected org.zkoss.zk.ui.event.EventListener getInvalidateListener()
Returns event listener for handling invalidate events Note:
This is used for invalidate frame content- Returns:
- instance of
EventListener - See Also:
ON_INVALIDATE_LATER_EVENT
-
getUserEventListener
protected org.zkoss.zk.ui.event.EventListener getUserEventListener()
Returns event listener for handling user events Note:
This is used for handling user events such like:- displaying popup dialog with proper content editors
- reacts when user change URL within content frame (this is used for keeping cmscockpit up-to-date with current URL from content frame)
- Returns:
- instance of
EventListener
-
refreshWelcomePanel
protected void refreshWelcomePanel()
Refreshes welcome panel when it is available Note:
This is disjoint with content frame i.e. when we displaying welcome page we also hide content frame at once and contrarywise
-
refreshContentFrame
protected void refreshContentFrame()
-
update
public void update()
Performs general update.
-
updateItem
public void updateItem(TypedObject item, java.util.Set<PropertyDescriptor> modifiedProperties, java.lang.Object reason)
Performs update according to given item modifications- Parameters:
item- modified itemmodifiedProperties- modified properties of the item
-
extractRequestPath
protected java.lang.String extractRequestPath(java.lang.String longUrl)
Extracts request path from long URL (request path with query search)- Parameters:
longUrl- request path with query search- Returns:
- extracted request path
-
loadWelcomePanel
protected org.zkoss.zk.ui.HtmlBasedComponent loadWelcomePanel(org.zkoss.zk.ui.HtmlBasedComponent parent)
Loads welcome panel if any- Parameters:
parent- parent component- Returns:
- current welcome panel component
-
getWelcomePanel
protected org.zkoss.zul.Div getWelcomePanel()
- Returns:
- the welcomePanel
-
getPopupEditorDialog
public LiveEditPopupEditDialog getPopupEditorDialog()
-
setPopupEditorDialog
public void setPopupEditorDialog(T popupEditorDialog)
-
-