Interface DocumentView

All Superinterfaces:
Cloneable, org.zkoss.zk.ui.Component, EventChild, EventChildHandler, LogEventChildHandler, org.zkoss.zk.ui.ext.Scope, Serializable
All Known Implementing Classes:
AbstractDocumentView, DocumentViewImpl, SapDocumentViewImpl

public interface DocumentView extends org.zkoss.zk.ui.Component, EventChild, EventChildHandler
Represents a viewer in a form.
  • Field Details

    • EDIT_WINDOW_PREFIX

      static final String EDIT_WINDOW_PREFIX
      Prefix of IDs of a popup-window in edit mode.
      See Also:
    • NO_EXTERNAL_WINDOW

      static final String NO_EXTERNAL_WINDOW
      Constant that defines that the viewer-implementation has no external window.
      See Also:
  • Method Details

    • openDocument

      void openDocument(DocumentId documentId, List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements, int element)
      Opens the specified url and displays the document.
      Parameters:
      documentId - the document's id
      element - document element
      documentElements - the document's elements (sub documents)
    • openDocument

      void openDocument(DocumentId documentId, List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements, int element, boolean currentRevision)
      Opens the specified url and displays the document.
      Parameters:
      documentId - the document's id
      element - document element
      documentElements - the document's elements (sub documents)
      currentRevision - whether to resolve the current revision or not
    • openSubDocument

      void openSubDocument()
      Opens a sub document structure.
    • openTemporaryDocument

      void openTemporaryDocument(TemporaryDocumentId documentId)
      Opens a temporary document. The document must be contained in the temporary document cache. A TemporaryDocumentId can be obtained by using TemporaryDocumentPreviewService to cache the document.
      Parameters:
      documentId - ID of the temporary document
    • onLogon

      void onLogon(org.zkoss.zk.ui.event.Event event)
      Event handler for logon event. The viewer will be enabled if the logon was successful.
      Parameters:
      event - ZK event
    • disable

      void disable()
      Disables the viewer.
    • enable

      void enable()
      Enables the viewer.
    • refreshView

      void refreshView()
      Refreshes the view with the last opened document.
    • reset

      void reset(boolean showInitImage)
      Closes the current document.
      Parameters:
      showInitImage - true, shows an initialization image (if supported by the viewer-component in use)
    • reset

      void reset()
      Closes the current document.
    • onDisplayResultItem

      void onDisplayResultItem(org.zkoss.zk.ui.event.Event event)
      Display document.
      Parameters:
      event - Event
    • onResetGui

      void onResetGui(org.zkoss.zk.ui.event.Event event)
      Handler for reset ui event.
      Parameters:
      event - ZK event
    • setPropertiesFileName

      void setPropertiesFileName(String filename)
      Sets the name of a properties file for the internal viewer component. Optional parameter.
      Parameters:
      filename - the new properties file name
    • getPropertiesFileName

      String getPropertiesFileName()
      Gets the properties file name.
      Returns:
      the properties file name
    • hasOpenChanges

      boolean hasOpenChanges()
      Check open changes in viewer.
      Returns:
      True, if open changes
    • getStructureList

      StructureList<?> getStructureList()
      Gets the structure list.
      Returns:
      the structure list
    • getParentForm

      IntelligentFormView getParentForm()
      Gets the parent form of this DocumentView.
      Returns:
      the parent form
    • setEnableLoadingMessage

      void setEnableLoadingMessage(boolean enable)
      Enables or disables the loading message that will be shown when the viewer is initiated. Note that not all viewer-components support showing a loading-message.
      Parameters:
      enable - enabled or disabled
    • isEnableLoadingMessage

      boolean isEnableLoadingMessage()
      Returns:
      true if loading message is enabled
    • setViewerClass

      void setViewerClass(String clazz)
      Sets the class-name of the contained viewer-component.
      Parameters:
      clazz - the class-name of the viewer-component
    • getViewerClass

      String getViewerClass()
      Gets the class-name of the contained viewer-component.
      Returns:
      the class-name of the contained viewer-component.
    • isStructureButtonsBoxShown

      boolean isStructureButtonsBoxShown()
      Tells you if the structure buttons of the structure view are shown or not. Default is true.
      Returns:
      True if structure buttons and its surrounding structure button box of structure view are shown, false else.
    • setStructureButtonsBoxShown

      void setStructureButtonsBoxShown(boolean showStructureButtonsBox)
      Set the visibility of the its structure button box and its containingn structure buttons of the structure view.
      Parameters:
      showStructureButtonsBox - Removes the structure buttons and its surrounding structure button box if it is set to false and shows the buttons if it is set to true.
    • handleLinkElement

      void handleLinkElement(DocumentArchiveMetaInfo.ElementArchiveMetaInfo linkElement)
      Handles the viewing of a linked element. How this is done is up to the implementation of the DocumentView component. The default-implementation opens a popup window to show the document.
      Parameters:
      linkElement - the linked element to view
    • setStructureEnabled

      void setStructureEnabled(boolean enabled)
      Enables or disables the structure view.
      Parameters:
      enabled - enabled/disabled
    • isStructureEnabled

      boolean isStructureEnabled()
      Returns:
      true if structure view is enabled
    • canModifyDocument

      boolean canModifyDocument()
      Checks if the ViewerComponent used by this viewer can modify documents.
      Returns:
      can edit documents
    • canShowRevisions

      boolean canShowRevisions()
      Checks if the ViewerComponent used by this viewer can show the document revisions.
      Returns:
      true or false