Class LiveEditView<T extends LiveEditPopupEditDialog>


  • public class LiveEditView<T extends LiveEditPopupEditDialog>
    extends java.lang.Object
    Controller 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
    • Field Detail

      • 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
    • 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
        • 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 then LiveEditViewModel.getCurrentPreviewData() return null

          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 item
          modifiedProperties - 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
        • setPopupEditorDialog

          public void setPopupEditorDialog​(T popupEditorDialog)